source_editor.js
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:1k
源码类别:

OA系统

开发平台:

Java

  1. function saveContent() {
  2. tinyMCE.setContent(document.getElementById('htmlSource').value);
  3. tinyMCE.closeWindow(window);
  4. }
  5. function onLoadInit() {
  6. tinyMCEPopup.resizeToInnerSize();
  7. // Remove Gecko spellchecking
  8. if (tinyMCE.isGecko)
  9. document.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");
  10. document.getElementById('htmlSource').value = tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'));
  11. resizeInputs();
  12. if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
  13. setWrap('soft');
  14. document.getElementById('wraped').checked = true;
  15. }
  16. }
  17. function setWrap(val) {
  18. var s = document.getElementById('htmlSource');
  19. s.wrap = val;
  20. if (tinyMCE.isGecko || tinyMCE.isOpera) {
  21. var v = s.value;
  22. var n = s.cloneNode(false);
  23. n.setAttribute("wrap", val);
  24. s.parentNode.replaceChild(n, s);
  25. n.value = v;
  26. }
  27. }
  28. function toggleWordWrap(elm) {
  29. if (elm.checked)
  30. setWrap('soft');
  31. else
  32. setWrap('off');
  33. }
  34. var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
  35. function resizeInputs() {
  36. var el = document.getElementById('htmlSource');
  37. if (!tinyMCE.isMSIE) {
  38.  wHeight = self.innerHeight - 60;
  39.  wWidth = self.innerWidth - 16;
  40. } else {
  41.  wHeight = document.body.clientHeight - 60;
  42.  wWidth = document.body.clientWidth - 16;
  43. }
  44. el.style.height = Math.abs(wHeight) + 'px';
  45. el.style.width  = Math.abs(wWidth) + 'px';
  46. }