includes/clientside/sbedit.js
changeset 80 cb7dde69c301
parent 1 fe660c52c48f
child 190 e858bacb5cfa
equal deleted inserted replaced
79:5faff33a6580 80:cb7dde69c301
    58         id = blockEdit_current[0];
    58         id = blockEdit_current[0];
    59         oElm = blockEdit_current[1];
    59         oElm = blockEdit_current[1];
    60         var thediv = document.createElement('div');
    60         var thediv = document.createElement('div');
    61         //if(!oElm.id) oElm.id = 'autoEditButton_'+Math.floor(Math.random() * 100000);
    61         //if(!oElm.id) oElm.id = 'autoEditButton_'+Math.floor(Math.random() * 100000);
    62         oElm = oElm.parentNode;
    62         oElm = oElm.parentNode;
    63         o = fetch_offset(oElm);
    63         var magic = $(oElm).Top() + $(oElm).Height();
    64         d = fetch_dimensions(oElm);
    64         var top = String(magic);
    65         top = o['top'] + d['h'] + 'px';
    65         top = top + 'px';
    66         left = o['left'] + 'px';
    66         left = $(oElm).Left() + 'px';
    67         thediv.style.top = top;
    67         thediv.style.top = top;
    68         thediv.style.left = left;
    68         thediv.style.left = left;
    69         thediv.style.position = 'absolute';
    69         thediv.style.position = 'absolute';
    70         thediv.className = 'mdg-comment';
    70         thediv.className = 'mdg-comment';
    71         thediv.style.margin = '0';
    71         thediv.style.margin = '0';
   105         id   = blockSave_current[0];
   105         id   = blockSave_current[0];
   106         oElm = blockSave_current[1];
   106         oElm = blockSave_current[1];
   107         eval(ajax.responseText);
   107         eval(ajax.responseText);
   108         if(status == 'GOOD')
   108         if(status == 'GOOD')
   109         {
   109         {
   110           parent = document.getElementById('disabled_'+id).parentNode.parentNode;
   110           var _id = 'disabled_' + String(id);
       
   111           var parent = document.getElementById(_id).parentNode.parentNode;
   111           oElm.parentNode.parentNode.removeChild(oElm.parentNode);
   112           oElm.parentNode.parentNode.removeChild(oElm.parentNode);
   112           content = content.replace('%a', unescape('%0A'));
   113           content = content.replace('%a', unescape('%0A'));
   113           parent.firstChild.nextSibling.nextSibling.nextSibling.innerHTML = content; // $content is set in ajax.responseText
   114           var obj = ( IE ) ? parent.firstChild.nextSibling.nextSibling : parent.firstChild.nextSibling.nextSibling.nextSibling;
       
   115           if ( obj )
       
   116             obj.innerHTML = content; // $content is set in ajax.responseText
   114         }
   117         }
   115         else
   118         else
   116         {
   119         {
   117           alert(status);
   120           alert(status);
   118         }
   121         }