includes/clientside/sbedit.js
changeset 365 cc6bf4d63684
parent 202 88d7a7c2743c
child 407 35d94240a197
equal deleted inserted replaced
364:390eb356cd49 365:cc6bf4d63684
    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';
    72         if(ajax.responseText == 'HOUSTON_WE_HAVE_A_PLUGIN')
    72         if(ajax.responseText == 'HOUSTON_WE_HAVE_A_PLUGIN')
    73         {
    73         {
    74           thediv.innerHTML = '<h3>This block cannot be edited.</h3><p>This is a plugin block, and cannot be edited.</p><p><a href="#" onclick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); return false;">close</a></p>';
    74           thediv.innerHTML = '<h3>' + $lang.get('sbedit_msg_cant_edit_plugin_title') + '</h3><p>' + $lang.get('sbedit_msg_cant_edit_plugin_body', { close_link: 'a href="#" onclick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); return false;"' }) + '</p>';
    75         }
    75         }
    76         else
    76         else
    77         {
    77         {
    78           ta = document.createElement('textarea');
    78           ta = document.createElement('textarea');
    79           ta.rows = '15';
    79           ta.rows = '15';
    80           ta.cols = '50';
    80           ta.cols = '50';
    81           ta.innerHTML = ajax.responseText;
    81           ta.innerHTML = ajax.responseText;
    82           thediv.appendChild(ta);
    82           thediv.appendChild(ta);
    83           b = document.createElement('br');
    83           b = document.createElement('br');
    84           thediv.appendChild(b);
    84           thediv.appendChild(b);
    85           thediv.innerHTML += '<a href="#" onclick="ajaxSaveBlock(this, \''+id+'\'); return false;">save</a>  |  <a href="#" onclick="if(confirm(\'Do you really want to discard your changes?\')) this.parentNode.parentNode.removeChild(this.parentNode); return false;">cancel</a>';
    85           thediv.innerHTML += '<a href="#" onclick="ajaxSaveBlock(this, \''+id+'\'); return false;">' + $lang.get('sbedit_btn_edit_save') + '</a>  |  <a href="#" onclick="if(confirm(\'' + $lang.get('sbedit_msg_discard_confirm') + '\')) this.parentNode.parentNode.removeChild(this.parentNode); return false;">' + $lang.get('sbedit_btn_edit_cancel') + '</a>';
    86         }
    86         }
    87         body = document.getElementsByTagName('body');
    87         body = document.getElementsByTagName('body');
    88         body = body[0];
    88         body = body[0];
    89         body.appendChild(thediv);
    89         body.appendChild(thediv);
    90       }
    90       }