includes/clientside/static/editor.js
changeset 827 2c20563245b2
parent 823 4596c40aaa94
child 832 7152ca0a0ce9
equal deleted inserted replaced
826:dcf5381ce8ba 827:2c20563245b2
    16   selectButtonMinor('edit');
    16   selectButtonMinor('edit');
    17   selectButtonMajor('article');
    17   selectButtonMajor('article');
    18   setAjaxLoading();
    18   setAjaxLoading();
    19   
    19   
    20   var rev_id_uri = ( revid ) ? '&revid=' + revid : '';
    20   var rev_id_uri = ( revid ) ? '&revid=' + revid : '';
    21   ajaxGet(stdAjaxPrefix + '&_mode=getsource' + rev_id_uri, function()
    21   ajaxGet(stdAjaxPrefix + '&_mode=getsource' + rev_id_uri, function(ajax)
    22     {
    22     {
    23       if ( ajax.readyState == 4 && ajax.status == 200 )
    23       if ( ajax.readyState == 4 && ajax.status == 200 )
    24       {
    24       {
    25         unsetAjaxLoading();
    25         unsetAjaxLoading();
    26         
    26         
   579     json_packet.captcha_code = captcha_field.value;
   579     json_packet.captcha_code = captcha_field.value;
   580     json_packet.captcha_id = captcha_field.getAttribute('enano:captcha_hash');
   580     json_packet.captcha_id = captcha_field.getAttribute('enano:captcha_hash');
   581   }
   581   }
   582   
   582   
   583   json_packet = ajaxEscape(toJSONString(json_packet));
   583   json_packet = ajaxEscape(toJSONString(json_packet));
   584   ajaxPost(stdAjaxPrefix + '&_mode=savepage_json', 'r=' + json_packet, function()
   584   ajaxPost(stdAjaxPrefix + '&_mode=savepage_json', 'r=' + json_packet, function(ajax)
   585     {
   585     {
   586       if ( ajax.readyState == 4 && ajax.status == 200 )
   586       if ( ajax.readyState == 4 && ajax.status == 200 )
   587       {
   587       {
   588         ajaxUnSetEditorLoading();
   588         ajaxUnSetEditorLoading();
   589         var response = String(ajax.responseText + '');
   589         var response = String(ajax.responseText + '');
   667             setAjaxLoading();
   667             setAjaxLoading();
   668             editor_open = false;
   668             editor_open = false;
   669             editor_save_lock = false;
   669             editor_save_lock = false;
   670             enableUnload();
   670             enableUnload();
   671             changeOpac(0, 'ajaxEditContainer');
   671             changeOpac(0, 'ajaxEditContainer');
   672             ajaxGet(stdAjaxPrefix + '&_mode=getpage&noheaders', function()
   672             ajaxGet(stdAjaxPrefix + '&_mode=getpage&noheaders', function(ajax)
   673               {
   673               {
   674                 if ( ajax.readyState == 4 && ajax.status == 200 )
   674                 if ( ajax.readyState == 4 && ajax.status == 200 )
   675                 {
   675                 {
   676                   unsetAjaxLoading();
   676                   unsetAjaxLoading();
   677                   selectButtonMajor('article');
   677                   selectButtonMajor('article');
   734   ta_content = ajaxEscape(ta_content);
   734   ta_content = ajaxEscape(ta_content);
   735   if ( $dynano('enano_editor_preview').object.innerHTML != '' )
   735   if ( $dynano('enano_editor_preview').object.innerHTML != '' )
   736   {
   736   {
   737     opacity('enano_editor_preview', 100, 0, 500);
   737     opacity('enano_editor_preview', 100, 0, 500);
   738   }
   738   }
   739   ajaxPost(stdAjaxPrefix + '&_mode=preview', 'text=' + ta_content, function()
   739   ajaxPost(stdAjaxPrefix + '&_mode=preview', 'text=' + ta_content, function(ajax)
   740     {
   740     {
   741       if ( ajax.readyState == 4 && ajax.status == 200 )
   741       if ( ajax.readyState == 4 && ajax.status == 200 )
   742       {
   742       {
   743         ajaxUnSetEditorLoading();
   743         ajaxUnSetEditorLoading();
   744         changeOpac(0, 'enano_editor_preview');
   744         changeOpac(0, 'enano_editor_preview');
   759 }
   759 }
   760 
   760 
   761 window.ajaxEditorRevertToLatestReal = function()
   761 window.ajaxEditorRevertToLatestReal = function()
   762 {
   762 {
   763   ajaxSetEditorLoading();
   763   ajaxSetEditorLoading();
   764   ajaxGet(stdAjaxPrefix + '&_mode=getsource', function()
   764   ajaxGet(stdAjaxPrefix + '&_mode=getsource', function(ajax)
   765     {
   765     {
   766       if ( ajax.readyState == 4 && ajax.status == 200 )
   766       if ( ajax.readyState == 4 && ajax.status == 200 )
   767       {
   767       {
   768         ajaxUnSetEditorLoading();
   768         ajaxUnSetEditorLoading();
   769         
   769         
   801   ta_content = ajaxEscape(ta_content);
   801   ta_content = ajaxEscape(ta_content);
   802   if ( $dynano('enano_editor_preview').object.innerHTML != '' )
   802   if ( $dynano('enano_editor_preview').object.innerHTML != '' )
   803   {
   803   {
   804     opacity('enano_editor_preview', 100, 0, 500);
   804     opacity('enano_editor_preview', 100, 0, 500);
   805   }
   805   }
   806   ajaxPost(stdAjaxPrefix + '&_mode=diff_cur', 'text=' + ta_content, function()
   806   ajaxPost(stdAjaxPrefix + '&_mode=diff_cur', 'text=' + ta_content, function(ajax)
   807     {
   807     {
   808       if ( ajax.readyState == 4 && ajax.status == 200 )
   808       if ( ajax.readyState == 4 && ajax.status == 200 )
   809       {
   809       {
   810         ajaxUnSetEditorLoading();
   810         ajaxUnSetEditorLoading();
   811         changeOpac(0, 'enano_editor_preview');
   811         changeOpac(0, 'enano_editor_preview');
   980 {
   980 {
   981   var aed = document.getElementById('ajaxEditArea');
   981   var aed = document.getElementById('ajaxEditArea');
   982   if ( !aed )
   982   if ( !aed )
   983     return false;
   983     return false;
   984   ajaxSetEditorLoading();
   984   ajaxSetEditorLoading();
   985   ajaxGet(stdAjaxPrefix + '&_mode=getsource&get_draft=1', function()
   985   ajaxGet(stdAjaxPrefix + '&_mode=getsource&get_draft=1', function(ajax)
   986     {
   986     {
   987       if ( ajax.readyState == 4 && ajax.status == 200 )
   987       if ( ajax.readyState == 4 && ajax.status == 200 )
   988       {
   988       {
   989         ajaxUnSetEditorLoading();
   989         ajaxUnSetEditorLoading();
   990         
   990