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