[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/tinymce/themes/advanced/js/ -> source_editor.js (source)

   1  tinyMCEPopup.requireLangPack();
   2  tinyMCEPopup.onInit.add(onLoadInit);
   3  
   4  function saveContent() {
   5      tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});
   6      tinyMCEPopup.close();
   7  }
   8  
   9  function onLoadInit() {
  10      tinyMCEPopup.resizeToInnerSize();
  11  
  12      // Remove Gecko spellchecking
  13      if (tinymce.isGecko)
  14          document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");
  15  
  16      document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});
  17  
  18      if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {
  19          setWrap('soft');
  20          document.getElementById('wraped').checked = true;
  21      }
  22  
  23      resizeInputs();
  24  }
  25  
  26  function setWrap(val) {
  27      var v, n, s = document.getElementById('htmlSource');
  28  
  29      s.wrap = val;
  30  
  31      if (!tinymce.isIE) {
  32          v = s.value;
  33          n = s.cloneNode(false);
  34          n.setAttribute("wrap", val);
  35          s.parentNode.replaceChild(n, s);
  36          n.value = v;
  37      }
  38  }
  39  
  40  function toggleWordWrap(elm) {
  41      if (elm.checked)
  42          setWrap('soft');
  43      else
  44          setWrap('off');
  45  }
  46  
  47  function resizeInputs() {
  48      var vp = tinyMCEPopup.dom.getViewPort(window), el;
  49  
  50      el = document.getElementById('htmlSource');
  51  
  52      if (el) {
  53          el.style.width = (vp.w - 20) + 'px';
  54          el.style.height = (vp.h - 65) + 'px';
  55      }
  56  }


Generated: Fri May 25 03:56:23 2012 Hosted by follow the white rabbit.