includes/clientside/static/editor.js
changeset 404 fb4f9e6f378f
parent 399 a3a9e463c62f
child 405 adb7f8de8ce1
equal deleted inserted replaced
403:2c9745b5c09d 404:fb4f9e6f378f
   110   //
   110   //
   111   
   111   
   112   var heading = document.createElement('h3');
   112   var heading = document.createElement('h3');
   113   heading.style.cssFloat = 'left';
   113   heading.style.cssFloat = 'left';
   114   heading.style.styleFloat = 'left';
   114   heading.style.styleFloat = 'left';
       
   115   heading.style.marginTop = '0px';
       
   116   heading.style.marginBottom = '0px';
   115   heading.appendChild(document.createTextNode($lang.get('editor_msg_editor_heading')));
   117   heading.appendChild(document.createTextNode($lang.get('editor_msg_editor_heading')));
   116   
   118   
   117   // Plaintext/wikitext toggler
   119   // Plaintext/wikitext toggler
   118   // Only build the editor if using TinyMCE is allowed. THIS IS WEAK
   120   // Only build the editor if using TinyMCE is allowed. THIS IS WEAK
   119   // AND CANNOT BE MADE ANY STRONGER.
   121   // AND CANNOT BE MADE ANY STRONGER.
   120   
   122   
   121   if ( allow_wysiwyg )
   123   if ( allow_wysiwyg )
   122   {
   124   {
   123     var toggler = document.createElement('p');
   125     var toggler = document.createElement('p');
   124     toggler.style.marginLeft = '0';
   126     toggler.style.marginLeft = '0';
   125     toggler.style.cssFloat = 'right';
   127     toggler.style.textAlign = 'right';
   126     toggler.style.styleFloat = 'right';
       
   127     toggler.style.paddingTop = '4pt';
       
   128     
   128     
   129     var span_wiki = document.createElement('span');
   129     var span_wiki = document.createElement('span');
   130     var span_mce  = document.createElement('span');
   130     var span_mce  = document.createElement('span');
   131     span_wiki.id  = 'enano_edit_btn_pt';
   131     span_wiki.id  = 'enano_edit_btn_pt';
   132     span_mce.id   = 'enano_edit_btn_mce';
   132     span_mce.id   = 'enano_edit_btn_mce';
   165   }
   165   }
   166   
   166   
   167   // Form (to allow submits from MCE to trigger a real save)
   167   // Form (to allow submits from MCE to trigger a real save)
   168   var form = document.createElement('form');
   168   var form = document.createElement('form');
   169   form.action = 'javascript:void(0);';
   169   form.action = 'javascript:void(0);';
   170   form.style.clear = 'both';
       
   171   form.onsubmit = function()
   170   form.onsubmit = function()
   172   {
   171   {
   173     ajaxEditorSave();
   172     ajaxEditorSave();
   174     return false;
   173     return false;
   175   }
   174   }
   178   var preview_anchor = document.createElement('a');
   177   var preview_anchor = document.createElement('a');
   179   preview_anchor.name = 'ajax_preview';
   178   preview_anchor.name = 'ajax_preview';
   180   preview_anchor.id = 'ajax_preview';
   179   preview_anchor.id = 'ajax_preview';
   181   var preview_container = document.createElement('div');
   180   var preview_container = document.createElement('div');
   182   preview_container.id = 'enano_editor_preview';
   181   preview_container.id = 'enano_editor_preview';
   183   preview_container.style.clear = 'both';
   182   preview_container.style.clear = 'left';
   184   
   183   
   185   // Textarea containing the content
   184   // Textarea containing the content
   186   var ta_wrapper = document.createElement('div');
   185   var ta_wrapper = document.createElement('div');
   187   ta_wrapper.style.margin = '10px 0';
   186   ta_wrapper.style.margin = '10px 0';
   188   ta_wrapper.style.clear = 'both';
   187   // ta_wrapper.style.clear = 'both';
   189   var textarea = document.createElement('textarea');
   188   var textarea = document.createElement('textarea');
   190   textarea.value = content;
   189   textarea.value = content;
   191   textarea._edTimestamp = timestamp;
   190   textarea._edTimestamp = timestamp;
   192   textarea.id = 'ajaxEditArea';
   191   textarea.id = 'ajaxEditArea';
   193   textarea.rows = '20';
   192   textarea.rows = '20';