summaryrefslogtreecommitdiff
path: root/public/javascripts/tiny_mce/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'public/javascripts/tiny_mce/plugins')
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advhr/css/advhr.css5
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advhr/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js54
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advhr/js/rule.js43
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js5
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advhr/rule.htm63
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advimage/css/advimage.css13
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advimage/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js47
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advimage/image.htm238
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advimage/img/sample.gifbin0 -> 1624 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advimage/js/image.js441
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js43
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advlink/css/advlink.css8
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advlink/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js58
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advlink/js/advlink.js527
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js52
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/advlink/link.htm339
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/autosave/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js51
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js117
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/compat2x/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js616
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js95
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/directionality/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js79
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js40
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/emotions.htm41
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gifbin0 -> 354 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gifbin0 -> 329 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gifbin0 -> 331 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gifbin0 -> 344 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gifbin0 -> 340 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gifbin0 -> 336 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gifbin0 -> 338 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gifbin0 -> 344 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gifbin0 -> 321 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gifbin0 -> 325 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gifbin0 -> 345 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gifbin0 -> 342 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gifbin0 -> 328 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gifbin0 -> 337 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gifbin0 -> 351 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gifbin0 -> 336 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/js/emotions.js22
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js20
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/example/dialog.htm27
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/example/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/example/editor_plugin_src.js81
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/example/img/example.gifbin0 -> 87 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/example/js/dialog.js19
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/example/langs/en.js3
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/example/langs/en_dlg.js3
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css182
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js142
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/fullpage.htm577
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js461
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js85
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js145
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm111
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/iespell/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js51
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js632
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gifbin0 -> 818 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gifbin0 -> 280 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gifbin0 -> 1195 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gifbin0 -> 915 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gifbin0 -> 911 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gifbin0 -> 769 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gifbin0 -> 92 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css90
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/inlinepopups/template.htm387
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js80
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/layer/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js209
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/css/content.css6
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/css/media.css16
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/editor_plugin_src.js400
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/img/flash.gifbin0 -> 241 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/img/flv_player.swfbin0 -> 11668 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/img/quicktime.gifbin0 -> 303 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/img/realmedia.gifbin0 -> 439 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/img/shockwave.gifbin0 -> 387 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/img/trans.gifbin0 -> 43 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/img/windowsmedia.gifbin0 -> 415 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/js/embed.js73
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/js/media.js630
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/langs/en_dlg.js103
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/media/media.htm824
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js50
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js87
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/pagebreak/css/content.css1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js74
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gifbin0 -> 325 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/pagebreak/img/trans.gifbin0 -> 43 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/blank.htm22
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/css/blank.css14
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/css/pasteword.css3
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js394
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/js/pastetext.js42
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/js/pasteword.js56
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js5
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/pastetext.htm34
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/paste/pasteword.htm29
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/preview/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js50
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/preview/example.html28
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/preview/jscripts/embed.js73
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/preview/preview.html19
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/print/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/print/editor_plugin_src.js31
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/safari/blank.htm1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/safari/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js514
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/save/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/save/editor_plugin_src.js98
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css6
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js54
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js126
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js16
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm105
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/spellchecker/css/content.css1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js338
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/spellchecker/img/wline.gifbin0 -> 46 bytes
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/style/css/props.css13
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/style/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/style/editor_plugin_src.js52
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/style/js/props.js641
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/style/langs/en_dlg.js63
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/style/props.htm731
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/cell.htm184
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/css/cell.css17
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/css/row.css25
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/css/table.css13
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/editor_plugin_src.js1136
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/js/cell.js269
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/js/merge_cells.js29
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/js/row.js212
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/js/table.js413
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/langs/en_dlg.js74
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/merge_cells.htm38
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/row.htm161
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/table/table.htm193
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/template/blank.htm12
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/template/css/template.css23
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/template/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/template/editor_plugin_src.js156
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/template/js/template.js106
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/template/langs/en_dlg.js15
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/template/template.htm39
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js73
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm149
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm149
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm154
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm149
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css11
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css9
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm170
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js136
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm170
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js25
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js25
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js123
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js25
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js60
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js231
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js59
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js32
186 files changed, 17022 insertions, 0 deletions
diff --git a/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css b/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css
new file mode 100755
index 0000000..0e22834
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css
@@ -0,0 +1,5 @@
1input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
2.panel_wrapper div.current {height:80px;}
3#width {width:50px; vertical-align:middle;}
4#width2 {width:50px; vertical-align:middle;}
5#size {width:100px;}
diff --git a/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js
new file mode 100755
index 0000000..f335004
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.AdvancedHRPlugin',{init:function(ed,url){ed.addCommand('mceAdvancedHr',function(){ed.windowManager.open({file:url+'/rule.htm',width:250+parseInt(ed.getLang('advhr.delta_width',0)),height:160+parseInt(ed.getLang('advhr.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('advhr',{title:'advhr.advhr_desc',cmd:'mceAdvancedHr'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('advhr',n.nodeName=='HR');});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='HR')ed.selection.select(e);});},getInfo:function(){return{longname:'Advanced HR',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advhr',tinymce.plugins.AdvancedHRPlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js
new file mode 100755
index 0000000..8a84753
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js
@@ -0,0 +1,54 @@
1/**
2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
10 init : function(ed, url) {
11 // Register commands
12 ed.addCommand('mceAdvancedHr', function() {
13 ed.windowManager.open({
14 file : url + '/rule.htm',
15 width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
16 height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
17 inline : 1
18 }, {
19 plugin_url : url
20 });
21 });
22
23 // Register buttons
24 ed.addButton('advhr', {
25 title : 'advhr.advhr_desc',
26 cmd : 'mceAdvancedHr'
27 });
28
29 ed.onNodeChange.add(function(ed, cm, n) {
30 cm.setActive('advhr', n.nodeName == 'HR');
31 });
32
33 ed.onClick.add(function(ed, e) {
34 e = e.target;
35
36 if (e.nodeName === 'HR')
37 ed.selection.select(e);
38 });
39 },
40
41 getInfo : function() {
42 return {
43 longname : 'Advanced HR',
44 author : 'Moxiecode Systems AB',
45 authorurl : 'http://tinymce.moxiecode.com',
46 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
47 version : tinymce.majorVersion + "." + tinymce.minorVersion
48 };
49 }
50 });
51
52 // Register plugin
53 tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
54})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advhr/js/rule.js b/public/javascripts/tiny_mce/plugins/advhr/js/rule.js
new file mode 100755
index 0000000..b6cbd66
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advhr/js/rule.js
@@ -0,0 +1,43 @@
1var AdvHRDialog = {
2 init : function(ed) {
3 var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
4
5 w = dom.getAttrib(n, 'width');
6 f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
7 f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
8 f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
9 selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
10 },
11
12 update : function() {
13 var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';
14
15 h = '<hr';
16
17 if (f.size.value) {
18 h += ' size="' + f.size.value + '"';
19 st += ' height:' + f.size.value + 'px;';
20 }
21
22 if (f.width.value) {
23 h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
24 st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
25 }
26
27 if (f.noshade.checked) {
28 h += ' noshade="noshade"';
29 st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
30 }
31
32 if (ed.settings.inline_styles)
33 h += ' style="' + tinymce.trim(st) + '"';
34
35 h += ' />';
36
37 ed.execCommand("mceInsertContent", false, h);
38 tinyMCEPopup.close();
39 }
40};
41
42tinyMCEPopup.requireLangPack();
43tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
diff --git a/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js
new file mode 100755
index 0000000..873bfd8
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js
@@ -0,0 +1,5 @@
1tinyMCE.addI18n('en.advhr_dlg',{
2width:"Width",
3size:"Height",
4noshade:"No shadow"
5}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advhr/rule.htm b/public/javascripts/tiny_mce/plugins/advhr/rule.htm
new file mode 100755
index 0000000..8f20f7f
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advhr/rule.htm
@@ -0,0 +1,63 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#advhr.advhr_desc}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="js/rule.js"></script>
7 <script type="text/javascript" src="../../utils/mctabs.js"></script>
8 <script type="text/javascript" src="../../utils/form_utils.js"></script>
9 <link href="css/advhr.css" rel="stylesheet" type="text/css" />
10 <base target="_self" />
11</head>
12<body>
13<form onsubmit="AdvHRDialog.update();return false;" action="#">
14 <div class="tabs">
15 <ul>
16 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>
17 </ul>
18 </div>
19
20 <div class="panel_wrapper">
21 <div id="general_panel" class="panel current">
22 <table border="0" cellpadding="4" cellspacing="0">
23 <tr>
24 <td><label for="width">{#advhr_dlg.width}</label></td>
25 <td nowrap="nowrap">
26 <input id="width" name="width" type="text" value="" class="mceFocus" />
27 <select name="width2" id="width2">
28 <option value="">px</option>
29 <option value="%">%</option>
30 </select>
31 </td>
32 </tr>
33 <tr>
34 <td><label for="size">{#advhr_dlg.size}</label></td>
35 <td><select id="size" name="size">
36 <option value="">Normal</option>
37 <option value="1">1</option>
38 <option value="2">2</option>
39 <option value="3">3</option>
40 <option value="4">4</option>
41 <option value="5">5</option>
42 </select></td>
43 </tr>
44 <tr>
45 <td><label for="noshade">{#advhr_dlg.noshade}</label></td>
46 <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
47 </tr>
48 </table>
49 </div>
50 </div>
51
52 <div class="mceActionPanel">
53 <div style="float: left">
54 <input type="submit" id="insert" name="insert" value="{#insert}" />
55 </div>
56
57 <div style="float: right">
58 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
59 </div>
60 </div>
61</form>
62</body>
63</html>
diff --git a/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css b/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css
new file mode 100755
index 0000000..0a6251a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css
@@ -0,0 +1,13 @@
1#src_list, #over_list, #out_list {width:280px;}
2.mceActionPanel {margin-top:7px;}
3.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
4.checkbox {border:0;}
5.panel_wrapper div.current {height:305px;}
6#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
7#align, #classlist {width:150px;}
8#width, #height {vertical-align:middle; width:50px; text-align:center;}
9#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
10#class_list {width:180px;}
11input {width: 280px;}
12#constrain, #onmousemovecheck {width:auto;}
13#id, #dir, #lang, #usemap, #longdesc {width:200px;}
diff --git a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js
new file mode 100755
index 0000000..3af5057
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.AdvancedImagePlugin',{init:function(ed,url){ed.addCommand('mceAdvImage',function(){if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({file:url+'/image.htm',width:480+parseInt(ed.getLang('advimage.delta_width',0)),height:385+parseInt(ed.getLang('advimage.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('image',{title:'advimage.image_desc',cmd:'mceAdvImage'});},getInfo:function(){return{longname:'Advanced image',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advimage',tinymce.plugins.AdvancedImagePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js
new file mode 100755
index 0000000..f526842
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js
@@ -0,0 +1,47 @@
1/**
2 * $Id: editor_plugin_src.js 677 2008-03-07 13:52:41Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
10 init : function(ed, url) {
11 // Register commands
12 ed.addCommand('mceAdvImage', function() {
13 // Internal image object like a flash placeholder
14 if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
15 return;
16
17 ed.windowManager.open({
18 file : url + '/image.htm',
19 width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
20 height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
21 inline : 1
22 }, {
23 plugin_url : url
24 });
25 });
26
27 // Register buttons
28 ed.addButton('image', {
29 title : 'advimage.image_desc',
30 cmd : 'mceAdvImage'
31 });
32 },
33
34 getInfo : function() {
35 return {
36 longname : 'Advanced image',
37 author : 'Moxiecode Systems AB',
38 authorurl : 'http://tinymce.moxiecode.com',
39 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
40 version : tinymce.majorVersion + "." + tinymce.minorVersion
41 };
42 }
43 });
44
45 // Register plugin
46 tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
47})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advimage/image.htm b/public/javascripts/tiny_mce/plugins/advimage/image.htm
new file mode 100755
index 0000000..dd84083
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advimage/image.htm
@@ -0,0 +1,238 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#advimage_dlg.dialog_title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="../../utils/validate.js"></script>
9 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
10 <script type="text/javascript" src="js/image.js"></script>
11 <link href="css/advimage.css" rel="stylesheet" type="text/css" />
12 <base target="_self" />
13</head>
14<body id="advimage" style="display: none">
15 <form onsubmit="ImageDialog.insert();return false;" action="#">
16 <div class="tabs">
17 <ul>
18 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>
19 <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>
20 <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>
21 </ul>
22 </div>
23
24 <div class="panel_wrapper">
25 <div id="general_panel" class="panel current">
26 <fieldset>
27 <legend>{#advimage_dlg.general}</legend>
28
29 <table class="properties">
30 <tr>
31 <td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
32 <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
33 <tr>
34 <td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td>
35 <td id="srcbrowsercontainer">&nbsp;</td>
36 </tr>
37 </table></td>
38 </tr>
39 <tr>
40 <td><label for="src_list">{#advimage_dlg.image_list}</label></td>
41 <td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"></select></td>
42 </tr>
43 <tr>
44 <td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
45 <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
46 </tr>
47 <tr>
48 <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
49 <td colspan="2"><input id="title" name="title" type="text" value="" /></td>
50 </tr>
51 </table>
52 </fieldset>
53
54 <fieldset>
55 <legend>{#advimage_dlg.preview}</legend>
56 <div id="prev"></div>
57 </fieldset>
58 </div>
59
60 <div id="appearance_panel" class="panel">
61 <fieldset>
62 <legend>{#advimage_dlg.tab_appearance}</legend>
63
64 <table border="0" cellpadding="4" cellspacing="0">
65 <tr>
66 <td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td>
67 <td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();">
68 <option value="">{#not_set}</option>
69 <option value="baseline">{#advimage_dlg.align_baseline}</option>
70 <option value="top">{#advimage_dlg.align_top}</option>
71 <option value="middle">{#advimage_dlg.align_middle}</option>
72 <option value="bottom">{#advimage_dlg.align_bottom}</option>
73 <option value="text-top">{#advimage_dlg.align_texttop}</option>
74 <option value="text-bottom">{#advimage_dlg.align_textbottom}</option>
75 <option value="left">{#advimage_dlg.align_left}</option>
76 <option value="right">{#advimage_dlg.align_right}</option>
77 </select>
78 </td>
79 <td rowspan="6" valign="top">
80 <div class="alignPreview">
81 <img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />
82 Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
83 nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
84 edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
85 erat volutpat.
86 </div>
87 </td>
88 </tr>
89
90 <tr>
91 <td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
92 <td nowrap="nowrap">
93 <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x
94 <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px
95 </td>
96 </tr>
97
98 <tr>
99 <td>&nbsp;</td>
100 <td><table border="0" cellpadding="0" cellspacing="0">
101 <tr>
102 <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
103 <td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>
104 </tr>
105 </table></td>
106 </tr>
107
108 <tr>
109 <td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td>
110 <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />
111 </td>
112 </tr>
113
114 <tr>
115 <td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td>
116 <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td>
117 </tr>
118
119 <tr>
120 <td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td>
121 <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td>
122 </tr>
123
124 <tr>
125 <td><label for="class_list">{#class_name}</label></td>
126 <td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"></select></td>
127 </tr>
128
129 <tr>
130 <td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td>
131 <td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td>
132 </tr>
133
134 <!-- <tr>
135 <td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td>
136 <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
137 </tr> -->
138 </table>
139 </fieldset>
140 </div>
141
142 <div id="advanced_panel" class="panel">
143 <fieldset>
144 <legend>{#advimage_dlg.swap_image}</legend>
145
146 <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" />
147 <label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>
148
149 <table border="0" cellpadding="4" cellspacing="0" width="100%">
150 <tr>
151 <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td>
152 <td><table border="0" cellspacing="0" cellpadding="0">
153 <tr>
154 <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
155 <td id="onmouseoversrccontainer">&nbsp;</td>
156 </tr>
157 </table></td>
158 </tr>
159 <tr>
160 <td><label for="over_list">{#advimage_dlg.image_list}</label></td>
161 <td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"></select></td>
162 </tr>
163 <tr>
164 <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
165 <td class="column2"><table border="0" cellspacing="0" cellpadding="0">
166 <tr>
167 <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
168 <td id="onmouseoutsrccontainer">&nbsp;</td>
169 </tr>
170 </table></td>
171 </tr>
172 <tr>
173 <td><label for="out_list">{#advimage_dlg.image_list}</label></td>
174 <td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"></select></td>
175 </tr>
176 </table>
177 </fieldset>
178
179 <fieldset>
180 <legend>{#advimage_dlg.misc}</legend>
181
182 <table border="0" cellpadding="4" cellspacing="0">
183 <tr>
184 <td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
185 <td><input id="id" name="id" type="text" value="" /></td>
186 </tr>
187
188 <tr>
189 <td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
190 <td>
191 <select id="dir" name="dir" onchange="ImageDialog.changeAppearance();">
192 <option value="">{#not_set}</option>
193 <option value="ltr">{#advimage_dlg.ltr}</option>
194 <option value="rtl">{#advimage_dlg.rtl}</option>
195 </select>
196 </td>
197 </tr>
198
199 <tr>
200 <td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td>
201 <td>
202 <input id="lang" name="lang" type="text" value="" />
203 </td>
204 </tr>
205
206 <tr>
207 <td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td>
208 <td>
209 <input id="usemap" name="usemap" type="text" value="" />
210 </td>
211 </tr>
212
213 <tr>
214 <td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>
215 <td><table border="0" cellspacing="0" cellpadding="0">
216 <tr>
217 <td><input id="longdesc" name="longdesc" type="text" value="" /></td>
218 <td id="longdesccontainer">&nbsp;</td>
219 </tr>
220 </table></td>
221 </tr>
222 </table>
223 </fieldset>
224 </div>
225 </div>
226
227 <div class="mceActionPanel">
228 <div style="float: left">
229 <input type="submit" id="insert" name="insert" value="{#insert}" />
230 </div>
231
232 <div style="float: right">
233 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
234 </div>
235 </div>
236 </form>
237</body>
238</html>
diff --git a/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif b/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif
new file mode 100755
index 0000000..53bf689
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/advimage/js/image.js b/public/javascripts/tiny_mce/plugins/advimage/js/image.js
new file mode 100755
index 0000000..64fc6f6
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advimage/js/image.js
@@ -0,0 +1,441 @@
1var ImageDialog = {
2 preInit : function() {
3 var url;
4
5 tinyMCEPopup.requireLangPack();
6
7 if (url = tinyMCEPopup.getParam("external_image_list_url"))
8 document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
9 },
10
11 init : function(ed) {
12 var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();
13
14 tinyMCEPopup.resizeToInnerSize();
15 this.fillClassList('class_list');
16 this.fillFileList('src_list', 'tinyMCEImageList');
17 this.fillFileList('over_list', 'tinyMCEImageList');
18 this.fillFileList('out_list', 'tinyMCEImageList');
19 TinyMCE_EditableSelects.init();
20
21 if (n.nodeName == 'IMG') {
22 nl.src.value = dom.getAttrib(n, 'src');
23 nl.width.value = dom.getAttrib(n, 'width');
24 nl.height.value = dom.getAttrib(n, 'height');
25 nl.alt.value = dom.getAttrib(n, 'alt');
26 nl.title.value = dom.getAttrib(n, 'title');
27 nl.vspace.value = this.getAttrib(n, 'vspace');
28 nl.hspace.value = this.getAttrib(n, 'hspace');
29 nl.border.value = this.getAttrib(n, 'border');
30 selectByValue(f, 'align', this.getAttrib(n, 'align'));
31 selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);
32 nl.style.value = dom.getAttrib(n, 'style');
33 nl.id.value = dom.getAttrib(n, 'id');
34 nl.dir.value = dom.getAttrib(n, 'dir');
35 nl.lang.value = dom.getAttrib(n, 'lang');
36 nl.usemap.value = dom.getAttrib(n, 'usemap');
37 nl.longdesc.value = dom.getAttrib(n, 'longdesc');
38 nl.insert.value = ed.getLang('update');
39
40 if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))
41 nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
42
43 if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))
44 nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
45
46 if (ed.settings.inline_styles) {
47 // Move attribs to styles
48 if (dom.getAttrib(n, 'align'))
49 this.updateStyle('align');
50
51 if (dom.getAttrib(n, 'hspace'))
52 this.updateStyle('hspace');
53
54 if (dom.getAttrib(n, 'border'))
55 this.updateStyle('border');
56
57 if (dom.getAttrib(n, 'vspace'))
58 this.updateStyle('vspace');
59 }
60 }
61
62 // Setup browse button
63 document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
64 if (isVisible('srcbrowser'))
65 document.getElementById('src').style.width = '260px';
66
67 // Setup browse button
68 document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');
69 if (isVisible('overbrowser'))
70 document.getElementById('onmouseoversrc').style.width = '260px';
71
72 // Setup browse button
73 document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');
74 if (isVisible('outbrowser'))
75 document.getElementById('onmouseoutsrc').style.width = '260px';
76
77 // If option enabled default contrain proportions to checked
78 if (ed.getParam("advimage_constrain_proportions", true))
79 f.constrain.checked = true;
80
81 // Check swap image if valid data
82 if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)
83 this.setSwapImage(true);
84 else
85 this.setSwapImage(false);
86
87 this.changeAppearance();
88 this.showPreviewImage(nl.src.value, 1);
89 },
90
91 insert : function(file, title) {
92 var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
93
94 if (f.src.value === '') {
95 if (ed.selection.getNode().nodeName == 'IMG') {
96 ed.dom.remove(ed.selection.getNode());
97 ed.execCommand('mceRepaint');
98 }
99
100 tinyMCEPopup.close();
101 return;
102 }
103
104 if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
105 if (!f.alt.value) {
106 tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
107 if (s)
108 t.insertAndClose();
109 });
110
111 return;
112 }
113 }
114
115 t.insertAndClose();
116 },
117
118 insertAndClose : function() {
119 var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
120
121 tinyMCEPopup.restoreSelection();
122
123 // Fixes crash in Safari
124 if (tinymce.isWebKit)
125 ed.getWin().focus();
126
127 if (!ed.settings.inline_styles) {
128 args = {
129 vspace : nl.vspace.value,
130 hspace : nl.hspace.value,
131 border : nl.border.value,
132 align : getSelectValue(f, 'align')
133 };
134 } else {
135 // Remove deprecated values
136 args = {
137 vspace : '',
138 hspace : '',
139 border : '',
140 align : ''
141 };
142 }
143
144 tinymce.extend(args, {
145 src : nl.src.value,
146 width : nl.width.value,
147 height : nl.height.value,
148 alt : nl.alt.value,
149 title : nl.title.value,
150 'class' : getSelectValue(f, 'class_list'),
151 style : nl.style.value,
152 id : nl.id.value,
153 dir : nl.dir.value,
154 lang : nl.lang.value,
155 usemap : nl.usemap.value,
156 longdesc : nl.longdesc.value
157 });
158
159 args.onmouseover = args.onmouseout = '';
160
161 if (f.onmousemovecheck.checked) {
162 if (nl.onmouseoversrc.value)
163 args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";
164
165 if (nl.onmouseoutsrc.value)
166 args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";
167 }
168
169 el = ed.selection.getNode();
170
171 if (el && el.nodeName == 'IMG') {
172 ed.dom.setAttribs(el, args);
173 } else {
174 ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
175 ed.dom.setAttribs('__mce_tmp', args);
176 ed.dom.setAttrib('__mce_tmp', 'id', '');
177 ed.undoManager.add();
178 }
179
180 tinyMCEPopup.close();
181 },
182
183 getAttrib : function(e, at) {
184 var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
185
186 if (ed.settings.inline_styles) {
187 switch (at) {
188 case 'align':
189 if (v = dom.getStyle(e, 'float'))
190 return v;
191
192 if (v = dom.getStyle(e, 'vertical-align'))
193 return v;
194
195 break;
196
197 case 'hspace':
198 v = dom.getStyle(e, 'margin-left')
199 v2 = dom.getStyle(e, 'margin-right');
200
201 if (v && v == v2)
202 return parseInt(v.replace(/[^0-9]/g, ''));
203
204 break;
205
206 case 'vspace':
207 v = dom.getStyle(e, 'margin-top')
208 v2 = dom.getStyle(e, 'margin-bottom');
209 if (v && v == v2)
210 return parseInt(v.replace(/[^0-9]/g, ''));
211
212 break;
213
214 case 'border':
215 v = 0;
216
217 tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
218 sv = dom.getStyle(e, 'border-' + sv + '-width');
219
220 // False or not the same as prev
221 if (!sv || (sv != v && v !== 0)) {
222 v = 0;
223 return false;
224 }
225
226 if (sv)
227 v = sv;
228 });
229
230 if (v)
231 return parseInt(v.replace(/[^0-9]/g, ''));
232
233 break;
234 }
235 }
236
237 if (v = dom.getAttrib(e, at))
238 return v;
239
240 return '';
241 },
242
243 setSwapImage : function(st) {
244 var f = document.forms[0];
245
246 f.onmousemovecheck.checked = st;
247 setBrowserDisabled('overbrowser', !st);
248 setBrowserDisabled('outbrowser', !st);
249
250 if (f.over_list)
251 f.over_list.disabled = !st;
252
253 if (f.out_list)
254 f.out_list.disabled = !st;
255
256 f.onmouseoversrc.disabled = !st;
257 f.onmouseoutsrc.disabled = !st;
258 },
259
260 fillClassList : function(id) {
261 var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
262
263 if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
264 cl = [];
265
266 tinymce.each(v.split(';'), function(v) {
267 var p = v.split('=');
268
269 cl.push({'title' : p[0], 'class' : p[1]});
270 });
271 } else
272 cl = tinyMCEPopup.editor.dom.getClasses();
273
274 if (cl.length > 0) {
275 lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
276
277 tinymce.each(cl, function(o) {
278 lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
279 });
280 } else
281 dom.remove(dom.getParent(id, 'tr'));
282 },
283
284 fillFileList : function(id, l) {
285 var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
286
287 l = window[l];
288
289 if (l && l.length > 0) {
290 lst.options[lst.options.length] = new Option('', '');
291
292 tinymce.each(l, function(o) {
293 lst.options[lst.options.length] = new Option(o[0], o[1]);
294 });
295 } else
296 dom.remove(dom.getParent(id, 'tr'));
297 },
298
299 resetImageData : function() {
300 var f = document.forms[0];
301
302 f.elements.width.value = f.elements.height.value = '';
303 },
304
305 updateImageData : function(img, st) {
306 var f = document.forms[0];
307
308 if (!st) {
309 f.elements.width.value = img.width;
310 f.elements.height.value = img.height;
311 }
312
313 this.preloadImg = img;
314 },
315
316 changeAppearance : function() {
317 var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');
318
319 if (img) {
320 if (ed.getParam('inline_styles')) {
321 ed.dom.setAttrib(img, 'style', f.style.value);
322 } else {
323 img.align = f.align.value;
324 img.border = f.border.value;
325 img.hspace = f.hspace.value;
326 img.vspace = f.vspace.value;
327 }
328 }
329 },
330
331 changeHeight : function() {
332 var f = document.forms[0], tp, t = this;
333
334 if (!f.constrain.checked || !t.preloadImg) {
335 return;
336 }
337
338 if (f.width.value == "" || f.height.value == "")
339 return;
340
341 tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;
342 f.height.value = tp.toFixed(0);
343 },
344
345 changeWidth : function() {
346 var f = document.forms[0], tp, t = this;
347
348 if (!f.constrain.checked || !t.preloadImg) {
349 return;
350 }
351
352 if (f.width.value == "" || f.height.value == "")
353 return;
354
355 tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;
356 f.width.value = tp.toFixed(0);
357 },
358
359 updateStyle : function(ty) {
360 var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
361
362 if (tinyMCEPopup.editor.settings.inline_styles) {
363 // Handle align
364 if (ty == 'align') {
365 dom.setStyle(img, 'float', '');
366 dom.setStyle(img, 'vertical-align', '');
367
368 v = getSelectValue(f, 'align');
369 if (v) {
370 if (v == 'left' || v == 'right')
371 dom.setStyle(img, 'float', v);
372 else
373 img.style.verticalAlign = v;
374 }
375 }
376
377 // Handle border
378 if (ty == 'border') {
379 dom.setStyle(img, 'border', '');
380
381 v = f.border.value;
382 if (v || v == '0') {
383 if (v == '0')
384 img.style.border = '0';
385 else
386 img.style.border = v + 'px solid black';
387 }
388 }
389
390 // Handle hspace
391 if (ty == 'hspace') {
392 dom.setStyle(img, 'marginLeft', '');
393 dom.setStyle(img, 'marginRight', '');
394
395 v = f.hspace.value;
396 if (v) {
397 img.style.marginLeft = v + 'px';
398 img.style.marginRight = v + 'px';
399 }
400 }
401
402 // Handle vspace
403 if (ty == 'vspace') {
404 dom.setStyle(img, 'marginTop', '');
405 dom.setStyle(img, 'marginBottom', '');
406
407 v = f.vspace.value;
408 if (v) {
409 img.style.marginTop = v + 'px';
410 img.style.marginBottom = v + 'px';
411 }
412 }
413
414 // Merge
415 dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText));
416 }
417 },
418
419 changeMouseMove : function() {
420 },
421
422 showPreviewImage : function(u, st) {
423 if (!u) {
424 tinyMCEPopup.dom.setHTML('prev', '');
425 return;
426 }
427
428 if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
429 this.resetImageData();
430
431 u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
432
433 if (!st)
434 tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
435 else
436 tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
437 }
438};
439
440ImageDialog.preInit();
441tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
diff --git a/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js
new file mode 100755
index 0000000..f493d19
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js
@@ -0,0 +1,43 @@
1tinyMCE.addI18n('en.advimage_dlg',{
2tab_general:"General",
3tab_appearance:"Appearance",
4tab_advanced:"Advanced",
5general:"General",
6title:"Title",
7preview:"Preview",
8constrain_proportions:"Constrain proportions",
9langdir:"Language direction",
10langcode:"Language code",
11long_desc:"Long description link",
12style:"Style",
13classes:"Classes",
14ltr:"Left to right",
15rtl:"Right to left",
16id:"Id",
17map:"Image map",
18swap_image:"Swap image",
19alt_image:"Alternative image",
20mouseover:"for mouse over",
21mouseout:"for mouse out",
22misc:"Miscellaneous",
23example_img:"Appearance preview image",
24missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.",
25dialog_title:"Insert/edit image",
26src:"Image URL",
27alt:"Image description",
28list:"Image list",
29border:"Border",
30dimensions:"Dimensions",
31vspace:"Vertical space",
32hspace:"Horizontal space",
33align:"Alignment",
34align_baseline:"Baseline",
35align_top:"Top",
36align_middle:"Middle",
37align_bottom:"Bottom",
38align_texttop:"Text top",
39align_textbottom:"Text bottom",
40align_left:"Left",
41align_right:"Right",
42image_list:"Image list"
43}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css b/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css
new file mode 100755
index 0000000..1436431
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css
@@ -0,0 +1,8 @@
1.mceLinkList, .mceAnchorList, #targetlist {width:280px;}
2.mceActionPanel {margin-top:7px;}
3.panel_wrapper div.current {height:320px;}
4#classlist, #title, #href {width:280px;}
5#popupurl, #popupname {width:200px;}
6#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
7#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
8#events_panel input {width:200px;}
diff --git a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js
new file mode 100755
index 0000000..4899f7b
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.AdvancedLinkPlugin',{init:function(ed,url){this.editor=ed;ed.addCommand('mceAdvLink',function(){var se=ed.selection;if(se.isCollapsed()&&!ed.dom.getParent(se.getNode(),'A'))return;ed.windowManager.open({file:url+'/link.htm',width:480+parseInt(ed.getLang('advlink.delta_width',0)),height:400+parseInt(ed.getLang('advlink.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('link',{title:'advlink.link_desc',cmd:'mceAdvLink'});ed.addShortcut('ctrl+k','advlink.advlink_desc','mceAdvLink');ed.onNodeChange.add(function(ed,cm,n,co){cm.setDisabled('link',co&&n.nodeName!='A');cm.setActive('link',n.nodeName=='A'&&!n.name);});},getInfo:function(){return{longname:'Advanced link',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advlink',tinymce.plugins.AdvancedLinkPlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js
new file mode 100755
index 0000000..fc5325a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js
@@ -0,0 +1,58 @@
1/**
2 * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {
10 init : function(ed, url) {
11 this.editor = ed;
12
13 // Register commands
14 ed.addCommand('mceAdvLink', function() {
15 var se = ed.selection;
16
17 // No selection and not in link
18 if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
19 return;
20
21 ed.windowManager.open({
22 file : url + '/link.htm',
23 width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
24 height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
25 inline : 1
26 }, {
27 plugin_url : url
28 });
29 });
30
31 // Register buttons
32 ed.addButton('link', {
33 title : 'advlink.link_desc',
34 cmd : 'mceAdvLink'
35 });
36
37 ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
38
39 ed.onNodeChange.add(function(ed, cm, n, co) {
40 cm.setDisabled('link', co && n.nodeName != 'A');
41 cm.setActive('link', n.nodeName == 'A' && !n.name);
42 });
43 },
44
45 getInfo : function() {
46 return {
47 longname : 'Advanced link',
48 author : 'Moxiecode Systems AB',
49 authorurl : 'http://tinymce.moxiecode.com',
50 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
51 version : tinymce.majorVersion + "." + tinymce.minorVersion
52 };
53 }
54 });
55
56 // Register plugin
57 tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
58})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js b/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js
new file mode 100755
index 0000000..a896250
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js
@@ -0,0 +1,527 @@
1/* Functions for the advlink plugin popup */
2
3tinyMCEPopup.requireLangPack();
4
5var templates = {
6 "window.open" : "window.open('${url}','${target}','${options}')"
7};
8
9function preinit() {
10 var url;
11
12 if (url = tinyMCEPopup.getParam("external_link_list_url"))
13 document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
14}
15
16function changeClass() {
17 var f = document.forms[0];
18
19 f.classes.value = getSelectValue(f, 'classlist');
20}
21
22function init() {
23 tinyMCEPopup.resizeToInnerSize();
24
25 var formObj = document.forms[0];
26 var inst = tinyMCEPopup.editor;
27 var elm = inst.selection.getNode();
28 var action = "insert";
29 var html;
30
31 document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
32 document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
33 document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');
34 document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');
35 document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
36
37 // Link list
38 html = getLinkListHTML('linklisthref','href');
39 if (html == "")
40 document.getElementById("linklisthrefrow").style.display = 'none';
41 else
42 document.getElementById("linklisthrefcontainer").innerHTML = html;
43
44 // Resize some elements
45 if (isVisible('hrefbrowser'))
46 document.getElementById('href').style.width = '260px';
47
48 if (isVisible('popupurlbrowser'))
49 document.getElementById('popupurl').style.width = '180px';
50
51 elm = inst.dom.getParent(elm, "A");
52 if (elm != null && elm.nodeName == "A")
53 action = "update";
54
55 formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
56
57 setPopupControlsDisabled(true);
58
59 if (action == "update") {
60 var href = inst.dom.getAttrib(elm, 'href');
61 var onclick = inst.dom.getAttrib(elm, 'onclick');
62
63 // Setup form data
64 setFormValue('href', href);
65 setFormValue('title', inst.dom.getAttrib(elm, 'title'));
66 setFormValue('id', inst.dom.getAttrib(elm, 'id'));
67 setFormValue('style', inst.dom.getAttrib(elm, "style"));
68 setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));
69 setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));
70 setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));
71 setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));
72 setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));
73 setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));
74 setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
75 setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
76 setFormValue('type', inst.dom.getAttrib(elm, 'type'));
77 setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));
78 setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));
79 setFormValue('onclick', onclick);
80 setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));
81 setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));
82 setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));
83 setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));
84 setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));
85 setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));
86 setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
87 setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
88 setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
89 setFormValue('target', inst.dom.getAttrib(elm, 'target'));
90 setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
91
92 // Parse onclick data
93 if (onclick != null && onclick.indexOf('window.open') != -1)
94 parseWindowOpen(onclick);
95 else
96 parseFunction(onclick);
97
98 // Select by the values
99 selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));
100 selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));
101 selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));
102 selectByValue(formObj, 'linklisthref', href);
103
104 if (href.charAt(0) == '#')
105 selectByValue(formObj, 'anchorlist', href);
106
107 addClassesToList('classlist', 'advlink_styles');
108
109 selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
110 selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);
111 } else
112 addClassesToList('classlist', 'advlink_styles');
113}
114
115function checkPrefix(n) {
116 if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
117 n.value = 'mailto:' + n.value;
118
119 if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
120 n.value = 'http://' + n.value;
121}
122
123function setFormValue(name, value) {
124 document.forms[0].elements[name].value = value;
125}
126
127function parseWindowOpen(onclick) {
128 var formObj = document.forms[0];
129
130 // Preprocess center code
131 if (onclick.indexOf('return false;') != -1) {
132 formObj.popupreturn.checked = true;
133 onclick = onclick.replace('return false;', '');
134 } else
135 formObj.popupreturn.checked = false;
136
137 var onClickData = parseLink(onclick);
138
139 if (onClickData != null) {
140 formObj.ispopup.checked = true;
141 setPopupControlsDisabled(false);
142
143 var onClickWindowOptions = parseOptions(onClickData['options']);
144 var url = onClickData['url'];
145
146 formObj.popupname.value = onClickData['target'];
147 formObj.popupurl.value = url;
148 formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
149 formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
150
151 formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
152 formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
153
154 if (formObj.popupleft.value.indexOf('screen') != -1)
155 formObj.popupleft.value = "c";
156
157 if (formObj.popuptop.value.indexOf('screen') != -1)
158 formObj.popuptop.value = "c";
159
160 formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
161 formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
162 formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
163 formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
164 formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
165 formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
166 formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
167
168 buildOnClick();
169 }
170}
171
172function parseFunction(onclick) {
173 var formObj = document.forms[0];
174 var onClickData = parseLink(onclick);
175
176 // TODO: Add stuff here
177}
178
179function getOption(opts, name) {
180 return typeof(opts[name]) == "undefined" ? "" : opts[name];
181}
182
183function setPopupControlsDisabled(state) {
184 var formObj = document.forms[0];
185
186 formObj.popupname.disabled = state;
187 formObj.popupurl.disabled = state;
188 formObj.popupwidth.disabled = state;
189 formObj.popupheight.disabled = state;
190 formObj.popupleft.disabled = state;
191 formObj.popuptop.disabled = state;
192 formObj.popuplocation.disabled = state;
193 formObj.popupscrollbars.disabled = state;
194 formObj.popupmenubar.disabled = state;
195 formObj.popupresizable.disabled = state;
196 formObj.popuptoolbar.disabled = state;
197 formObj.popupstatus.disabled = state;
198 formObj.popupreturn.disabled = state;
199 formObj.popupdependent.disabled = state;
200
201 setBrowserDisabled('popupurlbrowser', state);
202}
203
204function parseLink(link) {
205 link = link.replace(new RegExp('&#39;', 'g'), "'");
206
207 var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
208
209 // Is function name a template function
210 var template = templates[fnName];
211 if (template) {
212 // Build regexp
213 var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
214 var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
215 var replaceStr = "";
216 for (var i=0; i<variableNames.length; i++) {
217 // Is string value
218 if (variableNames[i].indexOf("'${") != -1)
219 regExp += "'(.*)'";
220 else // Number value
221 regExp += "([0-9]*)";
222
223 replaceStr += "$" + (i+1);
224
225 // Cleanup variable name
226 variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
227
228 if (i != variableNames.length-1) {
229 regExp += "\\s*,\\s*";
230 replaceStr += "<delim>";
231 } else
232 regExp += ".*";
233 }
234
235 regExp += "\\);?";
236
237 // Build variable array
238 var variables = [];
239 variables["_function"] = fnName;
240 var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
241 for (var i=0; i<variableNames.length; i++)
242 variables[variableNames[i]] = variableValues[i];
243
244 return variables;
245 }
246
247 return null;
248}
249
250function parseOptions(opts) {
251 if (opts == null || opts == "")
252 return [];
253
254 // Cleanup the options
255 opts = opts.toLowerCase();
256 opts = opts.replace(/;/g, ",");
257 opts = opts.replace(/[^0-9a-z=,]/g, "");
258
259 var optionChunks = opts.split(',');
260 var options = [];
261
262 for (var i=0; i<optionChunks.length; i++) {
263 var parts = optionChunks[i].split('=');
264
265 if (parts.length == 2)
266 options[parts[0]] = parts[1];
267 }
268
269 return options;
270}
271
272function buildOnClick() {
273 var formObj = document.forms[0];
274
275 if (!formObj.ispopup.checked) {
276 formObj.onclick.value = "";
277 return;
278 }
279
280 var onclick = "window.open('";
281 var url = formObj.popupurl.value;
282
283 onclick += url + "','";
284 onclick += formObj.popupname.value + "','";
285
286 if (formObj.popuplocation.checked)
287 onclick += "location=yes,";
288
289 if (formObj.popupscrollbars.checked)
290 onclick += "scrollbars=yes,";
291
292 if (formObj.popupmenubar.checked)
293 onclick += "menubar=yes,";
294
295 if (formObj.popupresizable.checked)
296 onclick += "resizable=yes,";
297
298 if (formObj.popuptoolbar.checked)
299 onclick += "toolbar=yes,";
300
301 if (formObj.popupstatus.checked)
302 onclick += "status=yes,";
303
304 if (formObj.popupdependent.checked)
305 onclick += "dependent=yes,";
306
307 if (formObj.popupwidth.value != "")
308 onclick += "width=" + formObj.popupwidth.value + ",";
309
310 if (formObj.popupheight.value != "")
311 onclick += "height=" + formObj.popupheight.value + ",";
312
313 if (formObj.popupleft.value != "") {
314 if (formObj.popupleft.value != "c")
315 onclick += "left=" + formObj.popupleft.value + ",";
316 else
317 onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
318 }
319
320 if (formObj.popuptop.value != "") {
321 if (formObj.popuptop.value != "c")
322 onclick += "top=" + formObj.popuptop.value + ",";
323 else
324 onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
325 }
326
327 if (onclick.charAt(onclick.length-1) == ',')
328 onclick = onclick.substring(0, onclick.length-1);
329
330 onclick += "');";
331
332 if (formObj.popupreturn.checked)
333 onclick += "return false;";
334
335 // tinyMCE.debug(onclick);
336
337 formObj.onclick.value = onclick;
338
339 if (formObj.href.value == "")
340 formObj.href.value = url;
341}
342
343function setAttrib(elm, attrib, value) {
344 var formObj = document.forms[0];
345 var valueElm = formObj.elements[attrib.toLowerCase()];
346 var dom = tinyMCEPopup.editor.dom;
347
348 if (typeof(value) == "undefined" || value == null) {
349 value = "";
350
351 if (valueElm)
352 value = valueElm.value;
353 }
354
355 // Clean up the style
356 if (attrib == 'style')
357 value = dom.serializeStyle(dom.parseStyle(value));
358
359 dom.setAttrib(elm, attrib, value);
360}
361
362function getAnchorListHTML(id, target) {
363 var inst = tinyMCEPopup.editor;
364 var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i;
365 var html = "";
366
367 html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';
368 html += 'this.options[this.selectedIndex].value;">';
369 html += '<option value="">---</option>';
370
371 for (i=0; i<nodes.length; i++) {
372 if ((name = inst.dom.getAttrib(nodes[i], "name")) != "")
373 html += '<option value="#' + name + '">' + name + '</option>';
374 }
375
376 html += '</select>';
377
378 return html;
379}
380
381function insertAction() {
382 var inst = tinyMCEPopup.editor;
383 var elm, elementArray, i;
384
385 elm = inst.selection.getNode();
386 checkPrefix(document.forms[0].href);
387
388 elm = inst.dom.getParent(elm, "A");
389
390 // Remove element if there is no href
391 if (!document.forms[0].href.value) {
392 tinyMCEPopup.execCommand("mceBeginUndoLevel");
393 i = inst.selection.getBookmark();
394 inst.dom.remove(elm, 1);
395 inst.selection.moveToBookmark(i);
396 tinyMCEPopup.execCommand("mceEndUndoLevel");
397 tinyMCEPopup.close();
398 return;
399 }
400
401 tinyMCEPopup.execCommand("mceBeginUndoLevel");
402
403 // Create new anchor elements
404 if (elm == null) {
405 tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
406
407 elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
408 for (i=0; i<elementArray.length; i++)
409 setAllAttribs(elm = elementArray[i]);
410 } else
411 setAllAttribs(elm);
412
413 // Don't move caret if selection was image
414 if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {
415 inst.focus();
416 inst.selection.select(elm);
417 inst.selection.collapse(0);
418 tinyMCEPopup.storeSelection();
419 }
420
421 tinyMCEPopup.execCommand("mceEndUndoLevel");
422 tinyMCEPopup.close();
423}
424
425function setAllAttribs(elm) {
426 var formObj = document.forms[0];
427 var href = formObj.href.value;
428 var target = getSelectValue(formObj, 'targetlist');
429
430 setAttrib(elm, 'href', href);
431 setAttrib(elm, 'title');
432 setAttrib(elm, 'target', target == '_self' ? '' : target);
433 setAttrib(elm, 'id');
434 setAttrib(elm, 'style');
435 setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
436 setAttrib(elm, 'rel');
437 setAttrib(elm, 'rev');
438 setAttrib(elm, 'charset');
439 setAttrib(elm, 'hreflang');
440 setAttrib(elm, 'dir');
441 setAttrib(elm, 'lang');
442 setAttrib(elm, 'tabindex');
443 setAttrib(elm, 'accesskey');
444 setAttrib(elm, 'type');
445 setAttrib(elm, 'onfocus');
446 setAttrib(elm, 'onblur');
447 setAttrib(elm, 'onclick');
448 setAttrib(elm, 'ondblclick');
449 setAttrib(elm, 'onmousedown');
450 setAttrib(elm, 'onmouseup');
451 setAttrib(elm, 'onmouseover');
452 setAttrib(elm, 'onmousemove');
453 setAttrib(elm, 'onmouseout');
454 setAttrib(elm, 'onkeypress');
455 setAttrib(elm, 'onkeydown');
456 setAttrib(elm, 'onkeyup');
457
458 // Refresh in old MSIE
459 if (tinyMCE.isMSIE5)
460 elm.outerHTML = elm.outerHTML;
461}
462
463function getSelectValue(form_obj, field_name) {
464 var elm = form_obj.elements[field_name];
465
466 if (!elm || elm.options == null || elm.selectedIndex == -1)
467 return "";
468
469 return elm.options[elm.selectedIndex].value;
470}
471
472function getLinkListHTML(elm_id, target_form_element, onchange_func) {
473 if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
474 return "";
475
476 var html = "";
477
478 html += '<select id="' + elm_id + '" name="' + elm_id + '"';
479 html += ' class="mceLinkList" onfoc2us="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
480 html += 'this.options[this.selectedIndex].value;';
481
482 if (typeof(onchange_func) != "undefined")
483 html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
484
485 html += '"><option value="">---</option>';
486
487 for (var i=0; i<tinyMCELinkList.length; i++)
488 html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
489
490 html += '</select>';
491
492 return html;
493
494 // tinyMCE.debug('-- image list start --', html, '-- image list end --');
495}
496
497function getTargetListHTML(elm_id, target_form_element) {
498 var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
499 var html = '';
500
501 html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
502 html += 'this.options[this.selectedIndex].value;">';
503 html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';
504 html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';
505 html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';
506 html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';
507
508 for (var i=0; i<targets.length; i++) {
509 var key, value;
510
511 if (targets[i] == "")
512 continue;
513
514 key = targets[i].split('=')[0];
515 value = targets[i].split('=')[1];
516
517 html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
518 }
519
520 html += '</select>';
521
522 return html;
523}
524
525// While loading
526preinit();
527tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js
new file mode 100755
index 0000000..c71ffbd
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js
@@ -0,0 +1,52 @@
1tinyMCE.addI18n('en.advlink_dlg',{
2title:"Insert/edit link",
3url:"Link URL",
4target:"Target",
5titlefield:"Title",
6is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
7is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
8list:"Link list",
9general_tab:"General",
10popup_tab:"Popup",
11events_tab:"Events",
12advanced_tab:"Advanced",
13general_props:"General properties",
14popup_props:"Popup properties",
15event_props:"Events",
16advanced_props:"Advanced properties",
17popup_opts:"Options",
18anchor_names:"Anchors",
19target_same:"Open in this window / frame",
20target_parent:"Open in parent window / frame",
21target_top:"Open in top frame (replaces all frames)",
22target_blank:"Open in new window",
23popup:"Javascript popup",
24popup_url:"Popup URL",
25popup_name:"Window name",
26popup_return:"Insert 'return false'",
27popup_scrollbars:"Show scrollbars",
28popup_statusbar:"Show status bar",
29popup_toolbar:"Show toolbars",
30popup_menubar:"Show menu bar",
31popup_location:"Show location bar",
32popup_resizable:"Make window resizable",
33popup_dependent:"Dependent (Mozilla/Firefox only)",
34popup_size:"Size",
35popup_position:"Position (X/Y)",
36id:"Id",
37style:"Style",
38classes:"Classes",
39target_name:"Target name",
40langdir:"Language direction",
41target_langcode:"Target language",
42langcode:"Language code",
43encoding:"Target character encoding",
44mime:"Target MIME type",
45rel:"Relationship page to target",
46rev:"Relationship target to page",
47tabindex:"Tabindex",
48accesskey:"Accesskey",
49ltr:"Left to right",
50rtl:"Right to left",
51link_list:"Link list"
52}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advlink/link.htm b/public/javascripts/tiny_mce/plugins/advlink/link.htm
new file mode 100755
index 0000000..f46e8f8
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/advlink/link.htm
@@ -0,0 +1,339 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#advlink_dlg.title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="../../utils/validate.js"></script>
9 <script type="text/javascript" src="js/advlink.js"></script>
10 <link href="css/advlink.css" rel="stylesheet" type="text/css" />
11 <base target="_self" />
12</head>
13<body id="advlink" style="display: none">
14 <form onsubmit="insertAction();return false;" action="#">
15 <div class="tabs">
16 <ul>
17 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li>
18 <li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li>
19 <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li>
20 <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li>
21 </ul>
22 </div>
23
24 <div class="panel_wrapper">
25 <div id="general_panel" class="panel current">
26 <fieldset>
27 <legend>{#advlink_dlg.general_props}</legend>
28
29 <table border="0" cellpadding="4" cellspacing="0">
30 <tr>
31 <td nowrap="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>
32 <td><table border="0" cellspacing="0" cellpadding="0">
33 <tr>
34 <td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>
35 <td id="hrefbrowsercontainer">&nbsp;</td>
36 </tr>
37 </table></td>
38 </tr>
39 <tr id="linklisthrefrow">
40 <td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>
41 <td colspan="2" id="linklisthrefcontainer">&nbsp;</td>
42 </tr>
43 <tr>
44 <td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>
45 <td colspan="2" id="anchorlistcontainer">&nbsp;</td>
46 </tr>
47 <tr>
48 <td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>
49 <td id="targetlistcontainer">&nbsp;</td>
50 </tr>
51 <tr>
52 <td nowrap="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>
53 <td><input id="title" name="title" type="text" value="" /></td>
54 </tr>
55 <tr>
56 <td><label id="classlabel" for="classlist">{#class_name}</label></td>
57 <td>
58 <select id="classlist" name="classlist" onchange="changeClass();">
59 <option value="" selected>{#not_set}</option>
60 </select>
61 </td>
62 </tr>
63 </table>
64 </fieldset>
65 </div>
66
67 <div id="popup_panel" class="panel">
68 <fieldset>
69 <legend>{#advlink_dlg.popup_props}</legend>
70
71 <input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />
72 <label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label>
73
74 <table border="0" cellpadding="0" cellspacing="4">
75 <tr>
76 <td nowrap="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label>&nbsp;</td>
77 <td>
78 <table border="0" cellspacing="0" cellpadding="0">
79 <tr>
80 <td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>
81 <td id="popupurlbrowsercontainer">&nbsp;</td>
82 </tr>
83 </table>
84 </td>
85 </tr>
86 <tr>
87 <td nowrap="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label>&nbsp;</td>
88 <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
89 </tr>
90 <tr>
91 <td nowrap="nowrap"><label>{#advlink_dlg.popup_size}</label>&nbsp;</td>
92 <td nowrap="nowrap">
93 <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x
94 <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px
95 </td>
96 </tr>
97 <tr>
98 <td nowrap="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label>&nbsp;</td>
99 <td nowrap="nowrap">
100 <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /
101 <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)
102 </td>
103 </tr>
104 </table>
105
106 <fieldset>
107 <legend>{#advlink_dlg.popup_opts}</legend>
108
109 <table border="0" cellpadding="0" cellspacing="4">
110 <tr>
111 <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
112 <td nowrap="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
113 <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
114 <td nowrap="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
115 </tr>
116 <tr>
117 <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
118 <td nowrap="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
119 <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
120 <td nowrap="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
121 </tr>
122 <tr>
123 <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
124 <td nowrap="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
125 <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
126 <td nowrap="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
127 </tr>
128 <tr>
129 <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
130 <td nowrap="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
131 <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
132 <td nowrap="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
133 </tr>
134 </table>
135 </fieldset>
136 </fieldset>
137 </div>
138
139 <div id="advanced_panel" class="panel">
140 <fieldset>
141 <legend>{#advlink_dlg.advanced_props}</legend>
142
143 <table border="0" cellpadding="0" cellspacing="4">
144 <tr>
145 <td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td>
146 <td><input id="id" name="id" type="text" value="" /></td>
147 </tr>
148
149 <tr>
150 <td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>
151 <td><input type="text" id="style" name="style" value="" /></td>
152 </tr>
153
154 <tr>
155 <td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>
156 <td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
157 </tr>
158
159 <tr>
160 <td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>
161 <td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
162 </tr>
163
164 <tr>
165 <td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td>
166 <td>
167 <select id="dir" name="dir">
168 <option value="">{#not_set}</option>
169 <option value="ltr">{#advlink_dlg.ltr}</option>
170 <option value="rtl">{#advlink_dlg.rtl}</option>
171 </select>
172 </td>
173 </tr>
174
175 <tr>
176 <td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>
177 <td><input type="text" id="hreflang" name="hreflang" value="" /></td>
178 </tr>
179
180 <tr>
181 <td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td>
182 <td>
183 <input id="lang" name="lang" type="text" value="" />
184 </td>
185 </tr>
186
187 <tr>
188 <td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>
189 <td><input type="text" id="charset" name="charset" value="" /></td>
190 </tr>
191
192 <tr>
193 <td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>
194 <td><input type="text" id="type" name="type" value="" /></td>
195 </tr>
196
197 <tr>
198 <td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>
199 <td><select id="rel" name="rel">
200 <option value="">{#not_set}</option>
201 <option value="lightbox">Lightbox</option>
202 <option value="alternate">Alternate</option>
203 <option value="designates">Designates</option>
204 <option value="stylesheet">Stylesheet</option>
205 <option value="start">Start</option>
206 <option value="next">Next</option>
207 <option value="prev">Prev</option>
208 <option value="contents">Contents</option>
209 <option value="index">Index</option>
210 <option value="glossary">Glossary</option>
211 <option value="copyright">Copyright</option>
212 <option value="chapter">Chapter</option>
213 <option value="subsection">Subsection</option>
214 <option value="appendix">Appendix</option>
215 <option value="help">Help</option>
216 <option value="bookmark">Bookmark</option>
217 <option value="nofollow">No Follow</option>
218 <option value="tag">Tag</option>
219 </select>
220 </td>
221 </tr>
222
223 <tr>
224 <td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>
225 <td><select id="rev" name="rev">
226 <option value="">{#not_set}</option>
227 <option value="alternate">Alternate</option>
228 <option value="designates">Designates</option>
229 <option value="stylesheet">Stylesheet</option>
230 <option value="start">Start</option>
231 <option value="next">Next</option>
232 <option value="prev">Prev</option>
233 <option value="contents">Contents</option>
234 <option value="index">Index</option>
235 <option value="glossary">Glossary</option>
236 <option value="copyright">Copyright</option>
237 <option value="chapter">Chapter</option>
238 <option value="subsection">Subsection</option>
239 <option value="appendix">Appendix</option>
240 <option value="help">Help</option>
241 <option value="bookmark">Bookmark</option>
242 </select>
243 </td>
244 </tr>
245
246 <tr>
247 <td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>
248 <td><input type="text" id="tabindex" name="tabindex" value="" /></td>
249 </tr>
250
251 <tr>
252 <td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>
253 <td><input type="text" id="accesskey" name="accesskey" value="" /></td>
254 </tr>
255 </table>
256 </fieldset>
257 </div>
258
259 <div id="events_panel" class="panel">
260 <fieldset>
261 <legend>{#advlink_dlg.event_props}</legend>
262
263 <table border="0" cellpadding="0" cellspacing="4">
264 <tr>
265 <td class="column1"><label for="onfocus">onfocus</label></td>
266 <td><input id="onfocus" name="onfocus" type="text" value="" /></td>
267 </tr>
268
269 <tr>
270 <td class="column1"><label for="onblur">onblur</label></td>
271 <td><input id="onblur" name="onblur" type="text" value="" /></td>
272 </tr>
273
274 <tr>
275 <td class="column1"><label for="onclick">onclick</label></td>
276 <td><input id="onclick" name="onclick" type="text" value="" /></td>
277 </tr>
278
279 <tr>
280 <td class="column1"><label for="ondblclick">ondblclick</label></td>
281 <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
282 </tr>
283
284 <tr>
285 <td class="column1"><label for="onmousedown">onmousedown</label></td>
286 <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
287 </tr>
288
289 <tr>
290 <td class="column1"><label for="onmouseup">onmouseup</label></td>
291 <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
292 </tr>
293
294 <tr>
295 <td class="column1"><label for="onmouseover">onmouseover</label></td>
296 <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
297 </tr>
298
299 <tr>
300 <td class="column1"><label for="onmousemove">onmousemove</label></td>
301 <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
302 </tr>
303
304 <tr>
305 <td class="column1"><label for="onmouseout">onmouseout</label></td>
306 <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
307 </tr>
308
309 <tr>
310 <td class="column1"><label for="onkeypress">onkeypress</label></td>
311 <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
312 </tr>
313
314 <tr>
315 <td class="column1"><label for="onkeydown">onkeydown</label></td>
316 <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
317 </tr>
318
319 <tr>
320 <td class="column1"><label for="onkeyup">onkeyup</label></td>
321 <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
322 </tr>
323 </table>
324 </fieldset>
325 </div>
326 </div>
327
328 <div class="mceActionPanel">
329 <div style="float: left">
330 <input type="submit" id="insert" name="insert" value="{#insert}" />
331 </div>
332
333 <div style="float: right">
334 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
335 </div>
336 </div>
337 </form>
338</body>
339</html>
diff --git a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js
new file mode 100755
index 0000000..01a994e
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.AutoSavePlugin',{init:function(ed,url){var t=this;t.editor=ed;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;},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:tinymce.majorVersion+"."+tinymce.minorVersion};},'static':{_beforeUnloadHandler:function(){var msg;tinymce.each(tinyMCE.editors,function(ed){if(ed.getParam("fullscreen_is_enabled"))return;if(ed.isDirty()){msg=ed.getLang("autosave.unload_msg");return false;}});return msg;}}});tinymce.PluginManager.add('autosave',tinymce.plugins.AutoSavePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js
new file mode 100755
index 0000000..3c4325a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js
@@ -0,0 +1,51 @@
1/**
2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.AutoSavePlugin', {
10 init : function(ed, url) {
11 var t = this;
12
13 t.editor = ed;
14
15 window.onbeforeunload = tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;
16 },
17
18 getInfo : function() {
19 return {
20 longname : 'Auto save',
21 author : 'Moxiecode Systems AB',
22 authorurl : 'http://tinymce.moxiecode.com',
23 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',
24 version : tinymce.majorVersion + "." + tinymce.minorVersion
25 };
26 },
27
28 // Private plugin internal methods
29
30 'static' : {
31 _beforeUnloadHandler : function() {
32 var msg;
33
34 tinymce.each(tinyMCE.editors, function(ed) {
35 if (ed.getParam("fullscreen_is_enabled"))
36 return;
37
38 if (ed.isDirty()) {
39 msg = ed.getLang("autosave.unload_msg");
40 return false;
41 }
42 });
43
44 return msg;
45 }
46 }
47 });
48
49 // Register plugin
50 tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSavePlugin);
51})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js
new file mode 100755
index 0000000..88f7ea6
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.BBCodePlugin',{init:function(ed,url){var t=this,dialect=ed.getParam('bbcode_dialect','punbb').toLowerCase();ed.onBeforeSetContent.add(function(ed,o){o.content=t['_'+dialect+'_bbcode2html'](o.content);});ed.onPostProcess.add(function(ed,o){if(o.set)o.content=t['_'+dialect+'_bbcode2html'](o.content);if(o.get)o.content=t['_'+dialect+'_html2bbcode'](o.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(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str);};rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");rep(/<font>(.*?)<\/font>/gi,"$1");rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");rep(/<\/(strong|b)>/gi,"[/b]");rep(/<(strong|b)>/gi,"[b]");rep(/<\/(em|i)>/gi,"[/i]");rep(/<(em|i)>/gi,"[i]");rep(/<\/u>/gi,"[/u]");rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");rep(/<u>/gi,"[u]");rep(/<blockquote[^>]*>/gi,"[quote]");rep(/<\/blockquote>/gi,"[/quote]");rep(/<br \/>/gi,"\n");rep(/<br\/>/gi,"\n");rep(/<br>/gi,"\n");rep(/<p>/gi,"");rep(/<\/p>/gi,"\n");rep(/&nbsp;/gi," ");rep(/&quot;/gi,"\"");rep(/&lt;/gi,"<");rep(/&gt;/gi,">");rep(/&amp;/gi,"&");return s;},_punbb_bbcode2html:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str);};rep(/\n/gi,"<br />");rep(/\[b\]/gi,"<strong>");rep(/\[\/b\]/gi,"</strong>");rep(/\[i\]/gi,"<em>");rep(/\[\/i\]/gi,"</em>");rep(/\[u\]/gi,"<u>");rep(/\[\/u\]/gi,"</u>");rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;");rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;");return s;}});tinymce.PluginManager.add('bbcode',tinymce.plugins.BBCodePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
new file mode 100755
index 0000000..1d7493e
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
@@ -0,0 +1,117 @@
1/**
2 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.BBCodePlugin', {
10 init : function(ed, url) {
11 var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
12
13 ed.onBeforeSetContent.add(function(ed, o) {
14 o.content = t['_' + dialect + '_bbcode2html'](o.content);
15 });
16
17 ed.onPostProcess.add(function(ed, o) {
18 if (o.set)
19 o.content = t['_' + dialect + '_bbcode2html'](o.content);
20
21 if (o.get)
22 o.content = t['_' + dialect + '_html2bbcode'](o.content);
23 });
24 },
25
26 getInfo : function() {
27 return {
28 longname : 'BBCode Plugin',
29 author : 'Moxiecode Systems AB',
30 authorurl : 'http://tinymce.moxiecode.com',
31 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
32 version : tinymce.majorVersion + "." + tinymce.minorVersion
33 };
34 },
35
36 // Private methods
37
38 // HTML -> BBCode in PunBB dialect
39 _punbb_html2bbcode : function(s) {
40 s = tinymce.trim(s);
41
42 function rep(re, str) {
43 s = s.replace(re, str);
44 };
45
46 // example: <strong> to [b]
47 rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
48 rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
49 rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
50 rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
51 rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
52 rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
53 rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
54 rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
55 rep(/<font>(.*?)<\/font>/gi,"$1");
56 rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
57 rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
58 rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
59 rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
60 rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
61 rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
62 rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
63 rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
64 rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
65 rep(/<\/(strong|b)>/gi,"[/b]");
66 rep(/<(strong|b)>/gi,"[b]");
67 rep(/<\/(em|i)>/gi,"[/i]");
68 rep(/<(em|i)>/gi,"[i]");
69 rep(/<\/u>/gi,"[/u]");
70 rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
71 rep(/<u>/gi,"[u]");
72 rep(/<blockquote[^>]*>/gi,"[quote]");
73 rep(/<\/blockquote>/gi,"[/quote]");
74 rep(/<br \/>/gi,"\n");
75 rep(/<br\/>/gi,"\n");
76 rep(/<br>/gi,"\n");
77 rep(/<p>/gi,"");
78 rep(/<\/p>/gi,"\n");
79 rep(/&nbsp;/gi," ");
80 rep(/&quot;/gi,"\"");
81 rep(/&lt;/gi,"<");
82 rep(/&gt;/gi,">");
83 rep(/&amp;/gi,"&");
84
85 return s;
86 },
87
88 // BBCode -> HTML from PunBB dialect
89 _punbb_bbcode2html : function(s) {
90 s = tinymce.trim(s);
91
92 function rep(re, str) {
93 s = s.replace(re, str);
94 };
95
96 // example: [b] to <strong>
97 rep(/\n/gi,"<br />");
98 rep(/\[b\]/gi,"<strong>");
99 rep(/\[\/b\]/gi,"</strong>");
100 rep(/\[i\]/gi,"<em>");
101 rep(/\[\/i\]/gi,"</em>");
102 rep(/\[u\]/gi,"<u>");
103 rep(/\[\/u\]/gi,"</u>");
104 rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
105 rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
106 rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
107 rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
108 rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;");
109 rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;");
110
111 return s;
112 }
113 });
114
115 // Register plugin
116 tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
117})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin.js b/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin.js
new file mode 100755
index 0000000..02a1da8
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin.js
@@ -0,0 +1 @@
(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.Compat2x',{getInfo:function(){return{longname:'Compat2x',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};}});(function(){tinymce.extend(tinyMCE,{addToLang:function(p,l){each(l,function(v,k){tinyMCE.i18n[(tinyMCE.settings.language||'en')+'.'+(p?p+'_':'')+k]=v;});},getInstanceById:function(n){return this.get(n);}});})();(function(){var EditorManager=tinymce.EditorManager;tinyMCE.instances={};tinyMCE.plugins={};tinymce.PluginManager.onAdd.add(function(pm,n,p){tinyMCE.plugins[n]=p;});tinyMCE.majorVersion=tinymce.majorVersion;tinyMCE.minorVersion=tinymce.minorVersion;tinyMCE.releaseDate=tinymce.releaseDate;tinyMCE.baseURL=tinymce.baseURL;tinyMCE.isIE=tinyMCE.isMSIE=tinymce.isIE||tinymce.isOpera;tinyMCE.isMSIE5=tinymce.isIE;tinyMCE.isMSIE5_0=tinymce.isIE;tinyMCE.isMSIE7=tinymce.isIE;tinyMCE.isGecko=tinymce.isGecko;tinyMCE.isSafari=tinymce.isWebKit;tinyMCE.isOpera=tinymce.isOpera;tinyMCE.isMac=false;tinyMCE.isNS7=false;tinyMCE.isNS71=false;tinyMCE.compat=true;TinyMCE_Engine=tinyMCE;tinymce.extend(tinyMCE,{getParam:function(n,dv){return this.activeEditor.getParam(n,dv);},addEvent:function(e,na,f,sc){tinymce.dom.Event.add(e,na,f,sc||this);},getControlHTML:function(n){return EditorManager.activeEditor.controlManager.createControl(n);},loadCSS:function(u){tinymce.DOM.loadCSS(u);},importCSS:function(doc,u){if(doc==document)this.loadCSS(u);else new tinymce.dom.DOMUtils(doc).loadCSS(u);},log:function(){console.debug.apply(console,arguments);},getLang:function(n,dv){var v=EditorManager.activeEditor.getLang(n.replace(/^lang_/g,''),dv);if(/^[0-9\-.]+$/g.test(v))return parseInt(v);return v;},isInstance:function(o){return o!=null&&typeof(o)=="object"&&o.execCommand;},triggerNodeChange:function(){EditorManager.activeEditor.nodeChanged();},regexpReplace:function(in_str,reg_exp,replace_str,opts){var re;if(in_str==null)return in_str;if(typeof(opts)=="undefined")opts='g';re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str);},trim:function(s){return tinymce.trim(s);},xmlEncode:function(s){return tinymce.DOM.encode(s);},explode:function(s,d){var o=[];tinymce.each(s.split(d),function(v){if(v!='')o.push(v);});return o;},switchClass:function(id,cls){var b;if(/^mceButton/.test(cls)){b=EditorManager.activeEditor.controlManager.get(id);if(!b)return;switch(cls){case"mceButtonNormal":b.setDisabled(false);b.setActive(false);return;case"mceButtonDisabled":b.setDisabled(true);return;case"mceButtonSelected":b.setActive(true);b.setDisabled(false);return;}}},addCSSClass:function(e,n,b){return tinymce.DOM.addClass(e,n,b);},hasCSSClass:function(e,n){return tinymce.DOM.hasClass(e,n);},removeCSSClass:function(e,n){return tinymce.DOM.removeClass(e,n);},getCSSClasses:function(){var cl=EditorManager.activeEditor.dom.getClasses(),o=[];each(cl,function(c){o.push(c['class']);});return o;},setWindowArg:function(n,v){EditorManager.activeEditor.windowManager.params[n]=v;},getWindowArg:function(n,dv){var wm=EditorManager.activeEditor.windowManager,v;v=wm.getParam(n);if(v==='')return'';return v||wm.getFeature(n)||dv;},getParentNode:function(n,f){return this._getDOM().getParent(n,f);},selectElements:function(n,na,f){var i,a=[],nl,x;for(x=0,na=na.split(',');x<na.length;x++)for(i=0,nl=n.getElementsByTagName(na[x]);i<nl.length;i++)(!f||f(nl[i]))&&a.push(nl[i]);return a;},getNodeTree:function(n,na,t,nn){return this.selectNodes(n,function(n){return(!t||n.nodeType==t)&&(!nn||n.nodeName==nn);},na?na:[]);},getAttrib:function(e,n,dv){return this._getDOM().getAttrib(e,n,dv);},setAttrib:function(e,n,v){return this._getDOM().setAttrib(e,n,v);},getElementsByAttributeValue:function(n,e,a,v){var i,nl=n.getElementsByTagName(e),o=[];for(i=0;i<nl.length;i++){if(tinyMCE.getAttrib(nl[i],a).indexOf(v)!=-1)o[o.length]=nl[i];}return o;},selectNodes:function(n,f,a){var i;if(!a)a=[];if(f(n))a[a.length]=n;if(n.hasChildNodes()){for(i=0;i<n.childNodes.length;i++)tinyMCE.selectNodes(n.childNodes[i],f,a);}return a;},getContent:function(){return EditorManager.activeEditor.getContent();},getParentElement:function(n,na,f){if(na)na=new RegExp('^('+na.toUpperCase().replace(/,/g,'|')+')$','g');return this._getDOM().getParent(n,function(n){return n.nodeType==1&&(!na||na.test(n.nodeName))&&(!f||f(n));},this.activeEditor.getBody());},importPluginLanguagePack:function(n){tinymce.PluginManager.requireLangPack(n);},getButtonHTML:function(cn,lang,img,c,u,v){var ed=EditorManager.activeEditor;img=img.replace(/\{\$pluginurl\}/g,tinyMCE.pluginURL);img=img.replace(/\{\$themeurl\}/g,tinyMCE.themeURL);lang=lang.replace(/^lang_/g,'');return ed.controlManager.createButton(cn,{title:lang,command:c,ui:u,value:v,scope:this,'class':'compat',image:img});},addSelectAccessibility:function(e,s,w){if(!s._isAccessible){s.onkeydown=tinyMCE.accessibleEventHandler;s.onblur=tinyMCE.accessibleEventHandler;s._isAccessible=true;s._win=w;}return false;},accessibleEventHandler:function(e){var elm,win=this._win;e=tinymce.isIE?win.event:e;elm=tinymce.isIE?e.srcElement:e.target;if(e.type=="blur"){if(elm.oldonchange){elm.onchange=elm.oldonchange;elm.oldonchange=null;}return true;}if(elm.nodeName=="SELECT"&&!elm.oldonchange){elm.oldonchange=elm.onchange;elm.onchange=null;}if(e.keyCode==13||e.keyCode==32){elm.onchange=elm.oldonchange;elm.onchange();elm.oldonchange=null;tinyMCE.cancelEvent(e);return false;}return true;},cancelEvent:function(e){return tinymce.dom.Event.cancel(e);},handleVisualAid:function(e){EditorManager.activeEditor.addVisual(e);},getAbsPosition:function(n,r){return tinymce.DOM.getPos(n,r);},cleanupEventStr:function(s){s=""+s;s=s.replace('function anonymous()\n{\n','');s=s.replace('\n}','');s=s.replace(/^return true;/gi,'');return s;},getVisualAidClass:function(s){return s;},parseStyle:function(s){return this._getDOM().parseStyle(s);},serializeStyle:function(s){return this._getDOM().serializeStyle(s);},openWindow:function(tpl,args){var ed=EditorManager.activeEditor,o={},n;for(n in tpl)o[n]=tpl[n];tpl=o;args=args||{};tpl.url=new tinymce.util.URI(tinymce.ThemeManager.themeURLs[ed.settings.theme]).toAbsolute(tpl.file);tpl.inline=tpl.inline||args.inline;ed.windowManager.open(tpl,args);},closeWindow:function(win){EditorManager.activeEditor.windowManager.close(win);},getOuterHTML:function(e){return tinymce.DOM.getOuterHTML(e);},setOuterHTML:function(e,h,d){return tinymce.DOM.setOuterHTML(e,h,d);},hasPlugin:function(n){return tinymce.PluginManager.get(n)!=null;},_setEventsEnabled:function(){},addPlugin:function(pn,f){var t=this;function PluginWrapper(ed){tinyMCE.selectedInstance=ed;ed.onInit.add(function(){t.settings=ed.settings;t.settings['base_href']=tinyMCE.documentBasePath;tinyMCE.settings=t.settings;tinyMCE.documentBasePath=ed.documentBasePath;if(f.initInstance)f.initInstance(ed);ed.contentDocument=ed.getDoc();ed.contentWindow=ed.getWin();ed.undoRedo=ed.undoManager;ed.startContent=ed.getContent({format:'raw'});tinyMCE.instances[ed.id]=ed;tinyMCE.loadedFiles=[];});ed.onActivate.add(function(){tinyMCE.settings=ed.settings;tinyMCE.selectedInstance=ed;});if(f.handleNodeChange){ed.onNodeChange.add(function(ed,cm,n){f.handleNodeChange(ed.id,n,0,0,false,!ed.selection.isCollapsed());});}if(f.onChange){ed.onChange.add(function(ed,n){return f.onChange(ed);});}if(f.cleanup){ed.onGetContent.add(function(){});}this.getInfo=function(){return f.getInfo();};this.createControl=function(n){tinyMCE.pluginURL=tinymce.baseURL+'/plugins/'+pn;tinyMCE.themeURL=tinymce.baseURL+'/themes/'+tinyMCE.activeEditor.settings.theme;if(f.getControlHTML)return f.getControlHTML(n);return null;};this.execCommand=function(cmd,ui,val){if(f.execCommand)return f.execCommand(ed.id,ed.getBody(),cmd,ui,val);return false;};};tinymce.PluginManager.add(pn,PluginWrapper);},_getDOM:function(){return tinyMCE.activeEditor?tinyMCE.activeEditor.dom:tinymce.DOM;},convertRelativeToAbsoluteURL:function(b,u){return new tinymce.util.URI(b).toAbsolute(u);},convertAbsoluteURLToRelativeURL:function(b,u){return new tinymce.util.URI(b).toRelative(u);}});tinymce.extend(tinymce.Editor.prototype,{getFocusElement:function(){return this.selection.getNode();},getData:function(n){if(!this.data)this.data=[];if(!this.data[n])this.data[n]=[];return this.data[n];},hasPlugin:function(n){return this.plugins[n]!=null;},getContainerWin:function(){return window;},getHTML:function(raw){return this.getContent({format:raw?'raw':'html'});},setHTML:function(h){this.setContent(h);},getSel:function(){return this.selection.getSel();},getRng:function(){return this.selection.getRng();},isHidden:function(){var s;if(!tinymce.isGecko)return false;s=this.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},translate:function(s){var c=this.settings.language,o;if(!s)return s;o=tinymce.EditorManager.i18n[c+'.'+s]||s.replace(/{\#([^}]+)\}/g,function(a,b){return tinymce.EditorManager.i18n[c+'.'+b]||'{#'+b+'}';});o=o.replace(/{\$lang_([^}]+)\}/g,function(a,b){return tinymce.EditorManager.i18n[c+'.'+b]||'{$lang_'+b+'}';});return o;},repaint:function(){this.execCommand('mceRepaint');}});tinymce.extend(tinymce.dom.Selection.prototype,{getSelectedText:function(){return this.getContent({format:'text'});},getSelectedHTML:function(){return this.getContent({format:'html'});},getFocusElement:function(){return this.getNode();},selectNode:function(node,collapse,select_text_node,to_start){var t=this;t.select(node,select_text_node||0);if(!is(collapse))collapse=true;if(collapse){if(!is(to_start))to_start=true;t.collapse(to_start);}}});}).call(this);tinymce.PluginManager.add('compat2x',tinymce.plugins.Compat2x);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js
new file mode 100755
index 0000000..60d4f2d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js
@@ -0,0 +1,616 @@
1/**
2 * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;
10
11 tinymce.create('tinymce.plugins.Compat2x', {
12 getInfo : function() {
13 return {
14 longname : 'Compat2x',
15 author : 'Moxiecode Systems AB',
16 authorurl : 'http://tinymce.moxiecode.com',
17 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x',
18 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
19 };
20 }
21 });
22
23 (function() {
24 // Extend tinyMCE/EditorManager
25 tinymce.extend(tinyMCE, {
26 addToLang : function(p, l) {
27 each(l, function(v, k) {
28 tinyMCE.i18n[(tinyMCE.settings.language || 'en') + '.' + (p ? p + '_' : '') + k] = v;
29 });
30 },
31
32 getInstanceById : function(n) {
33 return this.get(n);
34 }
35 });
36 })();
37
38 (function() {
39 var EditorManager = tinymce.EditorManager;
40
41 tinyMCE.instances = {};
42 tinyMCE.plugins = {};
43 tinymce.PluginManager.onAdd.add(function(pm, n, p) {
44 tinyMCE.plugins[n] = p;
45 });
46
47 tinyMCE.majorVersion = tinymce.majorVersion;
48 tinyMCE.minorVersion = tinymce.minorVersion;
49 tinyMCE.releaseDate = tinymce.releaseDate;
50 tinyMCE.baseURL = tinymce.baseURL;
51 tinyMCE.isIE = tinyMCE.isMSIE = tinymce.isIE || tinymce.isOpera;
52 tinyMCE.isMSIE5 = tinymce.isIE;
53 tinyMCE.isMSIE5_0 = tinymce.isIE;
54 tinyMCE.isMSIE7 = tinymce.isIE;
55 tinyMCE.isGecko = tinymce.isGecko;
56 tinyMCE.isSafari = tinymce.isWebKit;
57 tinyMCE.isOpera = tinymce.isOpera;
58 tinyMCE.isMac = false;
59 tinyMCE.isNS7 = false;
60 tinyMCE.isNS71 = false;
61 tinyMCE.compat = true;
62
63 // Extend tinyMCE class
64 TinyMCE_Engine = tinyMCE;
65 tinymce.extend(tinyMCE, {
66 getParam : function(n, dv) {
67 return this.activeEditor.getParam(n, dv);
68 },
69
70 addEvent : function(e, na, f, sc) {
71 tinymce.dom.Event.add(e, na, f, sc || this);
72 },
73
74 getControlHTML : function(n) {
75 return EditorManager.activeEditor.controlManager.createControl(n);
76 },
77
78 loadCSS : function(u) {
79 tinymce.DOM.loadCSS(u);
80 },
81
82 importCSS : function(doc, u) {
83 if (doc == document)
84 this.loadCSS(u);
85 else
86 new tinymce.dom.DOMUtils(doc).loadCSS(u);
87 },
88
89 log : function() {
90 console.debug.apply(console, arguments);
91 },
92
93 getLang : function(n, dv) {
94 var v = EditorManager.activeEditor.getLang(n.replace(/^lang_/g, ''), dv);
95
96 // Is number
97 if (/^[0-9\-.]+$/g.test(v))
98 return parseInt(v);
99
100 return v;
101 },
102
103 isInstance : function(o) {
104 return o != null && typeof(o) == "object" && o.execCommand;
105 },
106
107 triggerNodeChange : function() {
108 EditorManager.activeEditor.nodeChanged();
109 },
110
111 regexpReplace : function(in_str, reg_exp, replace_str, opts) {
112 var re;
113
114 if (in_str == null)
115 return in_str;
116
117 if (typeof(opts) == "undefined")
118 opts = 'g';
119
120 re = new RegExp(reg_exp, opts);
121
122 return in_str.replace(re, replace_str);
123 },
124
125 trim : function(s) {
126 return tinymce.trim(s);
127 },
128
129 xmlEncode : function(s) {
130 return tinymce.DOM.encode(s);
131 },
132
133 explode : function(s, d) {
134 var o = [];
135
136 tinymce.each(s.split(d), function(v) {
137 if (v != '')
138 o.push(v);
139 });
140
141 return o;
142 },
143
144 switchClass : function(id, cls) {
145 var b;
146
147 if (/^mceButton/.test(cls)) {
148 b = EditorManager.activeEditor.controlManager.get(id);
149
150 if (!b)
151 return;
152
153 switch (cls) {
154 case "mceButtonNormal":
155 b.setDisabled(false);
156 b.setActive(false);
157 return;
158
159 case "mceButtonDisabled":
160 b.setDisabled(true);
161 return;
162
163 case "mceButtonSelected":
164 b.setActive(true);
165 b.setDisabled(false);
166 return;
167 }
168 }
169 },
170
171 addCSSClass : function(e, n, b) {
172 return tinymce.DOM.addClass(e, n, b);
173 },
174
175 hasCSSClass : function(e, n) {
176 return tinymce.DOM.hasClass(e, n);
177 },
178
179 removeCSSClass : function(e, n) {
180 return tinymce.DOM.removeClass(e, n);
181 },
182
183 getCSSClasses : function() {
184 var cl = EditorManager.activeEditor.dom.getClasses(), o = [];
185
186 each(cl, function(c) {
187 o.push(c['class']);
188 });
189
190 return o;
191 },
192
193 setWindowArg : function(n, v) {
194 EditorManager.activeEditor.windowManager.params[n] = v;
195 },
196
197 getWindowArg : function(n, dv) {
198 var wm = EditorManager.activeEditor.windowManager, v;
199
200 v = wm.getParam(n);
201 if (v === '')
202 return '';
203
204 return v || wm.getFeature(n) || dv;
205 },
206
207 getParentNode : function(n, f) {
208 return this._getDOM().getParent(n, f);
209 },
210
211 selectElements : function(n, na, f) {
212 var i, a = [], nl, x;
213
214 for (x=0, na = na.split(','); x<na.length; x++)
215 for (i=0, nl = n.getElementsByTagName(na[x]); i<nl.length; i++)
216 (!f || f(nl[i])) && a.push(nl[i]);
217
218 return a;
219 },
220
221 getNodeTree : function(n, na, t, nn) {
222 return this.selectNodes(n, function(n) {
223 return (!t || n.nodeType == t) && (!nn || n.nodeName == nn);
224 }, na ? na : []);
225 },
226
227 getAttrib : function(e, n, dv) {
228 return this._getDOM().getAttrib(e, n, dv);
229 },
230
231 setAttrib : function(e, n, v) {
232 return this._getDOM().setAttrib(e, n, v);
233 },
234
235 getElementsByAttributeValue : function(n, e, a, v) {
236 var i, nl = n.getElementsByTagName(e), o = [];
237
238 for (i=0; i<nl.length; i++) {
239 if (tinyMCE.getAttrib(nl[i], a).indexOf(v) != -1)
240 o[o.length] = nl[i];
241 }
242
243 return o;
244 },
245
246 selectNodes : function(n, f, a) {
247 var i;
248
249 if (!a)
250 a = [];
251
252 if (f(n))
253 a[a.length] = n;
254
255 if (n.hasChildNodes()) {
256 for (i=0; i<n.childNodes.length; i++)
257 tinyMCE.selectNodes(n.childNodes[i], f, a);
258 }
259
260 return a;
261 },
262
263 getContent : function() {
264 return EditorManager.activeEditor.getContent();
265 },
266
267 getParentElement : function(n, na, f) {
268 if (na)
269 na = new RegExp('^(' + na.toUpperCase().replace(/,/g, '|') + ')$', 'g');
270
271 return this._getDOM().getParent(n, function(n) {
272 return n.nodeType == 1 && (!na || na.test(n.nodeName)) && (!f || f(n));
273 }, this.activeEditor.getBody());
274 },
275
276 importPluginLanguagePack : function(n) {
277 tinymce.PluginManager.requireLangPack(n);
278 },
279
280 getButtonHTML : function(cn, lang, img, c, u, v) {
281 var ed = EditorManager.activeEditor;
282
283 img = img.replace(/\{\$pluginurl\}/g, tinyMCE.pluginURL);
284 img = img.replace(/\{\$themeurl\}/g, tinyMCE.themeURL);
285 lang = lang.replace(/^lang_/g, '');
286
287 return ed.controlManager.createButton(cn, {
288 title : lang,
289 command : c,
290 ui : u,
291 value : v,
292 scope : this,
293 'class' : 'compat',
294 image : img
295 });
296 },
297
298 addSelectAccessibility : function(e, s, w) {
299 // Add event handlers
300 if (!s._isAccessible) {
301 s.onkeydown = tinyMCE.accessibleEventHandler;
302 s.onblur = tinyMCE.accessibleEventHandler;
303 s._isAccessible = true;
304 s._win = w;
305 }
306
307 return false;
308 },
309
310 accessibleEventHandler : function(e) {
311 var elm, win = this._win;
312
313 e = tinymce.isIE ? win.event : e;
314 elm = tinymce.isIE ? e.srcElement : e.target;
315
316 // Unpiggyback onchange on blur
317 if (e.type == "blur") {
318 if (elm.oldonchange) {
319 elm.onchange = elm.oldonchange;
320 elm.oldonchange = null;
321 }
322
323 return true;
324 }
325
326 // Piggyback onchange
327 if (elm.nodeName == "SELECT" && !elm.oldonchange) {
328 elm.oldonchange = elm.onchange;
329 elm.onchange = null;
330 }
331
332 // Execute onchange and remove piggyback
333 if (e.keyCode == 13 || e.keyCode == 32) {
334 elm.onchange = elm.oldonchange;
335 elm.onchange();
336 elm.oldonchange = null;
337
338 tinyMCE.cancelEvent(e);
339 return false;
340 }
341
342 return true;
343 },
344
345 cancelEvent : function(e) {
346 return tinymce.dom.Event.cancel(e);
347 },
348
349 handleVisualAid : function(e) {
350 EditorManager.activeEditor.addVisual(e);
351 },
352
353 getAbsPosition : function(n, r) {
354 return tinymce.DOM.getPos(n, r);
355 },
356
357 cleanupEventStr : function(s) {
358 s = "" + s;
359 s = s.replace('function anonymous()\n{\n', '');
360 s = s.replace('\n}', '');
361 s = s.replace(/^return true;/gi, ''); // Remove event blocker
362
363 return s;
364 },
365
366 getVisualAidClass : function(s) {
367 // TODO: Implement
368 return s;
369 },
370
371 parseStyle : function(s) {
372 return this._getDOM().parseStyle(s);
373 },
374
375 serializeStyle : function(s) {
376 return this._getDOM().serializeStyle(s);
377 },
378
379 openWindow : function(tpl, args) {
380 var ed = EditorManager.activeEditor, o = {}, n;
381
382 // Convert name/value array to object
383 for (n in tpl)
384 o[n] = tpl[n];
385
386 tpl = o;
387
388 args = args || {};
389 tpl.url = new tinymce.util.URI(tinymce.ThemeManager.themeURLs[ed.settings.theme]).toAbsolute(tpl.file);
390 tpl.inline = tpl.inline || args.inline;
391
392 ed.windowManager.open(tpl, args);
393 },
394
395 closeWindow : function(win) {
396 EditorManager.activeEditor.windowManager.close(win);
397 },
398
399 getOuterHTML : function(e) {
400 return tinymce.DOM.getOuterHTML(e);
401 },
402
403 setOuterHTML : function(e, h, d) {
404 return tinymce.DOM.setOuterHTML(e, h, d);
405 },
406
407 hasPlugin : function(n) {
408 return tinymce.PluginManager.get(n) != null;
409 },
410
411 _setEventsEnabled : function() {
412 // Ignore it!!
413 },
414
415 addPlugin : function(pn, f) {
416 var t = this;
417
418 function PluginWrapper(ed) {
419 tinyMCE.selectedInstance = ed;
420
421 ed.onInit.add(function() {
422 t.settings = ed.settings;
423 t.settings['base_href'] = tinyMCE.documentBasePath;
424 tinyMCE.settings = t.settings;
425 tinyMCE.documentBasePath = ed.documentBasePath;
426 //ed.formElement = DOM.get(ed.id);
427
428 if (f.initInstance)
429 f.initInstance(ed);
430
431 ed.contentDocument = ed.getDoc();
432 ed.contentWindow = ed.getWin();
433 ed.undoRedo = ed.undoManager;
434 ed.startContent = ed.getContent({format : 'raw'});
435
436 tinyMCE.instances[ed.id] = ed;
437 tinyMCE.loadedFiles = [];
438 });
439
440 ed.onActivate.add(function() {
441 tinyMCE.settings = ed.settings;
442 tinyMCE.selectedInstance = ed;
443 });
444
445 /* if (f.removeInstance) {
446 ed.onDestroy.add(function() {
447 return f.removeInstance(ed.id);
448 });
449 }*/
450
451 if (f.handleNodeChange) {
452 ed.onNodeChange.add(function(ed, cm, n) {
453 f.handleNodeChange(ed.id, n, 0, 0, false, !ed.selection.isCollapsed());
454 });
455 }
456
457 if (f.onChange) {
458 ed.onChange.add(function(ed, n) {
459 return f.onChange(ed);
460 });
461 }
462
463 if (f.cleanup) {
464 ed.onGetContent.add(function() {
465 //f.cleanup(type, content, inst);
466 });
467 }
468
469 this.getInfo = function() {
470 return f.getInfo();
471 };
472
473 this.createControl = function(n) {
474 tinyMCE.pluginURL = tinymce.baseURL + '/plugins/' + pn;
475 tinyMCE.themeURL = tinymce.baseURL + '/themes/' + tinyMCE.activeEditor.settings.theme;
476
477 if (f.getControlHTML)
478 return f.getControlHTML(n);
479
480 return null;
481 };
482
483 this.execCommand = function(cmd, ui, val) {
484 if (f.execCommand)
485 return f.execCommand(ed.id, ed.getBody(), cmd, ui, val);
486
487 return false;
488 };
489 };
490
491 tinymce.PluginManager.add(pn, PluginWrapper);
492 },
493
494 _getDOM : function() {
495 return tinyMCE.activeEditor ? tinyMCE.activeEditor.dom : tinymce.DOM;
496 },
497
498 convertRelativeToAbsoluteURL : function(b, u) {
499 return new tinymce.util.URI(b).toAbsolute(u);
500 },
501
502 convertAbsoluteURLToRelativeURL : function(b, u) {
503 return new tinymce.util.URI(b).toRelative(u);
504 }
505 });
506
507 // Extend Editor class
508 tinymce.extend(tinymce.Editor.prototype, {
509 getFocusElement : function() {
510 return this.selection.getNode();
511 },
512
513 getData : function(n) {
514 if (!this.data)
515 this.data = [];
516
517 if (!this.data[n])
518 this.data[n] = [];
519
520 return this.data[n];
521 },
522
523 hasPlugin : function(n) {
524 return this.plugins[n] != null;
525 },
526
527 getContainerWin : function() {
528 return window;
529 },
530
531 getHTML : function(raw) {
532 return this.getContent({ format : raw ? 'raw' : 'html'});
533 },
534
535 setHTML : function(h) {
536 this.setContent(h);
537 },
538
539 getSel : function() {
540 return this.selection.getSel();
541 },
542
543 getRng : function() {
544 return this.selection.getRng();
545 },
546
547 isHidden : function() {
548 var s;
549
550 if (!tinymce.isGecko)
551 return false;
552
553 s = this.getSel();
554
555 // Weird, wheres that cursor selection?
556 return (!s || !s.rangeCount || s.rangeCount == 0);
557 },
558
559 translate : function(s) {
560 var c = this.settings.language, o;
561
562 if (!s)
563 return s;
564
565 o = tinymce.EditorManager.i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {
566 return tinymce.EditorManager.i18n[c + '.' + b] || '{#' + b + '}';
567 });
568
569 o = o.replace(/{\$lang_([^}]+)\}/g, function(a, b) {
570 return tinymce.EditorManager.i18n[c + '.' + b] || '{$lang_' + b + '}';
571 });
572
573 return o;
574 },
575
576 repaint : function() {
577 this.execCommand('mceRepaint');
578 }
579 });
580
581 // Extend selection
582 tinymce.extend(tinymce.dom.Selection.prototype, {
583 getSelectedText : function() {
584 return this.getContent({format : 'text'});
585 },
586
587 getSelectedHTML : function() {
588 return this.getContent({format : 'html'});
589 },
590
591 getFocusElement : function() {
592 return this.getNode();
593 },
594
595 selectNode : function(node, collapse, select_text_node, to_start) {
596 var t = this;
597
598 t.select(node, select_text_node || 0);
599
600 if (!is(collapse))
601 collapse = true;
602
603 if (collapse) {
604 if (!is(to_start))
605 to_start = true;
606
607 t.collapse(to_start);
608 }
609 }
610 });
611 }).call(this);
612
613 // Register plugin
614 tinymce.PluginManager.add('compat2x', tinymce.plugins.Compat2x);
615})();
616
diff --git a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js
new file mode 100755
index 0000000..f68744d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js
@@ -0,0 +1 @@
(function(){var Event=tinymce.dom.Event,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.ContextMenu',{init:function(ed){var t=this;t.editor=ed;t.onContextMenu=new tinymce.util.Dispatcher(this);ed.onContextMenu.add(function(ed,e){if(!e.ctrlKey){t._getMenu(ed).showMenu(e.clientX,e.clientY);Event.add(ed.getDoc(),'click',hide);Event.cancel(e);}});function hide(){if(t._menu){t._menu.removeAll();t._menu.destroy();Event.remove(ed.getDoc(),'click',hide);}};ed.onMouseDown.add(hide);ed.onKeyDown.add(hide);},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(ed){var t=this,m=t._menu,se=ed.selection,col=se.isCollapsed(),el=se.getNode()||ed.getBody(),am,p1,p2;if(m){m.removeAll();m.destroy();}p1=DOM.getPos(ed.getContentAreaContainer());p2=DOM.getPos(ed.getContainer());m=ed.controlManager.createDropMenu('contextmenu',{offset_x:p1.x+ed.getParam('contextmenu_offset_x',0),offset_y:p1.y+ed.getParam('contextmenu_offset_y',0),constrain:1});t._menu=m;m.add({title:'advanced.cut_desc',icon:'cut',cmd:'Cut'}).setDisabled(col);m.add({title:'advanced.copy_desc',icon:'copy',cmd:'Copy'}).setDisabled(col);m.add({title:'advanced.paste_desc',icon:'paste',cmd:'Paste'});if((el.nodeName=='A'&&!ed.dom.getAttrib(el,'name'))||!col){m.addSeparator();m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});}m.addSeparator();m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();am=m.addMenu({title:'contextmenu.align'});am.add({title:'contextmenu.left',icon:'justifyleft',cmd:'JustifyLeft'});am.add({title:'contextmenu.center',icon:'justifycenter',cmd:'JustifyCenter'});am.add({title:'contextmenu.right',icon:'justifyright',cmd:'JustifyRight'});am.add({title:'contextmenu.full',icon:'justifyfull',cmd:'JustifyFull'});t.onContextMenu.dispatch(t,m,el,col);return m;}});tinymce.PluginManager.add('contextmenu',tinymce.plugins.ContextMenu);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js
new file mode 100755
index 0000000..a2c1866
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js
@@ -0,0 +1,95 @@
1/**
2 * $Id: editor_plugin_src.js 848 2008-05-15 11:54:40Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
10
11 tinymce.create('tinymce.plugins.ContextMenu', {
12 init : function(ed) {
13 var t = this;
14
15 t.editor = ed;
16 t.onContextMenu = new tinymce.util.Dispatcher(this);
17
18 ed.onContextMenu.add(function(ed, e) {
19 if (!e.ctrlKey) {
20 t._getMenu(ed).showMenu(e.clientX, e.clientY);
21 Event.add(ed.getDoc(), 'click', hide);
22 Event.cancel(e);
23 }
24 });
25
26 function hide() {
27 if (t._menu) {
28 t._menu.removeAll();
29 t._menu.destroy();
30 Event.remove(ed.getDoc(), 'click', hide);
31 }
32 };
33
34 ed.onMouseDown.add(hide);
35 ed.onKeyDown.add(hide);
36 },
37
38 getInfo : function() {
39 return {
40 longname : 'Contextmenu',
41 author : 'Moxiecode Systems AB',
42 authorurl : 'http://tinymce.moxiecode.com',
43 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
44 version : tinymce.majorVersion + "." + tinymce.minorVersion
45 };
46 },
47
48 _getMenu : function(ed) {
49 var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2;
50
51 if (m) {
52 m.removeAll();
53 m.destroy();
54 }
55
56 p1 = DOM.getPos(ed.getContentAreaContainer());
57 p2 = DOM.getPos(ed.getContainer());
58
59 m = ed.controlManager.createDropMenu('contextmenu', {
60 offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0),
61 offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0),
62 constrain : 1
63 });
64
65 t._menu = m;
66
67 m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);
68 m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);
69 m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});
70
71 if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {
72 m.addSeparator();
73 m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
74 m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
75 }
76
77 m.addSeparator();
78 m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
79
80 m.addSeparator();
81 am = m.addMenu({title : 'contextmenu.align'});
82 am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});
83 am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});
84 am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});
85 am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});
86
87 t.onContextMenu.dispatch(t, m, el, col);
88
89 return m;
90 }
91 });
92
93 // Register plugin
94 tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);
95})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js
new file mode 100755
index 0000000..6966d80
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.Directionality',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceDirectionLTR',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="ltr")ed.dom.setAttrib(e,"dir","ltr");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addCommand('mceDirectionRTL',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="rtl")ed.dom.setAttrib(e,"dir","rtl");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addButton('ltr',{title:'directionality.ltr_desc',cmd:'mceDirectionLTR'});ed.addButton('rtl',{title:'directionality.rtl_desc',cmd:'mceDirectionRTL'});ed.onNodeChange.add(t._nodeChange,t);},getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var dom=ed.dom,dir;n=dom.getParent(n,dom.isBlock);if(!n){cm.setDisabled('ltr',1);cm.setDisabled('rtl',1);return;}dir=dom.getAttrib(n,'dir');cm.setActive('ltr',dir=="ltr");cm.setDisabled('ltr',0);cm.setActive('rtl',dir=="rtl");cm.setDisabled('rtl',0);}});tinymce.PluginManager.add('directionality',tinymce.plugins.Directionality);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js
new file mode 100755
index 0000000..81818e3
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js
@@ -0,0 +1,79 @@
1/**
2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.Directionality', {
10 init : function(ed, url) {
11 var t = this;
12
13 t.editor = ed;
14
15 ed.addCommand('mceDirectionLTR', function() {
16 var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
17
18 if (e) {
19 if (ed.dom.getAttrib(e, "dir") != "ltr")
20 ed.dom.setAttrib(e, "dir", "ltr");
21 else
22 ed.dom.setAttrib(e, "dir", "");
23 }
24
25 ed.nodeChanged();
26 });
27
28 ed.addCommand('mceDirectionRTL', function() {
29 var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
30
31 if (e) {
32 if (ed.dom.getAttrib(e, "dir") != "rtl")
33 ed.dom.setAttrib(e, "dir", "rtl");
34 else
35 ed.dom.setAttrib(e, "dir", "");
36 }
37
38 ed.nodeChanged();
39 });
40
41 ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
42 ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
43
44 ed.onNodeChange.add(t._nodeChange, t);
45 },
46
47 getInfo : function() {
48 return {
49 longname : 'Directionality',
50 author : 'Moxiecode Systems AB',
51 authorurl : 'http://tinymce.moxiecode.com',
52 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
53 version : tinymce.majorVersion + "." + tinymce.minorVersion
54 };
55 },
56
57 // Private methods
58
59 _nodeChange : function(ed, cm, n) {
60 var dom = ed.dom, dir;
61
62 n = dom.getParent(n, dom.isBlock);
63 if (!n) {
64 cm.setDisabled('ltr', 1);
65 cm.setDisabled('rtl', 1);
66 return;
67 }
68
69 dir = dom.getAttrib(n, 'dir');
70 cm.setActive('ltr', dir == "ltr");
71 cm.setDisabled('ltr', 0);
72 cm.setActive('rtl', dir == "rtl");
73 cm.setDisabled('rtl', 0);
74 }
75 });
76
77 // Register plugin
78 tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
79})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js
new file mode 100755
index 0000000..87fac10
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.EmotionsPlugin',{init:function(ed,url){ed.addCommand('mceEmotion',function(){ed.windowManager.open({file:url+'/emotions.htm',width:250+parseInt(ed.getLang('emotions.delta_width',0)),height:160+parseInt(ed.getLang('emotions.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('emotions',{title:'emotions.emotions_desc',cmd:'mceEmotion'});},getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('emotions',tinymce.plugins.EmotionsPlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js
new file mode 100755
index 0000000..df0d370
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js
@@ -0,0 +1,40 @@
1/**
2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.EmotionsPlugin', {
10 init : function(ed, url) {
11 // Register commands
12 ed.addCommand('mceEmotion', function() {
13 ed.windowManager.open({
14 file : url + '/emotions.htm',
15 width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),
16 height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),
17 inline : 1
18 }, {
19 plugin_url : url
20 });
21 });
22
23 // Register buttons
24 ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});
25 },
26
27 getInfo : function() {
28 return {
29 longname : 'Emotions',
30 author : 'Moxiecode Systems AB',
31 authorurl : 'http://tinymce.moxiecode.com',
32 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
33 version : tinymce.majorVersion + "." + tinymce.minorVersion
34 };
35 }
36 });
37
38 // Register plugin
39 tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);
40})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/emotions/emotions.htm b/public/javascripts/tiny_mce/plugins/emotions/emotions.htm
new file mode 100755
index 0000000..8110ee0
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/emotions.htm
@@ -0,0 +1,41 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#emotions_dlg.title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="js/emotions.js"></script>
7 <base target="_self" />
8</head>
9<body style="display: none">
10 <div align="center">
11 <div class="title">{#emotions_dlg.title}:<br /><br /></div>
12
13 <table border="0" cellspacing="0" cellpadding="4">
14 <tr>
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>
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>
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>
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>
19 </tr>
20 <tr>
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>
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>
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>
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>
25 </tr>
26 <tr>
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>
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>
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>
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>
31 </tr>
32 <tr>
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>
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>
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>
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>
37 </tr>
38 </table>
39 </div>
40</body>
41</html>
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif
new file mode 100755
index 0000000..ba90cc3
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif
new file mode 100755
index 0000000..74d897a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif
new file mode 100755
index 0000000..963a96b
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif
new file mode 100755
index 0000000..16f68cc
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif
new file mode 100755
index 0000000..716f55e
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif
new file mode 100755
index 0000000..334d49e
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif
new file mode 100755
index 0000000..4efd549
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif
new file mode 100755
index 0000000..1606c11
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif
new file mode 100755
index 0000000..ca2451e
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif
new file mode 100755
index 0000000..b33d3cc
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif
new file mode 100755
index 0000000..e6a9e60
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif
new file mode 100755
index 0000000..cb99cdd
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif
new file mode 100755
index 0000000..2075dc1
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif
new file mode 100755
index 0000000..bef7e25
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif
new file mode 100755
index 0000000..9faf1af
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif
new file mode 100755
index 0000000..648e6e8
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js b/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js
new file mode 100755
index 0000000..c549367
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js
@@ -0,0 +1,22 @@
1tinyMCEPopup.requireLangPack();
2
3var EmotionsDialog = {
4 init : function(ed) {
5 tinyMCEPopup.resizeToInnerSize();
6 },
7
8 insert : function(file, title) {
9 var ed = tinyMCEPopup.editor, dom = ed.dom;
10
11 tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
12 src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
13 alt : ed.getLang(title),
14 title : ed.getLang(title),
15 border : 0
16 }));
17
18 tinyMCEPopup.close();
19 }
20};
21
22tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);
diff --git a/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js
new file mode 100755
index 0000000..3b57ad9
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js
@@ -0,0 +1,20 @@
1tinyMCE.addI18n('en.emotions_dlg',{
2title:"Insert emotion",
3desc:"Emotions",
4cool:"Cool",
5cry:"Cry",
6embarassed:"Embarassed",
7foot_in_mouth:"Foot in mouth",
8frown:"Frown",
9innocent:"Innocent",
10kiss:"Kiss",
11laughing:"Laughing",
12money_mouth:"Money mouth",
13sealed:"Sealed",
14smile:"Smile",
15surprised:"Surprised",
16tongue_out:"Tongue out",
17undecided:"Undecided",
18wink:"Wink",
19yell:"Yell"
20}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/example/dialog.htm b/public/javascripts/tiny_mce/plugins/example/dialog.htm
new file mode 100755
index 0000000..b4c6284
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/example/dialog.htm
@@ -0,0 +1,27 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#example_dlg.title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="js/dialog.js"></script>
7</head>
8<body>
9
10<form onsubmit="ExampleDialog.insert();return false;" action="#">
11 <p>Here is a example dialog.</p>
12 <p>Selected text: <input id="someval" name="someval" type="text" class="text" /></p>
13 <p>Custom arg: <input id="somearg" name="somearg" type="text" class="text" /></p>
14
15 <div class="mceActionPanel">
16 <div style="float: left">
17 <input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" />
18 </div>
19
20 <div style="float: right">
21 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
22 </div>
23 </div>
24</form>
25
26</body>
27</html>
diff --git a/public/javascripts/tiny_mce/plugins/example/editor_plugin.js b/public/javascripts/tiny_mce/plugins/example/editor_plugin.js
new file mode 100755
index 0000000..cb7010d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/example/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.PluginManager.requireLangPack('example');tinymce.create('tinymce.plugins.ExamplePlugin',{init:function(ed,url){ed.addCommand('mceExample',function(){ed.windowManager.open({file:url+'/dialog.htm',width:320+parseInt(ed.getLang('example.delta_width',0)),height:120+parseInt(ed.getLang('example.delta_height',0)),inline:1},{plugin_url:url,some_custom_arg:'custom arg'});});ed.addButton('example',{title:'example.desc',cmd:'mceExample',image:url+'/img/example.gif'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('example',n.nodeName=='IMG');});},createControl:function(n,cm){return null;},getInfo:function(){return{longname:'Example plugin',author:'Some author',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',version:"1.0"};}});tinymce.PluginManager.add('example',tinymce.plugins.ExamplePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js
new file mode 100755
index 0000000..5050550
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js
@@ -0,0 +1,81 @@
1/**
2 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 // Load plugin specific language pack
10 tinymce.PluginManager.requireLangPack('example');
11
12 tinymce.create('tinymce.plugins.ExamplePlugin', {
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 init : function(ed, url) {
22 // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
23 ed.addCommand('mceExample', function() {
24 ed.windowManager.open({
25 file : url + '/dialog.htm',
26 width : 320 + parseInt(ed.getLang('example.delta_width', 0)),
27 height : 120 + parseInt(ed.getLang('example.delta_height', 0)),
28 inline : 1
29 }, {
30 plugin_url : url, // Plugin absolute URL
31 some_custom_arg : 'custom arg' // Custom argument
32 });
33 });
34
35 // Register example button
36 ed.addButton('example', {
37 title : 'example.desc',
38 cmd : 'mceExample',
39 image : url + '/img/example.gif'
40 });
41
42 // Add a node change handler, selects the button in the UI when a image is selected
43 ed.onNodeChange.add(function(ed, cm, n) {
44 cm.setActive('example', n.nodeName == 'IMG');
45 });
46 },
47
48 /**
49 * Creates control instances based in the incomming name. This method is normally not
50 * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
51 * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
52 * method can be used to create those.
53 *
54 * @param {String} n Name of the control to create.
55 * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
56 * @return {tinymce.ui.Control} New control instance or null if no control was created.
57 */
58 createControl : function(n, cm) {
59 return null;
60 },
61
62 /**
63 * Returns information about the plugin as a name/value array.
64 * The current keys are longname, author, authorurl, infourl and version.
65 *
66 * @return {Object} Name/value array containing information about the plugin.
67 */
68 getInfo : function() {
69 return {
70 longname : 'Example plugin',
71 author : 'Some author',
72 authorurl : 'http://tinymce.moxiecode.com',
73 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
74 version : "1.0"
75 };
76 }
77 });
78
79 // Register plugin
80 tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
81})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/example/img/example.gif b/public/javascripts/tiny_mce/plugins/example/img/example.gif
new file mode 100755
index 0000000..1ab5da4
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/example/img/example.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/example/js/dialog.js b/public/javascripts/tiny_mce/plugins/example/js/dialog.js
new file mode 100755
index 0000000..fa83411
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/example/js/dialog.js
@@ -0,0 +1,19 @@
1tinyMCEPopup.requireLangPack();
2
3var ExampleDialog = {
4 init : function() {
5 var f = document.forms[0];
6
7 // Get the selected contents as text and place it in the input
8 f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
9 f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
10 },
11
12 insert : function() {
13 // Insert the contents from the input into the document
14 tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
15 tinyMCEPopup.close();
16 }
17};
18
19tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);
diff --git a/public/javascripts/tiny_mce/plugins/example/langs/en.js b/public/javascripts/tiny_mce/plugins/example/langs/en.js
new file mode 100755
index 0000000..e0784f8
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/example/langs/en.js
@@ -0,0 +1,3 @@
1tinyMCE.addI18n('en.example',{
2 desc : 'This is just a template button'
3});
diff --git a/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js
new file mode 100755
index 0000000..ebcf948
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js
@@ -0,0 +1,3 @@
1tinyMCE.addI18n('en.example_dlg',{
2 title : 'This is just a example title'
3});
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css b/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css
new file mode 100755
index 0000000..7a3334f
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css
@@ -0,0 +1,182 @@
1/* Hide the advanced tab */
2#advanced_tab {
3 display: none;
4}
5
6#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright {
7 width: 280px;
8}
9
10#doctype, #docencoding {
11 width: 200px;
12}
13
14#langcode {
15 width: 30px;
16}
17
18#bgimage {
19 width: 220px;
20}
21
22#fontface {
23 width: 240px;
24}
25
26#leftmargin, #rightmargin, #topmargin, #bottommargin {
27 width: 50px;
28}
29
30.panel_wrapper div.current {
31 height: 400px;
32}
33
34#stylesheet, #style {
35 width: 240px;
36}
37
38/* Head list classes */
39
40.headlistwrapper {
41 width: 100%;
42}
43
44.addbutton, .removebutton, .moveupbutton, .movedownbutton {
45 border-top: 1px solid;
46 border-left: 1px solid;
47 border-bottom: 1px solid;
48 border-right: 1px solid;
49 border-color: #F0F0EE;
50 cursor: default;
51 display: block;
52 width: 20px;
53 height: 20px;
54}
55
56#doctypes {
57 width: 200px;
58}
59
60.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover {
61 border: 1px solid #0A246A;
62 background-color: #B6BDD2;
63}
64
65.addbutton {
66 background-image: url('../images/add.gif');
67 float: left;
68 margin-right: 3px;
69}
70
71.removebutton {
72 background-image: url('../images/remove.gif');
73 float: left;
74}
75
76.moveupbutton {
77 background-image: url('../images/move_up.gif');
78 float: left;
79 margin-right: 3px;
80}
81
82.movedownbutton {
83 background-image: url('../images/move_down.gif');
84 float: left;
85}
86
87.selected {
88 border: 1px solid #0A246A;
89 background-color: #B6BDD2;
90}
91
92.toolbar {
93 width: 100%;
94}
95
96#headlist {
97 width: 100%;
98 margin-top: 3px;
99 font-size: 11px;
100}
101
102#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element {
103 display: none;
104}
105
106#addmenu {
107 position: absolute;
108 border: 1px solid gray;
109 display: none;
110 z-index: 100;
111 background-color: white;
112}
113
114#addmenu a {
115 display: block;
116 width: 100%;
117 line-height: 20px;
118 text-decoration: none;
119 background-color: white;
120}
121
122#addmenu a:hover {
123 background-color: #B6BDD2;
124 color: black;
125}
126
127#addmenu span {
128 padding-left: 10px;
129 padding-right: 10px;
130}
131
132#updateElementPanel {
133 display: none;
134}
135
136#script_element .panel_wrapper div.current {
137 height: 108px;
138}
139
140#style_element .panel_wrapper div.current {
141 height: 108px;
142}
143
144#link_element .panel_wrapper div.current {
145 height: 140px;
146}
147
148#element_script_value {
149 width: 100%;
150 height: 100px;
151}
152
153#element_comment_value {
154 width: 100%;
155 height: 120px;
156}
157
158#element_style_value {
159 width: 100%;
160 height: 100px;
161}
162
163#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title {
164 width: 250px;
165}
166
167.updateElementButton {
168 margin-top: 3px;
169}
170
171/* MSIE specific styles */
172
173* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton {
174 width: 22px;
175 height: 22px;
176}
177
178textarea {
179 height: 55px;
180}
181
182.panel_wrapper div.current {height:420px;} \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js
new file mode 100755
index 0000000..727beb5
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.FullPagePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceFullPageProperties',function(){ed.windowManager.open({file:url+'/fullpage.htm',width:430+parseInt(ed.getLang('fullpage.delta_width',0)),height:495+parseInt(ed.getLang('fullpage.delta_height',0)),inline:1},{plugin_url:url,head_html:t.head});});ed.addButton('fullpage',{title:'fullpage.desc',cmd:'mceFullPageProperties'});ed.onBeforeSetContent.add(t._setContent,t);ed.onSetContent.add(t._setBodyAttribs,t);ed.onGetContent.add(t._getContent,t);},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(ed,o){var bdattr,i,len,kv,k,v,t,attr=this.head.match(/body(.*?)>/i);if(attr&&attr[1]){bdattr=attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(bdattr){for(i=0,len=bdattr.length;i<len;i++){kv=bdattr[i].split('=');k=kv[0].replace(/\s/,'');v=kv[1];if(v){v=v.replace(/^\s+/,'').replace(/\s+$/,'');t=v.match(/^["'](.*)["']$/);if(t)v=t[1];}else v=k;ed.dom.setAttrib(ed.getBody(),'style',v);}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true});},_setContent:function(ed,o){var t=this,sp,ep,c=o.content,v,st='';c=c.replace(/<(\/?)BODY/gi,'<$1body');sp=c.indexOf('<body');if(sp!=-1){sp=c.indexOf('>',sp);t.head=c.substring(0,sp+1);ep=c.indexOf('</body',sp);if(ep==-1)ep=c.indexOf('</body',ep);o.content=c.substring(sp+1,ep);t.foot=c.substring(ep);function low(s){return s.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase();})};t.head=low(t.head);t.foot=low(t.foot);}else{t.head='';if(ed.getParam('fullpage_default_xml_pi'))t.head+='<?xml version="1.0" encoding="'+ed.getParam('fullpage_default_encoding','ISO-8859-1')+'" ?>\n';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">');t.head+='\n<html>\n<head>\n<title>'+ed.getParam('fullpage_default_title','Untitled document')+'</title>\n';if(v=ed.getParam('fullpage_default_encoding'))t.head+='<meta http-equiv="Content-Type" content="'+v+'" />\n';if(v=ed.getParam('fullpage_default_font_family'))st+='font-family: '+v+';';if(v=ed.getParam('fullpage_default_font_size'))st+='font-size: '+v+';';if(v=ed.getParam('fullpage_default_text_color'))st+='color: '+v+';';t.head+='</head>\n<body'+(st?' style="'+st+'"':'')+'>\n';t.foot='\n</body>\n</html>';}},_getContent:function(ed,o){var t=this;o.content=tinymce.trim(t.head)+'\n'+tinymce.trim(o.content)+'\n'+tinymce.trim(t.foot);}});tinymce.PluginManager.add('fullpage',tinymce.plugins.FullPagePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js
new file mode 100755
index 0000000..019682d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js
@@ -0,0 +1,142 @@
1/**
2 * $Id: editor_plugin_src.js 920 2008-09-09 14:05:33Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.FullPagePlugin', {
10 init : function(ed, url) {
11 var t = this;
12
13 t.editor = ed;
14
15 // Register commands
16 ed.addCommand('mceFullPageProperties', function() {
17 ed.windowManager.open({
18 file : url + '/fullpage.htm',
19 width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)),
20 height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)),
21 inline : 1
22 }, {
23 plugin_url : url,
24 head_html : t.head
25 });
26 });
27
28 // Register buttons
29 ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'});
30
31 ed.onBeforeSetContent.add(t._setContent, t);
32 ed.onSetContent.add(t._setBodyAttribs, t);
33 ed.onGetContent.add(t._getContent, t);
34 },
35
36 getInfo : function() {
37 return {
38 longname : 'Fullpage',
39 author : 'Moxiecode Systems AB',
40 authorurl : 'http://tinymce.moxiecode.com',
41 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',
42 version : tinymce.majorVersion + "." + tinymce.minorVersion
43 };
44 },
45
46 // Private plugin internal methods
47
48 _setBodyAttribs : function(ed, o) {
49 var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i);
50
51 if (attr && attr[1]) {
52 bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);
53
54 if (bdattr) {
55 for(i = 0, len = bdattr.length; i < len; i++) {
56 kv = bdattr[i].split('=');
57 k = kv[0].replace(/\s/,'');
58 v = kv[1];
59
60 if (v) {
61 v = v.replace(/^\s+/,'').replace(/\s+$/,'');
62 t = v.match(/^["'](.*)["']$/);
63
64 if (t)
65 v = t[1];
66 } else
67 v = k;
68
69 ed.dom.setAttrib(ed.getBody(), 'style', v);
70 }
71 }
72 }
73 },
74
75 _createSerializer : function() {
76 return new tinymce.dom.Serializer({
77 dom : this.editor.dom,
78 apply_source_formatting : true
79 });
80 },
81
82 _setContent : function(ed, o) {
83 var t = this, sp, ep, c = o.content, v, st = '';
84
85 // Parse out head, body and footer
86 c = c.replace(/<(\/?)BODY/gi, '<$1body');
87 sp = c.indexOf('<body');
88
89 if (sp != -1) {
90 sp = c.indexOf('>', sp);
91 t.head = c.substring(0, sp + 1);
92
93 ep = c.indexOf('</body', sp);
94 if (ep == -1)
95 ep = c.indexOf('</body', ep);
96
97 o.content = c.substring(sp + 1, ep);
98 t.foot = c.substring(ep);
99
100 function low(s) {
101 return s.replace(/<\/?[A-Z]+/g, function(a) {
102 return a.toLowerCase();
103 })
104 };
105
106 t.head = low(t.head);
107 t.foot = low(t.foot);
108 } else {
109 t.head = '';
110 if (ed.getParam('fullpage_default_xml_pi'))
111 t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
112
113 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">');
114 t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n';
115
116 if (v = ed.getParam('fullpage_default_encoding'))
117 t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n';
118
119 if (v = ed.getParam('fullpage_default_font_family'))
120 st += 'font-family: ' + v + ';';
121
122 if (v = ed.getParam('fullpage_default_font_size'))
123 st += 'font-size: ' + v + ';';
124
125 if (v = ed.getParam('fullpage_default_text_color'))
126 st += 'color: ' + v + ';';
127
128 t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n';
129 t.foot = '\n</body>\n</html>';
130 }
131 },
132
133 _getContent : function(ed, o) {
134 var t = this;
135
136 o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot);
137 }
138 });
139
140 // Register plugin
141 tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);
142})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm b/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm
new file mode 100755
index 0000000..d74da0d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm
@@ -0,0 +1,577 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#fullpage_dlg.title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="js/fullpage.js"></script>
9 <link href="css/fullpage.css" rel="stylesheet" type="text/css" />
10 <base target="_self" />
11</head>
12<body id="advlink" style="display: none">
13 <form onsubmit="updateAction();return false;" name="fullpage" action="#">
14 <div class="tabs">
15 <ul>
16 <li id="meta_tab" class="current"><span><a href="javascript:mcTabs.displayTab('meta_tab','meta_panel');" onmousedown="return false;">{#fullpage_dlg.meta_tab}</a></span></li>
17 <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li>
18 <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_tab}</a></span></li>
19 </ul>
20 </div>
21
22 <div class="panel_wrapper">
23 <div id="meta_panel" class="panel current">
24 <fieldset>
25 <legend>{#fullpage_dlg.meta_props}</legend>
26
27 <table border="0" cellpadding="4" cellspacing="0">
28 <tr>
29 <td nowrap="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label>&nbsp;</td>
30 <td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td>
31 </tr>
32 <tr>
33 <td nowrap="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label>&nbsp;</td>
34 <td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td>
35 </tr>
36 <tr>
37 <td nowrap="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label>&nbsp;</td>
38 <td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td>
39 </tr>
40 <tr>
41 <td nowrap="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label>&nbsp;</td>
42 <td><input type="text" id="metaauthor" name="metaauthor" value="" /></td>
43 </tr>
44 <tr>
45 <td nowrap="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label>&nbsp;</td>
46 <td><input type="text" id="metacopyright" name="metacopyright" value="" /></td>
47 </tr>
48 <tr>
49 <td nowrap="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label>&nbsp;</td>
50 <td>
51 <select id="metarobots" name="metarobots">
52 <option value="">{#not_set}</option>
53 <option value="index,follow">{#fullpage_dlg.meta_index_follow}</option>
54 <option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option>
55 <option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option>
56 <option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option>
57 </select>
58 </td>
59 </tr>
60 </table>
61 </fieldset>
62
63 <fieldset>
64 <legend>{#fullpage_dlg.langprops}</legend>
65
66 <table border="0" cellpadding="4" cellspacing="0">
67 <tr>
68 <td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td>
69 <td>
70 <select id="docencoding" name="docencoding">
71 <option value="">{#not_set}</option>
72 </select>
73 </td>
74 </tr>
75 <tr>
76 <td nowrap="nowrap"><label for="doctypes">{#fullpage_dlg.doctypes}</label>&nbsp;</td>
77 <td>
78 <select id="doctypes" name="doctypes">
79 <option value="">{#not_set}</option>
80 </select>
81 </td>
82 </tr>
83 <tr>
84 <td nowrap="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label>&nbsp;</td>
85 <td><input type="text" id="langcode" name="langcode" value="" /></td>
86 </tr>
87 <tr>
88 <td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td>
89 <td>
90 <select id="langdir" name="langdir">
91 <option value="">{#not_set}</option>
92 <option value="ltr">{#fullpage_dlg.ltr}</option>
93 <option value="rtl">{#fullpage_dlg.rtl}</option>
94 </select>
95 </td>
96 </tr>
97 <tr>
98 <td nowrap="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label>&nbsp;</td>
99 <td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td>
100 </tr>
101 </table>
102 </fieldset>
103 </div>
104
105 <div id="appearance_panel" class="panel">
106 <fieldset>
107 <legend>{#fullpage_dlg.appearance_textprops}</legend>
108
109 <table border="0" cellpadding="4" cellspacing="0">
110 <tr>
111 <td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td>
112 <td>
113 <select id="fontface" name="fontface" onchange="changedStyleField(this);">
114 <option value="">{#not_set}</option>
115 </select>
116 </td>
117 </tr>
118
119 <tr>
120 <td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td>
121 <td>
122 <select id="fontsize" name="fontsize" onchange="changedStyleField(this);">
123 <option value="">{#not_set}</option>
124 </select>
125 </td>
126 </tr>
127
128 <tr>
129 <td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td>
130 <td>
131 <table border="0" cellpadding="0" cellspacing="0">
132 <tr>
133 <td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');changedStyleField(this);" /></td>
134 <td id="textcolor_pickcontainer">&nbsp;</td>
135 </tr>
136 </table>
137 </td>
138 </tr>
139 </table>
140 </fieldset>
141
142 <fieldset>
143 <legend>{#fullpage_dlg.appearance_bgprops}</legend>
144
145 <table border="0" cellpadding="4" cellspacing="0">
146 <tr>
147 <td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td>
148 <td>
149 <table border="0" cellpadding="0" cellspacing="0">
150 <tr>
151 <td><input id="bgimage" name="bgimage" type="text" value="" onchange="changedStyleField(this);" /></td>
152 <td id="bgimage_pickcontainer">&nbsp;</td>
153 </tr>
154 </table>
155 </td>
156 </tr>
157 <tr>
158 <td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td>
159 <td>
160 <table border="0" cellpadding="0" cellspacing="0">
161 <tr>
162 <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedStyleField(this);" /></td>
163 <td id="bgcolor_pickcontainer">&nbsp;</td>
164 </tr>
165 </table>
166 </td>
167 </tr>
168 </table>
169 </fieldset>
170
171 <fieldset>
172 <legend>{#fullpage_dlg.appearance_marginprops}</legend>
173
174 <table border="0" cellpadding="4" cellspacing="0">
175 <tr>
176 <td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td>
177 <td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
178 <td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td>
179 <td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
180 </tr>
181 <tr>
182 <td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td>
183 <td><input id="topmargin" name="topmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
184 <td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td>
185 <td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="changedStyleField(this);" /></td>
186 </tr>
187 </table>
188 </fieldset>
189
190 <fieldset>
191 <legend>{#fullpage_dlg.appearance_linkprops}</legend>
192
193 <table border="0" cellpadding="4" cellspacing="0">
194 <tr>
195 <td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td>
196 <td>
197 <table border="0" cellpadding="0" cellspacing="0">
198 <tr>
199 <td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');changedStyleField(this);" /></td>
200 <td id="link_color_pickcontainer">&nbsp;</td>
201 </tr>
202 </table>
203 </td>
204
205 <td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td>
206 <td>
207 <table border="0" cellpadding="0" cellspacing="0">
208 <tr>
209 <td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');changedStyleField(this);" /></td>
210 <td id="visited_color_pickcontainer">&nbsp;</td>
211 </tr>
212 </table>
213 </td>
214 </tr>
215
216 <tr>
217 <td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td>
218 <td>
219 <table border="0" cellpadding="0" cellspacing="0">
220 <tr>
221 <td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');changedStyleField(this);" /></td>
222 <td id="active_color_pickcontainer">&nbsp;</td>
223 </tr>
224 </table>
225 </td>
226
227 <td>&nbsp;</td>
228 <td>&nbsp;</td>
229
230<!-- <td class="column1"><label for="hover_color">{#fullpage_dlg.hover_color}</label></td>
231 <td>
232 <table border="0" cellpadding="0" cellspacing="0">
233 <tr>
234 <td><input id="hover_color" name="hover_color" type="text" value="" size="9" onchange="changedStyleField(this);" /></td>
235 <td id="hover_color_pickcontainer">&nbsp;</td>
236 </tr>
237 </table>
238 </td> -->
239 </tr>
240 </table>
241 </fieldset>
242
243 <fieldset>
244 <legend>{#fullpage_dlg.appearance_style}</legend>
245
246 <table border="0" cellpadding="4" cellspacing="0">
247 <tr>
248 <td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td>
249 <td><table border="0" cellpadding="0" cellspacing="0">
250 <tr>
251 <td><input id="stylesheet" name="stylesheet" type="text" value="" /></td>
252 <td id="stylesheet_browsercontainer">&nbsp;</td>
253 </tr>
254 </table></td>
255 </tr>
256 <tr>
257 <td class="column1"><label for="style">{#fullpage_dlg.style}</label></td>
258 <td><input id="style" name="style" type="text" value="" onchange="changedStyleField(this);" /></td>
259 </tr>
260 </table>
261 </fieldset>
262 </div>
263
264 <div id="advanced_panel" class="panel">
265 <div id="addmenu">
266 <table border="0" cellpadding="0" cellspacing="0">
267 <tr><td><a href="javascript:addHeadElm('title');" onmousedown="return false;"><span>{#fullpage_dlg.add_title}</span></a></td></tr>
268 <tr><td><a href="javascript:addHeadElm('meta');" onmousedown="return false;"><span>{#fullpage_dlg.add_meta}</span></a></td></tr>
269 <tr><td><a href="javascript:addHeadElm('script');" onmousedown="return false;"><span>{#fullpage_dlg.add_script}</span></a></td></tr>
270 <tr><td><a href="javascript:addHeadElm('style');" onmousedown="return false;"><span>{#fullpage_dlg.add_style}</span></a></td></tr>
271 <tr><td><a href="javascript:addHeadElm('link');" onmousedown="return false;"><span>{#fullpage_dlg.add_link}</span></a></td></tr>
272 <tr><td><a href="javascript:addHeadElm('base');" onmousedown="return false;"><span>{#fullpage_dlg.add_base}</span></a></td></tr>
273 <tr><td><a href="javascript:addHeadElm('comment');" onmousedown="return false;"><span>{#fullpage_dlg.add_comment}</span></a></td></tr>
274 </table>
275 </div>
276
277 <fieldset>
278 <legend>{#fullpage_dlg.head_elements}</legend>
279
280 <div class="headlistwrapper">
281 <div class="toolbar">
282 <div style="float: left">
283 <a id="addbutton" href="javascript:showAddMenu();" onmousedown="return false;" class="addbutton" title="{#fullpage_dlg.add}"></a>
284 <a href="#" onmousedown="return false;" class="removebutton" title="{#fullpage_dlg.remove}"></a>
285 </div>
286 <div style="float: right">
287 <a href="#" onmousedown="return false;" class="moveupbutton" title="{#fullpage_dlg.moveup}"></a>
288 <a href="#" onmousedown="return false;" class="movedownbutton" title="{#fullpage_dlg.movedown}"></a>
289 </div>
290 <br style="clear: both" />
291 </div>
292 <select id="headlist" size="26" onchange="updateHeadElm(this.options[this.selectedIndex].value);">
293 <option value="title_0">&lt;title&gt;Some title bla bla bla&lt;/title&gt;</option>
294 <option value="meta_1">&lt;meta name="keywords"&gt;Some bla bla bla&lt;/meta&gt;</option>
295 <option value="meta_2">&lt;meta name="description"&gt;Some bla bla bla bla bla bla bla bla bla&lt;/meta&gt;</option>
296 <option value="script_3">&lt;script language=&quot;javascript&quot;&gt;...&lt;/script&gt;</option>
297 <option value="style_4">&lt;style&gt;...&lt;/style&gt;</option>
298 <option value="base_5">&lt;base href="." /&gt;</option>
299 <option value="comment_6">&lt;!-- ... --&gt;</option>
300 <option value="link_7">&lt;link href="." /&gt;</option>
301 </select>
302 </div>
303 </fieldset>
304
305 <fieldset id="meta_element">
306 <legend>{#fullpage_dlg.meta_element}</legend>
307
308 <table border="0" cellpadding="4" cellspacing="0">
309 <tr>
310 <td class="column1"><label for="element_meta_type">{#fullpage_dlg.type}</label></td>
311 <td><select id="element_meta_type">
312 <option value="name">name</option>
313 <option value="http-equiv">http-equiv</option>
314 </select></td>
315 </tr>
316 <tr>
317 <td class="column1"><label for="element_meta_name">{#fullpage_dlg.name}</label></td>
318 <td><input id="element_meta_name" name="element_meta_name" type="text" value="" /></td>
319 </tr>
320 <tr>
321 <td class="column1"><label for="element_meta_content">{#fullpage_dlg.content}</label></td>
322 <td><input id="element_meta_content" name="element_meta_content" type="text" value="" /></td>
323 </tr>
324 </table>
325
326 <input type="button" id="meta_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
327 </fieldset>
328
329 <fieldset id="title_element">
330 <legend>{#fullpage_dlg.title_element}</legend>
331
332 <table border="0" cellpadding="4" cellspacing="0">
333 <tr>
334 <td class="column1"><label for="element_title">{#fullpage_dlg.meta_title}</label></td>
335 <td><input id="element_title" name="element_title" type="text" value="" /></td>
336 </tr>
337 </table>
338
339 <input type="button" id="title_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
340 </fieldset>
341
342 <fieldset id="script_element">
343 <legend>{#fullpage_dlg.script_element}</legend>
344
345 <div class="tabs">
346 <ul>
347 <li id="script_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('script_props_tab','script_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>
348 <li id="script_value_tab"><span><a href="javascript:mcTabs.displayTab('script_value_tab','script_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>
349 </ul>
350 </div>
351
352 <br style="clear: both" />
353
354 <div class="panel_wrapper">
355 <div id="script_props_panel" class="panel current">
356 <table border="0" cellpadding="4" cellspacing="0">
357 <tr>
358 <td class="column1"><label for="element_script_type">{#fullpage_dlg.type}</label></td>
359 <td><select id="element_script_type">
360 <option value="text/javascript">text/javascript</option>
361 <option value="text/jscript">text/jscript</option>
362 <option value="text/vbscript">text/vbscript</option>
363 <option value="text/vbs">text/vbs</option>
364 <option value="text/ecmascript">text/ecmascript</option>
365 <option value="text/xml">text/xml</option>
366 </select></td>
367 </tr>
368 <tr>
369 <td class="column1"><label for="element_script_src">{#fullpage_dlg.src}</label></td>
370 <td><table border="0" cellpadding="0" cellspacing="0">
371 <tr>
372 <td><input id="element_script_src" name="element_script_src" type="text" value="" /></td>
373 <td id="script_src_pickcontainer">&nbsp;</td>
374 </tr>
375 </table></td>
376 </tr>
377 <tr>
378 <td class="column1"><label for="element_script_charset">{#fullpage_dlg.charset}</label></td>
379 <td><select id="element_script_charset"><option value="">{#not_set}</option></select></td>
380 </tr>
381 <tr>
382 <td class="column1"><label for="element_script_defer">{#fullpage_dlg.defer}</label></td>
383 <td><input type="checkbox" id="element_script_defer" name="element_script_defer" class="checkbox" /></td>
384 </tr>
385 </table>
386 </div>
387
388 <div id="script_value_panel" class="panel">
389 <textarea id="element_script_value"></textarea>
390 </div>
391 </div>
392
393 <input type="button" id="script_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
394 </fieldset>
395
396 <fieldset id="style_element">
397 <legend>{#fullpage_dlg.style_element}</legend>
398
399 <div class="tabs">
400 <ul>
401 <li id="style_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('style_props_tab','style_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>
402 <li id="style_value_tab"><span><a href="javascript:mcTabs.displayTab('style_value_tab','style_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>
403 </ul>
404 </div>
405
406 <br style="clear: both" />
407
408 <div class="panel_wrapper">
409 <div id="style_props_panel" class="panel current">
410 <table border="0" cellpadding="4" cellspacing="0">
411 <tr>
412 <td class="column1"><label for="element_style_type">{#fullpage_dlg.type}</label></td>
413 <td><select id="element_style_type">
414 <option value="text/css">text/css</option>
415 </select></td>
416 </tr>
417 <tr>
418 <td class="column1"><label for="element_style_media">{#fullpage_dlg.media}</label></td>
419 <td><select id="element_style_media"></select></td>
420 </tr>
421 </table>
422 </div>
423
424 <div id="style_value_panel" class="panel">
425 <textarea id="element_style_value"></textarea>
426 </div>
427 </div>
428
429 <input type="button" id="style_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
430 </fieldset>
431
432 <fieldset id="base_element">
433 <legend>{#fullpage_dlg.base_element}</legend>
434
435 <table border="0" cellpadding="4" cellspacing="0">
436 <tr>
437 <td class="column1"><label for="element_base_href">{#fullpage_dlg.href}</label></td>
438 <td><input id="element_base_href" name="element_base_href" type="text" value="" /></td>
439 </tr>
440 <tr>
441 <td class="column1"><label for="element_base_target">{#fullpage_dlg.target}</label></td>
442 <td><input id="element_base_target" name="element_base_target" type="text" value="" /></td>
443 </tr>
444 </table>
445
446 <input type="button" id="base_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
447 </fieldset>
448
449 <fieldset id="link_element">
450 <legend>{#fullpage_dlg.link_element}</legend>
451
452 <div class="tabs">
453 <ul>
454 <li id="link_general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('link_general_tab','link_general_panel');" onmousedown="return false;">{#fullpage_dlg.general_props}</a></span></li>
455 <li id="link_advanced_tab"><span><a href="javascript:mcTabs.displayTab('link_advanced_tab','link_advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_props}</a></span></li>
456 </ul>
457 </div>
458
459 <br style="clear: both" />
460
461 <div class="panel_wrapper">
462 <div id="link_general_panel" class="panel current">
463 <table border="0" cellpadding="4" cellspacing="0">
464 <tr>
465 <td class="column1"><label for="element_link_href">{#fullpage_dlg.href}</label></td>
466 <td><table border="0" cellpadding="0" cellspacing="0">
467 <tr>
468 <td><input id="element_link_href" name="element_link_href" type="text" value="" /></td>
469 <td id="link_href_pickcontainer">&nbsp;</td>
470 </tr>
471 </table></td>
472 </tr>
473 <tr>
474 <td class="column1"><label for="element_link_title">{#fullpage_dlg.meta_title}</label></td>
475 <td><input id="element_link_title" name="element_link_title" type="text" value="" /></td>
476 </tr>
477 <tr>
478 <td class="column1"><label for="element_link_type">{#fullpage_dlg.type}</label></td>
479 <td><select id="element_link_type" name="element_link_type">
480 <option value="text/css">text/css</option>
481 <option value="text/javascript">text/javascript</option>
482 </select></td>
483 </tr>
484 <tr>
485 <td class="column1"><label for="element_link_media">{#fullpage_dlg.media}</label></td>
486 <td><select id="element_link_media" name="element_link_media"></select></td>
487 </tr>
488 <tr>
489 <td><label for="element_style_rel">{#fullpage_dlg.rel}</label></td>
490 <td><select id="element_style_rel" name="element_style_rel">
491 <option value="">{#not_set}</option>
492 <option value="stylesheet">Stylesheet</option>
493 <option value="alternate">Alternate</option>
494 <option value="designates">Designates</option>
495 <option value="start">Start</option>
496 <option value="next">Next</option>
497 <option value="prev">Prev</option>
498 <option value="contents">Contents</option>
499 <option value="index">Index</option>
500 <option value="glossary">Glossary</option>
501 <option value="copyright">Copyright</option>
502 <option value="chapter">Chapter</option>
503 <option value="subsection">Subsection</option>
504 <option value="appendix">Appendix</option>
505 <option value="help">Help</option>
506 <option value="bookmark">Bookmark</option>
507 </select>
508 </td>
509 </tr>
510 </table>
511 </div>
512
513 <div id="link_advanced_panel" class="panel">
514 <table border="0" cellpadding="4" cellspacing="0">
515 <tr>
516 <td class="column1"><label for="element_link_charset">{#fullpage_dlg.charset}</label></td>
517 <td><select id="element_link_charset"><option value="">{#not_set}</option></select></td>
518 </tr>
519 <tr>
520 <td class="column1"><label for="element_link_hreflang">{#fullpage_dlg.hreflang}</label></td>
521 <td><input id="element_link_hreflang" name="element_link_hreflang" type="text" value="" /></td>
522 </tr>
523 <tr>
524 <td class="column1"><label for="element_link_target">{#fullpage_dlg.target}</label></td>
525 <td><input id="element_link_target" name="element_link_target" type="text" value="" /></td>
526 </tr>
527 <tr>
528 <td><label for="element_style_rev">{#fullpage_dlg.rev}</label></td>
529 <td><select id="element_style_rev" name="element_style_rev">
530 <option value="">{#not_set}</option>
531 <option value="alternate">Alternate</option>
532 <option value="designates">Designates</option>
533 <option value="stylesheet">Stylesheet</option>
534 <option value="start">Start</option>
535 <option value="next">Next</option>
536 <option value="prev">Prev</option>
537 <option value="contents">Contents</option>
538 <option value="index">Index</option>
539 <option value="glossary">Glossary</option>
540 <option value="copyright">Copyright</option>
541 <option value="chapter">Chapter</option>
542 <option value="subsection">Subsection</option>
543 <option value="appendix">Appendix</option>
544 <option value="help">Help</option>
545 <option value="bookmark">Bookmark</option>
546 </select>
547 </td>
548 </tr>
549 </table>
550 </div>
551 </div>
552
553 <input type="button" id="link_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
554 </fieldset>
555
556 <fieldset id="comment_element">
557 <legend>{#fullpage_dlg.comment_element}</legend>
558
559 <textarea id="element_comment_value"></textarea>
560
561 <input type="button" id="comment_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
562 </fieldset>
563 </div>
564 </div>
565
566 <div class="mceActionPanel">
567 <div style="float: left">
568 <input type="submit" id="insert" name="update" value="{#update}" />
569 </div>
570
571 <div style="float: right">
572 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
573 </div>
574 </div>
575 </form>
576</body>
577</html>
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js b/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js
new file mode 100755
index 0000000..89059ef
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js
@@ -0,0 +1,461 @@
1tinyMCEPopup.requireLangPack();
2
3var doc;
4
5var defaultDocTypes =
6 'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +
7 'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +
8 'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +
9 'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +
10 'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +
11 'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
12 'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
13
14var defaultEncodings =
15 'Western european (iso-8859-1)=iso-8859-1,' +
16 'Central European (iso-8859-2)=iso-8859-2,' +
17 'Unicode (UTF-8)=utf-8,' +
18 'Chinese traditional (Big5)=big5,' +
19 'Cyrillic (iso-8859-5)=iso-8859-5,' +
20 'Japanese (iso-2022-jp)=iso-2022-jp,' +
21 'Greek (iso-8859-7)=iso-8859-7,' +
22 'Korean (iso-2022-kr)=iso-2022-kr,' +
23 'ASCII (us-ascii)=us-ascii';
24
25var defaultMediaTypes =
26 'all=all,' +
27 'screen=screen,' +
28 'print=print,' +
29 'tty=tty,' +
30 'tv=tv,' +
31 'projection=projection,' +
32 'handheld=handheld,' +
33 'braille=braille,' +
34 'aural=aural';
35
36var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
37var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
38
39function init() {
40 var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style;
41
42 // Setup doctype select box
43 doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(',');
44 for (i=0; i<doctypes.length; i++) {
45 p = doctypes[i].split('=');
46
47 if (p.length > 1)
48 addSelectValue(f, 'doctypes', p[0], p[1]);
49 }
50
51 // Setup fonts select box
52 fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';');
53 for (i=0; i<fonts.length; i++) {
54 p = fonts[i].split('=');
55
56 if (p.length > 1)
57 addSelectValue(f, 'fontface', p[0], p[1]);
58 }
59
60 // Setup fontsize select box
61 fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(',');
62 for (i=0; i<fonts.length; i++)
63 addSelectValue(f, 'fontsize', fonts[i], fonts[i]);
64
65 // Setup mediatype select boxs
66 mediaTypes = ed.getParam("fullpage_media_types", defaultMediaTypes).split(',');
67 for (i=0; i<mediaTypes.length; i++) {
68 p = mediaTypes[i].split('=');
69
70 if (p.length > 1) {
71 addSelectValue(f, 'element_style_media', p[0], p[1]);
72 addSelectValue(f, 'element_link_media', p[0], p[1]);
73 }
74 }
75
76 // Setup encodings select box
77 encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(',');
78 for (i=0; i<encodings.length; i++) {
79 p = encodings[i].split('=');
80
81 if (p.length > 1) {
82 addSelectValue(f, 'docencoding', p[0], p[1]);
83 addSelectValue(f, 'element_script_charset', p[0], p[1]);
84 addSelectValue(f, 'element_link_charset', p[0], p[1]);
85 }
86 }
87
88 document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
89 document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');
90 //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color');
91 document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');
92 document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');
93 document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');
94 document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');
95 document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage');
96 document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage');
97 document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');
98
99 // Resize some elements
100 if (isVisible('stylesheetbrowser'))
101 document.getElementById('stylesheet').style.width = '220px';
102
103 if (isVisible('link_href_browser'))
104 document.getElementById('element_link_href').style.width = '230px';
105
106 if (isVisible('bgimage_browser'))
107 document.getElementById('bgimage').style.width = '210px';
108
109 // Add iframe
110 dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}});
111 doc = dom.get('documentIframe').contentWindow.document;
112 h = tinyMCEPopup.getWindowArg('head_html');
113
114 // Preprocess the HTML disable scripts and urls
115 h = h.replace(/<script>/gi, '<script type="text/javascript">');
116 h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-');
117 h = h.replace(/(src=|href=)/g, 'mce_$1');
118
119 // Write in the content in the iframe
120 doc.write(h + '</body></html>');
121 doc.close();
122
123 // Parse xml and doctype
124 xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
125 xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
126 docType = getReItem(/<\!DOCTYPE.*?>/gi, h, 0);
127 f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);
128
129 // Parse title
130 if (e = doc.getElementsByTagName('title')[0])
131 el.metatitle.value = e.textContent || e.text;
132
133 // Parse meta
134 tinymce.each(doc.getElementsByTagName('meta'), function(n) {
135 var na = (n.getAttribute('name', 2) || '').toLowerCase(), va = n.getAttribute('content', 2), eq = n.getAttribute('httpEquiv', 2) || '';
136
137 e = el['meta' + na];
138
139 if (na == 'robots') {
140 selectByValue(f, 'metarobots', tinymce.trim(va), true, true);
141 return;
142 }
143
144 switch (eq.toLowerCase()) {
145 case "content-type":
146 tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1);
147
148 // Override XML encoding
149 if (tmp != "")
150 xmlEnc = tmp;
151
152 return;
153 }
154
155 if (e)
156 e.value = va;
157 });
158
159 selectByValue(f, 'doctypes', docType, true, true);
160 selectByValue(f, 'docencoding', xmlEnc, true, true);
161 selectByValue(f, 'langdir', doc.body.getAttribute('dir', 2) || '', true, true);
162
163 if (xmlVer != '')
164 el.xml_pi.checked = true;
165
166 // Parse appearance
167
168 // Parse primary stylesheet
169 tinymce.each(doc.getElementsByTagName("link"), function(l) {
170 var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || '';
171
172 if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") {
173 f.stylesheet.value = l.getAttribute('mce_href', 2) || '';
174 return false;
175 }
176 });
177
178 // Get from style elements
179 tinymce.each(doc.getElementsByTagName("style"), function(st) {
180 var tmp = parseStyleElement(st);
181
182 for (x=0; x<tmp.length; x++) {
183 if (tmp[x].rule.indexOf('a:visited') != -1 && tmp[x].data['color'])
184 f.visited_color.value = tmp[x].data['color'];
185
186 if (tmp[x].rule.indexOf('a:link') != -1 && tmp[x].data['color'])
187 f.link_color.value = tmp[x].data['color'];
188
189 if (tmp[x].rule.indexOf('a:active') != -1 && tmp[x].data['color'])
190 f.active_color.value = tmp[x].data['color'];
191 }
192 });
193
194 f.textcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "text");
195 f.active_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "alink");
196 f.link_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "link");
197 f.visited_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "vlink");
198 f.bgcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "bgcolor");
199 f.bgimage.value = tinyMCEPopup.dom.getAttrib(doc.body, "background");
200
201 // Get from style info
202 style = tinyMCEPopup.dom.parseStyle(tinyMCEPopup.dom.getAttrib(doc.body, 'style'));
203
204 if (style['font-family'])
205 selectByValue(f, 'fontface', style['font-family'], true, true);
206 else
207 selectByValue(f, 'fontface', ed.getParam("fullpage_default_fontface", ""), true, true);
208
209 if (style['font-size'])
210 selectByValue(f, 'fontsize', style['font-size'], true, true);
211 else
212 selectByValue(f, 'fontsize', ed.getParam("fullpage_default_fontsize", ""), true, true);
213
214 if (style['color'])
215 f.textcolor.value = convertRGBToHex(style['color']);
216
217 if (style['background-image'])
218 f.bgimage.value = style['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
219
220 if (style['background-color'])
221 f.bgcolor.value = style['background-color'];
222
223 if (style['margin']) {
224 tmp = style['margin'].replace(/[^0-9 ]/g, '');
225 tmp = tmp.split(/ +/);
226 f.topmargin.value = tmp.length > 0 ? tmp[0] : '';
227 f.rightmargin.value = tmp.length > 1 ? tmp[1] : tmp[0];
228 f.bottommargin.value = tmp.length > 2 ? tmp[2] : tmp[0];
229 f.leftmargin.value = tmp.length > 3 ? tmp[3] : tmp[0];
230 }
231
232 if (style['margin-left'])
233 f.leftmargin.value = style['margin-left'].replace(/[^0-9]/g, '');
234
235 if (style['margin-right'])
236 f.rightmargin.value = style['margin-right'].replace(/[^0-9]/g, '');
237
238 if (style['margin-top'])
239 f.topmargin.value = style['margin-top'].replace(/[^0-9]/g, '');
240
241 if (style['margin-bottom'])
242 f.bottommargin.value = style['margin-bottom'].replace(/[^0-9]/g, '');
243
244 f.style.value = tinyMCEPopup.dom.serializeStyle(style);
245
246 // Update colors
247 updateColor('textcolor_pick', 'textcolor');
248 updateColor('bgcolor_pick', 'bgcolor');
249 updateColor('visited_color_pick', 'visited_color');
250 updateColor('active_color_pick', 'active_color');
251 updateColor('link_color_pick', 'link_color');
252}
253
254function getReItem(r, s, i) {
255 var c = r.exec(s);
256
257 if (c && c.length > i)
258 return c[i];
259
260 return '';
261}
262
263function updateAction() {
264 var f = document.forms[0], nl, i, h, v, s, head, html, l, tmp, addlink = true, ser;
265
266 head = doc.getElementsByTagName('head')[0];
267
268 // Fix scripts without a type
269 nl = doc.getElementsByTagName('script');
270 for (i=0; i<nl.length; i++) {
271 if (tinyMCEPopup.dom.getAttrib(nl[i], 'mce_type') == '')
272 nl[i].setAttribute('mce_type', 'text/javascript');
273 }
274
275 // Get primary stylesheet
276 nl = doc.getElementsByTagName("link");
277 for (i=0; i<nl.length; i++) {
278 l = nl[i];
279
280 tmp = tinyMCEPopup.dom.getAttrib(l, 'media');
281
282 if (tinyMCEPopup.dom.getAttrib(l, 'mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {
283 addlink = false;
284
285 if (f.stylesheet.value == '')
286 l.parentNode.removeChild(l);
287 else
288 l.setAttribute('mce_href', f.stylesheet.value);
289
290 break;
291 }
292 }
293
294 // Add new link
295 if (f.stylesheet.value != '') {
296 l = doc.createElement('link');
297
298 l.setAttribute('type', 'text/css');
299 l.setAttribute('mce_href', f.stylesheet.value);
300 l.setAttribute('rel', 'stylesheet');
301
302 head.appendChild(l);
303 }
304
305 setMeta(head, 'keywords', f.metakeywords.value);
306 setMeta(head, 'description', f.metadescription.value);
307 setMeta(head, 'author', f.metaauthor.value);
308 setMeta(head, 'copyright', f.metacopyright.value);
309 setMeta(head, 'robots', getSelectValue(f, 'metarobots'));
310 setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding'));
311
312 doc.body.dir = getSelectValue(f, 'langdir');
313 doc.body.style.cssText = f.style.value;
314
315 doc.body.setAttribute('vLink', f.visited_color.value);
316 doc.body.setAttribute('link', f.link_color.value);
317 doc.body.setAttribute('text', f.textcolor.value);
318 doc.body.setAttribute('aLink', f.active_color.value);
319
320 doc.body.style.fontFamily = getSelectValue(f, 'fontface');
321 doc.body.style.fontSize = getSelectValue(f, 'fontsize');
322 doc.body.style.backgroundColor = f.bgcolor.value;
323
324 if (f.leftmargin.value != '')
325 doc.body.style.marginLeft = f.leftmargin.value + 'px';
326
327 if (f.rightmargin.value != '')
328 doc.body.style.marginRight = f.rightmargin.value + 'px';
329
330 if (f.bottommargin.value != '')
331 doc.body.style.marginBottom = f.bottommargin.value + 'px';
332
333 if (f.topmargin.value != '')
334 doc.body.style.marginTop = f.topmargin.value + 'px';
335
336 html = doc.getElementsByTagName('html')[0];
337 html.setAttribute('lang', f.langcode.value);
338 html.setAttribute('xml:lang', f.langcode.value);
339
340 if (f.bgimage.value != '')
341 doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')";
342 else
343 doc.body.style.backgroundImage = '';
344
345 ser = tinyMCEPopup.editor.plugins.fullpage._createSerializer();
346 ser.setRules('-title,meta[http-equiv|name|content],base[href|target],link[href|rel|type|title|media],style[type],script[type|language|src],html[lang|xml::lang|xmlns],body[style|dir|vlink|link|text|alink],head');
347
348 h = ser.serialize(doc.documentElement);
349 h = h.substring(0, h.lastIndexOf('</body>'));
350
351 if (h.indexOf('<title>') == -1)
352 h = h.replace(/<head.*?>/, '$&\n' + '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');
353 else
354 h = h.replace(/<title>(.*?)<\/title>/, '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');
355
356 if ((v = getSelectValue(f, 'doctypes')) != '')
357 h = v + '\n' + h;
358
359 if (f.xml_pi.checked) {
360 s = '<?xml version="1.0"';
361
362 if ((v = getSelectValue(f, 'docencoding')) != '')
363 s += ' encoding="' + v + '"';
364
365 s += '?>\n';
366 h = s + h;
367 }
368
369 h = h.replace(/type=\"\-mce\-/gi, 'type="');
370
371 tinyMCEPopup.editor.plugins.fullpage.head = h;
372 tinyMCEPopup.editor.plugins.fullpage._setBodyAttribs(tinyMCEPopup.editor, {});
373 tinyMCEPopup.close();
374}
375
376function changedStyleField(field) {
377}
378
379function setMeta(he, k, v) {
380 var nl, i, m;
381
382 nl = he.getElementsByTagName('meta');
383 for (i=0; i<nl.length; i++) {
384 if (k == 'Content-Type' && tinyMCEPopup.dom.getAttrib(nl[i], 'http-equiv') == k) {
385 if (v == '')
386 nl[i].parentNode.removeChild(nl[i]);
387 else
388 nl[i].setAttribute('content', "text/html; charset=" + v);
389
390 return;
391 }
392
393 if (tinyMCEPopup.dom.getAttrib(nl[i], 'name') == k) {
394 if (v == '')
395 nl[i].parentNode.removeChild(nl[i]);
396 else
397 nl[i].setAttribute('content', v);
398 return;
399 }
400 }
401
402 if (v == '')
403 return;
404
405 m = doc.createElement('meta');
406
407 if (k == 'Content-Type')
408 m.httpEquiv = k;
409 else
410 m.setAttribute('name', k);
411
412 m.setAttribute('content', v);
413 he.appendChild(m);
414}
415
416function parseStyleElement(e) {
417 var v = e.innerHTML;
418 var p, i, r;
419
420 v = v.replace(/<!--/gi, '');
421 v = v.replace(/-->/gi, '');
422 v = v.replace(/[\n\r]/gi, '');
423 v = v.replace(/\s+/gi, ' ');
424
425 r = [];
426 p = v.split(/{|}/);
427
428 for (i=0; i<p.length; i+=2) {
429 if (p[i] != "")
430 r[r.length] = {rule : tinymce.trim(p[i]), data : tinyMCEPopup.dom.parseStyle(p[i+1])};
431 }
432
433 return r;
434}
435
436function serializeStyleElement(d) {
437 var i, s, st;
438
439 s = '<!--\n';
440
441 for (i=0; i<d.length; i++) {
442 s += d[i].rule + ' {\n';
443
444 st = tinyMCE.serializeStyle(d[i].data);
445
446 if (st != '')
447 st += ';';
448
449 s += st.replace(/;/g, ';\n');
450 s += '}\n';
451
452 if (i != d.length - 1)
453 s += '\n';
454 }
455
456 s += '\n-->';
457
458 return s;
459}
460
461tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js
new file mode 100755
index 0000000..f5801b8
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js
@@ -0,0 +1,85 @@
1tinyMCE.addI18n('en.fullpage_dlg',{
2title:"Document properties",
3meta_tab:"General",
4appearance_tab:"Appearance",
5advanced_tab:"Advanced",
6meta_props:"Meta information",
7langprops:"Language and encoding",
8meta_title:"Title",
9meta_keywords:"Keywords",
10meta_description:"Description",
11meta_robots:"Robots",
12doctypes:"Doctype",
13langcode:"Language code",
14langdir:"Language direction",
15ltr:"Left to right",
16rtl:"Right to left",
17xml_pi:"XML declaration",
18encoding:"Character encoding",
19appearance_bgprops:"Background properties",
20appearance_marginprops:"Body margins",
21appearance_linkprops:"Link colors",
22appearance_textprops:"Text properties",
23bgcolor:"Background color",
24bgimage:"Background image",
25left_margin:"Left margin",
26right_margin:"Right margin",
27top_margin:"Top margin",
28bottom_margin:"Bottom margin",
29text_color:"Text color",
30font_size:"Font size",
31font_face:"Font face",
32link_color:"Link color",
33hover_color:"Hover color",
34visited_color:"Visited color",
35active_color:"Active color",
36textcolor:"Color",
37fontsize:"Font size",
38fontface:"Font family",
39meta_index_follow:"Index and follow the links",
40meta_index_nofollow:"Index and don't follow the links",
41meta_noindex_follow:"Do not index but follow the links",
42meta_noindex_nofollow:"Do not index and don\'t follow the links",
43appearance_style:"Stylesheet and style properties",
44stylesheet:"Stylesheet",
45style:"Style",
46author:"Author",
47copyright:"Copyright",
48add:"Add new element",
49remove:"Remove selected element",
50moveup:"Move selected element up",
51movedown:"Move selected element down",
52head_elements:"Head elements",
53info:"Information",
54add_title:"Title element",
55add_meta:"Meta element",
56add_script:"Script element",
57add_style:"Style element",
58add_link:"Link element",
59add_base:"Base element",
60add_comment:"Comment node",
61title_element:"Title element",
62script_element:"Script element",
63style_element:"Style element",
64base_element:"Base element",
65link_element:"Link element",
66meta_element:"Meta element",
67comment_element:"Comment",
68src:"Src",
69language:"Language",
70href:"Href",
71target:"Target",
72type:"Type",
73charset:"Charset",
74defer:"Defer",
75media:"Media",
76properties:"Properties",
77name:"Name",
78value:"Value",
79content:"Content",
80rel:"Rel",
81rev:"Rev",
82hreflang:"Href lang",
83general_props:"General",
84advanced_props:"Advanced"
85}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js b/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js
new file mode 100755
index 0000000..fbcec59
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js
@@ -0,0 +1 @@
(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=DOM.doc.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{DOM.win.setTimeout(function(){tinymce.dom.Event.remove(DOM.win,'resize',t.resizeFunc);tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(DOM.doc.body,'overflow',ed.getParam('fullscreen_overflow'));DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));tinyMCE.settings=tinyMCE.oldSettings;},10);}return;}if(ed.getParam('fullscreen_new_window')){win=DOM.win.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{tinyMCE.oldSettings=tinyMCE.settings;s.fullscreen_overflow=DOM.getStyle(DOM.doc.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(tinymce.isIE&&(s.fullscreen_html_overflow=='visible'||s.fullscreen_html_overflow=='scroll'))s.fullscreen_html_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(DOM.doc.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();DOM.win.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(DOM.doc.body,'div',{id:'mce_fullscreen_container',style:'position:'+(tinymce.isIE6||(tinymce.isIE&&!DOM.boxModel)?'absolute':'fixed')+';top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:200000;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;s.save_onsavecallback=function(){ed.setContent(tinyMCE.get(s.id).getContent({format:'raw'}),{format:'raw'});ed.execCommand('mceSave');};tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent());t.fullscreenEditor.focus();});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();t.resizeFunc=tinymce.dom.Event.add(DOM.win,'resize',function(){var vp=tinymce.DOM.getViewPort();t.fullscreenEditor.theme.resizeTo(vp.w,vp.h);});}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js
new file mode 100755
index 0000000..77a8c3b
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js
@@ -0,0 +1,145 @@
1/**
2 * $Id: editor_plugin_src.js 923 2008-09-09 16:45:29Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var DOM = tinymce.DOM;
10
11 tinymce.create('tinymce.plugins.FullScreenPlugin', {
12 init : function(ed, url) {
13 var t = this, s = {}, vp;
14
15 t.editor = ed;
16
17 // Register commands
18 ed.addCommand('mceFullScreen', function() {
19 var win, de = DOM.doc.documentElement;
20
21 if (ed.getParam('fullscreen_is_enabled')) {
22 if (ed.getParam('fullscreen_new_window'))
23 closeFullscreen(); // Call to close in new window
24 else {
25 DOM.win.setTimeout(function() {
26 tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
27 tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
28 tinyMCE.remove(ed);
29 DOM.remove('mce_fullscreen_container');
30 de.style.overflow = ed.getParam('fullscreen_html_overflow');
31 DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));
32 DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
33 tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
34 }, 10);
35 }
36
37 return;
38 }
39
40 if (ed.getParam('fullscreen_new_window')) {
41 win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
42 try {
43 win.resizeTo(screen.availWidth, screen.availHeight);
44 } catch (e) {
45 // Ignore
46 }
47 } else {
48 tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
49 s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
50 s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
51 vp = DOM.getViewPort();
52 s.fullscreen_scrollx = vp.x;
53 s.fullscreen_scrolly = vp.y;
54
55 // Fixes an Opera bug where the scrollbars doesn't reappear
56 if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
57 s.fullscreen_overflow = 'auto';
58
59 // Fixes an IE bug where horizontal scrollbars would appear
60 if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
61 s.fullscreen_overflow = 'auto';
62
63 // Fixes an IE bug where the scrollbars doesn't reappear
64 if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
65 s.fullscreen_html_overflow = 'auto';
66
67 if (s.fullscreen_overflow == '0px')
68 s.fullscreen_overflow = '';
69
70 DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
71 de.style.overflow = 'hidden'; //Fix for IE6/7
72 vp = DOM.getViewPort();
73 DOM.win.scrollTo(0, 0);
74
75 if (tinymce.isIE)
76 vp.h -= 1;
77
78 n = DOM.add(DOM.doc.body, 'div', {id : 'mce_fullscreen_container', style : 'position:' + (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel) ? 'absolute' : 'fixed') + ';top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
79 DOM.add(n, 'div', {id : 'mce_fullscreen'});
80
81 tinymce.each(ed.settings, function(v, n) {
82 s[n] = v;
83 });
84
85 s.id = 'mce_fullscreen';
86 s.width = n.clientWidth;
87 s.height = n.clientHeight - 15;
88 s.fullscreen_is_enabled = true;
89 s.fullscreen_editor_id = ed.id;
90 s.theme_advanced_resizing = false;
91 s.save_onsavecallback = function() {
92 ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'});
93 ed.execCommand('mceSave');
94 };
95
96 tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {
97 s[k] = v;
98 });
99
100 if (s.theme_advanced_toolbar_location === 'external')
101 s.theme_advanced_toolbar_location = 'top';
102
103 t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
104 t.fullscreenEditor.onInit.add(function() {
105 t.fullscreenEditor.setContent(ed.getContent());
106 t.fullscreenEditor.focus();
107 });
108
109 t.fullscreenEditor.render();
110 tinyMCE.add(t.fullscreenEditor);
111
112 t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
113 t.fullscreenElement.update();
114 //document.body.overflow = 'hidden';
115
116 t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {
117 var vp = tinymce.DOM.getViewPort();
118
119 t.fullscreenEditor.theme.resizeTo(vp.w, vp.h);
120 });
121 }
122 });
123
124 // Register buttons
125 ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});
126
127 ed.onNodeChange.add(function(ed, cm) {
128 cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
129 });
130 },
131
132 getInfo : function() {
133 return {
134 longname : 'Fullscreen',
135 author : 'Moxiecode Systems AB',
136 authorurl : 'http://tinymce.moxiecode.com',
137 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',
138 version : tinymce.majorVersion + "." + tinymce.minorVersion
139 };
140 }
141 });
142
143 // Register plugin
144 tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
145})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm b/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm
new file mode 100755
index 0000000..4b081ca
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm
@@ -0,0 +1,111 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title></title>
5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
6 <script type="text/javascript" src="../../tiny_mce.js"></script>
7 <script type="text/javascript">
8 function patchCallback(settings, key) {
9 if (settings[key])
10 settings[key] = "window.opener." + settings[key];
11 }
12
13 var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;
14
15 // Clone array
16 for (var n in paSe)
17 settings[n] = paSe[n];
18
19 // Override options for fullscreen
20 for (var n in paSe.fullscreen_settings)
21 settings[n] = paSe.fullscreen_settings[n];
22
23 // Patch callbacks, make them point to window.opener
24 patchCallback(settings, 'urlconverter_callback');
25 patchCallback(settings, 'insertlink_callback');
26 patchCallback(settings, 'insertimage_callback');
27 patchCallback(settings, 'setupcontent_callback');
28 patchCallback(settings, 'save_callback');
29 patchCallback(settings, 'onchange_callback');
30 patchCallback(settings, 'init_instance_callback');
31 patchCallback(settings, 'file_browser_callback');
32 patchCallback(settings, 'cleanup_callback');
33 patchCallback(settings, 'execcommand_callback');
34 patchCallback(settings, 'oninit');
35
36 // Set options
37 delete settings.id;
38 settings['mode'] = 'exact';
39 settings['elements'] = 'fullscreenarea';
40 settings['add_unload_trigger'] = false;
41 settings['ask'] = false;
42 settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
43 settings['fullscreen_is_enabled'] = true;
44 settings['fullscreen_editor_id'] = oeID;
45 settings['theme_advanced_resizing'] = false;
46 settings['strict_loading_mode'] = true;
47
48 settings.save_onsavecallback = function() {
49 window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
50 window.opener.tinyMCE.get(oeID).execCommand('mceSave');
51 window.close();
52 };
53
54 function unloadHandler(e) {
55 moveContent();
56 }
57
58 function moveContent() {
59 window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
60 }
61
62 function closeFullscreen() {
63 moveContent();
64 window.close();
65 }
66
67 function doParentSubmit() {
68 moveContent();
69
70 if (window.opener.tinyMCE.selectedInstance.formElement.form)
71 window.opener.tinyMCE.selectedInstance.formElement.form.submit();
72
73 window.close();
74
75 return false;
76 }
77
78 function render() {
79 var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
80
81 e.value = window.opener.tinyMCE.get(oeID).getContent();
82
83 vp = dom.getViewPort();
84 settings.width = vp.w;
85 settings.height = vp.h - 15;
86
87 tinymce.dom.Event.add(window, 'resize', function() {
88 var vp = dom.getViewPort();
89
90 tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
91 });
92
93 tinyMCE.init(settings);
94 }
95
96 // Add onunload
97 tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
98 </script>
99 <base target="_self" />
100</head>
101<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
102<form onsubmit="doParentSubmit();">
103<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>
104</form>
105
106<script type="text/javascript">
107 render();
108</script>
109
110</body>
111</html>
diff --git a/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js b/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js
new file mode 100755
index 0000000..06dae75
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.IESpell',{init:function(ed,url){var t=this,sp;if(!tinymce.isIE)return;t.editor=ed;ed.addCommand('mceIESpell',function(){try{sp=new ActiveXObject("ieSpell.ieSpellExtension");sp.CheckDocumentNode(ed.getDoc().documentElement);}catch(e){if(e.number==-2146827859){ed.windowManager.confirm(ed.getLang("iespell.download"),function(s){if(s)window.open('http://www.iespell.com/download.php','ieSpellDownload','');});}else ed.windowManager.alert("Error Loading ieSpell: Exception "+e.number);}});ed.addButton('iespell',{title:'iespell.iespell_desc',cmd:'mceIESpell'});},getInfo:function(){return{longname:'IESpell (IE Only)',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('iespell',tinymce.plugins.IESpell);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js
new file mode 100755
index 0000000..a68f69a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js
@@ -0,0 +1,51 @@
1/**
2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.IESpell', {
10 init : function(ed, url) {
11 var t = this, sp;
12
13 if (!tinymce.isIE)
14 return;
15
16 t.editor = ed;
17
18 // Register commands
19 ed.addCommand('mceIESpell', function() {
20 try {
21 sp = new ActiveXObject("ieSpell.ieSpellExtension");
22 sp.CheckDocumentNode(ed.getDoc().documentElement);
23 } catch (e) {
24 if (e.number == -2146827859) {
25 ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {
26 if (s)
27 window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
28 });
29 } else
30 ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);
31 }
32 });
33
34 // Register buttons
35 ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});
36 },
37
38 getInfo : function() {
39 return {
40 longname : 'IESpell (IE Only)',
41 author : 'Moxiecode Systems AB',
42 authorurl : 'http://tinymce.moxiecode.com',
43 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',
44 version : tinymce.majorVersion + "." + tinymce.minorVersion
45 };
46 }
47 });
48
49 // Register plugin
50 tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);
51})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js b/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js
new file mode 100755
index 0000000..5560b6b
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js
@@ -0,0 +1 @@
(function(){var DOM=tinymce.DOM,Element=tinymce.dom.Element,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.InlinePopups',{init:function(ed,url){ed.onBeforeRenderUI.add(function(){ed.windowManager=new tinymce.InlineWindowManager(ed);DOM.loadCSS(url+'/skins/'+(ed.settings.inlinepopups_skin||'clearlooks2')+"/window.css");});},getInfo:function(){return{longname:'InlinePopups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager',{InlineWindowManager:function(ed){var t=this;t.parent(ed);t.zIndex=300000;t.count=0;t.windows={};},open:function(f,p){var t=this,id,opt='',ed=t.editor,dw=0,dh=0,vp,po,mdf,clf,we,w,u;f=f||{};p=p||{};if(!f.inline)return t.parent(f,p);if(!f.type)t.bookmark=ed.selection.getBookmark('simple');id=DOM.uniqueId();vp=DOM.getViewPort();f.width=parseInt(f.width||320);f.height=parseInt(f.height||240)+(tinymce.isIE?8:0);f.min_width=parseInt(f.min_width||150);f.min_height=parseInt(f.min_height||100);f.max_width=parseInt(f.max_width||2000);f.max_height=parseInt(f.max_height||2000);f.left=f.left||Math.round(Math.max(vp.x,vp.x+(vp.w/ 2.0) - (f.width /2.0)));f.top=f.top||Math.round(Math.max(vp.y,vp.y+(vp.h/ 2.0) - (f.height /2.0)));f.movable=f.resizable=true;p.mce_width=f.width;p.mce_height=f.height;p.mce_inline=true;p.mce_window_id=id;p.mce_auto_focus=f.auto_focus;t.features=f;t.params=p;t.onOpen.dispatch(t,f,p);if(f.type){opt+=' mceModal';if(f.type)opt+=' mce'+f.type.substring(0,1).toUpperCase()+f.type.substring(1);f.resizable=false;}if(f.statusbar)opt+=' mceStatusbar';if(f.resizable)opt+=' mceResizable';if(f.minimizable)opt+=' mceMinimizable';if(f.maximizable)opt+=' mceMaximizable';if(f.movable)opt+=' mceMovable';t._addAll(DOM.doc.body,['div',{id:id,'class':ed.settings.inlinepopups_skin||'clearlooks2',style:'width:100px;height:100px'},['div',{id:id+'_wrapper','class':'mceWrapper'+opt},['div',{id:id+'_top','class':'mceTop'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_title'},f.title||'']],['div',{id:id+'_middle','class':'mceMiddle'},['div',{id:id+'_left','class':'mceLeft'}],['span',{id:id+'_content'}],['div',{id:id+'_right','class':'mceRight'}]],['div',{id:id+'_bottom','class':'mceBottom'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_status'},'Content']],['a',{'class':'mceMove',tabindex:'-1',href:'javascript:;'}],['a',{'class':'mceMin',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMax',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMed',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceClose',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{id:id+'_resize_n','class':'mceResize mceResizeN',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_s','class':'mceResize mceResizeS',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_w','class':'mceResize mceResizeW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_e','class':'mceResize mceResizeE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_nw','class':'mceResize mceResizeNW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_ne','class':'mceResize mceResizeNE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_sw','class':'mceResize mceResizeSW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_se','class':'mceResize mceResizeSE',tabindex:'-1',href:'javascript:;'}]]]);DOM.setStyles(id,{top:-10000,left:-10000});if(tinymce.isGecko)DOM.setStyle(id,'overflow','auto');if(!f.type){dw+=DOM.get(id+'_left').clientWidth;dw+=DOM.get(id+'_right').clientWidth;dh+=DOM.get(id+'_top').clientHeight;dh+=DOM.get(id+'_bottom').clientHeight;}DOM.setStyles(id,{top:f.top,left:f.left,width:f.width+dw,height:f.height+dh});u=f.url||f.file;if(u){if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);}if(!f.type){DOM.add(id+'_content','iframe',{id:id+'_ifr',src:'javascript:""',frameBorder:0,style:'border:0;width:10px;height:10px'});DOM.setStyles(id+'_ifr',{width:f.width,height:f.height});DOM.setAttrib(id+'_ifr','src',u);}else{DOM.add(id+'_wrapper','a',{id:id+'_ok','class':'mceButton mceOk',href:'javascript:;',onmousedown:'return false;'},'Ok');if(f.type=='confirm')DOM.add(id+'_wrapper','a',{'class':'mceButton mceCancel',href:'javascript:;',onmousedown:'return false;'},'Cancel');DOM.add(id+'_middle','div',{'class':'mceIcon'});DOM.setHTML(id+'_content',f.content.replace('\n','<br />'));}mdf=Event.add(id,'mousedown',function(e){var n=e.target,w,vp;w=t.windows[id];t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){if(n.className=='mceMax'){w.oldPos=w.element.getXY();w.oldSize=w.element.getSize();vp=DOM.getViewPort();vp.w-=2;vp.h-=2;w.element.moveTo(vp.x,vp.y);w.element.resizeTo(vp.w,vp.h);DOM.setStyles(id+'_ifr',{width:vp.w-w.deltaWidth,height:vp.h-w.deltaHeight});DOM.addClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMed'){w.element.moveTo(w.oldPos.x,w.oldPos.y);w.element.resizeTo(w.oldSize.w,w.oldSize.h);w.iframeElement.resizeTo(w.oldSize.w-w.deltaWidth,w.oldSize.h-w.deltaHeight);DOM.removeClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMove')return t._startDrag(id,e,n.className);else if(DOM.hasClass(n,'mceResize'))return t._startDrag(id,e,n.className.substring(13));}});clf=Event.add(id,'click',function(e){var n=e.target;t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){switch(n.className){case'mceClose':t.close(null,id);return Event.cancel(e);case'mceButton mceOk':case'mceButton mceCancel':f.button_func(n.className=='mceButton mceOk');return Event.cancel(e);}}});w=t.windows[id]={id:id,mousedown_func:mdf,click_func:clf,element:new Element(id,{blocker:1,container:ed.getContainer()}),iframeElement:new Element(id+'_ifr'),features:f,deltaWidth:dw,deltaHeight:dh};w.iframeElement.on('focus',function(){t.focus(id);});if(t.count==0&&t.editor.getParam('dialog_type','modal')=='modal'){DOM.add(DOM.doc.body,'div',{id:'mceModalBlocker','class':(t.editor.settings.inlinepopups_skin||'clearlooks2')+'_modalBlocker',style:{zIndex:t.zIndex-1}});DOM.show('mceModalBlocker');}else DOM.setStyle('mceModalBlocker','z-index',t.zIndex-1);if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!DOM.boxModel))DOM.setStyles('mceModalBlocker',{position:'absolute',width:vp.w-2,height:vp.h-2});t.focus(id);t._fixIELayout(id,1);if(DOM.get(id+'_ok'))DOM.get(id+'_ok').focus();t.count++;return w;},focus:function(id){var t=this,w;if(w=t.windows[id]){w.zIndex=this.zIndex++;w.element.setStyle('zIndex',w.zIndex);w.element.update();id=id+'_wrapper';DOM.removeClass(t.lastId,'mceFocus');DOM.addClass(id,'mceFocus');t.lastId=id;}},_addAll:function(te,ne){var i,n,t=this,dom=tinymce.DOM;if(is(ne,'string'))te.appendChild(dom.doc.createTextNode(ne));else if(ne.length){te=te.appendChild(dom.create(ne[0],ne[1]));for(i=2;i<ne.length;i++)t._addAll(te,ne[i]);}},_startDrag:function(id,se,ac){var t=this,mu,mm,d=DOM.doc,eb,w=t.windows[id],we=w.element,sp=we.getXY(),p,sz,ph,cp,vp,sx,sy,sex,sey,dx,dy,dw,dh;cp={x:0,y:0};vp=DOM.getViewPort();vp.w-=2;vp.h-=2;sex=se.screenX;sey=se.screenY;dx=dy=dw=dh=0;mu=Event.add(d,'mouseup',function(e){Event.remove(d,'mouseup',mu);Event.remove(d,'mousemove',mm);if(eb)eb.remove();we.moveBy(dx,dy);we.resizeBy(dw,dh);sz=we.getSize();DOM.setStyles(id+'_ifr',{width:sz.w-w.deltaWidth,height:sz.h-w.deltaHeight});t._fixIELayout(id,1);return Event.cancel(e);});if(ac!='Move')startMove();function startMove(){if(eb)return;t._fixIELayout(id,0);DOM.add(d.body,'div',{id:'mceEventBlocker','class':'mceEventBlocker '+(t.editor.settings.inlinepopups_skin||'clearlooks2'),style:{zIndex:t.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!DOM.boxModel))DOM.setStyles('mceEventBlocker',{position:'absolute',width:vp.w-2,height:vp.h-2});eb=new Element('mceEventBlocker');eb.update();p=we.getXY();sz=we.getSize();sx=cp.x+p.x-vp.x;sy=cp.y+p.y-vp.y;DOM.add(eb.get(),'div',{id:'mcePlaceHolder','class':'mcePlaceHolder',style:{left:sx,top:sy,width:sz.w,height:sz.h}});ph=new Element('mcePlaceHolder');};mm=Event.add(d,'mousemove',function(e){var x,y,v;startMove();x=e.screenX-sex;y=e.screenY-sey;switch(ac){case'ResizeW':dx=x;dw=0-x;break;case'ResizeE':dw=x;break;case'ResizeN':case'ResizeNW':case'ResizeNE':if(ac=="ResizeNW"){dx=x;dw=0-x;}else if(ac=="ResizeNE")dw=x;dy=y;dh=0-y;break;case'ResizeS':case'ResizeSW':case'ResizeSE':if(ac=="ResizeSW"){dx=x;dw=0-x;}else if(ac=="ResizeSE")dw=x;dh=y;break;case'mceMove':dx=x;dy=y;break;}if(dw<(v=w.features.min_width-sz.w)){if(dx!==0)dx+=dw-v;dw=v;}if(dh<(v=w.features.min_height-sz.h)){if(dy!==0)dy+=dh-v;dh=v;}dw=Math.min(dw,w.features.max_width-sz.w);dh=Math.min(dh,w.features.max_height-sz.h);dx=Math.max(dx,vp.x-(sx+vp.x));dy=Math.max(dy,vp.y-(sy+vp.y));dx=Math.min(dx,(vp.w+vp.x)-(sx+sz.w+vp.x));dy=Math.min(dy,(vp.h+vp.y)-(sy+sz.h+vp.y));if(dx+dy!==0){if(sx+dx<0)dx=0;if(sy+dy<0)dy=0;ph.moveTo(sx+dx,sy+dy);}if(dw+dh!==0)ph.resizeTo(sz.w+dw,sz.h+dh);return Event.cancel(e);});return Event.cancel(se);},resizeBy:function(dw,dh,id){var w=this.windows[id];if(w){w.element.resizeBy(dw,dh);w.iframeElement.resizeBy(dw,dh);}},close:function(win,id){var t=this,w,d=DOM.doc,ix=0,fw,id;id=t._findId(id||win);if(!t.windows[id]){t.parent(win);return;}t.count--;if(t.count==0)DOM.remove('mceModalBlocker');if(w=t.windows[id]){t.onClose.dispatch(t);Event.remove(d,'mousedown',w.mousedownFunc);Event.remove(d,'click',w.clickFunc);Event.clear(id);Event.clear(id+'_ifr');DOM.setAttrib(id+'_ifr','src','javascript:""');w.element.remove();delete t.windows[id];each(t.windows,function(w){if(w.zIndex>ix){fw=w;ix=w.zIndex;}});if(fw)t.focus(fw.id);}},setTitle:function(w,ti){var e;w=this._findId(w);if(e=DOM.get(w+'_title'))e.innerHTML=DOM.encode(ti);},alert:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'alert',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},confirm:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'confirm',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},_findId:function(w){var t=this;if(typeof(w)=='string')return w;each(t.windows,function(wo){var ifr=DOM.get(wo.id+'_ifr');if(ifr&&w==ifr.contentWindow){w=wo.id;return false;}});return w;},_fixIELayout:function(id,s){var w,img;if(!tinymce.isIE6)return;each(['n','s','w','e','nw','ne','sw','se'],function(v){var e=DOM.get(id+'_resize_'+v);DOM.setStyles(e,{width:s?e.clientWidth:'',height:s?e.clientHeight:'',cursor:DOM.getStyle(e,'cursor',1)});DOM.setStyle(id+"_bottom",'bottom','-1px');e=0;});if(w=this.windows[id]){w.element.hide();w.element.show();each(DOM.select('div,a',id),function(e,i){if(e.currentStyle.backgroundImage!='none'){img=new Image();img.src=e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,'$1');}});DOM.get(id).style.filter='';}}});tinymce.PluginManager.add('inlinepopups',tinymce.plugins.InlinePopups);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
new file mode 100755
index 0000000..027a23c
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
@@ -0,0 +1,632 @@
1/**
2 * $Id: editor_plugin_src.js 961 2008-11-14 10:31:07Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;
10
11 tinymce.create('tinymce.plugins.InlinePopups', {
12 init : function(ed, url) {
13 // Replace window manager
14 ed.onBeforeRenderUI.add(function() {
15 ed.windowManager = new tinymce.InlineWindowManager(ed);
16 DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css");
17 });
18 },
19
20 getInfo : function() {
21 return {
22 longname : 'InlinePopups',
23 author : 'Moxiecode Systems AB',
24 authorurl : 'http://tinymce.moxiecode.com',
25 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
26 version : tinymce.majorVersion + "." + tinymce.minorVersion
27 };
28 }
29 });
30
31 tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', {
32 InlineWindowManager : function(ed) {
33 var t = this;
34
35 t.parent(ed);
36 t.zIndex = 300000;
37 t.count = 0;
38 t.windows = {};
39 },
40
41 open : function(f, p) {
42 var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u;
43
44 f = f || {};
45 p = p || {};
46
47 // Run native windows
48 if (!f.inline)
49 return t.parent(f, p);
50
51 // Only store selection if the type is a normal window
52 if (!f.type)
53 t.bookmark = ed.selection.getBookmark('simple');
54
55 id = DOM.uniqueId();
56 vp = DOM.getViewPort();
57 f.width = parseInt(f.width || 320);
58 f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
59 f.min_width = parseInt(f.min_width || 150);
60 f.min_height = parseInt(f.min_height || 100);
61 f.max_width = parseInt(f.max_width || 2000);
62 f.max_height = parseInt(f.max_height || 2000);
63 f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0)));
64 f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0)));
65 f.movable = f.resizable = true;
66 p.mce_width = f.width;
67 p.mce_height = f.height;
68 p.mce_inline = true;
69 p.mce_window_id = id;
70 p.mce_auto_focus = f.auto_focus;
71
72 // Transpose
73// po = DOM.getPos(ed.getContainer());
74// f.left -= po.x;
75// f.top -= po.y;
76
77 t.features = f;
78 t.params = p;
79 t.onOpen.dispatch(t, f, p);
80
81 if (f.type) {
82 opt += ' mceModal';
83
84 if (f.type)
85 opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1);
86
87 f.resizable = false;
88 }
89
90 if (f.statusbar)
91 opt += ' mceStatusbar';
92
93 if (f.resizable)
94 opt += ' mceResizable';
95
96 if (f.minimizable)
97 opt += ' mceMinimizable';
98
99 if (f.maximizable)
100 opt += ' mceMaximizable';
101
102 if (f.movable)
103 opt += ' mceMovable';
104
105 // Create DOM objects
106 t._addAll(DOM.doc.body,
107 ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'},
108 ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
109 ['div', {id : id + '_top', 'class' : 'mceTop'},
110 ['div', {'class' : 'mceLeft'}],
111 ['div', {'class' : 'mceCenter'}],
112 ['div', {'class' : 'mceRight'}],
113 ['span', {id : id + '_title'}, f.title || '']
114 ],
115
116 ['div', {id : id + '_middle', 'class' : 'mceMiddle'},
117 ['div', {id : id + '_left', 'class' : 'mceLeft'}],
118 ['span', {id : id + '_content'}],
119 ['div', {id : id + '_right', 'class' : 'mceRight'}]
120 ],
121
122 ['div', {id : id + '_bottom', 'class' : 'mceBottom'},
123 ['div', {'class' : 'mceLeft'}],
124 ['div', {'class' : 'mceCenter'}],
125 ['div', {'class' : 'mceRight'}],
126 ['span', {id : id + '_status'}, 'Content']
127 ],
128
129 ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}],
130 ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
131 ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
132 ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
133 ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
134 ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}],
135 ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}],
136 ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}],
137 ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}],
138 ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}],
139 ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}],
140 ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}],
141 ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}]
142 ]
143 ]
144 );
145
146 DOM.setStyles(id, {top : -10000, left : -10000});
147
148 // Fix gecko rendering bug, where the editors iframe messed with window contents
149 if (tinymce.isGecko)
150 DOM.setStyle(id, 'overflow', 'auto');
151
152 // Measure borders
153 if (!f.type) {
154 dw += DOM.get(id + '_left').clientWidth;
155 dw += DOM.get(id + '_right').clientWidth;
156 dh += DOM.get(id + '_top').clientHeight;
157 dh += DOM.get(id + '_bottom').clientHeight;
158 }
159
160 // Resize window
161 DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});
162
163 u = f.url || f.file;
164 if (u) {
165 if (tinymce.relaxedDomain)
166 u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;
167
168 u = tinymce._addVer(u);
169 }
170
171 if (!f.type) {
172 DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});
173 DOM.setStyles(id + '_ifr', {width : f.width, height : f.height});
174 DOM.setAttrib(id + '_ifr', 'src', u);
175 } else {
176 DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok');
177
178 if (f.type == 'confirm')
179 DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel');
180
181 DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
182 DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
183 }
184
185 // Register events
186 mdf = Event.add(id, 'mousedown', function(e) {
187 var n = e.target, w, vp;
188
189 w = t.windows[id];
190 t.focus(id);
191
192 if (n.nodeName == 'A' || n.nodeName == 'a') {
193 if (n.className == 'mceMax') {
194 w.oldPos = w.element.getXY();
195 w.oldSize = w.element.getSize();
196
197 vp = DOM.getViewPort();
198
199 // Reduce viewport size to avoid scrollbars
200 vp.w -= 2;
201 vp.h -= 2;
202
203 w.element.moveTo(vp.x, vp.y);
204 w.element.resizeTo(vp.w, vp.h);
205 DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight});
206 DOM.addClass(id + '_wrapper', 'mceMaximized');
207 } else if (n.className == 'mceMed') {
208 // Reset to old size
209 w.element.moveTo(w.oldPos.x, w.oldPos.y);
210 w.element.resizeTo(w.oldSize.w, w.oldSize.h);
211 w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight);
212
213 DOM.removeClass(id + '_wrapper', 'mceMaximized');
214 } else if (n.className == 'mceMove')
215 return t._startDrag(id, e, n.className);
216 else if (DOM.hasClass(n, 'mceResize'))
217 return t._startDrag(id, e, n.className.substring(13));
218 }
219 });
220
221 clf = Event.add(id, 'click', function(e) {
222 var n = e.target;
223
224 t.focus(id);
225
226 if (n.nodeName == 'A' || n.nodeName == 'a') {
227 switch (n.className) {
228 case 'mceClose':
229 t.close(null, id);
230 return Event.cancel(e);
231
232 case 'mceButton mceOk':
233 case 'mceButton mceCancel':
234 f.button_func(n.className == 'mceButton mceOk');
235 return Event.cancel(e);
236 }
237 }
238 });
239
240 // Add window
241 w = t.windows[id] = {
242 id : id,
243 mousedown_func : mdf,
244 click_func : clf,
245 element : new Element(id, {blocker : 1, container : ed.getContainer()}),
246 iframeElement : new Element(id + '_ifr'),
247 features : f,
248 deltaWidth : dw,
249 deltaHeight : dh
250 };
251
252 w.iframeElement.on('focus', function() {
253 t.focus(id);
254 });
255
256 // Setup blocker
257 if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {
258 DOM.add(DOM.doc.body, 'div', {
259 id : 'mceModalBlocker',
260 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',
261 style : {zIndex : t.zIndex - 1}
262 });
263
264 DOM.show('mceModalBlocker'); // Reduces flicker in IE
265 } else
266 DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);
267
268 if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel))
269 DOM.setStyles('mceModalBlocker', {position : 'absolute', width : vp.w - 2, height : vp.h - 2});
270
271 t.focus(id);
272 t._fixIELayout(id, 1);
273
274 // Focus ok button
275 if (DOM.get(id + '_ok'))
276 DOM.get(id + '_ok').focus();
277
278 t.count++;
279
280 return w;
281 },
282
283 focus : function(id) {
284 var t = this, w;
285
286 if (w = t.windows[id]) {
287 w.zIndex = this.zIndex++;
288 w.element.setStyle('zIndex', w.zIndex);
289 w.element.update();
290
291 id = id + '_wrapper';
292 DOM.removeClass(t.lastId, 'mceFocus');
293 DOM.addClass(id, 'mceFocus');
294 t.lastId = id;
295 }
296 },
297
298 _addAll : function(te, ne) {
299 var i, n, t = this, dom = tinymce.DOM;
300
301 if (is(ne, 'string'))
302 te.appendChild(dom.doc.createTextNode(ne));
303 else if (ne.length) {
304 te = te.appendChild(dom.create(ne[0], ne[1]));
305
306 for (i=2; i<ne.length; i++)
307 t._addAll(te, ne[i]);
308 }
309 },
310
311 _startDrag : function(id, se, ac) {
312 var t = this, mu, mm, d = DOM.doc, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh;
313
314 // Get positons and sizes
315// cp = DOM.getPos(t.editor.getContainer());
316 cp = {x : 0, y : 0};
317 vp = DOM.getViewPort();
318
319 // Reduce viewport size to avoid scrollbars while dragging
320 vp.w -= 2;
321 vp.h -= 2;
322
323 sex = se.screenX;
324 sey = se.screenY;
325 dx = dy = dw = dh = 0;
326
327 // Handle mouse up
328 mu = Event.add(d, 'mouseup', function(e) {
329 Event.remove(d, 'mouseup', mu);
330 Event.remove(d, 'mousemove', mm);
331
332 if (eb)
333 eb.remove();
334
335 we.moveBy(dx, dy);
336 we.resizeBy(dw, dh);
337 sz = we.getSize();
338 DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight});
339 t._fixIELayout(id, 1);
340
341 return Event.cancel(e);
342 });
343
344 if (ac != 'Move')
345 startMove();
346
347 function startMove() {
348 if (eb)
349 return;
350
351 t._fixIELayout(id, 0);
352
353 // Setup event blocker
354 DOM.add(d.body, 'div', {
355 id : 'mceEventBlocker',
356 'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),
357 style : {zIndex : t.zIndex + 1}
358 });
359
360 if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))
361 DOM.setStyles('mceEventBlocker', {position : 'absolute', width : vp.w - 2, height : vp.h - 2});
362
363 eb = new Element('mceEventBlocker');
364 eb.update();
365
366 // Setup placeholder
367 p = we.getXY();
368 sz = we.getSize();
369 sx = cp.x + p.x - vp.x;
370 sy = cp.y + p.y - vp.y;
371 DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}});
372 ph = new Element('mcePlaceHolder');
373 };
374
375 // Handle mouse move/drag
376 mm = Event.add(d, 'mousemove', function(e) {
377 var x, y, v;
378
379 startMove();
380
381 x = e.screenX - sex;
382 y = e.screenY - sey;
383
384 switch (ac) {
385 case 'ResizeW':
386 dx = x;
387 dw = 0 - x;
388 break;
389
390 case 'ResizeE':
391 dw = x;
392 break;
393
394 case 'ResizeN':
395 case 'ResizeNW':
396 case 'ResizeNE':
397 if (ac == "ResizeNW") {
398 dx = x;
399 dw = 0 - x;
400 } else if (ac == "ResizeNE")
401 dw = x;
402
403 dy = y;
404 dh = 0 - y;
405 break;
406
407 case 'ResizeS':
408 case 'ResizeSW':
409 case 'ResizeSE':
410 if (ac == "ResizeSW") {
411 dx = x;
412 dw = 0 - x;
413 } else if (ac == "ResizeSE")
414 dw = x;
415
416 dh = y;
417 break;
418
419 case 'mceMove':
420 dx = x;
421 dy = y;
422 break;
423 }
424
425 // Boundary check
426 if (dw < (v = w.features.min_width - sz.w)) {
427 if (dx !== 0)
428 dx += dw - v;
429
430 dw = v;
431 }
432
433 if (dh < (v = w.features.min_height - sz.h)) {
434 if (dy !== 0)
435 dy += dh - v;
436
437 dh = v;
438 }
439
440 dw = Math.min(dw, w.features.max_width - sz.w);
441 dh = Math.min(dh, w.features.max_height - sz.h);
442 dx = Math.max(dx, vp.x - (sx + vp.x));
443 dy = Math.max(dy, vp.y - (sy + vp.y));
444 dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x));
445 dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y));
446
447 // Move if needed
448 if (dx + dy !== 0) {
449 if (sx + dx < 0)
450 dx = 0;
451
452 if (sy + dy < 0)
453 dy = 0;
454
455 ph.moveTo(sx + dx, sy + dy);
456 }
457
458 // Resize if needed
459 if (dw + dh !== 0)
460 ph.resizeTo(sz.w + dw, sz.h + dh);
461
462 return Event.cancel(e);
463 });
464
465 return Event.cancel(se);
466 },
467
468 resizeBy : function(dw, dh, id) {
469 var w = this.windows[id];
470
471 if (w) {
472 w.element.resizeBy(dw, dh);
473 w.iframeElement.resizeBy(dw, dh);
474 }
475 },
476
477 close : function(win, id) {
478 var t = this, w, d = DOM.doc, ix = 0, fw, id;
479
480 id = t._findId(id || win);
481
482 // Probably not inline
483 if (!t.windows[id]) {
484 t.parent(win);
485 return;
486 }
487
488 t.count--;
489
490 if (t.count == 0)
491 DOM.remove('mceModalBlocker');
492
493 if (w = t.windows[id]) {
494 t.onClose.dispatch(t);
495 Event.remove(d, 'mousedown', w.mousedownFunc);
496 Event.remove(d, 'click', w.clickFunc);
497 Event.clear(id);
498 Event.clear(id + '_ifr');
499
500 DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak
501 w.element.remove();
502 delete t.windows[id];
503
504 // Find front most window and focus that
505 each (t.windows, function(w) {
506 if (w.zIndex > ix) {
507 fw = w;
508 ix = w.zIndex;
509 }
510 });
511
512 if (fw)
513 t.focus(fw.id);
514 }
515 },
516
517 setTitle : function(w, ti) {
518 var e;
519
520 w = this._findId(w);
521
522 if (e = DOM.get(w + '_title'))
523 e.innerHTML = DOM.encode(ti);
524 },
525
526 alert : function(txt, cb, s) {
527 var t = this, w;
528
529 w = t.open({
530 title : t,
531 type : 'alert',
532 button_func : function(s) {
533 if (cb)
534 cb.call(s || t, s);
535
536 t.close(null, w.id);
537 },
538 content : DOM.encode(t.editor.getLang(txt, txt)),
539 inline : 1,
540 width : 400,
541 height : 130
542 });
543 },
544
545 confirm : function(txt, cb, s) {
546 var t = this, w;
547
548 w = t.open({
549 title : t,
550 type : 'confirm',
551 button_func : function(s) {
552 if (cb)
553 cb.call(s || t, s);
554
555 t.close(null, w.id);
556 },
557 content : DOM.encode(t.editor.getLang(txt, txt)),
558 inline : 1,
559 width : 400,
560 height : 130
561 });
562 },
563
564 // Internal functions
565
566 _findId : function(w) {
567 var t = this;
568
569 if (typeof(w) == 'string')
570 return w;
571
572 each(t.windows, function(wo) {
573 var ifr = DOM.get(wo.id + '_ifr');
574
575 if (ifr && w == ifr.contentWindow) {
576 w = wo.id;
577 return false;
578 }
579 });
580
581 return w;
582 },
583
584 _fixIELayout : function(id, s) {
585 var w, img;
586
587 if (!tinymce.isIE6)
588 return;
589
590 // Fixes the bug where hover flickers and does odd things in IE6
591 each(['n','s','w','e','nw','ne','sw','se'], function(v) {
592 var e = DOM.get(id + '_resize_' + v);
593
594 DOM.setStyles(e, {
595 width : s ? e.clientWidth : '',
596 height : s ? e.clientHeight : '',
597 cursor : DOM.getStyle(e, 'cursor', 1)
598 });
599
600 DOM.setStyle(id + "_bottom", 'bottom', '-1px');
601
602 e = 0;
603 });
604
605 // Fixes graphics glitch
606 if (w = this.windows[id]) {
607 // Fixes rendering bug after resize
608 w.element.hide();
609 w.element.show();
610
611 // Forced a repaint of the window
612 //DOM.get(id).style.filter = '';
613
614 // IE has a bug where images used in CSS won't get loaded
615 // sometimes when the cache in the browser is disabled
616 // This fix tries to solve it by loading the images using the image object
617 each(DOM.select('div,a', id), function(e, i) {
618 if (e.currentStyle.backgroundImage != 'none') {
619 img = new Image();
620 img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1');
621 }
622 });
623
624 DOM.get(id).style.filter = '';
625 }
626 }
627 });
628
629 // Register plugin
630 tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups);
631})();
632
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif
new file mode 100755
index 0000000..94abd08
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif
new file mode 100755
index 0000000..e671094
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif
new file mode 100755
index 0000000..6baf64a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif
new file mode 100755
index 0000000..497307a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif
new file mode 100755
index 0000000..c894b2e
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif
new file mode 100755
index 0000000..c2a2ad4
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif
new file mode 100755
index 0000000..43a735f
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css
new file mode 100755
index 0000000..5e6fd7d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css
@@ -0,0 +1,90 @@
1/* Clearlooks 2 */
2
3/* Reset */
4.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
5
6/* General */
7.clearlooks2 {position:absolute; direction:ltr}
8.clearlooks2 .mceWrapper {position:static}
9.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
10.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)}
11.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none}
12
13/* Top */
14.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}
15.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)}
16.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
17.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
18.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
19.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0}
20.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px}
21.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0}
22.clearlooks2 .mceFocus .mceTop span {color:#FFF}
23
24/* Middle */
25.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0}
26.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)}
27.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
28.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
29.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
30
31/* Bottom */
32.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px}
33.clearlooks2 .mceBottom {left:0; bottom:0; width:100%}
34.clearlooks2 .mceBottom div {top:0}
35.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
36.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
37.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0}
38.clearlooks2 .mceBottom span {display:none}
39.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px}
40.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0}
41.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px}
42.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0}
43.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px}
44
45/* Actions */
46.clearlooks2 a {width:29px; height:16px; top:3px;}
47.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0}
48.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0}
49.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0}
50.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0}
51.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px}
52.clearlooks2 .mceMovable .mceMove {display:block}
53.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px}
54.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px}
55.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px}
56.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px}
57.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
58.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
59.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px}
60.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px}
61.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px}
62
63/* Resize */
64.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px}
65.clearlooks2 .mceResizable .mceResize {display:block}
66.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none}
67.clearlooks2 .mceMinimizable .mceMin {display:block}
68.clearlooks2 .mceMaximizable .mceMax {display:block}
69.clearlooks2 .mceMaximized .mceMed {display:block}
70.clearlooks2 .mceMaximized .mceMax {display:none}
71.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize}
72.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize}
73.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize}
74.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;}
75.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize}
76.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize}
77.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize}
78.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize}
79
80/* Alert/Confirm */
81.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
82.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px}
83.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
84.clearlooks2 a:hover {font-weight:bold;}
85.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5}
86.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px}
87.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)}
88.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px}
89.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto}
90.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm b/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm
new file mode 100755
index 0000000..f9ec642
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm
@@ -0,0 +1,387 @@
1<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -->
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<title>Template for dialogs</title>
5<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css" />
6</head>
7<body>
8
9<div class="mceEditor">
10 <div class="clearlooks2" style="width:400px; height:100px; left:10px;">
11 <div class="mceWrapper">
12 <div class="mceTop">
13 <div class="mceLeft"></div>
14 <div class="mceCenter"></div>
15 <div class="mceRight"></div>
16 <span>Blured</span>
17 </div>
18
19 <div class="mceMiddle">
20 <div class="mceLeft"></div>
21 <span>Content</span>
22 <div class="mceRight"></div>
23 </div>
24
25 <div class="mceBottom">
26 <div class="mceLeft"></div>
27 <div class="mceCenter"></div>
28 <div class="mceRight"></div>
29 <span>Statusbar text.</span>
30 </div>
31
32 <a class="mceMove" href="#"></a>
33 <a class="mceMin" href="#"></a>
34 <a class="mceMax" href="#"></a>
35 <a class="mceMed" href="#"></a>
36 <a class="mceClose" href="#"></a>
37 <a class="mceResize mceResizeN" href="#"></a>
38 <a class="mceResize mceResizeS" href="#"></a>
39 <a class="mceResize mceResizeW" href="#"></a>
40 <a class="mceResize mceResizeE" href="#"></a>
41 <a class="mceResize mceResizeNW" href="#"></a>
42 <a class="mceResize mceResizeNE" href="#"></a>
43 <a class="mceResize mceResizeSW" href="#"></a>
44 <a class="mceResize mceResizeSE" href="#"></a>
45 </div>
46 </div>
47
48 <div class="clearlooks2" style="width:400px; height:100px; left:420px;">
49 <div class="mceWrapper mceMovable mceFocus">
50 <div class="mceTop">
51 <div class="mceLeft"></div>
52 <div class="mceCenter"></div>
53 <div class="mceRight"></div>
54 <span>Focused</span>
55 </div>
56
57 <div class="mceMiddle">
58 <div class="mceLeft"></div>
59 <span>Content</span>
60 <div class="mceRight"></div>
61 </div>
62
63 <div class="mceBottom">
64 <div class="mceLeft"></div>
65 <div class="mceCenter"></div>
66 <div class="mceRight"></div>
67 <span>Statusbar text.</span>
68 </div>
69
70 <a class="mceMove" href="#"></a>
71 <a class="mceMin" href="#"></a>
72 <a class="mceMax" href="#"></a>
73 <a class="mceMed" href="#"></a>
74 <a class="mceClose" href="#"></a>
75 <a class="mceResize mceResizeN" href="#"></a>
76 <a class="mceResize mceResizeS" href="#"></a>
77 <a class="mceResize mceResizeW" href="#"></a>
78 <a class="mceResize mceResizeE" href="#"></a>
79 <a class="mceResize mceResizeNW" href="#"></a>
80 <a class="mceResize mceResizeNE" href="#"></a>
81 <a class="mceResize mceResizeSW" href="#"></a>
82 <a class="mceResize mceResizeSE" href="#"></a>
83 </div>
84 </div>
85
86 <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:120px;">
87 <div class="mceWrapper mceMovable mceFocus mceStatusbar">
88 <div class="mceTop">
89 <div class="mceLeft"></div>
90 <div class="mceCenter"></div>
91 <div class="mceRight"></div>
92 <span>Statusbar</span>
93 </div>
94
95 <div class="mceMiddle">
96 <div class="mceLeft"></div>
97 <span>Content</span>
98 <div class="mceRight"></div>
99 </div>
100
101 <div class="mceBottom">
102 <div class="mceLeft"></div>
103 <div class="mceCenter"></div>
104 <div class="mceRight"></div>
105 <span>Statusbar text.</span>
106 </div>
107
108 <a class="mceMove" href="#"></a>
109 <a class="mceMin" href="#"></a>
110 <a class="mceMax" href="#"></a>
111 <a class="mceMed" href="#"></a>
112 <a class="mceClose" href="#"></a>
113 <a class="mceResize mceResizeN" href="#"></a>
114 <a class="mceResize mceResizeS" href="#"></a>
115 <a class="mceResize mceResizeW" href="#"></a>
116 <a class="mceResize mceResizeE" href="#"></a>
117 <a class="mceResize mceResizeNW" href="#"></a>
118 <a class="mceResize mceResizeNE" href="#"></a>
119 <a class="mceResize mceResizeSW" href="#"></a>
120 <a class="mceResize mceResizeSE" href="#"></a>
121 </div>
122 </div>
123
124 <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:120px;">
125 <div class="mceWrapper mceMovable mceFocus mceStatusbar mceResizable">
126 <div class="mceTop">
127 <div class="mceLeft"></div>
128 <div class="mceCenter"></div>
129 <div class="mceRight"></div>
130 <span>Statusbar, Resizable</span>
131 </div>
132
133 <div class="mceMiddle">
134 <div class="mceLeft"></div>
135 <span>Content</span>
136 <div class="mceRight"></div>
137 </div>
138
139 <div class="mceBottom">
140 <div class="mceLeft"></div>
141 <div class="mceCenter"></div>
142 <div class="mceRight"></div>
143 <span>Statusbar text.</span>
144 </div>
145
146 <a class="mceMove" href="#"></a>
147 <a class="mceMin" href="#"></a>
148 <a class="mceMax" href="#"></a>
149 <a class="mceMed" href="#"></a>
150 <a class="mceClose" href="#"></a>
151 <a class="mceResize mceResizeN" href="#"></a>
152 <a class="mceResize mceResizeS" href="#"></a>
153 <a class="mceResize mceResizeW" href="#"></a>
154 <a class="mceResize mceResizeE" href="#"></a>
155 <a class="mceResize mceResizeNW" href="#"></a>
156 <a class="mceResize mceResizeNE" href="#"></a>
157 <a class="mceResize mceResizeSW" href="#"></a>
158 <a class="mceResize mceResizeSE" href="#"></a>
159 </div>
160 </div>
161
162 <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:230px;">
163 <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximizable">
164 <div class="mceTop">
165 <div class="mceLeft"></div>
166 <div class="mceCenter"></div>
167 <div class="mceRight"></div>
168 <span>Resizable, Maximizable</span>
169 </div>
170
171 <div class="mceMiddle">
172 <div class="mceLeft"></div>
173 <span>Content</span>
174 <div class="mceRight"></div>
175 </div>
176
177 <div class="mceBottom">
178 <div class="mceLeft"></div>
179 <div class="mceCenter"></div>
180 <div class="mceRight"></div>
181 <span>Statusbar text.</span>
182 </div>
183
184 <a class="mceMove" href="#"></a>
185 <a class="mceMin" href="#"></a>
186 <a class="mceMax" href="#"></a>
187 <a class="mceMed" href="#"></a>
188 <a class="mceClose" href="#"></a>
189 <a class="mceResize mceResizeN" href="#"></a>
190 <a class="mceResize mceResizeS" href="#"></a>
191 <a class="mceResize mceResizeW" href="#"></a>
192 <a class="mceResize mceResizeE" href="#"></a>
193 <a class="mceResize mceResizeNW" href="#"></a>
194 <a class="mceResize mceResizeNE" href="#"></a>
195 <a class="mceResize mceResizeSW" href="#"></a>
196 <a class="mceResize mceResizeSE" href="#"></a>
197 </div>
198 </div>
199
200 <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:230px;">
201 <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximizable">
202 <div class="mceTop">
203 <div class="mceLeft"></div>
204 <div class="mceCenter"></div>
205 <div class="mceRight"></div>
206 <span>Blurred, Maximizable, Statusbar, Resizable</span>
207 </div>
208
209 <div class="mceMiddle">
210 <div class="mceLeft"></div>
211 <span>Content</span>
212 <div class="mceRight"></div>
213 </div>
214
215 <div class="mceBottom">
216 <div class="mceLeft"></div>
217 <div class="mceCenter"></div>
218 <div class="mceRight"></div>
219 <span>Statusbar text.</span>
220 </div>
221
222 <a class="mceMove" href="#"></a>
223 <a class="mceMin" href="#"></a>
224 <a class="mceMax" href="#"></a>
225 <a class="mceMed" href="#"></a>
226 <a class="mceClose" href="#"></a>
227 <a class="mceResize mceResizeN" href="#"></a>
228 <a class="mceResize mceResizeS" href="#"></a>
229 <a class="mceResize mceResizeW" href="#"></a>
230 <a class="mceResize mceResizeE" href="#"></a>
231 <a class="mceResize mceResizeNW" href="#"></a>
232 <a class="mceResize mceResizeNE" href="#"></a>
233 <a class="mceResize mceResizeSW" href="#"></a>
234 <a class="mceResize mceResizeSE" href="#"></a>
235 </div>
236 </div>
237
238 <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:340px;">
239 <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximized mceMinimizable mceMaximizable">
240 <div class="mceTop">
241 <div class="mceLeft"></div>
242 <div class="mceCenter"></div>
243 <div class="mceRight"></div>
244 <span>Maximized, Maximizable, Minimizable</span>
245 </div>
246
247 <div class="mceMiddle">
248 <div class="mceLeft"></div>
249 <span>Content</span>
250 <div class="mceRight"></div>
251 </div>
252
253 <div class="mceBottom">
254 <div class="mceLeft"></div>
255 <div class="mceCenter"></div>
256 <div class="mceRight"></div>
257 <span>Statusbar text.</span>
258 </div>
259
260 <a class="mceMove" href="#"></a>
261 <a class="mceMin" href="#"></a>
262 <a class="mceMax" href="#"></a>
263 <a class="mceMed" href="#"></a>
264 <a class="mceClose" href="#"></a>
265 <a class="mceResize mceResizeN" href="#"></a>
266 <a class="mceResize mceResizeS" href="#"></a>
267 <a class="mceResize mceResizeW" href="#"></a>
268 <a class="mceResize mceResizeE" href="#"></a>
269 <a class="mceResize mceResizeNW" href="#"></a>
270 <a class="mceResize mceResizeNE" href="#"></a>
271 <a class="mceResize mceResizeSW" href="#"></a>
272 <a class="mceResize mceResizeSE" href="#"></a>
273 </div>
274 </div>
275
276 <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:340px;">
277 <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximized mceMinimizable mceMaximizable">
278 <div class="mceTop">
279 <div class="mceLeft"></div>
280 <div class="mceCenter"></div>
281 <div class="mceRight"></div>
282 <span>Blured</span>
283 </div>
284
285 <div class="mceMiddle">
286 <div class="mceLeft"></div>
287 <span>Content</span>
288 <div class="mceRight"></div>
289 </div>
290
291 <div class="mceBottom">
292 <div class="mceLeft"></div>
293 <div class="mceCenter"></div>
294 <div class="mceRight"></div>
295 <span>Statusbar text.</span>
296 </div>
297
298 <a class="mceMove" href="#"></a>
299 <a class="mceMin" href="#"></a>
300 <a class="mceMax" href="#"></a>
301 <a class="mceMed" href="#"></a>
302 <a class="mceClose" href="#"></a>
303 <a class="mceResize mceResizeN" href="#"></a>
304 <a class="mceResize mceResizeS" href="#"></a>
305 <a class="mceResize mceResizeW" href="#"></a>
306 <a class="mceResize mceResizeE" href="#"></a>
307 <a class="mceResize mceResizeNW" href="#"></a>
308 <a class="mceResize mceResizeNE" href="#"></a>
309 <a class="mceResize mceResizeSW" href="#"></a>
310 <a class="mceResize mceResizeSE" href="#"></a>
311 </div>
312 </div>
313
314 <div class="clearlooks2" style="width:400px; height:130px; left:10px; top:450px;">
315 <div class="mceWrapper mceMovable mceFocus mceModal mceAlert">
316 <div class="mceTop">
317 <div class="mceLeft"></div>
318 <div class="mceCenter"></div>
319 <div class="mceRight"></div>
320 <span>Alert</span>
321 </div>
322
323 <div class="mceMiddle">
324 <div class="mceLeft"></div>
325 <span>
326 This is a very long error message. This is a very long error message.
327 This is a very long error message. This is a very long error message.
328 This is a very long error message. This is a very long error message.
329 This is a very long error message. This is a very long error message.
330 This is a very long error message. This is a very long error message.
331 This is a very long error message. This is a very long error message.
332 </span>
333 <div class="mceRight"></div>
334 <div class="mceIcon"></div>
335 </div>
336
337 <div class="mceBottom">
338 <div class="mceLeft"></div>
339 <div class="mceCenter"></div>
340 <div class="mceRight"></div>
341 </div>
342
343 <a class="mceMove" href="#"></a>
344 <a class="mceButton mceOk" href="#">Ok</a>
345 <a class="mceClose" href="#"></a>
346 </div>
347 </div>
348
349 <div class="clearlooks2" style="width:400px; height:130px; left:420px; top:450px;">
350 <div class="mceWrapper mceMovable mceFocus mceModal mceConfirm">
351 <div class="mceTop">
352 <div class="mceLeft"></div>
353 <div class="mceCenter"></div>
354 <div class="mceRight"></div>
355 <span>Confirm</span>
356 </div>
357
358 <div class="mceMiddle">
359 <div class="mceLeft"></div>
360 <span>
361 This is a very long error message. This is a very long error message.
362 This is a very long error message. This is a very long error message.
363 This is a very long error message. This is a very long error message.
364 This is a very long error message. This is a very long error message.
365 This is a very long error message. This is a very long error message.
366 This is a very long error message. This is a very long error message.
367 </span>
368 <div class="mceRight"></div>
369 <div class="mceIcon"></div>
370 </div>
371
372 <div class="mceBottom">
373 <div class="mceLeft"></div>
374 <div class="mceCenter"></div>
375 <div class="mceRight"></div>
376 </div>
377
378 <a class="mceMove" href="#"></a>
379 <a class="mceButton mceOk" href="#">Ok</a>
380 <a class="mceButton mceCancel" href="#">Cancel</a>
381 <a class="mceClose" href="#"></a>
382 </div>
383 </div>
384</div>
385
386</body>
387</html>
diff --git a/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js b/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js
new file mode 100755
index 0000000..34d4cec
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.InsertDateTime',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceInsertDate',function(){var str=t._getDateTime(new Date(),ed.getParam("plugin_insertdate_dateFormat",ed.getLang('insertdatetime.date_fmt')));ed.execCommand('mceInsertContent',false,str);});ed.addCommand('mceInsertTime',function(){var str=t._getDateTime(new Date(),ed.getParam("plugin_insertdate_timeFormat",ed.getLang('insertdatetime.time_fmt')));ed.execCommand('mceInsertContent',false,str);});ed.addButton('insertdate',{title:'insertdatetime.insertdate_desc',cmd:'mceInsertDate'});ed.addButton('inserttime',{title:'insertdatetime.inserttime_desc',cmd:'mceInsertTime'});},getInfo:function(){return{longname:'Insert date/time',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_getDateTime:function(d,fmt){var ed=this.editor;function addZeros(value,len){value=""+value;if(value.length<len){for(var i=0;i<(len-value.length);i++)value="0"+value;}return value;};fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt.replace("%y",""+d.getYear());fmt=fmt.replace("%m",addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%B",""+ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);fmt=fmt.replace("%b",""+ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);fmt=fmt.replace("%A",""+ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);fmt=fmt.replace("%a",""+ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);fmt=fmt.replace("%%","%");return fmt;}});tinymce.PluginManager.add('insertdatetime',tinymce.plugins.InsertDateTime);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js
new file mode 100755
index 0000000..9ab3135
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js
@@ -0,0 +1,80 @@
1/**
2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.InsertDateTime', {
10 init : function(ed, url) {
11 var t = this;
12
13 t.editor = ed;
14
15 ed.addCommand('mceInsertDate', function() {
16 var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));
17
18 ed.execCommand('mceInsertContent', false, str);
19 });
20
21 ed.addCommand('mceInsertTime', function() {
22 var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));
23
24 ed.execCommand('mceInsertContent', false, str);
25 });
26
27 ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'});
28 ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'});
29 },
30
31 getInfo : function() {
32 return {
33 longname : 'Insert date/time',
34 author : 'Moxiecode Systems AB',
35 authorurl : 'http://tinymce.moxiecode.com',
36 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',
37 version : tinymce.majorVersion + "." + tinymce.minorVersion
38 };
39 },
40
41 // Private methods
42
43 _getDateTime : function(d, fmt) {
44 var ed = this.editor;
45
46 function addZeros(value, len) {
47 value = "" + value;
48
49 if (value.length < len) {
50 for (var i=0; i<(len-value.length); i++)
51 value = "0" + value;
52 }
53
54 return value;
55 };
56
57 fmt = fmt.replace("%D", "%m/%d/%y");
58 fmt = fmt.replace("%r", "%I:%M:%S %p");
59 fmt = fmt.replace("%Y", "" + d.getFullYear());
60 fmt = fmt.replace("%y", "" + d.getYear());
61 fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
62 fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
63 fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
64 fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
65 fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
66 fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
67 fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
68 fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);
69 fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);
70 fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);
71 fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);
72 fmt = fmt.replace("%%", "%");
73
74 return fmt;
75 }
76 });
77
78 // Register plugin
79 tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);
80})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js b/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js
new file mode 100755
index 0000000..4cd9427
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.Layer',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceInsertLayer',t._insertLayer,t);ed.addCommand('mceMoveForward',function(){t._move(1);});ed.addCommand('mceMoveBackward',function(){t._move(-1);});ed.addCommand('mceMakeAbsolute',function(){t._toggleAbsolute();});ed.addButton('moveforward',{title:'layer.forward_desc',cmd:'mceMoveForward'});ed.addButton('movebackward',{title:'layer.backward_desc',cmd:'mceMoveBackward'});ed.addButton('absolute',{title:'layer.absolute_desc',cmd:'mceMakeAbsolute'});ed.addButton('insertlayer',{title:'layer.insertlayer_desc',cmd:'mceInsertLayer'});ed.onInit.add(function(){if(tinymce.isIE)ed.getDoc().execCommand('2D-Position',false,true);});ed.onNodeChange.add(t._nodeChange,t);ed.onVisualAid.add(t._visualAid,t);},getInfo:function(){return{longname:'Layer',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var le,p;le=this._getParentLayer(n);p=ed.dom.getParent(n,'DIV,P,IMG');if(!p){cm.setDisabled('absolute',1);cm.setDisabled('moveforward',1);cm.setDisabled('movebackward',1);}else{cm.setDisabled('absolute',0);cm.setDisabled('moveforward',!le);cm.setDisabled('movebackward',!le);cm.setActive('absolute',le&&le.style.position.toLowerCase()=="absolute");}},_visualAid:function(ed,e,s){var dom=ed.dom;tinymce.each(dom.select('div,p',e),function(e){if(/^(absolute|relative|static)$/i.test(e.style.position)){if(s)dom.addClass(e,'mceItemVisualAid');else dom.removeClass(e,'mceItemVisualAid');}});},_move:function(d){var ed=this.editor,i,z=[],le=this._getParentLayer(ed.selection.getNode()),ci=-1,fi=-1,nl;nl=[];tinymce.walk(ed.getBody(),function(n){if(n.nodeType==1&&/^(absolute|relative|static)$/i.test(n.style.position))nl.push(n);},'childNodes');for(i=0;i<nl.length;i++){z[i]=nl[i].style.zIndex?parseInt(nl[i].style.zIndex):0;if(ci<0&&nl[i]==le)ci=i;}if(d<0){for(i=0;i<z.length;i++){if(z[i]<z[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else{if(z[ci]>0)nl[ci].style.zIndex=z[ci]-1;}}else{for(i=0;i<z.length;i++){if(z[i]>z[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else nl[ci].style.zIndex=z[ci]+1;}ed.execCommand('mceRepaint');},_getParentLayer:function(n){return this.editor.dom.getParent(n,function(n){return n.nodeType==1&&/^(absolute|relative|static)$/i.test(n.style.position);});},_insertLayer:function(){var ed=this.editor,p=ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(),'*'));ed.dom.add(ed.getBody(),'div',{style:{position:'absolute',left:p.x,top:(p.y>20?p.y:20),width:100,height:100},'class':'mceItemVisualAid'},ed.selection.getContent()||ed.getLang('layer.content'));},_toggleAbsolute:function(){var ed=this.editor,le=this._getParentLayer(ed.selection.getNode());if(!le)le=ed.dom.getParent(ed.selection.getNode(),'DIV,P,IMG');if(le){if(le.style.position.toLowerCase()=="absolute"){ed.dom.setStyles(le,{position:'',left:'',top:'',width:'',height:''});ed.dom.removeClass(le,'mceItemVisualAid');}else{if(le.style.left=="")le.style.left=20+'px';if(le.style.top=="")le.style.top=20+'px';if(le.style.width=="")le.style.width=le.width?(le.width+'px'):'100px';if(le.style.height=="")le.style.height=le.height?(le.height+'px'):'100px';le.style.position="absolute";ed.addVisual(ed.getBody());}ed.execCommand('mceRepaint');ed.nodeChanged();}}});tinymce.PluginManager.add('layer',tinymce.plugins.Layer);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js
new file mode 100755
index 0000000..a72f6c3
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js
@@ -0,0 +1,209 @@
1/**
2 * $Id: editor_plugin_src.js 652 2008-02-29 13:09:46Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.Layer', {
10 init : function(ed, url) {
11 var t = this;
12
13 t.editor = ed;
14
15 // Register commands
16 ed.addCommand('mceInsertLayer', t._insertLayer, t);
17
18 ed.addCommand('mceMoveForward', function() {
19 t._move(1);
20 });
21
22 ed.addCommand('mceMoveBackward', function() {
23 t._move(-1);
24 });
25
26 ed.addCommand('mceMakeAbsolute', function() {
27 t._toggleAbsolute();
28 });
29
30 // Register buttons
31 ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'});
32 ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'});
33 ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'});
34 ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});
35
36 ed.onInit.add(function() {
37 if (tinymce.isIE)
38 ed.getDoc().execCommand('2D-Position', false, true);
39 });
40
41 ed.onNodeChange.add(t._nodeChange, t);
42 ed.onVisualAid.add(t._visualAid, t);
43 },
44
45 getInfo : function() {
46 return {
47 longname : 'Layer',
48 author : 'Moxiecode Systems AB',
49 authorurl : 'http://tinymce.moxiecode.com',
50 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',
51 version : tinymce.majorVersion + "." + tinymce.minorVersion
52 };
53 },
54
55 // Private methods
56
57 _nodeChange : function(ed, cm, n) {
58 var le, p;
59
60 le = this._getParentLayer(n);
61 p = ed.dom.getParent(n, 'DIV,P,IMG');
62
63 if (!p) {
64 cm.setDisabled('absolute', 1);
65 cm.setDisabled('moveforward', 1);
66 cm.setDisabled('movebackward', 1);
67 } else {
68 cm.setDisabled('absolute', 0);
69 cm.setDisabled('moveforward', !le);
70 cm.setDisabled('movebackward', !le);
71 cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");
72 }
73 },
74
75 // Private methods
76
77 _visualAid : function(ed, e, s) {
78 var dom = ed.dom;
79
80 tinymce.each(dom.select('div,p', e), function(e) {
81 if (/^(absolute|relative|static)$/i.test(e.style.position)) {
82 if (s)
83 dom.addClass(e, 'mceItemVisualAid');
84 else
85 dom.removeClass(e, 'mceItemVisualAid');
86 }
87 });
88 },
89
90 _move : function(d) {
91 var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;
92
93 nl = [];
94 tinymce.walk(ed.getBody(), function(n) {
95 if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))
96 nl.push(n);
97 }, 'childNodes');
98
99 // Find z-indexes
100 for (i=0; i<nl.length; i++) {
101 z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;
102
103 if (ci < 0 && nl[i] == le)
104 ci = i;
105 }
106
107 if (d < 0) {
108 // Move back
109
110 // Try find a lower one
111 for (i=0; i<z.length; i++) {
112 if (z[i] < z[ci]) {
113 fi = i;
114 break;
115 }
116 }
117
118 if (fi > -1) {
119 nl[ci].style.zIndex = z[fi];
120 nl[fi].style.zIndex = z[ci];
121 } else {
122 if (z[ci] > 0)
123 nl[ci].style.zIndex = z[ci] - 1;
124 }
125 } else {
126 // Move forward
127
128 // Try find a higher one
129 for (i=0; i<z.length; i++) {
130 if (z[i] > z[ci]) {
131 fi = i;
132 break;
133 }
134 }
135
136 if (fi > -1) {
137 nl[ci].style.zIndex = z[fi];
138 nl[fi].style.zIndex = z[ci];
139 } else
140 nl[ci].style.zIndex = z[ci] + 1;
141 }
142
143 ed.execCommand('mceRepaint');
144 },
145
146 _getParentLayer : function(n) {
147 return this.editor.dom.getParent(n, function(n) {
148 return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);
149 });
150 },
151
152 _insertLayer : function() {
153 var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*'));
154
155 ed.dom.add(ed.getBody(), 'div', {
156 style : {
157 position : 'absolute',
158 left : p.x,
159 top : (p.y > 20 ? p.y : 20),
160 width : 100,
161 height : 100
162 },
163 'class' : 'mceItemVisualAid'
164 }, ed.selection.getContent() || ed.getLang('layer.content'));
165 },
166
167 _toggleAbsolute : function() {
168 var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());
169
170 if (!le)
171 le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');
172
173 if (le) {
174 if (le.style.position.toLowerCase() == "absolute") {
175 ed.dom.setStyles(le, {
176 position : '',
177 left : '',
178 top : '',
179 width : '',
180 height : ''
181 });
182
183 ed.dom.removeClass(le, 'mceItemVisualAid');
184 } else {
185 if (le.style.left == "")
186 le.style.left = 20 + 'px';
187
188 if (le.style.top == "")
189 le.style.top = 20 + 'px';
190
191 if (le.style.width == "")
192 le.style.width = le.width ? (le.width + 'px') : '100px';
193
194 if (le.style.height == "")
195 le.style.height = le.height ? (le.height + 'px') : '100px';
196
197 le.style.position = "absolute";
198 ed.addVisual(ed.getBody());
199 }
200
201 ed.execCommand('mceRepaint');
202 ed.nodeChanged();
203 }
204 }
205 });
206
207 // Register plugin
208 tinymce.PluginManager.add('layer', tinymce.plugins.Layer);
209})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/media/css/content.css b/public/javascripts/tiny_mce/plugins/media/css/content.css
new file mode 100755
index 0000000..1bf6a75
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/css/content.css
@@ -0,0 +1,6 @@
1.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;}
2.mceItemShockWave {background-image: url(../img/shockwave.gif);}
3.mceItemFlash {background-image:url(../img/flash.gif);}
4.mceItemQuickTime {background-image:url(../img/quicktime.gif);}
5.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);}
6.mceItemRealMedia {background-image:url(../img/realmedia.gif);}
diff --git a/public/javascripts/tiny_mce/plugins/media/css/media.css b/public/javascripts/tiny_mce/plugins/media/css/media.css
new file mode 100755
index 0000000..2d08794
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/css/media.css
@@ -0,0 +1,16 @@
1#id, #name, #hspace, #vspace, #class_name, #align { width: 100px }
2#hspace, #vspace { width: 50px }
3#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px }
4#flash_base, #flash_flashvars { width: 240px }
5#width, #height { width: 40px }
6#src, #media_type { width: 250px }
7#class { width: 120px }
8#prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto }
9.panel_wrapper div.current { height: 390px; overflow: auto }
10#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none }
11.mceAddSelectValue { background-color: #DDDDDD }
12#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px }
13#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px }
14#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px }
15#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px }
16#qt_qtsrc { width: 200px }
diff --git a/public/javascripts/tiny_mce/plugins/media/editor_plugin.js b/public/javascripts/tiny_mce/plugins/media/editor_plugin.js
new file mode 100755
index 0000000..b226b00
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/editor_plugin.js
@@ -0,0 +1 @@
(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.MediaPlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;function isMediaElm(n){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);};ed.onPreInit.add(function(){ed.serializer.addRules('param[name|value|_mce_value]');});ed.addCommand('mceMedia',function(){ed.windowManager.open({file:url+'/media.htm',width:430+parseInt(ed.getLang('media.delta_width',0)),height:470+parseInt(ed.getLang('media.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('media',{title:'media.desc',cmd:'mceMedia'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('media',n.nodeName=='IMG'&&isMediaElm(n));});ed.onInit.add(function(){var lo={mceItemFlash:'flash',mceItemShockWave:'shockwave',mceItemWindowsMedia:'windowsmedia',mceItemQuickTime:'quicktime',mceItemRealMedia:'realmedia'};ed.selection.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.selection.onBeforeSetContent.add(t._objectsToSpans,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.name=='img'){each(lo,function(v,k){if(ed.dom.hasClass(o.node,k)){o.name=v;o.title=ed.dom.getAttrib(o.node,'title');return false;}});}});}if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(e.nodeName=='IMG'&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)){m.add({title:'media.edit',icon:'media',cmd:'mceMedia'});}});}});ed.onBeforeSetContent.add(t._objectsToSpans,t);ed.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;if(o.set){t._spansToImgs(o.node);each(dom.select('IMG',o.node),function(n){var p;if(isMediaElm(n)){p=t._parse(n.title);dom.setAttrib(n,'width',dom.getAttrib(n,'width',p.width||100));dom.setAttrib(n,'height',dom.getAttrib(n,'height',p.height||100));}});}if(o.get){each(dom.select('IMG',o.node),function(n){var ci,cb,mt;if(ed.getParam('media_use_script')){if(isMediaElm(n))n.className=n.className.replace(/mceItem/g,'mceTemp');return;}switch(n.className){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=ed.getParam('media_wmp6_compatible')?'05589fa1-c356-11ce-bf01-00aa0055595a':'6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break;}if(ci){dom.replace(t._buildObj({classid:ci,codebase:cb,type:mt},n),n);}});}});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/_mce_value=/g,'value=');});if(ed.getParam('media_use_script')){function getAttr(s,n){n=new RegExp(n+'=\"([^\"]+)\"','g').exec(s);return n?ed.dom.decode(n[1]):'';};ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<img[^>]+>/g,function(im){var cl=getAttr(im,'class');if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)){at=t._parse(getAttr(im,'title'));at.width=getAttr(im,'width');at.height=getAttr(im,'height');im='<script type="text/javascript">write'+cl.substring(7)+'({'+t._serialize(at)+'});</script>';}return im;});});}},getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_objectsToSpans:function(ed,o){var t=this,h=o.content;h=h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(a,b,c){var o=t._parse(c);return'<img class="mceItem'+b+'" title="'+ed.dom.encode(c)+'" src="'+t.url+'/img/trans.gif" width="'+o.width+'" height="'+o.height+'" />'});h=h.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');h=h.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');h=h.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');h=h.replace(/<\/(object)([^>]*)>/gi,'</span>');h=h.replace(/<\/embed>/gi,'');h=h.replace(/<param([^>]*)>/gi,function(a,b){return'<span '+b.replace(/value=/gi,'_mce_value=')+' class="mceItemParam"></span>'});h=h.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');o.content=h;},_buildObj:function(o,n){var ob,ed=this.editor,dom=ed.dom,p=this._parse(n.title),stc;stc=ed.getParam('media_strict',true)&&o.type=='application/x-shockwave-flash';p.width=o.width=dom.getAttrib(n,'width')||100;p.height=o.height=dom.getAttrib(n,'height')||100;if(p.src)p.src=ed.convertURL(p.src,'src',n);if(stc){ob=dom.create('span',{mce_name:'object',type:'application/x-shockwave-flash',data:p.src,width:o.width,height:o.height});}else{ob=dom.create('span',{mce_name:'object',classid:"clsid:"+o.classid,codebase:o.codebase,width:o.width,height:o.height});}each(p,function(v,k){if(!/^(width|height|codebase|classid|_cx|_cy)$/.test(k)){if(o.type=='application/x-mplayer2'&&k=='src')k='url';if(v)dom.add(ob,'span',{mce_name:'param',name:k,'_mce_value':v});}});if(!stc)dom.add(ob,'span',tinymce.extend({mce_name:'embed',type:o.type},p));return ob;},_spansToImgs:function(p){var t=this,dom=t.editor.dom,im,ci;each(dom.select('span',p),function(n){if(dom.getAttrib(n,'class')=='mceItemObject'){ci=dom.getAttrib(n,"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':dom.replace(t._createImg('mceItemFlash',n),n);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}return;}if(dom.getAttrib(n,'class')=='mceItemEmbed'){switch(dom.getAttrib(n,'type')){case'application/x-shockwave-flash':dom.replace(t._createImg('mceItemFlash',n),n);break;case'application/x-director':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'application/x-mplayer2':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'video/quicktime':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'audio/x-pn-realaudio-plugin':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}}});},_createImg:function(cl,n){var im,dom=this.editor.dom,pa={},ti='',args;args=['id','name','width','height','bgcolor','align','flashvars','src','wmode','allowfullscreen','quality'];im=dom.create('img',{src:this.url+'/img/trans.gif',width:dom.getAttrib(n,'width')||100,height:dom.getAttrib(n,'height')||100,'class':cl});each(args,function(na){var v=dom.getAttrib(n,na);if(v)pa[na]=v;});each(dom.select('span',n),function(n){if(dom.hasClass(n,'mceItemParam'))pa[dom.getAttrib(n,'name')]=dom.getAttrib(n,'_mce_value');});if(pa.movie){pa.src=pa.movie;delete pa.movie;}n=dom.select('.mceItemEmbed',n)[0];if(n){each(args,function(na){var v=dom.getAttrib(n,na);if(v&&!pa[na])pa[na]=v;});}delete pa.width;delete pa.height;im.title=this._serialize(pa);return im;},_parse:function(s){return tinymce.util.JSON.parse('{'+s+'}');},_serialize:function(o){return tinymce.util.JSON.serialize(o).replace(/[{}]/g,'');}});tinymce.PluginManager.add('media',tinymce.plugins.MediaPlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js
new file mode 100755
index 0000000..beec3bf
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js
@@ -0,0 +1,400 @@
1/**
2 * $Id: editor_plugin_src.js 952 2008-11-03 17:56:04Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var each = tinymce.each;
10
11 tinymce.create('tinymce.plugins.MediaPlugin', {
12 init : function(ed, url) {
13 var t = this;
14
15 t.editor = ed;
16 t.url = url;
17
18 function isMediaElm(n) {
19 return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);
20 };
21
22 ed.onPreInit.add(function() {
23 // Force in _value parameter this extra parameter is required for older Opera versions
24 ed.serializer.addRules('param[name|value|_mce_value]');
25 });
26
27 // Register commands
28 ed.addCommand('mceMedia', function() {
29 ed.windowManager.open({
30 file : url + '/media.htm',
31 width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
32 height : 470 + parseInt(ed.getLang('media.delta_height', 0)),
33 inline : 1
34 }, {
35 plugin_url : url
36 });
37 });
38
39 // Register buttons
40 ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});
41
42 ed.onNodeChange.add(function(ed, cm, n) {
43 cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n));
44 });
45
46 ed.onInit.add(function() {
47 var lo = {
48 mceItemFlash : 'flash',
49 mceItemShockWave : 'shockwave',
50 mceItemWindowsMedia : 'windowsmedia',
51 mceItemQuickTime : 'quicktime',
52 mceItemRealMedia : 'realmedia'
53 };
54
55 ed.selection.onSetContent.add(function() {
56 t._spansToImgs(ed.getBody());
57 });
58
59 ed.selection.onBeforeSetContent.add(t._objectsToSpans, t);
60
61 if (ed.settings.content_css !== false)
62 ed.dom.loadCSS(url + "/css/content.css");
63
64 if (ed.theme.onResolveName) {
65 ed.theme.onResolveName.add(function(th, o) {
66 if (o.name == 'img') {
67 each(lo, function(v, k) {
68 if (ed.dom.hasClass(o.node, k)) {
69 o.name = v;
70 o.title = ed.dom.getAttrib(o.node, 'title');
71 return false;
72 }
73 });
74 }
75 });
76 }
77
78 if (ed && ed.plugins.contextmenu) {
79 ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
80 if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) {
81 m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
82 }
83 });
84 }
85 });
86
87 ed.onBeforeSetContent.add(t._objectsToSpans, t);
88
89 ed.onSetContent.add(function() {
90 t._spansToImgs(ed.getBody());
91 });
92
93 ed.onPreProcess.add(function(ed, o) {
94 var dom = ed.dom;
95
96 if (o.set) {
97 t._spansToImgs(o.node);
98
99 each(dom.select('IMG', o.node), function(n) {
100 var p;
101
102 if (isMediaElm(n)) {
103 p = t._parse(n.title);
104 dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100));
105 dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100));
106 }
107 });
108 }
109
110 if (o.get) {
111 each(dom.select('IMG', o.node), function(n) {
112 var ci, cb, mt;
113
114 if (ed.getParam('media_use_script')) {
115 if (isMediaElm(n))
116 n.className = n.className.replace(/mceItem/g, 'mceTemp');
117
118 return;
119 }
120
121 switch (n.className) {
122 case 'mceItemFlash':
123 ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000';
124 cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
125 mt = 'application/x-shockwave-flash';
126 break;
127
128 case 'mceItemShockWave':
129 ci = '166b1bca-3f9c-11cf-8075-444553540000';
130 cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
131 mt = 'application/x-director';
132 break;
133
134 case 'mceItemWindowsMedia':
135 ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6';
136 cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
137 mt = 'application/x-mplayer2';
138 break;
139
140 case 'mceItemQuickTime':
141 ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b';
142 cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
143 mt = 'video/quicktime';
144 break;
145
146 case 'mceItemRealMedia':
147 ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa';
148 cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
149 mt = 'audio/x-pn-realaudio-plugin';
150 break;
151 }
152
153 if (ci) {
154 dom.replace(t._buildObj({
155 classid : ci,
156 codebase : cb,
157 type : mt
158 }, n), n);
159 }
160 });
161 }
162 });
163
164 ed.onPostProcess.add(function(ed, o) {
165 o.content = o.content.replace(/_mce_value=/g, 'value=');
166 });
167
168 if (ed.getParam('media_use_script')) {
169 function getAttr(s, n) {
170 n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
171
172 return n ? ed.dom.decode(n[1]) : '';
173 };
174
175 ed.onPostProcess.add(function(ed, o) {
176 o.content = o.content.replace(/<img[^>]+>/g, function(im) {
177 var cl = getAttr(im, 'class');
178
179 if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) {
180 at = t._parse(getAttr(im, 'title'));
181 at.width = getAttr(im, 'width');
182 at.height = getAttr(im, 'height');
183 im = '<script type="text/javascript">write' + cl.substring(7) + '({' + t._serialize(at) + '});</script>';
184 }
185
186 return im;
187 });
188 });
189 }
190 },
191
192 getInfo : function() {
193 return {
194 longname : 'Media',
195 author : 'Moxiecode Systems AB',
196 authorurl : 'http://tinymce.moxiecode.com',
197 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',
198 version : tinymce.majorVersion + "." + tinymce.minorVersion
199 };
200 },
201
202 // Private methods
203 _objectsToSpans : function(ed, o) {
204 var t = this, h = o.content;
205
206 h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) {
207 var o = t._parse(c);
208
209 return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + t.url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />'
210 });
211
212 h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>');
213 h = h.replace(/<embed([^>]*)\/?>/gi, '<span class="mceItemEmbed" $1></span>');
214 h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>');
215 h = h.replace(/<\/(object)([^>]*)>/gi, '</span>');
216 h = h.replace(/<\/embed>/gi, '');
217 h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_mce_value=') + ' class="mceItemParam"></span>'});
218 h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>');
219
220 o.content = h;
221 },
222
223 _buildObj : function(o, n) {
224 var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc;
225
226 stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash';
227
228 p.width = o.width = dom.getAttrib(n, 'width') || 100;
229 p.height = o.height = dom.getAttrib(n, 'height') || 100;
230
231 if (p.src)
232 p.src = ed.convertURL(p.src, 'src', n);
233
234 if (stc) {
235 ob = dom.create('span', {
236 mce_name : 'object',
237 type : 'application/x-shockwave-flash',
238 data : p.src,
239 width : o.width,
240 height : o.height
241 });
242 } else {
243 ob = dom.create('span', {
244 mce_name : 'object',
245 classid : "clsid:" + o.classid,
246 codebase : o.codebase,
247 width : o.width,
248 height : o.height
249 });
250 }
251
252 each (p, function(v, k) {
253 if (!/^(width|height|codebase|classid|_cx|_cy)$/.test(k)) {
254 // Use url instead of src in IE for Windows media
255 if (o.type == 'application/x-mplayer2' && k == 'src')
256 k = 'url';
257
258 if (v)
259 dom.add(ob, 'span', {mce_name : 'param', name : k, '_mce_value' : v});
260 }
261 });
262
263 if (!stc)
264 dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type}, p));
265
266 return ob;
267 },
268
269 _spansToImgs : function(p) {
270 var t = this, dom = t.editor.dom, im, ci;
271
272 each(dom.select('span', p), function(n) {
273 // Convert object into image
274 if (dom.getAttrib(n, 'class') == 'mceItemObject') {
275 ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, '');
276
277 switch (ci) {
278 case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':
279 dom.replace(t._createImg('mceItemFlash', n), n);
280 break;
281
282 case 'clsid:166b1bca-3f9c-11cf-8075-444553540000':
283 dom.replace(t._createImg('mceItemShockWave', n), n);
284 break;
285
286 case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':
287 case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':
288 case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':
289 dom.replace(t._createImg('mceItemWindowsMedia', n), n);
290 break;
291
292 case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':
293 dom.replace(t._createImg('mceItemQuickTime', n), n);
294 break;
295
296 case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':
297 dom.replace(t._createImg('mceItemRealMedia', n), n);
298 break;
299
300 default:
301 dom.replace(t._createImg('mceItemFlash', n), n);
302 }
303
304 return;
305 }
306
307 // Convert embed into image
308 if (dom.getAttrib(n, 'class') == 'mceItemEmbed') {
309 switch (dom.getAttrib(n, 'type')) {
310 case 'application/x-shockwave-flash':
311 dom.replace(t._createImg('mceItemFlash', n), n);
312 break;
313
314 case 'application/x-director':
315 dom.replace(t._createImg('mceItemShockWave', n), n);
316 break;
317
318 case 'application/x-mplayer2':
319 dom.replace(t._createImg('mceItemWindowsMedia', n), n);
320 break;
321
322 case 'video/quicktime':
323 dom.replace(t._createImg('mceItemQuickTime', n), n);
324 break;
325
326 case 'audio/x-pn-realaudio-plugin':
327 dom.replace(t._createImg('mceItemRealMedia', n), n);
328 break;
329
330 default:
331 dom.replace(t._createImg('mceItemFlash', n), n);
332 }
333 }
334 });
335 },
336
337 _createImg : function(cl, n) {
338 var im, dom = this.editor.dom, pa = {}, ti = '', args;
339
340 args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality'];
341
342 // Create image
343 im = dom.create('img', {
344 src : this.url + '/img/trans.gif',
345 width : dom.getAttrib(n, 'width') || 100,
346 height : dom.getAttrib(n, 'height') || 100,
347 'class' : cl
348 });
349
350 // Setup base parameters
351 each(args, function(na) {
352 var v = dom.getAttrib(n, na);
353
354 if (v)
355 pa[na] = v;
356 });
357
358 // Add optional parameters
359 each(dom.select('span', n), function(n) {
360 if (dom.hasClass(n, 'mceItemParam'))
361 pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value');
362 });
363
364 // Use src not movie
365 if (pa.movie) {
366 pa.src = pa.movie;
367 delete pa.movie;
368 }
369
370 // Merge with embed args
371 n = dom.select('.mceItemEmbed', n)[0];
372 if (n) {
373 each(args, function(na) {
374 var v = dom.getAttrib(n, na);
375
376 if (v && !pa[na])
377 pa[na] = v;
378 });
379 }
380
381 delete pa.width;
382 delete pa.height;
383
384 im.title = this._serialize(pa);
385
386 return im;
387 },
388
389 _parse : function(s) {
390 return tinymce.util.JSON.parse('{' + s + '}');
391 },
392
393 _serialize : function(o) {
394 return tinymce.util.JSON.serialize(o).replace(/[{}]/g, '');
395 }
396 });
397
398 // Register plugin
399 tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);
400})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/media/img/flash.gif b/public/javascripts/tiny_mce/plugins/media/img/flash.gif
new file mode 100755
index 0000000..cb192e6
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/img/flash.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf b/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf
new file mode 100755
index 0000000..042c2ab
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif b/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif
new file mode 100755
index 0000000..3b04991
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif b/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif
new file mode 100755
index 0000000..fdfe0b9
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif b/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif
new file mode 100755
index 0000000..5f235df
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/media/img/trans.gif b/public/javascripts/tiny_mce/plugins/media/img/trans.gif
new file mode 100755
index 0000000..3884865
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/img/trans.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif b/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif
new file mode 100755
index 0000000..ab50f2d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/media/js/embed.js b/public/javascripts/tiny_mce/plugins/media/js/embed.js
new file mode 100755
index 0000000..f8dc810
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/js/embed.js
@@ -0,0 +1,73 @@
1/**
2 * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
3 */
4
5function writeFlash(p) {
6 writeEmbed(
7 'D27CDB6E-AE6D-11cf-96B8-444553540000',
8 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
9 'application/x-shockwave-flash',
10 p
11 );
12}
13
14function writeShockWave(p) {
15 writeEmbed(
16 '166B1BCA-3F9C-11CF-8075-444553540000',
17 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
18 'application/x-director',
19 p
20 );
21}
22
23function writeQuickTime(p) {
24 writeEmbed(
25 '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
26 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
27 'video/quicktime',
28 p
29 );
30}
31
32function writeRealMedia(p) {
33 writeEmbed(
34 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
35 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
36 'audio/x-pn-realaudio-plugin',
37 p
38 );
39}
40
41function writeWindowsMedia(p) {
42 p.url = p.src;
43 writeEmbed(
44 '6BF52A52-394A-11D3-B153-00C04F79FAA6',
45 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
46 'application/x-mplayer2',
47 p
48 );
49}
50
51function writeEmbed(cls, cb, mt, p) {
52 var h = '', n;
53
54 h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
55 h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
56 h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
57 h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
58 h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
59 h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
60 h += '>';
61
62 for (n in p)
63 h += '<param name="' + n + '" value="' + p[n] + '">';
64
65 h += '<embed type="' + mt + '"';
66
67 for (n in p)
68 h += n + '="' + p[n] + '" ';
69
70 h += '></embed></object>';
71
72 document.write(h);
73}
diff --git a/public/javascripts/tiny_mce/plugins/media/js/media.js b/public/javascripts/tiny_mce/plugins/media/js/media.js
new file mode 100755
index 0000000..fa8e142
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/js/media.js
@@ -0,0 +1,630 @@
1tinyMCEPopup.requireLangPack();
2
3var oldWidth, oldHeight, ed, url;
4
5if (url = tinyMCEPopup.getParam("media_external_list_url"))
6 document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
7
8function init() {
9 var pl = "", f, val;
10 var type = "flash", fe, i;
11
12 ed = tinyMCEPopup.editor;
13
14 tinyMCEPopup.resizeToInnerSize();
15 f = document.forms[0]
16
17 fe = ed.selection.getNode();
18 if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {
19 pl = fe.title;
20
21 switch (ed.dom.getAttrib(fe, 'class')) {
22 case 'mceItemFlash':
23 type = 'flash';
24 break;
25
26 case 'mceItemFlashVideo':
27 type = 'flv';
28 break;
29
30 case 'mceItemShockWave':
31 type = 'shockwave';
32 break;
33
34 case 'mceItemWindowsMedia':
35 type = 'wmp';
36 break;
37
38 case 'mceItemQuickTime':
39 type = 'qt';
40 break;
41
42 case 'mceItemRealMedia':
43 type = 'rmp';
44 break;
45 }
46
47 document.forms[0].insert.value = ed.getLang('update', 'Insert', true);
48 }
49
50 document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
51 document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media');
52 document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
53
54 var html = getMediaListHTML('medialist','src','media','media');
55 if (html == "")
56 document.getElementById("linklistrow").style.display = 'none';
57 else
58 document.getElementById("linklistcontainer").innerHTML = html;
59
60 // Resize some elements
61 if (isVisible('filebrowser'))
62 document.getElementById('src').style.width = '230px';
63
64 // Setup form
65 if (pl != "") {
66 pl = tinyMCEPopup.editor.plugins.media._parse(pl);
67
68 switch (type) {
69 case "flash":
70 setBool(pl, 'flash', 'play');
71 setBool(pl, 'flash', 'loop');
72 setBool(pl, 'flash', 'menu');
73 setBool(pl, 'flash', 'swliveconnect');
74 setStr(pl, 'flash', 'quality');
75 setStr(pl, 'flash', 'scale');
76 setStr(pl, 'flash', 'salign');
77 setStr(pl, 'flash', 'wmode');
78 setStr(pl, 'flash', 'base');
79 setStr(pl, 'flash', 'flashvars');
80 break;
81
82 case "qt":
83 setBool(pl, 'qt', 'loop');
84 setBool(pl, 'qt', 'autoplay');
85 setBool(pl, 'qt', 'cache');
86 setBool(pl, 'qt', 'controller');
87 setBool(pl, 'qt', 'correction');
88 setBool(pl, 'qt', 'enablejavascript');
89 setBool(pl, 'qt', 'kioskmode');
90 setBool(pl, 'qt', 'autohref');
91 setBool(pl, 'qt', 'playeveryframe');
92 setBool(pl, 'qt', 'tarsetcache');
93 setStr(pl, 'qt', 'scale');
94 setStr(pl, 'qt', 'starttime');
95 setStr(pl, 'qt', 'endtime');
96 setStr(pl, 'qt', 'tarset');
97 setStr(pl, 'qt', 'qtsrcchokespeed');
98 setStr(pl, 'qt', 'volume');
99 setStr(pl, 'qt', 'qtsrc');
100 break;
101
102 case "shockwave":
103 setBool(pl, 'shockwave', 'sound');
104 setBool(pl, 'shockwave', 'progress');
105 setBool(pl, 'shockwave', 'autostart');
106 setBool(pl, 'shockwave', 'swliveconnect');
107 setStr(pl, 'shockwave', 'swvolume');
108 setStr(pl, 'shockwave', 'swstretchstyle');
109 setStr(pl, 'shockwave', 'swstretchhalign');
110 setStr(pl, 'shockwave', 'swstretchvalign');
111 break;
112
113 case "wmp":
114 setBool(pl, 'wmp', 'autostart');
115 setBool(pl, 'wmp', 'enabled');
116 setBool(pl, 'wmp', 'enablecontextmenu');
117 setBool(pl, 'wmp', 'fullscreen');
118 setBool(pl, 'wmp', 'invokeurls');
119 setBool(pl, 'wmp', 'mute');
120 setBool(pl, 'wmp', 'stretchtofit');
121 setBool(pl, 'wmp', 'windowlessvideo');
122 setStr(pl, 'wmp', 'balance');
123 setStr(pl, 'wmp', 'baseurl');
124 setStr(pl, 'wmp', 'captioningid');
125 setStr(pl, 'wmp', 'currentmarker');
126 setStr(pl, 'wmp', 'currentposition');
127 setStr(pl, 'wmp', 'defaultframe');
128 setStr(pl, 'wmp', 'playcount');
129 setStr(pl, 'wmp', 'rate');
130 setStr(pl, 'wmp', 'uimode');
131 setStr(pl, 'wmp', 'volume');
132 break;
133
134 case "rmp":
135 setBool(pl, 'rmp', 'autostart');
136 setBool(pl, 'rmp', 'loop');
137 setBool(pl, 'rmp', 'autogotourl');
138 setBool(pl, 'rmp', 'center');
139 setBool(pl, 'rmp', 'imagestatus');
140 setBool(pl, 'rmp', 'maintainaspect');
141 setBool(pl, 'rmp', 'nojava');
142 setBool(pl, 'rmp', 'prefetch');
143 setBool(pl, 'rmp', 'shuffle');
144 setStr(pl, 'rmp', 'console');
145 setStr(pl, 'rmp', 'controls');
146 setStr(pl, 'rmp', 'numloop');
147 setStr(pl, 'rmp', 'scriptcallbacks');
148 break;
149 }
150
151 setStr(pl, null, 'src');
152 setStr(pl, null, 'id');
153 setStr(pl, null, 'name');
154 setStr(pl, null, 'vspace');
155 setStr(pl, null, 'hspace');
156 setStr(pl, null, 'bgcolor');
157 setStr(pl, null, 'align');
158 setStr(pl, null, 'width');
159 setStr(pl, null, 'height');
160
161 if ((val = ed.dom.getAttrib(fe, "width")) != "")
162 pl.width = f.width.value = val;
163
164 if ((val = ed.dom.getAttrib(fe, "height")) != "")
165 pl.height = f.height.value = val;
166
167 oldWidth = pl.width ? parseInt(pl.width) : 0;
168 oldHeight = pl.height ? parseInt(pl.height) : 0;
169 } else
170 oldWidth = oldHeight = 0;
171
172 selectByValue(f, 'media_type', type);
173 changedType(type);
174 updateColor('bgcolor_pick', 'bgcolor');
175
176 TinyMCE_EditableSelects.init();
177 generatePreview();
178}
179
180function insertMedia() {
181 var fe, f = document.forms[0], h;
182
183 tinyMCEPopup.restoreSelection();
184
185 if (!AutoValidator.validate(f)) {
186 tinyMCEPopup.alert(ed.getLang('invalid_data'));
187 return false;
188 }
189
190 f.width.value = f.width.value == "" ? 100 : f.width.value;
191 f.height.value = f.height.value == "" ? 100 : f.height.value;
192
193 fe = ed.selection.getNode();
194 if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {
195 switch (f.media_type.options[f.media_type.selectedIndex].value) {
196 case "flash":
197 fe.className = "mceItemFlash";
198 break;
199
200 case "flv":
201 fe.className = "mceItemFlashVideo";
202 break;
203
204 case "shockwave":
205 fe.className = "mceItemShockWave";
206 break;
207
208 case "qt":
209 fe.className = "mceItemQuickTime";
210 break;
211
212 case "wmp":
213 fe.className = "mceItemWindowsMedia";
214 break;
215
216 case "rmp":
217 fe.className = "mceItemRealMedia";
218 break;
219 }
220
221 if (fe.width != f.width.value || fe.height != f.height.height)
222 ed.execCommand('mceRepaint');
223
224 fe.title = serializeParameters();
225 fe.width = f.width.value;
226 fe.height = f.height.value;
227 fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : '');
228 fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : '');
229 fe.align = f.align.options[f.align.selectedIndex].value;
230 } else {
231 h = '<img src="' + tinyMCEPopup.getWindowArg("plugin_url") + '/img/trans.gif"' ;
232
233 switch (f.media_type.options[f.media_type.selectedIndex].value) {
234 case "flash":
235 h += ' class="mceItemFlash"';
236 break;
237
238 case "flv":
239 h += ' class="mceItemFlashVideo"';
240 break;
241
242 case "shockwave":
243 h += ' class="mceItemShockWave"';
244 break;
245
246 case "qt":
247 h += ' class="mceItemQuickTime"';
248 break;
249
250 case "wmp":
251 h += ' class="mceItemWindowsMedia"';
252 break;
253
254 case "rmp":
255 h += ' class="mceItemRealMedia"';
256 break;
257 }
258
259 h += ' title="' + serializeParameters() + '"';
260 h += ' width="' + f.width.value + '"';
261 h += ' height="' + f.height.value + '"';
262 h += ' align="' + f.align.options[f.align.selectedIndex].value + '"';
263
264 h += ' />';
265
266 ed.execCommand('mceInsertContent', false, h);
267 }
268
269 tinyMCEPopup.close();
270}
271
272function updatePreview() {
273 var f = document.forms[0], type;
274
275 f.width.value = f.width.value || '320';
276 f.height.value = f.height.value || '240';
277
278 type = getType(f.src.value);
279 selectByValue(f, 'media_type', type);
280 changedType(type);
281 generatePreview();
282}
283
284function getMediaListHTML() {
285 if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
286 var html = "";
287
288 html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;updatePreview();">';
289 html += '<option value="">---</option>';
290
291 for (var i=0; i<tinyMCEMediaList.length; i++)
292 html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
293
294 html += '</select>';
295
296 return html;
297 }
298
299 return "";
300}
301
302function getType(v) {
303 var fo, i, c, el, x, f = document.forms[0];
304
305 fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';');
306
307 // YouTube
308 if (v.match(/watch\?v=(.+)(.*)/)) {
309 f.width.value = '425';
310 f.height.value = '350';
311 f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1];
312 return 'flash';
313 }
314
315 // Google video
316 if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) {
317 f.width.value = '425';
318 f.height.value = '326';
319 f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en';
320 return 'flash';
321 }
322
323 for (i=0; i<fo.length; i++) {
324 c = fo[i].split('=');
325
326 el = c[1].split(',');
327 for (x=0; x<el.length; x++)
328 if (v.indexOf('.' + el[x]) != -1)
329 return c[0];
330 }
331
332 return null;
333}
334
335function switchType(v) {
336 var t = getType(v), d = document, f = d.forms[0];
337
338 if (!t)
339 return;
340
341 selectByValue(d.forms[0], 'media_type', t);
342 changedType(t);
343
344 // Update qtsrc also
345 if (t == 'qt' && f.src.value.toLowerCase().indexOf('rtsp://') != -1) {
346 alert(ed.getLang("media_qt_stream_warn"));
347
348 if (f.qt_qtsrc.value == '')
349 f.qt_qtsrc.value = f.src.value;
350 }
351}
352
353function changedType(t) {
354 var d = document;
355
356 d.getElementById('flash_options').style.display = 'none';
357 d.getElementById('flv_options').style.display = 'none';
358 d.getElementById('qt_options').style.display = 'none';
359 d.getElementById('shockwave_options').style.display = 'none';
360 d.getElementById('wmp_options').style.display = 'none';
361 d.getElementById('rmp_options').style.display = 'none';
362
363 if (t)
364 d.getElementById(t + '_options').style.display = 'block';
365}
366
367function serializeParameters() {
368 var d = document, f = d.forms[0], s = '';
369
370 switch (f.media_type.options[f.media_type.selectedIndex].value) {
371 case "flash":
372 s += getBool('flash', 'play', true);
373 s += getBool('flash', 'loop', true);
374 s += getBool('flash', 'menu', true);
375 s += getBool('flash', 'swliveconnect', false);
376 s += getStr('flash', 'quality');
377 s += getStr('flash', 'scale');
378 s += getStr('flash', 'salign');
379 s += getStr('flash', 'wmode');
380 s += getStr('flash', 'base');
381 s += getStr('flash', 'flashvars');
382 break;
383
384 case "qt":
385 s += getBool('qt', 'loop', false);
386 s += getBool('qt', 'autoplay', true);
387 s += getBool('qt', 'cache', false);
388 s += getBool('qt', 'controller', true);
389 s += getBool('qt', 'correction', false, 'none', 'full');
390 s += getBool('qt', 'enablejavascript', false);
391 s += getBool('qt', 'kioskmode', false);
392 s += getBool('qt', 'autohref', false);
393 s += getBool('qt', 'playeveryframe', false);
394 s += getBool('qt', 'targetcache', false);
395 s += getStr('qt', 'scale');
396 s += getStr('qt', 'starttime');
397 s += getStr('qt', 'endtime');
398 s += getStr('qt', 'target');
399 s += getStr('qt', 'qtsrcchokespeed');
400 s += getStr('qt', 'volume');
401 s += getStr('qt', 'qtsrc');
402 break;
403
404 case "shockwave":
405 s += getBool('shockwave', 'sound');
406 s += getBool('shockwave', 'progress');
407 s += getBool('shockwave', 'autostart');
408 s += getBool('shockwave', 'swliveconnect');
409 s += getStr('shockwave', 'swvolume');
410 s += getStr('shockwave', 'swstretchstyle');
411 s += getStr('shockwave', 'swstretchhalign');
412 s += getStr('shockwave', 'swstretchvalign');
413 break;
414
415 case "wmp":
416 s += getBool('wmp', 'autostart', true);
417 s += getBool('wmp', 'enabled', false);
418 s += getBool('wmp', 'enablecontextmenu', true);
419 s += getBool('wmp', 'fullscreen', false);
420 s += getBool('wmp', 'invokeurls', true);
421 s += getBool('wmp', 'mute', false);
422 s += getBool('wmp', 'stretchtofit', false);
423 s += getBool('wmp', 'windowlessvideo', false);
424 s += getStr('wmp', 'balance');
425 s += getStr('wmp', 'baseurl');
426 s += getStr('wmp', 'captioningid');
427 s += getStr('wmp', 'currentmarker');
428 s += getStr('wmp', 'currentposition');
429 s += getStr('wmp', 'defaultframe');
430 s += getStr('wmp', 'playcount');
431 s += getStr('wmp', 'rate');
432 s += getStr('wmp', 'uimode');
433 s += getStr('wmp', 'volume');
434 break;
435
436 case "rmp":
437 s += getBool('rmp', 'autostart', false);
438 s += getBool('rmp', 'loop', false);
439 s += getBool('rmp', 'autogotourl', true);
440 s += getBool('rmp', 'center', false);
441 s += getBool('rmp', 'imagestatus', true);
442 s += getBool('rmp', 'maintainaspect', false);
443 s += getBool('rmp', 'nojava', false);
444 s += getBool('rmp', 'prefetch', false);
445 s += getBool('rmp', 'shuffle', false);
446 s += getStr('rmp', 'console');
447 s += getStr('rmp', 'controls');
448 s += getStr('rmp', 'numloop');
449 s += getStr('rmp', 'scriptcallbacks');
450 break;
451 }
452
453 s += getStr(null, 'id');
454 s += getStr(null, 'name');
455 s += getStr(null, 'src');
456 s += getStr(null, 'align');
457 s += getStr(null, 'bgcolor');
458 s += getInt(null, 'vspace');
459 s += getInt(null, 'hspace');
460 s += getStr(null, 'width');
461 s += getStr(null, 'height');
462
463 s = s.length > 0 ? s.substring(0, s.length - 1) : s;
464
465 return s;
466}
467
468function setBool(pl, p, n) {
469 if (typeof(pl[n]) == "undefined")
470 return;
471
472 document.forms[0].elements[p + "_" + n].checked = pl[n];
473}
474
475function setStr(pl, p, n) {
476 var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n];
477
478 if (typeof(pl[n]) == "undefined")
479 return;
480
481 if (e.type == "text")
482 e.value = pl[n];
483 else
484 selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]);
485}
486
487function getBool(p, n, d, tv, fv) {
488 var v = document.forms[0].elements[p + "_" + n].checked;
489
490 tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'";
491 fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'";
492
493 return (v == d) ? '' : n + (v ? ':' + tv + ',' : ':' + fv + ',');
494}
495
496function getStr(p, n, d) {
497 var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
498 var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
499
500 if (n == 'src')
501 v = tinyMCEPopup.editor.convertURL(v, 'src', null);
502
503 return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',");
504}
505
506function getInt(p, n, d) {
507 var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
508 var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
509
510 return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ",");
511}
512
513function jsEncode(s) {
514 s = s.replace(new RegExp('\\\\', 'g'), '\\\\');
515 s = s.replace(new RegExp('"', 'g'), '\\"');
516 s = s.replace(new RegExp("'", 'g'), "\\'");
517
518 return s;
519}
520
521function generatePreview(c) {
522 var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh;
523
524 p.innerHTML = '<!-- x --->';
525
526 nw = parseInt(f.width.value);
527 nh = parseInt(f.height.value);
528
529 if (f.width.value != "" && f.height.value != "") {
530 if (f.constrain.checked) {
531 if (c == 'width' && oldWidth != 0) {
532 wp = nw / oldWidth;
533 nh = Math.round(wp * nh);
534 f.height.value = nh;
535 } else if (c == 'height' && oldHeight != 0) {
536 hp = nh / oldHeight;
537 nw = Math.round(hp * nw);
538 f.width.value = nw;
539 }
540 }
541 }
542
543 if (f.width.value != "")
544 oldWidth = nw;
545
546 if (f.height.value != "")
547 oldHeight = nh;
548
549 // After constrain
550 pl = serializeParameters();
551
552 switch (f.media_type.options[f.media_type.selectedIndex].value) {
553 case "flash":
554 cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
555 codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
556 type = 'application/x-shockwave-flash';
557 break;
558
559 case "shockwave":
560 cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000';
561 codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
562 type = 'application/x-director';
563 break;
564
565 case "qt":
566 cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
567 codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
568 type = 'video/quicktime';
569 break;
570
571 case "wmp":
572 cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6';
573 codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
574 type = 'application/x-mplayer2';
575 break;
576
577 case "rmp":
578 cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';
579 codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
580 type = 'audio/x-pn-realaudio-plugin';
581 break;
582 }
583
584 if (pl == '') {
585 p.innerHTML = '';
586 return;
587 }
588
589 pl = tinyMCEPopup.editor.plugins.media._parse(pl);
590
591 if (!pl.src) {
592 p.innerHTML = '';
593 return;
594 }
595
596 pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src);
597 pl.width = !pl.width ? 100 : pl.width;
598 pl.height = !pl.height ? 100 : pl.height;
599 pl.id = !pl.id ? 'obj' : pl.id;
600 pl.name = !pl.name ? 'eobj' : pl.name;
601 pl.align = !pl.align ? '' : pl.align;
602
603 // Avoid annoying warning about insecure items
604 if (!tinymce.isIE || document.location.protocol != 'https:') {
605 h += '<object classid="' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
606
607 for (n in pl) {
608 h += '<param name="' + n + '" value="' + pl[n] + '">';
609
610 // Add extra url parameter if it's an absolute URL
611 if (n == 'src' && pl[n].indexOf('://') != -1)
612 h += '<param name="url" value="' + pl[n] + '" />';
613 }
614 }
615
616 h += '<embed type="' + type + '" ';
617
618 for (n in pl)
619 h += n + '="' + pl[n] + '" ';
620
621 h += '></embed>';
622
623 // Avoid annoying warning about insecure items
624 if (!tinymce.isIE || document.location.protocol != 'https:')
625 h += '</object>';
626
627 p.innerHTML = "<!-- x --->" + h;
628}
629
630tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js
new file mode 100755
index 0000000..6d0a996
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js
@@ -0,0 +1,103 @@
1tinyMCE.addI18n('en.media_dlg',{
2title:"Insert / edit embedded media",
3general:"General",
4advanced:"Advanced",
5file:"File/URL",
6list:"List",
7size:"Dimensions",
8preview:"Preview",
9constrain_proportions:"Constrain proportions",
10type:"Type",
11id:"Id",
12name:"Name",
13class_name:"Class",
14vspace:"V-Space",
15hspace:"H-Space",
16play:"Auto play",
17loop:"Loop",
18menu:"Show menu",
19quality:"Quality",
20scale:"Scale",
21align:"Align",
22salign:"SAlign",
23wmode:"WMode",
24bgcolor:"Background",
25base:"Base",
26flashvars:"Flashvars",
27liveconnect:"SWLiveConnect",
28autohref:"AutoHREF",
29cache:"Cache",
30hidden:"Hidden",
31controller:"Controller",
32kioskmode:"Kiosk mode",
33playeveryframe:"Play every frame",
34targetcache:"Target cache",
35correction:"No correction",
36enablejavascript:"Enable JavaScript",
37starttime:"Start time",
38endtime:"End time",
39href:"Href",
40qtsrcchokespeed:"Choke speed",
41target:"Target",
42volume:"Volume",
43autostart:"Auto start",
44enabled:"Enabled",
45fullscreen:"Fullscreen",
46invokeurls:"Invoke URLs",
47mute:"Mute",
48stretchtofit:"Stretch to fit",
49windowlessvideo:"Windowless video",
50balance:"Balance",
51baseurl:"Base URL",
52captioningid:"Captioning id",
53currentmarker:"Current marker",
54currentposition:"Current position",
55defaultframe:"Default frame",
56playcount:"Play count",
57rate:"Rate",
58uimode:"UI Mode",
59flash_options:"Flash options",
60qt_options:"Quicktime options",
61wmp_options:"Windows media player options",
62rmp_options:"Real media player options",
63shockwave_options:"Shockwave options",
64autogotourl:"Auto goto URL",
65center:"Center",
66imagestatus:"Image status",
67maintainaspect:"Maintain aspect",
68nojava:"No java",
69prefetch:"Prefetch",
70shuffle:"Shuffle",
71console:"Console",
72numloop:"Num loops",
73controls:"Controls",
74scriptcallbacks:"Script callbacks",
75swstretchstyle:"Stretch style",
76swstretchhalign:"Stretch H-Align",
77swstretchvalign:"Stretch V-Align",
78sound:"Sound",
79progress:"Progress",
80qtsrc:"QT Src",
81qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..",
82align_top:"Top",
83align_right:"Right",
84align_bottom:"Bottom",
85align_left:"Left",
86align_center:"Center",
87align_top_left:"Top left",
88align_top_right:"Top right",
89align_bottom_left:"Bottom left",
90align_bottom_right:"Bottom right",
91flv_options:"Flash video options",
92flv_scalemode:"Scale mode",
93flv_buffer:"Buffer",
94flv_startimage:"Start image",
95flv_starttime:"Start time",
96flv_defaultvolume:"Default volumne",
97flv_hiddengui:"Hidden GUI",
98flv_autostart:"Auto start",
99flv_loop:"Loop",
100flv_showscalemodes:"Show scale modes",
101flv_smoothvideo:"Smooth video",
102flv_jscallback:"JS Callback"
103}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/media/media.htm b/public/javascripts/tiny_mce/plugins/media/media.htm
new file mode 100755
index 0000000..8b3bc1d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/media/media.htm
@@ -0,0 +1,824 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#media_dlg.title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="js/media.js"></script>
7 <script type="text/javascript" src="../../utils/mctabs.js"></script>
8 <script type="text/javascript" src="../../utils/validate.js"></script>
9 <script type="text/javascript" src="../../utils/form_utils.js"></script>
10 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
11 <link href="css/media.css" rel="stylesheet" type="text/css" />
12 <base target="_self" />
13</head>
14<body style="display: none">
15 <form onsubmit="insertMedia();return false;" action="#">
16 <div class="tabs">
17 <ul>
18 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{#media_dlg.general}</a></span></li>
19 <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>
20 </ul>
21 </div>
22
23 <div class="panel_wrapper">
24 <div id="general_panel" class="panel current">
25 <fieldset>
26 <legend>{#media_dlg.general}</legend>
27
28 <table border="0" cellpadding="4" cellspacing="0">
29 <tr>
30 <td><label for="media_type">{#media_dlg.type}</label></td>
31 <td>
32 <select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();">
33 <option value="flash">Flash</option>
34 <!-- <option value="flv">Flash video (FLV)</option> -->
35 <option value="qt">Quicktime</option>
36 <option value="shockwave">Shockwave</option>
37 <option value="wmp">Windows Media</option>
38 <option value="rmp">Real Media</option>
39 </select>
40 </td>
41 </tr>
42 <tr>
43 <td><label for="src">{#media_dlg.file}</label></td>
44 <td>
45 <table border="0" cellspacing="0" cellpadding="0">
46 <tr>
47 <td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="switchType(this.value);generatePreview();" /></td>
48 <td id="filebrowsercontainer">&nbsp;</td>
49 </tr>
50 </table>
51 </td>
52 </tr>
53 <tr id="linklistrow">
54 <td><label for="linklist">{#media_dlg.list}</label></td>
55 <td id="linklistcontainer">&nbsp;</td>
56 </tr>
57 <tr>
58 <td><label for="width">{#media_dlg.size}</label></td>
59 <td>
60 <table border="0" cellpadding="0" cellspacing="0">
61 <tr>
62 <td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size" onchange="generatePreview('height');" /></td>
63 <td>&nbsp;&nbsp;<input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
64 <td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>
65 </tr>
66 </table>
67 </td>
68 </tr>
69 </table>
70 </fieldset>
71
72 <fieldset>
73 <legend>{#media_dlg.preview}</legend>
74 <div id="prev"></div>
75 </fieldset>
76 </div>
77
78 <div id="advanced_panel" class="panel">
79 <fieldset>
80 <legend>{#media_dlg.advanced}</legend>
81
82 <table border="0" cellpadding="4" cellspacing="0" width="100%">
83 <tr>
84 <td><label for="id">{#media_dlg.id}</label></td>
85 <td><input type="text" id="id" name="id" onchange="generatePreview();" /></td>
86 <td><label for="name">{#media_dlg.name}</label></td>
87 <td><input type="text" id="name" name="name" onchange="generatePreview();" /></td>
88 </tr>
89
90 <tr>
91 <td><label for="align">{#media_dlg.align}</label></td>
92 <td>
93 <select id="align" name="align" onchange="generatePreview();">
94 <option value="">{#not_set}</option>
95 <option value="top">{#media_dlg.align_top}</option>
96 <option value="right">{#media_dlg.align_right}</option>
97 <option value="bottom">{#media_dlg.align_bottom}</option>
98 <option value="left">{#media_dlg.align_left}</option>
99 </select>
100 </td>
101
102 <td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>
103 <td>
104 <table border="0" cellpadding="0" cellspacing="0">
105 <tr>
106 <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');generatePreview();" /></td>
107 <td id="bgcolor_pickcontainer">&nbsp;</td>
108 </tr>
109 </table>
110 </td>
111 </tr>
112
113 <tr>
114 <td><label for="vspace">{#media_dlg.vspace}</label></td>
115 <td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td>
116 <td><label for="hspace">{#media_dlg.hspace}</label></td>
117 <td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td>
118 </tr>
119 </table>
120 </fieldset>
121
122 <fieldset id="flash_options">
123 <legend>{#media_dlg.flash_options}</legend>
124
125 <table border="0" cellpadding="4" cellspacing="0">
126 <tr>
127 <td><label for="flash_quality">{#media_dlg.quality}</label></td>
128 <td>
129 <select id="flash_quality" name="flash_quality" onchange="generatePreview();">
130 <option value="">{#not_set}</option>
131 <option value="high">high</option>
132 <option value="low">low</option>
133 <option value="autolow">autolow</option>
134 <option value="autohigh">autohigh</option>
135 <option value="best">best</option>
136 </select>
137 </td>
138
139 <td><label for="flash_scale">{#media_dlg.scale}</label></td>
140 <td>
141 <select id="flash_scale" name="flash_scale" onchange="generatePreview();">
142 <option value="">{#not_set}</option>
143 <option value="showall">showall</option>
144 <option value="noborder">noborder</option>
145 <option value="exactfit">exactfit</option>
146 <option value="noscale">noscale</option>
147 </select>
148 </td>
149 </tr>
150
151 <tr>
152 <td><label for="flash_wmode">{#media_dlg.wmode}</label></td>
153 <td>
154 <select id="flash_wmode" name="flash_wmode" onchange="generatePreview();">
155 <option value="">{#not_set}</option>
156 <option value="window">window</option>
157 <option value="opaque">opaque</option>
158 <option value="transparent">transparent</option>
159 </select>
160 </td>
161
162 <td><label for="flash_salign">{#media_dlg.salign}</label></td>
163 <td>
164 <select id="flash_salign" name="flash_salign" onchange="generatePreview();">
165 <option value="">{#not_set}</option>
166 <option value="l">{#media_dlg.align_left}</option>
167 <option value="t">{#media_dlg.align_top}</option>
168 <option value="r">{#media_dlg.align_right}</option>
169 <option value="b">{#media_dlg.align_bottom}</option>
170 <option value="tl">{#media_dlg.align_top_left}</option>
171 <option value="tr">{#media_dlg.align_top_right}</option>
172 <option value="bl">{#media_dlg.align_bottom_left}</option>
173 <option value="br">{#media_dlg.align_bottom_right}</option>
174 </select>
175 </td>
176 </tr>
177
178 <tr>
179 <td colspan="2">
180 <table border="0" cellpadding="0" cellspacing="0">
181 <tr>
182 <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td>
183 <td><label for="flash_play">{#media_dlg.play}</label></td>
184 </tr>
185 </table>
186 </td>
187
188 <td colspan="2">
189 <table border="0" cellpadding="0" cellspacing="0">
190 <tr>
191 <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td>
192 <td><label for="flash_loop">{#media_dlg.loop}</label></td>
193 </tr>
194 </table>
195 </td>
196 </tr>
197
198 <tr>
199 <td colspan="2">
200 <table border="0" cellpadding="0" cellspacing="0">
201 <tr>
202 <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td>
203 <td><label for="flash_menu">{#media_dlg.menu}</label></td>
204 </tr>
205 </table>
206 </td>
207
208 <td colspan="2">
209 <table border="0" cellpadding="0" cellspacing="0">
210 <tr>
211 <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td>
212 <td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>
213 </tr>
214 </table>
215 </td>
216 </tr>
217 </table>
218
219 <table>
220 <tr>
221 <td><label for="flash_base">{#media_dlg.base}</label></td>
222 <td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td>
223 </tr>
224
225 <tr>
226 <td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>
227 <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td>
228 </tr>
229 </table>
230 </fieldset>
231
232 <fieldset id="flv_options">
233 <legend>{#media_dlg.flv_options}</legend>
234
235 <table border="0" cellpadding="4" cellspacing="0">
236 <tr>
237 <td><label for="flv_scalemode">{#media_dlg.flv_scalemode}</label></td>
238 <td>
239 <select id="flv_scalemode" name="flv_scalemode" onchange="generatePreview();">
240 <option value="">{#not_set}</option>
241 <option value="none">none</option>
242 <option value="double">double</option>
243 <option value="full">full</option>
244 </select>
245 </td>
246
247 <td><label for="flv_buffer">{#media_dlg.flv_buffer}</label></td>
248 <td><input type="text" id="flv_buffer" name="flv_buffer" onchange="generatePreview();" /></td>
249 </tr>
250
251 <tr>
252 <td><label for="flv_startimage">{#media_dlg.flv_startimage}</label></td>
253 <td><input type="text" id="flv_startimage" name="flv_startimage" onchange="generatePreview();" /></td>
254
255 <td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>
256 <td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>
257 </tr>
258
259 <tr>
260 <td><label for="flv_defaultvolume">{#media_dlg.flv_defaultvolume}</label></td>
261 <td><input type="text" id="flv_defaultvolume" name="flv_defaultvolume" onchange="generatePreview();" /></td>
262
263 <td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>
264 <td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>
265 </tr>
266
267 <tr>
268 <td colspan="2">
269 <table border="0" cellpadding="0" cellspacing="0">
270 <tr>
271 <td><input type="checkbox" class="checkbox" id="flv_hiddengui" name="flv_hiddengui" checked="checked" onchange="generatePreview();" /></td>
272 <td><label for="flv_hiddengui">{#media_dlg.flv_hiddengui}</label></td>
273 </tr>
274 </table>
275 </td>
276
277 <td colspan="2">
278 <table border="0" cellpadding="0" cellspacing="0">
279 <tr>
280 <td><input type="checkbox" class="checkbox" id="flv_autostart" name="flv_autostart" checked="checked" onchange="generatePreview();" /></td>
281 <td><label for="flv_autostart">{#media_dlg.flv_autostart}</label></td>
282 </tr>
283 </table>
284 </td>
285 </tr>
286
287 <tr>
288 <td colspan="2">
289 <table border="0" cellpadding="0" cellspacing="0">
290 <tr>
291 <td><input type="checkbox" class="checkbox" id="flv_loop" name="flv_loop" checked="checked" onchange="generatePreview();" /></td>
292 <td><label for="flv_loop">{#media_dlg.flv_loop}</label></td>
293 </tr>
294 </table>
295 </td>
296
297 <td colspan="2">
298 <table border="0" cellpadding="0" cellspacing="0">
299 <tr>
300 <td><input type="checkbox" class="checkbox" id="flv_showscalemodes" name="flv_showscalemodes" onchange="generatePreview();" /></td>
301 <td><label for="flv_showscalemodes">{#media_dlg.flv_showscalemodes}</label></td>
302 </tr>
303 </table>
304 </td>
305 </tr>
306
307 <tr>
308 <td colspan="2">
309 <table border="0" cellpadding="0" cellspacing="0">
310 <tr>
311 <td><input type="checkbox" class="checkbox" id="flv_smoothvideo" name="flash_flv_flv_smoothvideosmoothvideo" checked="checked" onchange="generatePreview();" /></td>
312 <td><label for="flv_smoothvideo">{#media_dlg.flv_smoothvideo}</label></td>
313 </tr>
314 </table>
315 </td>
316
317 <td colspan="2">
318 <table border="0" cellpadding="0" cellspacing="0">
319 <tr>
320 <td><input type="checkbox" class="checkbox" id="flv_jscallback" name="flv_jscallback" onchange="generatePreview();" /></td>
321 <td><label for="flv_jscallback">{#media_dlg.flv_jscallback}</label></td>
322 </tr>
323 </table>
324 </td>
325 </tr>
326 </table>
327 </fieldset>
328
329 <fieldset id="qt_options">
330 <legend>{#media_dlg.qt_options}</legend>
331
332 <table border="0" cellpadding="4" cellspacing="0">
333 <tr>
334 <td colspan="2">
335 <table border="0" cellpadding="0" cellspacing="0">
336 <tr>
337 <td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td>
338 <td><label for="qt_loop">{#media_dlg.loop}</label></td>
339 </tr>
340 </table>
341 </td>
342
343 <td colspan="2">
344 <table border="0" cellpadding="0" cellspacing="0">
345 <tr>
346 <td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td>
347 <td><label for="qt_autoplay">{#media_dlg.play}</label></td>
348 </tr>
349 </table>
350 </td>
351 </tr>
352
353 <tr>
354 <td colspan="2">
355 <table border="0" cellpadding="0" cellspacing="0">
356 <tr>
357 <td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td>
358 <td><label for="qt_cache">{#media_dlg.cache}</label></td>
359 </tr>
360 </table>
361 </td>
362
363 <td colspan="2">
364 <table border="0" cellpadding="0" cellspacing="0">
365 <tr>
366 <td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td>
367 <td><label for="qt_controller">{#media_dlg.controller}</label></td>
368 </tr>
369 </table>
370 </td>
371 </tr>
372
373 <tr>
374 <td colspan="2">
375 <table border="0" cellpadding="0" cellspacing="0">
376 <tr>
377 <td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td>
378 <td><label for="qt_correction">{#media_dlg.correction}</label></td>
379 </tr>
380 </table>
381 </td>
382
383 <td colspan="2">
384 <table border="0" cellpadding="0" cellspacing="0">
385 <tr>
386 <td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td>
387 <td><label for="qt_enablejavascript">{#media_dlg.enablejavascript}</label></td>
388 </tr>
389 </table>
390 </td>
391 </tr>
392
393 <tr>
394 <td colspan="2">
395 <table border="0" cellpadding="0" cellspacing="0">
396 <tr>
397 <td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td>
398 <td><label for="qt_kioskmode">{#media_dlg.kioskmode}</label></td>
399 </tr>
400 </table>
401 </td>
402
403 <td colspan="2">
404 <table border="0" cellpadding="0" cellspacing="0">
405 <tr>
406 <td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td>
407 <td><label for="qt_autohref">{#media_dlg.autohref}</label></td>
408 </tr>
409 </table>
410 </td>
411 </tr>
412
413 <tr>
414 <td colspan="2">
415 <table border="0" cellpadding="0" cellspacing="0">
416 <tr>
417 <td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td>
418 <td><label for="qt_playeveryframe">{#media_dlg.playeveryframe}</label></td>
419 </tr>
420 </table>
421 </td>
422
423 <td colspan="2">
424 <table border="0" cellpadding="0" cellspacing="0">
425 <tr>
426 <td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td>
427 <td><label for="qt_targetcache">{#media_dlg.targetcache}</label></td>
428 </tr>
429 </table>
430 </td>
431 </tr>
432
433 <tr>
434 <td><label for="qt_scale">{#media_dlg.scale}</label></td>
435 <td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();">
436 <option value="">{#not_set}</option>
437 <option value="tofit">tofit</option>
438 <option value="aspect">aspect</option>
439 </select>
440 </td>
441
442 <td colspan="2">&nbsp;</td>
443 </tr>
444
445 <tr>
446 <td><label for="qt_starttime">{#media_dlg.starttime}</label></td>
447 <td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td>
448
449 <td><label for="qt_endtime">{#media_dlg.endtime}</label></td>
450 <td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td>
451 </tr>
452
453 <tr>
454 <td><label for="qt_target">{#media_dlg.target}</label></td>
455 <td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td>
456
457 <td><label for="qt_href">{#media_dlg.href}</label></td>
458 <td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td>
459 </tr>
460
461 <tr>
462 <td><label for="qt_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>
463 <td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td>
464
465 <td><label for="qt_volume">{#media_dlg.volume}</label></td>
466 <td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td>
467 </tr>
468
469 <tr>
470 <td><label for="qt_qtsrc">{#media_dlg.qtsrc}</label></td>
471 <td colspan="4">
472 <table border="0" cellspacing="0" cellpadding="0">
473 <tr>
474 <td><input type="text" id="qt_qtsrc" name="qt_qtsrc" onchange="generatePreview();" /></td>
475 <td id="qtsrcfilebrowsercontainer">&nbsp;</td>
476 </tr>
477 </table>
478 </td>
479 </tr>
480 </table>
481 </fieldset>
482
483 <fieldset id="wmp_options">
484 <legend>{#media_dlg.wmp_options}</legend>
485
486 <table border="0" cellpadding="4" cellspacing="0">
487 <tr>
488 <td colspan="2">
489 <table border="0" cellpadding="0" cellspacing="0">
490 <tr>
491 <td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td>
492 <td><label for="wmp_autostart">{#media_dlg.autostart}</label></td>
493 </tr>
494 </table>
495 </td>
496
497 <td colspan="2">
498 <table border="0" cellpadding="0" cellspacing="0">
499 <tr>
500 <td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td>
501 <td><label for="wmp_enabled">{#media_dlg.enabled}</label></td>
502 </tr>
503 </table>
504 </td>
505 </tr>
506
507 <tr>
508 <td colspan="2">
509 <table border="0" cellpadding="0" cellspacing="0">
510 <tr>
511 <td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td>
512 <td><label for="wmp_enablecontextmenu">{#media_dlg.menu}</label></td>
513 </tr>
514 </table>
515 </td>
516
517 <td colspan="2">
518 <table border="0" cellpadding="0" cellspacing="0">
519 <tr>
520 <td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td>
521 <td><label for="wmp_fullscreen">{#media_dlg.fullscreen}</label></td>
522 </tr>
523 </table>
524 </td>
525 </tr>
526
527 <tr>
528 <td colspan="2">
529 <table border="0" cellpadding="0" cellspacing="0">
530 <tr>
531 <td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td>
532 <td><label for="wmp_invokeurls">{#media_dlg.invokeurls}</label></td>
533 </tr>
534 </table>
535 </td>
536
537 <td colspan="2">
538 <table border="0" cellpadding="0" cellspacing="0">
539 <tr>
540 <td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td>
541 <td><label for="wmp_mute">{#media_dlg.mute}</label></td>
542 </tr>
543 </table>
544 </td>
545 </tr>
546
547 <tr>
548 <td colspan="2">
549 <table border="0" cellpadding="0" cellspacing="0">
550 <tr>
551 <td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td>
552 <td><label for="wmp_stretchtofit">{#media_dlg.stretchtofit}</label></td>
553 </tr>
554 </table>
555 </td>
556
557 <td colspan="2">
558 <table border="0" cellpadding="0" cellspacing="0">
559 <tr>
560 <td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td>
561 <td><label for="wmp_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>
562 </tr>
563 </table>
564 </td>
565 </tr>
566
567 <tr>
568 <td><label for="wmp_balance">{#media_dlg.balance}</label></td>
569 <td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td>
570
571 <td><label for="wmp_baseurl">{#media_dlg.baseurl}</label></td>
572 <td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td>
573 </tr>
574
575 <tr>
576 <td><label for="wmp_captioningid">{#media_dlg.captioningid}</label></td>
577 <td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td>
578
579 <td><label for="wmp_currentmarker">{#media_dlg.currentmarker}</label></td>
580 <td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td>
581 </tr>
582
583 <tr>
584 <td><label for="wmp_currentposition">{#media_dlg.currentposition}</label></td>
585 <td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td>
586
587 <td><label for="wmp_defaultframe">{#media_dlg.defaultframe}</label></td>
588 <td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td>
589 </tr>
590
591 <tr>
592 <td><label for="wmp_playcount">{#media_dlg.playcount}</label></td>
593 <td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td>
594
595 <td><label for="wmp_rate">{#media_dlg.rate}</label></td>
596 <td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td>
597 </tr>
598
599 <tr>
600 <td><label for="wmp_uimode">{#media_dlg.uimode}</label></td>
601 <td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td>
602
603 <td><label for="wmp_volume">{#media_dlg.volume}</label></td>
604 <td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td>
605 </tr>
606
607 </table>
608 </fieldset>
609
610 <fieldset id="rmp_options">
611 <legend>{#media_dlg.rmp_options}</legend>
612
613 <table border="0" cellpadding="4" cellspacing="0">
614 <tr>
615 <td colspan="2">
616 <table border="0" cellpadding="0" cellspacing="0">
617 <tr>
618 <td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td>
619 <td><label for="rmp_autostart">{#media_dlg.autostart}</label></td>
620 </tr>
621 </table>
622 </td>
623
624 <td colspan="2">
625 <table border="0" cellpadding="0" cellspacing="0">
626 <tr>
627 <td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td>
628 <td><label for="rmp_loop">{#media_dlg.loop}</label></td>
629 </tr>
630 </table>
631 </td>
632 </tr>
633
634 <tr>
635 <td colspan="2">
636 <table border="0" cellpadding="0" cellspacing="0">
637 <tr>
638 <td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td>
639 <td><label for="rmp_autogotourl">{#media_dlg.autogotourl}</label></td>
640 </tr>
641 </table>
642 </td>
643
644 <td colspan="2">
645 <table border="0" cellpadding="0" cellspacing="0">
646 <tr>
647 <td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td>
648 <td><label for="rmp_center">{#media_dlg.center}</label></td>
649 </tr>
650 </table>
651 </td>
652 </tr>
653
654 <tr>
655 <td colspan="2">
656 <table border="0" cellpadding="0" cellspacing="0">
657 <tr>
658 <td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td>
659 <td><label for="rmp_imagestatus">{#media_dlg.imagestatus}</label></td>
660 </tr>
661 </table>
662 </td>
663
664 <td colspan="2">
665 <table border="0" cellpadding="0" cellspacing="0">
666 <tr>
667 <td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td>
668 <td><label for="rmp_maintainaspect">{#media_dlg.maintainaspect}</label></td>
669 </tr>
670 </table>
671 </td>
672 </tr>
673
674 <tr>
675 <td colspan="2">
676 <table border="0" cellpadding="0" cellspacing="0">
677 <tr>
678 <td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td>
679 <td><label for="rmp_nojava">{#media_dlg.nojava}</label></td>
680 </tr>
681 </table>
682 </td>
683
684 <td colspan="2">
685 <table border="0" cellpadding="0" cellspacing="0">
686 <tr>
687 <td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td>
688 <td><label for="rmp_prefetch">{#media_dlg.prefetch}</label></td>
689 </tr>
690 </table>
691 </td>
692 </tr>
693
694 <tr>
695 <td colspan="2">
696 <table border="0" cellpadding="0" cellspacing="0">
697 <tr>
698 <td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td>
699 <td><label for="rmp_shuffle">{#media_dlg.shuffle}</label></td>
700 </tr>
701 </table>
702 </td>
703
704 <td colspan="2">
705 &nbsp;
706 </td>
707 </tr>
708
709 <tr>
710 <td><label for="rmp_console">{#media_dlg.console}</label></td>
711 <td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td>
712
713 <td><label for="rmp_controls">{#media_dlg.controls}</label></td>
714 <td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td>
715 </tr>
716
717 <tr>
718 <td><label for="rmp_numloop">{#media_dlg.numloop}</label></td>
719 <td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td>
720
721 <td><label for="rmp_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>
722 <td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td>
723 </tr>
724 </table>
725 </fieldset>
726
727 <fieldset id="shockwave_options">
728 <legend>{#media_dlg.shockwave_options}</legend>
729
730 <table border="0" cellpadding="4" cellspacing="0">
731 <tr>
732 <td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>
733 <td>
734 <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();">
735 <option value="none">{#not_set}</option>
736 <option value="meet">Meet</option>
737 <option value="fill">Fill</option>
738 <option value="stage">Stage</option>
739 </select>
740 </td>
741
742 <td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>
743 <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td>
744 </tr>
745
746 <tr>
747 <td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>
748 <td>
749 <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();">
750 <option value="none">{#not_set}</option>
751 <option value="left">{#media_dlg.align_left}</option>
752 <option value="center">{#media_dlg.align_center}</option>
753 <option value="right">{#media_dlg.align_right}</option>
754 </select>
755 </td>
756
757 <td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>
758 <td>
759 <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();">
760 <option value="none">{#not_set}</option>
761 <option value="meet">Meet</option>
762 <option value="fill">Fill</option>
763 <option value="stage">Stage</option>
764 </select>
765 </td>
766 </tr>
767
768 <tr>
769 <td colspan="2">
770 <table border="0" cellpadding="0" cellspacing="0">
771 <tr>
772 <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td>
773 <td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>
774 </tr>
775 </table>
776 </td>
777
778 <td colspan="2">
779 <table border="0" cellpadding="0" cellspacing="0">
780 <tr>
781 <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td>
782 <td><label for="shockwave_sound">{#media_dlg.sound}</label></td>
783 </tr>
784 </table>
785 </td>
786 </tr>
787
788
789 <tr>
790 <td colspan="2">
791 <table border="0" cellpadding="0" cellspacing="0">
792 <tr>
793 <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td>
794 <td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>
795 </tr>
796 </table>
797 </td>
798
799 <td colspan="2">
800 <table border="0" cellpadding="0" cellspacing="0">
801 <tr>
802 <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td>
803 <td><label for="shockwave_progress">{#media_dlg.progress}</label></td>
804 </tr>
805 </table>
806 </td>
807 </tr>
808 </table>
809 </fieldset>
810 </div>
811 </div>
812
813 <div class="mceActionPanel">
814 <div style="float: left">
815 <input type="submit" id="insert" name="insert" value="{#insert}" />
816 </div>
817
818 <div style="float: right">
819 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
820 </div>
821 </div>
822 </form>
823</body>
824</html>
diff --git a/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js b/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js
new file mode 100755
index 0000000..4fce503
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.Nonbreaking',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceNonBreaking',function(){ed.execCommand('mceInsertContent',false,(ed.plugins.visualchars&&ed.plugins.visualchars.state)?'<span class="mceItemHidden mceVisualNbsp">&middot;</span>':'&nbsp;');});ed.addButton('nonbreaking',{title:'nonbreaking.nonbreaking_desc',cmd:'mceNonBreaking'});if(ed.getParam('nonbreaking_force_tab')){ed.onKeyDown.add(function(ed,e){if(tinymce.isIE&&e.keyCode==9){ed.execCommand('mceNonBreaking');ed.execCommand('mceNonBreaking');ed.execCommand('mceNonBreaking');tinymce.dom.Event.cancel(e);}});}},getInfo:function(){return{longname:'Nonbreaking space',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('nonbreaking',tinymce.plugins.Nonbreaking);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js
new file mode 100755
index 0000000..b723756
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js
@@ -0,0 +1,50 @@
1/**
2 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.Nonbreaking', {
10 init : function(ed, url) {
11 var t = this;
12
13 t.editor = ed;
14
15 // Register commands
16 ed.addCommand('mceNonBreaking', function() {
17 ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span class="mceItemHidden mceVisualNbsp">&middot;</span>' : '&nbsp;');
18 });
19
20 // Register buttons
21 ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});
22
23 if (ed.getParam('nonbreaking_force_tab')) {
24 ed.onKeyDown.add(function(ed, e) {
25 if (tinymce.isIE && e.keyCode == 9) {
26 ed.execCommand('mceNonBreaking');
27 ed.execCommand('mceNonBreaking');
28 ed.execCommand('mceNonBreaking');
29 tinymce.dom.Event.cancel(e);
30 }
31 });
32 }
33 },
34
35 getInfo : function() {
36 return {
37 longname : 'Nonbreaking space',
38 author : 'Moxiecode Systems AB',
39 authorurl : 'http://tinymce.moxiecode.com',
40 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
41 version : tinymce.majorVersion + "." + tinymce.minorVersion
42 };
43 }
44
45 // Private methods
46 });
47
48 // Register plugin
49 tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);
50})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js
new file mode 100755
index 0000000..8a1b8f0
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js
@@ -0,0 +1 @@
(function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.NonEditablePlugin',{init:function(ed,url){var t=this,editClass,nonEditClass;t.editor=ed;editClass=ed.getParam("noneditable_editable_class","mceEditable");nonEditClass=ed.getParam("noneditable_noneditable_class","mceNonEditable");ed.onNodeChange.addToTop(function(ed,cm,n){var sc,ec;sc=ed.dom.getParent(ed.selection.getStart(),function(n){return ed.dom.hasClass(n,nonEditClass);});ec=ed.dom.getParent(ed.selection.getEnd(),function(n){return ed.dom.hasClass(n,nonEditClass);});if(sc||ec){t._setDisabled(1);return false;}else t._setDisabled(0);});},getInfo:function(){return{longname:'Non editable elements',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_block:function(ed,e){var k=e.keyCode;if((k>32&&k<41)||(k>111&&k<124))return;return Event.cancel(e);},_setDisabled:function(s){var t=this,ed=t.editor;tinymce.each(ed.controlManager.controls,function(c){c.setDisabled(s);});if(s!==t.disabled){if(s){ed.onKeyDown.addToTop(t._block);ed.onKeyPress.addToTop(t._block);ed.onKeyUp.addToTop(t._block);ed.onPaste.addToTop(t._block);}else{ed.onKeyDown.remove(t._block);ed.onKeyPress.remove(t._block);ed.onKeyUp.remove(t._block);ed.onPaste.remove(t._block);}t.disabled=s;}}});tinymce.PluginManager.add('noneditable',tinymce.plugins.NonEditablePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js
new file mode 100755
index 0000000..77db577
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js
@@ -0,0 +1,87 @@
1/**
2 * $Id: editor_plugin_src.js 743 2008-03-23 17:47:33Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var Event = tinymce.dom.Event;
10
11 tinymce.create('tinymce.plugins.NonEditablePlugin', {
12 init : function(ed, url) {
13 var t = this, editClass, nonEditClass;
14
15 t.editor = ed;
16 editClass = ed.getParam("noneditable_editable_class", "mceEditable");
17 nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable");
18
19 ed.onNodeChange.addToTop(function(ed, cm, n) {
20 var sc, ec;
21
22 // Block if start or end is inside a non editable element
23 sc = ed.dom.getParent(ed.selection.getStart(), function(n) {
24 return ed.dom.hasClass(n, nonEditClass);
25 });
26
27 ec = ed.dom.getParent(ed.selection.getEnd(), function(n) {
28 return ed.dom.hasClass(n, nonEditClass);
29 });
30
31 // Block or unblock
32 if (sc || ec) {
33 t._setDisabled(1);
34 return false;
35 } else
36 t._setDisabled(0);
37 });
38 },
39
40 getInfo : function() {
41 return {
42 longname : 'Non editable elements',
43 author : 'Moxiecode Systems AB',
44 authorurl : 'http://tinymce.moxiecode.com',
45 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',
46 version : tinymce.majorVersion + "." + tinymce.minorVersion
47 };
48 },
49
50 _block : function(ed, e) {
51 var k = e.keyCode;
52
53 // Don't block arrow keys, pg up/down, and F1-F12
54 if ((k > 32 && k < 41) || (k > 111 && k < 124))
55 return;
56
57 return Event.cancel(e);
58 },
59
60 _setDisabled : function(s) {
61 var t = this, ed = t.editor;
62
63 tinymce.each(ed.controlManager.controls, function(c) {
64 c.setDisabled(s);
65 });
66
67 if (s !== t.disabled) {
68 if (s) {
69 ed.onKeyDown.addToTop(t._block);
70 ed.onKeyPress.addToTop(t._block);
71 ed.onKeyUp.addToTop(t._block);
72 ed.onPaste.addToTop(t._block);
73 } else {
74 ed.onKeyDown.remove(t._block);
75 ed.onKeyPress.remove(t._block);
76 ed.onKeyUp.remove(t._block);
77 ed.onPaste.remove(t._block);
78 }
79
80 t.disabled = s;
81 }
82 }
83 });
84
85 // Register plugin
86 tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin);
87})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css b/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css
new file mode 100755
index 0000000..c949d58
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css
@@ -0,0 +1 @@
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../img/pagebreak.gif) no-repeat center top;}
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js b/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js
new file mode 100755
index 0000000..177ea95
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.PageBreakPlugin',{init:function(ed,url){var pb='<img src="'+url+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',cls='mcePageBreak',sep=ed.getParam('pagebreak_separator','<!-- pagebreak -->'),pbRE;pbRE=new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return'\\'+a;}),'g');ed.addCommand('mcePageBreak',function(){ed.execCommand('mceInsertContent',0,pb);});ed.addButton('pagebreak',{title:'pagebreak.desc',cmd:cls});ed.onInit.add(function(){if(ed.settings.content_css!==false)ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.node.nodeName=='IMG'&&ed.dom.hasClass(o.node,cls))o.name='pagebreak';});}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='IMG'&&ed.dom.hasClass(e,cls))ed.selection.select(e);});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('pagebreak',n.nodeName==='IMG'&&ed.dom.hasClass(n,cls));});ed.onBeforeSetContent.add(function(ed,o){o.content=o.content.replace(pbRE,pb);});ed.onPostProcess.add(function(ed,o){if(o.get)o.content=o.content.replace(/<img[^>]+>/g,function(im){if(im.indexOf('class="mcePageBreak')!==-1)im=sep;return im;});});},getInfo:function(){return{longname:'PageBreak',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('pagebreak',tinymce.plugins.PageBreakPlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js
new file mode 100755
index 0000000..16f5748
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js
@@ -0,0 +1,74 @@
1/**
2 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.PageBreakPlugin', {
10 init : function(ed, url) {
11 var pb = '<img src="' + url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE;
12
13 pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');
14
15 // Register commands
16 ed.addCommand('mcePageBreak', function() {
17 ed.execCommand('mceInsertContent', 0, pb);
18 });
19
20 // Register buttons
21 ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});
22
23 ed.onInit.add(function() {
24 if (ed.settings.content_css !== false)
25 ed.dom.loadCSS(url + "/css/content.css");
26
27 if (ed.theme.onResolveName) {
28 ed.theme.onResolveName.add(function(th, o) {
29 if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))
30 o.name = 'pagebreak';
31 });
32 }
33 });
34
35 ed.onClick.add(function(ed, e) {
36 e = e.target;
37
38 if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls))
39 ed.selection.select(e);
40 });
41
42 ed.onNodeChange.add(function(ed, cm, n) {
43 cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));
44 });
45
46 ed.onBeforeSetContent.add(function(ed, o) {
47 o.content = o.content.replace(pbRE, pb);
48 });
49
50 ed.onPostProcess.add(function(ed, o) {
51 if (o.get)
52 o.content = o.content.replace(/<img[^>]+>/g, function(im) {
53 if (im.indexOf('class="mcePageBreak') !== -1)
54 im = sep;
55
56 return im;
57 });
58 });
59 },
60
61 getInfo : function() {
62 return {
63 longname : 'PageBreak',
64 author : 'Moxiecode Systems AB',
65 authorurl : 'http://tinymce.moxiecode.com',
66 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',
67 version : tinymce.majorVersion + "." + tinymce.minorVersion
68 };
69 }
70 });
71
72 // Register plugin
73 tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin);
74})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif b/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif
new file mode 100755
index 0000000..acdf408
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif b/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif
new file mode 100755
index 0000000..3884865
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/paste/blank.htm b/public/javascripts/tiny_mce/plugins/paste/blank.htm
new file mode 100755
index 0000000..7ba26bd
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/blank.htm
@@ -0,0 +1,22 @@
1<html xmlns="http://www.w3.org/1999/xhtml">
2<head>
3<title>blank_page</title>
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5<link href="css/blank.css" rel="stylesheet" type="text/css" />
6<base target="_self" />
7<script type="text/javascript">
8function init() {
9 if (parent.tinymce.isIE)
10 document.body.contentEditable = true;
11 else
12 document.designMode = 'on';
13
14 parent.initIframe(document);
15 window.focus();
16}
17</script>
18</head>
19<body onload="init();">
20
21</body>
22</html>
diff --git a/public/javascripts/tiny_mce/plugins/paste/css/blank.css b/public/javascripts/tiny_mce/plugins/paste/css/blank.css
new file mode 100755
index 0000000..6b16bac
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/css/blank.css
@@ -0,0 +1,14 @@
1html, body {height:98%}
2body {
3background-color: #FFFFFF;
4font-family: Verdana, Arial, Helvetica, sans-serif;
5font-size: 10px;
6scrollbar-3dlight-color: #F0F0EE;
7scrollbar-arrow-color: #676662;
8scrollbar-base-color: #F0F0EE;
9scrollbar-darkshadow-color: #DDDDDD;
10scrollbar-face-color: #E0E0DD;
11scrollbar-highlight-color: #F0F0EE;
12scrollbar-shadow-color: #F0F0EE;
13scrollbar-track-color: #F5F5F5;
14}
diff --git a/public/javascripts/tiny_mce/plugins/paste/css/pasteword.css b/public/javascripts/tiny_mce/plugins/paste/css/pasteword.css
new file mode 100755
index 0000000..b3be627
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/css/pasteword.css
@@ -0,0 +1,3 @@
1.sourceIframe {
2 border: 1px solid #808080;
3}
diff --git a/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js b/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js
new file mode 100755
index 0000000..eeeebd5
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js
@@ -0,0 +1 @@
(function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.PastePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePasteText',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pastetext.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(clipboardData.getData("Text"),true);}else t._insertText(v.html,v.linebreaks);});ed.addCommand('mcePasteWord',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pasteword.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(t._clipboardHTML());}else t._insertWordContent(v);});ed.addCommand('mceSelectAll',function(){ed.execCommand('selectall');});ed.addButton('pastetext',{title:'paste.paste_text_desc',cmd:'mcePasteText',ui:true});ed.addButton('pasteword',{title:'paste.paste_word_desc',cmd:'mcePasteWord',ui:true});ed.addButton('selectall',{title:'paste.selectall_desc',cmd:'mceSelectAll'});if(ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onPaste.add(function(ed,e){return t._handlePasteEvent(e)});}if(!tinymce.isIE&&ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onKeyDown.add(function(ed,e){if(e.ctrlKey&&e.keyCode==86){window.setTimeout(function(){ed.execCommand("mcePasteText",true);},1);Event.cancel(e);}});}},getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_handlePasteEvent:function(e){var html=this._clipboardHTML(),ed=this.editor,sel=ed.selection,r;if(ed&&(r=sel.getRng())&&r.text.length>0)ed.execCommand('delete');if(html&&html.length>0)ed.execCommand('mcePasteWord',false,html);return Event.cancel(e);},_insertText:function(content,bLinebreaks){content=this.editor.dom.encode(content);if(content&&content.length>0){if(!this.editor.selection.isCollapsed())this.editor.execCommand("Delete");if(bLinebreaks){if(this.editor.getParam("paste_create_paragraphs",true)){var rl=this.editor.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);content=content.replace(/\r\n\r\n/g,'</p><p>');content=content.replace(/\r\r/g,'</p><p>');content=content.replace(/\n\n/g,'</p><p>');if((pos=content.indexOf('</p><p>'))!=-1){this.editor.execCommand("Delete");var node=this.editor.selection.getNode();var breakElms=[];do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="</p>";before+=content.substring(0,pos);for(var i=0;i<breakElms.length;i++){before+="</"+breakElms[i].nodeName+">";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="<p>";content=before+content.substring(pos+7)+after;}}if(this.editor.getParam("paste_create_linebreaks",true)){content=content.replace(/\r\n/g,'<br />');content=content.replace(/\r/g,'<br />');content=content.replace(/\n/g,'<br />');}}this.editor.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){var t=this,ed=t.editor;if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','before',content);var rl=ed.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\x93|\x94|\u201c|\u201d,",\x60|\x91|\x92|\u2018|\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>','gi'),'<p><b>$1</b></p>');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)<BR>","gi"),"<p>"+middot+"$1</p>");content=content.replace(new RegExp('<SPAN style="mso-list: Ignore">','gi'),"<span>"+bull);content=content.replace(/<o:p><\/o:p>/gi,"");content=content.replace(new RegExp('<br style="page-break-before: always;.*>','gi'),'-- page break --');content=content.replace(/<!--([\s\S]*?)-->|<style>[\s\S]*?<\/style>/g,"");content=content.replace(/<(meta|link)[^>]+>/g,"");if(this.editor.getParam("paste_remove_spans",true))content=content.replace(/<\/?span[^>]*>/gi,"");if(this.editor.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(this.editor.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+this._reEscape(""+document.location)+'','gi'),'href="'+this.editor.documentBaseURI.getURI());content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!this.editor.getParam('force_p_newlines')){content=content.replace('','','gi');content=content.replace('</p>','<br /><br />','gi');}if(!tinymce.isIE&&!this.editor.getParam('force_p_newlines')){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(this.editor.getParam("paste_convert_middot_lists",true)){var div=ed.dom.create("div",null,content);var className=this.editor.getParam("paste_unindented_list_class","unIndentedList");while(this._convertMiddots(div,"--list--"));while(this._convertMiddots(div,middot,className));while(this._convertMiddots(div,bull));content=div.innerHTML;}if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi,'<p>&nbsp;&nbsp;</p>');content=content.replace(/<h[1-6]>/gi,'<p><b>');content=content.replace(/<\/h[1-6]>/gi,'</b></p>');content=content.replace(/<b>&nbsp;<\/b>/gi,'<b>&nbsp;&nbsp;</b>');content=content.replace(/^(&nbsp;)*/gi,'');}content=content.replace(/--list--/gi,"");if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','after',content);this.editor.execCommand("mceInsertContent",false,content);if(this.editor.getParam('paste_force_cleanup_wordpaste',true)){var ed=this.editor;window.setTimeout(function(){ed.execCommand("mceCleanup");},1);}}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i<s.length;i++){var c=s.charAt(i);if(l.indexOf(c)!=-1)o+='\\'+c;else o+=c;}return o;},_convertMiddots:function(div,search,class_name){var ed=this.editor,mdot=String.fromCharCode(183),bull=String.fromCharCode(8226);var nodes,prevul,i,p,ul,li,np,cp,li;nodes=div.getElementsByTagName("p");for(i=0;i<nodes.length;i++){p=nodes[i];if(p.innerHTML.indexOf(search)==0){ul=ed.dom.create("ul");if(class_name)ul.className=class_name;li=ed.dom.create("li");li.innerHTML=p.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--|&nbsp;',"gi"),'');ul.appendChild(li);np=p.nextSibling;while(np){if(np.nodeType==3&&new RegExp('^\\s$','m').test(np.nodeValue)){np=np.nextSibling;continue;}if(search==mdot){if(np.nodeType==1&&new RegExp('^o(\\s+|&nbsp;)').test(np.innerHTML)){if(!prevul){prevul=ul;ul=ed.dom.create("ul");prevul.appendChild(ul);}np.innerHTML=np.innerHTML.replace(/^o/,'');}else{if(prevul){ul=prevul;prevul=null;}if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}}else{if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}cp=np.nextSibling;li=ed.dom.create("li");li.innerHTML=np.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--|&nbsp;',"gi"),'');np.parentNode.removeChild(np);ul.appendChild(li);np=cp;}p.parentNode.replaceChild(ul,p);return true;}}return false;},_clipboardHTML:function(){var div=document.getElementById('_TinyMCE_clipboardHTML');if(!div){var div=document.createElement('DIV');div.id='_TinyMCE_clipboardHTML';with(div.style){visibility='hidden';overflow='hidden';position='absolute';width=1;height=1;}document.body.appendChild(div);}div.innerHTML='';var rng=document.body.createTextRange();rng.moveToElementText(div);rng.execCommand('Paste');var html=div.innerHTML;div.innerHTML='';return html;}});tinymce.PluginManager.add('paste',tinymce.plugins.PastePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js
new file mode 100755
index 0000000..bb5f5aa
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js
@@ -0,0 +1,394 @@
1/**
2 * $Id: editor_plugin_src.js 919 2008-09-08 20:31:23Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var Event = tinymce.dom.Event;
10
11 tinymce.create('tinymce.plugins.PastePlugin', {
12 init : function(ed, url) {
13 var t = this;
14
15 t.editor = ed;
16
17 // Register commands
18 ed.addCommand('mcePasteText', function(ui, v) {
19 if (ui) {
20 if ((ed.getParam('paste_use_dialog', true)) || (!tinymce.isIE)) {
21 ed.windowManager.open({
22 file : url + '/pastetext.htm',
23 width : 450,
24 height : 400,
25 inline : 1
26 }, {
27 plugin_url : url
28 });
29 } else
30 t._insertText(clipboardData.getData("Text"), true);
31 } else
32 t._insertText(v.html, v.linebreaks);
33 });
34
35 ed.addCommand('mcePasteWord', function(ui, v) {
36 if (ui) {
37 if ((ed.getParam('paste_use_dialog', true)) || (!tinymce.isIE)) {
38 ed.windowManager.open({
39 file : url + '/pasteword.htm',
40 width : 450,
41 height : 400,
42 inline : 1
43 }, {
44 plugin_url : url
45 });
46 } else
47 t._insertText(t._clipboardHTML());
48 } else
49 t._insertWordContent(v);
50 });
51
52 ed.addCommand('mceSelectAll', function() {
53 ed.execCommand('selectall');
54 });
55
56 // Register buttons
57 ed.addButton('pastetext', {title : 'paste.paste_text_desc', cmd : 'mcePasteText', ui : true});
58 ed.addButton('pasteword', {title : 'paste.paste_word_desc', cmd : 'mcePasteWord', ui : true});
59 ed.addButton('selectall', {title : 'paste.selectall_desc', cmd : 'mceSelectAll'});
60
61 if (ed.getParam("paste_auto_cleanup_on_paste", false)) {
62 ed.onPaste.add(function(ed, e) {
63 return t._handlePasteEvent(e)
64 });
65 }
66
67 if (!tinymce.isIE && ed.getParam("paste_auto_cleanup_on_paste", false)) {
68 // Force paste dialog if non IE browser
69 ed.onKeyDown.add(function(ed, e) {
70 if (e.ctrlKey && e.keyCode == 86) {
71 window.setTimeout(function() {
72 ed.execCommand("mcePasteText", true);
73 }, 1);
74
75 Event.cancel(e);
76 }
77 });
78 }
79 },
80
81 getInfo : function() {
82 return {
83 longname : 'Paste text/word',
84 author : 'Moxiecode Systems AB',
85 authorurl : 'http://tinymce.moxiecode.com',
86 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',
87 version : tinymce.majorVersion + "." + tinymce.minorVersion
88 };
89 },
90
91 // Private methods
92
93 _handlePasteEvent : function(e) {
94 var html = this._clipboardHTML(), ed = this.editor, sel = ed.selection, r;
95
96 // Removes italic, strong etc, the if was needed due to bug #1437114
97 if (ed && (r = sel.getRng()) && r.text.length > 0)
98 ed.execCommand('delete');
99
100 if (html && html.length > 0)
101 ed.execCommand('mcePasteWord', false, html);
102
103 return Event.cancel(e);
104 },
105
106 _insertText : function(content, bLinebreaks) {
107 content = this.editor.dom.encode(content);
108
109 if (content && content.length > 0) {
110 // Delete any highlighted text before pasting
111 if (!this.editor.selection.isCollapsed())
112 this.editor.execCommand("Delete");
113
114 if (bLinebreaks) {
115 // Special paragraph treatment
116 if (this.editor.getParam("paste_create_paragraphs", true)) {
117 var rl = this.editor.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
118 for (var i=0; i<rl.length; i+=2)
119 content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
120
121 content = content.replace(/\r\n\r\n/g, '</p><p>');
122 content = content.replace(/\r\r/g, '</p><p>');
123 content = content.replace(/\n\n/g, '</p><p>');
124
125 // Has paragraphs
126 if ((pos = content.indexOf('</p><p>')) != -1) {
127 this.editor.execCommand("Delete");
128
129 var node = this.editor.selection.getNode();
130
131 // Get list of elements to break
132 var breakElms = [];
133
134 do {
135 if (node.nodeType == 1) {
136 // Don't break tables and break at body
137 if (node.nodeName == "TD" || node.nodeName == "BODY")
138 break;
139
140 breakElms[breakElms.length] = node;
141 }
142 } while(node = node.parentNode);
143
144 var before = "", after = "</p>";
145 before += content.substring(0, pos);
146
147 for (var i=0; i<breakElms.length; i++) {
148 before += "</" + breakElms[i].nodeName + ">";
149 after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">";
150 }
151
152 before += "<p>";
153 content = before + content.substring(pos+7) + after;
154 }
155 }
156
157 if (this.editor.getParam("paste_create_linebreaks", true)) {
158 content = content.replace(/\r\n/g, '<br />');
159 content = content.replace(/\r/g, '<br />');
160 content = content.replace(/\n/g, '<br />');
161 }
162 }
163
164 this.editor.execCommand("mceInsertRawHTML", false, content);
165 }
166 },
167
168 _insertWordContent : function(content) {
169 var t = this, ed = t.editor;
170
171 if (content && content.length > 0) {
172 // Cleanup Word content
173 var bull = String.fromCharCode(8226);
174 var middot = String.fromCharCode(183);
175
176 if (ed.getParam('paste_insert_word_content_callback'))
177 content = ed.execCallback('paste_insert_word_content_callback', 'before', content);
178
179 var rl = ed.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\x93|\x94|\u201c|\u201d,",\x60|\x91|\x92|\u2018|\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
180 for (var i=0; i<rl.length; i+=2)
181 content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
182
183 if (this.editor.getParam("paste_convert_headers_to_strong", false)) {
184 content = content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>', 'gi'), '<p><b>$1</b></p>');
185 }
186
187 content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--");
188 content = content.replace(new RegExp(bull + "(.*?)<BR>", "gi"), "<p>" + middot + "$1</p>");
189 content = content.replace(new RegExp('<SPAN style="mso-list: Ignore">', 'gi'), "<span>" + bull); // Covert to bull list
190 content = content.replace(/<o:p><\/o:p>/gi, "");
191 content = content.replace(new RegExp('<br style="page-break-before: always;.*>', 'gi'), '-- page break --'); // Replace pagebreaks
192 content = content.replace(/<!--([\s\S]*?)-->|<style>[\s\S]*?<\/style>/g, ""); // Word comments
193 content = content.replace(/<(meta|link)[^>]+>/g, ""); // Header elements
194
195 if (this.editor.getParam("paste_remove_spans", true))
196 content = content.replace(/<\/?span[^>]*>/gi, "");
197
198 if (this.editor.getParam("paste_remove_styles", true))
199 content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3");
200
201 content = content.replace(/<\/?font[^>]*>/gi, "");
202
203 // Strips class attributes.
204 switch (this.editor.getParam("paste_strip_class_attributes", "all")) {
205 case "all":
206 content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
207 break;
208
209 case "mso":
210 content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3");
211 break;
212 }
213
214 content = content.replace(new RegExp('href="?' + this._reEscape("" + document.location) + '', 'gi'), 'href="' + this.editor.documentBaseURI.getURI());
215 content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
216 content = content.replace(/<\\?\?xml[^>]*>/gi, "");
217 content = content.replace(/<\/?\w+:[^>]*>/gi, "");
218 content = content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi, ""); // Remove pagebreaks
219 content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks
220
221 // content = content.replace(/\/?&nbsp;*/gi, ""); &nbsp;
222 // content = content.replace(/<p>&nbsp;<\/p>/gi, '');
223
224 if (!this.editor.getParam('force_p_newlines')) {
225 content = content.replace('', '' ,'gi');
226 content = content.replace('</p>', '<br /><br />' ,'gi');
227 }
228
229 if (!tinymce.isIE && !this.editor.getParam('force_p_newlines')) {
230 content = content.replace(/<\/?p[^>]*>/gi, "");
231 }
232
233 content = content.replace(/<\/?div[^>]*>/gi, "");
234
235 // Convert all middlot lists to UL lists
236 if (this.editor.getParam("paste_convert_middot_lists", true)) {
237 var div = ed.dom.create("div", null, content);
238
239 // Convert all middot paragraphs to li elements
240 var className = this.editor.getParam("paste_unindented_list_class", "unIndentedList");
241
242 while (this._convertMiddots(div, "--list--")) ; // bull
243 while (this._convertMiddots(div, middot, className)) ; // Middot
244 while (this._convertMiddots(div, bull)) ; // bull
245
246 content = div.innerHTML;
247 }
248
249 // Replace all headers with strong and fix some other issues
250 if (this.editor.getParam("paste_convert_headers_to_strong", false)) {
251 content = content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi, '<p>&nbsp;&nbsp;</p>');
252 content = content.replace(/<h[1-6]>/gi, '<p><b>');
253 content = content.replace(/<\/h[1-6]>/gi, '</b></p>');
254 content = content.replace(/<b>&nbsp;<\/b>/gi, '<b>&nbsp;&nbsp;</b>');
255 content = content.replace(/^(&nbsp;)*/gi, '');
256 }
257
258 content = content.replace(/--list--/gi, ""); // Remove --list--
259
260 if (ed.getParam('paste_insert_word_content_callback'))
261 content = ed.execCallback('paste_insert_word_content_callback', 'after', content);
262
263 // Insert cleaned content
264 this.editor.execCommand("mceInsertContent", false, content);
265
266 if (this.editor.getParam('paste_force_cleanup_wordpaste', true)) {
267 var ed = this.editor;
268
269 window.setTimeout(function() {
270 ed.execCommand("mceCleanup");
271 }, 1); // Do normal cleanup detached from this thread
272 }
273 }
274 },
275
276 _reEscape : function(s) {
277 var l = "?.\\*[](){}+^$:";
278 var o = "";
279
280 for (var i=0; i<s.length; i++) {
281 var c = s.charAt(i);
282
283 if (l.indexOf(c) != -1)
284 o += '\\' + c;
285 else
286 o += c;
287 }
288
289 return o;
290 },
291
292 _convertMiddots : function(div, search, class_name) {
293 var ed = this.editor, mdot = String.fromCharCode(183), bull = String.fromCharCode(8226);
294 var nodes, prevul, i, p, ul, li, np, cp, li;
295
296 nodes = div.getElementsByTagName("p");
297 for (i=0; i<nodes.length; i++) {
298 p = nodes[i];
299
300 // Is middot
301 if (p.innerHTML.indexOf(search) == 0) {
302 ul = ed.dom.create("ul");
303
304 if (class_name)
305 ul.className = class_name;
306
307 // Add the first one
308 li = ed.dom.create("li");
309 li.innerHTML = p.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
310 ul.appendChild(li);
311
312 // Add the rest
313 np = p.nextSibling;
314 while (np) {
315 // If the node is whitespace, then
316 // ignore it and continue on.
317 if (np.nodeType == 3 && new RegExp('^\\s$', 'm').test(np.nodeValue)) {
318 np = np.nextSibling;
319 continue;
320 }
321
322 if (search == mdot) {
323 if (np.nodeType == 1 && new RegExp('^o(\\s+|&nbsp;)').test(np.innerHTML)) {
324 // Second level of nesting
325 if (!prevul) {
326 prevul = ul;
327 ul = ed.dom.create("ul");
328 prevul.appendChild(ul);
329 }
330 np.innerHTML = np.innerHTML.replace(/^o/, '');
331 } else {
332 // Pop the stack if we're going back up to the first level
333 if (prevul) {
334 ul = prevul;
335 prevul = null;
336 }
337 // Not element or middot paragraph
338 if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
339 break;
340 }
341 } else {
342 // Not element or middot paragraph
343 if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
344 break;
345 }
346
347 cp = np.nextSibling;
348 li = ed.dom.create("li");
349 li.innerHTML = np.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
350 np.parentNode.removeChild(np);
351 ul.appendChild(li);
352 np = cp;
353 }
354
355 p.parentNode.replaceChild(ul, p);
356
357 return true;
358 }
359 }
360
361 return false;
362 },
363
364 _clipboardHTML : function() {
365 var div = document.getElementById('_TinyMCE_clipboardHTML');
366
367 if (!div) {
368 var div = document.createElement('DIV');
369 div.id = '_TinyMCE_clipboardHTML';
370
371 with (div.style) {
372 visibility = 'hidden';
373 overflow = 'hidden';
374 position = 'absolute';
375 width = 1;
376 height = 1;
377 }
378
379 document.body.appendChild(div);
380 }
381
382 div.innerHTML = '';
383 var rng = document.body.createTextRange();
384 rng.moveToElementText(div);
385 rng.execCommand('Paste');
386 var html = div.innerHTML;
387 div.innerHTML = '';
388 return html;
389 }
390 });
391
392 // Register plugin
393 tinymce.PluginManager.add('paste', tinymce.plugins.PastePlugin);
394})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js b/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js
new file mode 100755
index 0000000..326bb16
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js
@@ -0,0 +1,42 @@
1tinyMCEPopup.requireLangPack();
2
3function saveContent() {
4 if (document.forms[0].htmlSource.value == '') {
5 tinyMCEPopup.close();
6 return false;
7 }
8
9 tinyMCEPopup.execCommand('mcePasteText', false, {
10 html : document.forms[0].htmlSource.value,
11 linebreaks : document.forms[0].linebreaks.checked
12 });
13
14 tinyMCEPopup.close();
15}
16
17function onLoadInit() {
18 tinyMCEPopup.resizeToInnerSize();
19
20 // Remove Gecko spellchecking
21 if (tinymce.isGecko)
22 document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
23
24 resizeInputs();
25}
26
27var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
28
29function resizeInputs() {
30 if (!tinymce.isIE) {
31 wHeight = self.innerHeight-80;
32 wWidth = self.innerWidth-17;
33 } else {
34 wHeight = document.body.clientHeight-80;
35 wWidth = document.body.clientWidth-17;
36 }
37
38 document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
39 document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px';
40}
41
42tinyMCEPopup.onInit.add(onLoadInit); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js b/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js
new file mode 100755
index 0000000..6701b99
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js
@@ -0,0 +1,56 @@
1tinyMCEPopup.requireLangPack();
2
3function saveContent() {
4 var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;
5
6 if (html == ''){
7 tinyMCEPopup.close();
8 return false;
9 }
10
11 tinyMCEPopup.execCommand('mcePasteWord', false, html);
12 tinyMCEPopup.close();
13}
14
15function onLoadInit() {
16 tinyMCEPopup.resizeToInnerSize();
17
18 // Fix for endless reloading in FF
19 window.setTimeout(createIFrame, 10);
20}
21
22function createIFrame() {
23 document.getElementById('iframecontainer').innerHTML = '<iframe id="frmData" name="frmData" class="sourceIframe" src="blank.htm" height="280" width="400" frameborder="0" style="background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>';
24}
25
26var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
27
28function initIframe(doc) {
29 var dir = tinyMCEPopup.editor.settings.directionality;
30
31 doc.body.dir = dir;
32
33 // Remove Gecko spellchecking
34 if (tinymce.isGecko)
35 doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
36
37 resizeInputs();
38}
39
40function resizeInputs() {
41 if (!tinymce.isIE) {
42 wHeight = self.innerHeight - 80;
43 wWidth = self.innerWidth - 18;
44 } else {
45 wHeight = document.body.clientHeight - 80;
46 wWidth = document.body.clientWidth - 18;
47 }
48
49 var elm = document.getElementById('frmData');
50 if (elm) {
51 elm.style.height = Math.abs(wHeight) + 'px';
52 elm.style.width = Math.abs(wWidth) + 'px';
53 }
54}
55
56tinyMCEPopup.onInit.add(onLoadInit);
diff --git a/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js
new file mode 100755
index 0000000..eeac778
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js
@@ -0,0 +1,5 @@
1tinyMCE.addI18n('en.paste_dlg',{
2text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
3text_linebreaks:"Keep linebreaks",
4word_title:"Use CTRL+V on your keyboard to paste the text into the window."
5}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/paste/pastetext.htm b/public/javascripts/tiny_mce/plugins/paste/pastetext.htm
new file mode 100755
index 0000000..2f2b341
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/pastetext.htm
@@ -0,0 +1,34 @@
1<html xmlns="http://www.w3.org/1999/xhtml">
2<head>
3 <title>{#paste.paste_text_desc}</title>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="js/pastetext.js"></script>
7 <base target="_self" />
8</head>
9<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
10<form name="source" onsubmit="saveContent();return false;" action="#">
11 <div style="float: left" class="title">{#paste.paste_text_desc}</div>
12
13 <div style="float: right">
14 <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
15 </div>
16
17 <br style="clear: both" />
18
19 <div>{#paste_dlg.text_title}</div>
20
21 <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>
22
23 <div class="mceActionPanel">
24 <div style="float: left">
25 <input type="submit" name="insert" value="{#insert}" id="insert" />
26 </div>
27
28 <div style="float: right">
29 <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
30 </div>
31 </div>
32</form>
33</body>
34</html> \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/paste/pasteword.htm b/public/javascripts/tiny_mce/plugins/paste/pasteword.htm
new file mode 100755
index 0000000..9e5ab1b
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/paste/pasteword.htm
@@ -0,0 +1,29 @@
1<html xmlns="http://www.w3.org/1999/xhtml">
2<head>
3 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
4 <title>{#paste.paste_word_desc}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="js/pasteword.js"></script>
7 <link href="css/pasteword.css" rel="stylesheet" type="text/css" />
8 <base target="_self" />
9</head>
10<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
11 <form name="source" onsubmit="saveContent();" action="#">
12 <div class="title">{#paste.paste_word_desc}</div>
13
14 <div>{#paste_dlg.word_title}</div>
15
16 <div id="iframecontainer"></div>
17
18 <div class="mceActionPanel">
19 <div style="float: left">
20 <input type="button" id="insert" name="insert" value="{#insert}" onclick="saveContent();" />
21 </div>
22
23 <div style="float: right">
24 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
25 </div>
26 </div>
27 </form>
28</body>
29</html>
diff --git a/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js b/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js
new file mode 100755
index 0000000..deb4bce
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.Preview',{init:function(ed,url){var t=this,css=tinymce.explode(ed.settings.content_css);t.editor=ed;tinymce.each(css,function(u,k){css[k]=ed.documentBaseURI.toAbsolute(u);});ed.addCommand('mcePreview',function(){ed.windowManager.open({file:ed.getParam("plugin_preview_pageurl",url+"/preview.html"),width:parseInt(ed.getParam("plugin_preview_width","550")),height:parseInt(ed.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:css.join(','),inline:ed.getParam("plugin_preview_inline",1)},{base:ed.documentBaseURI.getURI()});});ed.addButton('preview',{title:'preview.preview_desc',cmd:'mcePreview'});},getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('preview',tinymce.plugins.Preview);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js
new file mode 100755
index 0000000..b2d27f7
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js
@@ -0,0 +1,50 @@
1/**
2 * $Id: editor_plugin_src.js 895 2008-07-10 14:34:23Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.Preview', {
10 init : function(ed, url) {
11 var t = this, css = tinymce.explode(ed.settings.content_css);
12
13 t.editor = ed;
14
15 // Force absolute CSS urls
16 tinymce.each(css, function(u, k) {
17 css[k] = ed.documentBaseURI.toAbsolute(u);
18 });
19
20 ed.addCommand('mcePreview', function() {
21 ed.windowManager.open({
22 file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
23 width : parseInt(ed.getParam("plugin_preview_width", "550")),
24 height : parseInt(ed.getParam("plugin_preview_height", "600")),
25 resizable : "yes",
26 scrollbars : "yes",
27 popup_css : css.join(','),
28 inline : ed.getParam("plugin_preview_inline", 1)
29 }, {
30 base : ed.documentBaseURI.getURI()
31 });
32 });
33
34 ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
35 },
36
37 getInfo : function() {
38 return {
39 longname : 'Preview',
40 author : 'Moxiecode Systems AB',
41 authorurl : 'http://tinymce.moxiecode.com',
42 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
43 version : tinymce.majorVersion + "." + tinymce.minorVersion
44 };
45 }
46 });
47
48 // Register plugin
49 tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
50})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/preview/example.html b/public/javascripts/tiny_mce/plugins/preview/example.html
new file mode 100755
index 0000000..b2c3d90
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/preview/example.html
@@ -0,0 +1,28 @@
1<html xmlns="http://www.w3.org/1999/xhtml">
2<head>
3<script language="javascript" src="../../tiny_mce_popup.js"></script>
4<script type="text/javascript" src="jscripts/embed.js"></script>
5<script type="text/javascript">
6tinyMCEPopup.onInit.add(function(ed) {
7 var dom = tinyMCEPopup.dom;
8
9 // Load editor content_css
10 tinymce.each(ed.settings.content_css.split(','), function(u) {
11 dom.loadCSS(ed.documentBaseURI.toAbsolute(u));
12 });
13
14 // Place contents inside div container
15 dom.setHTML('content', ed.getContent());
16});
17</script>
18<title>Example of a custom preview page</title>
19</head>
20<body>
21
22Editor contents: <br />
23<div id="content">
24<!-- Gets filled with editor contents -->
25</div>
26
27</body>
28</html>
diff --git a/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js b/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js
new file mode 100755
index 0000000..f8dc810
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js
@@ -0,0 +1,73 @@
1/**
2 * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
3 */
4
5function writeFlash(p) {
6 writeEmbed(
7 'D27CDB6E-AE6D-11cf-96B8-444553540000',
8 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
9 'application/x-shockwave-flash',
10 p
11 );
12}
13
14function writeShockWave(p) {
15 writeEmbed(
16 '166B1BCA-3F9C-11CF-8075-444553540000',
17 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
18 'application/x-director',
19 p
20 );
21}
22
23function writeQuickTime(p) {
24 writeEmbed(
25 '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
26 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
27 'video/quicktime',
28 p
29 );
30}
31
32function writeRealMedia(p) {
33 writeEmbed(
34 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
35 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
36 'audio/x-pn-realaudio-plugin',
37 p
38 );
39}
40
41function writeWindowsMedia(p) {
42 p.url = p.src;
43 writeEmbed(
44 '6BF52A52-394A-11D3-B153-00C04F79FAA6',
45 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
46 'application/x-mplayer2',
47 p
48 );
49}
50
51function writeEmbed(cls, cb, mt, p) {
52 var h = '', n;
53
54 h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
55 h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
56 h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
57 h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
58 h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
59 h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
60 h += '>';
61
62 for (n in p)
63 h += '<param name="' + n + '" value="' + p[n] + '">';
64
65 h += '<embed type="' + mt + '"';
66
67 for (n in p)
68 h += n + '="' + p[n] + '" ';
69
70 h += '></embed></object>';
71
72 document.write(h);
73}
diff --git a/public/javascripts/tiny_mce/plugins/preview/preview.html b/public/javascripts/tiny_mce/plugins/preview/preview.html
new file mode 100755
index 0000000..7960f78
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/preview/preview.html
@@ -0,0 +1,19 @@
1<html xmlns="http://www.w3.org/1999/xhtml">
2<head>
3<script language="javascript" src="../../tiny_mce_popup.js"></script>
4<script type="text/javascript" src="jscripts/embed.js"></script>
5<script type="text/javascript">
6tinyMCEPopup.onInit.add(function(ed) {
7 var dom = tinyMCEPopup.dom;
8
9 dom.setHTML('content', ed.getContent());
10});
11
12document.write('<base href="' + tinyMCEPopup.getWindowArg("base") + '">');
13</script>
14<title>{#preview.preview_desc}</title>
15</head>
16<body id="content">
17<!-- Gets filled with editor contents -->
18</body>
19</html>
diff --git a/public/javascripts/tiny_mce/plugins/print/editor_plugin.js b/public/javascripts/tiny_mce/plugins/print/editor_plugin.js
new file mode 100755
index 0000000..7d09a87
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/print/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.Print',{init:function(ed,url){ed.addCommand('mcePrint',function(){ed.getWin().print();});ed.addButton('print',{title:'print.print_desc',cmd:'mcePrint'});},getInfo:function(){return{longname:'Print',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('print',tinymce.plugins.Print);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js
new file mode 100755
index 0000000..51fe156
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js
@@ -0,0 +1,31 @@
1/**
2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.Print', {
10 init : function(ed, url) {
11 ed.addCommand('mcePrint', function() {
12 ed.getWin().print();
13 });
14
15 ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'});
16 },
17
18 getInfo : function() {
19 return {
20 longname : 'Print',
21 author : 'Moxiecode Systems AB',
22 authorurl : 'http://tinymce.moxiecode.com',
23 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',
24 version : tinymce.majorVersion + "." + tinymce.minorVersion
25 };
26 }
27 });
28
29 // Register plugin
30 tinymce.PluginManager.add('print', tinymce.plugins.Print);
31})();
diff --git a/public/javascripts/tiny_mce/plugins/safari/blank.htm b/public/javascripts/tiny_mce/plugins/safari/blank.htm
new file mode 100755
index 0000000..266808c
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/safari/blank.htm
@@ -0,0 +1 @@
<!-- WebKit --> \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/safari/editor_plugin.js b/public/javascripts/tiny_mce/plugins/safari/editor_plugin.js
new file mode 100755
index 0000000..4daac19
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/safari/editor_plugin.js
@@ -0,0 +1 @@
(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;function isEmpty(d,e,f){var w,n;w=d.createTreeWalker(e,NodeFilter.SHOW_ALL,null,false);while(n=w.nextNode()){if(f){if(!f(n))return false;}if(n.nodeType==3&&n.nodeValue&&/[^\s\u00a0]+/.test(n.nodeValue))return false;if(n.nodeType==1&&/^(HR|IMG|TABLE)$/.test(n.nodeName))return false;}return true;};tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.addCommand('CreateLink',function(u,v){var n=ed.selection.getNode(),dom=ed.dom,a;if(n&&(/^(left|right)$/i.test(dom.getStyle(n,'float',1))||/^(left|right)$/i.test(dom.getAttrib(n,'align')))){a=dom.create('a',{href:v},n.cloneNode());n.parentNode.replaceChild(a,n);ed.selection.select(a);}else ed.getDoc().execCommand("CreateLink",false,v);});ed.onPaste.add(function(ed,e){function removeStyles(e){e=e.target;if(e.nodeType==1){e.style.cssText='';each(ed.dom.select('*',e),function(e){e.style.cssText='';});}};Event.add(ed.getDoc(),'DOMNodeInserted',removeStyles);window.setTimeout(function(){Event.remove(ed.getDoc(),'DOMNodeInserted',removeStyles);},0);});ed.onKeyUp.add(function(ed,e){var h,b,r,n,s;if(e.keyCode==46||e.keyCode==8){b=ed.getBody();h=b.innerHTML;s=ed.selection;if(b.childNodes.length==1&&!/<(img|hr)/.test(h)&&tinymce.trim(h.replace(/<[^>]+>/g,'')).length==0){ed.setContent('<p><br mce_bogus="1" /></p>',{format:'raw'});n=b.firstChild;r=s.getRng();r.setStart(n,0);r.setEnd(n,0);s.setRng(r);}}});ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,ed.dom.processHTML(v)+'<span id="_mce_tmp">XX</span>');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){var se,li,lic,r1,r2,n,sel,doc,be,af,pa;if(e.keyCode==13){sel=ed.selection;se=sel.getNode();if(e.shiftKey||ed.settings.force_br_newlines&&se.nodeName!='LI'){t._insertBR(ed);Event.cancel(e);}if(li=dom.getParent(se,'LI')){lic=dom.getParent(li,'OL,UL');doc=ed.getDoc();pa=dom.create('p');dom.add(pa,'br',{mce_bogus:"1"});if(isEmpty(doc,li)){if(n=dom.getParent(lic.parentNode,'LI,OL,UL'))return;n=dom.getParent(lic,'p,h1,h2,h3,h4,h5,h6,div')||lic;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(li);r2=doc.createRange();r2.setStartAfter(li);r2.setEndAfter(n);be=r1.cloneContents();af=r2.cloneContents();if(!isEmpty(doc,af))dom.insertAfter(af,n);dom.insertAfter(pa,n);if(!isEmpty(doc,be))dom.insertAfter(be,n);dom.remove(n);n=pa.firstChild;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(n);sel.setRng(r1);return Event.cancel(e);}}}});ed.onExecCommand.add(function(ed,cmd){var sel,dom,bl,bm;if(cmd=='InsertUnorderedList'||cmd=='InsertOrderedList'){sel=ed.selection;dom=ed.dom;if(bl=dom.getParent(sel.getNode(),function(n){return/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})){bm=sel.getBookmark();dom.remove(bl,1);sel.moveToBookmark(bm);}}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onInit.add(function(){t._fixWebKitSpans();if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,'</$1>');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},getInfo:function(){return{longname:'Safari compatibility',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js
new file mode 100755
index 0000000..642d659
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js
@@ -0,0 +1,514 @@
1/**
2 * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray, isOldWebKit = tinymce.isOldWebKit;
10
11 function isEmpty(d, e, f) {
12 var w, n;
13
14 w = d.createTreeWalker(e, NodeFilter.SHOW_ALL, null, false);
15 while (n = w.nextNode()) {
16 // Filter func
17 if (f) {
18 if (!f(n))
19 return false;
20 }
21
22 // Non whitespace text node
23 if (n.nodeType == 3 && n.nodeValue && /[^\s\u00a0]+/.test(n.nodeValue))
24 return false;
25
26 // Is non text element byt still content
27 if (n.nodeType == 1 && /^(HR|IMG|TABLE)$/.test(n.nodeName))
28 return false;
29 }
30
31 return true;
32 };
33
34 tinymce.create('tinymce.plugins.Safari', {
35 init : function(ed) {
36 var t = this, dom;
37
38 // Ignore on non webkit
39 if (!tinymce.isWebKit)
40 return;
41
42 t.editor = ed;
43 t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];
44 t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large'];
45
46 // Safari CreateLink command will not work correctly on images that is aligned
47 ed.addCommand('CreateLink', function(u, v) {
48 var n = ed.selection.getNode(), dom = ed.dom, a;
49
50 if (n && (/^(left|right)$/i.test(dom.getStyle(n, 'float', 1)) || /^(left|right)$/i.test(dom.getAttrib(n, 'align')))) {
51 a = dom.create('a', {href : v}, n.cloneNode());
52 n.parentNode.replaceChild(a, n);
53 ed.selection.select(a);
54 } else
55 ed.getDoc().execCommand("CreateLink", false, v);
56 });
57
58 ed.onPaste.add(function(ed, e) {
59 function removeStyles(e) {
60 e = e.target;
61
62 if (e.nodeType == 1) {
63 e.style.cssText = '';
64
65 each(ed.dom.select('*', e), function(e) {
66 e.style.cssText = '';
67 });
68 }
69 };
70
71 Event.add(ed.getDoc(), 'DOMNodeInserted', removeStyles);
72
73 window.setTimeout(function() {
74 Event.remove(ed.getDoc(), 'DOMNodeInserted', removeStyles);
75 }, 0);
76 });
77
78 ed.onKeyUp.add(function(ed, e) {
79 var h, b, r, n, s;
80
81 // If backspace or delete key
82 if (e.keyCode == 46 || e.keyCode == 8) {
83 b = ed.getBody();
84 h = b.innerHTML;
85 s = ed.selection;
86
87 // If there is no text content or images or hr elements then remove everything
88 if (b.childNodes.length == 1 && !/<(img|hr)/.test(h) && tinymce.trim(h.replace(/<[^>]+>/g, '')).length == 0) {
89 // Inject paragrah and bogus br
90 ed.setContent('<p><br mce_bogus="1" /></p>', {format : 'raw'});
91
92 // Move caret before bogus br
93 n = b.firstChild;
94 r = s.getRng();
95 r.setStart(n, 0);
96 r.setEnd(n, 0);
97 s.setRng(r);
98 }
99 }
100 });
101
102 // Workaround for FormatBlock bug, http://bugs.webkit.org/show_bug.cgi?id=16004
103 ed.addCommand('FormatBlock', function(u, v) {
104 var dom = ed.dom, e = dom.getParent(ed.selection.getNode(), dom.isBlock);
105
106 if (e)
107 dom.replace(dom.create(v), e, 1);
108 else
109 ed.getDoc().execCommand("FormatBlock", false, v);
110 });
111
112 // Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382
113 ed.addCommand('mceInsertContent', function(u, v) {
114 ed.getDoc().execCommand("InsertText", false, 'mce_marker');
115 ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, ed.dom.processHTML(v) + '<span id="_mce_tmp">XX</span>');
116 ed.selection.select(ed.dom.get('_mce_tmp'));
117 ed.getDoc().execCommand("Delete", false, ' ');
118 });
119
120 ed.onKeyPress.add(function(ed, e) {
121 var se, li, lic, r1, r2, n, sel, doc, be, af, pa;
122
123 if (e.keyCode == 13) {
124 sel = ed.selection;
125 se = sel.getNode();
126
127 // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973
128 if (e.shiftKey || ed.settings.force_br_newlines && se.nodeName != 'LI') {
129 t._insertBR(ed);
130 Event.cancel(e);
131 }
132
133 // Workaround for DIV elements produced by Safari
134 if (li = dom.getParent(se, 'LI')) {
135 lic = dom.getParent(li, 'OL,UL');
136 doc = ed.getDoc();
137
138 pa = dom.create('p');
139 dom.add(pa, 'br', {mce_bogus : "1"});
140
141 if (isEmpty(doc, li)) {
142 // If list in list then use browser default behavior
143 if (n = dom.getParent(lic.parentNode, 'LI,OL,UL'))
144 return;
145
146 n = dom.getParent(lic, 'p,h1,h2,h3,h4,h5,h6,div') || lic;
147
148 // Create range from the start of block element to the list item
149 r1 = doc.createRange();
150 r1.setStartBefore(n);
151 r1.setEndBefore(li);
152
153 // Create range after the list to the end of block element
154 r2 = doc.createRange();
155 r2.setStartAfter(li);
156 r2.setEndAfter(n);
157
158 be = r1.cloneContents();
159 af = r2.cloneContents();
160
161 if (!isEmpty(doc, af))
162 dom.insertAfter(af, n);
163
164 dom.insertAfter(pa, n);
165
166 if (!isEmpty(doc, be))
167 dom.insertAfter(be, n);
168
169 dom.remove(n);
170
171 n = pa.firstChild;
172 r1 = doc.createRange();
173 r1.setStartBefore(n);
174 r1.setEndBefore(n);
175 sel.setRng(r1);
176
177 return Event.cancel(e);
178 }
179 }
180 }
181 });
182
183 // Safari doesn't place lists outside block elements
184 ed.onExecCommand.add(function(ed, cmd) {
185 var sel, dom, bl, bm;
186
187 if (cmd == 'InsertUnorderedList' || cmd == 'InsertOrderedList') {
188 sel = ed.selection;
189 dom = ed.dom;
190
191 if (bl = dom.getParent(sel.getNode(), function(n) {return /^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})) {
192 bm = sel.getBookmark();
193 dom.remove(bl, 1);
194 sel.moveToBookmark(bm);
195 }
196 }
197 });
198
199 // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
200 ed.onClick.add(function(ed, e) {
201 e = e.target;
202
203 if (e.nodeName == 'IMG') {
204 t.selElm = e;
205 ed.selection.select(e);
206 } else
207 t.selElm = null;
208 });
209
210 ed.onInit.add(function() {
211 t._fixWebKitSpans();
212
213 if (isOldWebKit)
214 t._patchSafari2x(ed);
215 });
216
217 ed.onSetContent.add(function() {
218 dom = ed.dom;
219
220 // Convert strong,b,em,u,strike to spans
221 each(['strong','b','em','u','strike','sub','sup','a'], function(v) {
222 each(grep(dom.select(v)).reverse(), function(n) {
223 var nn = n.nodeName.toLowerCase(), st;
224
225 // Convert anchors into images
226 if (nn == 'a') {
227 if (n.name)
228 dom.replace(dom.create('img', {mce_name : 'a', name : n.name, 'class' : 'mceItemAnchor'}), n);
229
230 return;
231 }
232
233 switch (nn) {
234 case 'b':
235 case 'strong':
236 if (nn == 'b')
237 nn = 'strong';
238
239 st = 'font-weight: bold;';
240 break;
241
242 case 'em':
243 st = 'font-style: italic;';
244 break;
245
246 case 'u':
247 st = 'text-decoration: underline;';
248 break;
249
250 case 'sub':
251 st = 'vertical-align: sub;';
252 break;
253
254 case 'sup':
255 st = 'vertical-align: super;';
256 break;
257
258 case 'strike':
259 st = 'text-decoration: line-through;';
260 break;
261 }
262
263 dom.replace(dom.create('span', {mce_name : nn, style : st, 'class' : 'Apple-style-span'}), n, 1);
264 });
265 });
266 });
267
268 ed.onPreProcess.add(function(ed, o) {
269 dom = ed.dom;
270
271 each(grep(o.node.getElementsByTagName('span')).reverse(), function(n) {
272 var v, bg;
273
274 if (o.get) {
275 if (dom.hasClass(n, 'Apple-style-span')) {
276 bg = n.style.backgroundColor;
277
278 switch (dom.getAttrib(n, 'mce_name')) {
279 case 'font':
280 if (!ed.settings.convert_fonts_to_spans)
281 dom.setAttrib(n, 'style', '');
282 break;
283
284 case 'strong':
285 case 'em':
286 case 'sub':
287 case 'sup':
288 dom.setAttrib(n, 'style', '');
289 break;
290
291 case 'strike':
292 case 'u':
293 if (!ed.settings.inline_styles)
294 dom.setAttrib(n, 'style', '');
295 else
296 dom.setAttrib(n, 'mce_name', '');
297
298 break;
299
300 default:
301 if (!ed.settings.inline_styles)
302 dom.setAttrib(n, 'style', '');
303 }
304
305
306 if (bg)
307 n.style.backgroundColor = bg;
308 }
309 }
310
311 if (dom.hasClass(n, 'mceItemRemoved'))
312 dom.remove(n, 1);
313 });
314 });
315
316 ed.onPostProcess.add(function(ed, o) {
317 // Safari adds BR at end of all block elements
318 o.content = o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g, '</$1>');
319
320 // Safari adds id="undefined" to HR elements
321 o.content = o.content.replace(/ id=\"undefined\"/g, '');
322 });
323 },
324
325 getInfo : function() {
326 return {
327 longname : 'Safari compatibility',
328 author : 'Moxiecode Systems AB',
329 authorurl : 'http://tinymce.moxiecode.com',
330 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',
331 version : tinymce.majorVersion + "." + tinymce.minorVersion
332 };
333 },
334
335 // Internal methods
336
337 _fixWebKitSpans : function() {
338 var t = this, ed = t.editor;
339
340 if (!isOldWebKit) {
341 // Use mutator events on new WebKit
342 Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) {
343 e = e.target;
344
345 if (e && e.nodeType == 1)
346 t._fixAppleSpan(e);
347 });
348 } else {
349 // Do post command processing in old WebKit since the browser crashes on Mutator events :(
350 ed.onExecCommand.add(function() {
351 each(ed.dom.select('span'), function(n) {
352 t._fixAppleSpan(n);
353 });
354
355 ed.nodeChanged();
356 });
357 }
358 },
359
360 _fixAppleSpan : function(e) {
361 var ed = this.editor, dom = ed.dom, fz = this.webKitFontSizes, fzn = this.namedFontSizes, s = ed.settings, st, p;
362
363 if (dom.getAttrib(e, 'mce_fixed'))
364 return;
365
366 // Handle Apple style spans
367 if (e.nodeName == 'SPAN' && e.className == 'Apple-style-span') {
368 st = e.style;
369
370 if (!s.convert_fonts_to_spans) {
371 if (st.fontSize) {
372 dom.setAttrib(e, 'mce_name', 'font');
373 dom.setAttrib(e, 'size', inArray(fz, st.fontSize) + 1);
374 }
375
376 if (st.fontFamily) {
377 dom.setAttrib(e, 'mce_name', 'font');
378 dom.setAttrib(e, 'face', st.fontFamily);
379 }
380
381 if (st.color) {
382 dom.setAttrib(e, 'mce_name', 'font');
383 dom.setAttrib(e, 'color', dom.toHex(st.color));
384 }
385
386 if (st.backgroundColor) {
387 dom.setAttrib(e, 'mce_name', 'font');
388 dom.setStyle(e, 'background-color', st.backgroundColor);
389 }
390 } else {
391 if (st.fontSize)
392 dom.setStyle(e, 'fontSize', fzn[inArray(fz, st.fontSize)]);
393 }
394
395 if (st.fontWeight == 'bold')
396 dom.setAttrib(e, 'mce_name', 'strong');
397
398 if (st.fontStyle == 'italic')
399 dom.setAttrib(e, 'mce_name', 'em');
400
401 if (st.textDecoration == 'underline')
402 dom.setAttrib(e, 'mce_name', 'u');
403
404 if (st.textDecoration == 'line-through')
405 dom.setAttrib(e, 'mce_name', 'strike');
406
407 if (st.verticalAlign == 'super')
408 dom.setAttrib(e, 'mce_name', 'sup');
409
410 if (st.verticalAlign == 'sub')
411 dom.setAttrib(e, 'mce_name', 'sub');
412
413 dom.setAttrib(e, 'mce_fixed', '1');
414 }
415 },
416
417 _patchSafari2x : function(ed) {
418 var t = this, setContent, getNode, dom = ed.dom, lr;
419
420 // Inline dialogs
421 if (ed.windowManager.onBeforeOpen) {
422 ed.windowManager.onBeforeOpen.add(function() {
423 r = ed.selection.getRng();
424 });
425 }
426
427 // Fake select on 2.x
428 ed.selection.select = function(n) {
429 this.getSel().setBaseAndExtent(n, 0, n, 1);
430 };
431
432 getNode = ed.selection.getNode;
433 ed.selection.getNode = function() {
434 return t.selElm || getNode.call(this);
435 };
436
437 // Fake range on Safari 2.x
438 ed.selection.getRng = function() {
439 var t = this, s = t.getSel(), d = ed.getDoc(), r, rb, ra, di;
440
441 // Fake range on Safari 2.x
442 if (s.anchorNode) {
443 r = d.createRange();
444
445 try {
446 // Setup before range
447 rb = d.createRange();
448 rb.setStart(s.anchorNode, s.anchorOffset);
449 rb.collapse(1);
450
451 // Setup after range
452 ra = d.createRange();
453 ra.setStart(s.focusNode, s.focusOffset);
454 ra.collapse(1);
455
456 // Setup start/end points by comparing locations
457 di = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0;
458 r.setStart(di ? s.anchorNode : s.focusNode, di ? s.anchorOffset : s.focusOffset);
459 r.setEnd(di ? s.focusNode : s.anchorNode, di ? s.focusOffset : s.anchorOffset);
460
461 lr = r;
462 } catch (ex) {
463 // Sometimes fails, at least we tried to do it by the book. I hope Safari 2.x will go disappear soooon!!!
464 }
465 }
466
467 return r || lr;
468 };
469
470 // Fix setContent so it works
471 setContent = ed.selection.setContent;
472 ed.selection.setContent = function(h, s) {
473 var r = this.getRng(), b;
474
475 try {
476 setContent.call(this, h, s);
477 } catch (ex) {
478 // Workaround for Safari 2.x
479 b = dom.create('body');
480 b.innerHTML = h;
481
482 each(b.childNodes, function(n) {
483 r.insertNode(n.cloneNode(true));
484 });
485 }
486 };
487 },
488
489 _insertBR : function(ed) {
490 var dom = ed.dom, s = ed.selection, r = s.getRng(), br;
491
492 // Insert BR element
493 r.insertNode(br = dom.create('br'));
494
495 // Place caret after BR
496 r.setStartAfter(br);
497 r.setEndAfter(br);
498 s.setRng(r);
499
500 // Could not place caret after BR then insert an nbsp entity and move the caret
501 if (s.getSel().focusNode == br.previousSibling) {
502 s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br));
503 s.collapse(1);
504 }
505
506 // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117
507 ed.getWin().scrollTo(0, dom.getPos(s.getRng().startContainer).y);
508 }
509 });
510
511 // Register plugin
512 tinymce.PluginManager.add('safari', tinymce.plugins.Safari);
513})();
514
diff --git a/public/javascripts/tiny_mce/plugins/save/editor_plugin.js b/public/javascripts/tiny_mce/plugins/save/editor_plugin.js
new file mode 100755
index 0000000..8a13e7d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/save/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.Save',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceSave',t._save,t);ed.addCommand('mceCancel',t._cancel,t);ed.addButton('save',{title:'save.save_desc',cmd:'mceSave'});ed.addButton('cancel',{title:'save.cancel_desc',cmd:'mceCancel'});ed.onNodeChange.add(t._nodeChange,t);ed.addShortcut('ctrl+s',ed.getLang('save.save_desc'),'mceSave');},getInfo:function(){return{longname:'Save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var ed=this.editor;if(ed.getParam('save_enablewhendirty')){cm.setDisabled('save',!ed.isDirty());cm.setDisabled('cancel',!ed.isDirty());}},_save:function(){var ed=this.editor,formObj,os,i,elementId;formObj=tinymce.DOM.get(ed.id).form||tinymce.DOM.getParent(ed.id,'form');if(ed.getParam("save_enablewhendirty")&&!ed.isDirty())return;tinyMCE.triggerSave();if(os=ed.getParam("save_onsavecallback")){if(ed.execCallback('save_onsavecallback',ed)){ed.startContent=tinymce.trim(ed.getContent({format:'raw'}));ed.nodeChanged();}return;}if(formObj){ed.isNotDirty=true;if(formObj.onsubmit==null||formObj.onsubmit()!=false)formObj.submit();ed.nodeChanged();}else ed.windowManager.alert("Error: No form element found.");},_cancel:function(){var ed=this.editor,os,h=tinymce.trim(ed.startContent);if(os=ed.getParam("save_oncancelcallback")){ed.execCallback('save_oncancelcallback',ed);return;}ed.setContent(h);ed.undoManager.clear();ed.nodeChanged();}});tinymce.PluginManager.add('save',tinymce.plugins.Save);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js
new file mode 100755
index 0000000..b38be4d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js
@@ -0,0 +1,98 @@
1/**
2 * $Id: editor_plugin_src.js 851 2008-05-26 15:38:49Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.Save', {
10 init : function(ed, url) {
11 var t = this;
12
13 t.editor = ed;
14
15 // Register commands
16 ed.addCommand('mceSave', t._save, t);
17 ed.addCommand('mceCancel', t._cancel, t);
18
19 // Register buttons
20 ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'});
21 ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'});
22
23 ed.onNodeChange.add(t._nodeChange, t);
24 ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave');
25 },
26
27 getInfo : function() {
28 return {
29 longname : 'Save',
30 author : 'Moxiecode Systems AB',
31 authorurl : 'http://tinymce.moxiecode.com',
32 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',
33 version : tinymce.majorVersion + "." + tinymce.minorVersion
34 };
35 },
36
37 // Private methods
38
39 _nodeChange : function(ed, cm, n) {
40 var ed = this.editor;
41
42 if (ed.getParam('save_enablewhendirty')) {
43 cm.setDisabled('save', !ed.isDirty());
44 cm.setDisabled('cancel', !ed.isDirty());
45 }
46 },
47
48 // Private methods
49
50 _save : function() {
51 var ed = this.editor, formObj, os, i, elementId;
52
53 formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form');
54
55 if (ed.getParam("save_enablewhendirty") && !ed.isDirty())
56 return;
57
58 tinyMCE.triggerSave();
59
60 // Use callback instead
61 if (os = ed.getParam("save_onsavecallback")) {
62 if (ed.execCallback('save_onsavecallback', ed)) {
63 ed.startContent = tinymce.trim(ed.getContent({format : 'raw'}));
64 ed.nodeChanged();
65 }
66
67 return;
68 }
69
70 if (formObj) {
71 ed.isNotDirty = true;
72
73 if (formObj.onsubmit == null || formObj.onsubmit() != false)
74 formObj.submit();
75
76 ed.nodeChanged();
77 } else
78 ed.windowManager.alert("Error: No form element found.");
79 },
80
81 _cancel : function() {
82 var ed = this.editor, os, h = tinymce.trim(ed.startContent);
83
84 // Use callback instead
85 if (os = ed.getParam("save_oncancelcallback")) {
86 ed.execCallback('save_oncancelcallback', ed);
87 return;
88 }
89
90 ed.setContent(h);
91 ed.undoManager.clear();
92 ed.nodeChanged();
93 }
94 });
95
96 // Register plugin
97 tinymce.PluginManager.add('save', tinymce.plugins.Save);
98})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css b/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css
new file mode 100755
index 0000000..ecdf58c
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css
@@ -0,0 +1,6 @@
1.panel_wrapper {height:85px;}
2.panel_wrapper div.current {height:85px;}
3
4/* IE */
5* html .panel_wrapper {height:100px;}
6* html .panel_wrapper div.current {height:100px;}
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js b/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js
new file mode 100755
index 0000000..7fd913b
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.SearchReplacePlugin',{init:function(ed,url){function open(m){ed.windowManager.open({file:url+'/searchreplace.htm',width:420+parseInt(ed.getLang('searchreplace.delta_width',0)),height:160+parseInt(ed.getLang('searchreplace.delta_height',0)),inline:1,auto_focus:0},{mode:m,search_string:ed.selection.getContent({format:'text'}),plugin_url:url});};ed.addCommand('mceSearch',function(){open('search');});ed.addCommand('mceReplace',function(){open('replace');});ed.addButton('search',{title:'searchreplace.search_desc',cmd:'mceSearch'});ed.addButton('replace',{title:'searchreplace.replace_desc',cmd:'mceReplace'});ed.addShortcut('ctrl+f','searchreplace.search_desc','mceSearch');},getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('searchreplace',tinymce.plugins.SearchReplacePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js
new file mode 100755
index 0000000..59edc3b
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js
@@ -0,0 +1,54 @@
1/**
2 * $Id: editor_plugin_src.js 686 2008-03-09 18:13:49Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.SearchReplacePlugin', {
10 init : function(ed, url) {
11 function open(m) {
12 ed.windowManager.open({
13 file : url + '/searchreplace.htm',
14 width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),
15 height : 160 + parseInt(ed.getLang('searchreplace.delta_height', 0)),
16 inline : 1,
17 auto_focus : 0
18 }, {
19 mode : m,
20 search_string : ed.selection.getContent({format : 'text'}),
21 plugin_url : url
22 });
23 };
24
25 // Register commands
26 ed.addCommand('mceSearch', function() {
27 open('search');
28 });
29
30 ed.addCommand('mceReplace', function() {
31 open('replace');
32 });
33
34 // Register buttons
35 ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});
36 ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});
37
38 ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');
39 },
40
41 getInfo : function() {
42 return {
43 longname : 'Search/Replace',
44 author : 'Moxiecode Systems AB',
45 authorurl : 'http://tinymce.moxiecode.com',
46 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
47 version : tinymce.majorVersion + "." + tinymce.minorVersion
48 };
49 }
50 });
51
52 // Register plugin
53 tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);
54})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js
new file mode 100755
index 0000000..a8585cc
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js
@@ -0,0 +1,126 @@
1tinyMCEPopup.requireLangPack();
2
3var SearchReplaceDialog = {
4 init : function(ed) {
5 var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
6
7 this.switchMode(m);
8
9 f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
10
11 // Focus input field
12 f[m + '_panel_searchstring'].focus();
13 },
14
15 switchMode : function(m) {
16 var f, lm = this.lastMode;
17
18 if (lm != m) {
19 f = document.forms[0];
20
21 if (lm) {
22 f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
23 f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
24 f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
25 f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
26 }
27
28 mcTabs.displayTab(m + '_tab', m + '_panel');
29 document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
30 document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
31 this.lastMode = m;
32 }
33 },
34
35 searchNext : function(a) {
36 var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
37
38 // Get input
39 f = document.forms[0];
40 s = f[m + '_panel_searchstring'].value;
41 b = f[m + '_panel_backwardsu'].checked;
42 ca = f[m + '_panel_casesensitivebox'].checked;
43 rs = f['replace_panel_replacestring'].value;
44
45 if (s == '')
46 return;
47
48 function fix() {
49 // Correct Firefox graphics glitches
50 r = se.getRng().cloneRange();
51 ed.getDoc().execCommand('SelectAll', false, null);
52 se.setRng(r);
53 };
54
55 function replace() {
56 if (tinymce.isIE)
57 ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE
58 else
59 ed.getDoc().execCommand('InsertHTML', false, rs);
60 };
61
62 // IE flags
63 if (ca)
64 fl = fl | 4;
65
66 switch (a) {
67 case 'all':
68 // Move caret to beginning of text
69 ed.execCommand('SelectAll');
70 ed.selection.collapse(true);
71
72 if (tinymce.isIE) {
73 while (r.findText(s, b ? -1 : 1, fl)) {
74 r.scrollIntoView();
75 r.select();
76 replace();
77 fo = 1;
78 }
79
80 tinyMCEPopup.storeSelection();
81 } else {
82 while (w.find(s, ca, b, false, false, false, false)) {
83 replace();
84 fo = 1;
85 }
86 }
87
88 if (fo)
89 tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));
90 else
91 tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
92
93 return;
94
95 case 'current':
96 if (!ed.selection.isCollapsed())
97 replace();
98
99 break;
100 }
101
102 se.collapse(b);
103 r = se.getRng();
104
105 // Whats the point
106 if (!s)
107 return;
108
109 if (tinymce.isIE) {
110 if (r.findText(s, b ? -1 : 1, fl)) {
111 r.scrollIntoView();
112 r.select();
113 } else
114 tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
115
116 tinyMCEPopup.storeSelection();
117 } else {
118 if (!w.find(s, ca, b, false, false, false, false))
119 tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
120 else
121 fix();
122 }
123 }
124};
125
126tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js
new file mode 100755
index 0000000..370959a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js
@@ -0,0 +1,16 @@
1tinyMCE.addI18n('en.searchreplace_dlg',{
2searchnext_desc:"Find again",
3notfound:"The search has been completed. The search string could not be found.",
4search_title:"Find",
5replace_title:"Find/Replace",
6allreplaced:"All occurrences of the search string were replaced.",
7findwhat:"Find what",
8replacewith:"Replace with",
9direction:"Direction",
10up:"Up",
11down:"Down",
12mcase:"Match case",
13findnext:"Find next",
14replace:"Replace",
15replaceall:"Replace all"
16}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm b/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm
new file mode 100755
index 0000000..9c95a6a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm
@@ -0,0 +1,105 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#searchreplace_dlg.replace_title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="js/searchreplace.js"></script>
9 <link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
10 <base target="_self" />
11</head>
12<body style="display:none;">
13<form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">
14 <div class="tabs">
15 <ul>
16 <li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>
17 <li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>
18 </ul>
19 </div>
20
21 <div class="panel_wrapper">
22 <div id="search_panel" class="panel">
23 <table border="0" cellspacing="0" cellpadding="2">
24 <tr>
25 <td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
26 <td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>
27 </tr>
28 <tr>
29 <td colspan="2">
30 <table border="0" cellspacing="0" cellpadding="0" class="direction">
31 <tr>
32 <td><label>{#searchreplace_dlg.direction}</label></td>
33 <td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
34 <td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
35 <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>
36 <td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
37 </tr>
38 </table>
39 </td>
40 </tr>
41 <tr>
42 <td colspan="2">
43 <table border="0" cellspacing="0" cellpadding="0">
44 <tr>
45 <td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
46 <td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
47 </tr>
48 </table>
49 </td>
50 </tr>
51 </table>
52 </div>
53
54 <div id="replace_panel" class="panel">
55 <table border="0" cellspacing="0" cellpadding="2">
56 <tr>
57 <td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
58 <td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>
59 </tr>
60 <tr>
61 <td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>
62 <td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>
63 </tr>
64 <tr>
65 <td colspan="2">
66 <table border="0" cellspacing="0" cellpadding="0" class="direction">
67 <tr>
68 <td><label>{#searchreplace_dlg.direction}</label></td>
69 <td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
70 <td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
71 <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>
72 <td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
73 </tr>
74 </table>
75 </td>
76 </tr>
77 <tr>
78 <td colspan="2">
79 <table border="0" cellspacing="0" cellpadding="0">
80 <tr>
81 <td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
82 <td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
83 </tr>
84 </table>
85 </td>
86 </tr>
87 </table>
88 </div>
89
90 </div>
91
92 <div class="mceActionPanel">
93 <div style="float: left">
94 <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
95 <input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
96 <input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
97 </div>
98
99 <div style="float: right">
100 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
101 </div>
102 </div>
103</form>
104</body>
105</html>
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css b/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css
new file mode 100755
index 0000000..24efa02
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css
@@ -0,0 +1 @@
.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;}
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js b/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js
new file mode 100755
index 0000000..9cb6799
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js
@@ -0,0 +1 @@
(function(){var JSONRequest=tinymce.util.JSONRequest,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.SpellcheckerPlugin',{getInfo:function(){return{longname:'Spellchecker',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker',version:tinymce.majorVersion+"."+tinymce.minorVersion};},init:function(ed,url){var t=this,cm;t.url=url;t.editor=ed;ed.addCommand('mceSpellCheck',function(){if(!t.active){ed.setProgressState(1);t._sendRPC('checkWords',[t.selectedLang,t._getWords()],function(r){if(r.length>0){t.active=1;t._markWords(r);ed.setProgressState(0);ed.nodeChanged();}else{ed.setProgressState(0);ed.windowManager.alert('spellchecker.no_mpell');}});}else t._done();});ed.onInit.add(function(){if(ed.settings.content_css!==false)ed.dom.loadCSS(url+'/css/content.css');});ed.onClick.add(t._showMenu,t);ed.onContextMenu.add(t._showMenu,t);ed.onBeforeGetContent.add(function(){if(t.active)t._removeWords();});ed.onNodeChange.add(function(ed,cm){cm.setActive('spellchecker',t.active);});ed.onSetContent.add(function(){t._done();});ed.onBeforeGetContent.add(function(){t._done();});ed.onBeforeExecCommand.add(function(ed,cmd){if(cmd=='mceFullScreen')t._done();});t.languages={};each(ed.getParam('spellchecker_languages','+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv','hash'),function(v,k){if(k.indexOf('+')===0){k=k.substring(1);t.selectedLang=v;}t.languages[k]=v;});},createControl:function(n,cm){var t=this,c,ed=t.editor;if(n=='spellchecker'){c=cm.createSplitButton(n,{title:'spellchecker.desc',cmd:'mceSpellCheck',scope:t});c.onRenderMenu.add(function(c,m){m.add({title:'spellchecker.langs','class':'mceMenuItemTitle'}).setDisabled(1);each(t.languages,function(v,k){var o={icon:1},mi;o.onclick=function(){mi.setSelected(1);t.selectedItem.setSelected(0);t.selectedItem=mi;t.selectedLang=v;};o.title=k;mi=m.add(o);mi.setSelected(v==t.selectedLang);if(v==t.selectedLang)t.selectedItem=mi;})});return c;}},_walk:function(n,f){var d=this.editor.getDoc(),w;if(d.createTreeWalker){w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while((n=w.nextNode())!=null)f.call(this,n);}else tinymce.walk(n,f,'childNodes');},_getSeparators:function(){var re='',i,str=this.editor.getParam('spellchecker_word_separator_chars','\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}����������������\u201d\u201c');for(i=0;i<str.length;i++)re+='\\'+str.charAt(i);return re;},_getWords:function(){var ed=this.editor,wl=[],tx='',lo={};this._walk(ed.getBody(),function(n){if(n.nodeType==3)tx+=n.nodeValue+' ';});tx=tx.replace(new RegExp('([0-9]|['+this._getSeparators()+'])','g'),' ');tx=tinymce.trim(tx.replace(/(\s+)/g,' '));each(tx.split(' '),function(v){if(!lo[v]){wl.push(v);lo[v]=1;}});return wl;},_removeWords:function(w){var ed=this.editor,dom=ed.dom,se=ed.selection,b=se.getBookmark();each(dom.select('span').reverse(),function(n){if(n&&(dom.hasClass(n,'mceItemHiddenSpellWord')||dom.hasClass(n,'mceItemHidden'))){if(!w||dom.decode(n.innerHTML)==w)dom.remove(n,1);}});se.moveToBookmark(b);},_markWords:function(wl){var r1,r2,r3,r4,r5,w='',ed=this.editor,re=this._getSeparators(),dom=ed.dom,nl=[];var se=ed.selection,b=se.getBookmark();each(wl,function(v){w+=(w?'|':'')+v;});r1=new RegExp('(['+re+'])('+w+')(['+re+'])','g');r2=new RegExp('^('+w+')','g');r3=new RegExp('('+w+')(['+re+']?)$','g');r4=new RegExp('^('+w+')(['+re+']?)$','g');r5=new RegExp('('+w+')(['+re+'])','g');this._walk(this.editor.getBody(),function(n){if(n.nodeType==3){nl.push(n);}});each(nl,function(n){var v;if(n.nodeType==3){v=n.nodeValue;if(r1.test(v)||r2.test(v)||r3.test(v)||r4.test(v)){v=dom.encode(v);v=v.replace(r5,'<span class="mceItemHiddenSpellWord">$1</span>$2');v=v.replace(r3,'<span class="mceItemHiddenSpellWord">$1</span>$2');dom.replace(dom.create('span',{'class':'mceItemHidden'},v),n);}}});se.moveToBookmark(b);},_showMenu:function(ed,e){var t=this,ed=t.editor,m=t._menu,p1,dom=ed.dom,vp=dom.getViewPort(ed.getWin());if(!m){p1=DOM.getPos(ed.getContentAreaContainer());m=ed.controlManager.createDropMenu('spellcheckermenu',{offset_x:p1.x,offset_y:p1.y,'class':'mceNoIcons'});t._menu=m;}if(dom.hasClass(e.target,'mceItemHiddenSpellWord')){m.removeAll();m.add({title:'spellchecker.wait','class':'mceMenuItemTitle'}).setDisabled(1);t._sendRPC('getSuggestions',[t.selectedLang,dom.decode(e.target.innerHTML)],function(r){m.removeAll();if(r.length>0){m.add({title:'spellchecker.sug','class':'mceMenuItemTitle'}).setDisabled(1);each(r,function(v){m.add({title:v,onclick:function(){dom.replace(ed.getDoc().createTextNode(v),e.target);t._checkDone();}});});m.addSeparator();}else m.add({title:'spellchecker.no_sug','class':'mceMenuItemTitle'}).setDisabled(1);m.add({title:'spellchecker.ignore_word',onclick:function(){dom.remove(e.target,1);t._checkDone();}});m.add({title:'spellchecker.ignore_words',onclick:function(){t._removeWords(dom.decode(e.target.innerHTML));t._checkDone();}});m.update();});ed.selection.select(e.target);p1=dom.getPos(e.target);m.showMenu(p1.x,p1.y+e.target.offsetHeight-vp.y);return tinymce.dom.Event.cancel(e);}else m.hideMenu();},_checkDone:function(){var t=this,ed=t.editor,dom=ed.dom,o;each(dom.select('span'),function(n){if(n&&dom.hasClass(n,'mceItemHiddenSpellWord')){o=true;return false;}});if(!o)t._done();},_done:function(){var t=this,la=t.active;if(t.active){t.active=0;t._removeWords();if(t._menu)t._menu.hideMenu();if(la)t.editor.nodeChanged();}},_sendRPC:function(m,p,cb){var t=this,url=t.editor.getParam("spellchecker_rpc_url","{backend}");if(url=='{backend}'){t.editor.setProgressState(0);alert('Please specify: spellchecker_rpc_url');return;}JSONRequest.sendRPC({url:url,method:m,params:p,success:cb,error:function(e,x){t.editor.setProgressState(0);t.editor.windowManager.alert(e.errstr||('Error response: '+x.responseText));}});}});tinymce.PluginManager.add('spellchecker',tinymce.plugins.SpellcheckerPlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js
new file mode 100755
index 0000000..c913c46
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js
@@ -0,0 +1,338 @@
1/**
2 * $Id: editor_plugin_src.js 425 2007-11-21 15:17:39Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM;
10
11 tinymce.create('tinymce.plugins.SpellcheckerPlugin', {
12 getInfo : function() {
13 return {
14 longname : 'Spellchecker',
15 author : 'Moxiecode Systems AB',
16 authorurl : 'http://tinymce.moxiecode.com',
17 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker',
18 version : tinymce.majorVersion + "." + tinymce.minorVersion
19 };
20 },
21
22 init : function(ed, url) {
23 var t = this, cm;
24
25 t.url = url;
26 t.editor = ed;
27
28 // Register commands
29 ed.addCommand('mceSpellCheck', function() {
30 if (!t.active) {
31 ed.setProgressState(1);
32 t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) {
33 if (r.length > 0) {
34 t.active = 1;
35 t._markWords(r);
36 ed.setProgressState(0);
37 ed.nodeChanged();
38 } else {
39 ed.setProgressState(0);
40 ed.windowManager.alert('spellchecker.no_mpell');
41 }
42 });
43 } else
44 t._done();
45 });
46
47 ed.onInit.add(function() {
48 if (ed.settings.content_css !== false)
49 ed.dom.loadCSS(url + '/css/content.css');
50 });
51
52 ed.onClick.add(t._showMenu, t);
53 ed.onContextMenu.add(t._showMenu, t);
54 ed.onBeforeGetContent.add(function() {
55 if (t.active)
56 t._removeWords();
57 });
58
59 ed.onNodeChange.add(function(ed, cm) {
60 cm.setActive('spellchecker', t.active);
61 });
62
63 ed.onSetContent.add(function() {
64 t._done();
65 });
66
67 ed.onBeforeGetContent.add(function() {
68 t._done();
69 });
70
71 ed.onBeforeExecCommand.add(function(ed, cmd) {
72 if (cmd == 'mceFullScreen')
73 t._done();
74 });
75
76 // Find selected language
77 t.languages = {};
78 each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) {
79 if (k.indexOf('+') === 0) {
80 k = k.substring(1);
81 t.selectedLang = v;
82 }
83
84 t.languages[k] = v;
85 });
86 },
87
88 createControl : function(n, cm) {
89 var t = this, c, ed = t.editor;
90
91 if (n == 'spellchecker') {
92 c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});
93
94 c.onRenderMenu.add(function(c, m) {
95 m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
96 each(t.languages, function(v, k) {
97 var o = {icon : 1}, mi;
98
99 o.onclick = function() {
100 mi.setSelected(1);
101 t.selectedItem.setSelected(0);
102 t.selectedItem = mi;
103 t.selectedLang = v;
104 };
105
106 o.title = k;
107 mi = m.add(o);
108 mi.setSelected(v == t.selectedLang);
109
110 if (v == t.selectedLang)
111 t.selectedItem = mi;
112 })
113 });
114
115 return c;
116 }
117 },
118
119 // Internal functions
120
121 _walk : function(n, f) {
122 var d = this.editor.getDoc(), w;
123
124 if (d.createTreeWalker) {
125 w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
126
127 while ((n = w.nextNode()) != null)
128 f.call(this, n);
129 } else
130 tinymce.walk(n, f, 'childNodes');
131 },
132
133 _getSeparators : function() {
134 var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');
135
136 // Build word separator regexp
137 for (i=0; i<str.length; i++)
138 re += '\\' + str.charAt(i);
139
140 return re;
141 },
142
143 _getWords : function() {
144 var ed = this.editor, wl = [], tx = '', lo = {};
145
146 // Get area text
147 this._walk(ed.getBody(), function(n) {
148 if (n.nodeType == 3)
149 tx += n.nodeValue + ' ';
150 });
151
152 // Split words by separator
153 tx = tx.replace(new RegExp('([0-9]|[' + this._getSeparators() + '])', 'g'), ' ');
154 tx = tinymce.trim(tx.replace(/(\s+)/g, ' '));
155
156 // Build word array and remove duplicates
157 each(tx.split(' '), function(v) {
158 if (!lo[v]) {
159 wl.push(v);
160 lo[v] = 1;
161 }
162 });
163
164 return wl;
165 },
166
167 _removeWords : function(w) {
168 var ed = this.editor, dom = ed.dom, se = ed.selection, b = se.getBookmark();
169
170 each(dom.select('span').reverse(), function(n) {
171 if (n && (dom.hasClass(n, 'mceItemHiddenSpellWord') || dom.hasClass(n, 'mceItemHidden'))) {
172 if (!w || dom.decode(n.innerHTML) == w)
173 dom.remove(n, 1);
174 }
175 });
176
177 se.moveToBookmark(b);
178 },
179
180 _markWords : function(wl) {
181 var r1, r2, r3, r4, r5, w = '', ed = this.editor, re = this._getSeparators(), dom = ed.dom, nl = [];
182 var se = ed.selection, b = se.getBookmark();
183
184 each(wl, function(v) {
185 w += (w ? '|' : '') + v;
186 });
187
188 r1 = new RegExp('([' + re + '])(' + w + ')([' + re + '])', 'g');
189 r2 = new RegExp('^(' + w + ')', 'g');
190 r3 = new RegExp('(' + w + ')([' + re + ']?)$', 'g');
191 r4 = new RegExp('^(' + w + ')([' + re + ']?)$', 'g');
192 r5 = new RegExp('(' + w + ')([' + re + '])', 'g');
193
194 // Collect all text nodes
195 this._walk(this.editor.getBody(), function(n) {
196 if (n.nodeType == 3) {
197 nl.push(n);
198 }
199 });
200
201 // Wrap incorrect words in spans
202 each(nl, function(n) {
203 var v;
204
205 if (n.nodeType == 3) {
206 v = n.nodeValue;
207
208 if (r1.test(v) || r2.test(v) || r3.test(v) || r4.test(v)) {
209 v = dom.encode(v);
210 v = v.replace(r5, '<span class="mceItemHiddenSpellWord">$1</span>$2');
211 v = v.replace(r3, '<span class="mceItemHiddenSpellWord">$1</span>$2');
212
213 dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n);
214 }
215 }
216 });
217
218 se.moveToBookmark(b);
219 },
220
221 _showMenu : function(ed, e) {
222 var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin());
223
224 if (!m) {
225 p1 = DOM.getPos(ed.getContentAreaContainer());
226 //p2 = DOM.getPos(ed.getContainer());
227
228 m = ed.controlManager.createDropMenu('spellcheckermenu', {
229 offset_x : p1.x,
230 offset_y : p1.y,
231 'class' : 'mceNoIcons'
232 });
233
234 t._menu = m;
235 }
236
237 if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) {
238 m.removeAll();
239 m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
240
241 t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) {
242 m.removeAll();
243
244 if (r.length > 0) {
245 m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
246 each(r, function(v) {
247 m.add({title : v, onclick : function() {
248 dom.replace(ed.getDoc().createTextNode(v), e.target);
249 t._checkDone();
250 }});
251 });
252
253 m.addSeparator();
254 } else
255 m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
256
257 m.add({
258 title : 'spellchecker.ignore_word',
259 onclick : function() {
260 dom.remove(e.target, 1);
261 t._checkDone();
262 }
263 });
264
265 m.add({
266 title : 'spellchecker.ignore_words',
267 onclick : function() {
268 t._removeWords(dom.decode(e.target.innerHTML));
269 t._checkDone();
270 }
271 });
272
273 m.update();
274 });
275
276 ed.selection.select(e.target);
277 p1 = dom.getPos(e.target);
278 m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y);
279
280 return tinymce.dom.Event.cancel(e);
281 } else
282 m.hideMenu();
283 },
284
285 _checkDone : function() {
286 var t = this, ed = t.editor, dom = ed.dom, o;
287
288 each(dom.select('span'), function(n) {
289 if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) {
290 o = true;
291 return false;
292 }
293 });
294
295 if (!o)
296 t._done();
297 },
298
299 _done : function() {
300 var t = this, la = t.active;
301
302 if (t.active) {
303 t.active = 0;
304 t._removeWords();
305
306 if (t._menu)
307 t._menu.hideMenu();
308
309 if (la)
310 t.editor.nodeChanged();
311 }
312 },
313
314 _sendRPC : function(m, p, cb) {
315 var t = this, url = t.editor.getParam("spellchecker_rpc_url", "{backend}");
316
317 if (url == '{backend}') {
318 t.editor.setProgressState(0);
319 alert('Please specify: spellchecker_rpc_url');
320 return;
321 }
322
323 JSONRequest.sendRPC({
324 url : url,
325 method : m,
326 params : p,
327 success : cb,
328 error : function(e, x) {
329 t.editor.setProgressState(0);
330 t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText));
331 }
332 });
333 }
334 });
335
336 // Register plugin
337 tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin);
338})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif b/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif
new file mode 100755
index 0000000..7d0a4db
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif
Binary files differ
diff --git a/public/javascripts/tiny_mce/plugins/style/css/props.css b/public/javascripts/tiny_mce/plugins/style/css/props.css
new file mode 100755
index 0000000..eb1f264
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/style/css/props.css
@@ -0,0 +1,13 @@
1#text_font {width:250px;}
2#text_size {width:70px;}
3.mceAddSelectValue {background:#DDD;}
4select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;}
5#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;}
6#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;}
7#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;}
8.panel_wrapper div.current {padding-top:10px;height:230px;}
9.delim {border-left:1px solid gray;}
10.tdelim {border-bottom:1px solid gray;}
11#block_display {width:145px;}
12#list_type {width:115px;}
13.disabled {background:#EEE;}
diff --git a/public/javascripts/tiny_mce/plugins/style/editor_plugin.js b/public/javascripts/tiny_mce/plugins/style/editor_plugin.js
new file mode 100755
index 0000000..6ebaa91
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/style/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.StylePlugin',{init:function(ed,url){ed.addCommand('mceStyleProps',function(){ed.windowManager.open({file:url+'/props.htm',width:480+parseInt(ed.getLang('style.delta_width',0)),height:320+parseInt(ed.getLang('style.delta_height',0)),inline:1},{plugin_url:url,style_text:ed.selection.getNode().style.cssText});});ed.addCommand('mceSetElementStyle',function(ui,v){if(e=ed.selection.getNode()){ed.dom.setAttrib(e,'style',v);ed.execCommand('mceRepaint');}});ed.onNodeChange.add(function(ed,cm,n){cm.setDisabled('styleprops',n.nodeName==='BODY');});ed.addButton('styleprops',{title:'style.desc',cmd:'mceStyleProps'});},getInfo:function(){return{longname:'Style',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('style',tinymce.plugins.StylePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js
new file mode 100755
index 0000000..6c817ce
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js
@@ -0,0 +1,52 @@
1/**
2 * $Id: editor_plugin_src.js 787 2008-04-10 11:40:57Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.StylePlugin', {
10 init : function(ed, url) {
11 // Register commands
12 ed.addCommand('mceStyleProps', function() {
13 ed.windowManager.open({
14 file : url + '/props.htm',
15 width : 480 + parseInt(ed.getLang('style.delta_width', 0)),
16 height : 320 + parseInt(ed.getLang('style.delta_height', 0)),
17 inline : 1
18 }, {
19 plugin_url : url,
20 style_text : ed.selection.getNode().style.cssText
21 });
22 });
23
24 ed.addCommand('mceSetElementStyle', function(ui, v) {
25 if (e = ed.selection.getNode()) {
26 ed.dom.setAttrib(e, 'style', v);
27 ed.execCommand('mceRepaint');
28 }
29 });
30
31 ed.onNodeChange.add(function(ed, cm, n) {
32 cm.setDisabled('styleprops', n.nodeName === 'BODY');
33 });
34
35 // Register buttons
36 ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});
37 },
38
39 getInfo : function() {
40 return {
41 longname : 'Style',
42 author : 'Moxiecode Systems AB',
43 authorurl : 'http://tinymce.moxiecode.com',
44 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',
45 version : tinymce.majorVersion + "." + tinymce.minorVersion
46 };
47 }
48 });
49
50 // Register plugin
51 tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);
52})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/style/js/props.js b/public/javascripts/tiny_mce/plugins/style/js/props.js
new file mode 100755
index 0000000..cafd6b1
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/style/js/props.js
@@ -0,0 +1,641 @@
1tinyMCEPopup.requireLangPack();
2
3var defaultFonts = "" +
4 "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" +
5 "Times New Roman, Times, serif=Times New Roman, Times, serif;" +
6 "Courier New, Courier, mono=Courier New, Courier, mono;" +
7 "Times New Roman, Times, serif=Times New Roman, Times, serif;" +
8 "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" +
9 "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" +
10 "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";
11
12var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";
13var defaultMeasurement = "+pixels=px;points=pt;em;in;cm;mm;picas;ems;exs;%";
14var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%";
15var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%";
16var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";
17var defaultTextStyle = "normal;italic;oblique";
18var defaultVariant = "normal;small-caps";
19var defaultLineHeight = "normal";
20var defaultAttachment = "fixed;scroll";
21var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y";
22var defaultPosH = "left;center;right";
23var defaultPosV = "top;center;bottom";
24var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom";
25var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none";
26var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset";
27var defaultBorderWidth = "thin;medium;thick";
28var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none";
29
30function init() {
31 var ce = document.getElementById('container'), h;
32
33 ce.style.cssText = tinyMCEPopup.getWindowArg('style_text');
34
35 h = getBrowserHTML('background_image_browser','background_image','image','advimage');
36 document.getElementById("background_image_browser").innerHTML = h;
37
38 document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color');
39 document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color');
40 document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top');
41 document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right');
42 document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');
43 document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left');
44
45 fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true);
46 fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true);
47 fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true);
48 fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true);
49 fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true);
50 fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true);
51 fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true);
52 fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true);
53 fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true);
54
55 fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true);
56 fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true);
57
58 fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true);
59 fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true);
60
61 fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true);
62 fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true);
63
64 fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true);
65 fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true);
66 fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true);
67 fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true);
68 fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true);
69 fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true);
70 fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true);
71 fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true);
72 fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true);
73
74 fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true);
75 fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true);
76 fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true);
77 fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true);
78 fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true);
79 fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true);
80 fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true);
81 fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true);
82 fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true);
83 fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true);
84 fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true);
85 fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true);
86
87 fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true);
88 fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true);
89 fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true);
90 fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true);
91
92 fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true);
93 fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true);
94 fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true);
95 fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true);
96
97 fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true);
98 fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true);
99 fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true);
100 fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true);
101
102 fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true);
103 fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true);
104
105 fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true);
106 fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true);
107
108 fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true);
109 fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true);
110 fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true);
111
112 fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true);
113 fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true);
114 fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true);
115 fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true);
116
117 fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true);
118 fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true);
119 fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true);
120 fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true);
121
122 TinyMCE_EditableSelects.init();
123 setupFormData();
124 showDisabledControls();
125}
126
127function setupFormData() {
128 var ce = document.getElementById('container'), f = document.forms[0], s, b, i;
129
130 // Setup text fields
131
132 selectByValue(f, 'text_font', ce.style.fontFamily, true, true);
133 selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true);
134 selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize));
135 selectByValue(f, 'text_weight', ce.style.fontWeight, true, true);
136 selectByValue(f, 'text_style', ce.style.fontStyle, true, true);
137 selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true);
138 selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight));
139 selectByValue(f, 'text_case', ce.style.textTransform, true, true);
140 selectByValue(f, 'text_variant', ce.style.fontVariant, true, true);
141 f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color);
142 updateColor('text_color_pick', 'text_color');
143 f.text_underline.checked = inStr(ce.style.textDecoration, 'underline');
144 f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');
145 f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');
146 f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');
147
148 // Setup background fields
149
150 f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor);
151 updateColor('background_color_pick', 'background_color');
152 f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
153 selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true);
154 selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true);
155 selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true);
156 selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0)));
157 selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true);
158 selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1)));
159
160 // Setup block fields
161
162 selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true);
163 selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing));
164 selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true);
165 selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing));
166 selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true);
167 selectByValue(f, 'block_text_align', ce.style.textAlign, true, true);
168 f.block_text_indent.value = getNum(ce.style.textIndent);
169 selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent));
170 selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true);
171 selectByValue(f, 'block_display', ce.style.display, true, true);
172
173 // Setup box fields
174
175 f.box_width.value = getNum(ce.style.width);
176 selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width));
177
178 f.box_height.value = getNum(ce.style.height);
179 selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));
180
181 if (tinymce.isGecko)
182 selectByValue(f, 'box_float', ce.style.cssFloat, true, true);
183 else
184 selectByValue(f, 'box_float', ce.style.styleFloat, true, true);
185
186 selectByValue(f, 'box_clear', ce.style.clear, true, true);
187
188 setupBox(f, ce, 'box_padding', 'padding', '');
189 setupBox(f, ce, 'box_margin', 'margin', '');
190
191 // Setup border fields
192
193 setupBox(f, ce, 'border_style', 'border', 'Style');
194 setupBox(f, ce, 'border_width', 'border', 'Width');
195 setupBox(f, ce, 'border_color', 'border', 'Color');
196
197 updateColor('border_color_top_pick', 'border_color_top');
198 updateColor('border_color_right_pick', 'border_color_right');
199 updateColor('border_color_bottom_pick', 'border_color_bottom');
200 updateColor('border_color_left_pick', 'border_color_left');
201
202 f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value);
203 f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value);
204 f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value);
205 f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value);
206
207 // Setup list fields
208
209 selectByValue(f, 'list_type', ce.style.listStyleType, true, true);
210 selectByValue(f, 'list_position', ce.style.listStylePosition, true, true);
211 f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
212
213 // Setup box fields
214
215 selectByValue(f, 'positioning_type', ce.style.position, true, true);
216 selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true);
217 selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true);
218 f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : "";
219
220 f.positioning_width.value = getNum(ce.style.width);
221 selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));
222
223 f.positioning_height.value = getNum(ce.style.height);
224 selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
225
226 setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']);
227
228 s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
229 s = s.replace(/,/g, ' ');
230
231 if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) {
232 f.positioning_clip_top.value = getNum(getVal(s, 0));
233 selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
234 f.positioning_clip_right.value = getNum(getVal(s, 1));
235 selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));
236 f.positioning_clip_bottom.value = getNum(getVal(s, 2));
237 selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2)));
238 f.positioning_clip_left.value = getNum(getVal(s, 3));
239 selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3)));
240 } else {
241 f.positioning_clip_top.value = getNum(getVal(s, 0));
242 selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
243 f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value;
244 }
245
246// setupBox(f, ce, '', 'border', 'Color');
247}
248
249function getMeasurement(s) {
250 return s.replace(/^([0-9]+)(.*)$/, "$2");
251}
252
253function getNum(s) {
254 if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s))
255 return s.replace(/[^0-9]/g, '');
256
257 return s;
258}
259
260function inStr(s, n) {
261 return new RegExp(n, 'gi').test(s);
262}
263
264function getVal(s, i) {
265 var a = s.split(' ');
266
267 if (a.length > 1)
268 return a[i];
269
270 return "";
271}
272
273function setValue(f, n, v) {
274 if (f.elements[n].type == "text")
275 f.elements[n].value = v;
276 else
277 selectByValue(f, n, v, true, true);
278}
279
280function setupBox(f, ce, fp, pr, sf, b) {
281 if (typeof(b) == "undefined")
282 b = ['Top', 'Right', 'Bottom', 'Left'];
283
284 if (isSame(ce, pr, sf, b)) {
285 f.elements[fp + "_same"].checked = true;
286
287 setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
288 f.elements[fp + "_top"].disabled = false;
289
290 f.elements[fp + "_right"].value = "";
291 f.elements[fp + "_right"].disabled = true;
292 f.elements[fp + "_bottom"].value = "";
293 f.elements[fp + "_bottom"].disabled = true;
294 f.elements[fp + "_left"].value = "";
295 f.elements[fp + "_left"].disabled = true;
296
297 if (f.elements[fp + "_top_measurement"]) {
298 selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
299 f.elements[fp + "_left_measurement"].disabled = true;
300 f.elements[fp + "_bottom_measurement"].disabled = true;
301 f.elements[fp + "_right_measurement"].disabled = true;
302 }
303 } else {
304 f.elements[fp + "_same"].checked = false;
305
306 setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
307 f.elements[fp + "_top"].disabled = false;
308
309 setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf]));
310 f.elements[fp + "_right"].disabled = false;
311
312 setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf]));
313 f.elements[fp + "_bottom"].disabled = false;
314
315 setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf]));
316 f.elements[fp + "_left"].disabled = false;
317
318 if (f.elements[fp + "_top_measurement"]) {
319 selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
320 selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf]));
321 selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf]));
322 selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf]));
323 f.elements[fp + "_left_measurement"].disabled = false;
324 f.elements[fp + "_bottom_measurement"].disabled = false;
325 f.elements[fp + "_right_measurement"].disabled = false;
326 }
327 }
328}
329
330function isSame(e, pr, sf, b) {
331 var a = [], i, x;
332
333 if (typeof(b) == "undefined")
334 b = ['Top', 'Right', 'Bottom', 'Left'];
335
336 if (typeof(sf) == "undefined" || sf == null)
337 sf = "";
338
339 a[0] = e.style[pr + b[0] + sf];
340 a[1] = e.style[pr + b[1] + sf];
341 a[2] = e.style[pr + b[2] + sf];
342 a[3] = e.style[pr + b[3] + sf];
343
344 for (i=0; i<a.length; i++) {
345 if (a[i] == null)
346 return false;
347
348 for (x=0; x<a.length; x++) {
349 if (a[x] != a[i])
350 return false;
351 }
352 }
353
354 return true;
355};
356
357function hasEqualValues(a) {
358 var i, x;
359
360 for (i=0; i<a.length; i++) {
361 if (a[i] == null)
362 return false;
363
364 for (x=0; x<a.length; x++) {
365 if (a[x] != a[i])
366 return false;
367 }
368 }
369
370 return true;
371}
372
373function applyAction() {
374 var ce = document.getElementById('container'), ed = tinyMCEPopup.editor;
375
376 generateCSS();
377
378 tinyMCEPopup.restoreSelection();
379 ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText)));
380}
381
382function updateAction() {
383 applyAction();
384 tinyMCEPopup.close();
385}
386
387function generateCSS() {
388 var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t;
389
390 ce.style.cssText = "";
391
392 // Build text styles
393 ce.style.fontFamily = f.text_font.value;
394 ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : "");
395 ce.style.fontStyle = f.text_style.value;
396 ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : "");
397 ce.style.textTransform = f.text_case.value;
398 ce.style.fontWeight = f.text_weight.value;
399 ce.style.fontVariant = f.text_variant.value;
400 ce.style.color = f.text_color.value;
401
402 s = "";
403 s += f.text_underline.checked ? " underline" : "";
404 s += f.text_overline.checked ? " overline" : "";
405 s += f.text_linethrough.checked ? " line-through" : "";
406 s += f.text_blink.checked ? " blink" : "";
407 s = s.length > 0 ? s.substring(1) : s;
408
409 if (f.text_none.checked)
410 s = "none";
411
412 ce.style.textDecoration = s;
413
414 // Build background styles
415
416 ce.style.backgroundColor = f.background_color.value;
417 ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : "";
418 ce.style.backgroundRepeat = f.background_repeat.value;
419 ce.style.backgroundAttachment = f.background_attachment.value;
420
421 if (f.background_hpos.value != "") {
422 s = "";
423 s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " ";
424 s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : "");
425 ce.style.backgroundPosition = s;
426 }
427
428 // Build block styles
429
430 ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : "");
431 ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : "");
432 ce.style.verticalAlign = f.block_vertical_alignment.value;
433 ce.style.textAlign = f.block_text_align.value;
434 ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : "");
435 ce.style.whiteSpace = f.block_whitespace.value;
436 ce.style.display = f.block_display.value;
437
438 // Build box styles
439
440 ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");
441 ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");
442 ce.style.styleFloat = f.box_float.value;
443
444 if (tinymce.isGecko)
445 ce.style.cssFloat = f.box_float.value;
446
447 ce.style.clear = f.box_clear.value;
448
449 if (!f.box_padding_same.checked) {
450 ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
451 ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : "");
452 ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : "");
453 ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : "");
454 } else
455 ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
456
457 if (!f.box_margin_same.checked) {
458 ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
459 ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : "");
460 ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : "");
461 ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : "");
462 } else
463 ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
464
465 // Build border styles
466
467 if (!f.border_style_same.checked) {
468 ce.style.borderTopStyle = f.border_style_top.value;
469 ce.style.borderRightStyle = f.border_style_right.value;
470 ce.style.borderBottomStyle = f.border_style_bottom.value;
471 ce.style.borderLeftStyle = f.border_style_left.value;
472 } else
473 ce.style.borderStyle = f.border_style_top.value;
474
475 if (!f.border_width_same.checked) {
476 ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");
477 ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : "");
478 ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");
479 ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");
480 } else
481 ce.style.borderWidth = f.border_width_top.value;
482
483 if (!f.border_color_same.checked) {
484 ce.style.borderTopColor = f.border_color_top.value;
485 ce.style.borderRightColor = f.border_color_right.value;
486 ce.style.borderBottomColor = f.border_color_bottom.value;
487 ce.style.borderLeftColor = f.border_color_left.value;
488 } else
489 ce.style.borderColor = f.border_color_top.value;
490
491 // Build list styles
492
493 ce.style.listStyleType = f.list_type.value;
494 ce.style.listStylePosition = f.list_position.value;
495 ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : "";
496
497 // Build positioning styles
498
499 ce.style.position = f.positioning_type.value;
500 ce.style.visibility = f.positioning_visibility.value;
501
502 if (ce.style.width == "")
503 ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : "");
504
505 if (ce.style.height == "")
506 ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : "");
507
508 ce.style.zIndex = f.positioning_zindex.value;
509 ce.style.overflow = f.positioning_overflow.value;
510
511 if (!f.positioning_placement_same.checked) {
512 ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
513 ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : "");
514 ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : "");
515 ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : "");
516 } else {
517 s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
518 ce.style.top = s;
519 ce.style.right = s;
520 ce.style.bottom = s;
521 ce.style.left = s;
522 }
523
524 if (!f.positioning_clip_same.checked) {
525 s = "rect(";
526 s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " ";
527 s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " ";
528 s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " ";
529 s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto");
530 s += ")";
531
532 if (s != "rect(auto auto auto auto)")
533 ce.style.clip = s;
534 } else {
535 s = "rect(";
536 t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto";
537 s += t + " ";
538 s += t + " ";
539 s += t + " ";
540 s += t + ")";
541
542 if (s != "rect(auto auto auto auto)")
543 ce.style.clip = s;
544 }
545
546 ce.style.cssText = ce.style.cssText;
547}
548
549function isNum(s) {
550 return new RegExp('[0-9]+', 'g').test(s);
551}
552
553function showDisabledControls() {
554 var f = document.forms, i, a;
555
556 for (i=0; i<f.length; i++) {
557 for (a=0; a<f[i].elements.length; a++) {
558 if (f[i].elements[a].disabled)
559 tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled");
560 else
561 tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled");
562 }
563 }
564}
565
566function fillSelect(f, s, param, dval, sep, em) {
567 var i, ar, p, se;
568
569 f = document.forms[f];
570 sep = typeof(sep) == "undefined" ? ";" : sep;
571
572 if (em)
573 addSelectValue(f, s, "", "");
574
575 ar = tinyMCEPopup.getParam(param, dval).split(sep);
576 for (i=0; i<ar.length; i++) {
577 se = false;
578
579 if (ar[i].charAt(0) == '+') {
580 ar[i] = ar[i].substring(1);
581 se = true;
582 }
583
584 p = ar[i].split('=');
585
586 if (p.length > 1) {
587 addSelectValue(f, s, p[0], p[1]);
588
589 if (se)
590 selectByValue(f, s, p[1]);
591 } else {
592 addSelectValue(f, s, p[0], p[0]);
593
594 if (se)
595 selectByValue(f, s, p[0]);
596 }
597 }
598}
599
600function toggleSame(ce, pre) {
601 var el = document.forms[0].elements, i;
602
603 if (ce.checked) {
604 el[pre + "_top"].disabled = false;
605 el[pre + "_right"].disabled = true;
606 el[pre + "_bottom"].disabled = true;
607 el[pre + "_left"].disabled = true;
608
609 if (el[pre + "_top_measurement"]) {
610 el[pre + "_top_measurement"].disabled = false;
611 el[pre + "_right_measurement"].disabled = true;
612 el[pre + "_bottom_measurement"].disabled = true;
613 el[pre + "_left_measurement"].disabled = true;
614 }
615 } else {
616 el[pre + "_top"].disabled = false;
617 el[pre + "_right"].disabled = false;
618 el[pre + "_bottom"].disabled = false;
619 el[pre + "_left"].disabled = false;
620
621 if (el[pre + "_top_measurement"]) {
622 el[pre + "_top_measurement"].disabled = false;
623 el[pre + "_right_measurement"].disabled = false;
624 el[pre + "_bottom_measurement"].disabled = false;
625 el[pre + "_left_measurement"].disabled = false;
626 }
627 }
628
629 showDisabledControls();
630}
631
632function synch(fr, to) {
633 var f = document.forms[0];
634
635 f.elements[to].value = f.elements[fr].value;
636
637 if (f.elements[fr + "_measurement"])
638 selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);
639}
640
641tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js
new file mode 100755
index 0000000..5026313
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js
@@ -0,0 +1,63 @@
1tinyMCE.addI18n('en.style_dlg',{
2title:"Edit CSS Style",
3apply:"Apply",
4text_tab:"Text",
5background_tab:"Background",
6block_tab:"Block",
7box_tab:"Box",
8border_tab:"Border",
9list_tab:"List",
10positioning_tab:"Positioning",
11text_props:"Text",
12text_font:"Font",
13text_size:"Size",
14text_weight:"Weight",
15text_style:"Style",
16text_variant:"Variant",
17text_lineheight:"Line height",
18text_case:"Case",
19text_color:"Color",
20text_decoration:"Decoration",
21text_overline:"overline",
22text_underline:"underline",
23text_striketrough:"strikethrough",
24text_blink:"blink",
25text_none:"none",
26background_color:"Background color",
27background_image:"Background image",
28background_repeat:"Repeat",
29background_attachment:"Attachment",
30background_hpos:"Horizontal position",
31background_vpos:"Vertical position",
32block_wordspacing:"Word spacing",
33block_letterspacing:"Letter spacing",
34block_vertical_alignment:"Vertical alignment",
35block_text_align:"Text align",
36block_text_indent:"Text indent",
37block_whitespace:"Whitespace",
38block_display:"Display",
39box_width:"Width",
40box_height:"Height",
41box_float:"Float",
42box_clear:"Clear",
43padding:"Padding",
44same:"Same for all",
45top:"Top",
46right:"Right",
47bottom:"Bottom",
48left:"Left",
49margin:"Margin",
50style:"Style",
51width:"Width",
52height:"Height",
53color:"Color",
54list_type:"Type",
55bullet_image:"Bullet image",
56position:"Position",
57positioning_type:"Type",
58visibility:"Visibility",
59zindex:"Z-index",
60overflow:"Overflow",
61placement:"Placement",
62clip:"Clip"
63}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/style/props.htm b/public/javascripts/tiny_mce/plugins/style/props.htm
new file mode 100755
index 0000000..54538e3
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/style/props.htm
@@ -0,0 +1,731 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#style_dlg.title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
8 <script type="text/javascript" src="../../utils/form_utils.js"></script>
9 <script type="text/javascript" src="js/props.js"></script>
10 <link href="css/props.css" rel="stylesheet" type="text/css" />
11 <base target="_self" />
12</head>
13
14<body id="styleprops" style="display: none">
15<form onsubmit="updateAction();return false;" action="#">
16<div class="tabs">
17 <ul>
18 <li id="text_tab" class="current"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li>
19 <li id="background_tab"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li>
20 <li id="block_tab"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li>
21 <li id="box_tab"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li>
22 <li id="border_tab"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li>
23 <li id="list_tab"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li>
24 <li id="positioning_tab"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li>
25 </ul>
26</div>
27
28<div class="panel_wrapper">
29<div id="text_panel" class="panel current">
30 <table border="0" width="100%">
31 <tr>
32 <td><label for="text_font">{#style_dlg.text_font}</label></td>
33 <td colspan="3">
34 <select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select>
35 </td>
36 </tr>
37 <tr>
38 <td><label for="text_size">{#style_dlg.text_size}</label></td>
39 <td>
40 <table border="0" cellspacing="0" cellpadding="0">
41 <tr>
42 <td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
43 <td>&nbsp;</td>
44 <td><select id="text_size_measurement" name="text_size_measurement"></select></td>
45 </tr>
46 </table>
47 </td>
48 <td><label for="text_weight">{#style_dlg.text_weight}</label></td>
49 <td>
50 <select id="text_weight" name="text_weight"></select>
51 </td>
52 </tr>
53 <tr>
54 <td><label for="text_style">{#style_dlg.text_style}</label></td>
55 <td>
56 <select id="text_style" name="text_style" class="mceEditableSelect"></select>
57 </td>
58 <td><label for="text_variant">{#style_dlg.text_variant}</label></td>
59 <td>
60 <select id="text_variant" name="text_variant"></select>
61 </td>
62 </tr>
63 <tr>
64 <td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
65 <td>
66 <table border="0" cellspacing="0" cellpadding="0">
67 <tr>
68 <td>
69 <select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
70 </td>
71 <td>&nbsp;</td>
72 <td><select id="text_lineheight_measurement" name="text_lineheight_measurement"></select></td>
73 </tr>
74 </table>
75 </td>
76 <td><label for="text_case">{#style_dlg.text_case}</label></td>
77 <td>
78 <select id="text_case" name="text_case"></select>
79 </td>
80 </tr>
81 <tr>
82 <td><label for="text_color">{#style_dlg.text_color}</label></td>
83 <td colspan="2">
84 <table border="0" cellpadding="0" cellspacing="0">
85 <tr>
86 <td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td>
87 <td id="text_color_pickcontainer">&nbsp;</td>
88 </tr>
89 </table>
90 </td>
91 </tr>
92 <tr>
93 <td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
94 <td colspan="2">
95 <table border="0" cellspacing="0" cellpadding="0">
96 <tr>
97 <td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
98 <td><label for="text_underline">{#style_dlg.text_underline}</label></td>
99 </tr>
100 <tr>
101 <td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
102 <td><label for="text_overline">{#style_dlg.text_overline}</label></td>
103 </tr>
104 <tr>
105 <td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
106 <td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
107 </tr>
108 <tr>
109 <td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
110 <td><label for="text_blink">{#style_dlg.text_blink}</label></td>
111 </tr>
112 <tr>
113 <td><input id="text_none" name="text_none" class="checkbox" type="checkbox" /></td>
114 <td><label for="text_none">{#style_dlg.text_none}</label></td>
115 </tr>
116 </table>
117 </td>
118 </tr>
119 </table>
120</div>
121
122<div id="background_panel" class="panel">
123 <table border="0">
124 <tr>
125 <td><label for="background_color">{#style_dlg.background_color}</label></td>
126 <td>
127 <table border="0" cellpadding="0" cellspacing="0">
128 <tr>
129 <td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td>
130 <td id="background_color_pickcontainer">&nbsp;</td>
131 </tr>
132 </table>
133 </td>
134 </tr>
135
136 <tr>
137 <td><label for="background_image">{#style_dlg.background_image}</label></td>
138 <td><table border="0" cellspacing="0" cellpadding="0">
139 <tr>
140 <td><input id="background_image" name="background_image" type="text" /></td>
141 <td id="background_image_browser">&nbsp;</td>
142 </tr>
143 </table>
144 </td>
145 </tr>
146
147 <tr>
148 <td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
149 <td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
150 </tr>
151
152 <tr>
153 <td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
154 <td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
155 </tr>
156
157 <tr>
158 <td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
159 <td>
160 <table border="0" cellspacing="0" cellpadding="0">
161 <tr>
162 <td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
163 <td>&nbsp;</td>
164 <td><select id="background_hpos_measurement" name="background_hpos_measurement"></select></td>
165 </tr>
166 </table>
167 </td>
168 </tr>
169
170 <tr>
171 <td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
172 <td>
173 <table border="0" cellspacing="0" cellpadding="0">
174 <tr>
175 <td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
176 <td>&nbsp;</td>
177 <td><select id="background_vpos_measurement" name="background_vpos_measurement"></select></td>
178 </tr>
179 </table>
180 </td>
181 </tr>
182 </table>
183</div>
184
185<div id="block_panel" class="panel">
186 <table border="0">
187 <tr>
188 <td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
189 <td>
190 <table border="0" cellspacing="0" cellpadding="0">
191 <tr>
192 <td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
193 <td>&nbsp;</td>
194 <td><select id="block_wordspacing_measurement" name="block_wordspacing_measurement"></select></td>
195 </tr>
196 </table>
197 </td>
198 </tr>
199
200 <tr>
201 <td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
202 <td>
203 <table border="0" cellspacing="0" cellpadding="0">
204 <tr>
205 <td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
206 <td>&nbsp;</td>
207 <td><select id="block_letterspacing_measurement" name="block_letterspacing_measurement"></select></td>
208 </tr>
209 </table>
210 </td>
211 </tr>
212
213 <tr>
214 <td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
215 <td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
216 </tr>
217
218 <tr>
219 <td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
220 <td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
221 </tr>
222
223 <tr>
224 <td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
225 <td>
226 <table border="0" cellspacing="0" cellpadding="0">
227 <tr>
228 <td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
229 <td>&nbsp;</td>
230 <td><select id="block_text_indent_measurement" name="block_text_indent_measurement"></select></td>
231 </tr>
232 </table>
233 </td>
234 </tr>
235
236 <tr>
237 <td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
238 <td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
239 </tr>
240
241 <tr>
242 <td><label for="block_display">{#style_dlg.block_display}</label></td>
243 <td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
244 </tr>
245 </table>
246</div>
247
248<div id="box_panel" class="panel">
249<table border="0">
250 <tr>
251 <td><label for="box_width">{#style_dlg.box_width}</label></td>
252 <td>
253 <table border="0" cellspacing="0" cellpadding="0">
254 <tr>
255 <td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td>
256 <td>&nbsp;</td>
257 <td><select id="box_width_measurement" name="box_width_measurement"></select></td>
258 </tr>
259 </table>
260 </td>
261 <td>&nbsp;&nbsp;&nbsp;<label for="box_float">{#style_dlg.box_float}</label></td>
262 <td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
263 </tr>
264
265 <tr>
266 <td><label for="box_height">{#style_dlg.box_height}</label></td>
267 <td>
268 <table border="0" cellspacing="0" cellpadding="0">
269 <tr>
270 <td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td>
271 <td>&nbsp;</td>
272 <td><select id="box_height_measurement" name="box_height_measurement"></select></td>
273 </tr>
274 </table>
275 </td>
276 <td>&nbsp;&nbsp;&nbsp;<label for="box_clear">{#style_dlg.box_clear}</label></td>
277 <td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
278 </tr>
279</table>
280<div style="float: left; width: 49%">
281 <fieldset>
282 <legend>{#style_dlg.padding}</legend>
283
284 <table border="0">
285 <tr>
286 <td>&nbsp;</td>
287 <td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
288 </tr>
289 <tr>
290 <td><label for="box_padding_top">{#style_dlg.top}</label></td>
291 <td>
292 <table border="0" cellspacing="0" cellpadding="0">
293 <tr>
294 <td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
295 <td>&nbsp;</td>
296 <td><select id="box_padding_top_measurement" name="box_padding_top_measurement"></select></td>
297 </tr>
298 </table>
299 </td>
300 </tr>
301 <tr>
302 <td><label for="box_padding_right">{#style_dlg.right}</label></td>
303 <td>
304 <table border="0" cellspacing="0" cellpadding="0">
305 <tr>
306 <td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
307 <td>&nbsp;</td>
308 <td><select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled"></select></td>
309 </tr>
310 </table>
311 </td>
312 </tr>
313 <tr>
314 <td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
315 <td>
316 <table border="0" cellspacing="0" cellpadding="0">
317 <tr>
318 <td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
319 <td>&nbsp;</td>
320 <td><select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled"></select></td>
321 </tr>
322 </table>
323 </td>
324 </tr>
325 <tr>
326 <td><label for="box_padding_left">{#style_dlg.left}</label></td>
327 <td>
328 <table border="0" cellspacing="0" cellpadding="0">
329 <tr>
330 <td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
331 <td>&nbsp;</td>
332 <td><select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled"></select></td>
333 </tr>
334 </table>
335 </td>
336 </tr>
337 </table>
338 </fieldset>
339</div>
340
341<div style="float: right; width: 49%">
342 <fieldset>
343 <legend>{#style_dlg.margin}</legend>
344
345 <table border="0">
346 <tr>
347 <td>&nbsp;</td>
348 <td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
349 </tr>
350 <tr>
351 <td><label for="box_margin_top">{#style_dlg.top}</label></td>
352 <td>
353 <table border="0" cellspacing="0" cellpadding="0">
354 <tr>
355 <td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
356 <td>&nbsp;</td>
357 <td><select id="box_margin_top_measurement" name="box_margin_top_measurement"></select></td>
358 </tr>
359 </table>
360 </td>
361 </tr>
362 <tr>
363 <td><label for="box_margin_right">{#style_dlg.right}</label></td>
364 <td>
365 <table border="0" cellspacing="0" cellpadding="0">
366 <tr>
367 <td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
368 <td>&nbsp;</td>
369 <td><select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled"></select></td>
370 </tr>
371 </table>
372 </td>
373 </tr>
374 <tr>
375 <td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
376 <td>
377 <table border="0" cellspacing="0" cellpadding="0">
378 <tr>
379 <td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
380 <td>&nbsp;</td>
381 <td><select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled"></select></td>
382 </tr>
383 </table>
384 </td>
385 </tr>
386 <tr>
387 <td><label for="box_margin_left">{#style_dlg.left}</label></td>
388 <td>
389 <table border="0" cellspacing="0" cellpadding="0">
390 <tr>
391 <td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
392 <td>&nbsp;</td>
393 <td><select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled"></select></td>
394 </tr>
395 </table>
396 </td>
397 </tr>
398 </table>
399 </fieldset>
400</div>
401<br style="clear: both" />
402</div>
403
404<div id="border_panel" class="panel">
405<table border="0" cellspacing="0" cellpadding="0" width="100%">
406<tr>
407 <td class="tdelim">&nbsp;</td>
408 <td class="tdelim delim">&nbsp;</td>
409 <td class="tdelim">{#style_dlg.style}</td>
410 <td class="tdelim delim">&nbsp;</td>
411 <td class="tdelim">{#style_dlg.width}</td>
412 <td class="tdelim delim">&nbsp;</td>
413 <td class="tdelim">{#style_dlg.color}</td>
414</tr>
415
416<tr>
417 <td>&nbsp;</td>
418 <td class="delim">&nbsp;</td>
419 <td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
420 <td class="delim">&nbsp;</td>
421 <td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
422 <td class="delim">&nbsp;</td>
423 <td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
424</tr>
425
426<tr>
427 <td>{#style_dlg.top}</td>
428 <td class="delim">&nbsp;</td>
429 <td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
430 <td class="delim">&nbsp;</td>
431 <td>
432 <table border="0" cellspacing="0" cellpadding="0">
433 <tr>
434 <td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
435 <td>&nbsp;</td>
436 <td><select id="border_width_top_measurement" name="border_width_top_measurement"></select></td>
437 </tr>
438 </table>
439 </td>
440 <td class="delim">&nbsp;</td>
441 <td>
442 <table border="0" cellpadding="0" cellspacing="0">
443 <tr>
444 <td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td>
445 <td id="border_color_top_pickcontainer">&nbsp;</td>
446 </tr>
447 </table>
448 </td>
449</tr>
450
451<tr>
452 <td>{#style_dlg.right}</td>
453 <td class="delim">&nbsp;</td>
454 <td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
455 <td class="delim">&nbsp;</td>
456 <td>
457 <table border="0" cellspacing="0" cellpadding="0">
458 <tr>
459 <td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
460 <td>&nbsp;</td>
461 <td><select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled"></select></td>
462 </tr>
463 </table>
464 </td>
465 <td class="delim">&nbsp;</td>
466 <td>
467 <table border="0" cellpadding="0" cellspacing="0">
468 <tr>
469 <td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
470 <td id="border_color_right_pickcontainer">&nbsp;</td>
471 </tr>
472 </table>
473 </td>
474</tr>
475
476<tr>
477 <td>{#style_dlg.bottom}</td>
478 <td class="delim">&nbsp;</td>
479 <td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
480 <td class="delim">&nbsp;</td>
481 <td>
482 <table border="0" cellspacing="0" cellpadding="0">
483 <tr>
484 <td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
485 <td>&nbsp;</td>
486 <td><select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled"></select></td>
487 </tr>
488 </table>
489 </td>
490 <td class="delim">&nbsp;</td>
491 <td>
492 <table border="0" cellpadding="0" cellspacing="0">
493 <tr>
494 <td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
495 <td id="border_color_bottom_pickcontainer">&nbsp;</td>
496 </tr>
497 </table>
498 </td>
499</tr>
500
501<tr>
502 <td>{#style_dlg.left}</td>
503 <td class="delim">&nbsp;</td>
504 <td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
505 <td class="delim">&nbsp;</td>
506 <td>
507 <table border="0" cellspacing="0" cellpadding="0">
508 <tr>
509 <td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
510 <td>&nbsp;</td>
511 <td><select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled"></select></td>
512 </tr>
513 </table>
514 </td>
515 <td class="delim">&nbsp;</td>
516 <td>
517 <table border="0" cellpadding="0" cellspacing="0">
518 <tr>
519 <td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
520 <td id="border_color_left_pickcontainer">&nbsp;</td>
521 </tr>
522 </table>
523 </td>
524</tr>
525</table>
526</div>
527
528<div id="list_panel" class="panel">
529 <table border="0">
530 <tr>
531 <td><label for="list_type">{#style_dlg.list_type}</label></td>
532 <td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
533 </tr>
534
535 <tr>
536 <td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
537 <td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
538 </tr>
539
540 <tr>
541 <td><label for="list_position">{#style_dlg.position}</label></td>
542 <td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
543 </tr>
544 </table>
545</div>
546
547<div id="positioning_panel" class="panel">
548<table border="0">
549 <tr>
550 <td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
551 <td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
552 <td>&nbsp;&nbsp;&nbsp;<label for="positioning_visibility">{#style_dlg.visibility}</label></td>
553 <td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
554 </tr>
555
556 <tr>
557 <td><label for="positioning_width">{#style_dlg.width}</label></td>
558 <td>
559 <table border="0" cellspacing="0" cellpadding="0">
560 <tr>
561 <td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td>
562 <td>&nbsp;</td>
563 <td><select id="positioning_width_measurement" name="positioning_width_measurement"></select></td>
564 </tr>
565 </table>
566 </td>
567 <td>&nbsp;&nbsp;&nbsp;<label for="positioning_zindex">{#style_dlg.zindex}</label></td>
568 <td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
569 </tr>
570
571 <tr>
572 <td><label for="positioning_height">{#style_dlg.height}</label></td>
573 <td>
574 <table border="0" cellspacing="0" cellpadding="0">
575 <tr>
576 <td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td>
577 <td>&nbsp;</td>
578 <td><select id="positioning_height_measurement" name="positioning_height_measurement"></select></td>
579 </tr>
580 </table>
581 </td>
582 <td>&nbsp;&nbsp;&nbsp;<label for="positioning_overflow">{#style_dlg.overflow}</label></td>
583 <td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
584 </tr>
585</table>
586
587<div style="float: left; width: 49%">
588 <fieldset>
589 <legend>{#style_dlg.placement}</legend>
590
591 <table border="0">
592 <tr>
593 <td>&nbsp;</td>
594 <td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
595 </tr>
596 <tr>
597 <td>{#style_dlg.top}</td>
598 <td>
599 <table border="0" cellspacing="0" cellpadding="0">
600 <tr>
601 <td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
602 <td>&nbsp;</td>
603 <td><select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement"></select></td>
604 </tr>
605 </table>
606 </td>
607 </tr>
608 <tr>
609 <td>{#style_dlg.right}</td>
610 <td>
611 <table border="0" cellspacing="0" cellpadding="0">
612 <tr>
613 <td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
614 <td>&nbsp;</td>
615 <td><select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled"></select></td>
616 </tr>
617 </table>
618 </td>
619 </tr>
620 <tr>
621 <td>{#style_dlg.bottom}</td>
622 <td>
623 <table border="0" cellspacing="0" cellpadding="0">
624 <tr>
625 <td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
626 <td>&nbsp;</td>
627 <td><select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled"></select></td>
628 </tr>
629 </table>
630 </td>
631 </tr>
632 <tr>
633 <td>{#style_dlg.left}</td>
634 <td>
635 <table border="0" cellspacing="0" cellpadding="0">
636 <tr>
637 <td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
638 <td>&nbsp;</td>
639 <td><select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled"></select></td>
640 </tr>
641 </table>
642 </td>
643 </tr>
644 </table>
645 </fieldset>
646</div>
647
648<div style="float: right; width: 49%">
649 <fieldset>
650 <legend>{#style_dlg.clip}</legend>
651
652 <table border="0">
653 <tr>
654 <td>&nbsp;</td>
655 <td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
656 </tr>
657 <tr>
658 <td>{#style_dlg.top}</td>
659 <td>
660 <table border="0" cellspacing="0" cellpadding="0">
661 <tr>
662 <td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
663 <td>&nbsp;</td>
664 <td><select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement"></select></td>
665 </tr>
666 </table>
667 </td>
668 </tr>
669 <tr>
670 <td>{#style_dlg.right}</td>
671 <td>
672 <table border="0" cellspacing="0" cellpadding="0">
673 <tr>
674 <td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
675 <td>&nbsp;</td>
676 <td><select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled"></select></td>
677 </tr>
678 </table>
679 </td>
680 </tr>
681 <tr>
682 <td>{#style_dlg.bottom}</td>
683 <td>
684 <table border="0" cellspacing="0" cellpadding="0">
685 <tr>
686 <td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
687 <td>&nbsp;</td>
688 <td><select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled"></select></td>
689 </tr>
690 </table>
691 </td>
692 </tr>
693 <tr>
694 <td>{#style_dlg.left}</td>
695 <td>
696 <table border="0" cellspacing="0" cellpadding="0">
697 <tr>
698 <td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
699 <td>&nbsp;</td>
700 <td><select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled"></select></td>
701 </tr>
702 </table>
703 </td>
704 </tr>
705 </table>
706 </fieldset>
707</div>
708<br style="clear: both" />
709</div>
710</div>
711
712<div class="mceActionPanel">
713 <div style="float: left">
714 <div style="float: left"><input type="submit" id="insert" name="insert" value="{#update}" /></div>
715
716 <div style="float: left">&nbsp;<input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" /></div>
717 <br style="clear: both" />
718 </div>
719
720 <div style="float: right">
721 <input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
722 </div>
723</div>
724</form>
725
726<div style="display: none">
727 <div id="container"></div>
728</div>
729
730</body>
731</html>
diff --git a/public/javascripts/tiny_mce/plugins/table/cell.htm b/public/javascripts/tiny_mce/plugins/table/cell.htm
new file mode 100755
index 0000000..60264db
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/cell.htm
@@ -0,0 +1,184 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#table_dlg.cell_title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9 <script type="text/javascript" src="js/cell.js"></script>
10 <link href="css/cell.css" rel="stylesheet" type="text/css" />
11 <base target="_self" />
12</head>
13<body id="tablecell" style="display: none">
14 <form onsubmit="updateAction();return false;" action="#">
15 <div class="tabs">
16 <ul>
17 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
18 <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
19 </ul>
20 </div>
21
22 <div class="panel_wrapper">
23 <div id="general_panel" class="panel current">
24 <fieldset>
25 <legend>{#table_dlg.general_props}</legend>
26
27 <table border="0" cellpadding="4" cellspacing="0">
28 <tr>
29 <td><label for="align">{#table_dlg.align}</label></td>
30 <td>
31 <select id="align" name="align" class="mceFocus">
32 <option value="">{#not_set}</option>
33 <option value="center">{#table_dlg.align_middle}</option>
34 <option value="left">{#table_dlg.align_left}</option>
35 <option value="right">{#table_dlg.align_right}</option>
36 </select>
37 </td>
38
39 <td><label for="celltype">{#table_dlg.cell_type}</label></td>
40 <td>
41 <select id="celltype" name="celltype">
42 <option value="td">{#table_dlg.td}</option>
43 <option value="th">{#table_dlg.th}</option>
44 </select>
45 </td>
46 </tr>
47
48 <tr>
49 <td><label for="valign">{#table_dlg.valign}</label></td>
50 <td>
51 <select id="valign" name="valign">
52 <option value="">{#not_set}</option>
53 <option value="top">{#table_dlg.align_top}</option>
54 <option value="middle">{#table_dlg.align_middle}</option>
55 <option value="bottom">{#table_dlg.align_bottom}</option>
56 </select>
57 </td>
58
59 <td><label for="scope">{#table_dlg.scope}</label></td>
60 <td>
61 <select id="scope" name="scope">
62 <option value="">{#not_set}</option>
63 <option value="col">{#table.col}</option>
64 <option value="row">{#table.row}</option>
65 <option value="rowgroup">{#table_dlg.rowgroup}</option>
66 <option value="colgroup">{#table_dlg.colgroup}</option>
67 </select>
68 </td>
69
70 </tr>
71
72 <tr>
73 <td><label for="width">{#table_dlg.width}</label></td>
74 <td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
75
76 <td><label for="height">{#table_dlg.height}</label></td>
77 <td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
78 </tr>
79
80 <tr id="styleSelectRow">
81 <td><label for="class">{#class_name}</label></td>
82 <td colspan="3">
83 <select id="class" name="class" class="mceEditableSelect">
84 <option value="" selected="selected">{#not_set}</option>
85 </select>
86 </td>
87 </tr>
88 </table>
89 </fieldset>
90 </div>
91
92 <div id="advanced_panel" class="panel">
93 <fieldset>
94 <legend>{#table_dlg.advanced_props}</legend>
95
96 <table border="0" cellpadding="0" cellspacing="4">
97 <tr>
98 <td class="column1"><label for="id">{#table_dlg.id}</label></td>
99 <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
100 </tr>
101
102 <tr>
103 <td><label for="style">{#table_dlg.style}</label></td>
104 <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
105 </tr>
106
107 <tr>
108 <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
109 <td>
110 <select id="dir" name="dir" style="width: 200px">
111 <option value="">{#not_set}</option>
112 <option value="ltr">{#table_dlg.ltr}</option>
113 <option value="rtl">{#table_dlg.rtl}</option>
114 </select>
115 </td>
116 </tr>
117
118 <tr>
119 <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
120 <td>
121 <input id="lang" name="lang" type="text" value="" style="width: 200px" />
122 </td>
123 </tr>
124
125 <tr>
126 <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
127 <td>
128 <table border="0" cellpadding="0" cellspacing="0">
129 <tr>
130 <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
131 <td id="backgroundimagebrowsercontainer">&nbsp;</td>
132 </tr>
133 </table>
134 </td>
135 </tr>
136
137 <tr>
138 <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td>
139 <td>
140 <table border="0" cellpadding="0" cellspacing="0">
141 <tr>
142 <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
143 <td id="bordercolor_pickcontainer">&nbsp;</td>
144 </tr>
145 </table>
146 </td>
147 </tr>
148
149 <tr>
150 <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
151 <td>
152 <table border="0" cellpadding="0" cellspacing="0">
153 <tr>
154 <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
155 <td id="bgcolor_pickcontainer">&nbsp;</td>
156 </tr>
157 </table>
158 </td>
159 </tr>
160 </table>
161 </fieldset>
162 </div>
163 </div>
164
165 <div class="mceActionPanel">
166 <div>
167 <select id="action" name="action">
168 <option value="cell">{#table_dlg.cell_cell}</option>
169 <option value="row">{#table_dlg.cell_row}</option>
170 <option value="all">{#table_dlg.cell_all}</option>
171 </select>
172 </div>
173
174 <div style="float: left">
175 <div><input type="submit" id="insert" name="insert" value="{#update}" /></div>
176 </div>
177
178 <div style="float: right">
179 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
180 </div>
181 </div>
182 </form>
183</body>
184</html>
diff --git a/public/javascripts/tiny_mce/plugins/table/css/cell.css b/public/javascripts/tiny_mce/plugins/table/css/cell.css
new file mode 100755
index 0000000..a067ecd
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/css/cell.css
@@ -0,0 +1,17 @@
1/* CSS file for cell dialog in the table plugin */
2
3.panel_wrapper div.current {
4 height: 200px;
5}
6
7.advfield {
8 width: 200px;
9}
10
11#action {
12 margin-bottom: 3px;
13}
14
15#class {
16 width: 150px;
17} \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/table/css/row.css b/public/javascripts/tiny_mce/plugins/table/css/row.css
new file mode 100755
index 0000000..1f7755d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/css/row.css
@@ -0,0 +1,25 @@
1/* CSS file for row dialog in the table plugin */
2
3.panel_wrapper div.current {
4 height: 200px;
5}
6
7.advfield {
8 width: 200px;
9}
10
11#action {
12 margin-bottom: 3px;
13}
14
15#rowtype,#align,#valign,#class,#height {
16 width: 150px;
17}
18
19#height {
20 width: 50px;
21}
22
23.col2 {
24 padding-left: 20px;
25}
diff --git a/public/javascripts/tiny_mce/plugins/table/css/table.css b/public/javascripts/tiny_mce/plugins/table/css/table.css
new file mode 100755
index 0000000..d11c3f6
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/css/table.css
@@ -0,0 +1,13 @@
1/* CSS file for table dialog in the table plugin */
2
3.panel_wrapper div.current {
4 height: 245px;
5}
6
7.advfield {
8 width: 200px;
9}
10
11#class {
12 width: 150px;
13}
diff --git a/public/javascripts/tiny_mce/plugins/table/editor_plugin.js b/public/javascripts/tiny_mce/plugins/table/editor_plugin.js
new file mode 100755
index 0000000..97a9d25
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/editor_plugin.js
@@ -0,0 +1 @@
(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;each([['table','table.desc','mceInsertTable',true],['delete_table','table.del','mceTableDelete'],['delete_col','table.delete_col_desc','mceTableDeleteCol'],['delete_row','table.delete_row_desc','mceTableDeleteRow'],['col_after','table.col_after_desc','mceTableInsertColAfter'],['col_before','table.col_before_desc','mceTableInsertColBefore'],['row_after','table.row_after_desc','mceTableInsertRowAfter'],['row_before','table.row_before_desc','mceTableInsertRowBefore'],['row_props','table.row_desc','mceTableRowProps',true],['cell_props','table.cell_desc','mceTableCellProps',true],['split_cells','table.split_cells_desc','mceTableSplitCells',true],['merge_cells','table.merge_cells_desc','mceTableMergeCells',true]],function(c){ed.addButton(c[0],{title:c[1],cmd:c[2],ui:c[3]});});if(ed.getParam('inline_styles')){ed.onPreProcess.add(function(ed,o){var dom=ed.dom;each(dom.select('table',o.node),function(n){var v;if(v=dom.getAttrib(n,'width')){dom.setStyle(n,'width',v);dom.setAttrib(n,'width');}if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height');}});});}ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){var sm,se=ed.selection,el=se.getNode()||ed.getBody();if(ed.dom.getParent(e,'td')||ed.dom.getParent(e,'th')){m.removeAll();if(el.nodeName=='A'&&!ed.dom.getAttrib(el,'name')){m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});m.addSeparator();}if(el.nodeName=='IMG'&&el.className.indexOf('mceItem')==-1){m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();}m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true,value:{action:'insert'}});m.add({title:'table.props_desc',icon:'table_props',cmd:'mceInsertTable',ui:true});m.add({title:'table.del',icon:'delete_table',cmd:'mceTableDelete',ui:true});m.addSeparator();sm=m.addMenu({title:'table.cell'});sm.add({title:'table.cell_desc',icon:'cell_props',cmd:'mceTableCellProps',ui:true});sm.add({title:'table.split_cells_desc',icon:'split_cells',cmd:'mceTableSplitCells',ui:true});sm.add({title:'table.merge_cells_desc',icon:'merge_cells',cmd:'mceTableMergeCells',ui:true});sm=m.addMenu({title:'table.row'});sm.add({title:'table.row_desc',icon:'row_props',cmd:'mceTableRowProps',ui:true});sm.add({title:'table.row_before_desc',icon:'row_before',cmd:'mceTableInsertRowBefore'});sm.add({title:'table.row_after_desc',icon:'row_after',cmd:'mceTableInsertRowAfter'});sm.add({title:'table.delete_row_desc',icon:'delete_row',cmd:'mceTableDeleteRow'});sm.addSeparator();sm.add({title:'table.cut_row_desc',icon:'cut',cmd:'mceTableCutRow'});sm.add({title:'table.copy_row_desc',icon:'copy',cmd:'mceTableCopyRow'});sm.add({title:'table.paste_row_before_desc',icon:'paste',cmd:'mceTablePasteRowBefore'});sm.add({title:'table.paste_row_after_desc',icon:'paste',cmd:'mceTablePasteRowAfter'});sm=m.addMenu({title:'table.col'});sm.add({title:'table.col_before_desc',icon:'col_before',cmd:'mceTableInsertColBefore'});sm.add({title:'table.col_after_desc',icon:'col_after',cmd:'mceTableInsertColAfter'});sm.add({title:'table.delete_col_desc',icon:'delete_col',cmd:'mceTableDeleteCol'});}else m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true});});}});ed.onKeyDown.add(function(ed,e){if(e.keyCode==9&&ed.dom.getParent(ed.selection.getNode(),'TABLE')){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(ed.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(e);}ed.undoManager.add();}});if(!tinymce.isIE){if(ed.getParam('table_selection',true)){ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='TABLE')ed.selection.select(e);});}}ed.onNodeChange.add(function(ed,cm,n){var p=ed.dom.getParent(n,'td,th,caption');cm.setActive('table',n.nodeName==='TABLE'||!!p);if(p&&p.nodeName==='CAPTION')p=null;cm.setDisabled('delete_table',!p);cm.setDisabled('delete_col',!p);cm.setDisabled('delete_table',!p);cm.setDisabled('delete_row',!p);cm.setDisabled('col_after',!p);cm.setDisabled('col_before',!p);cm.setDisabled('row_after',!p);cm.setDisabled('row_before',!p);cm.setDisabled('row_props',!p);cm.setDisabled('cell_props',!p);cm.setDisabled('split_cells',!p||(parseInt(ed.dom.getAttrib(p,'colspan','1'))<2&&parseInt(ed.dom.getAttrib(p,'rowspan','1'))<2));cm.setDisabled('merge_cells',!p);});if(!tinymce.isIE){ed.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?'<$1$2>&nbsp;</$1>':'<$1$2><br mce_bogus="1" /></$1>');});}},execCommand:function(cmd,ui,val){var ed=this.editor,b;switch(cmd){case"mceTableMoveToNextRow":case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":ed.execCommand('mceBeginUndoLevel');this._doExecCommand(cmd,ui,val);ed.execCommand('mceEndUndoLevel');return true;}return false;},getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_doExecCommand:function(command,user_interface,value){var inst=this.editor,ed=inst,url=this.url;var focusElm=inst.selection.getNode();var trElm=inst.dom.getParent(focusElm,"tr");var tdElm=inst.dom.getParent(focusElm,"td,th");var tableElm=inst.dom.getParent(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function select(dx,dy){var td;grid=getTableGrid(tableElm);dx=dx||0;dy=dy||0;dx=Math.max(cpos.cellindex+dx,0);dy=Math.max(cpos.rowindex+dy,0);inst.execCommand('mceRepaint');td=getCell(grid,dy,dx);if(td){inst.selection.select(td.firstChild||td);inst.selection.collapse(1);}};function makeTD(){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}function getColRowSpan(td){var colspan=inst.dom.getAttrib(td,"colspan");var rowspan=inst.dom.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){var x,y;for(y=0;y<grid.length;y++){for(x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y};}}return null;}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null;}function getNextCell(table,cell){var cells=[],x=0,i,j,cell,nextCell;for(i=0;i<table.rows.length;i++)for(j=0;j<table.rows[i].cells.length;j++,x++)cells[x]=table.rows[i].cells[j];for(i=0;i<cells.length;i++)if(cells[i]==cell)if(nextCell=cells[i+1])return nextCell;}function getTableGrid(table){var grid=[],rows=table.rows,x,y,td,sd,xstart,x2,y2;for(y=0;y<rows.length;y++){for(x=0;x<rows[y].cells.length;x++){td=rows[y].cells[x];sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=[];for(x2=xstart;x2<xstart+sd['colspan'];x2++)grid[y2][x2]=td;}}}return grid;}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table),cpos=getCellPos(grid,td);var cells,lastElm;if(new_tr.cells.length!=tr.childNodes.length){cells=tr.childNodes;lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true;}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true;}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node;}}return null;}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue;}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';if(tinymce.isIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=inst.dom.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break;}}}if(newTD==null){newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableMoveToNextRow":var nextCell=getNextCell(tableElm,tdElm);if(!nextCell){inst.execCommand("mceTableInsertRowAfter",tdElm);nextCell=getNextCell(tableElm,tdElm);}inst.selection.select(nextCell);inst.selection.collapse(true);return true;case"mceTableRowProps":if(trElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/row.htm',width:400+parseInt(inst.getLang('table.rowprops_delta_width',0)),height:295+parseInt(inst.getLang('table.rowprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/cell.htm',width:400+parseInt(inst.getLang('table.cellprops_delta_width',0)),height:295+parseInt(inst.getLang('table.cellprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceInsertTable":if(user_interface){inst.windowManager.open({url:url+'/table.htm',width:400+parseInt(inst.getLang('table.table_delta_width',0)),height:320+parseInt(inst.getLang('table.table_delta_height',0)),inline:1},{plugin_url:url,action:value?value.action:0});}return true;case"mceTableDelete":var table=inst.dom.getParent(inst.selection.getNode(),"table");if(table){table.parentNode.removeChild(table);inst.execCommand('mceRepaint');}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);select(0,1);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}select(0,1);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);select(0,-1);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(inst.dom.getParent(tableElm,"table"));var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}select();break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(inst.dom.getParent(tableElm,"table"));var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}select(1);break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if((grid.length>1&&grid[0].length<=1)&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}select(-1);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");break;case"mceTableMergeCells":var rows=[];var sel=inst.selection.getSel();var grid=getTableGrid(tableElm);if(tinymce.isIE||sel.rangeCount==1){if(user_interface){var sp=getColRowSpan(tdElm);inst.windowManager.open({url:url+'/merge_cells.htm',width:240+parseInt(inst.getLang('table.merge_cells_delta_width',0)),height:110+parseInt(inst.getLang('table.merge_cells_delta_height',0)),inline:1},{action:"update",numcols:sp.colspan,numrows:sp.rowspan,plugin_url:url});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=[];for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td;}}if(rowCells.length>0)rows[rows.length]=rowCells;var td=getCell(grid,cpos.rowindex,cpos.cellindex);each(ed.dom.select('br',td),function(e,i){if(i>0&&ed.dom.getAttrib('mce_bogus'))ed.dom.remove(e);});}}}else{var cells=[];var sel=inst.selection.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD"||tdElm.nodeName=="TH")cells[cells.length]=tdElm;}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=[];for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td;}}}if(rowCells.length>0)rows[rows.length]=rowCells;}var curRow=[];var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y;}x2=x;y2=y;grid[y][x]._selected=true;}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true;}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true;}lastRowSpan=sd['rowspan'];}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true;}lastColSpan=sd['colspan'];}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=html.replace(/[ \t\r\n]/g,"");if(chk!="<br/>"&&chk!="<br>"&&chk!='<br mce_bogus="1"/>'&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}each(ed.dom.select('br',tdElm),function(e,i){if(i>0&&ed.dom.getAttrib(e,'mce_bogus'))ed.dom.remove(e);});break;}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");inst.addVisual(tableElm);inst.nodeChanged();}return true;}return false;}});tinymce.PluginManager.add('table',tinymce.plugins.TablePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js
new file mode 100755
index 0000000..80cf748
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js
@@ -0,0 +1,1136 @@
1/**
2 * $Id: editor_plugin_src.js 953 2008-11-04 10:16:50Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var each = tinymce.each;
10
11 tinymce.create('tinymce.plugins.TablePlugin', {
12 init : function(ed, url) {
13 var t = this;
14
15 t.editor = ed;
16 t.url = url;
17
18 // Register buttons
19 each([
20 ['table', 'table.desc', 'mceInsertTable', true],
21 ['delete_table', 'table.del', 'mceTableDelete'],
22 ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
23 ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
24 ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
25 ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
26 ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
27 ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
28 ['row_props', 'table.row_desc', 'mceTableRowProps', true],
29 ['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
30 ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
31 ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
32 ], function(c) {
33 ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
34 });
35
36 if (ed.getParam('inline_styles')) {
37 // Force move of attribs to styles in strict mode
38 ed.onPreProcess.add(function(ed, o) {
39 var dom = ed.dom;
40
41 each(dom.select('table', o.node), function(n) {
42 var v;
43
44 if (v = dom.getAttrib(n, 'width')) {
45 dom.setStyle(n, 'width', v);
46 dom.setAttrib(n, 'width');
47 }
48
49 if (v = dom.getAttrib(n, 'height')) {
50 dom.setStyle(n, 'height', v);
51 dom.setAttrib(n, 'height');
52 }
53 });
54 });
55 }
56
57 ed.onInit.add(function() {
58 if (ed && ed.plugins.contextmenu) {
59 ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
60 var sm, se = ed.selection, el = se.getNode() || ed.getBody();
61
62 if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th')) {
63 m.removeAll();
64
65 if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {
66 m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
67 m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
68 m.addSeparator();
69 }
70
71 if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {
72 m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
73 m.addSeparator();
74 }
75
76 m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true, value : {action : 'insert'}});
77 m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable', ui : true});
78 m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete', ui : true});
79 m.addSeparator();
80
81 // Cell menu
82 sm = m.addMenu({title : 'table.cell'});
83 sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps', ui : true});
84 sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells', ui : true});
85 sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells', ui : true});
86
87 // Row menu
88 sm = m.addMenu({title : 'table.row'});
89 sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps', ui : true});
90 sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
91 sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
92 sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
93 sm.addSeparator();
94 sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
95 sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
96 sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'});
97 sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'});
98
99 // Column menu
100 sm = m.addMenu({title : 'table.col'});
101 sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
102 sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
103 sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
104 } else
105 m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true});
106 });
107 }
108 });
109
110 // Add undo level when new rows are created using the tab key
111 ed.onKeyDown.add(function(ed, e) {
112 if (e.keyCode == 9 && ed.dom.getParent(ed.selection.getNode(), 'TABLE')) {
113 if (!tinymce.isGecko && !tinymce.isOpera) {
114 tinyMCE.execInstanceCommand(ed.editorId, "mceTableMoveToNextRow", true);
115 return tinymce.dom.Event.cancel(e);
116 }
117
118 ed.undoManager.add();
119 }
120 });
121
122 // Select whole table is a table border is clicked
123 if (!tinymce.isIE) {
124 if (ed.getParam('table_selection', true)) {
125 ed.onClick.add(function(ed, e) {
126 e = e.target;
127
128 if (e.nodeName === 'TABLE')
129 ed.selection.select(e);
130 });
131 }
132 }
133
134 ed.onNodeChange.add(function(ed, cm, n) {
135 var p = ed.dom.getParent(n, 'td,th,caption');
136
137 cm.setActive('table', n.nodeName === 'TABLE' || !!p);
138 if (p && p.nodeName === 'CAPTION')
139 p = null;
140
141 cm.setDisabled('delete_table', !p);
142 cm.setDisabled('delete_col', !p);
143 cm.setDisabled('delete_table', !p);
144 cm.setDisabled('delete_row', !p);
145 cm.setDisabled('col_after', !p);
146 cm.setDisabled('col_before', !p);
147 cm.setDisabled('row_after', !p);
148 cm.setDisabled('row_before', !p);
149 cm.setDisabled('row_props', !p);
150 cm.setDisabled('cell_props', !p);
151 cm.setDisabled('split_cells', !p || (parseInt(ed.dom.getAttrib(p, 'colspan', '1')) < 2 && parseInt(ed.dom.getAttrib(p, 'rowspan', '1')) < 2));
152 cm.setDisabled('merge_cells', !p);
153 });
154
155 // Padd empty table cells
156 if (!tinymce.isIE) {
157 ed.onBeforeSetContent.add(function(ed, o) {
158 if (o.initial)
159 o.content = o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g, tinymce.isOpera ? '<$1$2>&nbsp;</$1>' : '<$1$2><br mce_bogus="1" /></$1>');
160 });
161 }
162 },
163
164 execCommand : function(cmd, ui, val) {
165 var ed = this.editor, b;
166
167 // Is table command
168 switch (cmd) {
169 case "mceTableMoveToNextRow":
170 case "mceInsertTable":
171 case "mceTableRowProps":
172 case "mceTableCellProps":
173 case "mceTableSplitCells":
174 case "mceTableMergeCells":
175 case "mceTableInsertRowBefore":
176 case "mceTableInsertRowAfter":
177 case "mceTableDeleteRow":
178 case "mceTableInsertColBefore":
179 case "mceTableInsertColAfter":
180 case "mceTableDeleteCol":
181 case "mceTableCutRow":
182 case "mceTableCopyRow":
183 case "mceTablePasteRowBefore":
184 case "mceTablePasteRowAfter":
185 case "mceTableDelete":
186 ed.execCommand('mceBeginUndoLevel');
187 this._doExecCommand(cmd, ui, val);
188 ed.execCommand('mceEndUndoLevel');
189
190 return true;
191 }
192
193 // Pass to next handler in chain
194 return false;
195 },
196
197 getInfo : function() {
198 return {
199 longname : 'Tables',
200 author : 'Moxiecode Systems AB',
201 authorurl : 'http://tinymce.moxiecode.com',
202 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',
203 version : tinymce.majorVersion + "." + tinymce.minorVersion
204 };
205 },
206
207 // Private plugin internal methods
208
209 /**
210 * Executes the table commands.
211 */
212 _doExecCommand : function(command, user_interface, value) {
213 var inst = this.editor, ed = inst, url = this.url;
214 var focusElm = inst.selection.getNode();
215 var trElm = inst.dom.getParent(focusElm, "tr");
216 var tdElm = inst.dom.getParent(focusElm, "td,th");
217 var tableElm = inst.dom.getParent(focusElm, "table");
218 var doc = inst.contentWindow.document;
219 var tableBorder = tableElm ? tableElm.getAttribute("border") : "";
220
221 // Get first TD if no TD found
222 if (trElm && tdElm == null)
223 tdElm = trElm.cells[0];
224
225 function inArray(ar, v) {
226 for (var i=0; i<ar.length; i++) {
227 // Is array
228 if (ar[i].length > 0 && inArray(ar[i], v))
229 return true;
230
231 // Found value
232 if (ar[i] == v)
233 return true;
234 }
235
236 return false;
237 }
238
239 function select(dx, dy) {
240 var td;
241
242 grid = getTableGrid(tableElm);
243 dx = dx || 0;
244 dy = dy || 0;
245 dx = Math.max(cpos.cellindex + dx, 0);
246 dy = Math.max(cpos.rowindex + dy, 0);
247
248 // Recalculate grid and select
249 inst.execCommand('mceRepaint');
250 td = getCell(grid, dy, dx);
251
252 if (td) {
253 inst.selection.select(td.firstChild || td);
254 inst.selection.collapse(1);
255 }
256 };
257
258 function makeTD() {
259 var newTD = doc.createElement("td");
260
261 if (!tinymce.isIE)
262 newTD.innerHTML = '<br mce_bogus="1"/>';
263 }
264
265 function getColRowSpan(td) {
266 var colspan = inst.dom.getAttrib(td, "colspan");
267 var rowspan = inst.dom.getAttrib(td, "rowspan");
268
269 colspan = colspan == "" ? 1 : parseInt(colspan);
270 rowspan = rowspan == "" ? 1 : parseInt(rowspan);
271
272 return {colspan : colspan, rowspan : rowspan};
273 }
274
275 function getCellPos(grid, td) {
276 var x, y;
277
278 for (y=0; y<grid.length; y++) {
279 for (x=0; x<grid[y].length; x++) {
280 if (grid[y][x] == td)
281 return {cellindex : x, rowindex : y};
282 }
283 }
284
285 return null;
286 }
287
288 function getCell(grid, row, col) {
289 if (grid[row] && grid[row][col])
290 return grid[row][col];
291
292 return null;
293 }
294
295 function getNextCell(table, cell) {
296 var cells = [], x = 0, i, j, cell, nextCell;
297
298 for (i = 0; i < table.rows.length; i++)
299 for (j = 0; j < table.rows[i].cells.length; j++, x++)
300 cells[x] = table.rows[i].cells[j];
301
302 for (i = 0; i < cells.length; i++)
303 if (cells[i] == cell)
304 if (nextCell = cells[i+1])
305 return nextCell;
306 }
307
308 function getTableGrid(table) {
309 var grid = [], rows = table.rows, x, y, td, sd, xstart, x2, y2;
310
311 for (y=0; y<rows.length; y++) {
312 for (x=0; x<rows[y].cells.length; x++) {
313 td = rows[y].cells[x];
314 sd = getColRowSpan(td);
315
316 // All ready filled
317 for (xstart = x; grid[y] && grid[y][xstart]; xstart++) ;
318
319 // Fill box
320 for (y2=y; y2<y+sd['rowspan']; y2++) {
321 if (!grid[y2])
322 grid[y2] = [];
323
324 for (x2=xstart; x2<xstart+sd['colspan']; x2++)
325 grid[y2][x2] = td;
326 }
327 }
328 }
329
330 return grid;
331 }
332
333 function trimRow(table, tr, td, new_tr) {
334 var grid = getTableGrid(table), cpos = getCellPos(grid, td);
335 var cells, lastElm;
336
337 // Time to crop away some
338 if (new_tr.cells.length != tr.childNodes.length) {
339 cells = tr.childNodes;
340 lastElm = null;
341
342 for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) {
343 var remove = true;
344 var sd = getColRowSpan(td);
345
346 // Remove due to rowspan
347 if (inArray(cells, td)) {
348 new_tr.childNodes[x]._delete = true;
349 } else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan
350 for (var i=x; i<x+td.colSpan; i++)
351 new_tr.childNodes[i]._delete = true;
352 }
353
354 if ((lastElm == null || td != lastElm) && sd.rowspan > 1)
355 td.rowSpan = sd.rowspan + 1;
356
357 lastElm = td;
358 }
359
360 deleteMarked(tableElm);
361 }
362 }
363
364 function prevElm(node, name) {
365 while ((node = node.previousSibling) != null) {
366 if (node.nodeName == name)
367 return node;
368 }
369
370 return null;
371 }
372
373 function nextElm(node, names) {
374 var namesAr = names.split(',');
375
376 while ((node = node.nextSibling) != null) {
377 for (var i=0; i<namesAr.length; i++) {
378 if (node.nodeName.toLowerCase() == namesAr[i].toLowerCase() )
379 return node;
380 }
381 }
382
383 return null;
384 }
385
386 function deleteMarked(tbl) {
387 if (tbl.rows == 0)
388 return;
389
390 var tr = tbl.rows[0];
391 do {
392 var next = nextElm(tr, "TR");
393
394 // Delete row
395 if (tr._delete) {
396 tr.parentNode.removeChild(tr);
397 continue;
398 }
399
400 // Delete cells
401 var td = tr.cells[0];
402 if (td.cells > 1) {
403 do {
404 var nexttd = nextElm(td, "TD,TH");
405
406 if (td._delete)
407 td.parentNode.removeChild(td);
408 } while ((td = nexttd) != null);
409 }
410 } while ((tr = next) != null);
411 }
412
413 function addRows(td_elm, tr_elm, rowspan) {
414 // Add rows
415 td_elm.rowSpan = 1;
416 var trNext = nextElm(tr_elm, "TR");
417 for (var i=1; i<rowspan && trNext; i++) {
418 var newTD = doc.createElement("td");
419
420 if (!tinymce.isIE)
421 newTD.innerHTML = '<br mce_bogus="1"/>';
422
423 if (tinymce.isIE)
424 trNext.insertBefore(newTD, trNext.cells(td_elm.cellIndex));
425 else
426 trNext.insertBefore(newTD, trNext.cells[td_elm.cellIndex]);
427
428 trNext = nextElm(trNext, "TR");
429 }
430 }
431
432 function copyRow(doc, table, tr) {
433 var grid = getTableGrid(table);
434 var newTR = tr.cloneNode(false);
435 var cpos = getCellPos(grid, tr.cells[0]);
436 var lastCell = null;
437 var tableBorder = inst.dom.getAttrib(table, "border");
438 var tdElm = null;
439
440 for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
441 var newTD = null;
442
443 if (lastCell != tdElm) {
444 for (var i=0; i<tr.cells.length; i++) {
445 if (tdElm == tr.cells[i]) {
446 newTD = tdElm.cloneNode(true);
447 break;
448 }
449 }
450 }
451
452 if (newTD == null) {
453 newTD = doc.createElement("td");
454
455 if (!tinymce.isIE)
456 newTD.innerHTML = '<br mce_bogus="1"/>';
457 }
458
459 // Reset col/row span
460 newTD.colSpan = 1;
461 newTD.rowSpan = 1;
462
463 newTR.appendChild(newTD);
464
465 lastCell = tdElm;
466 }
467
468 return newTR;
469 }
470
471 // ---- Commands -----
472
473 // Handle commands
474 switch (command) {
475 case "mceTableMoveToNextRow":
476 var nextCell = getNextCell(tableElm, tdElm);
477
478 if (!nextCell) {
479 inst.execCommand("mceTableInsertRowAfter", tdElm);
480 nextCell = getNextCell(tableElm, tdElm);
481 }
482
483 inst.selection.select(nextCell);
484 inst.selection.collapse(true);
485
486 return true;
487
488 case "mceTableRowProps":
489 if (trElm == null)
490 return true;
491
492 if (user_interface) {
493 inst.windowManager.open({
494 url : url + '/row.htm',
495 width : 400 + parseInt(inst.getLang('table.rowprops_delta_width', 0)),
496 height : 295 + parseInt(inst.getLang('table.rowprops_delta_height', 0)),
497 inline : 1
498 }, {
499 plugin_url : url
500 });
501 }
502
503 return true;
504
505 case "mceTableCellProps":
506 if (tdElm == null)
507 return true;
508
509 if (user_interface) {
510 inst.windowManager.open({
511 url : url + '/cell.htm',
512 width : 400 + parseInt(inst.getLang('table.cellprops_delta_width', 0)),
513 height : 295 + parseInt(inst.getLang('table.cellprops_delta_height', 0)),
514 inline : 1
515 }, {
516 plugin_url : url
517 });
518 }
519
520 return true;
521
522 case "mceInsertTable":
523 if (user_interface) {
524 inst.windowManager.open({
525 url : url + '/table.htm',
526 width : 400 + parseInt(inst.getLang('table.table_delta_width', 0)),
527 height : 320 + parseInt(inst.getLang('table.table_delta_height', 0)),
528 inline : 1
529 }, {
530 plugin_url : url,
531 action : value ? value.action : 0
532 });
533 }
534
535 return true;
536
537 case "mceTableDelete":
538 var table = inst.dom.getParent(inst.selection.getNode(), "table");
539 if (table) {
540 table.parentNode.removeChild(table);
541 inst.execCommand('mceRepaint');
542 }
543 return true;
544
545 case "mceTableSplitCells":
546 case "mceTableMergeCells":
547 case "mceTableInsertRowBefore":
548 case "mceTableInsertRowAfter":
549 case "mceTableDeleteRow":
550 case "mceTableInsertColBefore":
551 case "mceTableInsertColAfter":
552 case "mceTableDeleteCol":
553 case "mceTableCutRow":
554 case "mceTableCopyRow":
555 case "mceTablePasteRowBefore":
556 case "mceTablePasteRowAfter":
557 // No table just return (invalid command)
558 if (!tableElm)
559 return true;
560
561 // Table has a tbody use that reference
562 // Changed logic by ApTest 2005.07.12 (www.aptest.com)
563 // Now lookk at the focused element and take its parentNode. That will be a tbody or a table.
564 if (trElm && tableElm != trElm.parentNode)
565 tableElm = trElm.parentNode;
566
567 if (tableElm && trElm) {
568 switch (command) {
569 case "mceTableCutRow":
570 if (!trElm || !tdElm)
571 return true;
572
573 inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
574 inst.execCommand("mceTableDeleteRow");
575 break;
576
577 case "mceTableCopyRow":
578 if (!trElm || !tdElm)
579 return true;
580
581 inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
582 break;
583
584 case "mceTablePasteRowBefore":
585 if (!trElm || !tdElm)
586 return true;
587
588 var newTR = inst.tableRowClipboard.cloneNode(true);
589
590 var prevTR = prevElm(trElm, "TR");
591 if (prevTR != null)
592 trimRow(tableElm, prevTR, prevTR.cells[0], newTR);
593
594 trElm.parentNode.insertBefore(newTR, trElm);
595 break;
596
597 case "mceTablePasteRowAfter":
598 if (!trElm || !tdElm)
599 return true;
600
601 var nextTR = nextElm(trElm, "TR");
602 var newTR = inst.tableRowClipboard.cloneNode(true);
603
604 trimRow(tableElm, trElm, tdElm, newTR);
605
606 if (nextTR == null)
607 trElm.parentNode.appendChild(newTR);
608 else
609 nextTR.parentNode.insertBefore(newTR, nextTR);
610
611 break;
612
613 case "mceTableInsertRowBefore":
614 if (!trElm || !tdElm)
615 return true;
616
617 var grid = getTableGrid(tableElm);
618 var cpos = getCellPos(grid, tdElm);
619 var newTR = doc.createElement("tr");
620 var lastTDElm = null;
621
622 cpos.rowindex--;
623 if (cpos.rowindex < 0)
624 cpos.rowindex = 0;
625
626 // Create cells
627 for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
628 if (tdElm != lastTDElm) {
629 var sd = getColRowSpan(tdElm);
630
631 if (sd['rowspan'] == 1) {
632 var newTD = doc.createElement("td");
633
634 if (!tinymce.isIE)
635 newTD.innerHTML = '<br mce_bogus="1"/>';
636
637 newTD.colSpan = tdElm.colSpan;
638
639 newTR.appendChild(newTD);
640 } else
641 tdElm.rowSpan = sd['rowspan'] + 1;
642
643 lastTDElm = tdElm;
644 }
645 }
646
647 trElm.parentNode.insertBefore(newTR, trElm);
648 select(0, 1);
649 break;
650
651 case "mceTableInsertRowAfter":
652 if (!trElm || !tdElm)
653 return true;
654
655 var grid = getTableGrid(tableElm);
656 var cpos = getCellPos(grid, tdElm);
657 var newTR = doc.createElement("tr");
658 var lastTDElm = null;
659
660 // Create cells
661 for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
662 if (tdElm != lastTDElm) {
663 var sd = getColRowSpan(tdElm);
664
665 if (sd['rowspan'] == 1) {
666 var newTD = doc.createElement("td");
667
668 if (!tinymce.isIE)
669 newTD.innerHTML = '<br mce_bogus="1"/>';
670
671 newTD.colSpan = tdElm.colSpan;
672
673 newTR.appendChild(newTD);
674 } else
675 tdElm.rowSpan = sd['rowspan'] + 1;
676
677 lastTDElm = tdElm;
678 }
679 }
680
681 if (newTR.hasChildNodes()) {
682 var nextTR = nextElm(trElm, "TR");
683 if (nextTR)
684 nextTR.parentNode.insertBefore(newTR, nextTR);
685 else
686 tableElm.appendChild(newTR);
687 }
688
689 select(0, 1);
690 break;
691
692 case "mceTableDeleteRow":
693 if (!trElm || !tdElm)
694 return true;
695
696 var grid = getTableGrid(tableElm);
697 var cpos = getCellPos(grid, tdElm);
698
699 // Only one row, remove whole table
700 if (grid.length == 1 && tableElm.nodeName == 'TBODY') {
701 inst.dom.remove(inst.dom.getParent(tableElm, "table"));
702 return true;
703 }
704
705 // Move down row spanned cells
706 var cells = trElm.cells;
707 var nextTR = nextElm(trElm, "TR");
708 for (var x=0; x<cells.length; x++) {
709 if (cells[x].rowSpan > 1) {
710 var newTD = cells[x].cloneNode(true);
711 var sd = getColRowSpan(cells[x]);
712
713 newTD.rowSpan = sd.rowspan - 1;
714
715 var nextTD = nextTR.cells[x];
716
717 if (nextTD == null)
718 nextTR.appendChild(newTD);
719 else
720 nextTR.insertBefore(newTD, nextTD);
721 }
722 }
723
724 // Delete cells
725 var lastTDElm = null;
726 for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
727 if (tdElm != lastTDElm) {
728 var sd = getColRowSpan(tdElm);
729
730 if (sd.rowspan > 1) {
731 tdElm.rowSpan = sd.rowspan - 1;
732 } else {
733 trElm = tdElm.parentNode;
734
735 if (trElm.parentNode)
736 trElm._delete = true;
737 }
738
739 lastTDElm = tdElm;
740 }
741 }
742
743 deleteMarked(tableElm);
744
745 select(0, -1);
746 break;
747
748 case "mceTableInsertColBefore":
749 if (!trElm || !tdElm)
750 return true;
751
752 var grid = getTableGrid(inst.dom.getParent(tableElm, "table"));
753 var cpos = getCellPos(grid, tdElm);
754 var lastTDElm = null;
755
756 for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
757 if (tdElm != lastTDElm) {
758 var sd = getColRowSpan(tdElm);
759
760 if (sd['colspan'] == 1) {
761 var newTD = doc.createElement(tdElm.nodeName);
762
763 if (!tinymce.isIE)
764 newTD.innerHTML = '<br mce_bogus="1"/>';
765
766 newTD.rowSpan = tdElm.rowSpan;
767
768 tdElm.parentNode.insertBefore(newTD, tdElm);
769 } else
770 tdElm.colSpan++;
771
772 lastTDElm = tdElm;
773 }
774 }
775
776 select();
777 break;
778
779 case "mceTableInsertColAfter":
780 if (!trElm || !tdElm)
781 return true;
782
783 var grid = getTableGrid(inst.dom.getParent(tableElm, "table"));
784 var cpos = getCellPos(grid, tdElm);
785 var lastTDElm = null;
786
787 for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
788 if (tdElm != lastTDElm) {
789 var sd = getColRowSpan(tdElm);
790
791 if (sd['colspan'] == 1) {
792 var newTD = doc.createElement(tdElm.nodeName);
793
794 if (!tinymce.isIE)
795 newTD.innerHTML = '<br mce_bogus="1"/>';
796
797 newTD.rowSpan = tdElm.rowSpan;
798
799 var nextTD = nextElm(tdElm, "TD,TH");
800 if (nextTD == null)
801 tdElm.parentNode.appendChild(newTD);
802 else
803 nextTD.parentNode.insertBefore(newTD, nextTD);
804 } else
805 tdElm.colSpan++;
806
807 lastTDElm = tdElm;
808 }
809 }
810
811 select(1);
812 break;
813
814 case "mceTableDeleteCol":
815 if (!trElm || !tdElm)
816 return true;
817
818 var grid = getTableGrid(tableElm);
819 var cpos = getCellPos(grid, tdElm);
820 var lastTDElm = null;
821
822 // Only one col, remove whole table
823 if ((grid.length > 1 && grid[0].length <= 1) && tableElm.nodeName == 'TBODY') {
824 inst.dom.remove(inst.dom.getParent(tableElm, "table"));
825 return true;
826 }
827
828 // Delete cells
829 for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
830 if (tdElm != lastTDElm) {
831 var sd = getColRowSpan(tdElm);
832
833 if (sd['colspan'] > 1)
834 tdElm.colSpan = sd['colspan'] - 1;
835 else {
836 if (tdElm.parentNode)
837 tdElm.parentNode.removeChild(tdElm);
838 }
839
840 lastTDElm = tdElm;
841 }
842 }
843
844 select(-1);
845 break;
846
847 case "mceTableSplitCells":
848 if (!trElm || !tdElm)
849 return true;
850
851 var spandata = getColRowSpan(tdElm);
852
853 var colspan = spandata["colspan"];
854 var rowspan = spandata["rowspan"];
855
856 // Needs splitting
857 if (colspan > 1 || rowspan > 1) {
858 // Generate cols
859 tdElm.colSpan = 1;
860 for (var i=1; i<colspan; i++) {
861 var newTD = doc.createElement("td");
862
863 if (!tinymce.isIE)
864 newTD.innerHTML = '<br mce_bogus="1"/>';
865
866 trElm.insertBefore(newTD, nextElm(tdElm, "TD,TH"));
867
868 if (rowspan > 1)
869 addRows(newTD, trElm, rowspan);
870 }
871
872 addRows(tdElm, trElm, rowspan);
873 }
874
875 // Apply visual aids
876 tableElm = inst.dom.getParent(inst.selection.getNode(), "table");
877 break;
878
879 case "mceTableMergeCells":
880 var rows = [];
881 var sel = inst.selection.getSel();
882 var grid = getTableGrid(tableElm);
883
884 if (tinymce.isIE || sel.rangeCount == 1) {
885 if (user_interface) {
886 // Setup template
887 var sp = getColRowSpan(tdElm);
888
889 inst.windowManager.open({
890 url : url + '/merge_cells.htm',
891 width : 240 + parseInt(inst.getLang('table.merge_cells_delta_width', 0)),
892 height : 110 + parseInt(inst.getLang('table.merge_cells_delta_height', 0)),
893 inline : 1
894 }, {
895 action : "update",
896 numcols : sp.colspan,
897 numrows : sp.rowspan,
898 plugin_url : url
899 });
900
901 return true;
902 } else {
903 var numRows = parseInt(value['numrows']);
904 var numCols = parseInt(value['numcols']);
905 var cpos = getCellPos(grid, tdElm);
906
907 if (("" + numRows) == "NaN")
908 numRows = 1;
909
910 if (("" + numCols) == "NaN")
911 numCols = 1;
912
913 // Get rows and cells
914 var tRows = tableElm.rows;
915 for (var y=cpos.rowindex; y<grid.length; y++) {
916 var rowCells = [];
917
918 for (var x=cpos.cellindex; x<grid[y].length; x++) {
919 var td = getCell(grid, y, x);
920
921 if (td && !inArray(rows, td) && !inArray(rowCells, td)) {
922 var cp = getCellPos(grid, td);
923
924 // Within range
925 if (cp.cellindex < cpos.cellindex+numCols && cp.rowindex < cpos.rowindex+numRows)
926 rowCells[rowCells.length] = td;
927 }
928 }
929
930 if (rowCells.length > 0)
931 rows[rows.length] = rowCells;
932
933 var td = getCell(grid, cpos.rowindex, cpos.cellindex);
934 each(ed.dom.select('br', td), function(e, i) {
935 if (i > 0 && ed.dom.getAttrib('mce_bogus'))
936 ed.dom.remove(e);
937 });
938 }
939
940 //return true;
941 }
942 } else {
943 var cells = [];
944 var sel = inst.selection.getSel();
945 var lastTR = null;
946 var curRow = null;
947 var x1 = -1, y1 = -1, x2, y2;
948
949 // Only one cell selected, whats the point?
950 if (sel.rangeCount < 2)
951 return true;
952
953 // Get all selected cells
954 for (var i=0; i<sel.rangeCount; i++) {
955 var rng = sel.getRangeAt(i);
956 var tdElm = rng.startContainer.childNodes[rng.startOffset];
957
958 if (!tdElm)
959 break;
960
961 if (tdElm.nodeName == "TD" || tdElm.nodeName == "TH")
962 cells[cells.length] = tdElm;
963 }
964
965 // Get rows and cells
966 var tRows = tableElm.rows;
967 for (var y=0; y<tRows.length; y++) {
968 var rowCells = [];
969
970 for (var x=0; x<tRows[y].cells.length; x++) {
971 var td = tRows[y].cells[x];
972
973 for (var i=0; i<cells.length; i++) {
974 if (td == cells[i]) {
975 rowCells[rowCells.length] = td;
976 }
977 }
978 }
979
980 if (rowCells.length > 0)
981 rows[rows.length] = rowCells;
982 }
983
984 // Find selected cells in grid and box
985 var curRow = [];
986 var lastTR = null;
987 for (var y=0; y<grid.length; y++) {
988 for (var x=0; x<grid[y].length; x++) {
989 grid[y][x]._selected = false;
990
991 for (var i=0; i<cells.length; i++) {
992 if (grid[y][x] == cells[i]) {
993 // Get start pos
994 if (x1 == -1) {
995 x1 = x;
996 y1 = y;
997 }
998
999 // Get end pos
1000 x2 = x;
1001 y2 = y;
1002
1003 grid[y][x]._selected = true;
1004 }
1005 }
1006 }
1007 }
1008
1009 // Is there gaps, if so deny
1010 for (var y=y1; y<=y2; y++) {
1011 for (var x=x1; x<=x2; x++) {
1012 if (!grid[y][x]._selected) {
1013 alert("Invalid selection for merge.");
1014 return true;
1015 }
1016 }
1017 }
1018 }
1019
1020 // Validate selection and get total rowspan and colspan
1021 var rowSpan = 1, colSpan = 1;
1022
1023 // Validate horizontal and get total colspan
1024 var lastRowSpan = -1;
1025 for (var y=0; y<rows.length; y++) {
1026 var rowColSpan = 0;
1027
1028 for (var x=0; x<rows[y].length; x++) {
1029 var sd = getColRowSpan(rows[y][x]);
1030
1031 rowColSpan += sd['colspan'];
1032
1033 if (lastRowSpan != -1 && sd['rowspan'] != lastRowSpan) {
1034 alert("Invalid selection for merge.");
1035 return true;
1036 }
1037
1038 lastRowSpan = sd['rowspan'];
1039 }
1040
1041 if (rowColSpan > colSpan)
1042 colSpan = rowColSpan;
1043
1044 lastRowSpan = -1;
1045 }
1046
1047 // Validate vertical and get total rowspan
1048 var lastColSpan = -1;
1049 for (var x=0; x<rows[0].length; x++) {
1050 var colRowSpan = 0;
1051
1052 for (var y=0; y<rows.length; y++) {
1053 var sd = getColRowSpan(rows[y][x]);
1054
1055 colRowSpan += sd['rowspan'];
1056
1057 if (lastColSpan != -1 && sd['colspan'] != lastColSpan) {
1058 alert("Invalid selection for merge.");
1059 return true;
1060 }
1061
1062 lastColSpan = sd['colspan'];
1063 }
1064
1065 if (colRowSpan > rowSpan)
1066 rowSpan = colRowSpan;
1067
1068 lastColSpan = -1;
1069 }
1070
1071 // Setup td
1072 tdElm = rows[0][0];
1073 tdElm.rowSpan = rowSpan;
1074 tdElm.colSpan = colSpan;
1075
1076 // Merge cells
1077 for (var y=0; y<rows.length; y++) {
1078 for (var x=0; x<rows[y].length; x++) {
1079 var html = rows[y][x].innerHTML;
1080 var chk = html.replace(/[ \t\r\n]/g, "");
1081
1082 if (chk != "<br/>" && chk != "<br>" && chk != '<br mce_bogus="1"/>' && (x+y > 0))
1083 tdElm.innerHTML += html;
1084
1085 // Not current cell
1086 if (rows[y][x] != tdElm && !rows[y][x]._deleted) {
1087 var cpos = getCellPos(grid, rows[y][x]);
1088 var tr = rows[y][x].parentNode;
1089
1090 tr.removeChild(rows[y][x]);
1091 rows[y][x]._deleted = true;
1092
1093 // Empty TR, remove it
1094 if (!tr.hasChildNodes()) {
1095 tr.parentNode.removeChild(tr);
1096
1097 var lastCell = null;
1098 for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) {
1099 if (cellElm != lastCell && cellElm.rowSpan > 1)
1100 cellElm.rowSpan--;
1101
1102 lastCell = cellElm;
1103 }
1104
1105 if (tdElm.rowSpan > 1)
1106 tdElm.rowSpan--;
1107 }
1108 }
1109 }
1110 }
1111
1112 // Remove all but one bogus br
1113 each(ed.dom.select('br', tdElm), function(e, i) {
1114 if (i > 0 && ed.dom.getAttrib(e, 'mce_bogus'))
1115 ed.dom.remove(e);
1116 });
1117
1118 break;
1119 }
1120
1121 tableElm = inst.dom.getParent(inst.selection.getNode(), "table");
1122 inst.addVisual(tableElm);
1123 inst.nodeChanged();
1124 }
1125
1126 return true;
1127 }
1128
1129 // Pass to next handler in chain
1130 return false;
1131 }
1132 });
1133
1134 // Register plugin
1135 tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
1136})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/table/js/cell.js b/public/javascripts/tiny_mce/plugins/table/js/cell.js
new file mode 100755
index 0000000..f23b067
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/js/cell.js
@@ -0,0 +1,269 @@
1tinyMCEPopup.requireLangPack();
2
3var ed;
4
5function init() {
6 ed = tinyMCEPopup.editor;
7 tinyMCEPopup.resizeToInnerSize();
8
9 document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
10 document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
11 document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
12
13 var inst = ed;
14 var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th");
15 var formObj = document.forms[0];
16 var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));
17
18 // Get table cell data
19 var celltype = tdElm.nodeName.toLowerCase();
20 var align = ed.dom.getAttrib(tdElm, 'align');
21 var valign = ed.dom.getAttrib(tdElm, 'valign');
22 var width = trimSize(getStyle(tdElm, 'width', 'width'));
23 var height = trimSize(getStyle(tdElm, 'height', 'height'));
24 var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
25 var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
26 var className = ed.dom.getAttrib(tdElm, 'class');
27 var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
28 var id = ed.dom.getAttrib(tdElm, 'id');
29 var lang = ed.dom.getAttrib(tdElm, 'lang');
30 var dir = ed.dom.getAttrib(tdElm, 'dir');
31 var scope = ed.dom.getAttrib(tdElm, 'scope');
32
33 // Setup form
34 addClassesToList('class', 'table_cell_styles');
35 TinyMCE_EditableSelects.init();
36
37 formObj.bordercolor.value = bordercolor;
38 formObj.bgcolor.value = bgcolor;
39 formObj.backgroundimage.value = backgroundimage;
40 formObj.width.value = width;
41 formObj.height.value = height;
42 formObj.id.value = id;
43 formObj.lang.value = lang;
44 formObj.style.value = ed.dom.serializeStyle(st);
45 selectByValue(formObj, 'align', align);
46 selectByValue(formObj, 'valign', valign);
47 selectByValue(formObj, 'class', className, true, true);
48 selectByValue(formObj, 'celltype', celltype);
49 selectByValue(formObj, 'dir', dir);
50 selectByValue(formObj, 'scope', scope);
51
52 // Resize some elements
53 if (isVisible('backgroundimagebrowser'))
54 document.getElementById('backgroundimage').style.width = '180px';
55
56 updateColor('bordercolor_pick', 'bordercolor');
57 updateColor('bgcolor_pick', 'bgcolor');
58}
59
60function updateAction() {
61 var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
62
63 tinyMCEPopup.restoreSelection();
64 el = ed.selection.getNode();
65 tdElm = ed.dom.getParent(el, "td,th");
66 trElm = ed.dom.getParent(el, "tr");
67 tableElm = ed.dom.getParent(el, "table");
68
69 ed.execCommand('mceBeginUndoLevel');
70
71 switch (getSelectValue(formObj, 'action')) {
72 case "cell":
73 var celltype = getSelectValue(formObj, 'celltype');
74 var scope = getSelectValue(formObj, 'scope');
75
76 function doUpdate(s) {
77 if (s) {
78 updateCell(tdElm);
79
80 ed.addVisual();
81 ed.nodeChanged();
82 inst.execCommand('mceEndUndoLevel');
83 tinyMCEPopup.close();
84 }
85 };
86
87 if (ed.getParam("accessibility_warnings", 1)) {
88 if (celltype == "th" && scope == "")
89 tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate);
90 else
91 doUpdate(1);
92
93 return;
94 }
95
96 updateCell(tdElm);
97 break;
98
99 case "row":
100 var cell = trElm.firstChild;
101
102 if (cell.nodeName != "TD" && cell.nodeName != "TH")
103 cell = nextCell(cell);
104
105 do {
106 cell = updateCell(cell, true);
107 } while ((cell = nextCell(cell)) != null);
108
109 break;
110
111 case "all":
112 var rows = tableElm.getElementsByTagName("tr");
113
114 for (var i=0; i<rows.length; i++) {
115 var cell = rows[i].firstChild;
116
117 if (cell.nodeName != "TD" && cell.nodeName != "TH")
118 cell = nextCell(cell);
119
120 do {
121 cell = updateCell(cell, true);
122 } while ((cell = nextCell(cell)) != null);
123 }
124
125 break;
126 }
127
128 ed.addVisual();
129 ed.nodeChanged();
130 inst.execCommand('mceEndUndoLevel');
131 tinyMCEPopup.close();
132}
133
134function nextCell(elm) {
135 while ((elm = elm.nextSibling) != null) {
136 if (elm.nodeName == "TD" || elm.nodeName == "TH")
137 return elm;
138 }
139
140 return null;
141}
142
143function updateCell(td, skip_id) {
144 var inst = ed;
145 var formObj = document.forms[0];
146 var curCellType = td.nodeName.toLowerCase();
147 var celltype = getSelectValue(formObj, 'celltype');
148 var doc = inst.getDoc();
149 var dom = ed.dom;
150
151 if (!skip_id)
152 td.setAttribute('id', formObj.id.value);
153
154 td.setAttribute('align', formObj.align.value);
155 td.setAttribute('vAlign', formObj.valign.value);
156 td.setAttribute('lang', formObj.lang.value);
157 td.setAttribute('dir', getSelectValue(formObj, 'dir'));
158 td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));
159 td.setAttribute('scope', formObj.scope.value);
160 ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
161
162 // Clear deprecated attributes
163 ed.dom.setAttrib(td, 'width', '');
164 ed.dom.setAttrib(td, 'height', '');
165 ed.dom.setAttrib(td, 'bgColor', '');
166 ed.dom.setAttrib(td, 'borderColor', '');
167 ed.dom.setAttrib(td, 'background', '');
168
169 // Set styles
170 td.style.width = getCSSSize(formObj.width.value);
171 td.style.height = getCSSSize(formObj.height.value);
172 if (formObj.bordercolor.value != "") {
173 td.style.borderColor = formObj.bordercolor.value;
174 td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
175 td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
176 } else
177 td.style.borderColor = '';
178
179 td.style.backgroundColor = formObj.bgcolor.value;
180
181 if (formObj.backgroundimage.value != "")
182 td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
183 else
184 td.style.backgroundImage = '';
185
186 if (curCellType != celltype) {
187 // changing to a different node type
188 var newCell = doc.createElement(celltype);
189
190 for (var c=0; c<td.childNodes.length; c++)
191 newCell.appendChild(td.childNodes[c].cloneNode(1));
192
193 for (var a=0; a<td.attributes.length; a++)
194 ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name));
195
196 td.parentNode.replaceChild(newCell, td);
197 td = newCell;
198 }
199
200 dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText)));
201
202 return td;
203}
204
205function changedBackgroundImage() {
206 var formObj = document.forms[0];
207 var st = ed.dom.parseStyle(formObj.style.value);
208
209 st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
210
211 formObj.style.value = ed.dom.serializeStyle(st);
212}
213
214function changedSize() {
215 var formObj = document.forms[0];
216 var st = ed.dom.parseStyle(formObj.style.value);
217
218 var width = formObj.width.value;
219 if (width != "")
220 st['width'] = getCSSSize(width);
221 else
222 st['width'] = "";
223
224 var height = formObj.height.value;
225 if (height != "")
226 st['height'] = getCSSSize(height);
227 else
228 st['height'] = "";
229
230 formObj.style.value = ed.dom.serializeStyle(st);
231}
232
233function changedColor() {
234 var formObj = document.forms[0];
235 var st = ed.dom.parseStyle(formObj.style.value);
236
237 st['background-color'] = formObj.bgcolor.value;
238 st['border-color'] = formObj.bordercolor.value;
239
240 formObj.style.value = ed.dom.serializeStyle(st);
241}
242
243function changedStyle() {
244 var formObj = document.forms[0];
245 var st = ed.dom.parseStyle(formObj.style.value);
246
247 if (st['background-image'])
248 formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
249 else
250 formObj.backgroundimage.value = '';
251
252 if (st['width'])
253 formObj.width.value = trimSize(st['width']);
254
255 if (st['height'])
256 formObj.height.value = trimSize(st['height']);
257
258 if (st['background-color']) {
259 formObj.bgcolor.value = st['background-color'];
260 updateColor('bgcolor_pick','bgcolor');
261 }
262
263 if (st['border-color']) {
264 formObj.bordercolor.value = st['border-color'];
265 updateColor('bordercolor_pick','bordercolor');
266 }
267}
268
269tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js b/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js
new file mode 100755
index 0000000..31d6df0
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js
@@ -0,0 +1,29 @@
1tinyMCEPopup.requireLangPack();
2
3function init() {
4 var f = document.forms[0], v;
5
6 tinyMCEPopup.resizeToInnerSize();
7
8 f.numcols.value = tinyMCEPopup.getWindowArg('numcols', 1);
9 f.numrows.value = tinyMCEPopup.getWindowArg('numrows', 1);
10}
11
12function mergeCells() {
13 var args = [], f = document.forms[0];
14
15 tinyMCEPopup.restoreSelection();
16
17 if (!AutoValidator.validate(f)) {
18 tinyMCEPopup.alert(tinyMCEPopup.getLang('invalid_data'));
19 return false;
20 }
21
22 args["numcols"] = f.numcols.value;
23 args["numrows"] = f.numrows.value;
24
25 tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
26 tinyMCEPopup.close();
27}
28
29tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/table/js/row.js b/public/javascripts/tiny_mce/plugins/table/js/row.js
new file mode 100755
index 0000000..d25f635
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/js/row.js
@@ -0,0 +1,212 @@
1tinyMCEPopup.requireLangPack();
2
3function init() {
4 tinyMCEPopup.resizeToInnerSize();
5
6 document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
7 document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
8
9 var inst = tinyMCEPopup.editor;
10 var dom = inst.dom;
11 var trElm = dom.getParent(inst.selection.getNode(), "tr");
12 var formObj = document.forms[0];
13 var st = dom.parseStyle(dom.getAttrib(trElm, "style"));
14
15 // Get table row data
16 var rowtype = trElm.parentNode.nodeName.toLowerCase();
17 var align = dom.getAttrib(trElm, 'align');
18 var valign = dom.getAttrib(trElm, 'valign');
19 var height = trimSize(getStyle(trElm, 'height', 'height'));
20 var className = dom.getAttrib(trElm, 'class');
21 var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
22 var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
23 var id = dom.getAttrib(trElm, 'id');
24 var lang = dom.getAttrib(trElm, 'lang');
25 var dir = dom.getAttrib(trElm, 'dir');
26
27 // Setup form
28 addClassesToList('class', 'table_row_styles');
29 TinyMCE_EditableSelects.init();
30
31 formObj.bgcolor.value = bgcolor;
32 formObj.backgroundimage.value = backgroundimage;
33 formObj.height.value = height;
34 formObj.id.value = id;
35 formObj.lang.value = lang;
36 formObj.style.value = dom.serializeStyle(st);
37 selectByValue(formObj, 'align', align);
38 selectByValue(formObj, 'valign', valign);
39 selectByValue(formObj, 'class', className, true, true);
40 selectByValue(formObj, 'rowtype', rowtype);
41 selectByValue(formObj, 'dir', dir);
42
43 // Resize some elements
44 if (isVisible('backgroundimagebrowser'))
45 document.getElementById('backgroundimage').style.width = '180px';
46
47 updateColor('bgcolor_pick', 'bgcolor');
48}
49
50function updateAction() {
51 var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];
52 var action = getSelectValue(formObj, 'action');
53
54 tinyMCEPopup.restoreSelection();
55 trElm = dom.getParent(inst.selection.getNode(), "tr");
56 tableElm = dom.getParent(inst.selection.getNode(), "table");
57
58 inst.execCommand('mceBeginUndoLevel');
59
60 switch (action) {
61 case "row":
62 updateRow(trElm);
63 break;
64
65 case "all":
66 var rows = tableElm.getElementsByTagName("tr");
67
68 for (var i=0; i<rows.length; i++)
69 updateRow(rows[i], true);
70
71 break;
72
73 case "odd":
74 case "even":
75 var rows = tableElm.getElementsByTagName("tr");
76
77 for (var i=0; i<rows.length; i++) {
78 if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
79 updateRow(rows[i], true, true);
80 }
81
82 break;
83 }
84
85 inst.addVisual();
86 inst.nodeChanged();
87 inst.execCommand('mceEndUndoLevel');
88 tinyMCEPopup.close();
89}
90
91function updateRow(tr_elm, skip_id, skip_parent) {
92 var inst = tinyMCEPopup.editor;
93 var formObj = document.forms[0];
94 var dom = inst.dom;
95 var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
96 var rowtype = getSelectValue(formObj, 'rowtype');
97 var doc = inst.getDoc();
98
99 // Update row element
100 if (!skip_id)
101 tr_elm.setAttribute('id', formObj.id.value);
102
103 tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
104 tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
105 tr_elm.setAttribute('lang', formObj.lang.value);
106 tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
107 tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));
108 dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
109
110 // Clear deprecated attributes
111 tr_elm.setAttribute('background', '');
112 tr_elm.setAttribute('bgColor', '');
113 tr_elm.setAttribute('height', '');
114
115 // Set styles
116 tr_elm.style.height = getCSSSize(formObj.height.value);
117 tr_elm.style.backgroundColor = formObj.bgcolor.value;
118
119 if (formObj.backgroundimage.value != "")
120 tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
121 else
122 tr_elm.style.backgroundImage = '';
123
124 // Setup new rowtype
125 if (curRowType != rowtype && !skip_parent) {
126 // first, clone the node we are working on
127 var newRow = tr_elm.cloneNode(1);
128
129 // next, find the parent of its new destination (creating it if necessary)
130 var theTable = dom.getParent(tr_elm, "table");
131 var dest = rowtype;
132 var newParent = null;
133 for (var i = 0; i < theTable.childNodes.length; i++) {
134 if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
135 newParent = theTable.childNodes[i];
136 }
137
138 if (newParent == null) {
139 newParent = doc.createElement(dest);
140
141 if (dest == "thead") {
142 if (theTable.firstChild.nodeName == 'CAPTION')
143 inst.dom.insertAfter(newParent, theTable.firstChild);
144 else
145 theTable.insertBefore(newParent, theTable.firstChild);
146 } else
147 theTable.appendChild(newParent);
148 }
149
150 // append the row to the new parent
151 newParent.appendChild(newRow);
152
153 // remove the original
154 tr_elm.parentNode.removeChild(tr_elm);
155
156 // set tr_elm to the new node
157 tr_elm = newRow;
158 }
159
160 dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));
161}
162
163function changedBackgroundImage() {
164 var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
165 var st = dom.parseStyle(formObj.style.value);
166
167 st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
168
169 formObj.style.value = dom.serializeStyle(st);
170}
171
172function changedStyle() {
173 var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
174 var st = dom.parseStyle(formObj.style.value);
175
176 if (st['background-image'])
177 formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
178 else
179 formObj.backgroundimage.value = '';
180
181 if (st['height'])
182 formObj.height.value = trimSize(st['height']);
183
184 if (st['background-color']) {
185 formObj.bgcolor.value = st['background-color'];
186 updateColor('bgcolor_pick','bgcolor');
187 }
188}
189
190function changedSize() {
191 var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
192 var st = dom.parseStyle(formObj.style.value);
193
194 var height = formObj.height.value;
195 if (height != "")
196 st['height'] = getCSSSize(height);
197 else
198 st['height'] = "";
199
200 formObj.style.value = dom.serializeStyle(st);
201}
202
203function changedColor() {
204 var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
205 var st = dom.parseStyle(formObj.style.value);
206
207 st['background-color'] = formObj.bgcolor.value;
208
209 formObj.style.value = dom.serializeStyle(st);
210}
211
212tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/table/js/table.js b/public/javascripts/tiny_mce/plugins/table/js/table.js
new file mode 100755
index 0000000..a7f3c3a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/js/table.js
@@ -0,0 +1,413 @@
1tinyMCEPopup.requireLangPack();
2
3var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom;
4
5function insertTable() {
6 var formObj = document.forms[0];
7 var inst = tinyMCEPopup.editor, dom = inst.dom;
8 var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;
9 var html = '', capEl, elm;
10 var cellLimit, rowLimit, colLimit;
11
12 tinyMCEPopup.restoreSelection();
13
14 if (!AutoValidator.validate(formObj)) {
15 tinyMCEPopup.alert(inst.getLang('invalid_data'));
16 return false;
17 }
18
19 elm = dom.getParent(inst.selection.getNode(), 'table');
20
21 // Get form data
22 cols = formObj.elements['cols'].value;
23 rows = formObj.elements['rows'].value;
24 border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
25 cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
26 cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
27 align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
28 frame = formObj.elements['frame'].options[formObj.elements['frame'].selectedIndex].value;
29 rules = formObj.elements['rules'].options[formObj.elements['rules'].selectedIndex].value;
30 width = formObj.elements['width'].value;
31 height = formObj.elements['height'].value;
32 bordercolor = formObj.elements['bordercolor'].value;
33 bgcolor = formObj.elements['bgcolor'].value;
34 className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
35 id = formObj.elements['id'].value;
36 summary = formObj.elements['summary'].value;
37 style = formObj.elements['style'].value;
38 dir = formObj.elements['dir'].value;
39 lang = formObj.elements['lang'].value;
40 background = formObj.elements['backgroundimage'].value;
41 caption = formObj.elements['caption'].checked;
42
43 cellLimit = tinyMCEPopup.getParam('table_cell_limit', false);
44 rowLimit = tinyMCEPopup.getParam('table_row_limit', false);
45 colLimit = tinyMCEPopup.getParam('table_col_limit', false);
46
47 // Validate table size
48 if (colLimit && cols > colLimit) {
49 tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));
50 return false;
51 } else if (rowLimit && rows > rowLimit) {
52 tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));
53 return false;
54 } else if (cellLimit && cols * rows > cellLimit) {
55 tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));
56 return false;
57 }
58
59 // Update table
60 if (action == "update") {
61 inst.execCommand('mceBeginUndoLevel');
62
63 dom.setAttrib(elm, 'cellPadding', cellpadding, true);
64 dom.setAttrib(elm, 'cellSpacing', cellspacing, true);
65 dom.setAttrib(elm, 'border', border);
66 dom.setAttrib(elm, 'align', align);
67 dom.setAttrib(elm, 'frame', frame);
68 dom.setAttrib(elm, 'rules', rules);
69 dom.setAttrib(elm, 'class', className);
70 dom.setAttrib(elm, 'style', style);
71 dom.setAttrib(elm, 'id', id);
72 dom.setAttrib(elm, 'summary', summary);
73 dom.setAttrib(elm, 'dir', dir);
74 dom.setAttrib(elm, 'lang', lang);
75
76 capEl = inst.dom.select('caption', elm)[0];
77
78 if (capEl && !caption)
79 capEl.parentNode.removeChild(capEl);
80
81 if (!capEl && caption) {
82 capEl = elm.ownerDocument.createElement('caption');
83
84 if (!tinymce.isIE)
85 capEl.innerHTML = '<br mce_bogus="1"/>';
86
87 elm.insertBefore(capEl, elm.firstChild);
88 }
89
90 if (width && inst.settings.inline_styles) {
91 dom.setStyle(elm, 'width', width);
92 dom.setAttrib(elm, 'width', '');
93 } else {
94 dom.setAttrib(elm, 'width', width, true);
95 dom.setStyle(elm, 'width', '');
96 }
97
98 // Remove these since they are not valid XHTML
99 dom.setAttrib(elm, 'borderColor', '');
100 dom.setAttrib(elm, 'bgColor', '');
101 dom.setAttrib(elm, 'background', '');
102
103 if (height && inst.settings.inline_styles) {
104 dom.setStyle(elm, 'height', height);
105 dom.setAttrib(elm, 'height', '');
106 } else {
107 dom.setAttrib(elm, 'height', height, true);
108 dom.setStyle(elm, 'height', '');
109 }
110
111 if (background != '')
112 elm.style.backgroundImage = "url('" + background + "')";
113 else
114 elm.style.backgroundImage = '';
115
116/* if (tinyMCEPopup.getParam("inline_styles")) {
117 if (width != '')
118 elm.style.width = getCSSSize(width);
119 }*/
120
121 if (bordercolor != "") {
122 elm.style.borderColor = bordercolor;
123 elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
124 elm.style.borderWidth = border == "" ? "1px" : border;
125 } else
126 elm.style.borderColor = '';
127
128 elm.style.backgroundColor = bgcolor;
129 elm.style.height = getCSSSize(height);
130
131 inst.addVisual();
132
133 // Fix for stange MSIE align bug
134 //elm.outerHTML = elm.outerHTML;
135
136 inst.nodeChanged();
137 inst.execCommand('mceEndUndoLevel');
138
139 // Repaint if dimensions changed
140 if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
141 inst.execCommand('mceRepaint');
142
143 tinyMCEPopup.close();
144 return true;
145 }
146
147 // Create new table
148 html += '<table';
149
150 html += makeAttrib('id', id);
151 html += makeAttrib('border', border);
152 html += makeAttrib('cellpadding', cellpadding);
153 html += makeAttrib('cellspacing', cellspacing);
154
155 if (width && inst.settings.inline_styles) {
156 if (style)
157 style += '; ';
158
159 style += 'width: ' + width;
160 } else
161 html += makeAttrib('width', width);
162
163/* if (height) {
164 if (style)
165 style += '; ';
166
167 style += 'height: ' + height;
168 }*/
169
170 //html += makeAttrib('height', height);
171 //html += makeAttrib('bordercolor', bordercolor);
172 //html += makeAttrib('bgcolor', bgcolor);
173 html += makeAttrib('align', align);
174 html += makeAttrib('frame', frame);
175 html += makeAttrib('rules', rules);
176 html += makeAttrib('class', className);
177 html += makeAttrib('style', style);
178 html += makeAttrib('summary', summary);
179 html += makeAttrib('dir', dir);
180 html += makeAttrib('lang', lang);
181 html += '>';
182
183 if (caption) {
184 if (!tinymce.isIE)
185 html += '<caption><br mce_bogus="1"/></caption>';
186 else
187 html += '<caption></caption>';
188 }
189
190 for (var y=0; y<rows; y++) {
191 html += "<tr>";
192
193 for (var x=0; x<cols; x++) {
194 if (!tinymce.isIE)
195 html += '<td><br mce_bogus="1"/></td>';
196 else
197 html += '<td></td>';
198 }
199
200 html += "</tr>";
201 }
202
203 html += "</table>";
204
205 inst.execCommand('mceBeginUndoLevel');
206 inst.execCommand('mceInsertContent', false, html);
207 inst.addVisual();
208 inst.execCommand('mceEndUndoLevel');
209
210 tinyMCEPopup.close();
211}
212
213function makeAttrib(attrib, value) {
214 var formObj = document.forms[0];
215 var valueElm = formObj.elements[attrib];
216
217 if (typeof(value) == "undefined" || value == null) {
218 value = "";
219
220 if (valueElm)
221 value = valueElm.value;
222 }
223
224 if (value == "")
225 return "";
226
227 // XML encode it
228 value = value.replace(/&/g, '&amp;');
229 value = value.replace(/\"/g, '&quot;');
230 value = value.replace(/</g, '&lt;');
231 value = value.replace(/>/g, '&gt;');
232
233 return ' ' + attrib + '="' + value + '"';
234}
235
236function init() {
237 tinyMCEPopup.resizeToInnerSize();
238
239 document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
240 document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
241 document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
242 document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
243
244 var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');
245 var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
246 var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame;
247 var inst = tinyMCEPopup.editor, dom = inst.dom;
248 var formObj = document.forms[0];
249 var elm = dom.getParent(inst.selection.getNode(), "table");
250
251 action = tinyMCEPopup.getWindowArg('action');
252
253 if (!action)
254 action = elm ? "update" : "insert";
255
256 if (elm && action != "insert") {
257 var rowsAr = elm.rows;
258 var cols = 0;
259 for (var i=0; i<rowsAr.length; i++)
260 if (rowsAr[i].cells.length > cols)
261 cols = rowsAr[i].cells.length;
262
263 cols = cols;
264 rows = rowsAr.length;
265
266 st = dom.parseStyle(dom.getAttrib(elm, "style"));
267 border = trimSize(getStyle(elm, 'border', 'borderWidth'));
268 cellpadding = dom.getAttrib(elm, 'cellpadding', "");
269 cellspacing = dom.getAttrib(elm, 'cellspacing', "");
270 width = trimSize(getStyle(elm, 'width', 'width'));
271 height = trimSize(getStyle(elm, 'height', 'height'));
272 bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
273 bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));
274 align = dom.getAttrib(elm, 'align', align);
275 frame = dom.getAttrib(elm, 'frame');
276 rules = dom.getAttrib(elm, 'rules');
277 className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, ''));
278 id = dom.getAttrib(elm, 'id');
279 summary = dom.getAttrib(elm, 'summary');
280 style = dom.serializeStyle(st);
281 dir = dom.getAttrib(elm, 'dir');
282 lang = dom.getAttrib(elm, 'lang');
283 background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
284 formObj.caption.checked = elm.getElementsByTagName('caption').length > 0;
285
286 orgTableWidth = width;
287 orgTableHeight = height;
288
289 action = "update";
290 formObj.insert.value = inst.getLang('update');
291 }
292
293 addClassesToList('class', "table_styles");
294 TinyMCE_EditableSelects.init();
295
296 // Update form
297 selectByValue(formObj, 'align', align);
298 selectByValue(formObj, 'frame', frame);
299 selectByValue(formObj, 'rules', rules);
300 selectByValue(formObj, 'class', className, true, true);
301 formObj.cols.value = cols;
302 formObj.rows.value = rows;
303 formObj.border.value = border;
304 formObj.cellpadding.value = cellpadding;
305 formObj.cellspacing.value = cellspacing;
306 formObj.width.value = width;
307 formObj.height.value = height;
308 formObj.bordercolor.value = bordercolor;
309 formObj.bgcolor.value = bgcolor;
310 formObj.id.value = id;
311 formObj.summary.value = summary;
312 formObj.style.value = style;
313 formObj.dir.value = dir;
314 formObj.lang.value = lang;
315 formObj.backgroundimage.value = background;
316
317 updateColor('bordercolor_pick', 'bordercolor');
318 updateColor('bgcolor_pick', 'bgcolor');
319
320 // Resize some elements
321 if (isVisible('backgroundimagebrowser'))
322 document.getElementById('backgroundimage').style.width = '180px';
323
324 // Disable some fields in update mode
325 if (action == "update") {
326 formObj.cols.disabled = true;
327 formObj.rows.disabled = true;
328 }
329}
330
331function changedSize() {
332 var formObj = document.forms[0];
333 var st = dom.parseStyle(formObj.style.value);
334
335/* var width = formObj.width.value;
336 if (width != "")
337 st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : "";
338 else
339 st['width'] = "";*/
340
341 var height = formObj.height.value;
342 if (height != "")
343 st['height'] = getCSSSize(height);
344 else
345 st['height'] = "";
346
347 formObj.style.value = dom.serializeStyle(st);
348}
349
350function changedBackgroundImage() {
351 var formObj = document.forms[0];
352 var st = dom.parseStyle(formObj.style.value);
353
354 st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
355
356 formObj.style.value = dom.serializeStyle(st);
357}
358
359function changedBorder() {
360 var formObj = document.forms[0];
361 var st = dom.parseStyle(formObj.style.value);
362
363 // Update border width if the element has a color
364 if (formObj.border.value != "" && formObj.bordercolor.value != "")
365 st['border-width'] = formObj.border.value + "px";
366
367 formObj.style.value = dom.serializeStyle(st);
368}
369
370function changedColor() {
371 var formObj = document.forms[0];
372 var st = dom.parseStyle(formObj.style.value);
373
374 st['background-color'] = formObj.bgcolor.value;
375
376 if (formObj.bordercolor.value != "") {
377 st['border-color'] = formObj.bordercolor.value;
378
379 // Add border-width if it's missing
380 if (!st['border-width'])
381 st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
382 }
383
384 formObj.style.value = dom.serializeStyle(st);
385}
386
387function changedStyle() {
388 var formObj = document.forms[0];
389 var st = dom.parseStyle(formObj.style.value);
390
391 if (st['background-image'])
392 formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
393 else
394 formObj.backgroundimage.value = '';
395
396 if (st['width'])
397 formObj.width.value = trimSize(st['width']);
398
399 if (st['height'])
400 formObj.height.value = trimSize(st['height']);
401
402 if (st['background-color']) {
403 formObj.bgcolor.value = st['background-color'];
404 updateColor('bgcolor_pick','bgcolor');
405 }
406
407 if (st['border-color']) {
408 formObj.bordercolor.value = st['border-color'];
409 updateColor('bordercolor_pick','bordercolor');
410 }
411}
412
413tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js
new file mode 100755
index 0000000..000332a
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js
@@ -0,0 +1,74 @@
1tinyMCE.addI18n('en.table_dlg',{
2general_tab:"General",
3advanced_tab:"Advanced",
4general_props:"General properties",
5advanced_props:"Advanced properties",
6rowtype:"Row in table part",
7title:"Insert/Modify table",
8width:"Width",
9height:"Height",
10cols:"Cols",
11rows:"Rows",
12cellspacing:"Cellspacing",
13cellpadding:"Cellpadding",
14border:"Border",
15align:"Alignment",
16align_default:"Default",
17align_left:"Left",
18align_right:"Right",
19align_middle:"Center",
20row_title:"Table row properties",
21cell_title:"Table cell properties",
22cell_type:"Cell type",
23valign:"Vertical alignment",
24align_top:"Top",
25align_bottom:"Bottom",
26bordercolor:"Border color",
27bgcolor:"Background color",
28merge_cells_title:"Merge table cells",
29id:"Id",
30style:"Style",
31langdir:"Language direction",
32langcode:"Language code",
33mime:"Target MIME type",
34ltr:"Left to right",
35rtl:"Right to left",
36bgimage:"Background image",
37summary:"Summary",
38td:"Data",
39th:"Header",
40cell_cell:"Update current cell",
41cell_row:"Update all cells in row",
42cell_all:"Update all cells in table",
43row_row:"Update current row",
44row_odd:"Update odd rows in table",
45row_even:"Update even rows in table",
46row_all:"Update all rows in table",
47thead:"Table Head",
48tbody:"Table Body",
49tfoot:"Table Foot",
50scope:"Scope",
51rowgroup:"Row Group",
52colgroup:"Col Group",
53col_limit:"You've exceeded the maximum number of columns of {$cols}.",
54row_limit:"You've exceeded the maximum number of rows of {$rows}.",
55cell_limit:"You've exceeded the maximum number of cells of {$cells}.",
56missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",
57caption:"Table caption",
58frame:"Frame",
59frame_none:"none",
60frame_groups:"groups",
61frame_rows:"rows",
62frame_cols:"cols",
63frame_all:"all",
64rules:"Rules",
65rules_void:"void",
66rules_above:"above",
67rules_below:"below",
68rules_hsides:"hsides",
69rules_lhs:"lhs",
70rules_rhs:"rhs",
71rules_vsides:"vsides",
72rules_box:"box",
73rules_border:"border"
74}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/table/merge_cells.htm b/public/javascripts/tiny_mce/plugins/table/merge_cells.htm
new file mode 100755
index 0000000..9d34a88
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/merge_cells.htm
@@ -0,0 +1,38 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#table_dlg.merge_cells_title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/validate.js"></script>
8 <script type="text/javascript" src="js/merge_cells.js"></script>
9 <base target="_self" />
10</head>
11<body style="margin: 8px" style="display: none">
12<form onsubmit="mergeCells();return false;" action="#">
13 <fieldset>
14 <legend>{#table_dlg.merge_cells_title}</legend>
15 <table border="0" cellpadding="0" cellspacing="3" width="100%">
16 <tr>
17 <td>{#table_dlg.cols}:</td>
18 <td align="right"><input type="text" name="numcols" value="" class="number min1 mceFocus" style="width: 30px" /></td>
19 </tr>
20 <tr>
21 <td>{#table_dlg.rows}:</td>
22 <td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>
23 </tr>
24 </table>
25 </fieldset>
26
27 <div class="mceActionPanel">
28 <div style="float: left">
29 <input type="submit" id="insert" name="insert" value="{#update}" />
30 </div>
31
32 <div style="float: right">
33 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
34 </div>
35 </div>
36</form>
37</body>
38</html>
diff --git a/public/javascripts/tiny_mce/plugins/table/row.htm b/public/javascripts/tiny_mce/plugins/table/row.htm
new file mode 100755
index 0000000..fe75bf6
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/row.htm
@@ -0,0 +1,161 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#table_dlg.row_title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9 <script type="text/javascript" src="js/row.js"></script>
10 <link href="css/row.css" rel="stylesheet" type="text/css" />
11 <base target="_self" />
12</head>
13<body id="tablerow" style="display: none">
14 <form onsubmit="updateAction();return false;">
15 <div class="tabs">
16 <ul>
17 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
18 <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
19 </ul>
20 </div>
21
22 <div class="panel_wrapper">
23 <div id="general_panel" class="panel current">
24 <fieldset>
25 <legend>{#table_dlg.general_props}</legend>
26
27 <table border="0" cellpadding="4" cellspacing="0">
28 <tr>
29 <td><label for="rowtype">{#table_dlg.rowtype}</label></td>
30 <td class="col2">
31 <select id="rowtype" name="rowtype" class="mceFocus">
32 <option value="thead">{#table_dlg.thead}</option>
33 <option value="tbody">{#table_dlg.tbody}</option>
34 <option value="tfoot">{#table_dlg.tfoot}</option>
35 </select>
36 </td>
37 </tr>
38
39 <tr>
40 <td><label for="align">{#table_dlg.align}</label></td>
41 <td class="col2">
42 <select id="align" name="align">
43 <option value="">{#not_set}</option>
44 <option value="center">{#table_dlg.align_middle}</option>
45 <option value="left">{#table_dlg.align_left}</option>
46 <option value="right">{#table_dlg.align_right}</option>
47 </select>
48 </td>
49 </tr>
50
51 <tr>
52 <td><label for="valign">{#table_dlg.valign}</label></td>
53 <td class="col2">
54 <select id="valign" name="valign">
55 <option value="">{#not_set}</option>
56 <option value="top">{#table_dlg.align_top}</option>
57 <option value="middle">{#table_dlg.align_middle}</option>
58 <option value="bottom">{#table_dlg.align_bottom}</option>
59 </select>
60 </td>
61 </tr>
62
63 <tr id="styleSelectRow">
64 <td><label for="class">{#class_name}</label></td>
65 <td class="col2">
66 <select id="class" name="class" class="mceEditableSelect">
67 <option value="" selected="selected">{#not_set}</option>
68 </select>
69 </td>
70 </tr>
71
72 <tr>
73 <td><label for="height">{#table_dlg.height}</label></td>
74 <td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
75 </tr>
76 </table>
77 </fieldset>
78 </div>
79
80 <div id="advanced_panel" class="panel">
81 <fieldset>
82 <legend>{#table_dlg.advanced_props}</legend>
83
84 <table border="0" cellpadding="0" cellspacing="4">
85 <tr>
86 <td class="column1"><label for="id">{#table_dlg.id}</label></td>
87 <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
88 </tr>
89
90 <tr>
91 <td><label for="style">{#table_dlg.style}</label></td>
92 <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
93 </tr>
94
95 <tr>
96 <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
97 <td>
98 <select id="dir" name="dir" style="width: 200px">
99 <option value="">{#not_set}</option>
100 <option value="ltr">{#table_dlg.ltr}</option>
101 <option value="rtl">{#table_dlg.rtl}</option>
102 </select>
103 </td>
104 </tr>
105
106 <tr>
107 <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
108 <td>
109 <input id="lang" name="lang" type="text" value="" style="width: 200px" />
110 </td>
111 </tr>
112
113 <tr>
114 <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
115 <td>
116 <table border="0" cellpadding="0" cellspacing="0">
117 <tr>
118 <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
119 <td id="backgroundimagebrowsercontainer">&nbsp;</td>
120 </tr>
121 </table>
122 </td>
123 </tr>
124
125 <tr>
126 <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
127 <td>
128 <table border="0" cellpadding="0" cellspacing="0">
129 <tr>
130 <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
131 <td id="bgcolor_pickcontainer">&nbsp;</td>
132 </tr>
133 </table>
134 </td>
135 </tr>
136 </table>
137 </fieldset>
138 </div>
139 </div>
140
141 <div class="mceActionPanel">
142 <div>
143 <select id="action" name="action">
144 <option value="row">{#table_dlg.row_row}</option>
145 <option value="odd">{#table_dlg.row_odd}</option>
146 <option value="even">{#table_dlg.row_even}</option>
147 <option value="all">{#table_dlg.row_all}</option>
148 </select>
149 </div>
150
151 <div style="float: left">
152 <div><input type="submit" id="insert" name="insert" value="{#update}" /></div>
153 </div>
154
155 <div style="float: right">
156 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
157 </div>
158 </div>
159 </form>
160</body>
161</html>
diff --git a/public/javascripts/tiny_mce/plugins/table/table.htm b/public/javascripts/tiny_mce/plugins/table/table.htm
new file mode 100755
index 0000000..75136e6
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/table/table.htm
@@ -0,0 +1,193 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#table_dlg.title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="../../utils/validate.js"></script>
9 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
10 <script type="text/javascript" src="js/table.js"></script>
11 <link href="css/table.css" rel="stylesheet" type="text/css" />
12 <base target="_self" />
13</head>
14<body id="table" style="display: none">
15 <form onsubmit="insertTable();return false;" action="#">
16 <div class="tabs">
17 <ul>
18 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
19 <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
20 </ul>
21 </div>
22
23 <div class="panel_wrapper">
24 <div id="general_panel" class="panel current">
25 <fieldset>
26 <legend>{#table_dlg.general_props}</legend>
27 <table border="0" cellpadding="4" cellspacing="0" width="100%">
28 <tr>
29 <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td>
30 <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" /></td>
31 <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td>
32 <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
33 </tr>
34 <tr>
35 <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>
36 <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
37 <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>
38 <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
39 </tr>
40 <tr>
41 <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>
42 <td><select id="align" name="align">
43 <option value="">{#not_set}</option>
44 <option value="center">{#table_dlg.align_middle}</option>
45 <option value="left">{#table_dlg.align_left}</option>
46 <option value="right">{#table_dlg.align_right}</option>
47 </select></td>
48 <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td>
49 <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>
50 </tr>
51 <tr id="width_row">
52 <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td>
53 <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
54 <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td>
55 <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
56 </tr>
57 <tr id="styleSelectRow">
58 <td><label id="classlabel" for="class">{#class_name}</label></td>
59 <td colspan="3">
60 <select id="class" name="class" class="mceEditableSelect">
61 <option value="" selected>{#not_set}</option>
62 </select></td>
63 </tr>
64 <tr>
65 <td class="column1"><label for="caption">{#table_dlg.caption}</label></td>
66 <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>
67 </tr>
68 </table>
69 </fieldset>
70 </div>
71
72 <div id="advanced_panel" class="panel">
73 <fieldset>
74 <legend>{#table_dlg.advanced_props}</legend>
75
76 <table border="0" cellpadding="0" cellspacing="4">
77 <tr>
78 <td class="column1"><label for="id">{#table_dlg.id}</label></td>
79 <td><input id="id" name="id" type="text" value="" class="advfield" /></td>
80 </tr>
81
82 <tr>
83 <td class="column1"><label for="summary">{#table_dlg.summary}</label></td>
84 <td><input id="summary" name="summary" type="text" value="" class="advfield" /></td>
85 </tr>
86
87 <tr>
88 <td><label for="style">{#table_dlg.style}</label></td>
89 <td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>
90 </tr>
91
92 <tr>
93 <td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td>
94 <td>
95 <input id="lang" name="lang" type="text" value="" class="advfield" />
96 </td>
97 </tr>
98
99 <tr>
100 <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
101 <td>
102 <table border="0" cellpadding="0" cellspacing="0">
103 <tr>
104 <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
105 <td id="backgroundimagebrowsercontainer">&nbsp;</td>
106 </tr>
107 </table>
108 </td>
109 </tr>
110
111 <tr>
112 <td class="column1"><label for="frame">{#table_dlg.frame}</label></td>
113 <td>
114 <select id="frame" name="frame" class="advfield">
115 <option value="">{#not_set}</option>
116 <option value="void">{#table_dlg.rules_void}</option>
117 <option value="above">{#table_dlg.rules_above}</option>
118 <option value="below">{#table_dlg.rules_below}</option>
119 <option value="hsides">{#table_dlg.rules_hsides}</option>
120 <option value="lhs">{#table_dlg.rules_lhs}</option>
121 <option value="rhs">{#table_dlg.rules_rhs}</option>
122 <option value="vsides">{#table_dlg.rules_vsides}</option>
123 <option value="box">{#table_dlg.rules_box}</option>
124 <option value="border">{#table_dlg.rules_border}</option>
125 </select>
126 </td>
127 </tr>
128
129 <tr>
130 <td class="column1"><label for="rules">{#table_dlg.rules}</label></td>
131 <td>
132 <select id="rules" name="rules" class="advfield">
133 <option value="">{#not_set}</option>
134 <option value="none">{#table_dlg.frame_none}</option>
135 <option value="groups">{#table_dlg.frame_groups}</option>
136 <option value="rows">{#table_dlg.frame_rows}</option>
137 <option value="cols">{#table_dlg.frame_cols}</option>
138 <option value="all">{#table_dlg.frame_all}</option>
139 </select>
140 </td>
141 </tr>
142
143 <tr>
144 <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
145 <td>
146 <select id="dir" name="dir" class="advfield">
147 <option value="">{#not_set}</option>
148 <option value="ltr">{#table_dlg.ltr}</option>
149 <option value="rtl">{#table_dlg.rtl}</option>
150 </select>
151 </td>
152 </tr>
153
154 <tr>
155 <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td>
156 <td>
157 <table border="0" cellpadding="0" cellspacing="0">
158 <tr>
159 <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
160 <td id="bordercolor_pickcontainer">&nbsp;</td>
161 </tr>
162 </table>
163 </td>
164 </tr>
165
166 <tr>
167 <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
168 <td>
169 <table border="0" cellpadding="0" cellspacing="0">
170 <tr>
171 <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
172 <td id="bgcolor_pickcontainer">&nbsp;</td>
173 </tr>
174 </table>
175 </td>
176 </tr>
177 </table>
178 </fieldset>
179 </div>
180 </div>
181
182 <div class="mceActionPanel">
183 <div style="float: left">
184 <input type="submit" id="insert" name="insert" value="{#insert}" />
185 </div>
186
187 <div style="float: right">
188 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
189 </div>
190 </div>
191 </form>
192</body>
193</html>
diff --git a/public/javascripts/tiny_mce/plugins/template/blank.htm b/public/javascripts/tiny_mce/plugins/template/blank.htm
new file mode 100755
index 0000000..ecde53f
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/template/blank.htm
@@ -0,0 +1,12 @@
1<html xmlns="http://www.w3.org/1999/xhtml">
2<head>
3 <title>blank_page</title>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <script type="text/javascript">
6 parent.TemplateDialog.loadCSSFiles(document);
7 </script>
8</head>
9<body id="mceTemplatePreview" class="mceContentBody">
10
11</body>
12</html>
diff --git a/public/javascripts/tiny_mce/plugins/template/css/template.css b/public/javascripts/tiny_mce/plugins/template/css/template.css
new file mode 100755
index 0000000..2d23a49
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/template/css/template.css
@@ -0,0 +1,23 @@
1#frmbody {
2 padding: 10px;
3 background-color: #FFF;
4 border: 1px solid #CCC;
5}
6
7.frmRow {
8 margin-bottom: 10px;
9}
10
11#templatesrc {
12 border: none;
13 width: 320px;
14 height: 240px;
15}
16
17.title {
18 padding-bottom: 5px;
19}
20
21.mceActionPanel {
22 padding-top: 5px;
23}
diff --git a/public/javascripts/tiny_mce/plugins/template/editor_plugin.js b/public/javascripts/tiny_mce/plugins/template/editor_plugin.js
new file mode 100755
index 0000000..0f7fb01
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/template/editor_plugin.js
@@ -0,0 +1 @@
(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TemplatePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceTemplate',function(ui){ed.windowManager.open({file:url+'/template.htm',width:ed.getParam('template_popup_width',750),height:ed.getParam('template_popup_height',600),inline:1},{plugin_url:url});});ed.addCommand('mceInsertTemplate',t._insertTemplate,t);ed.addButton('template',{title:'template.desc',cmd:'mceTemplate'});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;each(dom.select('div',o.node),function(e){if(dom.hasClass(e,'mceTmpl')){each(dom.select('*',e),function(e){if(dom.hasClass(e,ed.getParam('template_mdate_classes','mdate').replace(/\s+/g,'|')))e.innerHTML=t._getDateTime(new Date(),ed.getParam("template_mdate_format",ed.getLang("template.mdate_format")));});t._replaceVals(e);}});});},getInfo:function(){return{longname:'Template plugin',author:'Moxiecode Systems AB',authorurl:'http://www.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_insertTemplate:function(ui,v){var t=this,ed=t.editor,h,el,dom=ed.dom,sel=ed.selection.getContent();h=v.content;each(t.editor.getParam('template_replace_values'),function(v,k){if(typeof(v)!='function')h=h.replace(new RegExp('\\{\\$'+k+'\\}','g'),v);});el=dom.create('div',null,h);n=dom.select('.mceTmpl',el);if(n&&n.length>0){el=dom.create('div',null);el.appendChild(n[0].cloneNode(true));}function hasClass(n,c){return new RegExp('\\b'+c+'\\b','g').test(n.className);};each(dom.select('*',el),function(n){if(hasClass(n,ed.getParam('template_cdate_classes','cdate').replace(/\s+/g,'|')))n.innerHTML=t._getDateTime(new Date(),ed.getParam("template_cdate_format",ed.getLang("template.cdate_format")));if(hasClass(n,ed.getParam('template_mdate_classes','mdate').replace(/\s+/g,'|')))n.innerHTML=t._getDateTime(new Date(),ed.getParam("template_mdate_format",ed.getLang("template.mdate_format")));if(hasClass(n,ed.getParam('template_selected_content_classes','selcontent').replace(/\s+/g,'|')))n.innerHTML=sel;});t._replaceVals(el);ed.execCommand('mceInsertContent',false,el.innerHTML);ed.addVisual();},_replaceVals:function(e){var dom=this.editor.dom,vl=this.editor.getParam('template_replace_values');each(dom.select('*',e),function(e){each(vl,function(v,k){if(dom.hasClass(e,k)){if(typeof(vl[k])=='function')vl[k](e);}});});},_getDateTime:function(d,fmt){if(!fmt)return"";function addZeros(value,len){var i;value=""+value;if(value.length<len){for(i=0;i<(len-value.length);i++)value="0"+value;}return value;}fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt.replace("%y",""+d.getYear());fmt=fmt.replace("%m",addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%B",""+tinyMCE.getLang("template_months_long").split(',')[d.getMonth()]);fmt=fmt.replace("%b",""+tinyMCE.getLang("template_months_short").split(',')[d.getMonth()]);fmt=fmt.replace("%A",""+tinyMCE.getLang("template_day_long").split(',')[d.getDay()]);fmt=fmt.replace("%a",""+tinyMCE.getLang("template_day_short").split(',')[d.getDay()]);fmt=fmt.replace("%%","%");return fmt;}});tinymce.PluginManager.add('template',tinymce.plugins.TemplatePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js
new file mode 100755
index 0000000..73ab39e
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js
@@ -0,0 +1,156 @@
1/**
2 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 var each = tinymce.each;
10
11 tinymce.create('tinymce.plugins.TemplatePlugin', {
12 init : function(ed, url) {
13 var t = this;
14
15 t.editor = ed;
16
17 // Register commands
18 ed.addCommand('mceTemplate', function(ui) {
19 ed.windowManager.open({
20 file : url + '/template.htm',
21 width : ed.getParam('template_popup_width', 750),
22 height : ed.getParam('template_popup_height', 600),
23 inline : 1
24 }, {
25 plugin_url : url
26 });
27 });
28
29 ed.addCommand('mceInsertTemplate', t._insertTemplate, t);
30
31 // Register buttons
32 ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'});
33
34 ed.onPreProcess.add(function(ed, o) {
35 var dom = ed.dom;
36
37 each(dom.select('div', o.node), function(e) {
38 if (dom.hasClass(e, 'mceTmpl')) {
39 each(dom.select('*', e), function(e) {
40 if (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|')))
41 e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format")));
42 });
43
44 t._replaceVals(e);
45 }
46 });
47 });
48 },
49
50 getInfo : function() {
51 return {
52 longname : 'Template plugin',
53 author : 'Moxiecode Systems AB',
54 authorurl : 'http://www.moxiecode.com',
55 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template',
56 version : tinymce.majorVersion + "." + tinymce.minorVersion
57 };
58 },
59
60 _insertTemplate : function(ui, v) {
61 var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent();
62
63 h = v.content;
64
65 each(t.editor.getParam('template_replace_values'), function(v, k) {
66 if (typeof(v) != 'function')
67 h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);
68 });
69
70 el = dom.create('div', null, h);
71
72 // Find template element within div
73 n = dom.select('.mceTmpl', el);
74 if (n && n.length > 0) {
75 el = dom.create('div', null);
76 el.appendChild(n[0].cloneNode(true));
77 }
78
79 function hasClass(n, c) {
80 return new RegExp('\\b' + c + '\\b', 'g').test(n.className);
81 };
82
83 each(dom.select('*', el), function(n) {
84 // Replace cdate
85 if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|')))
86 n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format")));
87
88 // Replace mdate
89 if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|')))
90 n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format")));
91
92 // Replace selection
93 if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|')))
94 n.innerHTML = sel;
95 });
96
97 t._replaceVals(el);
98
99 ed.execCommand('mceInsertContent', false, el.innerHTML);
100 ed.addVisual();
101 },
102
103 _replaceVals : function(e) {
104 var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values');
105
106 each(dom.select('*', e), function(e) {
107 each(vl, function(v, k) {
108 if (dom.hasClass(e, k)) {
109 if (typeof(vl[k]) == 'function')
110 vl[k](e);
111 }
112 });
113 });
114 },
115
116 _getDateTime : function(d, fmt) {
117 if (!fmt)
118 return "";
119
120 function addZeros(value, len) {
121 var i;
122
123 value = "" + value;
124
125 if (value.length < len) {
126 for (i=0; i<(len-value.length); i++)
127 value = "0" + value;
128 }
129
130 return value;
131 }
132
133 fmt = fmt.replace("%D", "%m/%d/%y");
134 fmt = fmt.replace("%r", "%I:%M:%S %p");
135 fmt = fmt.replace("%Y", "" + d.getFullYear());
136 fmt = fmt.replace("%y", "" + d.getYear());
137 fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
138 fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
139 fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
140 fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
141 fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
142 fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
143 fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
144 fmt = fmt.replace("%B", "" + tinyMCE.getLang("template_months_long").split(',')[d.getMonth()]);
145 fmt = fmt.replace("%b", "" + tinyMCE.getLang("template_months_short").split(',')[d.getMonth()]);
146 fmt = fmt.replace("%A", "" + tinyMCE.getLang("template_day_long").split(',')[d.getDay()]);
147 fmt = fmt.replace("%a", "" + tinyMCE.getLang("template_day_short").split(',')[d.getDay()]);
148 fmt = fmt.replace("%%", "%");
149
150 return fmt;
151 }
152 });
153
154 // Register plugin
155 tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin);
156})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/template/js/template.js b/public/javascripts/tiny_mce/plugins/template/js/template.js
new file mode 100755
index 0000000..24045d7
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/template/js/template.js
@@ -0,0 +1,106 @@
1tinyMCEPopup.requireLangPack();
2
3var TemplateDialog = {
4 preInit : function() {
5 var url = tinyMCEPopup.getParam("template_external_list_url");
6
7 if (url != null)
8 document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></sc'+'ript>');
9 },
10
11 init : function() {
12 var ed = tinyMCEPopup.editor, tsrc, sel, x, u;
13
14 tsrc = ed.getParam("template_templates", false);
15 sel = document.getElementById('tpath');
16
17 // Setup external template list
18 if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') {
19 for (x=0, tsrc = []; x<tinyMCETemplateList.length; x++)
20 tsrc.push({title : tinyMCETemplateList[x][0], src : tinyMCETemplateList[x][1], description : tinyMCETemplateList[x][2]});
21 }
22
23 for (x=0; x<tsrc.length; x++)
24 sel.options[sel.options.length] = new Option(tsrc[x].title, tinyMCEPopup.editor.documentBaseURI.toAbsolute(tsrc[x].src));
25
26 this.resize();
27 this.tsrc = tsrc;
28 },
29
30 resize : function() {
31 var w, h, e;
32
33 if (!self.innerWidth) {
34 w = document.body.clientWidth - 50;
35 h = document.body.clientHeight - 160;
36 } else {
37 w = self.innerWidth - 50;
38 h = self.innerHeight - 170;
39 }
40
41 e = document.getElementById('templatesrc');
42
43 if (e) {
44 e.style.height = Math.abs(h) + 'px';
45 e.style.width = Math.abs(w - 5) + 'px';
46 }
47 },
48
49 loadCSSFiles : function(d) {
50 var ed = tinyMCEPopup.editor;
51
52 tinymce.each(ed.getParam("content_css", '').split(','), function(u) {
53 d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />');
54 });
55 },
56
57 selectTemplate : function(u, ti) {
58 var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc;
59
60 if (!u)
61 return;
62
63 d.body.innerHTML = this.templateHTML = this.getFileContents(u);
64
65 for (x=0; x<tsrc.length; x++) {
66 if (tsrc[x].title == ti)
67 document.getElementById('tmpldesc').innerHTML = tsrc[x].description || '';
68 }
69 },
70
71 insert : function() {
72 tinyMCEPopup.execCommand('mceInsertTemplate', false, {
73 content : this.templateHTML,
74 selection : tinyMCEPopup.editor.selection.getContent()
75 });
76
77 tinyMCEPopup.close();
78 },
79
80 getFileContents : function(u) {
81 var x, d, t = 'text/plain';
82
83 function g(s) {
84 x = 0;
85
86 try {
87 x = new ActiveXObject(s);
88 } catch (s) {
89 }
90
91 return x;
92 };
93
94 x = window.ActiveXObject ? g('Msxml2.XMLHTTP') || g('Microsoft.XMLHTTP') : new XMLHttpRequest();
95
96 // Synchronous AJAX load file
97 x.overrideMimeType && x.overrideMimeType(t);
98 x.open("GET", u, false);
99 x.send(null);
100
101 return x.responseText;
102 }
103};
104
105TemplateDialog.preInit();
106tinyMCEPopup.onInit.add(TemplateDialog.init, TemplateDialog);
diff --git a/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js
new file mode 100755
index 0000000..2471c3f
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js
@@ -0,0 +1,15 @@
1tinyMCE.addI18n('en.template_dlg',{
2title:"Templates",
3label:"Template",
4desc_label:"Description",
5desc:"Insert predefined template content",
6select:"Select a template",
7preview:"Preview",
8warning:"Warning: Updating a template with a different one may cause data loss.",
9mdate_format:"%Y-%m-%d %H:%M:%S",
10cdate_format:"%Y-%m-%d %H:%M:%S",
11months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
12months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
13day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
14day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
15}); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/template/template.htm b/public/javascripts/tiny_mce/plugins/template/template.htm
new file mode 100755
index 0000000..2b71c6e
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/template/template.htm
@@ -0,0 +1,39 @@
1<html xmlns="http://www.w3.org/1999/xhtml">
2<head>
3 <title>{#template_dlg.title}</title>
4 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
5 <script type="text/javascript" src="js/template.js"></script>
6 <link href="css/template.css" rel="stylesheet" type="text/css" />
7 <base target="_self" />
8</head>
9<body onresize="TemplateDialog.resize();">
10 <form onsubmit="TemplateDialog.insert();return false;">
11 <div id="frmbody">
12 <div class="title">{#template_dlg.desc}</div>
13 <div class="frmRow"><label for="tpath" title="{#template_dlg.select}">{#template_dlg.label}:</label>
14 <select id="tpath" name="tpath" onchange="TemplateDialog.selectTemplate(this.options[this.selectedIndex].value, this.options[this.selectedIndex].text);" class="mceFocus">
15 <option value="">{#template_dlg.select}...</option>
16 </select>
17 <span id="warning"></span></div>
18 <div class="frmRow"><label for="tdesc">{#template_dlg.desc_label}:</label>
19 <span id="tmpldesc"></span></div>
20 <fieldset>
21 <legend>{#template_dlg.preview}</legend>
22 <iframe id="templatesrc" name="templatesrc" src="blank.htm" width="690" height="400" frameborder="0"></iframe>
23 </fieldset>
24 </div>
25
26 <div class="mceActionPanel">
27 <div style="float: left">
28 <input type="submit" id="insert" name="insert" value="{#insert}" />
29 </div>
30
31 <div style="float: right">
32 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
33 </div>
34
35 <br style="clear:both" />
36 </div>
37 </form>
38</body>
39</html>
diff --git a/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js b/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js
new file mode 100755
index 0000000..e1e4238
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.VisualChars',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceVisualChars',t._toggleVisualChars,t);ed.addButton('visualchars',{title:'visualchars.desc',cmd:'mceVisualChars'});ed.onBeforeGetContent.add(function(ed,o){if(t.state){t.state=true;t._toggleVisualChars();}});},getInfo:function(){return{longname:'Visual characters',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_toggleVisualChars:function(){var t=this,ed=t.editor,nl,i,h,d=ed.getDoc(),b=ed.getBody(),nv,s=ed.selection,bo;t.state=!t.state;ed.controlManager.setActive('visualchars',t.state);if(t.state){nl=[];tinymce.walk(b,function(n){if(n.nodeType==3&&n.nodeValue&&n.nodeValue.indexOf('\u00a0')!=-1)nl.push(n);},'childNodes');for(i=0;i<nl.length;i++){nv=nl[i].nodeValue;nv=nv.replace(/(\u00a0+)/g,'<span class="mceItemHidden mceVisualNbsp">$1</span>');nv=nv.replace(/\u00a0/g,'\u00b7');ed.dom.setOuterHTML(nl[i],nv,d);}}else{nl=tinymce.grep(ed.dom.select('span',b),function(n){return ed.dom.hasClass(n,'mceVisualNbsp');});for(i=0;i<nl.length;i++)ed.dom.setOuterHTML(nl[i],nl[i].innerHTML.replace(/(&middot;|\u00b7)/g,'&nbsp;'),d);}}});tinymce.PluginManager.add('visualchars',tinymce.plugins.VisualChars);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js
new file mode 100755
index 0000000..02ec4e6
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js
@@ -0,0 +1,73 @@
1/**
2 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.VisualChars', {
10 init : function(ed, url) {
11 var t = this;
12
13 t.editor = ed;
14
15 // Register commands
16 ed.addCommand('mceVisualChars', t._toggleVisualChars, t);
17
18 // Register buttons
19 ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'});
20
21 ed.onBeforeGetContent.add(function(ed, o) {
22 if (t.state) {
23 t.state = true;
24 t._toggleVisualChars();
25 }
26 });
27 },
28
29 getInfo : function() {
30 return {
31 longname : 'Visual characters',
32 author : 'Moxiecode Systems AB',
33 authorurl : 'http://tinymce.moxiecode.com',
34 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',
35 version : tinymce.majorVersion + "." + tinymce.minorVersion
36 };
37 },
38
39 // Private methods
40
41 _toggleVisualChars : function() {
42 var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo;
43
44 t.state = !t.state;
45 ed.controlManager.setActive('visualchars', t.state);
46
47 if (t.state) {
48 nl = [];
49 tinymce.walk(b, function(n) {
50 if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1)
51 nl.push(n);
52 }, 'childNodes');
53
54 for (i=0; i<nl.length; i++) {
55 nv = nl[i].nodeValue;
56 nv = nv.replace(/(\u00a0+)/g, '<span class="mceItemHidden mceVisualNbsp">$1</span>');
57 nv = nv.replace(/\u00a0/g, '\u00b7');
58 ed.dom.setOuterHTML(nl[i], nv, d);
59 }
60 } else {
61 nl = tinymce.grep(ed.dom.select('span', b), function(n) {
62 return ed.dom.hasClass(n, 'mceVisualNbsp');
63 });
64
65 for (i=0; i<nl.length; i++)
66 ed.dom.setOuterHTML(nl[i], nl[i].innerHTML.replace(/(&middot;|\u00b7)/g, '&nbsp;'), d);
67 }
68 }
69 });
70
71 // Register plugin
72 tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars);
73})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm
new file mode 100755
index 0000000..5800284
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm
@@ -0,0 +1,149 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#xhtmlxtras_dlg.title_abbr_element}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9 <script type="text/javascript" src="js/element_common.js"></script>
10 <script type="text/javascript" src="js/abbr.js"></script>
11 <link rel="stylesheet" type="text/css" href="css/popup.css" />
12 <base target="_self" />
13</head>
14<body style="display: none">
15<form onsubmit="insertAbbr();return false;" action="#">
16 <div class="tabs">
17 <ul>
18 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19 <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20 </ul>
21 </div>
22
23 <div class="panel_wrapper">
24 <div id="general_panel" class="panel current">
25 <fieldset>
26 <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27 <table border="0" cellpadding="0" cellspacing="4">
28 <tr>
29 <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30 <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31 </tr>
32 <tr>
33 <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34 <td><input id="id" name="id" type="text" value="" class="field" /></td>
35 </tr>
36 <tr>
37 <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38 <td>
39 <select id="class" name="class" class="field mceEditableSelect">
40 <option value="">{#not_set}</option>
41 </select>
42 </td>
43 </tr>
44 <tr>
45 <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46 <td><input id="style" name="style" type="text" value="" class="field" /></td>
47 </tr>
48 <tr>
49 <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50 <td>
51 <select id="dir" name="dir" class="field">
52 <option value="">{#not_set}</option>
53 <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54 <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55 </select>
56 </td>
57 </tr>
58 <tr>
59 <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60 <td>
61 <input id="lang" name="lang" type="text" value="" class="field" />
62 </td>
63 </tr>
64 </table>
65 </fieldset>
66 </div>
67 <div id="events_panel" class="panel">
68 <fieldset>
69 <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
71 <table border="0" cellpadding="0" cellspacing="4">
72 <tr>
73 <td class="label"><label for="onfocus">onfocus</label>:</td>
74 <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75 </tr>
76
77 <tr>
78 <td class="label"><label for="onblur">onblur</label>:</td>
79 <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80 </tr>
81
82 <tr>
83 <td class="label"><label for="onclick">onclick</label>:</td>
84 <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85 </tr>
86
87 <tr>
88 <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89 <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90 </tr>
91
92 <tr>
93 <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94 <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95 </tr>
96
97 <tr>
98 <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99 <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100 </tr>
101
102 <tr>
103 <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104 <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105 </tr>
106
107 <tr>
108 <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109 <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110 </tr>
111
112 <tr>
113 <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114 <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115 </tr>
116
117 <tr>
118 <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119 <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120 </tr>
121
122 <tr>
123 <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124 <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125 </tr>
126
127 <tr>
128 <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129 <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130 </tr>
131 </table>
132 </fieldset>
133 </div>
134 </div>
135 <div class="mceActionPanel">
136 <div style="float: left">
137 <input type="submit" id="insert" name="insert" value="{#update}" />
138 </div>
139 <div style="float: left">
140 <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" />
141 </div>
142 <div style="float: right">
143 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144 </div>
145 </div>
146
147</form>
148</body>
149</html>
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm
new file mode 100755
index 0000000..54e4c9d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm
@@ -0,0 +1,149 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#xhtmlxtras_dlg.title_acronym_element}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9 <script type="text/javascript" src="js/element_common.js"></script>
10 <script type="text/javascript" src="js/acronym.js"></script>
11 <link rel="stylesheet" type="text/css" href="css/popup.css" />
12 <base target="_self" />
13</head>
14<body style="display: none">
15<form onsubmit="insertAcronym();return false;" action="#">
16 <div class="tabs">
17 <ul>
18 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19 <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20 </ul>
21 </div>
22
23 <div class="panel_wrapper">
24 <div id="general_panel" class="panel current">
25 <fieldset>
26 <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27 <table border="0" cellpadding="0" cellspacing="4">
28 <tr>
29 <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30 <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31 </tr>
32 <tr>
33 <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34 <td><input id="id" name="id" type="text" value="" class="field" /></td>
35 </tr>
36 <tr>
37 <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38 <td>
39 <select id="class" name="class" class="field mceEditableSelect">
40 <option value="">{#not_set}</option>
41 </select>
42 </td>
43 </tr>
44 <tr>
45 <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46 <td><input id="style" name="style" type="text" value="" class="field" /></td>
47 </tr>
48 <tr>
49 <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50 <td>
51 <select id="dir" name="dir" class="field">
52 <option value="">{#not_set}</option>
53 <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54 <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55 </select>
56 </td>
57 </tr>
58 <tr>
59 <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60 <td>
61 <input id="lang" name="lang" type="text" value="" class="field" />
62 </td>
63 </tr>
64 </table>
65 </fieldset>
66 </div>
67 <div id="events_panel" class="panel">
68 <fieldset>
69 <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
71 <table border="0" cellpadding="0" cellspacing="4">
72 <tr>
73 <td class="label"><label for="onfocus">onfocus</label>:</td>
74 <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75 </tr>
76
77 <tr>
78 <td class="label"><label for="onblur">onblur</label>:</td>
79 <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80 </tr>
81
82 <tr>
83 <td class="label"><label for="onclick">onclick</label>:</td>
84 <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85 </tr>
86
87 <tr>
88 <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89 <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90 </tr>
91
92 <tr>
93 <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94 <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95 </tr>
96
97 <tr>
98 <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99 <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100 </tr>
101
102 <tr>
103 <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104 <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105 </tr>
106
107 <tr>
108 <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109 <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110 </tr>
111
112 <tr>
113 <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114 <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115 </tr>
116
117 <tr>
118 <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119 <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120 </tr>
121
122 <tr>
123 <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124 <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125 </tr>
126
127 <tr>
128 <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129 <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130 </tr>
131 </table>
132 </fieldset>
133 </div>
134 </div>
135 <div class="mceActionPanel">
136 <div style="float: left">
137 <input type="submit" id="insert" name="insert" value="{#update}" />
138 </div>
139 <div style="float: left">
140 <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" />
141 </div>
142 <div style="float: right">
143 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144 </div>
145 </div>
146
147</form>
148</body>
149</html>
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm
new file mode 100755
index 0000000..cfbb409
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm
@@ -0,0 +1,154 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#xhtmlxtras_dlg.attribs_title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
8 <script type="text/javascript" src="../../utils/form_utils.js"></script>
9 <script type="text/javascript" src="js/attributes.js"></script>
10 <link rel="stylesheet" type="text/css" href="css/attributes.css" />
11 <base target="_self" />
12</head>
13<body style="display: none">
14<form onsubmit="insertAction();return false;" action="#">
15 <div class="tabs">
16 <ul>
17 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_attrib_tab}</a></span></li>
18 <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_events_tab}</a></span></li>
19 </ul>
20 </div>
21
22 <div class="panel_wrapper">
23 <div id="general_panel" class="panel current">
24 <fieldset>
25 <legend>{#xhtmlxtras_dlg.attribute_attrib_tab}</legend>
26 <table border="0" cellpadding="0" cellspacing="4">
27 <tr>
28 <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
29 <td><input id="title" name="title" type="text" value="" class="mceFocus" /></td>
30 </tr>
31 <tr>
32 <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
33 <td><input id="id" name="id" type="text" value="" /></td>
34 </tr>
35 <tr>
36 <td><label id="classlabel" for="classlist">{#class_name}</label></td>
37 <td>
38 <select id="classlist" name="classlist" class="mceEditableSelect">
39 <option value="" selected>{#not_set}</option>
40 </select>
41 </td>
42 </tr>
43 <tr>
44 <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
45 <td><input id="style" name="style" type="text" value="" /></td>
46 </tr>
47 <tr>
48 <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
49 <td>
50 <select id="dir" name="dir">
51 <option value="">{#not_set}</option>
52 <option value="ltr">{#xhtmlxtras_dlg.option_ltr}</option>
53 <option value="rtl">{#xhtmlxtras_dlg.option_rtl}</option>
54 </select>
55 </td>
56 </tr>
57 <tr>
58 <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
59 <td>
60 <input id="lang" name="lang" type="text" value="" />
61 </td>
62 </tr>
63 <tr>
64 <td><label id="tabindexlabel" for="tabindex">{#xhtmlxtras_dlg.attribute_label_tabindex}</label></td>
65 <td><input type="text" id="tabindex" name="tabindex" value="" /></td>
66 </tr>
67
68 <tr>
69 <td><label id="accesskeylabel" for="accesskey">{#xhtmlxtras_dlg.attribute_label_accesskey}</label></td>
70 <td><input type="text" id="accesskey" name="accesskey" value="" /></td>
71 </tr>
72 </table>
73 </fieldset>
74 </div>
75 <div id="events_panel" class="panel">
76 <fieldset>
77 <legend>{#xhtmlxtras_dlg.attribute_events_tab}</legend>
78
79 <table border="0" cellpadding="0" cellspacing="4">
80 <tr>
81 <td class="label"><label for="onfocus">onfocus</label>:</td>
82 <td><input id="onfocus" name="onfocus" type="text" value="" /></td>
83 </tr>
84
85 <tr>
86 <td class="label"><label for="onblur">onblur</label>:</td>
87 <td><input id="onblur" name="onblur" type="text" value="" /></td>
88 </tr>
89
90 <tr>
91 <td class="label"><label for="onclick">onclick</label>:</td>
92 <td><input id="onclick" name="onclick" type="text" value="" /></td>
93 </tr>
94
95 <tr>
96 <td class="label"><label for="ondblclick">ondblclick</label>:</td>
97 <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
98 </tr>
99
100 <tr>
101 <td class="label"><label for="onmousedown">onmousedown</label>:</td>
102 <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
103 </tr>
104
105 <tr>
106 <td class="label"><label for="onmouseup">onmouseup</label>:</td>
107 <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
108 </tr>
109
110 <tr>
111 <td class="label"><label for="onmouseover">onmouseover</label>:</td>
112 <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
113 </tr>
114
115 <tr>
116 <td class="label"><label for="onmousemove">onmousemove</label>:</td>
117 <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
118 </tr>
119
120 <tr>
121 <td class="label"><label for="onmouseout">onmouseout</label>:</td>
122 <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
123 </tr>
124
125 <tr>
126 <td class="label"><label for="onkeypress">onkeypress</label>:</td>
127 <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
128 </tr>
129
130 <tr>
131 <td class="label"><label for="onkeydown">onkeydown</label>:</td>
132 <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
133 </tr>
134
135 <tr>
136 <td class="label"><label for="onkeyup">onkeyup</label>:</td>
137 <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
138 </tr>
139 </table>
140 </fieldset>
141 </div>
142 </div>
143 <div class="mceActionPanel">
144 <div style="float: left">
145 <input type="submit" id="insert" name="insert" value="{#insert}" />
146 </div>
147 <div style="float: right">
148 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
149 </div>
150 </div>
151
152</form>
153</body>
154</html>
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm
new file mode 100755
index 0000000..7d9eaba
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm
@@ -0,0 +1,149 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#xhtmlxtras_dlg.title_cite_element}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9 <script type="text/javascript" src="js/element_common.js"></script>
10 <script type="text/javascript" src="js/cite.js"></script>
11 <link rel="stylesheet" type="text/css" href="css/popup.css" />
12 <base target="_self" />
13</head>
14<body style="display: none">
15<form onsubmit="insertCite();return false;" action="#">
16 <div class="tabs">
17 <ul>
18 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19 <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20 </ul>
21 </div>
22
23 <div class="panel_wrapper">
24 <div id="general_panel" class="panel current">
25 <fieldset>
26 <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27 <table border="0" cellpadding="0" cellspacing="4">
28 <tr>
29 <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30 <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31 </tr>
32 <tr>
33 <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34 <td><input id="id" name="id" type="text" value="" class="field" /></td>
35 </tr>
36 <tr>
37 <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38 <td>
39 <select id="class" name="class" class="field mceEditableSelect">
40 <option value="">{#not_set}</option>
41 </select>
42 </td>
43 </tr>
44 <tr>
45 <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46 <td><input id="style" name="style" type="text" value="" class="field" /></td>
47 </tr>
48 <tr>
49 <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50 <td>
51 <select id="dir" name="dir" class="field">
52 <option value="">{#not_set}</option>
53 <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54 <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55 </select>
56 </td>
57 </tr>
58 <tr>
59 <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60 <td>
61 <input id="lang" name="lang" type="text" value="" class="field" />
62 </td>
63 </tr>
64 </table>
65 </fieldset>
66 </div>
67 <div id="events_panel" class="panel">
68 <fieldset>
69 <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
71 <table border="0" cellpadding="0" cellspacing="4">
72 <tr>
73 <td class="label"><label for="onfocus">onfocus</label>:</td>
74 <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75 </tr>
76
77 <tr>
78 <td class="label"><label for="onblur">onblur</label>:</td>
79 <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80 </tr>
81
82 <tr>
83 <td class="label"><label for="onclick">onclick</label>:</td>
84 <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85 </tr>
86
87 <tr>
88 <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89 <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90 </tr>
91
92 <tr>
93 <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94 <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95 </tr>
96
97 <tr>
98 <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99 <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100 </tr>
101
102 <tr>
103 <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104 <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105 </tr>
106
107 <tr>
108 <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109 <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110 </tr>
111
112 <tr>
113 <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114 <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115 </tr>
116
117 <tr>
118 <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119 <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120 </tr>
121
122 <tr>
123 <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124 <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125 </tr>
126
127 <tr>
128 <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129 <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130 </tr>
131 </table>
132 </fieldset>
133 </div>
134 </div>
135 <div class="mceActionPanel">
136 <div style="float: left">
137 <input type="submit" id="insert" name="insert" value="{#update}" />
138 </div>
139 <div style="float: left">
140 <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" />
141 </div>
142 <div style="float: right">
143 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144 </div>
145 </div>
146
147</form>
148</body>
149</html>
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css
new file mode 100755
index 0000000..9a6a235
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css
@@ -0,0 +1,11 @@
1.panel_wrapper div.current {
2 height: 290px;
3}
4
5#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey {
6 width: 200px;
7}
8
9#events_panel input {
10 width: 200px;
11}
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css b/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css
new file mode 100755
index 0000000..e67114d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css
@@ -0,0 +1,9 @@
1input.field, select.field {width:200px;}
2input.picker {width:179px; margin-left: 5px;}
3input.disabled {border-color:#F2F2F2;}
4img.picker {vertical-align:text-bottom; cursor:pointer;}
5h1 {padding: 0 0 5px 0;}
6.panel_wrapper div.current {height:160px;}
7#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;}
8a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;}
9#datetime {width:180px;}
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm
new file mode 100755
index 0000000..d03c456
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm
@@ -0,0 +1,170 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#xhtmlxtras_dlg.title_del_element}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9 <script type="text/javascript" src="js/element_common.js"></script>
10 <script type="text/javascript" src="js/del.js"></script>
11 <link rel="stylesheet" type="text/css" href="css/popup.css" />
12 <base target="_self" />
13</head>
14<body id="xhtmlxtrasins" style="display: none">
15<form onsubmit="insertDel();return false;" action="#">
16 <div class="tabs">
17 <ul>
18 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19 <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20 </ul>
21 </div>
22
23 <div class="panel_wrapper">
24 <div id="general_panel" class="panel current">
25 <fieldset>
26 <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>
27 <table border="0" cellpadding="0" cellspacing="4">
28 <tr>
29 <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>
30 <td>
31 <table border="0" cellspacing="0" cellpadding="0">
32 <tr>
33 <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
34 <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
35 </tr>
36 </table>
37 </td>
38 </tr>
39 <tr>
40 <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>
41 <td><input id="cite" name="cite" type="text" value="" class="field" /></td>
42 </tr>
43 </table>
44 </fieldset>
45 <fieldset>
46 <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
47 <table border="0" cellpadding="0" cellspacing="4">
48 <tr>
49 <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
50 <td><input id="title" name="title" type="text" value="" class="field" /></td>
51 </tr>
52 <tr>
53 <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
54 <td><input id="id" name="id" type="text" value="" class="field" /></td>
55 </tr>
56 <tr>
57 <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
58 <td>
59 <select id="class" name="class" class="field mceEditableSelect">
60 <option value="">{#not_set}</option>
61 </select>
62 </td>
63 </tr>
64 <tr>
65 <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
66 <td><input id="style" name="style" type="text" value="" class="field" /></td>
67 </tr>
68 <tr>
69 <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
70 <td>
71 <select id="dir" name="dir" class="field">
72 <option value="">{#not_set}</option>
73 <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
74 <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
75 </select>
76 </td>
77 </tr>
78 <tr>
79 <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
80 <td>
81 <input id="lang" name="lang" type="text" value="" class="field" />
82 </td>
83 </tr>
84 </table>
85 </fieldset>
86 </div>
87 <div id="events_panel" class="panel">
88 <fieldset>
89 <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
90
91 <table border="0" cellpadding="0" cellspacing="4">
92 <tr>
93 <td class="label"><label for="onfocus">onfocus</label>:</td>
94 <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
95 </tr>
96
97 <tr>
98 <td class="label"><label for="onblur">onblur</label>:</td>
99 <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
100 </tr>
101
102 <tr>
103 <td class="label"><label for="onclick">onclick</label>:</td>
104 <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
105 </tr>
106
107 <tr>
108 <td class="label"><label for="ondblclick">ondblclick</label>:</td>
109 <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
110 </tr>
111
112 <tr>
113 <td class="label"><label for="onmousedown">onmousedown</label>:</td>
114 <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
115 </tr>
116
117 <tr>
118 <td class="label"><label for="onmouseup">onmouseup</label>:</td>
119 <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
120 </tr>
121
122 <tr>
123 <td class="label"><label for="onmouseover">onmouseover</label>:</td>
124 <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
125 </tr>
126
127 <tr>
128 <td class="label"><label for="onmousemove">onmousemove</label>:</td>
129 <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
130 </tr>
131
132 <tr>
133 <td class="label"><label for="onmouseout">onmouseout</label>:</td>
134 <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
135 </tr>
136
137 <tr>
138 <td class="label"><label for="onkeypress">onkeypress</label>:</td>
139 <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
140 </tr>
141
142 <tr>
143 <td class="label"><label for="onkeydown">onkeydown</label>:</td>
144 <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
145 </tr>
146
147 <tr>
148 <td class="label"><label for="onkeyup">onkeyup</label>:</td>
149 <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
150 </tr>
151 </table>
152 </fieldset>
153 </div>
154 </div>
155 <div class="mceActionPanel">
156 <div style="float: left">
157 <input type="submit" id="insert" name="insert" value="{#update}" />
158 </div>
159 <div style="float: left">
160 <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" />
161 </div>
162 <div style="float: right">
163 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
164 </div>
165 </div>
166
167</form>
168
169</body>
170</html>
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js
new file mode 100755
index 0000000..00c178e
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.XHTMLXtrasPlugin',{init:function(ed,url){ed.addCommand('mceCite',function(){ed.windowManager.open({file:url+'/cite.htm',width:350+parseInt(ed.getLang('xhtmlxtras.cite_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.cite_delta_height',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAcronym',function(){ed.windowManager.open({file:url+'/acronym.htm',width:350+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAbbr',function(){ed.windowManager.open({file:url+'/abbr.htm',width:350+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceDel',function(){ed.windowManager.open({file:url+'/del.htm',width:340+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceIns',function(){ed.windowManager.open({file:url+'/ins.htm',width:340+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAttributes',function(){ed.windowManager.open({file:url+'/attributes.htm',width:380,height:370,inline:1},{plugin_url:url});});ed.addButton('cite',{title:'xhtmlxtras.cite_desc',cmd:'mceCite'});ed.addButton('acronym',{title:'xhtmlxtras.acronym_desc',cmd:'mceAcronym'});ed.addButton('abbr',{title:'xhtmlxtras.abbr_desc',cmd:'mceAbbr'});ed.addButton('del',{title:'xhtmlxtras.del_desc',cmd:'mceDel'});ed.addButton('ins',{title:'xhtmlxtras.ins_desc',cmd:'mceIns'});ed.addButton('attribs',{title:'xhtmlxtras.attribs_desc',cmd:'mceAttributes'});if(tinymce.isIE){function fix(ed,o){if(o.set){o.content=o.content.replace(/<abbr([^>]+)>/gi,'<html:abbr $1>');o.content=o.content.replace(/<\/abbr>/gi,'</html:abbr>');}};ed.onBeforeSetContent.add(fix);ed.onPostProcess.add(fix);}ed.onNodeChange.add(function(ed,cm,n,co){n=ed.dom.getParent(n,'CITE,ACRONYM,ABBR,DEL,INS');cm.setDisabled('cite',co);cm.setDisabled('acronym',co);cm.setDisabled('abbr',co);cm.setDisabled('del',co);cm.setDisabled('ins',co);cm.setDisabled('attribs',n&&n.nodeName=='BODY');cm.setActive('cite',0);cm.setActive('acronym',0);cm.setActive('abbr',0);cm.setActive('del',0);cm.setActive('ins',0);if(n){do{cm.setDisabled(n.nodeName.toLowerCase(),0);cm.setActive(n.nodeName.toLowerCase(),1);}while(n=n.parentNode);}});},getInfo:function(){return{longname:'XHTML Xtras Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('xhtmlxtras',tinymce.plugins.XHTMLXtrasPlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js
new file mode 100755
index 0000000..bef06f2
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js
@@ -0,0 +1,136 @@
1/**
2 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', {
10 init : function(ed, url) {
11 // Register commands
12 ed.addCommand('mceCite', function() {
13 ed.windowManager.open({
14 file : url + '/cite.htm',
15 width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)),
16 height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)),
17 inline : 1
18 }, {
19 plugin_url : url
20 });
21 });
22
23 ed.addCommand('mceAcronym', function() {
24 ed.windowManager.open({
25 file : url + '/acronym.htm',
26 width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),
27 height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),
28 inline : 1
29 }, {
30 plugin_url : url
31 });
32 });
33
34 ed.addCommand('mceAbbr', function() {
35 ed.windowManager.open({
36 file : url + '/abbr.htm',
37 width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),
38 height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),
39 inline : 1
40 }, {
41 plugin_url : url
42 });
43 });
44
45 ed.addCommand('mceDel', function() {
46 ed.windowManager.open({
47 file : url + '/del.htm',
48 width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),
49 height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),
50 inline : 1
51 }, {
52 plugin_url : url
53 });
54 });
55
56 ed.addCommand('mceIns', function() {
57 ed.windowManager.open({
58 file : url + '/ins.htm',
59 width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),
60 height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),
61 inline : 1
62 }, {
63 plugin_url : url
64 });
65 });
66
67 ed.addCommand('mceAttributes', function() {
68 ed.windowManager.open({
69 file : url + '/attributes.htm',
70 width : 380,
71 height : 370,
72 inline : 1
73 }, {
74 plugin_url : url
75 });
76 });
77
78 // Register buttons
79 ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'});
80 ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'});
81 ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'});
82 ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'});
83 ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'});
84 ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'});
85
86 if (tinymce.isIE) {
87 function fix(ed, o) {
88 if (o.set) {
89 o.content = o.content.replace(/<abbr([^>]+)>/gi, '<html:abbr $1>');
90 o.content = o.content.replace(/<\/abbr>/gi, '</html:abbr>');
91 }
92 };
93
94 ed.onBeforeSetContent.add(fix);
95 ed.onPostProcess.add(fix);
96 }
97
98 ed.onNodeChange.add(function(ed, cm, n, co) {
99 n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS');
100
101 cm.setDisabled('cite', co);
102 cm.setDisabled('acronym', co);
103 cm.setDisabled('abbr', co);
104 cm.setDisabled('del', co);
105 cm.setDisabled('ins', co);
106 cm.setDisabled('attribs', n && n.nodeName == 'BODY');
107 cm.setActive('cite', 0);
108 cm.setActive('acronym', 0);
109 cm.setActive('abbr', 0);
110 cm.setActive('del', 0);
111 cm.setActive('ins', 0);
112
113 // Activate all
114 if (n) {
115 do {
116 cm.setDisabled(n.nodeName.toLowerCase(), 0);
117 cm.setActive(n.nodeName.toLowerCase(), 1);
118 } while (n = n.parentNode);
119 }
120 });
121 },
122
123 getInfo : function() {
124 return {
125 longname : 'XHTML Xtras Plugin',
126 author : 'Moxiecode Systems AB',
127 authorurl : 'http://tinymce.moxiecode.com',
128 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',
129 version : tinymce.majorVersion + "." + tinymce.minorVersion
130 };
131 }
132 });
133
134 // Register plugin
135 tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin);
136})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm
new file mode 100755
index 0000000..c0f056f
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm
@@ -0,0 +1,170 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#xhtmlxtras_dlg.title_ins_element}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9 <script type="text/javascript" src="js/element_common.js"></script>
10 <script type="text/javascript" src="js/ins.js"></script>
11 <link rel="stylesheet" type="text/css" href="css/popup.css" />
12 <base target="_self" />
13</head>
14<body id="xhtmlxtrasins" style="display: none">
15<form onsubmit="insertIns();return false;" action="#">
16 <div class="tabs">
17 <ul>
18 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19 <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20 </ul>
21 </div>
22
23 <div class="panel_wrapper">
24 <div id="general_panel" class="panel current">
25 <fieldset>
26 <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>
27 <table border="0" cellpadding="0" cellspacing="4">
28 <tr>
29 <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>
30 <td>
31 <table border="0" cellspacing="0" cellpadding="0">
32 <tr>
33 <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
34 <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
35 </tr>
36 </table>
37 </td>
38 </tr>
39 <tr>
40 <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>
41 <td><input id="cite" name="cite" type="text" value="" class="field" /></td>
42 </tr>
43 </table>
44 </fieldset>
45 <fieldset>
46 <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
47 <table border="0" cellpadding="0" cellspacing="4">
48 <tr>
49 <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
50 <td><input id="title" name="title" type="text" value="" class="field" /></td>
51 </tr>
52 <tr>
53 <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
54 <td><input id="id" name="id" type="text" value="" class="field" /></td>
55 </tr>
56 <tr>
57 <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
58 <td>
59 <select id="class" name="class" class="field mceEditableSelect">
60 <option value="">{#not_set}</option>
61 </select>
62 </td>
63 </tr>
64 <tr>
65 <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
66 <td><input id="style" name="style" type="text" value="" class="field" /></td>
67 </tr>
68 <tr>
69 <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
70 <td>
71 <select id="dir" name="dir" class="field">
72 <option value="">{#not_set}</option>
73 <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
74 <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
75 </select>
76 </td>
77 </tr>
78 <tr>
79 <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
80 <td>
81 <input id="lang" name="lang" type="text" value="" class="field" />
82 </td>
83 </tr>
84 </table>
85 </fieldset>
86 </div>
87 <div id="events_panel" class="panel">
88 <fieldset>
89 <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
90
91 <table border="0" cellpadding="0" cellspacing="4">
92 <tr>
93 <td class="label"><label for="onfocus">onfocus</label>:</td>
94 <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
95 </tr>
96
97 <tr>
98 <td class="label"><label for="onblur">onblur</label>:</td>
99 <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
100 </tr>
101
102 <tr>
103 <td class="label"><label for="onclick">onclick</label>:</td>
104 <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
105 </tr>
106
107 <tr>
108 <td class="label"><label for="ondblclick">ondblclick</label>:</td>
109 <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
110 </tr>
111
112 <tr>
113 <td class="label"><label for="onmousedown">onmousedown</label>:</td>
114 <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
115 </tr>
116
117 <tr>
118 <td class="label"><label for="onmouseup">onmouseup</label>:</td>
119 <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
120 </tr>
121
122 <tr>
123 <td class="label"><label for="onmouseover">onmouseover</label>:</td>
124 <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
125 </tr>
126
127 <tr>
128 <td class="label"><label for="onmousemove">onmousemove</label>:</td>
129 <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
130 </tr>
131
132 <tr>
133 <td class="label"><label for="onmouseout">onmouseout</label>:</td>
134 <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
135 </tr>
136
137 <tr>
138 <td class="label"><label for="onkeypress">onkeypress</label>:</td>
139 <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
140 </tr>
141
142 <tr>
143 <td class="label"><label for="onkeydown">onkeydown</label>:</td>
144 <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
145 </tr>
146
147 <tr>
148 <td class="label"><label for="onkeyup">onkeyup</label>:</td>
149 <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
150 </tr>
151 </table>
152 </fieldset>
153 </div>
154 </div>
155 <div class="mceActionPanel">
156 <div style="float: left">
157 <input type="submit" id="insert" name="insert" value="{#update}" />
158 </div>
159 <div style="float: left">
160 <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" />
161 </div>
162 <div style="float: right">
163 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
164 </div>
165 </div>
166
167</form>
168
169</body>
170</html>
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js
new file mode 100755
index 0000000..e84b6a8
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js
@@ -0,0 +1,25 @@
1 /**
2 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3 *
4 * @author Moxiecode - based on work by Andrew Tetlaw
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8function init() {
9 SXE.initElementDialog('abbr');
10 if (SXE.currentAction == "update") {
11 SXE.showRemoveButton();
12 }
13}
14
15function insertAbbr() {
16 SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr');
17 tinyMCEPopup.close();
18}
19
20function removeAbbr() {
21 SXE.removeElement('abbr');
22 tinyMCEPopup.close();
23}
24
25tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js
new file mode 100755
index 0000000..933d122
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js
@@ -0,0 +1,25 @@
1 /**
2 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3 *
4 * @author Moxiecode - based on work by Andrew Tetlaw
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8function init() {
9 SXE.initElementDialog('acronym');
10 if (SXE.currentAction == "update") {
11 SXE.showRemoveButton();
12 }
13}
14
15function insertAcronym() {
16 SXE.insertElement('acronym');
17 tinyMCEPopup.close();
18}
19
20function removeAcronym() {
21 SXE.removeElement('acronym');
22 tinyMCEPopup.close();
23}
24
25tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js
new file mode 100755
index 0000000..23c7fa4
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js
@@ -0,0 +1,123 @@
1 /**
2 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3 *
4 * @author Moxiecode - based on work by Andrew Tetlaw
5 * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
6 */
7
8function init() {
9 tinyMCEPopup.resizeToInnerSize();
10 var inst = tinyMCEPopup.editor;
11 var dom = inst.dom;
12 var elm = inst.selection.getNode();
13 var f = document.forms[0];
14 var onclick = dom.getAttrib(elm, 'onclick');
15
16 setFormValue('title', dom.getAttrib(elm, 'title'));
17 setFormValue('id', dom.getAttrib(elm, 'id'));
18 setFormValue('style', dom.getAttrib(elm, "style"));
19 setFormValue('dir', dom.getAttrib(elm, 'dir'));
20 setFormValue('lang', dom.getAttrib(elm, 'lang'));
21 setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
22 setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
23 setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
24 setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
25 setFormValue('onclick', onclick);
26 setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
27 setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
28 setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
29 setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
30 setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
31 setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
32 setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
33 setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
34 setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
35 className = dom.getAttrib(elm, 'class');
36
37 addClassesToList('classlist', 'advlink_styles');
38 selectByValue(f, 'classlist', className, true);
39
40 TinyMCE_EditableSelects.init();
41}
42
43function setFormValue(name, value) {
44 if(value && document.forms[0].elements[name]){
45 document.forms[0].elements[name].value = value;
46 }
47}
48
49function insertAction() {
50 var inst = tinyMCEPopup.editor;
51 var elm = inst.selection.getNode();
52
53 tinyMCEPopup.execCommand("mceBeginUndoLevel");
54 setAllAttribs(elm);
55 tinyMCEPopup.execCommand("mceEndUndoLevel");
56 tinyMCEPopup.close();
57}
58
59function setAttrib(elm, attrib, value) {
60 var formObj = document.forms[0];
61 var valueElm = formObj.elements[attrib.toLowerCase()];
62 var inst = tinyMCEPopup.editor;
63 var dom = inst.dom;
64
65 if (typeof(value) == "undefined" || value == null) {
66 value = "";
67
68 if (valueElm)
69 value = valueElm.value;
70 }
71
72 if (value != "") {
73 dom.setAttrib(elm, attrib.toLowerCase(), value);
74
75 if (attrib == "style")
76 attrib = "style.cssText";
77
78 if (attrib.substring(0, 2) == 'on')
79 value = 'return true;' + value;
80
81 if (attrib == "class")
82 attrib = "className";
83
84 elm[attrib]=value;
85 } else
86 elm.removeAttribute(attrib);
87}
88
89function setAllAttribs(elm) {
90 var f = document.forms[0];
91
92 setAttrib(elm, 'title');
93 setAttrib(elm, 'id');
94 setAttrib(elm, 'style');
95 setAttrib(elm, 'class', getSelectValue(f, 'classlist'));
96 setAttrib(elm, 'dir');
97 setAttrib(elm, 'lang');
98 setAttrib(elm, 'tabindex');
99 setAttrib(elm, 'accesskey');
100 setAttrib(elm, 'onfocus');
101 setAttrib(elm, 'onblur');
102 setAttrib(elm, 'onclick');
103 setAttrib(elm, 'ondblclick');
104 setAttrib(elm, 'onmousedown');
105 setAttrib(elm, 'onmouseup');
106 setAttrib(elm, 'onmouseover');
107 setAttrib(elm, 'onmousemove');
108 setAttrib(elm, 'onmouseout');
109 setAttrib(elm, 'onkeypress');
110 setAttrib(elm, 'onkeydown');
111 setAttrib(elm, 'onkeyup');
112
113 // Refresh in old MSIE
114// if (tinyMCE.isMSIE5)
115// elm.outerHTML = elm.outerHTML;
116}
117
118function insertAttribute() {
119 tinyMCEPopup.close();
120}
121
122tinyMCEPopup.onInit.add(init);
123tinyMCEPopup.requireLangPack();
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js
new file mode 100755
index 0000000..c36f7fd
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js
@@ -0,0 +1,25 @@
1 /**
2 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3 *
4 * @author Moxiecode - based on work by Andrew Tetlaw
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8function init() {
9 SXE.initElementDialog('cite');
10 if (SXE.currentAction == "update") {
11 SXE.showRemoveButton();
12 }
13}
14
15function insertCite() {
16 SXE.insertElement('cite');
17 tinyMCEPopup.close();
18}
19
20function removeCite() {
21 SXE.removeElement('cite');
22 tinyMCEPopup.close();
23}
24
25tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js
new file mode 100755
index 0000000..7049f2b
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js
@@ -0,0 +1,60 @@
1 /**
2 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3 *
4 * @author Moxiecode - based on work by Andrew Tetlaw
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8function init() {
9 SXE.initElementDialog('del');
10 if (SXE.currentAction == "update") {
11 setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
12 setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
13 SXE.showRemoveButton();
14 }
15}
16
17function setElementAttribs(elm) {
18 setAllCommonAttribs(elm);
19 setAttrib(elm, 'datetime');
20 setAttrib(elm, 'cite');
21}
22
23function insertDel() {
24 var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
25
26 tinyMCEPopup.execCommand('mceBeginUndoLevel');
27 if (elm == null) {
28 var s = SXE.inst.selection.getContent();
29 if(s.length > 0) {
30 insertInlineElement('del');
31 var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
32 for (var i=0; i<elementArray.length; i++) {
33 var elm = elementArray[i];
34 setElementAttribs(elm);
35 }
36 }
37 } else {
38 setElementAttribs(elm);
39 }
40 tinyMCEPopup.editor.nodeChanged();
41 tinyMCEPopup.execCommand('mceEndUndoLevel');
42 tinyMCEPopup.close();
43}
44
45function insertInlineElement(en) {
46 var ed = tinyMCEPopup.editor, dom = ed.dom;
47
48 ed.getDoc().execCommand('FontName', false, 'mceinline');
49 tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
50 if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
51 dom.replace(dom.create(en), n, 1);
52 });
53}
54
55function removeDel() {
56 SXE.removeElement('del');
57 tinyMCEPopup.close();
58}
59
60tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js
new file mode 100755
index 0000000..5cdeb21
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js
@@ -0,0 +1,231 @@
1 /**
2 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3 *
4 * @author Moxiecode - based on work by Andrew Tetlaw
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8tinyMCEPopup.requireLangPack();
9
10function initCommonAttributes(elm) {
11 var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
12
13 // Setup form data for common element attributes
14 setFormValue('title', dom.getAttrib(elm, 'title'));
15 setFormValue('id', dom.getAttrib(elm, 'id'));
16 selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);
17 setFormValue('style', dom.getAttrib(elm, 'style'));
18 selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));
19 setFormValue('lang', dom.getAttrib(elm, 'lang'));
20 setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
21 setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
22 setFormValue('onclick', dom.getAttrib(elm, 'onclick'));
23 setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
24 setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
25 setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
26 setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
27 setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
28 setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
29 setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
30 setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
31 setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
32}
33
34function setFormValue(name, value) {
35 if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;
36}
37
38function insertDateTime(id) {
39 document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");
40}
41
42function getDateTime(d, fmt) {
43 fmt = fmt.replace("%D", "%m/%d/%y");
44 fmt = fmt.replace("%r", "%I:%M:%S %p");
45 fmt = fmt.replace("%Y", "" + d.getFullYear());
46 fmt = fmt.replace("%y", "" + d.getYear());
47 fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
48 fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
49 fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
50 fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
51 fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
52 fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
53 fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
54 fmt = fmt.replace("%%", "%");
55
56 return fmt;
57}
58
59function addZeros(value, len) {
60 var i;
61
62 value = "" + value;
63
64 if (value.length < len) {
65 for (i=0; i<(len-value.length); i++)
66 value = "0" + value;
67 }
68
69 return value;
70}
71
72function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
73 if (!form_obj || !form_obj.elements[field_name])
74 return;
75
76 var sel = form_obj.elements[field_name];
77
78 var found = false;
79 for (var i=0; i<sel.options.length; i++) {
80 var option = sel.options[i];
81
82 if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
83 option.selected = true;
84 found = true;
85 } else
86 option.selected = false;
87 }
88
89 if (!found && add_custom && value != '') {
90 var option = new Option('Value: ' + value, value);
91 option.selected = true;
92 sel.options[sel.options.length] = option;
93 }
94
95 return found;
96}
97
98function setAttrib(elm, attrib, value) {
99 var formObj = document.forms[0];
100 var valueElm = formObj.elements[attrib.toLowerCase()];
101 tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);
102}
103
104function setAllCommonAttribs(elm) {
105 setAttrib(elm, 'title');
106 setAttrib(elm, 'id');
107 setAttrib(elm, 'class');
108 setAttrib(elm, 'style');
109 setAttrib(elm, 'dir');
110 setAttrib(elm, 'lang');
111 /*setAttrib(elm, 'onfocus');
112 setAttrib(elm, 'onblur');
113 setAttrib(elm, 'onclick');
114 setAttrib(elm, 'ondblclick');
115 setAttrib(elm, 'onmousedown');
116 setAttrib(elm, 'onmouseup');
117 setAttrib(elm, 'onmouseover');
118 setAttrib(elm, 'onmousemove');
119 setAttrib(elm, 'onmouseout');
120 setAttrib(elm, 'onkeypress');
121 setAttrib(elm, 'onkeydown');
122 setAttrib(elm, 'onkeyup');*/
123}
124
125SXE = {
126 currentAction : "insert",
127 inst : tinyMCEPopup.editor,
128 updateElement : null
129}
130
131SXE.focusElement = SXE.inst.selection.getNode();
132
133SXE.initElementDialog = function(element_name) {
134 addClassesToList('class', 'xhtmlxtras_styles');
135 TinyMCE_EditableSelects.init();
136
137 element_name = element_name.toLowerCase();
138 var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
139 if (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) {
140 SXE.currentAction = "update";
141 }
142
143 if (SXE.currentAction == "update") {
144 initCommonAttributes(elm);
145 SXE.updateElement = elm;
146 }
147
148 document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true);
149}
150
151SXE.insertElement = function(element_name) {
152 var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;
153
154 tinyMCEPopup.execCommand('mceBeginUndoLevel');
155 if (elm == null) {
156 var s = SXE.inst.selection.getContent();
157 if(s.length > 0) {
158 tagName = element_name;
159
160 if (tinymce.isIE && element_name.indexOf('html:') == 0)
161 element_name = element_name.substring(5).toLowerCase();
162
163 insertInlineElement(element_name);
164 var elementArray = tinymce.grep(SXE.inst.dom.select(element_name));
165 for (var i=0; i<elementArray.length; i++) {
166 var elm = elementArray[i];
167
168 if (SXE.inst.dom.getAttrib(elm, '_mce_new')) {
169 elm.id = '';
170 elm.setAttribute('id', '');
171 elm.removeAttribute('id');
172 elm.removeAttribute('_mce_new');
173
174 setAllCommonAttribs(elm);
175 }
176 }
177 }
178 } else {
179 setAllCommonAttribs(elm);
180 }
181 SXE.inst.nodeChanged();
182 tinyMCEPopup.execCommand('mceEndUndoLevel');
183}
184
185SXE.removeElement = function(element_name){
186 element_name = element_name.toLowerCase();
187 elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
188 if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){
189 tinyMCEPopup.execCommand('mceBeginUndoLevel');
190 tinyMCE.execCommand('mceRemoveNode', false, elm);
191 SXE.inst.nodeChanged();
192 tinyMCEPopup.execCommand('mceEndUndoLevel');
193 }
194}
195
196SXE.showRemoveButton = function() {
197 document.getElementById("remove").style.display = 'block';
198}
199
200SXE.containsClass = function(elm,cl) {
201 return (elm.className.indexOf(cl) > -1) ? true : false;
202}
203
204SXE.removeClass = function(elm,cl) {
205 if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {
206 return true;
207 }
208 var classNames = elm.className.split(" ");
209 var newClassNames = "";
210 for (var x = 0, cnl = classNames.length; x < cnl; x++) {
211 if (classNames[x] != cl) {
212 newClassNames += (classNames[x] + " ");
213 }
214 }
215 elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end
216}
217
218SXE.addClass = function(elm,cl) {
219 if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;
220 return true;
221}
222
223function insertInlineElement(en) {
224 var ed = tinyMCEPopup.editor, dom = ed.dom;
225
226 ed.getDoc().execCommand('FontName', false, 'mceinline');
227 tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
228 if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
229 dom.replace(dom.create(en, {_mce_new : 1}), n, 1);
230 });
231}
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
new file mode 100755
index 0000000..4fcc998
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
@@ -0,0 +1,59 @@
1 /**
2 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3 *
4 * @author Moxiecode - based on work by Andrew Tetlaw
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8function init() {
9 SXE.initElementDialog('ins');
10 if (SXE.currentAction == "update") {
11 setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
12 setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
13 SXE.showRemoveButton();
14 }
15}
16
17function setElementAttribs(elm) {
18 setAllCommonAttribs(elm);
19 setAttrib(elm, 'datetime');
20 setAttrib(elm, 'cite');
21}
22
23function insertIns() {
24 var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
25 tinyMCEPopup.execCommand('mceBeginUndoLevel');
26 if (elm == null) {
27 var s = SXE.inst.selection.getContent();
28 if(s.length > 0) {
29 insertInlineElement('INS');
30 var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
31 for (var i=0; i<elementArray.length; i++) {
32 var elm = elementArray[i];
33 setElementAttribs(elm);
34 }
35 }
36 } else {
37 setElementAttribs(elm);
38 }
39 tinyMCEPopup.editor.nodeChanged();
40 tinyMCEPopup.execCommand('mceEndUndoLevel');
41 tinyMCEPopup.close();
42}
43
44function removeIns() {
45 SXE.removeElement('ins');
46 tinyMCEPopup.close();
47}
48
49function insertInlineElement(en) {
50 var ed = tinyMCEPopup.editor, dom = ed.dom;
51
52 ed.getDoc().execCommand('FontName', false, 'mceinline');
53 tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
54 if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
55 dom.replace(dom.create(en), n, 1);
56 });
57}
58
59tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js
new file mode 100755
index 0000000..45b6b26
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js
@@ -0,0 +1,32 @@
1tinyMCE.addI18n('en.xhtmlxtras_dlg',{
2attribute_label_title:"Title",
3attribute_label_id:"ID",
4attribute_label_class:"Class",
5attribute_label_style:"Style",
6attribute_label_cite:"Cite",
7attribute_label_datetime:"Date/Time",
8attribute_label_langdir:"Text Direction",
9attribute_option_ltr:"Left to right",
10attribute_option_rtl:"Right to left",
11attribute_label_langcode:"Language",
12attribute_label_tabindex:"TabIndex",
13attribute_label_accesskey:"AccessKey",
14attribute_events_tab:"Events",
15attribute_attrib_tab:"Attributes",
16general_tab:"General",
17attrib_tab:"Attributes",
18events_tab:"Events",
19fieldset_general_tab:"General Settings",
20fieldset_attrib_tab:"Element Attributes",
21fieldset_events_tab:"Element Events",
22title_ins_element:"Insertion Element",
23title_del_element:"Deletion Element",
24title_acronym_element:"Acronym Element",
25title_abbr_element:"Abbreviation Element",
26title_cite_element:"Citation Element",
27remove:"Remove",
28insert_date:"Insert current date/time",
29option_ltr:"Left to right",
30option_rtl:"Right to left",
31attribs_title:"Insert/Edit Attributes"
32}); \ No newline at end of file