/static/scripts/tiny_mce/plugins/paste/js/pastetext.js

http://n23.googlecode.com/ · JavaScript · 42 lines · 31 code · 10 blank · 1 comment · 5 complexity · 5d078052a103321a9d90921f669bb6a9 MD5 · raw file

  1. tinyMCEPopup.requireLangPack();
  2. function saveContent() {
  3. if (document.forms[0].htmlSource.value == '') {
  4. tinyMCEPopup.close();
  5. return false;
  6. }
  7. tinyMCEPopup.execCommand('mcePasteText', false, {
  8. html : document.forms[0].htmlSource.value,
  9. linebreaks : document.forms[0].linebreaks.checked
  10. });
  11. tinyMCEPopup.close();
  12. }
  13. function onLoadInit() {
  14. tinyMCEPopup.resizeToInnerSize();
  15. // Remove Gecko spellchecking
  16. if (tinymce.isGecko)
  17. document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
  18. resizeInputs();
  19. }
  20. var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
  21. function resizeInputs() {
  22. if (!tinymce.isIE) {
  23. wHeight = self.innerHeight-80;
  24. wWidth = self.innerWidth-17;
  25. } else {
  26. wHeight = document.body.clientHeight-80;
  27. wWidth = document.body.clientWidth-17;
  28. }
  29. document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
  30. document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px';
  31. }
  32. tinyMCEPopup.onInit.add(onLoadInit);