cable 0.9.15 → 0.9.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. data/VERSION +1 -1
  2. data/public/javascripts/tinymce/langs/en.js +54 -2
  3. data/public/javascripts/tinymce/plugins/advhr/langs/en_dlg.js +2 -0
  4. data/public/javascripts/tinymce/plugins/advhr/rule.htm +30 -29
  5. data/public/javascripts/tinymce/plugins/advimage/image.htm +34 -31
  6. data/public/javascripts/tinymce/plugins/advimage/js/image.js +4 -2
  7. data/public/javascripts/tinymce/plugins/advimage/langs/en_dlg.js +2 -0
  8. data/public/javascripts/tinymce/plugins/advlink/js/advlink.js +5 -10
  9. data/public/javascripts/tinymce/plugins/advlink/langs/en_dlg.js +4 -2
  10. data/public/javascripts/tinymce/plugins/advlink/link.htm +34 -29
  11. data/public/javascripts/tinymce/plugins/advlist/editor_plugin.js +1 -1
  12. data/public/javascripts/tinymce/plugins/advlist/editor_plugin_src.js +3 -3
  13. data/public/javascripts/tinymce/plugins/autolink/editor_plugin.js +1 -0
  14. data/public/javascripts/tinymce/plugins/autolink/editor_plugin_src.js +169 -0
  15. data/public/javascripts/tinymce/plugins/autosave/editor_plugin.js +1 -1
  16. data/public/javascripts/tinymce/plugins/autosave/editor_plugin_src.js +13 -4
  17. data/public/javascripts/tinymce/plugins/bbcode/editor_plugin.js +1 -1
  18. data/public/javascripts/tinymce/plugins/bbcode/editor_plugin_src.js +1 -1
  19. data/public/javascripts/tinymce/plugins/contextmenu/editor_plugin.js +1 -1
  20. data/public/javascripts/tinymce/plugins/contextmenu/editor_plugin_src.js +23 -14
  21. data/public/javascripts/tinymce/plugins/emotions/emotions.htm +15 -14
  22. data/public/javascripts/tinymce/plugins/fullpage/css/fullpage.css +6 -4
  23. data/public/javascripts/tinymce/plugins/fullpage/editor_plugin.js +1 -1
  24. data/public/javascripts/tinymce/plugins/fullpage/editor_plugin_src.js +53 -8
  25. data/public/javascripts/tinymce/plugins/fullpage/fullpage.htm +2 -2
  26. data/public/javascripts/tinymce/plugins/fullpage/js/fullpage.js +45 -19
  27. data/public/javascripts/tinymce/plugins/fullscreen/editor_plugin.js +1 -1
  28. data/public/javascripts/tinymce/plugins/fullscreen/editor_plugin_src.js +10 -2
  29. data/public/javascripts/tinymce/plugins/inlinepopups/editor_plugin.js +1 -1
  30. data/public/javascripts/tinymce/plugins/inlinepopups/editor_plugin_src.js +76 -15
  31. data/public/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +0 -10
  32. data/public/javascripts/tinymce/plugins/layer/editor_plugin.js +1 -1
  33. data/public/javascripts/tinymce/plugins/layer/editor_plugin_src.js +2 -0
  34. data/public/javascripts/tinymce/plugins/legacyoutput/editor_plugin.js +1 -1
  35. data/public/javascripts/tinymce/plugins/legacyoutput/editor_plugin_src.js +29 -26
  36. data/public/javascripts/tinymce/plugins/lists/editor_plugin.js +1 -0
  37. data/public/javascripts/tinymce/plugins/lists/editor_plugin_src.js +617 -0
  38. data/public/javascripts/tinymce/plugins/media/css/media.css +5 -4
  39. data/public/javascripts/tinymce/plugins/media/editor_plugin.js +1 -1
  40. data/public/javascripts/tinymce/plugins/media/editor_plugin_src.js +652 -296
  41. data/public/javascripts/tinymce/plugins/media/js/media.js +327 -603
  42. data/public/javascripts/tinymce/plugins/media/langs/en_dlg.js +8 -2
  43. data/public/javascripts/tinymce/plugins/media/media.htm +283 -288
  44. data/public/javascripts/tinymce/plugins/media/moxieplayer.swf +0 -0
  45. data/public/javascripts/tinymce/plugins/nonbreaking/editor_plugin.js +1 -1
  46. data/public/javascripts/tinymce/plugins/nonbreaking/editor_plugin_src.js +1 -1
  47. data/public/javascripts/tinymce/plugins/pagebreak/editor_plugin.js +1 -1
  48. data/public/javascripts/tinymce/plugins/pagebreak/editor_plugin_src.js +1 -4
  49. data/public/javascripts/tinymce/plugins/paste/editor_plugin.js +1 -1
  50. data/public/javascripts/tinymce/plugins/paste/editor_plugin_src.js +106 -128
  51. data/public/javascripts/tinymce/plugins/searchreplace/editor_plugin.js +1 -1
  52. data/public/javascripts/tinymce/plugins/searchreplace/editor_plugin_src.js +4 -0
  53. data/public/javascripts/tinymce/plugins/searchreplace/js/searchreplace.js +14 -10
  54. data/public/javascripts/tinymce/plugins/searchreplace/searchreplace.htm +17 -16
  55. data/public/javascripts/tinymce/plugins/spellchecker/editor_plugin.js +1 -1
  56. data/public/javascripts/tinymce/plugins/spellchecker/editor_plugin_src.js +55 -37
  57. data/public/javascripts/tinymce/plugins/style/js/props.js +2 -8
  58. data/public/javascripts/tinymce/plugins/style/langs/en_dlg.js +8 -1
  59. data/public/javascripts/tinymce/plugins/style/props.htm +513 -398
  60. data/public/javascripts/tinymce/plugins/tabfocus/editor_plugin.js +1 -1
  61. data/public/javascripts/tinymce/plugins/tabfocus/editor_plugin_src.js +30 -28
  62. data/public/javascripts/tinymce/plugins/table/cell.htm +12 -12
  63. data/public/javascripts/tinymce/plugins/table/editor_plugin.js +1 -1
  64. data/public/javascripts/tinymce/plugins/table/editor_plugin_src.js +85 -26
  65. data/public/javascripts/tinymce/plugins/table/js/cell.js +9 -11
  66. data/public/javascripts/tinymce/plugins/table/js/row.js +13 -18
  67. data/public/javascripts/tinymce/plugins/table/js/table.js +8 -12
  68. data/public/javascripts/tinymce/plugins/table/langs/en_dlg.js +1 -1
  69. data/public/javascripts/tinymce/plugins/table/merge_cells.htm +11 -11
  70. data/public/javascripts/tinymce/plugins/table/row.htm +10 -8
  71. data/public/javascripts/tinymce/plugins/table/table.htm +54 -53
  72. data/public/javascripts/tinymce/plugins/template/js/template.js +1 -1
  73. data/public/javascripts/tinymce/plugins/visualchars/editor_plugin.js +1 -1
  74. data/public/javascripts/tinymce/plugins/visualchars/editor_plugin_src.js +1 -1
  75. data/public/javascripts/tinymce/plugins/wordcount/editor_plugin.js +1 -1
  76. data/public/javascripts/tinymce/plugins/wordcount/editor_plugin_src.js +35 -19
  77. data/public/javascripts/tinymce/plugins/xhtmlxtras/abbr.htm +6 -5
  78. data/public/javascripts/tinymce/plugins/xhtmlxtras/acronym.htm +6 -5
  79. data/public/javascripts/tinymce/plugins/xhtmlxtras/attributes.htm +6 -5
  80. data/public/javascripts/tinymce/plugins/xhtmlxtras/cite.htm +5 -4
  81. data/public/javascripts/tinymce/plugins/xhtmlxtras/del.htm +9 -8
  82. data/public/javascripts/tinymce/plugins/xhtmlxtras/ins.htm +11 -10
  83. data/public/javascripts/tinymce/plugins/xhtmlxtras/js/attributes.js +0 -1
  84. data/public/javascripts/tinymce/plugins/xhtmlxtras/js/del.js +2 -2
  85. data/public/javascripts/tinymce/plugins/xhtmlxtras/js/element_common.js +3 -5
  86. data/public/javascripts/tinymce/plugins/xhtmlxtras/js/ins.js +4 -3
  87. data/public/javascripts/tinymce/themes/advanced/about.htm +3 -5
  88. data/public/javascripts/tinymce/themes/advanced/anchor.htm +5 -5
  89. data/public/javascripts/tinymce/themes/advanced/charmap.htm +39 -40
  90. data/public/javascripts/tinymce/themes/advanced/color_picker.htm +10 -9
  91. data/public/javascripts/tinymce/themes/advanced/editor_template.js +1 -1
  92. data/public/javascripts/tinymce/themes/advanced/editor_template_src.js +171 -40
  93. data/public/javascripts/tinymce/themes/advanced/image.htm +51 -51
  94. data/public/javascripts/tinymce/{plugins/media → themes/advanced}/img/flash.gif +0 -0
  95. data/public/javascripts/tinymce/themes/advanced/img/iframe.gif +0 -0
  96. data/public/javascripts/tinymce/{plugins/pagebreak → themes/advanced}/img/pagebreak.gif +0 -0
  97. data/public/javascripts/tinymce/{plugins/media → themes/advanced}/img/quicktime.gif +0 -0
  98. data/public/javascripts/tinymce/{plugins/media → themes/advanced}/img/realmedia.gif +0 -0
  99. data/public/javascripts/tinymce/{plugins/media → themes/advanced}/img/shockwave.gif +0 -0
  100. data/public/javascripts/tinymce/{plugins/media → themes/advanced}/img/trans.gif +0 -0
  101. data/public/javascripts/tinymce/themes/advanced/img/video.gif +0 -0
  102. data/public/javascripts/tinymce/{plugins/media → themes/advanced}/img/windowsmedia.gif +0 -0
  103. data/public/javascripts/tinymce/themes/advanced/js/about.js +1 -0
  104. data/public/javascripts/tinymce/themes/advanced/js/anchor.js +5 -0
  105. data/public/javascripts/tinymce/themes/advanced/js/charmap.js +26 -6
  106. data/public/javascripts/tinymce/themes/advanced/js/color_picker.js +108 -32
  107. data/public/javascripts/tinymce/themes/advanced/js/image.js +3 -1
  108. data/public/javascripts/tinymce/themes/advanced/js/link.js +4 -7
  109. data/public/javascripts/tinymce/themes/advanced/js/source_editor.js +1 -1
  110. data/public/javascripts/tinymce/themes/advanced/langs/en.js +8 -2
  111. data/public/javascripts/tinymce/themes/advanced/langs/en_dlg.js +6 -3
  112. data/public/javascripts/tinymce/themes/advanced/link.htm +27 -28
  113. data/public/javascripts/tinymce/themes/advanced/shortcuts.htm +47 -0
  114. data/public/javascripts/tinymce/themes/advanced/skins/default/content.css +11 -0
  115. data/public/javascripts/tinymce/themes/advanced/skins/default/ui.css +4 -4
  116. data/public/javascripts/tinymce/themes/advanced/skins/highcontrast/content.css +23 -0
  117. data/public/javascripts/tinymce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  118. data/public/javascripts/tinymce/themes/advanced/skins/highcontrast/ui.css +101 -0
  119. data/public/javascripts/tinymce/themes/advanced/skins/o2k7/content.css +10 -0
  120. data/public/javascripts/tinymce/themes/advanced/skins/o2k7/dialog.css +1 -0
  121. data/public/javascripts/tinymce/themes/advanced/skins/o2k7/ui.css +5 -4
  122. data/public/javascripts/tinymce/themes/advanced/skins/o2k7/ui_black.css +1 -1
  123. data/public/javascripts/tinymce/themes/advanced/skins/o2k7/ui_silver.css +1 -1
  124. data/public/javascripts/tinymce/themes/advanced/source_editor.htm +3 -3
  125. data/public/javascripts/tinymce/themes/simple/editor_template.js +1 -1
  126. data/public/javascripts/tinymce/themes/simple/editor_template_src.js +1 -2
  127. data/public/javascripts/tinymce/tiny_mce.js +1 -1
  128. data/public/javascripts/tinymce/tiny_mce_popup.js +1 -1
  129. data/public/javascripts/tinymce/tiny_mce_src.js +6383 -4025
  130. data/public/javascripts/tinymce/utils/form_utils.js +14 -4
  131. data/public/javascripts/tinymce/utils/mctabs.js +95 -10
  132. data/public/javascripts/tinymce/utils/validate.js +34 -2
  133. metadata +50 -93
  134. data/public/javascripts/tinymce/plugins/media/css/content.css +0 -6
  135. data/public/javascripts/tinymce/plugins/media/img/flv_player.swf +0 -0
  136. data/public/javascripts/tinymce/plugins/pagebreak/css/content.css +0 -1
  137. data/public/javascripts/tinymce/plugins/pagebreak/img/trans.gif +0 -0
  138. data/public/javascripts/tinymce/plugins/pdw/editor_plugin.js +0 -4
  139. data/public/javascripts/tinymce/plugins/pdw/editor_plugin_src.js +0 -158
  140. data/public/javascripts/tinymce/plugins/pdw/img/toolbars.gif +0 -0
  141. data/public/javascripts/tinymce/plugins/pdw/langs/en.js +0 -3
  142. data/public/javascripts/tinymce/plugins/pdw/langs/nl.js +0 -3
