A tumblelog CMS built on AJAX, PHP and MySQL.

tools.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //<!--
  2. function init_tynimce(el1, el2) {
  3. tinyMCE.init({
  4. width : "100%",
  5. mode : "textareas",
  6. theme : "simple"
  7. });
  8. edCanvas = document.getElementById(el1);
  9. // This code is meant to allow tabbing from Title to Description (TinyMCE).
  10. if ( tinyMCE.isMSIE )
  11. document.getElementById(el2).onkeydown = function (e)
  12. {
  13. e = e ? e : window.event;
  14. if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
  15. var i = tinyMCE.selectedInstance;
  16. if(typeof i == 'undefined')
  17. return true;
  18. tinyMCE.execCommand("mceStartTyping");
  19. this.blur();
  20. i.contentWindow.focus();
  21. e.returnValue = false;
  22. return false;
  23. }
  24. }
  25. else
  26. document.getElementById(el2).onkeypress = function (e)
  27. {
  28. e = e ? e : window.event;
  29. if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
  30. var i = tinyMCE.selectedInstance;
  31. if(typeof i == 'undefined')
  32. return true;
  33. tinyMCE.execCommand("mceStartTyping");
  34. this.blur();
  35. i.contentWindow.focus();
  36. e.returnValue = false;
  37. return false;
  38. }
  39. }
  40. }
  41. //-->