Sha256: ae39326deafd76c5eed11bc7a2cd8ddfac42305f941309348f926841305b4047

Contents?: true

Size: 1.62 KB

Versions: 14

Compression:

Stored size: 1.62 KB

Contents

tinyMCEPopup.requireLangPack();
tinyMCEPopup.onInit.add(onLoadInit);

function saveContent() {
  tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});
  tinyMCEPopup.close();
}

function onLoadInit() {
  tinyMCEPopup.resizeToInnerSize();

  // Remove Gecko spellchecking
  if (tinymce.isGecko)
    document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");

  document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});

  if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {
    setWrap('soft');
    document.getElementById('wraped').checked = true;
  }

  resizeInputs();
}

function setWrap(val) {
  var v, n, s = document.getElementById('htmlSource');

  s.wrap = val;

  if (!tinymce.isIE) {
    v = s.value;
    n = s.cloneNode(false);
    n.setAttribute("wrap", val);
    s.parentNode.replaceChild(n, s);
    n.value = v;
  }
}

function toggleWordWrap(elm) {
  if (elm.checked)
    setWrap('soft');
  else
    setWrap('off');
}

var wHeight=0, wWidth=0, owHeight=0, owWidth=0;

function resizeInputs() {
  var el = document.getElementById('htmlSource');

  if (!tinymce.isIE) {
     wHeight = self.innerHeight - 65 - 61; // FIXME (Did): 61 is the bottom actions bar
     wWidth = self.innerWidth - 16;
  } else {
     wHeight = document.body.clientHeight - 70 - 61; // FIXME (Did): 61 is the bottom actions bar
     wWidth = document.body.clientWidth - 16;
  }

  el.style.height = Math.abs(wHeight) + 'px';
  el.style.width  = Math.abs(wWidth) + 'px';
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
locomotive_cms-1.0.0.beta.2 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-1.0.0.beta public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta12 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta11 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta10 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta9 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta8 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta7 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta5 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta4 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta3 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta2 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4.beta1 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js
locomotive_cms-0.0.4 public/javascripts/admin/plugins/tiny_mce/themes/advanced/js/source_editor.js