@@ -1 +1 @@
1
- (function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square")},createControl:function(d,b){var f=this,e,h;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){h=f[d][0]}function c(i,k){var j=true;a(k.styles,function(m,l){if(f.editor.dom.getStyle(i,l)!=m){j=false;return false}});return j}function g(){var k,i=f.editor,l=i.dom,j=i.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,h)){i.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(h){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,h.styles);k.removeAttribute("_mce_style")}}}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){g()}});e.onRenderMenu.add(function(i,j){j.onShowMenu.add(function(){var m=f.editor.dom,l=m.getParent(f.editor.selection.getNode(),"ol,ul"),k;if(l||h){k=f[d];a(j.items,function(n){var o=true;n.setSelected(0);if(l&&!n.isDisabled()){a(k,function(p){if(p.id==n.id){if(!c(l,p)){o=false;return false}}});if(o){n.setSelected(1)}}});if(!l){j.items[h.id].setSelected(1)}}});j.add({id:f.editor.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle"}).setDisabled(1);a(f[d],function(k){k.id=f.editor.dom.uniqueId();j.add({id:k.id,title:k.title,onclick:function(){h=k;g()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
1
+ (function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square")},createControl:function(d,b){var f=this,e,h;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){h=f[d][0]}function c(i,k){var j=true;a(k.styles,function(m,l){if(f.editor.dom.getStyle(i,l)!=m){j=false;return false}});return j}function g(){var k,i=f.editor,l=i.dom,j=i.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,h)){i.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(h){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,h.styles);k.removeAttribute("data-mce-style")}}i.focus()}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){g()}});e.onRenderMenu.add(function(i,j){j.onShowMenu.add(function(){var m=f.editor.dom,l=m.getParent(f.editor.selection.getNode(),"ol,ul"),k;if(l||h){k=f[d];a(j.items,function(n){var o=true;n.setSelected(0);if(l&&!n.isDisabled()){a(k,function(p){if(p.id==n.id){if(!c(l,p)){o=false;return false}}});if(o){n.setSelected(1)}}});if(!l){j.items[h.id].setSelected(1)}}});j.add({id:f.editor.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle",titleItem:true}).setDisabled(1);a(f[d],function(k){k.id=f.editor.dom.uniqueId();j.add({id:k.id,title:k.title,onclick:function(){h=k;g()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
@@ -72,12 +72,12 @@
72
72
  // Append styles to new list element
73
73
  if (format) {
74
74
  list = dom.getParent(sel.getNode(), 'ol,ul');
75
-
76
75
  if (list) {
77
76
  dom.setStyles(list, format.styles);
78
- list.removeAttribute('_mce_style');
77
+ list.removeAttribute('data-mce-style');
79
78
  }
80
79
  }
80
+ ed.focus();
81
81
  };
82
82
 
83
83
  btn = cm.createSplitButton(name, {
@@ -122,7 +122,7 @@
122
122
  }
123
123
  });
124
124
 
125
- menu.add({id : t.editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
125
+ menu.add({id : t.editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1);
126
126
 
127
127
  each(t[name], function(item) {
128
128
  item.id = t.editor.dom.uniqueId();
@@ -0,0 +1 @@
1
+ (function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;if(tinyMCE.isIE){return}a.onKeyDown.add(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}if(f.shiftKey&&f.keyCode==48){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng().cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("mceInsertLink",false,h[1]+h[2]);i.selection.moveToBookmark(k);if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();
@@ -0,0 +1,169 @@
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2011, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function() {
12
+ tinymce.create('tinymce.plugins.AutolinkPlugin', {
13
+ /**
14
+ * Initializes the plugin, this will be executed after the plugin has been created.
15
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
16
+ * of the editor instance to intercept that event.
17
+ *
18
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
19
+ * @param {string} url Absolute URL to where the plugin is located.
20
+ */
21
+
22
+ init : function(ed, url) {
23
+ var t = this;
24
+
25
+ // Internet Explorer has built-in automatic linking
26
+ if (tinyMCE.isIE)
27
+ return;
28
+
29
+ // Add a key down handler
30
+ ed.onKeyDown.add(function(ed, e) {
31
+ if (e.keyCode == 13)
32
+ return t.handleEnter(ed);
33
+ if (e.shiftKey && e.keyCode == 48)
34
+ return t.handleEclipse(ed);
35
+ });
36
+
37
+ // Add a key up handler
38
+ ed.onKeyUp.add(function(ed, e) {
39
+ if (e.keyCode == 32)
40
+ return t.handleSpacebar(ed);
41
+ });
42
+ },
43
+
44
+ handleEclipse : function(ed) {
45
+ this.parseCurrentLine(ed, -1, '(', true);
46
+ },
47
+
48
+ handleSpacebar : function(ed) {
49
+ this.parseCurrentLine(ed, 0, '', true);
50
+ },
51
+
52
+ handleEnter : function(ed) {
53
+ this.parseCurrentLine(ed, -1, '', false);
54
+ },
55
+
56
+ parseCurrentLine : function(ed, end_offset, delimiter, goback) {
57
+ var r, end, start, endContainer, bookmark, text, matches, prev, len;
58
+
59
+ // We need at least five characters to form a URL,
60
+ // hence, at minimum, five characters from the beginning of the line.
61
+ r = ed.selection.getRng().cloneRange();
62
+ if (r.startOffset < 5) {
63
+ // During testing, the caret is placed inbetween two text nodes.
64
+ // The previous text node contains the URL.
65
+ prev = r.endContainer.previousSibling;
66
+ if (prev == null) {
67
+ if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
68
+ return;
69
+
70
+ prev = r.endContainer.firstChild.nextSibling;
71
+ }
72
+ len = prev.length;
73
+ r.setStart(prev, len);
74
+ r.setEnd(prev, len);
75
+
76
+ if (r.endOffset < 5)
77
+ return;
78
+
79
+ end = r.endOffset;
80
+ endContainer = prev;
81
+ } else {
82
+ endContainer = r.endContainer;
83
+
84
+ // Get a text node
85
+ if (endContainer.nodeType != 3 && endContainer.firstChild) {
86
+ while (endContainer.nodeType != 3 && endContainer.firstChild)
87
+ endContainer = endContainer.firstChild;
88
+
89
+ r.setStart(endContainer, 0);
90
+ r.setEnd(endContainer, endContainer.nodeValue.length);
91
+ }
92
+
93
+ if (r.endOffset == 1)
94
+ end = 2;
95
+ else
96
+ end = r.endOffset - 1 - end_offset;
97
+ }
98
+
99
+ start = end;
100
+
101
+ do
102
+ {
103
+ // Move the selection one character backwards.
104
+ r.setStart(endContainer, end - 2);
105
+ r.setEnd(endContainer, end - 1);
106
+ end -= 1;
107
+
108
+ // Loop until one of the following is found: a blank space, &nbsp;, delimeter, (end-2) >= 0
109
+ } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
110
+
111
+ if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
112
+ r.setStart(endContainer, end);
113
+ r.setEnd(endContainer, start);
114
+ end += 1;
115
+ } else if (r.startOffset == 0) {
116
+ r.setStart(endContainer, 0);
117
+ r.setEnd(endContainer, start);
118
+ }
119
+ else {
120
+ r.setStart(endContainer, end);
121
+ r.setEnd(endContainer, start);
122
+ }
123
+
124
+ text = r.toString();
125
+ matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)(.+)$/i);
126
+
127
+ if (matches) {
128
+ if (matches[1] == 'www.') {
129
+ matches[1] = 'http://www.';
130
+ }
131
+
132
+ bookmark = ed.selection.getBookmark();
133
+
134
+ ed.selection.setRng(r);
135
+ tinyMCE.execCommand('mceInsertLink',false, matches[1] + matches[2]);
136
+ ed.selection.moveToBookmark(bookmark);
137
+
138
+ // TODO: Determine if this is still needed.
139
+ if (tinyMCE.isWebKit) {
140
+ // move the caret to its original position
141
+ ed.selection.collapse(false);
142
+ var max = Math.min(endContainer.length, start + 1);
143
+ r.setStart(endContainer, max);
144
+ r.setEnd(endContainer, max);
145
+ ed.selection.setRng(r);
146
+ }
147
+ }
148
+ },
149
+
150
+ /**
151
+ * Returns information about the plugin as a name/value array.
152
+ * The current keys are longname, author, authorurl, infourl and version.
153
+ *
154
+ * @return {Object} Name/value array containing information about the plugin.
155
+ */
156
+ getInfo : function() {
157
+ return {
158
+ longname : 'Autolink',
159
+ author : 'Moxiecode Systems AB',
160
+ authorurl : 'http://tinymce.moxiecode.com',
161
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',
162
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
163
+ };
164
+ }
165
+ });
166
+
167
+ // Register plugin
168
+ tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
169
+ })();
@@ -1 +1 @@
1
- (function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s|&nbsp;|<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();m.save("TinyMCE")},getItem:function(l){var m=i.getElement();m.load("TinyMCE");return m.getAttribute(l)},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,i=h.storage;if(i){content=i.getItem(h.key);if(content){h.editor.setContent(content);h.onRestoreDraft.dispatch(h,{content:content})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
1
+ (function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s|&nbsp;|<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,i=h.storage;if(i){content=i.getItem(h.key);if(content){h.editor.setContent(content);h.onRestoreDraft.dispatch(h,{content:content})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
@@ -257,15 +257,24 @@
257
257
 
258
258
  userDataElement.setAttribute(key, value);
259
259
  userDataElement.expires = self.getExpDate();
260
- userDataElement.save("TinyMCE");
260
+
261
+ try {
262
+ userDataElement.save("TinyMCE");
263
+ } catch (e) {
264
+ // Ignore, saving might fail if "Userdata Persistence" is disabled in IE
265
+ }
261
266
  },
262
267
 
263
268
  getItem : function(key) {
264
269
  var userDataElement = ed.getElement();
265
270
 
266
- userDataElement.load("TinyMCE");
267
-
268
- return userDataElement.getAttribute(key);
271
+ try {
272
+ userDataElement.load("TinyMCE");
273
+ return userDataElement.getAttribute(key);
274
+ } catch (e) {
275
+ // Ignore, loading might fail if "Userdata Persistence" is disabled in IE
276
+ return null;
277
+ }
269
278
  },
270
279
 
271
280
  removeItem : function(key) {
@@ -1 +1 @@
1
- (function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/&nbsp;/gi," ");b(/&quot;/gi,'"');b(/&lt;/gi,"<");b(/&gt;/gi,">");b(/&amp;/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
1
+ (function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/&nbsp;|\u00a0/gi," ");b(/&quot;/gi,'"');b(/&lt;/gi,"<");b(/&gt;/gi,">");b(/&amp;/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
@@ -79,7 +79,7 @@
79
79
  rep(/<br>/gi,"\n");
80
80
  rep(/<p>/gi,"");
81
81
  rep(/<\/p>/gi,"\n");
82
- rep(/&nbsp;/gi," ");
82
+ rep(/&nbsp;|\u00a0/gi," ");
83
83
  rep(/&quot;/gi,"\"");
84
84
  rep(/&lt;/gi,"<");
85
85
  rep(/&gt;/gi,">");
@@ -1 +1 @@
1
- (function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this,g;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(h,i){if(!i.ctrlKey){if(g){h.selection.setRng(g)}f._getMenu(h).showMenu(i.clientX,i.clientY);a.add(h.getDoc(),"click",function(j){e(h,j)});a.cancel(i)}});d.onRemove.add(function(){if(f._menu){f._menu.removeAll()}});function e(h,i){g=null;if(i&&i.button==2){g=h.selection.getRng();return}if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(h.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e)},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
1
+ (function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(e){var h=this,i,f,d;h.editor=e;d=e.settings.contextmenu_never_use_native;h.onContextMenu=new tinymce.util.Dispatcher(this);f=e.onContextMenu.add(function(j,k){if(k.ctrlKey&&!d){return}if(i){j.selection.setRng(i)}h._getMenu(j).showMenu(k.clientX||k.pageX,k.clientY||k.pageX);a.add(j.getDoc(),"click",function(l){g(j,l)});a.cancel(k)});e.onRemove.add(function(){if(h._menu){h._menu.removeAll()}});function g(j,k){i=null;if(k&&k.button==2){i=j.selection.getRng();return}if(h._menu){h._menu.removeAll();h._menu.destroy();a.remove(j.getDoc(),"click",g)}}e.onMouseDown.add(g);e.onKeyDown.add(g);e.onKeyDown.add(function(j,k){if(k.shiftKey&&!k.ctrlKey&&!k.altKey&&k.keyCode===121){a.cancel(k);f(j,k)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
@@ -27,10 +27,12 @@
27
27
  * @param {string} url Absolute URL to where the plugin is located.
28
28
  */
29
29
  init : function(ed) {
30
- var t = this, lastRng;
30
+ var t = this, lastRng, showMenu, contextmenuNeverUseNative;
31
31
 
32
32
  t.editor = ed;
33
33
 
34
+ contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native;
35
+
34
36
  /**
35
37
  * This event gets fired when the context menu is shown.
36
38
  *
@@ -40,18 +42,18 @@
40
42
  */
41
43
  t.onContextMenu = new tinymce.util.Dispatcher(this);
42
44
 
43
- ed.onContextMenu.add(function(ed, e) {
44
- if (!e.ctrlKey) {
45
- // Restore the last selection since it was removed
46
- if (lastRng)
47
- ed.selection.setRng(lastRng);
45
+ showMenu = ed.onContextMenu.add(function(ed, e) {
46
+ if (e.ctrlKey && !contextmenuNeverUseNative) return;
48
47
 
49
- t._getMenu(ed).showMenu(e.clientX, e.clientY);
50
- Event.add(ed.getDoc(), 'click', function(e) {
51
- hide(ed, e);
52
- });
53
- Event.cancel(e);
54
- }
48
+ // Restore the last selection since it was removed
49
+ if (lastRng)
50
+ ed.selection.setRng(lastRng);
51
+
52
+ t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageX);
53
+ Event.add(ed.getDoc(), 'click', function(e) {
54
+ hide(ed, e);
55
+ });
56
+ Event.cancel(e);
55
57
  });
56
58
 
57
59
  ed.onRemove.add(function() {
@@ -78,6 +80,12 @@
78
80
 
79
81
  ed.onMouseDown.add(hide);
80
82
  ed.onKeyDown.add(hide);
83
+ ed.onKeyDown.add(function(ed, e) {
84
+ if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) {
85
+ Event.cancel(e);
86
+ showMenu(ed, e);
87
+ }
88
+ });
81
89
  },
82
90
 
83
91
  /**
@@ -111,7 +119,8 @@
111
119
  m = ed.controlManager.createDropMenu('contextmenu', {
112
120
  offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0),
113
121
  offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0),
114
- constrain : 1
122
+ constrain : 1,
123
+ keyboard_focus: true
115
124
  });
116
125
 
117
126
  t._menu = m;
@@ -144,4 +153,4 @@
144
153
 
145
154
  // Register plugin
146
155
  tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);
147
- })();
156
+ })();
@@ -5,36 +5,37 @@
5
5
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
6
  <script type="text/javascript" src="js/emotions.js"></script>
7
7
  </head>
8
- <body style="display: none">
9
- <div align="center">
10
- <div class="title">{#emotions_dlg.title}:<br /><br /></div>
8
+ <body style="display: none" role="application" aria-labelledby="app_title">
9
+ <span style="display:none;" id="app_title">{#emotions_dlg.title}</span>
10
+ <div align="center">
11
+ <div class="title">{#emotions_dlg.title}:<br /><br /></div>
11
12
 
12
- <table border="0" cellspacing="0" cellpadding="4">
13
- <tr>
13
+ <table role="presentation" border="0" cellspacing="0" cellpadding="4">
14
+ <tr>
14
15
  <td><a href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}" title="{#emotions_dlg.cool}" /></a></td>
15
16
  <td><a href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}" title="{#emotions_dlg.cry}" /></a></td>
16
17
  <td><a href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}" title="{#emotions_dlg.embarassed}" /></a></td>
17
18
  <td><a href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}" title="{#emotions_dlg.foot_in_mouth}" /></a></td>
18
- </tr>
19
- <tr>
19
+ </tr>
20
+ <tr>
20
21
  <td><a href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" title="{#emotions_dlg.frown}" /></a></td>
21
22
  <td><a href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}" title="{#emotions_dlg.innocent}" /></a></td>
22
23
  <td><a href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}" title="{#emotions_dlg.kiss}" /></a></td>
23
24
  <td><a href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}" title="{#emotions_dlg.laughing}" /></a></td>
24
- </tr>
25
- <tr>
25
+ </tr>
26
+ <tr>
26
27
  <td><a href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}" title="{#emotions_dlg.money_mouth}" /></a></td>
27
28
  <td><a href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}" title="{#emotions_dlg.sealed}" /></a></td>
28
29
  <td><a href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}" title="{#emotions_dlg.smile}" /></a></td>
29
30
  <td><a href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}" title="{#emotions_dlg.surprised}" /></a></td>
30
- </tr>
31
- <tr>
31
+ </tr>
32
+ <tr>
32
33
  <td><a href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue-out}" title="{#emotions_dlg.tongue_out}" /></a></td>
33
34
  <td><a href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}" title="{#emotions_dlg.undecided}" /></a></td>
34
35
  <td><a href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}" title="{#emotions_dlg.wink}" /></a></td>
35
36
  <td><a href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}" title="{#emotions_dlg.yell}" /></a></td>
36
- </tr>
37
- </table>
38
- </div>
37
+ </tr>
38
+ </table>
39
+ </div>
39
40
  </body>
40
41
  </html>
@@ -35,12 +35,17 @@
35
35
  width: 240px;
36
36
  }
37
37
 
38
+ #doctypes {
39
+ width: 200px;
40
+ }
41
+
38
42
  /* Head list classes */
39
43
 
40
44
  .headlistwrapper {
41
45
  width: 100%;
42
46
  }
43
47
 
48
+ /* not implemented advanced tab buttons
44
49
  .addbutton, .removebutton, .moveupbutton, .movedownbutton {
45
50
  border-top: 1px solid;
46
51
  border-left: 1px solid;
@@ -53,10 +58,6 @@
53
58
  height: 20px;
54
59
  }
55
60
 
56
- #doctypes {
57
- width: 200px;
58
- }
59
-
60
61
  .addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover {
61
62
  border: 1px solid #0A246A;
62
63
  background-color: #B6BDD2;
@@ -83,6 +84,7 @@
83
84
  background-image: url('../images/move_down.gif');
84
85
  float: left;
85
86
  }
87
+ */
86
88
 
87
89
  .selected {
88
90
  border: 1px solid #0A246A;
@@ -1 +1 @@
1
- (function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c<e;c++){g=l[c].split("=");b=g[0].replace(/\s/,"");h=g[1];if(h){h=h.replace(/^\s+/,"").replace(/\s+$/,"");j=h.match(/^["'](.*)["']$/);if(j){h=j[1]}}else{h=b}d.dom.setAttrib(d.getBody(),"style",h)}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true})},_setContent:function(d,b){var h=this,a,j,f=b.content,g,i="";if(b.format=="raw"&&h.head){return}if(b.source_view&&d.getParam("fullpage_hide_in_source_view")){return}f=f.replace(/<(\/?)BODY/gi,"<$1body");a=f.indexOf("<body");if(a!=-1){a=f.indexOf(">",a);h.head=f.substring(0,a+1);j=f.indexOf("</body",a);if(j==-1){j=f.indexOf("</body",j)}b.content=f.substring(a+1,j);h.foot=f.substring(j);function e(c){return c.replace(/<\/?[A-Z]+/g,function(k){return k.toLowerCase()})}h.head=e(h.head);h.foot=e(h.foot)}else{h.head="";if(d.getParam("fullpage_default_xml_pi")){h.head+='<?xml version="1.0" encoding="'+d.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}h.head+=d.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');h.head+="\n<html>\n<head>\n<title>"+d.getParam("fullpage_default_title","Untitled document")+"</title>\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='<meta http-equiv="Content-Type" content="'+g+'" />\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n";h.foot="\n</body>\n</html>"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})();
1
+ (function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(e,a){var p,d,g,l,b,m,n,h=this.head.match(/body(.*?)>/i),j="",c,f=this.head.match(/<html([^>]*?)>/i);if(h&&h[1]){p=h[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(p){for(d=0,g=p.length;d<g;d++){l=p[d].split("=");b=l[0].replace(/\s/,"");m=l[1];if(m){m=m.replace(/^\s+/,"").replace(/\s+$/,"");n=m.match(/^["'](.*)["']$/);if(n){m=n[1]}if(b=="dir"){j=m}}else{m=b}e.dom.setAttrib(e.getBody(),"style",m)}}}if(j==""&&f&&f[1]){c=f[1].match(/dir\s*=\s*["']([^"']*)["']/i);if(c&&c[1]){j=c[1]}}bd=e.getBody();bd.setAttribute("dir",j)},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,indent:true,apply_source_formatting:true,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,title,meta,head",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,title,meta,head"})},_setContent:function(d,b){var i=this,a,l,f=b.content,h,j="";if(b.format=="raw"&&i.head){return}if(b.source_view&&d.getParam("fullpage_hide_in_source_view")){return}f=f.replace(/<(\/?)BODY/gi,"<$1body");a=f.indexOf("<body");if(a!=-1){a=f.indexOf(">",a);i.head=f.substring(0,a+1);var k=0,g;i.css="";while((k=i.head.indexOf("<style",k))!=-1){k=f.indexOf(">",k)+1;if((g=i.head.indexOf("</style",k))==-1){break}i.css+=i.head.substring(k,g);k=g}l=f.indexOf("</body",a);if(l==-1){l=f.length}b.content=f.substring(a+1,l);i.foot=f.substring(l);function e(c){return c.replace(/<\/?[A-Z]+/g,function(m){return m.toLowerCase()})}i.head=e(i.head);i.foot=e(i.foot)}else{i.head="";if(d.getParam("fullpage_default_xml_pi")){i.head+='<?xml version="1.0" encoding="'+d.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}i.head+=d.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');i.head+="\n<html>\n<head>\n";if(h=d.getParam("fullpage_default_title")){i.head+="<title>"+h+"</title>\n"}if(h=d.getParam("fullpage_default_encoding")){i.head+='<meta http-equiv="Content-Type" content="text/html; charset='+h+'" />\n'}if(h=d.getParam("fullpage_default_font_family")){j+="font-family: "+h+";"}if(h=d.getParam("fullpage_default_font_size")){j+="font-size: "+h+";"}if(h=d.getParam("fullpage_default_text_color")){j+="color: "+h+";"}i.head+="</head>\n<body"+(j?' style="'+j+'"':"")+">\n";i.foot="\n</body>\n</html>"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot);if(b.css){b._setStyle(a,b.css)}}},_setStyle:function(a,b){a.dom.remove("injectedCSS");var d=a.dom.doc,c=d.createElement("style");c.type="text/css";c.id="injectedCSS";if(c.styleSheet){c.styleSheet.cssText=b}else{c.appendChild(d.createTextNode(b))}d.getElementsByTagName("head")[0].appendChild(c)}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})();
@@ -49,7 +49,7 @@
49
49
  // Private plugin internal methods
50
50
 
51
51
  _setBodyAttribs : function(ed, o) {
52
- var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i);
52
+ var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i), bddir = '',htattr, hattr = this.head.match(/<html([^>]*?)>/i);
53
53
 
54
54
  if (attr && attr[1]) {
55
55
  bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);
@@ -66,6 +66,8 @@
66
66
 
67
67
  if (t)
68
68
  v = t[1];
69
+ if(k == 'dir')
70
+ bddir = v;
69
71
  } else
70
72
  v = k;
71
73
 
@@ -73,12 +75,23 @@
73
75
  }
74
76
  }
75
77
  }
78
+ //if found fetch the dir-attribute from the html-tag and apply it to the editor-body
79
+ if(bddir == '' && hattr && hattr[1]){
80
+ htattr = hattr[1].match(/dir\s*=\s*["']([^"']*)["']/i);
81
+ if (htattr && htattr[1])
82
+ bddir = htattr[1];
83
+ }
84
+ bd = ed.getBody();
85
+ bd.setAttribute('dir', bddir);
76
86
  },
77
87
 
78
88
  _createSerializer : function() {
79
89
  return new tinymce.dom.Serializer({
80
90
  dom : this.editor.dom,
81
- apply_source_formatting : true
91
+ indent : true,
92
+ apply_source_formatting : true,
93
+ indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,title,meta,head',
94
+ indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,title,meta,head'
82
95
  });
83
96
  },
84
97
 
@@ -100,9 +113,20 @@
100
113
  sp = c.indexOf('>', sp);
101
114
  t.head = c.substring(0, sp + 1);
102
115
 
116
+ // Concatenate all <style>'s text into t.css
117
+ var ss = 0, es;
118
+ t.css = '';
119
+ while ((ss = t.head.indexOf('<style', ss)) != -1) {
120
+ ss = c.indexOf('>', ss) + 1;
121
+ if ( (es = t.head.indexOf('</style', ss)) == -1)
122
+ break;
123
+ t.css += t.head.substring(ss, es);
124
+ ss = es;
125
+ }
126
+
103
127
  ep = c.indexOf('</body', sp);
104
128
  if (ep == -1)
105
- ep = c.indexOf('</body', ep);
129
+ ep = c.length;
106
130
 
107
131
  o.content = c.substring(sp + 1, ep);
108
132
  t.foot = c.substring(ep);
@@ -121,10 +145,13 @@
121
145
  t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
122
146
 
123
147
  t.head += ed.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
124
- t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n';
148
+ t.head += '\n<html>\n<head>\n';
149
+
150
+ if (v = ed.getParam('fullpage_default_title'))
151
+ t.head += '<title>' + v + '</title>\n';
125
152
 
126
153
  if (v = ed.getParam('fullpage_default_encoding'))
127
- t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n';
154
+ t.head += '<meta http-equiv="Content-Type" content="text/html; charset=' + v + '" />\n';
128
155
 
129
156
  if (v = ed.getParam('fullpage_default_font_family'))
130
157
  st += 'font-family: ' + v + ';';
@@ -143,11 +170,29 @@
143
170
  _getContent : function(ed, o) {
144
171
  var t = this;
145
172
 
146
- if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view'))
173
+ if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) {
147
174
  o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot);
148
- }
175
+
176
+ if (t.css)
177
+ t._setStyle(ed, t.css);
178
+ }
179
+ },
180
+
181
+ _setStyle : function(ed, css) {
182
+ ed.dom.remove('injectedCSS');
183
+ var doc = ed.dom.doc, style = doc.createElement('style');
184
+ style.type = 'text/css';
185
+ style.id = 'injectedCSS';
186
+
187
+ if (style.styleSheet) // IE
188
+ style.styleSheet.cssText = css;
189
+ else // other browsers
190
+ style.appendChild(doc.createTextNode(css));
191
+
192
+ doc.getElementsByTagName('head')[0].appendChild(style);
193
+ }
149
194
  });
150
195
 
151
196
  // Register plugin
152
197
  tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);
153
- })();
198
+ })();