TinyMCE Advanced - Version 3.2.4

Version Description

Download this release

Release Info

Developer azaozz
Plugin Icon 128x128 TinyMCE Advanced
Version 3.2.4
Comparing to
See all releases

Code changes from version 3.2 to 3.2.4

Files changed (48) hide show
  1. css/tadv-mce.css +3 -3
  2. css/tadv-styles.css +9 -1
  3. js/tadv.js +111 -111
  4. js/tadv_replace.js +111 -111
  5. mce/advhr/editor_plugin.js +1 -1
  6. mce/advhr/rule.htm +6 -7
  7. mce/advimage/editor_plugin.js +1 -1
  8. mce/advimage/image.htm +12 -13
  9. mce/advimage/js/image.js +2 -0
  10. mce/advlink/editor_plugin.js +1 -1
  11. mce/advlink/js/advlink.js +2 -1
  12. mce/advlink/link.htm +26 -27
  13. mce/contextmenu/editor_plugin.js +1 -1
  14. mce/iespell/editor_plugin.js +1 -1
  15. mce/insertdatetime/editor_plugin.js +1 -1
  16. mce/layer/editor_plugin.js +1 -1
  17. mce/nonbreaking/editor_plugin.js +1 -1
  18. mce/print/editor_plugin.js +1 -1
  19. mce/searchreplace/editor_plugin.js +1 -1
  20. mce/searchreplace/searchreplace.htm +5 -6
  21. mce/style/editor_plugin.js +1 -1
  22. mce/style/js/props.js +7 -7
  23. mce/style/props.htm +6 -7
  24. mce/table/cell.htm +6 -7
  25. mce/table/editor_plugin.js +1 -1
  26. mce/table/js/table.js +28 -1
  27. mce/table/merge_cells.htm +5 -6
  28. mce/table/row.htm +7 -8
  29. mce/table/table.htm +8 -9
  30. mce/visualchars/editor_plugin.js +1 -1
  31. mce/xhtmlxtras/abbr.htm +7 -8
  32. mce/xhtmlxtras/acronym.htm +7 -8
  33. mce/xhtmlxtras/attributes.htm +8 -9
  34. mce/xhtmlxtras/cite.htm +7 -8
  35. mce/xhtmlxtras/del.htm +8 -9
  36. mce/xhtmlxtras/editor_plugin.js +1 -1
  37. mce/xhtmlxtras/ins.htm +8 -9
  38. mce/xhtmlxtras/js/element_common.js +1 -1
  39. readme.txt +6 -4
  40. screenshot-1.png +0 -0
  41. tadv_admin.php +357 -356
  42. tadv_defaults.php +18 -19
  43. tiny_mce_popup.js +5 -294
  44. tinymce-advanced.php +6 -8
  45. utils/editable_selects.js +69 -69
  46. utils/form_utils.js +199 -199
  47. utils/mctabs.js +76 -76
  48. utils/validate.js +219 -219
css/tadv-mce.css CHANGED
@@ -1,3 +1,3 @@
1
- /* Add css class names below and they will show in all "Style" drop-downs */
2
- .shutter {}
3
- .shutterset {}
1
+ /* Add css class names below and they will show in all "Style" drop-downs */
2
+ .shutter {}
3
+ .shutterset {}
css/tadv-styles.css CHANGED
@@ -72,6 +72,10 @@ form#tadvadmin {
72
  margin:1px;
73
  padding:1px 2px;
74
  width:20px;
 
 
 
 
75
  }
76
  .tadvdropzone ul {
77
  height: 30px;
@@ -118,6 +122,10 @@ form#tadvadmin {
118
  border: 1px solid #bbb;
119
  background-color: #fff;
120
  margin: 4px;
 
 
 
 
121
  }
122
  #tadvpalette .tadvmodule .descr {
123
  display: inline;
@@ -216,4 +224,4 @@ form#tadvadmin {
216
  opacity: 0.6;
217
  filter: alpha(opacity=60);
218
  z-index: 100;
219
- }
72
  margin:1px;
73
  padding:1px 2px;
74
  width:20px;
75
+ -moz-border-radius: 3px;
76
+ -khtml-border-radius: 3px;
77
+ -webkit-border-radius: 3px;
78
+ border-radius: 3px;
79
  }
80
  .tadvdropzone ul {
81
  height: 30px;
122
  border: 1px solid #bbb;
123
  background-color: #fff;
124
  margin: 4px;
125
+ -moz-border-radius: 3px;
126
+ -khtml-border-radius: 3px;
127
+ -webkit-border-radius: 3px;
128
+ border-radius: 3px;
129
  }
130
  #tadvpalette .tadvmodule .descr {
131
  display: inline;
224
  opacity: 0.6;
225
  filter: alpha(opacity=60);
226
  z-index: 100;
227
+ }
js/tadv.js CHANGED
@@ -1,111 +1,111 @@
1
- // TinyMCE Advanced jQuery sortables
2
-
3
- (function($) {
4
- tadvSortable = {
5
-
6
- init : function() {
7
- $("#toolbar_1").sortable({
8
- connectWith: ["#toolbar_2, #toolbar_3, #toolbar_4, #tadvpalette"],
9
- items : 'li',
10
- stop : tadvSortable.update,
11
- revert : true,
12
- containment : '#contain'
13
- });
14
-
15
- $("#toolbar_2").sortable({
16
- connectWith: ["#toolbar_1, #toolbar_3, #toolbar_4, #tadvpalette"],
17
- items : 'li',
18
- stop : tadvSortable.update,
19
- revert : true,
20
- containment : '#contain'
21
- });
22
-
23
- $("#toolbar_3").sortable({
24
- connectWith: ["#toolbar_2, #toolbar_1, #toolbar_4, #tadvpalette"],
25
- items : 'li',
26
- stop : tadvSortable.update,
27
- revert : true,
28
- containment : '#contain'
29
- });
30
-
31
- $("#toolbar_4").sortable({
32
- connectWith: ["#toolbar_2, #toolbar_3, #toolbar_1, #tadvpalette"],
33
- items : 'li',
34
- stop : tadvSortable.update,
35
- revert : true,
36
- containment : '#contain'
37
- });
38
-
39
- $("#tadvpalette").sortable({
40
- connectWith: ["#toolbar_1, #toolbar_2, #toolbar_3, #toolbar_4"],
41
- items : 'li',
42
- stop : tadvSortable.update,
43
- revert : true,
44
- containment : '#contain'
45
- });
46
-
47
- this.update();
48
- $(window).resize(function(){
49
- tadvSortable.update();
50
- });
51
- },
52
-
53
- I : function(a) {
54
- return document.getElementById(a);
55
- },
56
-
57
- serialize : function() {
58
- var tb1, tb2, tb3, tb4;
59
-
60
- tb1 = $('#toolbar_1').sortable('serialize',{expression : '([^_]+)_(.+)'});
61
- tb2 = $('#toolbar_2').sortable('serialize',{expression : '([^_]+)_(.+)'});
62
- tb3 = $('#toolbar_3').sortable('serialize',{expression : '([^_]+)_(.+)'})
63
- tb4 = $('#toolbar_4').sortable('serialize',{expression : '([^_]+)_(.+)'})
64
-
65
- $('#toolbar_1order').val(tb1);
66
- $('#toolbar_2order').val(tb2);
67
- $('#toolbar_3order').val(tb3);
68
- $('#toolbar_4order').val(tb4);
69
-
70
- if ( (tb1.indexOf('wp_adv') != -1 && ! tb2) ||
71
- (tb2.indexOf('wp_adv') != -1 && ! tb3) ||
72
- (tb3.indexOf('wp_adv') != -1 && ! tb4) ||
73
- tb4.indexOf('wp_adv') != -1 ) {
74
- $('#sink_err').css('display', 'inline');
75
- return false;
76
- }
77
- $('#tadvadmin').submit();
78
- },
79
-
80
- reset : function() {
81
- var pd = this.I('tadvpalette');
82
- if ( ! pd ) return;
83
- if( pd.childNodes.length > 6 ) {
84
- var last = pd.lastChild.previousSibling;
85
- pd.style.height = last.offsetTop + last.offsetHeight + 30 + "px";
86
- } else pd.style.height = "60px";
87
- },
88
-
89
- update : function() {
90
- var t = tadvSortable, w;
91
-
92
- t.reset();
93
- $('#too_long').css('display', 'none');
94
- $('#sink_err').css('display', 'none');
95
-
96
- $('.container').each(function(no,o){
97
- var kids = o.childNodes, tbwidth = o.clientWidth, W = 0;
98
-
99
- for( i = 0; i < kids.length; i++ ) {
100
- if ( w = kids[i].offsetWidth )
101
- W += w;
102
- }
103
-
104
- if( (W+8) > tbwidth )
105
- $('#too_long').css('display', 'inline');
106
- });
107
- }
108
- }
109
- }(jQuery));
110
-
111
- jQuery(document).ready(function(){ tadvSortable.init(); });
1
+ // TinyMCE Advanced jQuery sortables
2
+
3
+ (function($) {
4
+ tadvSortable = {
5
+
6
+ init : function() {
7
+ $("#toolbar_1").sortable({
8
+ connectWith: ["#toolbar_2, #toolbar_3, #toolbar_4, #tadvpalette"],
9
+ items : 'li',
10
+ stop : tadvSortable.update,
11
+ revert : true,
12
+ containment : '#contain'
13
+ });
14
+
15
+ $("#toolbar_2").sortable({
16
+ connectWith: ["#toolbar_1, #toolbar_3, #toolbar_4, #tadvpalette"],
17
+ items : 'li',
18
+ stop : tadvSortable.update,
19
+ revert : true,
20
+ containment : '#contain'
21
+ });
22
+
23
+ $("#toolbar_3").sortable({
24
+ connectWith: ["#toolbar_2, #toolbar_1, #toolbar_4, #tadvpalette"],
25
+ items : 'li',
26
+ stop : tadvSortable.update,
27
+ revert : true,
28
+ containment : '#contain'
29
+ });
30
+
31
+ $("#toolbar_4").sortable({
32
+ connectWith: ["#toolbar_2, #toolbar_3, #toolbar_1, #tadvpalette"],
33
+ items : 'li',
34
+ stop : tadvSortable.update,
35
+ revert : true,
36
+ containment : '#contain'
37
+ });
38
+
39
+ $("#tadvpalette").sortable({
40
+ connectWith: ["#toolbar_1, #toolbar_2, #toolbar_3, #toolbar_4"],
41
+ items : 'li',
42
+ stop : tadvSortable.update,
43
+ revert : true,
44
+ containment : '#contain'
45
+ });
46
+
47
+ this.update();
48
+ $(window).resize(function(){
49
+ tadvSortable.update();
50
+ });
51
+ },
52
+
53
+ I : function(a) {
54
+ return document.getElementById(a);
55
+ },
56
+
57
+ serialize : function() {
58
+ var tb1, tb2, tb3, tb4;
59
+
60
+ tb1 = $('#toolbar_1').sortable('serialize',{expression : '([^_]+)_(.+)'});
61
+ tb2 = $('#toolbar_2').sortable('serialize',{expression : '([^_]+)_(.+)'});
62
+ tb3 = $('#toolbar_3').sortable('serialize',{expression : '([^_]+)_(.+)'})
63
+ tb4 = $('#toolbar_4').sortable('serialize',{expression : '([^_]+)_(.+)'})
64
+
65
+ $('#toolbar_1order').val(tb1);
66
+ $('#toolbar_2order').val(tb2);
67
+ $('#toolbar_3order').val(tb3);
68
+ $('#toolbar_4order').val(tb4);
69
+
70
+ if ( (tb1.indexOf('wp_adv') != -1 && ! tb2) ||
71
+ (tb2.indexOf('wp_adv') != -1 && ! tb3) ||
72
+ (tb3.indexOf('wp_adv') != -1 && ! tb4) ||
73
+ tb4.indexOf('wp_adv') != -1 ) {
74
+ $('#sink_err').css('display', 'inline');
75
+ return false;
76
+ }
77
+ $('#tadvadmin').submit();
78
+ },
79
+
80
+ reset : function() {
81
+ var pd = this.I('tadvpalette');
82
+ if ( ! pd ) return;
83
+ if( pd.childNodes.length > 6 ) {
84
+ var last = pd.lastChild.previousSibling;
85
+ pd.style.height = last.offsetTop + last.offsetHeight + 30 + "px";
86
+ } else pd.style.height = "60px";
87
+ },
88
+
89
+ update : function() {
90
+ var t = tadvSortable, w;
91
+
92
+ t.reset();
93
+ $('#too_long').css('display', 'none');
94
+ $('#sink_err').css('display', 'none');
95
+
96
+ $('.container').each(function(no,o){
97
+ var kids = o.childNodes, tbwidth = o.clientWidth, W = 0;
98
+
99
+ for( i = 0; i < kids.length; i++ ) {
100
+ if ( w = kids[i].offsetWidth )
101
+ W += w;
102
+ }
103
+
104
+ if( (W+8) > tbwidth )
105
+ $('#too_long').css('display', 'inline');
106
+ });
107
+ }
108
+ }
109
+ }(jQuery));
110
+
111
+ jQuery(document).ready(function(){ tadvSortable.init(); });
js/tadv_replace.js CHANGED
@@ -1,111 +1,111 @@
1
-
2
- tadvReplace = {
3
-
4
- init : function() {
5
- var t = this, btn1, btn2, tb = document.getElementById('ed_toolbar'), c = document.getElementById('content'), se;
6
- se = ( 'undefined' != typeof switchEditors ) ? switchEditors : null;
7
-
8
- if ( se ) {
9
- if ( 'function' == typeof se._wpautop ) {
10
- se.tadv_wpautop = se._wpautop;
11
- se._wpautop = tadvReplace.noautop;
12
- se.tadv_pre_wpautop = se._pre_wpautop;
13
- se._pre_wpautop = tadvReplace.pre_format;
14
- } else {
15
- se.tadv_wpautop = se.wpautop;
16
- se.wpautop = tadvReplace.noautop;
17
- se.tadv_pre_wpautop = se.pre_wpautop;
18
- se.pre_wpautop = tadvReplace.pre_format;
19
- }
20
- }
21
-
22
- if ( c.value == '<br />\n' ) c.value = '';
23
- /*
24
- if ( 'undefined' != typeof tb ) {
25
- btn1 = document.createElement('input');
26
- btn1.type = 'button';
27
- btn1.value = 'autop';
28
- btn1.className = 'ed_button';
29
- btn1.title = 'autop';
30
- btn1.id = 'ed_autop';
31
- btn1.onclick = function(){tadvReplace.btn_autop();};
32
- tb.appendChild(btn1);
33
-
34
- btn2 = document.createElement('input');
35
- btn2.type = 'button';
36
- btn2.value = 'undo';
37
- btn2.className = 'ed_button';
38
- btn2.title = 'undo';
39
- btn2.id = 'ed_undo';
40
- btn2.style.color = '#888';
41
- btn2.onclick = function(){tadvReplace.btn_undo();};
42
- tb.appendChild(btn2);
43
- }
44
- */
45
- },
46
-
47
- pre_format : function(c) {
48
-
49
- c = c.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
50
- a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
51
- return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
52
- });
53
-
54
- c = c.replace(/<p>(\s|<br ?\/?>|\u00a0)*<\/p>/g, '<p><br class="spacer_" /></p>'); // keep empty paragraphs...
55
- c = c.replace(/\[\/sourcecode\]\s*<br \/>\s*<br \/>/g, '[/sourcecode]\n');
56
- c = c.replace(/<p( [^>]*)?>/g, '\n<p$1>');
57
- c = c.replace(/<\/p>/g, '</p>\n');
58
- c = c.replace(/<\/p>\s*<p/g, '</p>\n\n<p');
59
- c = c.replace(/<((blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])[^>]*)>\s*<p/g, '<$1><p');
60
- c = c.replace(/<\/p>\s*<\/(blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])>/g, '</p></$1>');
61
- c = c.replace(/<br ?\/?>[\r\n]*/g, '<br />\n');
62
- c = c.replace(/<li([^>]*)>/g, '\t<li$1>');
63
- c = c.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
64
- c = c.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
65
-
66
- c = c.replace(/<object[\s\S]+?<\/object>/g, function(a) {
67
- return a.replace(/[\r\n]*/g, '');
68
- });
69
-
70
- return tinymce.trim(c);
71
- },
72
-
73
- cache : '',
74
-
75
- btn_undo : function() {
76
- var t = this, btn_undo = document.getElementById('ed_undo');
77
-
78
- if ( t.cache ) document.getElementById('content').value = t.cache;
79
- btn_undo.style.color = '#888';
80
- },
81
-
82
- btn_autop : function() {
83
- var c = document.getElementById('content'), t = this, sel, btn_undo = document.getElementById('ed_undo'), autop = switchEditors.tadv_pre_wpautop;
84
- t.cache = c.value;
85
-
86
- if ( document.selection ) { //ie
87
- c.focus();
88
- sel = document.selection.createRange();
89
- if ( sel.text.length > 0 )
90
- sel.text = autop(sel.text);
91
- else c.value = autop(c.value);
92
-
93
- } else if ( c.selectionEnd > 0 && c.selectionStart != c.selectionEnd ) { //ff
94
- var startPos = c.selectionStart, endPos = c.selectionEnd, scrollTop = c.scrollTop;
95
-
96
- c.value = c.value.substring(0, startPos)
97
- + autop(c.value.substring(startPos, endPos))
98
- + c.value.substring(endPos, c.value.length);
99
- c.scrollTop = scrollTop;
100
- } else
101
- c.value = autop(c.value);
102
-
103
- c.focus();
104
-
105
- btn_undo.style.color = '#000';
106
- },
107
-
108
- noautop : function(c) {return c;}
109
- }
110
-
111
- addLoadEvent(function(){tadvReplace.init();});
1
+
2
+ tadvReplace = {
3
+
4
+ init : function() {
5
+ var t = this, btn1, btn2, tb = document.getElementById('ed_toolbar'), c = document.getElementById('content'), se;
6
+ se = ( 'undefined' != typeof switchEditors ) ? switchEditors : null;
7
+
8
+ if ( se ) {
9
+ if ( 'function' == typeof se._wpautop ) {
10
+ se.tadv_wpautop = se._wpautop;
11
+ se._wpautop = tadvReplace.noautop;
12
+ se.tadv_pre_wpautop = se._pre_wpautop;
13
+ se._pre_wpautop = tadvReplace.pre_format;
14
+ } else {
15
+ se.tadv_wpautop = se.wpautop;
16
+ se.wpautop = tadvReplace.noautop;
17
+ se.tadv_pre_wpautop = se.pre_wpautop;
18
+ se.pre_wpautop = tadvReplace.pre_format;
19
+ }
20
+ }
21
+
22
+ if ( c.value == '<br />\n' ) c.value = '';
23
+ /*
24
+ if ( 'undefined' != typeof tb ) {
25
+ btn1 = document.createElement('input');
26
+ btn1.type = 'button';
27
+ btn1.value = 'autop';
28
+ btn1.className = 'ed_button';
29
+ btn1.title = 'autop';
30
+ btn1.id = 'ed_autop';
31
+ btn1.onclick = function(){tadvReplace.btn_autop();};
32
+ tb.appendChild(btn1);
33
+
34
+ btn2 = document.createElement('input');
35
+ btn2.type = 'button';
36
+ btn2.value = 'undo';
37
+ btn2.className = 'ed_button';
38
+ btn2.title = 'undo';
39
+ btn2.id = 'ed_undo';
40
+ btn2.style.color = '#888';
41
+ btn2.onclick = function(){tadvReplace.btn_undo();};
42
+ tb.appendChild(btn2);
43
+ }
44
+ */
45
+ },
46
+
47
+ pre_format : function(c) {
48
+
49
+ c = c.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
50
+ a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
51
+ return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
52
+ });
53
+
54
+ c = c.replace(/<p>(\s|<br ?\/?>|\u00a0)*<\/p>/g, '<p><br class="spacer_" /></p>'); // keep empty paragraphs...
55
+ c = c.replace(/\[\/sourcecode\]\s*<br \/>\s*<br \/>/g, '[/sourcecode]\n');
56
+ c = c.replace(/<p( [^>]*)?>/g, '\n<p$1>');
57
+ c = c.replace(/<\/p>/g, '</p>\n');
58
+ c = c.replace(/<\/p>\s*<p/g, '</p>\n\n<p');
59
+ c = c.replace(/<((blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])[^>]*)>\s*<p/g, '<$1><p');
60
+ c = c.replace(/<\/p>\s*<\/(blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])>/g, '</p></$1>');
61
+ c = c.replace(/<br ?\/?>[\r\n]*/g, '<br />\n');
62
+ c = c.replace(/<li([^>]*)>/g, '\t<li$1>');
63
+ c = c.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
64
+ c = c.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
65
+
66
+ c = c.replace(/<object[\s\S]+?<\/object>/g, function(a) {
67
+ return a.replace(/[\r\n]*/g, '');
68
+ });
69
+
70
+ return tinymce.trim(c);
71
+ },
72
+
73
+ cache : '',
74
+
75
+ btn_undo : function() {
76
+ var t = this, btn_undo = document.getElementById('ed_undo');
77
+
78
+ if ( t.cache ) document.getElementById('content').value = t.cache;
79
+ btn_undo.style.color = '#888';
80
+ },
81
+
82
+ btn_autop : function() {
83
+ var c = document.getElementById('content'), t = this, sel, btn_undo = document.getElementById('ed_undo'), autop = switchEditors.tadv_pre_wpautop;
84
+ t.cache = c.value;
85
+
86
+ if ( document.selection ) { //ie
87
+ c.focus();
88
+ sel = document.selection.createRange();
89
+ if ( sel.text.length > 0 )
90
+ sel.text = autop(sel.text);
91
+ else c.value = autop(c.value);
92
+
93
+ } else if ( c.selectionEnd > 0 && c.selectionStart != c.selectionEnd ) { //ff
94
+ var startPos = c.selectionStart, endPos = c.selectionEnd, scrollTop = c.scrollTop;
95
+
96
+ c.value = c.value.substring(0, startPos)
97
+ + autop(c.value.substring(startPos, endPos))
98
+ + c.value.substring(endPos, c.value.length);
99
+ c.scrollTop = scrollTop;
100
+ } else
101
+ c.value = autop(c.value);
102
+
103
+ c.focus();
104
+
105
+ btn_undo.style.color = '#000';
106
+ },
107
+
108
+ noautop : function(c) {return c;}
109
+ }
110
+
111
+ addLoadEvent(function(){tadvReplace.init();});
mce/advhr/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},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)})();
mce/advhr/rule.htm CHANGED
@@ -2,12 +2,11 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="js/rule.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
9
- <link href="css/advhr.css?ver=3211" rel="stylesheet" type="text/css" />
10
- <base target="_self" />
11
  </head>
12
  <body>
13
  <form onsubmit="AdvHRDialog.update();return false;" action="#">
@@ -22,7 +21,7 @@
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>
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="js/rule.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
9
+ <link href="css/advhr.css?ver=3241-1141" rel="stylesheet" type="text/css" />
 
10
  </head>
11
  <body>
12
  <form onsubmit="AdvHRDialog.update();return false;" action="#">
21
  <table border="0" cellpadding="4" cellspacing="0">
22
  <tr>
23
  <td><label for="width">{#advhr_dlg.width}</label></td>
24
+ <td class="nowrap">
25
  <input id="width" name="width" type="text" value="" class="mceFocus" />
26
  <select name="width2" id="width2">
27
  <option value="">px</option>
mce/advimage/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.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)})();
mce/advimage/image.htm CHANGED
@@ -2,14 +2,13 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/validate.js?ver=3211"></script>
9
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
10
- <script type="text/javascript" src="js/image.js?ver=3211"></script>
11
- <link href="css/advimage.css?ver=3211" 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="#">
@@ -38,7 +37,7 @@
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>
@@ -89,7 +88,7 @@
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>
@@ -123,7 +122,7 @@
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>
@@ -158,7 +157,7 @@
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>
@@ -171,7 +170,7 @@
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>
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
10
+ <script type="text/javascript" src="js/image.js?ver=3241-1141"></script>
11
+ <link href="css/advimage.css?ver=3241-1141" rel="stylesheet" type="text/css" />
 
12
  </head>
13
  <body id="advimage" style="display: none">
14
  <form onsubmit="ImageDialog.insert();return false;" action="#">
37
  </tr>
38
  <tr>
39
  <td><label for="src_list">{#advimage_dlg.image_list}</label></td>
40
+ <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);"><option value=""></option></select></td>
41
  </tr>
42
  <tr>
43
  <td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
88
 
89
  <tr>
90
  <td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
91
+ <td class="nowrap">
92
  <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x
93
  <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px
94
  </td>
122
 
123
  <tr>
124
  <td><label for="class_list">{#class_name}</label></td>
125
+ <td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>
126
  </tr>
127
 
128
  <tr>
157
  </tr>
158
  <tr>
159
  <td><label for="over_list">{#advimage_dlg.image_list}</label></td>
160
+ <td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
161
  </tr>
162
  <tr>
163
  <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
170
  </tr>
171
  <tr>
172
  <td><label for="out_list">{#advimage_dlg.image_list}</label></td>
173
+ <td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
174
  </tr>
175
  </table>
176
  </fieldset>
mce/advimage/js/image.js CHANGED
@@ -272,6 +272,7 @@ var ImageDialog = {
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) {
@@ -285,6 +286,7 @@ var ImageDialog = {
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('', '');
272
  cl = tinyMCEPopup.editor.dom.getClasses();
273
 
274
  if (cl.length > 0) {
275
+ lst.options.length = 0;
276
  lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
277
 
278
  tinymce.each(cl, function(o) {
286
  var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
287
 
288
  l = window[l];
289
+ lst.options.length = 0;
290
 
291
  if (l && l.length > 0) {
292
  lst.options[lst.options.length] = new Option('', '');
mce/advlink/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.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)})();
mce/advlink/js/advlink.js CHANGED
@@ -116,7 +116,7 @@ function 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
 
@@ -402,6 +402,7 @@ function insertAction() {
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#';});
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
 
402
 
403
  // Create new anchor elements
404
  if (elm == null) {
405
+ inst.getDoc().execCommand("unlink", false, null);
406
  tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
407
 
408
  elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
mce/advlink/link.htm CHANGED
@@ -2,13 +2,12 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/validate.js?ver=3211"></script>
9
- <script type="text/javascript" src="js/advlink.js?ver=3211"></script>
10
- <link href="css/advlink.css?ver=3211" 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="#">
@@ -28,7 +27,7 @@
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>
@@ -38,25 +37,25 @@
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>
@@ -73,7 +72,7 @@
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>
@@ -84,19 +83,19 @@
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>
@@ -109,27 +108,27 @@
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>
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="js/advlink.js?ver=3241-1141"></script>
10
+ <link href="css/advlink.css?ver=3241-1141" rel="stylesheet" type="text/css" />
 
11
  </head>
12
  <body id="advlink" style="display: none">
13
  <form onsubmit="insertAction();return false;" action="#">
27
 
28
  <table border="0" cellpadding="4" cellspacing="0">
29
  <tr>
30
+ <td class="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>
31
  <td><table border="0" cellspacing="0" cellpadding="0">
32
  <tr>
33
  <td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>
37
  </tr>
38
  <tr id="linklisthrefrow">
39
  <td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>
40
+ <td colspan="2" id="linklisthrefcontainer"><select id="linklisthref"><option value=""></option></select></td>
41
  </tr>
42
  <tr>
43
  <td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>
44
+ <td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td>
45
  </tr>
46
  <tr>
47
  <td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>
48
+ <td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td>
49
  </tr>
50
  <tr>
51
+ <td class="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>
52
  <td><input id="title" name="title" type="text" value="" /></td>
53
  </tr>
54
  <tr>
55
  <td><label id="classlabel" for="classlist">{#class_name}</label></td>
56
  <td>
57
  <select id="classlist" name="classlist" onchange="changeClass();">
58
+ <option value="" selected="selected">{#not_set}</option>
59
  </select>
60
  </td>
61
  </tr>
72
 
73
  <table border="0" cellpadding="0" cellspacing="4">
74
  <tr>
75
+ <td class="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label>&nbsp;</td>
76
  <td>
77
  <table border="0" cellspacing="0" cellpadding="0">
78
  <tr>
83
  </td>
84
  </tr>
85
  <tr>
86
+ <td class="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label>&nbsp;</td>
87
  <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
88
  </tr>
89
  <tr>
90
+ <td class="nowrap"><label>{#advlink_dlg.popup_size}</label>&nbsp;</td>
91
+ <td class="nowrap">
92
  <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x
93
  <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px
94
  </td>
95
  </tr>
96
  <tr>
97
+ <td class="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label>&nbsp;</td>
98
+ <td class="nowrap">
99
  <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /
100
  <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)
101
  </td>
108
  <table border="0" cellpadding="0" cellspacing="4">
109
  <tr>
110
  <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
111
+ <td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
112
  <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
113
+ <td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
114
  </tr>
115
  <tr>
116
  <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
117
+ <td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
118
  <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
119
+ <td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
120
  </tr>
121
  <tr>
122
  <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
123
+ <td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
124
  <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
125
+ <td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
126
  </tr>
127
  <tr>
128
  <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
129
+ <td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
130
  <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
131
+ <td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
132
  </tr>
133
  </table>
134
  </fieldset>
mce/contextmenu/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(g,h){if(!h.ctrlKey){f._getMenu(g).showMenu(h.clientX,h.clientY);a.add(g.getDoc(),"click",e);a.cancel(h)}});function e(){if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(d.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e)},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
mce/iespell/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.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)})();
mce/insertdatetime/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.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(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length<d){for(var f=0;f<(d-g.length);f++){g="0"+g}}return g}a=a.replace("%D","%m/%d/%y");a=a.replace("%r","%I:%M:%S %p");a=a.replace("%Y",""+e.getFullYear());a=a.replace("%y",""+e.getYear());a=a.replace("%m",b(e.getMonth()+1,2));a=a.replace("%d",b(e.getDate(),2));a=a.replace("%H",""+b(e.getHours(),2));a=a.replace("%M",""+b(e.getMinutes(),2));a=a.replace("%S",""+b(e.getSeconds(),2));a=a.replace("%I",""+((e.getHours()+11)%12+1));a=a.replace("%p",""+(e.getHours()<12?"AM":"PM"));a=a.replace("%B",""+c.getLang("insertdatetime.months_long").split(",")[e.getMonth()]);a=a.replace("%b",""+c.getLang("insertdatetime.months_short").split(",")[e.getMonth()]);a=a.replace("%A",""+c.getLang("insertdatetime.day_long").split(",")[e.getDay()]);a=a.replace("%a",""+c.getLang("insertdatetime.day_short").split(",")[e.getDay()]);a=a.replace("%%","%");return a}});tinymce.PluginManager.add("insertdatetime",tinymce.plugins.InsertDateTime)})();
mce/layer/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.Layer",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertLayer",c._insertLayer,c);a.addCommand("mceMoveForward",function(){c._move(1)});a.addCommand("mceMoveBackward",function(){c._move(-1)});a.addCommand("mceMakeAbsolute",function(){c._toggleAbsolute()});a.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});a.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});a.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});a.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});a.onInit.add(function(){if(tinymce.isIE){a.getDoc().execCommand("2D-Position",false,true)}});a.onNodeChange.add(c._nodeChange,c);a.onVisualAid.add(c._visualAid,c)},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(b,a,e){var c,d;c=this._getParentLayer(e);d=b.dom.getParent(e,"DIV,P,IMG");if(!d){a.setDisabled("absolute",1);a.setDisabled("moveforward",1);a.setDisabled("movebackward",1)}else{a.setDisabled("absolute",0);a.setDisabled("moveforward",!c);a.setDisabled("movebackward",!c);a.setActive("absolute",c&&c.style.position.toLowerCase()=="absolute")}},_visualAid:function(a,c,b){var d=a.dom;tinymce.each(d.select("div,p",c),function(f){if(/^(absolute|relative|static)$/i.test(f.style.position)){if(b){d.addClass(f,"mceItemVisualAid")}else{d.removeClass(f,"mceItemVisualAid")}}})},_move:function(h){var b=this.editor,f,g=[],e=this._getParentLayer(b.selection.getNode()),c=-1,j=-1,a;a=[];tinymce.walk(b.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){a.push(d)}},"childNodes");for(f=0;f<a.length;f++){g[f]=a[f].style.zIndex?parseInt(a[f].style.zIndex):0;if(c<0&&a[f]==e){c=f}}if(h<0){for(f=0;f<g.length;f++){if(g[f]<g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{if(g[c]>0){a[c].style.zIndex=g[c]-1}}}else{for(f=0;f<g.length;f++){if(g[f]>g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{a[c].style.zIndex=g[c]+1}}b.execCommand("mceRepaint")},_getParentLayer:function(a){return this.editor.dom.getParent(a,function(b){return b.nodeType==1&&/^(absolute|relative|static)$/i.test(b.style.position)})},_insertLayer:function(){var a=this.editor,b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));a.dom.add(a.getBody(),"div",{style:{position:"absolute",left:b.x,top:(b.y>20?b.y:20),width:100,height:100},"class":"mceItemVisualAid"},a.selection.getContent()||a.getLang("layer.content"))},_toggleAbsolute:function(){var a=this.editor,b=this._getParentLayer(a.selection.getNode());if(!b){b=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")}if(b){if(b.style.position.toLowerCase()=="absolute"){a.dom.setStyles(b,{position:"",left:"",top:"",width:"",height:""});a.dom.removeClass(b,"mceItemVisualAid")}else{if(b.style.left==""){b.style.left=20+"px"}if(b.style.top==""){b.style.top=20+"px"}if(b.style.width==""){b.style.width=b.width?(b.width+"px"):"100px"}if(b.style.height==""){b.style.height=b.height?(b.height+"px"):"100px"}b.style.position="absolute";a.addVisual(a.getBody())}a.execCommand("mceRepaint");a.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})();
mce/nonbreaking/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'<span class="mceItemHidden mceVisualNbsp">&middot;</span>':"&nbsp;")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},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)})();
mce/print/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.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)})();
mce/searchreplace/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:160+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.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)})();
mce/searchreplace/searchreplace.htm CHANGED
@@ -2,12 +2,11 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="js/searchreplace.js?ver=3211"></script>
9
- <link rel="stylesheet" type="text/css" href="css/searchreplace.css?ver=3211" />
10
- <base target="_self" />
11
  </head>
12
  <body style="display:none;">
13
  <form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="js/searchreplace.js?ver=3241-1141"></script>
9
+ <link rel="stylesheet" type="text/css" href="css/searchreplace.css?ver=3241-1141" />
 
10
  </head>
11
  <body style="display:none;">
12
  <form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">
mce/style/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:320+parseInt(a.getLang("style.delta_height",0)),inline:1},{plugin_url:b,style_text:a.selection.getNode().style.cssText})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.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)})();
mce/style/js/props.js CHANGED
@@ -10,9 +10,9 @@ var defaultFonts = "" +
10
  "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";
11
 
12
  var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";
13
- var defaultMeasurement = "+pixels=px;points=pt;em;in;cm;mm;picas;ems;exs;%";
14
- var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%";
15
- var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%";
16
  var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";
17
  var defaultTextStyle = "normal;italic;oblique";
18
  var defaultVariant = "normal;small-caps";
@@ -247,12 +247,12 @@ function setupFormData() {
247
  }
248
 
249
  function getMeasurement(s) {
250
- return s.replace(/^([0-9]+)(.*)$/, "$2");
251
  }
252
 
253
  function 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
  }
@@ -478,7 +478,7 @@ function generateCSS() {
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;
10
  "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";
11
 
12
  var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";
13
+ var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";
14
+ var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%";
15
+ var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";
16
  var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";
17
  var defaultTextStyle = "normal;italic;oblique";
18
  var defaultVariant = "normal;small-caps";
247
  }
248
 
249
  function getMeasurement(s) {
250
+ return s.replace(/^([0-9.]+)(.*)$/, "$2");
251
  }
252
 
253
  function 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
  }
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 + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");
482
 
483
  if (!f.border_color_same.checked) {
484
  ce.style.borderTopColor = f.border_color_top.value;
mce/style/props.htm CHANGED
@@ -2,13 +2,12 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
9
- <script type="text/javascript" src="js/props.js?ver=3211"></script>
10
- <link href="css/props.css?ver=3211" rel="stylesheet" type="text/css" />
11
- <base target="_self" />
12
  </head>
13
 
14
  <body id="styleprops" style="display: none">
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="js/props.js?ver=3241-1141"></script>
10
+ <link href="css/props.css?ver=3241-1141" rel="stylesheet" type="text/css" />
 
11
  </head>
12
 
13
  <body id="styleprops" style="display: none">
mce/table/cell.htm CHANGED
@@ -2,13 +2,12 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
9
- <script type="text/javascript" src="js/cell.js?ver=3211"></script>
10
- <link href="css/cell.css?ver=3211" 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="#">
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="js/cell.js?ver=3241-1141"></script>
10
+ <link href="css/cell.css?ver=3241-1141" rel="stylesheet" type="text/css" />
 
11
  </head>
12
  <body id="tablecell" style="display: none">
13
  <form onsubmit="updateAction();return false;" action="#">
mce/table/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TablePlugin",{init:function(b,c){var d=this;d.editor=b;d.url=c;a([["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(e){b.addButton(e[0],{title:e[1],cmd:e[2],ui:e[3]})});if(b.getParam("inline_styles")){b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("table",g.node),function(i){var h;if(h=f.getAttrib(i,"width")){f.setStyle(i,"width",h);f.setAttrib(i,"width")}if(h=f.getAttrib(i,"height")){f.setStyle(i,"height",h);f.setAttrib(i,"height")}})})}b.onInit.add(function(){if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(h,f,j){var k,i=b.selection,g=i.getNode()||b.getBody();if(b.dom.getParent(j,"td")||b.dom.getParent(j,"th")){f.removeAll();if(g.nodeName=="A"&&!b.dom.getAttrib(g,"name")){f.add({title:"advanced.link_desc",icon:"link",cmd:b.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});f.addSeparator()}if(g.nodeName=="IMG"&&g.className.indexOf("mceItem")==-1){f.add({title:"advanced.image_desc",icon:"image",cmd:b.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator()}f.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",ui:true,value:{action:"insert"}});f.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable",ui:true});f.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete",ui:true});f.addSeparator();k=f.addMenu({title:"table.cell"});k.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps",ui:true});k.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells",ui:true});k.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells",ui:true});k=f.addMenu({title:"table.row"});k.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps",ui:true});k.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});k.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});k.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});k.addSeparator();k.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});k.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});k.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"});k.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"});k=f.addMenu({title:"table.col"});k.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});k.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});k.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{f.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",ui:true})}})}});b.onKeyDown.add(function(f,g){if(g.keyCode==9&&f.dom.getParent(f.selection.getNode(),"TABLE")){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(f.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(g)}f.undoManager.add()}});if(!tinymce.isIE){if(b.getParam("table_selection",true)){b.onClick.add(function(f,g){g=g.target;if(g.nodeName==="TABLE"){f.selection.select(g)}})}}b.onNodeChange.add(function(f,e,h){var g=f.dom.getParent(h,"td,th,caption");e.setActive("table",h.nodeName==="TABLE"||!!g);if(g&&g.nodeName==="CAPTION"){g=null}e.setDisabled("delete_table",!g);e.setDisabled("delete_col",!g);e.setDisabled("delete_table",!g);e.setDisabled("delete_row",!g);e.setDisabled("col_after",!g);e.setDisabled("col_before",!g);e.setDisabled("row_after",!g);e.setDisabled("row_before",!g);e.setDisabled("row_props",!g);e.setDisabled("cell_props",!g);e.setDisabled("split_cells",!g||(parseInt(f.dom.getAttrib(g,"colspan","1"))<2&&parseInt(f.dom.getAttrib(g,"rowspan","1"))<2));e.setDisabled("merge_cells",!g)});if(!tinymce.isIE){b.onBeforeSetContent.add(function(e,f){if(f.initial){f.content=f.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?"<$1$2>&nbsp;</$1>":'<$1$2><br mce_bogus="1" /></$1>')}})}},execCommand:function(f,e,g){var d=this.editor,c;switch(f){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":d.execCommand("mceBeginUndoLevel");this._doExecCommand(f,e,g);d.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(r,Z,ae){var V=this.editor,au=V,g=this.url;var n=V.selection.getNode();var W=V.dom.getParent(n,"tr");var aq=V.dom.getParent(n,"td,th");var F=V.dom.getParent(n,"table");var k=V.contentWindow.document;var av=F?F.getAttribute("border"):"";if(W&&aq==null){aq=W.cells[0]}function ap(y,x){for(var ax=0;ax<y.length;ax++){if(y[ax].length>0&&ap(y[ax],x)){return true}if(y[ax]==x){return true}}return false}function aj(x,i){var y;ad=e(F);x=x||0;i=i||0;x=Math.max(o.cellindex+x,0);i=Math.max(o.rowindex+i,0);V.execCommand("mceRepaint");y=d(ad,i,x);if(y){V.selection.select(y.firstChild||y);V.selection.collapse(1)}}function ah(){var i=k.createElement("td");if(!tinymce.isIE){i.innerHTML='<br mce_bogus="1"/>'}}function j(y){var x=V.dom.getAttrib(y,"colspan");var i=V.dom.getAttrib(y,"rowspan");x=x==""?1:parseInt(x);i=i==""?1:parseInt(i);return{colspan:x,rowspan:i}}function al(ax,az){var i,ay;for(ay=0;ay<ax.length;ay++){for(i=0;i<ax[ay].length;i++){if(ax[ay][i]==az){return{cellindex:i,rowindex:ay}}}}return null}function d(x,y,i){if(x[y]&&x[y][i]){return x[y][i]}return null}function A(aC,ax){var az=[],y=0,aA,ay,ax,aB;for(aA=0;aA<aC.rows.length;aA++){for(ay=0;ay<aC.rows[aA].cells.length;ay++,y++){az[y]=aC.rows[aA].cells[ay]}}for(aA=0;aA<az.length;aA++){if(az[aA]==ax){if(aB=az[aA+1]){return aB}}}}function e(aE){var i=[],aF=aE.rows,aC,aB,ay,az,aD,ax,aA;for(aB=0;aB<aF.length;aB++){for(aC=0;aC<aF[aB].cells.length;aC++){ay=aF[aB].cells[aC];az=j(ay);for(aD=aC;i[aB]&&i[aB][aD];aD++){}for(aA=aB;aA<aB+az.rowspan;aA++){if(!i[aA]){i[aA]=[]}for(ax=aD;ax<aD+az.colspan;ax++){i[aA][ax]=ay}}}}return i}function m(aG,aD,ay,ax){var y=e(aG),aF=al(y,ay);var aH,aC;if(ax.cells.length!=aD.childNodes.length){aH=aD.childNodes;aC=null;for(var aE=0;ay=d(y,aF.rowindex,aE);aE++){var aA=true;var aB=j(ay);if(ap(aH,ay)){ax.childNodes[aE]._delete=true}else{if((aC==null||ay!=aC)&&aB.colspan>1){for(var az=aE;az<aE+ay.colSpan;az++){ax.childNodes[az]._delete=true}}}if((aC==null||ay!=aC)&&aB.rowspan>1){ay.rowSpan=aB.rowspan+1}aC=ay}B(F)}}function O(x,i){while((x=x.previousSibling)!=null){if(x.nodeName==i){return x}}return null}function af(ax,ay){var x=ay.split(",");while((ax=ax.nextSibling)!=null){for(var y=0;y<x.length;y++){if(ax.nodeName.toLowerCase()==x[y].toLowerCase()){return ax}}}return null}function B(ax){if(ax.rows==0){return}var y=ax.rows[0];do{var x=af(y,"TR");if(y._delete){y.parentNode.removeChild(y);continue}var ay=y.cells[0];if(ay.cells>1){do{var i=af(ay,"TD,TH");if(ay._delete){ay.parentNode.removeChild(ay)}}while((ay=i)!=null)}}while((y=x)!=null)}function p(ax,aA,az){ax.rowSpan=1;var x=af(aA,"TR");for(var ay=1;ay<az&&x;ay++){var y=k.createElement("td");if(!tinymce.isIE){y.innerHTML='<br mce_bogus="1"/>'}if(tinymce.isIE){x.insertBefore(y,x.cells(ax.cellIndex))}else{x.insertBefore(y,x.cells[ax.cellIndex])}x=af(x,"TR")}}function S(aF,aH,aB){var y=e(aH);var ax=aB.cloneNode(false);var aG=al(y,aB.cells[0]);var aC=null;var aA=V.dom.getAttrib(aH,"border");var az=null;for(var aE=0;az=d(y,aG.rowindex,aE);aE++){var aD=null;if(aC!=az){for(var ay=0;ay<aB.cells.length;ay++){if(az==aB.cells[ay]){aD=az.cloneNode(true);break}}}if(aD==null){aD=aF.createElement("td");if(!tinymce.isIE){aD.innerHTML='<br mce_bogus="1"/>'}}aD.colSpan=1;aD.rowSpan=1;ax.appendChild(aD);aC=az}return ax}switch(r){case"mceTableMoveToNextRow":var L=A(F,aq);if(!L){V.execCommand("mceTableInsertRowAfter",aq);L=A(F,aq)}V.selection.select(L);V.selection.collapse(true);return true;case"mceTableRowProps":if(W==null){return true}if(Z){V.windowManager.open({url:g+"/row.htm",width:400+parseInt(V.getLang("table.rowprops_delta_width",0)),height:295+parseInt(V.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:g})}return true;case"mceTableCellProps":if(aq==null){return true}if(Z){V.windowManager.open({url:g+"/cell.htm",width:400+parseInt(V.getLang("table.cellprops_delta_width",0)),height:295+parseInt(V.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:g})}return true;case"mceInsertTable":if(Z){V.windowManager.open({url:g+"/table.htm",width:400+parseInt(V.getLang("table.table_delta_width",0)),height:320+parseInt(V.getLang("table.table_delta_height",0)),inline:1},{plugin_url:g,action:ae?ae.action:0})}return true;case"mceTableDelete":var G=V.dom.getParent(V.selection.getNode(),"table");if(G){G.parentNode.removeChild(G);V.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(!F){return true}if(W&&F!=W.parentNode){F=W.parentNode}if(F&&W){switch(r){case"mceTableCutRow":if(!W||!aq){return true}V.tableRowClipboard=S(k,F,W);V.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!W||!aq){return true}V.tableRowClipboard=S(k,F,W);break;case"mceTablePasteRowBefore":if(!W||!aq){return true}var v=V.tableRowClipboard.cloneNode(true);var h=O(W,"TR");if(h!=null){m(F,h,h.cells[0],v)}W.parentNode.insertBefore(v,W);break;case"mceTablePasteRowAfter":if(!W||!aq){return true}var X=af(W,"TR");var v=V.tableRowClipboard.cloneNode(true);m(F,W,aq,v);if(X==null){W.parentNode.appendChild(v)}else{X.parentNode.insertBefore(v,X)}break;case"mceTableInsertRowBefore":if(!W||!aq){return true}var ad=e(F);var o=al(ad,aq);var v=k.createElement("tr");var u=null;o.rowindex--;if(o.rowindex<0){o.rowindex=0}for(var ac=0;aq=d(ad,o.rowindex,ac);ac++){if(aq!=u){var E=j(aq);if(E.rowspan==1){var J=k.createElement("td");if(!tinymce.isIE){J.innerHTML='<br mce_bogus="1"/>'}J.colSpan=aq.colSpan;v.appendChild(J)}else{aq.rowSpan=E.rowspan+1}u=aq}}W.parentNode.insertBefore(v,W);aj(0,1);break;case"mceTableInsertRowAfter":if(!W||!aq){return true}var ad=e(F);var o=al(ad,aq);var v=k.createElement("tr");var u=null;for(var ac=0;aq=d(ad,o.rowindex,ac);ac++){if(aq!=u){var E=j(aq);if(E.rowspan==1){var J=k.createElement("td");if(!tinymce.isIE){J.innerHTML='<br mce_bogus="1"/>'}J.colSpan=aq.colSpan;v.appendChild(J)}else{aq.rowSpan=E.rowspan+1}u=aq}}if(v.hasChildNodes()){var X=af(W,"TR");if(X){X.parentNode.insertBefore(v,X)}else{F.appendChild(v)}}aj(0,1);break;case"mceTableDeleteRow":if(!W||!aq){return true}var ad=e(F);var o=al(ad,aq);if(ad.length==1&&F.nodeName=="TBODY"){V.dom.remove(V.dom.getParent(F,"table"));return true}var D=W.cells;var X=af(W,"TR");for(var ac=0;ac<D.length;ac++){if(D[ac].rowSpan>1){var J=D[ac].cloneNode(true);var E=j(D[ac]);J.rowSpan=E.rowspan-1;var ak=X.cells[ac];if(ak==null){X.appendChild(J)}else{X.insertBefore(J,ak)}}}var u=null;for(var ac=0;aq=d(ad,o.rowindex,ac);ac++){if(aq!=u){var E=j(aq);if(E.rowspan>1){aq.rowSpan=E.rowspan-1}else{W=aq.parentNode;if(W.parentNode){W._delete=true}}u=aq}}B(F);aj(0,-1);break;case"mceTableInsertColBefore":if(!W||!aq){return true}var ad=e(V.dom.getParent(F,"table"));var o=al(ad,aq);var u=null;for(var aa=0;aq=d(ad,aa,o.cellindex);aa++){if(aq!=u){var E=j(aq);if(E.colspan==1){var J=k.createElement(aq.nodeName);if(!tinymce.isIE){J.innerHTML='<br mce_bogus="1"/>'}J.rowSpan=aq.rowSpan;aq.parentNode.insertBefore(J,aq)}else{aq.colSpan++}u=aq}}aj();break;case"mceTableInsertColAfter":if(!W||!aq){return true}var ad=e(V.dom.getParent(F,"table"));var o=al(ad,aq);var u=null;for(var aa=0;aq=d(ad,aa,o.cellindex);aa++){if(aq!=u){var E=j(aq);if(E.colspan==1){var J=k.createElement(aq.nodeName);if(!tinymce.isIE){J.innerHTML='<br mce_bogus="1"/>'}J.rowSpan=aq.rowSpan;var ak=af(aq,"TD,TH");if(ak==null){aq.parentNode.appendChild(J)}else{ak.parentNode.insertBefore(J,ak)}}else{aq.colSpan++}u=aq}}aj(1);break;case"mceTableDeleteCol":if(!W||!aq){return true}var ad=e(F);var o=al(ad,aq);var u=null;if((ad.length>1&&ad[0].length<=1)&&F.nodeName=="TBODY"){V.dom.remove(V.dom.getParent(F,"table"));return true}for(var aa=0;aq=d(ad,aa,o.cellindex);aa++){if(aq!=u){var E=j(aq);if(E.colspan>1){aq.colSpan=E.colspan-1}else{if(aq.parentNode){aq.parentNode.removeChild(aq)}}u=aq}}aj(-1);break;case"mceTableSplitCells":if(!W||!aq){return true}var l=j(aq);var C=l.colspan;var H=l.rowspan;if(C>1||H>1){aq.colSpan=1;for(var am=1;am<C;am++){var J=k.createElement("td");if(!tinymce.isIE){J.innerHTML='<br mce_bogus="1"/>'}W.insertBefore(J,af(aq,"TD,TH"));if(H>1){p(J,W,H)}}p(aq,W,H)}F=V.dom.getParent(V.selection.getNode(),"table");break;case"mceTableMergeCells":var ao=[];var R=V.selection.getSel();var ad=e(F);if(tinymce.isIE||R.rangeCount==1){if(Z){var t=j(aq);V.windowManager.open({url:g+"/merge_cells.htm",width:240+parseInt(V.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(V.getLang("table.merge_cells_delta_height",0)),inline:1},{action:"update",numcols:t.colspan,numrows:t.rowspan,plugin_url:g});return true}else{var U=parseInt(ae.numrows);var c=parseInt(ae.numcols);var o=al(ad,aq);if((""+U)=="NaN"){U=1}if((""+c)=="NaN"){c=1}var b=F.rows;for(var aa=o.rowindex;aa<ad.length;aa++){var ag=[];for(var ac=o.cellindex;ac<ad[aa].length;ac++){var f=d(ad,aa,ac);if(f&&!ap(ao,f)&&!ap(ag,f)){var N=al(ad,f);if(N.cellindex<o.cellindex+c&&N.rowindex<o.rowindex+U){ag[ag.length]=f}}}if(ag.length>0){ao[ao.length]=ag}var f=d(ad,o.rowindex,o.cellindex);a(au.dom.select("br",f),function(y,x){if(x>0&&au.dom.getAttrib("mce_bogus")){au.dom.remove(y)}})}}}else{var D=[];var R=V.selection.getSel();var Y=null;var an=null;var z=-1,aw=-1,w,at;if(R.rangeCount<2){return true}for(var am=0;am<R.rangeCount;am++){var ai=R.getRangeAt(am);var aq=ai.startContainer.childNodes[ai.startOffset];if(!aq){break}if(aq.nodeName=="TD"||aq.nodeName=="TH"){D[D.length]=aq}}var b=F.rows;for(var aa=0;aa<b.length;aa++){var ag=[];for(var ac=0;ac<b[aa].cells.length;ac++){var f=b[aa].cells[ac];for(var am=0;am<D.length;am++){if(f==D[am]){ag[ag.length]=f}}}if(ag.length>0){ao[ao.length]=ag}}var an=[];var Y=null;for(var aa=0;aa<ad.length;aa++){for(var ac=0;ac<ad[aa].length;ac++){ad[aa][ac]._selected=false;for(var am=0;am<D.length;am++){if(ad[aa][ac]==D[am]){if(z==-1){z=ac;aw=aa}w=ac;at=aa;ad[aa][ac]._selected=true}}}}for(var aa=aw;aa<=at;aa++){for(var ac=z;ac<=w;ac++){if(!ad[aa][ac]._selected){alert("Invalid selection for merge.");return true}}}}var s=1,q=1;var T=-1;for(var aa=0;aa<ao.length;aa++){var I=0;for(var ac=0;ac<ao[aa].length;ac++){var E=j(ao[aa][ac]);I+=E.colspan;if(T!=-1&&E.rowspan!=T){alert("Invalid selection for merge.");return true}T=E.rowspan}if(I>q){q=I}T=-1}var Q=-1;for(var ac=0;ac<ao[0].length;ac++){var M=0;for(var aa=0;aa<ao.length;aa++){var E=j(ao[aa][ac]);M+=E.rowspan;if(Q!=-1&&E.colspan!=Q){alert("Invalid selection for merge.");return true}Q=E.colspan}if(M>s){s=M}Q=-1}aq=ao[0][0];aq.rowSpan=s;aq.colSpan=q;for(var aa=0;aa<ao.length;aa++){for(var ac=0;ac<ao[aa].length;ac++){var P=ao[aa][ac].innerHTML;var K=P.replace(/[ \t\r\n]/g,"");if(K!="<br/>"&&K!="<br>"&&K!='<br mce_bogus="1"/>'&&(ac+aa>0)){aq.innerHTML+=P}if(ao[aa][ac]!=aq&&!ao[aa][ac]._deleted){var o=al(ad,ao[aa][ac]);var ar=ao[aa][ac].parentNode;ar.removeChild(ao[aa][ac]);ao[aa][ac]._deleted=true;if(!ar.hasChildNodes()){ar.parentNode.removeChild(ar);var ab=null;for(var ac=0;cellElm=d(ad,o.rowindex,ac);ac++){if(cellElm!=ab&&cellElm.rowSpan>1){cellElm.rowSpan--}ab=cellElm}if(aq.rowSpan>1){aq.rowSpan--}}}}}a(au.dom.select("br",aq),function(y,x){if(x>0&&au.dom.getAttrib(y,"mce_bogus")){au.dom.remove(y)}});break}F=V.dom.getParent(V.selection.getNode(),"table");V.addVisual(F);V.nodeChanged()}return true}return false}});tinymce.PluginManager.add("table",tinymce.plugins.TablePlugin)})();
mce/table/js/table.js CHANGED
@@ -156,6 +156,10 @@ function insertTable() {
156
  if (style)
157
  style += '; ';
158
 
 
 
 
 
159
  style += 'width: ' + width;
160
  } else
161
  html += makeAttrib('width', width);
@@ -203,7 +207,30 @@ function insertTable() {
203
  html += "</table>";
204
 
205
  inst.execCommand('mceBeginUndoLevel');
206
- inst.execCommand('mceInsertContent', false, html);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  inst.addVisual();
208
  inst.execCommand('mceEndUndoLevel');
209
 
156
  if (style)
157
  style += '; ';
158
 
159
+ // Force px
160
+ if (/^[0-9\.]+$/.test(width))
161
+ width += 'px';
162
+
163
  style += 'width: ' + width;
164
  } else
165
  html += makeAttrib('width', width);
207
  html += "</table>";
208
 
209
  inst.execCommand('mceBeginUndoLevel');
210
+
211
+ // Move table
212
+ if (inst.settings.fix_table_elements) {
213
+ var bm = inst.selection.getBookmark(), patt = '';
214
+
215
+ inst.execCommand('mceInsertContent', false, '<br class="_mce_marker" />');
216
+
217
+ tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) {
218
+ if (patt)
219
+ patt += ',';
220
+
221
+ patt += n + ' ._mce_marker';
222
+ });
223
+
224
+ tinymce.each(inst.dom.select(patt), function(n) {
225
+ inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n);
226
+ });
227
+
228
+ dom.setOuterHTML(dom.select('._mce_marker')[0], html);
229
+
230
+ inst.selection.moveToBookmark(bm);
231
+ } else
232
+ inst.execCommand('mceInsertContent', false, html);
233
+
234
  inst.addVisual();
235
  inst.execCommand('mceEndUndoLevel');
236
 
mce/table/merge_cells.htm CHANGED
@@ -2,13 +2,12 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/validate.js?ver=3211"></script>
8
- <script type="text/javascript" src="js/merge_cells.js?ver=3211"></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>
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/validate.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="js/merge_cells.js?ver=3241-1141"></script>
 
9
  </head>
10
+ <body style="margin: 8px">
11
  <form onsubmit="mergeCells();return false;" action="#">
12
  <fieldset>
13
  <legend>{#table_dlg.merge_cells_title}</legend>
mce/table/row.htm CHANGED
@@ -2,16 +2,15 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
9
- <script type="text/javascript" src="js/row.js?ver=3211"></script>
10
- <link href="css/row.css?ver=3211" 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>
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="js/row.js?ver=3241-1141"></script>
10
+ <link href="css/row.css?ver=3241-1141" rel="stylesheet" type="text/css" />
 
11
  </head>
12
  <body id="tablerow" style="display: none">
13
+ <form onsubmit="updateAction();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;">{#table_dlg.general_tab}</a></span></li>
mce/table/table.htm CHANGED
@@ -2,14 +2,13 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/validate.js?ver=3211"></script>
9
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
10
- <script type="text/javascript" src="js/table.js?ver=3211"></script>
11
- <link href="css/table.css?ver=3211" 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="#">
@@ -58,7 +57,7 @@
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>
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
10
+ <script type="text/javascript" src="js/table.js?ver=3241-1141"></script>
11
+ <link href="css/table.css?ver=3241-1141" rel="stylesheet" type="text/css" />
 
12
  </head>
13
  <body id="table" style="display: none">
14
  <form onsubmit="insertTable();return false;" action="#">
57
  <td><label id="classlabel" for="class">{#class_name}</label></td>
58
  <td colspan="3">
59
  <select id="class" name="class" class="mceEditableSelect">
60
+ <option value="" selected="selected">{#not_set}</option>
61
  </select></td>
62
  </tr>
63
  <tr>
mce/visualchars/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state){c.state=true;c._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 m=this,g=m.editor,a,e,f,k=g.getDoc(),l=g.getBody(),j,n=g.selection,c;m.state=!m.state;g.controlManager.setActive("visualchars",m.state);if(m.state){a=[];tinymce.walk(l,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(e=0;e<a.length;e++){j=a[e].nodeValue;j=j.replace(/(\u00a0+)/g,'<span class="mceItemHidden mceVisualNbsp">$1</span>');j=j.replace(/\u00a0/g,"\u00b7");g.dom.setOuterHTML(a[e],j,k)}}else{a=tinymce.grep(g.dom.select("span",l),function(b){return g.dom.hasClass(b,"mceVisualNbsp")});for(e=0;e<a.length;e++){g.dom.setOuterHTML(a[e],a[e].innerHTML.replace(/(&middot;|\u00b7)/g,"&nbsp;"),k)}}}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})();
mce/xhtmlxtras/abbr.htm CHANGED
@@ -2,14 +2,13 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
9
- <script type="text/javascript" src="js/element_common.js?ver=3211"></script>
10
- <script type="text/javascript" src="js/abbr.js?ver=3211"></script>
11
- <link rel="stylesheet" type="text/css" href="css/popup.css?ver=3211" />
12
- <base target="_self" />
13
  </head>
14
  <body style="display: none">
15
  <form onsubmit="insertAbbr();return false;" action="#">
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="js/element_common.js?ver=3241-1141"></script>
10
+ <script type="text/javascript" src="js/abbr.js?ver=3241-1141"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?ver=3241-1141" />
 
12
  </head>
13
  <body style="display: none">
14
  <form onsubmit="insertAbbr();return false;" action="#">
mce/xhtmlxtras/acronym.htm CHANGED
@@ -2,14 +2,13 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
9
- <script type="text/javascript" src="js/element_common.js?ver=3211"></script>
10
- <script type="text/javascript" src="js/acronym.js?ver=3211"></script>
11
- <link rel="stylesheet" type="text/css" href="css/popup.css?ver=3211" />
12
- <base target="_self" />
13
  </head>
14
  <body style="display: none">
15
  <form onsubmit="insertAcronym();return false;" action="#">
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="js/element_common.js?ver=3241-1141"></script>
10
+ <script type="text/javascript" src="js/acronym.js?ver=3241-1141"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?ver=3241-1141" />
 
12
  </head>
13
  <body style="display: none">
14
  <form onsubmit="insertAcronym();return false;" action="#">
mce/xhtmlxtras/attributes.htm CHANGED
@@ -2,13 +2,12 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
9
- <script type="text/javascript" src="js/attributes.js?ver=3211"></script>
10
- <link rel="stylesheet" type="text/css" href="css/attributes.css?ver=3211" />
11
- <base target="_self" />
12
  </head>
13
  <body style="display: none">
14
  <form onsubmit="insertAction();return false;" action="#">
@@ -36,12 +35,12 @@
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>
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="js/attributes.js?ver=3241-1141"></script>
10
+ <link rel="stylesheet" type="text/css" href="css/attributes.css?ver=3241-1141" />
 
11
  </head>
12
  <body style="display: none">
13
  <form onsubmit="insertAction();return false;" action="#">
35
  <td><label id="classlabel" for="classlist">{#class_name}</label></td>
36
  <td>
37
  <select id="classlist" name="classlist" class="mceEditableSelect">
38
+ <option value="" selected="selected">{#not_set}</option>
39
  </select>
40
  </td>
41
  </tr>
42
  <tr>
43
+ <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
44
  <td><input id="style" name="style" type="text" value="" /></td>
45
  </tr>
46
  <tr>
mce/xhtmlxtras/cite.htm CHANGED
@@ -2,14 +2,13 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
9
- <script type="text/javascript" src="js/element_common.js?ver=3211"></script>
10
- <script type="text/javascript" src="js/cite.js?ver=3211"></script>
11
- <link rel="stylesheet" type="text/css" href="css/popup.css?ver=3211" />
12
- <base target="_self" />
13
  </head>
14
  <body style="display: none">
15
  <form onsubmit="insertCite();return false;" action="#">
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="js/element_common.js?ver=3241-1141"></script>
10
+ <script type="text/javascript" src="js/cite.js?ver=3241-1141"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?ver=3241-1141" />
 
12
  </head>
13
  <body style="display: none">
14
  <form onsubmit="insertCite();return false;" action="#">
mce/xhtmlxtras/del.htm CHANGED
@@ -2,14 +2,13 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
9
- <script type="text/javascript" src="js/element_common.js?ver=3211"></script>
10
- <script type="text/javascript" src="js/del.js?ver=3211"></script>
11
- <link rel="stylesheet" type="text/css" href="css/popup.css?ver=3211" />
12
- <base target="_self" />
13
  </head>
14
  <body id="xhtmlxtrasins" style="display: none">
15
  <form onsubmit="insertDel();return false;" action="#">
@@ -31,7 +30,7 @@
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>
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="js/element_common.js?ver=3241-1141"></script>
10
+ <script type="text/javascript" src="js/del.js?ver=3241-1141"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?ver=3241-1141" />
 
12
  </head>
13
  <body id="xhtmlxtrasins" style="display: none">
14
  <form onsubmit="insertDel();return false;" action="#">
30
  <table border="0" cellspacing="0" cellpadding="0">
31
  <tr>
32
  <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
33
+ <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
34
  </tr>
35
  </table>
36
  </td>
mce/xhtmlxtras/editor_plugin.js CHANGED
@@ -1 +1 @@
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);})();
1
+ (function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(b,c){b.addCommand("mceCite",function(){b.windowManager.open({file:c+"/cite.htm",width:350+parseInt(b.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:c})});b.addCommand("mceAcronym",function(){b.windowManager.open({file:c+"/acronym.htm",width:350+parseInt(b.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.acronym_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceAbbr",function(){b.windowManager.open({file:c+"/abbr.htm",width:350+parseInt(b.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.abbr_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceDel",function(){b.windowManager.open({file:c+"/del.htm",width:340+parseInt(b.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(b.getLang("xhtmlxtras.del_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceIns",function(){b.windowManager.open({file:c+"/ins.htm",width:340+parseInt(b.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(b.getLang("xhtmlxtras.ins_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceAttributes",function(){b.windowManager.open({file:c+"/attributes.htm",width:380,height:370,inline:1},{plugin_url:c})});b.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});b.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});b.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});b.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});b.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});b.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});if(tinymce.isIE){function a(d,e){if(e.set){e.content=e.content.replace(/<abbr([^>]+)>/gi,"<html:abbr $1>");e.content=e.content.replace(/<\/abbr>/gi,"</html:abbr>")}}b.onBeforeSetContent.add(a);b.onPostProcess.add(a)}b.onNodeChange.add(function(e,d,g,f){g=e.dom.getParent(g,"CITE,ACRONYM,ABBR,DEL,INS");d.setDisabled("cite",f);d.setDisabled("acronym",f);d.setDisabled("abbr",f);d.setDisabled("del",f);d.setDisabled("ins",f);d.setDisabled("attribs",g&&g.nodeName=="BODY");d.setActive("cite",0);d.setActive("acronym",0);d.setActive("abbr",0);d.setActive("del",0);d.setActive("ins",0);if(g){do{d.setDisabled(g.nodeName.toLowerCase(),0);d.setActive(g.nodeName.toLowerCase(),1)}while(g=g.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)})();
mce/xhtmlxtras/ins.htm CHANGED
@@ -2,14 +2,13 @@
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?ver=3211"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3211"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3211"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3211"></script>
9
- <script type="text/javascript" src="js/element_common.js?ver=3211"></script>
10
- <script type="text/javascript" src="js/ins.js?ver=3211"></script>
11
- <link rel="stylesheet" type="text/css" href="css/popup.css?ver=3211" />
12
- <base target="_self" />
13
  </head>
14
  <body id="xhtmlxtrasins" style="display: none">
15
  <form onsubmit="insertIns();return false;" action="#">
@@ -31,7 +30,7 @@
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>
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?ver=3241-1141"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
9
+ <script type="text/javascript" src="js/element_common.js?ver=3241-1141"></script>
10
+ <script type="text/javascript" src="js/ins.js?ver=3241-1141"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?ver=3241-1141" />
 
12
  </head>
13
  <body id="xhtmlxtrasins" style="display: none">
14
  <form onsubmit="insertIns();return false;" action="#">
30
  <table border="0" cellspacing="0" cellpadding="0">
31
  <tr>
32
  <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
33
+ <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
34
  </tr>
35
  </table>
36
  </td>
mce/xhtmlxtras/js/element_common.js CHANGED
@@ -224,7 +224,7 @@ function 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
  });
224
  var ed = tinyMCEPopup.editor, dom = ed.dom;
225
 
226
  ed.getDoc().execCommand('FontName', false, 'mceinline');
227
+ tinymce.each(dom.select('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
  });
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: Andrew Ozz
3
  Donate link:
4
  Tags: wysiwyg, formatting, tinymce, write, edit, post
5
- Requires at least: 2.7
6
- Tested up to: 2.7
7
- Stable tag: 3.2
8
 
9
  Enables most of the advanced features of TinyMCE, the WordPress WYSIWYG editor.
10
 
@@ -12,7 +12,7 @@ Enables most of the advanced features of TinyMCE, the WordPress WYSIWYG editor.
12
 
13
  This plugin adds 15 plugins to [TinyMCE](http://tinymce.moxiecode.com/): Advanced hr, Advanced Image, Advanced Link, Context Menu, Emotions (Smilies), Date and Time, IESpell, Layer, Nonbreaking, Print, Search and Replace, Style, Table, Visual Characters and XHTML Extras.
14
 
15
- Version 2.0 includes an admin page for arranging the TinyMCE toolbar buttons, easy installation, a lot of bugfixes, customized "Smilies" plugin that uses the built-in WordPress smilies, etc. The admin page uses Scriptaculous and Prototype.js (similar to the "Widgets" admin page) that lets you "drag and drop" the TinyMCE buttons to arrange your own toolbars and enables/disables the corresponding plugins depending on the used buttons.
16
 
17
  Version 2.1: Improved language selection, improved compatibility with WordPress 2.3 and TinyMCE 2.1.1.1, option to override some of the imported css classes and other small improvements and bugfixes.
18
 
@@ -26,6 +26,8 @@ Version 3.1: Compatibility with WordPress 2.6 and TinyMCE 3.1, keeps empty parag
26
 
27
  Version 3.2: Compatibility with WordPress 2.7 and TinyMCE 3.2, minor bug fixes.
28
 
 
 
29
  **Language Support:** The plugin interface in only in English, but the TinyMCE plugins include several translations: German, French, Italian, Spanish, Portuguese, Russian, Chinese and Japanese. More translations are available at the [TinyMCE web site](http://tinymce.moxiecode.com/download_i18n.php).
30
 
31
 
2
  Contributors: Andrew Ozz
3
  Donate link:
4
  Tags: wysiwyg, formatting, tinymce, write, edit, post
5
+ Requires at least: 2.8
6
+ Tested up to: 2.8
7
+ Stable tag: 3.2.4
8
 
9
  Enables most of the advanced features of TinyMCE, the WordPress WYSIWYG editor.
10
 
12
 
13
  This plugin adds 15 plugins to [TinyMCE](http://tinymce.moxiecode.com/): Advanced hr, Advanced Image, Advanced Link, Context Menu, Emotions (Smilies), Date and Time, IESpell, Layer, Nonbreaking, Print, Search and Replace, Style, Table, Visual Characters and XHTML Extras.
14
 
15
+ Version 2.0 includes an admin page for arranging the TinyMCE toolbar buttons, easy installation, a lot of bugfixes, customized "Smilies" plugin that uses the built-in WordPress smilies, etc. The admin page uses jQuery and jQuery UI that lets you "drag and drop" the TinyMCE buttons to arrange your own toolbars and enables/disables the corresponding plugins depending on the used buttons.
16
 
17
  Version 2.1: Improved language selection, improved compatibility with WordPress 2.3 and TinyMCE 2.1.1.1, option to override some of the imported css classes and other small improvements and bugfixes.
18
 
26
 
27
  Version 3.2: Compatibility with WordPress 2.7 and TinyMCE 3.2, minor bug fixes.
28
 
29
+ Version 3.2.4: Compatibility with WordPress 2.8 and TinyMCE 3.2.4, minor bug fixes.
30
+
31
  **Language Support:** The plugin interface in only in English, but the TinyMCE plugins include several translations: German, French, Italian, Spanish, Portuguese, Russian, Chinese and Japanese. More translations are available at the [TinyMCE web site](http://tinymce.moxiecode.com/download_i18n.php).
32
 
33
 
screenshot-1.png CHANGED
Binary file
tadv_admin.php CHANGED
@@ -1,356 +1,357 @@
1
- <?php
2
-
3
- if ( ! current_user_can('edit_themes') )
4
- wp_die('Cheatin&#8217; uh?');
5
-
6
- if ( isset( $_POST['tadv_uninstall'] ) ) {
7
- check_admin_referer( 'tadv-uninstall' );
8
-
9
- delete_option('tadv_options');
10
- delete_option('tadv_toolbars');
11
- delete_option('tadv_plugins');
12
- delete_option('tadv_btns1');
13
- delete_option('tadv_btns2');
14
- delete_option('tadv_btns3');
15
- delete_option('tadv_btns4');
16
- delete_option('tadv_allbtns');
17
- ?>
18
- <div class="updated" style="margin-top:30px;">
19
- <p><?php _e('All options have been removed from the database. Please', 'tadv'); ?> <a href="plugins.php"><?php _e('disable TinyMCE Advanced.', 'tadv'); ?></a></p>
20
- </div>
21
- <?php
22
- return;
23
- }
24
-
25
- if ( ! isset($GLOBALS['wp_version']) || version_compare($GLOBALS['wp_version'], '2.7', '<') ) { // if less than 2.7 ?>
26
- <div class="error" style="margin-top:30px;">
27
- <p><?php _e('This plugin requires WordPress version 2.7 or newer. Please upgrade your WordPress installation or download an', 'tadv'); ?> <a href="http://wordpress.org/extend/plugins/tinymce-advanced/download/"><?php _e('older version of the plugin.', 'tadv'); ?></a></p>
28
- </div>
29
- <?php
30
- return;
31
- }
32
-
33
- $update_tadv_options = false;
34
- $imgpath = WP_PLUGIN_URL . '/tinymce-advanced/images/';
35
-
36
- $tadv_toolbars = get_option('tadv_toolbars');
37
- if ( ! is_array($tadv_toolbars) ) {
38
- @include_once( WP_PLUGIN_DIR . '/tinymce-advanced/tadv_defaults.php');
39
- $tadv_options = array( 'advlink' => 1, 'advimage' => 1, 'importcss' => 0, 'contextmenu' => 0, 'tadvreplace' => 0 );
40
- } else {
41
- $tadv_options = get_option('tadv_options');
42
- $tadv_toolbars['toolbar_1'] = isset($tadv_toolbars['toolbar_1']) ? (array) $tadv_toolbars['toolbar_1'] : array();
43
- $tadv_toolbars['toolbar_2'] = isset($tadv_toolbars['toolbar_2']) ? (array) $tadv_toolbars['toolbar_2'] : array();
44
- $tadv_toolbars['toolbar_3'] = isset($tadv_toolbars['toolbar_3']) ? (array) $tadv_toolbars['toolbar_3'] : array();
45
- $tadv_toolbars['toolbar_4'] = isset($tadv_toolbars['toolbar_4']) ? (array) $tadv_toolbars['toolbar_4'] : array();
46
- }
47
-
48
- if ( isset( $_POST['tadv-save'] ) ) {
49
- check_admin_referer( 'tadv-save-buttons-order' );
50
-
51
- $tb1 = $tb2 = $tb3 = $tb4 = $btns = array();
52
- parse_str( $_POST['toolbar_1order'], $tb1 );
53
- parse_str( $_POST['toolbar_2order'], $tb2 );
54
- parse_str( $_POST['toolbar_3order'], $tb3 );
55
- parse_str( $_POST['toolbar_4order'], $tb4 );
56
-
57
- $tadv_toolbars['toolbar_1'] = (array) $tb1['pre'];
58
- $tadv_toolbars['toolbar_2'] = (array) $tb2['pre'];
59
- $tadv_toolbars['toolbar_3'] = (array) $tb3['pre'];
60
- $tadv_toolbars['toolbar_4'] = (array) $tb4['pre'];
61
-
62
- update_option( 'tadv_toolbars', $tadv_toolbars );
63
-
64
- $tadv_options['advlink'] = $_POST['advlink'] ? 1 : 0;
65
- $tadv_options['advimage'] = $_POST['advimage'] ? 1 : 0;
66
- $tadv_options['contextmenu'] = $_POST['contextmenu'] ? 1 : 0;
67
- $tadv_options['importcss'] = $_POST['importcss'] ? 1 : 0;
68
- $tadv_options['fix_autop'] = $_POST['fix_autop'] ? 1 : 0;
69
- $update_tadv_options = true;
70
- }
71
-
72
- $hidden_row = 0;
73
- $i = 0;
74
- foreach ( $tadv_toolbars as $toolbar ) {
75
- $l = false;
76
- $i++;
77
-
78
- if ( empty($toolbar) ) {
79
- $btns["toolbar_$i"] = array();
80
- continue;
81
- }
82
-
83
- foreach( $toolbar as $k => $v ) {
84
- if ( strpos($v, 'separator') !== false ) $toolbar[$k] = 'separator';
85
- if ( 'layer' == $v ) $l = $k;
86
- if ( empty($v) ) unset($toolbar[$k]);
87
- }
88
- if ( $l ) array_splice( $toolbar, $l, 1, array('insertlayer', 'moveforward', 'movebackward', 'absolute') );
89
-
90
- $btns["toolbar_$i"] = $toolbar;
91
- }
92
- extract($btns);
93
-
94
- if ( empty($toolbar_1) && empty($toolbar_2) && empty($toolbar_3) && empty($toolbar_4) ) {
95
- ?><div class="error" id="message"><p><?php _e('All toolbars are empty! Default buttons loaded.', 'tadv'); ?></p></div><?php
96
-
97
- @include_once( WP_PLUGIN_DIR . '/tinymce-advanced/tadv_defaults.php');
98
- $allbtns = array_merge( $tadv_btns1, $tadv_btns2, $tadv_btns3, $tadv_btns4 );
99
- } else {
100
- $allbtns = array_merge( $toolbar_1, $toolbar_2, $toolbar_3, $toolbar_4 );
101
- }
102
- if ( in_array('advhr', $allbtns) ) $plugins[] = 'advhr';
103
- if ( in_array('insertlayer', $allbtns) ) $plugins[] = 'layer';
104
- if ( in_array('visualchars', $allbtns) ) $plugins[] = 'visualchars';
105
-
106
- if ( in_array('nonbreaking', $allbtns) ) $plugins[] = 'nonbreaking';
107
- if ( in_array('styleprops', $allbtns) ) $plugins[] = 'style';
108
- if ( in_array('emotions', $allbtns) ) $plugins[] = 'emotions';
109
- if ( in_array('insertdate', $allbtns) ||
110
- in_array('inserttime', $allbtns) ) $plugins[] = 'insertdatetime';
111
-
112
- if ( in_array('tablecontrols', $allbtns) ) $plugins[] = 'table';
113
- if ( in_array('print', $allbtns) ) $plugins[] = 'print';
114
- if ( in_array('search', $allbtns) ||
115
- in_array('replace', $allbtns) ) $plugins[] = 'searchreplace';
116
-
117
- if ( in_array('cite', $allbtns) ||
118
- in_array('ins', $allbtns) ||
119
- in_array('del', $allbtns) ||
120
- in_array('abbr', $allbtns) ||
121
- in_array('acronym', $allbtns) ||
122
- in_array('attribs', $allbtns) ) $plugins[] = 'xhtmlxtras';
123
-
124
- if ( $tadv_options['advlink'] == '1' ) $plugins[] = 'advlink';
125
- if ( $tadv_options['advimage'] == '1' ) $plugins[] = 'advimage';
126
- if ( $tadv_options['contextmenu'] == '1' ) $plugins[] = 'contextmenu';
127
-
128
- $buttons = array( 'Kitchen Sink' => 'wp_adv', 'Quote' => 'blockquote', 'Bold' => 'bold', 'Italic' => 'italic', 'Strikethrough' => 'strikethrough', 'Underline' => 'underline', 'Bullet List' => 'bullist', 'Numbered List' => 'numlist', 'Outdent' => 'outdent', 'Indent' => 'indent', 'Allign Left' => 'justifyleft', 'Center' => 'justifycenter', 'Alligh Right' => 'justifyright', 'Justify' => 'justifyfull', 'Cut' => 'cut', 'Copy' => 'copy', 'Paste' => 'paste', 'Link' => 'link', 'Remove Link' => 'unlink', 'Insert Image' => 'image', 'More Tag' => 'wp_more', 'Split Page' => 'wp_page', 'Search' => 'search', 'Replace' => 'replace', '<!--fontselect-->' => 'fontselect', '<!--fontsizeselect-->' => 'fontsizeselect', 'Help' => 'wp_help', 'Full Screen' => 'fullscreen', '<!--styleselect-->' => 'styleselect', '<!--formatselect-->' => 'formatselect', 'Text Color' => 'forecolor', 'Paste as Text' => 'pastetext', 'Paste from Word' => 'pasteword', 'Remove Format' => 'removeformat', 'Clean Code' => 'cleanup', 'Check Spelling' => 'spellchecker', 'Character Map' => 'charmap', 'Print' => 'print', 'Undo' => 'undo', 'Redo' => 'redo', 'Table' => 'tablecontrols', 'Citation' => 'cite', 'Inserted Text' => 'ins', 'Deleted Text' => 'del', 'Abbreviation' => 'abbr', 'Acronym' => 'acronym', 'XHTML Attribs' => 'attribs', 'Layer' => 'layer', 'Advanced HR' => 'advhr', 'View HTML' => 'code', 'Hidden Chars' => 'visualchars', 'NB Space' => 'nonbreaking', 'Sub' => 'sub', 'Sup' => 'sup', 'Visual Aids' => 'visualaid', 'Insert Date' => 'insertdate', 'Insert Time' => 'inserttime', 'Anchor' => 'anchor', 'Style' => 'styleprops', 'Smilies' => 'emotions', 'Insert Movie' => 'media', 'IE Spell' => 'iespell' );
129
-
130
- if ( function_exists('moxiecode_plugins_url') ) {
131
- if ( moxiecode_plugins_url('imagemanager') ) $buttons['MCFileManager'] = 'insertimage';
132
- if ( moxiecode_plugins_url('filemanager') ) $buttons['MCImageManager'] = 'insertfile';
133
- }
134
-
135
- $tadv_allbtns = array_values($buttons);
136
- $tadv_allbtns[] = 'separator';
137
- $tadv_allbtns[] = '|';
138
-
139
- if ( get_option('tadv_plugins') != $plugins ) update_option( 'tadv_plugins', $plugins );
140
- if ( get_option('tadv_btns1') != $toolbar_1 ) update_option( 'tadv_btns1', $toolbar_1 );
141
- if ( get_option('tadv_btns2') != $toolbar_2 ) update_option( 'tadv_btns2', $toolbar_2 );
142
- if ( get_option('tadv_btns3') != $toolbar_3 ) update_option( 'tadv_btns3', $toolbar_3 );
143
- if ( get_option('tadv_btns4') != $toolbar_4 ) update_option( 'tadv_btns4', $toolbar_4 );
144
- if ( get_option('tadv_allbtns') != $tadv_allbtns ) update_option( 'tadv_allbtns', $tadv_allbtns );
145
-
146
- for ( $i = 1; $i < 21; $i++ )
147
- $buttons["s$i"] = "separator$i";
148
-
149
- if ( isset($_POST['tadv-save']) ) { ?>
150
- <div class="updated" id="message"><p><?php _e('Options saved', 'tadv'); ?></p></div>
151
- <?php } ?>
152
-
153
- <div class="wrap" id="contain">
154
-
155
- <h2><?php _e('TinyMCE Buttons Arrangement', 'tadv'); ?></h2>
156
-
157
- <form id="tadvadmin" method="post" action="" onsubmit="">
158
- <p><?php _e('Drag and drop buttons onto the toolbars below.', 'tadv'); ?></p>
159
-
160
- <div id="tadvzones">
161
- <input id="toolbar_1order" name="toolbar_1order" value="" type="hidden" />
162
- <input id="toolbar_2order" name="toolbar_2order" value="" type="hidden" />
163
- <input id="toolbar_3order" name="toolbar_3order" value="" type="hidden" />
164
- <input id="toolbar_4order" name="toolbar_4order" value="" type="hidden" />
165
- <input name="tadv-save" value="1" type="hidden" />
166
-
167
- <div class="tadvdropzone">
168
- <ul style="position: relative;" id="toolbar_1" class="container">
169
- <?php
170
- if ( is_array($tadv_toolbars['toolbar_1']) ) {
171
- $tb1 = array();
172
- foreach( $tadv_toolbars['toolbar_1'] as $k ) {
173
- $t = array_intersect( $buttons, (array) $k );
174
- $tb1 += $t;
175
- }
176
-
177
- foreach( $tb1 as $name => $btn ) {
178
- if ( strpos( $btn, 'separator' ) !== false ) { ?>
179
-
180
- <li class="separator" id="pre_<?php echo $btn; ?>">
181
- <div class="tadvitem"> </div></li>
182
- <?php } else { ?>
183
-
184
- <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
185
- <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
186
- <span class="descr"> <?php echo $name; ?></span></div></li>
187
- <?php }
188
- }
189
- $buttons = array_diff( $buttons, $tb1 );
190
- } ?>
191
- </ul></div>
192
- <br class="clear" />
193
-
194
- <div class="tadvdropzone">
195
- <ul style="position: relative;" id="toolbar_2" class="container">
196
- <?php
197
- if ( is_array($tadv_toolbars['toolbar_2']) ) {
198
- $tb2 = array();
199
- foreach( $tadv_toolbars['toolbar_2'] as $k ) {
200
- $t = array_intersect( $buttons, (array) $k );
201
- $tb2 = $tb2 + $t;
202
- }
203
- foreach( $tb2 as $name => $btn ) {
204
- if ( strpos( $btn, 'separator' ) !== false ) { ?>
205
-
206
- <li class="separator" id="pre_<?php echo $btn; ?>">
207
- <div class="tadvitem"> </div></li>
208
- <?php } else { ?>
209
-
210
- <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
211
- <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
212
- <span class="descr"> <?php echo $name; ?></span></div></li>
213
- <?php }
214
- }
215
- $buttons = array_diff( $buttons, $tb2 );
216
- } ?>
217
- </ul></div>
218
- <br class="clear" />
219
-
220
- <div class="tadvdropzone">
221
- <ul style="position: relative;" id="toolbar_3" class="container">
222
- <?php
223
- if ( is_array($tadv_toolbars['toolbar_3']) ) {
224
- $tb3 = array();
225
- foreach( $tadv_toolbars['toolbar_3'] as $k ) {
226
- $t = array_intersect( $buttons, (array) $k );
227
- $tb3 += $t;
228
- }
229
- foreach( $tb3 as $name => $btn ) {
230
- if ( strpos( $btn, 'separator' ) !== false ) { ?>
231
-
232
- <li class="separator" id="pre_<?php echo $btn; ?>">
233
- <div class="tadvitem"> </div></li>
234
- <?php } else { ?>
235
-
236
- <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
237
- <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
238
- <span class="descr"> <?php echo $name; ?></span></div></li>
239
- <?php }
240
- }
241
- $buttons = array_diff( $buttons, $tb3 );
242
- } ?>
243
- </ul></div>
244
- <br class="clear" />
245
-
246
- <div class="tadvdropzone">
247
- <ul style="position: relative;" id="toolbar_4" class="container">
248
- <?php
249
- if ( is_array($tadv_toolbars['toolbar_4']) ) {
250
- $tb4 = array();
251
- foreach( $tadv_toolbars['toolbar_4'] as $k ) {
252
- $t = array_intersect( $buttons, (array) $k );
253
- $tb4 += $t;
254
- }
255
- foreach( $tb4 as $name => $btn ) {
256
- if ( strpos( $btn, 'separator' ) !== false ) { ?>
257
-
258
- <li class="separator" id="pre_<?php echo $btn; ?>">
259
- <div class="tadvitem"> </div></li>
260
- <?php } else { ?>
261
-
262
- <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
263
- <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
264
- <span class="descr"> <?php echo $name; ?></span></div></li>
265
- <?php }
266
- }
267
- $buttons = array_diff( $buttons, $tb4 );
268
- } ?>
269
- </ul></div>
270
- <br class="clear" />
271
- </div>
272
-
273
- <div id="tadvWarnmsg">&nbsp;
274
- <span id="too_long" style="display:none;"><?php _e('Adding too many buttons will make the toolbar too long and will not display correctly in TinyMCE!', 'tadv'); ?></span>
275
- </div>
276
-
277
- <div id="tadvpalettediv">
278
- <ul style="position: relative;" id="tadvpalette">
279
- <?php
280
- if ( is_array($buttons) ) {
281
- foreach( $buttons as $name => $btn ) {
282
- if ( strpos( $btn, 'separator' ) !== false ) { ?>
283
-
284
- <li class="separator" id="pre_<?php echo $btn; ?>">
285
- <div class="tadvitem"> </div></li>
286
- <?php } else { ?>
287
-
288
- <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
289
- <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
290
- <span class="descr"> <?php echo $name; ?></span></div></li>
291
- <?php }
292
- }
293
- } ?>
294
- </ul>
295
- </div>
296
-
297
- <table class="clear" style="margin:10px 0"><tr><td style="padding:2px 12px 8px;">
298
- Also enable:
299
- <label for="advlink" class="tadv-box"><?php _e('Advanced Link', 'tadv'); ?> &nbsp;
300
- <input type="checkbox" class="tadv-chk" name="advlink" id="advlink" <?php if ( $tadv_options['advlink'] == '1' ) echo ' checked="checked"'; ?> /></label> &bull;
301
-
302
- <label for="advimage" class="tadv-box"><?php _e('Advanced Image', 'tadv'); ?> &nbsp;
303
- <input type="checkbox" class="tadv-chk" name="advimage" id="advimage" <?php if ( $tadv_options['advimage'] == '1' ) echo ' checked="checked"'; ?> /></label> &bull;
304
- <label for="contextmenu" class="tadv-box"><?php _e('Context Menu', 'tadv'); ?> &nbsp;
305
-
306
- <input type="checkbox" class="tadv-chk" name="contextmenu" id="contextmenu" <?php if ( $tadv_options['contextmenu'] == '1' ) echo ' checked="checked"'; ?> /></label>
307
- <?php _e('(to show the context menu in Firefox and use the spellchecker, hold down the Ctrl key).', 'tadv'); ?>
308
- </td></tr>
309
-
310
- <tr><td style="border:1px solid #CD0000;padding:2px 12px 8px;">
311
- <p style="font-weight:bold;color:#CD0000;"><?php _e('Advanced', 'tadv'); ?></p>
312
-
313
- <p><label for="importcss" class="tadv-box"><?php _e('Import the current theme CSS classes', 'tadv'); ?> &nbsp;
314
- <input type="checkbox" class="tadv-chk" name="importcss" id="importcss" <?php if ( $tadv_options['importcss'] == '1' ) echo ' checked="checked"'; ?> /></label></p>
315
- <p style="font-size:11px;"><?php _e('Custom CSS styles can be added in /wp-content/plugins/tinymce-advanced/css/tadv-mce.css. They will be imported and used in TinyMCE. The file has to be downloaded with FTP, edited and uploaded, overwriting the original. Only CSS classes can be added, also <strong>div.my-class</strong> would not work, but <strong>.my-class</strong> will.', 'tadv'); ?></p>
316
- <p><label for="fix_autop" class="tadv-box"><?php _e('Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them in the HTML editor', 'tadv'); ?> &nbsp;
317
- <input type="checkbox" class="tadv-chk" name="fix_autop" id="fix_autop" <?php if ( $tadv_options['fix_autop'] == '1' ) echo ' checked="checked"'; ?> /></label></p>
318
- <p style="font-size:11px;"><?php _e('This will make it possible to use more advanced HTML without the back-end filtering affecting it much. It also preserves empty new lines in the editor by padding them with &lt;br /&gt; tags.', 'tadv'); ?></p>
319
- </td></tr>
320
- <?php
321
- $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
322
- if ( $mce_locale != 'en' ) {
323
- if ( ! @file_exists(WP_PLUGIN_DIR . '/tinymce-advanced/mce/advlink/langs/' . $mce_locale . '_dlg.js') ) { ?>
324
- <tr><td style="padding:2px 12px 8px;">
325
- <p style="font-weight:bold;"><?php _e('Language Settings', 'tadv'); ?></p>
326
- <p><?php _e('Your WordPress language is set to', 'tadv'); ?> <strong><?php echo get_locale(); ?></strong>. <?php _e('However there is no matching language installed for TinyMCE plugins. This plugin includes several translations: German, French, Italian, Spanish, Portuguese, Russian, Japanese and Chinese. More translations are available at the', 'tadv'); ?> <a href="http://services.moxiecode.com/i18n/"><?php _e('TinyMCE web site.', 'tadv'); ?></a></p>
327
- </td></tr>
328
- <?php }
329
- } // end mce_locale
330
- ?>
331
- </table>
332
-
333
- <p class="submit">
334
- <?php wp_nonce_field( 'tadv-save-buttons-order' ); ?>
335
- <input type="button" value="<?php _e('Save Changes', 'tadv'); ?>" onclick="tadvSortable.serialize();" />
336
- <input type="button" class="tadv_btn" value="<?php _e('Uninstall', 'tadv'); ?>" onclick="document.getElementById('tadv_uninst_div').style.display = 'block';" />
337
- </p>
338
- </form>
339
-
340
- <div id="tadvWarnmsg2">&nbsp;
341
- <span id="sink_err" style="display:none;"><?php _e('The Kitchen Sink button shows/hides the next toolbar row. It will not work at the current place.', 'tadv'); ?></span>
342
- </div>
343
-
344
- <div id="tadv_uninst_div" style="">
345
- <form method="post" action="">
346
- <?php wp_nonce_field('tadv-uninstall'); ?>
347
- <div><?php _e('Uninstalling will remove all saved settings from the database.', 'tadv'); ?>
348
- <input class="button tadv_btn" type="button" name="cancel" value="<?php _e('Cancel', 'tadv'); ?>" onclick="document.getElementById('tadv_uninst_div').style.display = 'none';" style="margin-left:20px" />
349
- <input class="button tadv_btn" type="submit" name="tadv_uninstall" value="<?php _e('Continue', 'tadv'); ?>" /></div>
350
- </form>
351
- </div>
352
- </div>
353
-
354
- <?php
355
- if ( $update_tadv_options )
356
- update_option( 'tadv_options', $tadv_options );
 
1
+ <?php
2
+
3
+ if ( !defined('ABSPATH') || !current_user_can('manage_options') )
4
+ wp_die('Cheatin&#8217; uh?');
5
+
6
+ if ( isset( $_POST['tadv_uninstall'] ) ) {
7
+ check_admin_referer( 'tadv-uninstall' );
8
+
9
+ delete_option('tadv_options');
10
+ delete_option('tadv_toolbars');
11
+ delete_option('tadv_plugins');
12
+ delete_option('tadv_btns1');
13
+ delete_option('tadv_btns2');
14
+ delete_option('tadv_btns3');
15
+ delete_option('tadv_btns4');
16
+ delete_option('tadv_allbtns');
17
+ ?>
18
+ <div class="updated" style="margin-top:30px;">
19
+ <p><?php _e('All options have been removed from the database. You can', 'tadv'); ?> <a href="plugins.php"><?php _e('deactivate TinyMCE Advanced', 'tadv'); ?></a> <?php _e('or', 'tadv'); ?> <a href=""> <?php _e('reload this page', 'tadv'); ?></a> <?php _e('to reset them to the default values.', 'tadv'); ?></p>
20
+ </div>
21
+ <?php
22
+ return;
23
+ }
24
+
25
+ if ( ! isset($GLOBALS['wp_version']) || version_compare($GLOBALS['wp_version'], '2.8', '<') ) { // if less than 2.8 ?>
26
+ <div class="error" style="margin-top:30px;">
27
+ <p><?php _e('This plugin requires WordPress version 2.8 or newer. Please upgrade your WordPress installation or download an', 'tadv'); ?> <a href="http://wordpress.org/extend/plugins/tinymce-advanced/download/"><?php _e('older version of the plugin.', 'tadv'); ?></a></p>
28
+ </div>
29
+ <?php
30
+ return;
31
+ }
32
+
33
+ $update_tadv_options = false;
34
+ $imgpath = WP_PLUGIN_URL . '/tinymce-advanced/images/';
35
+
36
+ $tadv_toolbars = get_option('tadv_toolbars');
37
+ if ( ! is_array($tadv_toolbars) ) {
38
+ @include_once( WP_PLUGIN_DIR . '/tinymce-advanced/tadv_defaults.php');
39
+ $tadv_options = array( 'advlink' => 1, 'advimage' => 1, 'importcss' => 0, 'contextmenu' => 0, 'tadvreplace' => 0 );
40
+ } else {
41
+ $tadv_options = get_option('tadv_options');
42
+ $tadv_toolbars['toolbar_1'] = isset($tadv_toolbars['toolbar_1']) ? (array) $tadv_toolbars['toolbar_1'] : array();
43
+ $tadv_toolbars['toolbar_2'] = isset($tadv_toolbars['toolbar_2']) ? (array) $tadv_toolbars['toolbar_2'] : array();
44
+ $tadv_toolbars['toolbar_3'] = isset($tadv_toolbars['toolbar_3']) ? (array) $tadv_toolbars['toolbar_3'] : array();
45
+ $tadv_toolbars['toolbar_4'] = isset($tadv_toolbars['toolbar_4']) ? (array) $tadv_toolbars['toolbar_4'] : array();
46
+ }
47
+
48
+ if ( isset( $_POST['tadv-save'] ) ) {
49
+ check_admin_referer( 'tadv-save-buttons-order' );
50
+
51
+ $tb1 = $tb2 = $tb3 = $tb4 = $btns = array();
52
+ parse_str( $_POST['toolbar_1order'], $tb1 );
53
+ parse_str( $_POST['toolbar_2order'], $tb2 );
54
+ parse_str( $_POST['toolbar_3order'], $tb3 );
55
+ parse_str( $_POST['toolbar_4order'], $tb4 );
56
+
57
+ $tadv_toolbars['toolbar_1'] = (array) $tb1['pre'];
58
+ $tadv_toolbars['toolbar_2'] = (array) $tb2['pre'];
59
+ $tadv_toolbars['toolbar_3'] = (array) $tb3['pre'];
60
+ $tadv_toolbars['toolbar_4'] = (array) $tb4['pre'];
61
+
62
+ update_option( 'tadv_toolbars', $tadv_toolbars );
63
+
64
+ $tadv_options['advlink'] = $_POST['advlink'] ? 1 : 0;
65
+ $tadv_options['advimage'] = $_POST['advimage'] ? 1 : 0;
66
+ $tadv_options['contextmenu'] = $_POST['contextmenu'] ? 1 : 0;
67
+ $tadv_options['importcss'] = $_POST['importcss'] ? 1 : 0;
68
+ $tadv_options['fix_autop'] = $_POST['fix_autop'] ? 1 : 0;
69
+ $update_tadv_options = true;
70
+ }
71
+
72
+ $hidden_row = 0;
73
+ $i = 0;
74
+ foreach ( $tadv_toolbars as $toolbar ) {
75
+ $l = false;
76
+ $i++;
77
+
78
+ if ( empty($toolbar) ) {
79
+ $btns["toolbar_$i"] = array();
80
+ continue;
81
+ }
82
+
83
+ foreach( $toolbar as $k => $v ) {
84
+ if ( strpos($v, 'separator') !== false ) $toolbar[$k] = 'separator';
85
+ if ( 'layer' == $v ) $l = $k;
86
+ if ( empty($v) ) unset($toolbar[$k]);
87
+ }
88
+ if ( $l ) array_splice( $toolbar, $l, 1, array('insertlayer', 'moveforward', 'movebackward', 'absolute') );
89
+
90
+ $btns["toolbar_$i"] = $toolbar;
91
+ }
92
+ extract($btns);
93
+
94
+ if ( empty($toolbar_1) && empty($toolbar_2) && empty($toolbar_3) && empty($toolbar_4) ) {
95
+ ?><div class="error" id="message"><p><?php _e('All toolbars are empty! Default buttons loaded.', 'tadv'); ?></p></div><?php
96
+
97
+ @include_once( WP_PLUGIN_DIR . '/tinymce-advanced/tadv_defaults.php');
98
+ $allbtns = array_merge( $tadv_btns1, $tadv_btns2, $tadv_btns3, $tadv_btns4 );
99
+ } else {
100
+ $allbtns = array_merge( $toolbar_1, $toolbar_2, $toolbar_3, $toolbar_4 );
101
+ }
102
+ if ( in_array('advhr', $allbtns) ) $plugins[] = 'advhr';
103
+ if ( in_array('insertlayer', $allbtns) ) $plugins[] = 'layer';
104
+ if ( in_array('visualchars', $allbtns) ) $plugins[] = 'visualchars';
105
+
106
+ if ( in_array('nonbreaking', $allbtns) ) $plugins[] = 'nonbreaking';
107
+ if ( in_array('styleprops', $allbtns) ) $plugins[] = 'style';
108
+ if ( in_array('emotions', $allbtns) ) $plugins[] = 'emotions';
109
+ if ( in_array('insertdate', $allbtns) ||
110
+ in_array('inserttime', $allbtns) ) $plugins[] = 'insertdatetime';
111
+
112
+ if ( in_array('tablecontrols', $allbtns) ) $plugins[] = 'table';
113
+ if ( in_array('print', $allbtns) ) $plugins[] = 'print';
114
+ if ( in_array('iespell', $allbtns) ) $plugins[] = 'iespell';
115
+ if ( in_array('search', $allbtns) ||
116
+ in_array('replace', $allbtns) ) $plugins[] = 'searchreplace';
117
+
118
+ if ( in_array('cite', $allbtns) ||
119
+ in_array('ins', $allbtns) ||
120
+ in_array('del', $allbtns) ||
121
+ in_array('abbr', $allbtns) ||
122
+ in_array('acronym', $allbtns) ||
123
+ in_array('attribs', $allbtns) ) $plugins[] = 'xhtmlxtras';
124
+
125
+ if ( $tadv_options['advlink'] == '1' ) $plugins[] = 'advlink';
126
+ if ( $tadv_options['advimage'] == '1' ) $plugins[] = 'advimage';
127
+ if ( $tadv_options['contextmenu'] == '1' ) $plugins[] = 'contextmenu';
128
+
129
+ $buttons = array( 'Kitchen Sink' => 'wp_adv', 'Quote' => 'blockquote', 'Bold' => 'bold', 'Italic' => 'italic', 'Strikethrough' => 'strikethrough', 'Underline' => 'underline', 'Bullet List' => 'bullist', 'Numbered List' => 'numlist', 'Outdent' => 'outdent', 'Indent' => 'indent', 'Allign Left' => 'justifyleft', 'Center' => 'justifycenter', 'Alligh Right' => 'justifyright', 'Justify' => 'justifyfull', 'Cut' => 'cut', 'Copy' => 'copy', 'Paste' => 'paste', 'Link' => 'link', 'Remove Link' => 'unlink', 'Insert Image' => 'image', 'More Tag' => 'wp_more', 'Split Page' => 'wp_page', 'Search' => 'search', 'Replace' => 'replace', '<!--fontselect-->' => 'fontselect', '<!--fontsizeselect-->' => 'fontsizeselect', 'Help' => 'wp_help', 'Full Screen' => 'fullscreen', '<!--styleselect-->' => 'styleselect', '<!--formatselect-->' => 'formatselect', 'Text Color' => 'forecolor', 'Back Color' => 'backcolor', 'Paste as Text' => 'pastetext', 'Paste from Word' => 'pasteword', 'Remove Format' => 'removeformat', 'Clean Code' => 'cleanup', 'Check Spelling' => 'spellchecker', 'Character Map' => 'charmap', 'Print' => 'print', 'Undo' => 'undo', 'Redo' => 'redo', 'Table' => 'tablecontrols', 'Citation' => 'cite', 'Inserted Text' => 'ins', 'Deleted Text' => 'del', 'Abbreviation' => 'abbr', 'Acronym' => 'acronym', 'XHTML Attribs' => 'attribs', 'Layer' => 'layer', 'Advanced HR' => 'advhr', 'View HTML' => 'code', 'Hidden Chars' => 'visualchars', 'NB Space' => 'nonbreaking', 'Sub' => 'sub', 'Sup' => 'sup', 'Visual Aids' => 'visualaid', 'Insert Date' => 'insertdate', 'Insert Time' => 'inserttime', 'Anchor' => 'anchor', 'Style' => 'styleprops', 'Smilies' => 'emotions', 'Insert Movie' => 'media', 'IE Spell' => 'iespell' );
130
+
131
+ if ( function_exists('moxiecode_plugins_url') ) {
132
+ if ( moxiecode_plugins_url('imagemanager') ) $buttons['MCFileManager'] = 'insertimage';
133
+ if ( moxiecode_plugins_url('filemanager') ) $buttons['MCImageManager'] = 'insertfile';
134
+ }
135
+
136
+ $tadv_allbtns = array_values($buttons);
137
+ $tadv_allbtns[] = 'separator';
138
+ $tadv_allbtns[] = '|';
139
+
140
+ if ( get_option('tadv_plugins') != $plugins ) update_option( 'tadv_plugins', $plugins );
141
+ if ( get_option('tadv_btns1') != $toolbar_1 ) update_option( 'tadv_btns1', $toolbar_1 );
142
+ if ( get_option('tadv_btns2') != $toolbar_2 ) update_option( 'tadv_btns2', $toolbar_2 );
143
+ if ( get_option('tadv_btns3') != $toolbar_3 ) update_option( 'tadv_btns3', $toolbar_3 );
144
+ if ( get_option('tadv_btns4') != $toolbar_4 ) update_option( 'tadv_btns4', $toolbar_4 );
145
+ if ( get_option('tadv_allbtns') != $tadv_allbtns ) update_option( 'tadv_allbtns', $tadv_allbtns );
146
+
147
+ for ( $i = 1; $i < 21; $i++ )
148
+ $buttons["s$i"] = "separator$i";
149
+
150
+ if ( isset($_POST['tadv-save']) ) { ?>
151
+ <div class="updated" id="message"><p><?php _e('Options saved', 'tadv'); ?></p></div>
152
+ <?php } ?>
153
+
154
+ <div class="wrap" id="contain">
155
+
156
+ <h2><?php _e('TinyMCE Buttons Arrangement', 'tadv'); ?></h2>
157
+
158
+ <form id="tadvadmin" method="post" action="" onsubmit="">
159
+ <p><?php _e('Drag and drop buttons onto the toolbars below.', 'tadv'); ?></p>
160
+
161
+ <div id="tadvzones">
162
+ <input id="toolbar_1order" name="toolbar_1order" value="" type="hidden" />
163
+ <input id="toolbar_2order" name="toolbar_2order" value="" type="hidden" />
164
+ <input id="toolbar_3order" name="toolbar_3order" value="" type="hidden" />
165
+ <input id="toolbar_4order" name="toolbar_4order" value="" type="hidden" />
166
+ <input name="tadv-save" value="1" type="hidden" />
167
+
168
+ <div class="tadvdropzone">
169
+ <ul style="position: relative;" id="toolbar_1" class="container">
170
+ <?php
171
+ if ( is_array($tadv_toolbars['toolbar_1']) ) {
172
+ $tb1 = array();
173
+ foreach( $tadv_toolbars['toolbar_1'] as $k ) {
174
+ $t = array_intersect( $buttons, (array) $k );
175
+ $tb1 += $t;
176
+ }
177
+
178
+ foreach( $tb1 as $name => $btn ) {
179
+ if ( strpos( $btn, 'separator' ) !== false ) { ?>
180
+
181
+ <li class="separator" id="pre_<?php echo $btn; ?>">
182
+ <div class="tadvitem"> </div></li>
183
+ <?php } else { ?>
184
+
185
+ <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
186
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
187
+ <span class="descr"> <?php echo $name; ?></span></div></li>
188
+ <?php }
189
+ }
190
+ $buttons = array_diff( $buttons, $tb1 );
191
+ } ?>
192
+ </ul></div>
193
+ <br class="clear" />
194
+
195
+ <div class="tadvdropzone">
196
+ <ul style="position: relative;" id="toolbar_2" class="container">
197
+ <?php
198
+ if ( is_array($tadv_toolbars['toolbar_2']) ) {
199
+ $tb2 = array();
200
+ foreach( $tadv_toolbars['toolbar_2'] as $k ) {
201
+ $t = array_intersect( $buttons, (array) $k );
202
+ $tb2 = $tb2 + $t;
203
+ }
204
+ foreach( $tb2 as $name => $btn ) {
205
+ if ( strpos( $btn, 'separator' ) !== false ) { ?>
206
+
207
+ <li class="separator" id="pre_<?php echo $btn; ?>">
208
+ <div class="tadvitem"> </div></li>
209
+ <?php } else { ?>
210
+
211
+ <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
212
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
213
+ <span class="descr"> <?php echo $name; ?></span></div></li>
214
+ <?php }
215
+ }
216
+ $buttons = array_diff( $buttons, $tb2 );
217
+ } ?>
218
+ </ul></div>
219
+ <br class="clear" />
220
+
221
+ <div class="tadvdropzone">
222
+ <ul style="position: relative;" id="toolbar_3" class="container">
223
+ <?php
224
+ if ( is_array($tadv_toolbars['toolbar_3']) ) {
225
+ $tb3 = array();
226
+ foreach( $tadv_toolbars['toolbar_3'] as $k ) {
227
+ $t = array_intersect( $buttons, (array) $k );
228
+ $tb3 += $t;
229
+ }
230
+ foreach( $tb3 as $name => $btn ) {
231
+ if ( strpos( $btn, 'separator' ) !== false ) { ?>
232
+
233
+ <li class="separator" id="pre_<?php echo $btn; ?>">
234
+ <div class="tadvitem"> </div></li>
235
+ <?php } else { ?>
236
+
237
+ <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
238
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
239
+ <span class="descr"> <?php echo $name; ?></span></div></li>
240
+ <?php }
241
+ }
242
+ $buttons = array_diff( $buttons, $tb3 );
243
+ } ?>
244
+ </ul></div>
245
+ <br class="clear" />
246
+
247
+ <div class="tadvdropzone">
248
+ <ul style="position: relative;" id="toolbar_4" class="container">
249
+ <?php
250
+ if ( is_array($tadv_toolbars['toolbar_4']) ) {
251
+ $tb4 = array();
252
+ foreach( $tadv_toolbars['toolbar_4'] as $k ) {
253
+ $t = array_intersect( $buttons, (array) $k );
254
+ $tb4 += $t;
255
+ }
256
+ foreach( $tb4 as $name => $btn ) {
257
+ if ( strpos( $btn, 'separator' ) !== false ) { ?>
258
+
259
+ <li class="separator" id="pre_<?php echo $btn; ?>">
260
+ <div class="tadvitem"> </div></li>
261
+ <?php } else { ?>
262
+
263
+ <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
264
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
265
+ <span class="descr"> <?php echo $name; ?></span></div></li>
266
+ <?php }
267
+ }
268
+ $buttons = array_diff( $buttons, $tb4 );
269
+ } ?>
270
+ </ul></div>
271
+ <br class="clear" />
272
+ </div>
273
+
274
+ <div id="tadvWarnmsg">&nbsp;
275
+ <span id="too_long" style="display:none;"><?php _e('Adding too many buttons will make the toolbar too long and will not display correctly in TinyMCE!', 'tadv'); ?></span>
276
+ </div>
277
+
278
+ <div id="tadvpalettediv">
279
+ <ul style="position: relative;" id="tadvpalette">
280
+ <?php
281
+ if ( is_array($buttons) ) {
282
+ foreach( $buttons as $name => $btn ) {
283
+ if ( strpos( $btn, 'separator' ) !== false ) { ?>
284
+
285
+ <li class="separator" id="pre_<?php echo $btn; ?>">
286
+ <div class="tadvitem"> </div></li>
287
+ <?php } else { ?>
288
+
289
+ <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
290
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
291
+ <span class="descr"> <?php echo $name; ?></span></div></li>
292
+ <?php }
293
+ }
294
+ } ?>
295
+ </ul>
296
+ </div>
297
+
298
+ <table class="clear" style="margin:10px 0"><tr><td style="padding:2px 12px 8px;">
299
+ Also enable:
300
+ <label for="advlink" class="tadv-box"><?php _e('Advanced Link', 'tadv'); ?> &nbsp;
301
+ <input type="checkbox" class="tadv-chk" name="advlink" id="advlink" <?php if ( $tadv_options['advlink'] == '1' ) echo ' checked="checked"'; ?> /></label> &bull;
302
+
303
+ <label for="advimage" class="tadv-box"><?php _e('Advanced Image', 'tadv'); ?> &nbsp;
304
+ <input type="checkbox" class="tadv-chk" name="advimage" id="advimage" <?php if ( $tadv_options['advimage'] == '1' ) echo ' checked="checked"'; ?> /></label> &bull;
305
+ <label for="contextmenu" class="tadv-box"><?php _e('Context Menu', 'tadv'); ?> &nbsp;
306
+
307
+ <input type="checkbox" class="tadv-chk" name="contextmenu" id="contextmenu" <?php if ( $tadv_options['contextmenu'] == '1' ) echo ' checked="checked"'; ?> /></label>
308
+ <?php _e('(to show the context menu in Firefox and use the spellchecker, hold down the Ctrl key).', 'tadv'); ?>
309
+ </td></tr>
310
+
311
+ <tr><td style="border:1px solid #CD0000;padding:2px 12px 8px;">
312
+ <p style="font-weight:bold;color:#CD0000;"><?php _e('Advanced', 'tadv'); ?></p>
313
+
314
+ <p><label for="importcss" class="tadv-box"><?php _e('Import the current theme CSS classes', 'tadv'); ?> &nbsp;
315
+ <input type="checkbox" class="tadv-chk" name="importcss" id="importcss" <?php if ( $tadv_options['importcss'] == '1' ) echo ' checked="checked"'; ?> /></label></p>
316
+ <p style="font-size:11px;"><?php _e('Custom CSS styles can be added in', 'tadv'); ?> <a href="plugin-editor.php?file=tinymce-advanced/css/tadv-mce.css&amp;plugin=tinymce-advanced/tinymce-advanced.php"> <?php _e('/wp-content/plugins/tinymce-advanced/css/tadv-mce.css.', 'tadv'); ?></a> <?php _e('They will be imported and used in TinyMCE. Only CSS classes will be used, also <strong>div.my-class</strong> would not work, but <strong>.my-class</strong> will.', 'tadv'); ?></p>
317
+ <p><label for="fix_autop" class="tadv-box"><?php _e('Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them in the HTML editor', 'tadv'); ?> &nbsp;
318
+ <input type="checkbox" class="tadv-chk" name="fix_autop" id="fix_autop" <?php if ( $tadv_options['fix_autop'] == '1' ) echo ' checked="checked"'; ?> /></label></p>
319
+ <p style="font-size:11px;"><?php _e('This will make it possible to use more advanced HTML without the back-end filtering affecting it much. It also preserves empty new lines in the editor by padding them with &lt;br /&gt; tags.', 'tadv'); ?></p>
320
+ </td></tr>
321
+ <?php
322
+ $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
323
+ if ( $mce_locale != 'en' ) {
324
+ if ( ! @file_exists(WP_PLUGIN_DIR . '/tinymce-advanced/mce/advlink/langs/' . $mce_locale . '_dlg.js') ) { ?>
325
+ <tr><td style="padding:2px 12px 8px;">
326
+ <p style="font-weight:bold;"><?php _e('Language Settings', 'tadv'); ?></p>
327
+ <p><?php _e('Your WordPress language is set to', 'tadv'); ?> <strong><?php echo get_locale(); ?></strong>. <?php _e('However there is no matching language installed for TinyMCE plugins. This plugin includes several translations: German, French, Italian, Spanish, Portuguese, Russian, Japanese and Chinese. More translations are available at the', 'tadv'); ?> <a href="http://services.moxiecode.com/i18n/"><?php _e('TinyMCE web site.', 'tadv'); ?></a></p>
328
+ </td></tr>
329
+ <?php }
330
+ } // end mce_locale
331
+ ?>
332
+ </table>
333
+
334
+ <p>
335
+ <?php wp_nonce_field( 'tadv-save-buttons-order' ); ?>
336
+ <input class="button tadv_btn" type="button" class="tadv_btn" value="<?php _e('Remove Settings', 'tadv'); ?>" onclick="document.getElementById('tadv_uninst_div').style.display = 'block';" />
337
+ <input class="button-primary tadv_btn" type="button" value="<?php _e('Save Changes', 'tadv'); ?>" onclick="tadvSortable.serialize();" />
338
+ </p>
339
+ </form>
340
+
341
+ <div id="tadvWarnmsg2">&nbsp;
342
+ <span id="sink_err" style="display:none;"><?php _e('The Kitchen Sink button shows/hides the next toolbar row. It will not work at the current place.', 'tadv'); ?></span>
343
+ </div>
344
+
345
+ <div id="tadv_uninst_div" style="">
346
+ <form method="post" action="">
347
+ <?php wp_nonce_field('tadv-uninstall'); ?>
348
+ <div><?php _e('Remove all saved settings from the database?', 'tadv'); ?>
349
+ <input class="button tadv_btn" type="button" name="cancel" value="<?php _e('Cancel', 'tadv'); ?>" onclick="document.getElementById('tadv_uninst_div').style.display = 'none';" style="margin-left:20px" />
350
+ <input class="button tadv_btn" type="submit" name="tadv_uninstall" value="<?php _e('Continue', 'tadv'); ?>" /></div>
351
+ </form>
352
+ </div>
353
+ </div>
354
+
355
+ <?php
356
+ if ( $update_tadv_options )
357
+ update_option( 'tadv_options', $tadv_options );
tadv_defaults.php CHANGED
@@ -1,19 +1,18 @@
1
- <?php
2
-
3
- $tadv_plugins = array( 'style', 'emotions', 'print', 'searchreplace', 'xhtmlxtras', 'advlink', 'advimage' );
4
-
5
- $tadv_toolbars = array(
6
- 'toolbar_1' => array( 'bold', 'italic', 'strikethrough', 'underline', 'separator1', 'bullist', 'numlist', 'outdent', 'indent', 'separator2', 'justifyleft', 'justifycenter', 'justifyright', 'separator3', 'link', 'unlink', 'separator4', 'image', 'styleprops', 'separator12', 'wp_more', 'wp_page', 'separator5', 'spellchecker', 'search', 'separator6', 'fullscreen', 'wp_adv' ),
7
- 'toolbar_2' => array( 'fontsizeselect', 'formatselect', 'pastetext', 'pasteword', 'removeformat', 'separator8', 'charmap', 'print', 'separator9', 'forecolor', 'emotions', 'separator10', 'sup', 'sub', 'media', 'separator11', 'undo', 'redo', 'attribs', 'wp_help' ),
8
- 'toolbar_3' => array(),
9
- 'toolbar_4' => array()
10
- );
11
-
12
- $tadv_btns1 = array( 'bold', 'italic', 'strikethrough', 'underline', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'separator', 'link', 'unlink', 'separator', 'image', 'styleprops', 'separator', 'wp_more', 'wp_page', 'separator', 'spellchecker', 'search', 'separator', 'fullscreen', 'wp_adv' );
13
-
14
- $tadv_btns2 = array( 'fontsizeselect', 'formatselect', 'pastetext', 'pasteword', 'removeformat', 'separator', 'charmap', 'print', 'separator', 'forecolor', 'emotions', 'separator', 'sup', 'sub', 'media', 'separator', 'undo', 'redo', 'attribs', 'wp_help' );
15
-
16
- $tadv_btns3 = $tadv_btns4 = array();
17
-
18
- $tadv_allbtns = array( 'wp_adv', 'bold', 'italic', 'strikethrough', 'underline', 'bullist', 'numlist', 'outdent', 'indent', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'cut', 'copy', 'paste', 'link', 'unlink', 'image', 'wp_more', 'wp_page', 'search', 'replace', 'fontselect', 'fontsizeselect', 'wp_help', 'fullscreen', 'styleselect', 'formatselect', 'forecolor', 'pastetext', 'pasteword', 'removeformat', 'cleanup', 'spellchecker', 'charmap', 'print', 'undo', 'redo', 'tablecontrols', 'cite', 'ins', 'del', 'abbr', 'acronym', 'attribs', 'layer', 'advhr', 'code', 'visualchars', 'nonbreaking', 'sub', 'sup', 'visualaid', 'insertdate', 'inserttime', 'anchor', 'styleprops', 'emotions', 'media', 'blockquote', 'separator', '|' );
19
- ?>
1
+ <?php
2
+
3
+ $tadv_plugins = array( 'style', 'emotions', 'print', 'searchreplace', 'xhtmlxtras', 'advlink', 'advimage' );
4
+
5
+ $tadv_toolbars = array(
6
+ 'toolbar_1' => array( 'bold', 'italic', 'strikethrough', 'underline', 'separator1', 'bullist', 'numlist', 'outdent', 'indent', 'separator2', 'justifyleft', 'justifycenter', 'justifyright', 'separator3', 'link', 'unlink', 'separator4', 'image', 'styleprops', 'separator12', 'wp_more', 'wp_page', 'separator5', 'spellchecker', 'search', 'separator6', 'fullscreen', 'wp_adv' ),
7
+ 'toolbar_2' => array( 'fontsizeselect', 'formatselect', 'pastetext', 'pasteword', 'removeformat', 'separator8', 'charmap', 'print', 'separator9', 'forecolor', 'backcolor', 'emotions', 'separator10', 'sup', 'sub', 'media', 'separator11', 'undo', 'redo', 'attribs', 'wp_help' ),
8
+ 'toolbar_3' => array(),
9
+ 'toolbar_4' => array()
10
+ );
11
+
12
+ $tadv_btns1 = array( 'bold', 'italic', 'strikethrough', 'underline', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'separator', 'link', 'unlink', 'separator', 'image', 'styleprops', 'separator', 'wp_more', 'wp_page', 'separator', 'spellchecker', 'search', 'separator', 'fullscreen', 'wp_adv' );
13
+
14
+ $tadv_btns2 = array( 'fontsizeselect', 'formatselect', 'pastetext', 'pasteword', 'removeformat', 'separator', 'charmap', 'print', 'separator', 'forecolor', 'backcolor', 'emotions', 'separator', 'sup', 'sub', 'media', 'separator', 'undo', 'redo', 'attribs', 'wp_help' );
15
+
16
+ $tadv_btns3 = $tadv_btns4 = array();
17
+
18
+ $tadv_allbtns = array( 'wp_adv', 'bold', 'italic', 'strikethrough', 'underline', 'bullist', 'numlist', 'outdent', 'indent', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'cut', 'copy', 'paste', 'link', 'unlink', 'image', 'wp_more', 'wp_page', 'search', 'replace', 'fontselect', 'fontsizeselect', 'wp_help', 'fullscreen', 'styleselect', 'formatselect', 'forecolor', 'backcolor', 'pastetext', 'pasteword', 'removeformat', 'cleanup', 'spellchecker', 'charmap', 'print', 'undo', 'redo', 'tablecontrols', 'cite', 'ins', 'del', 'abbr', 'acronym', 'attribs', 'layer', 'advhr', 'code', 'visualchars', 'nonbreaking', 'sub', 'sup', 'visualaid', 'insertdate', 'inserttime', 'anchor', 'styleprops', 'emotions', 'media', 'blockquote', 'separator', '|' );
 
tiny_mce_popup.js CHANGED
@@ -1,294 +1,5 @@
1
- // Some global instances
2
- var tinymce = null, tinyMCEPopup, tinyMCE;
3
-
4
- tinyMCEPopup = {
5
- init : function() {
6
- var t = this, w, ti, li, q, i, it;
7
-
8
- li = ('' + document.location.search).replace(/^\?/, '').split('&');
9
- q = {};
10
- for (i=0; i<li.length; i++) {
11
- it = li[i].split('=');
12
- q[unescape(it[0])] = unescape(it[1]);
13
- }
14
-
15
- if (q.mce_rdomain)
16
- document.domain = q.mce_rdomain;
17
-
18
- // Find window & API
19
- w = t.getWin();
20
- tinymce = w.tinymce;
21
- tinyMCE = w.tinyMCE;
22
- t.editor = tinymce.EditorManager.activeEditor;
23
- t.params = t.editor.windowManager.params;
24
- t.features = t.editor.windowManager.features;
25
-
26
- // Setup local DOM
27
- t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document);
28
-
29
- // Enables you to skip loading the default css
30
- if (t.features.popup_css !== false)
31
- t.dom.loadCSS(t.features.popup_css || t.editor.settings.popup_css);
32
-
33
- // Setup on init listeners
34
- t.listeners = [];
35
- t.onInit = {
36
- add : function(f, s) {
37
- t.listeners.push({func : f, scope : s});
38
- }
39
- };
40
-
41
- t.isWindow = !t.getWindowArg('mce_inline');
42
- t.id = t.getWindowArg('mce_window_id');
43
- t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window);
44
- },
45
-
46
- getWin : function() {
47
- return window.dialogArguments || opener || parent || top;
48
- },
49
-
50
- getWindowArg : function(n, dv) {
51
- var v = this.params[n];
52
-
53
- return tinymce.is(v) ? v : dv;
54
- },
55
-
56
- getParam : function(n, dv) {
57
- return this.editor.getParam(n, dv);
58
- },
59
-
60
- getLang : function(n, dv) {
61
- return this.editor.getLang(n, dv);
62
- },
63
-
64
- execCommand : function(cmd, ui, val, a) {
65
- a = a || {};
66
- a.skip_focus = 1;
67
-
68
- this.restoreSelection();
69
- return this.editor.execCommand(cmd, ui, val, a);
70
- },
71
-
72
- resizeToInnerSize : function() {
73
- var t = this, n, b = document.body, vp = t.dom.getViewPort(window), dw, dh;
74
-
75
- dw = t.getWindowArg('mce_width') - vp.w;
76
- dh = t.getWindowArg('mce_height') - vp.h;
77
-
78
- if (t.isWindow)
79
- window.resizeBy(dw, dh);
80
- else
81
- t.editor.windowManager.resizeBy(dw, dh, t.id);
82
- },
83
-
84
- executeOnLoad : function(s) {
85
- this.onInit.add(function() {
86
- eval(s);
87
- });
88
- },
89
-
90
- storeSelection : function() {
91
- this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark('simple');
92
- },
93
-
94
- restoreSelection : function() {
95
- var t = tinyMCEPopup;
96
-
97
- if (!t.isWindow && tinymce.isIE)
98
- t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
99
- },
100
-
101
- requireLangPack : function() {
102
- var u = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url');
103
-
104
- if (u && this.editor.settings.language) {
105
- u += '/langs/' + this.editor.settings.language + '_dlg.js';
106
-
107
- if (!tinymce.ScriptLoader.isDone(u)) {
108
- document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"></script>');
109
- tinymce.ScriptLoader.markDone(u);
110
- }
111
- }
112
- },
113
-
114
- pickColor : function(e, element_id) {
115
- this.execCommand('mceColorPicker', true, {
116
- color : document.getElementById(element_id).value,
117
- func : function(c) {
118
- document.getElementById(element_id).value = c;
119
-
120
- try {
121
- document.getElementById(element_id).onchange();
122
- } catch (ex) {
123
- // Try fire event, ignore errors
124
- }
125
- }
126
- });
127
- },
128
-
129
- openBrowser : function(element_id, type, option) {
130
- tinyMCEPopup.restoreSelection();
131
- this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
132
- },
133
-
134
- confirm : function(t, cb, s) {
135
- this.editor.windowManager.confirm(t, cb, s, window);
136
- },
137
-
138
- alert : function(tx, cb, s) {
139
- this.editor.windowManager.alert(tx, cb, s, window);
140
- },
141
-
142
- close : function() {
143
- var t = this;
144
-
145
- // To avoid domain relaxing issue in Opera
146
- function close() {
147
- t.editor.windowManager.close(window);
148
- tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
149
- };
150
-
151
- if (tinymce.isOpera)
152
- t.getWin().setTimeout(close, 0);
153
- else
154
- close();
155
- },
156
-
157
- // Internal functions
158
-
159
- _restoreSelection : function() {
160
- var e = window.event.srcElement;
161
-
162
- if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
163
- tinyMCEPopup.restoreSelection();
164
- },
165
-
166
- /* _restoreSelection : function() {
167
- var e = window.event.srcElement;
168
-
169
- // If user focus a non text input or textarea
170
- if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
171
- tinyMCEPopup.restoreSelection();
172
- },*/
173
-
174
- _onDOMLoaded : function() {
175
- var t = this, ti = document.title, bm, h, nv;
176
-
177
- // Translate page
178
- if (t.features.translate_i18n !== false) {
179
- h = document.body.innerHTML;
180
-
181
- // Replace a=x with a="x" in IE
182
- if (tinymce.isIE)
183
- h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
184
-
185
- document.dir = t.editor.getParam('directionality','');
186
-
187
- if ((nv = t.editor.translate(h)) && nv != h)
188
- document.body.innerHTML = nv;
189
-
190
- if ((nv = t.editor.translate(ti)) && nv != ti)
191
- document.title = ti = nv;
192
- }
193
-
194
- document.body.style.display = '';
195
-
196
- // Restore selection in IE when focus is placed on a non textarea or input element of the type text
197
- if (tinymce.isIE)
198
- document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
199
-
200
- t.restoreSelection();
201
- t.resizeToInnerSize();
202
-
203
- // Set inline title
204
- if (!t.isWindow)
205
- t.editor.windowManager.setTitle(window, ti);
206
- else
207
- window.focus();
208
-
209
- if (!tinymce.isIE && !t.isWindow) {
210
- tinymce.dom.Event._add(document, 'focus', function() {
211
- t.editor.windowManager.focus(t.id)
212
- });
213
- }
214
-
215
- // Patch for accessibility
216
- tinymce.each(t.dom.select('select'), function(e) {
217
- e.onkeydown = tinyMCEPopup._accessHandler;
218
- });
219
-
220
- // Call onInit
221
- // Init must be called before focus so the selection won't get lost by the focus call
222
- tinymce.each(t.listeners, function(o) {
223
- o.func.call(o.scope, t.editor);
224
- });
225
-
226
- // Move focus to window
227
- if (t.getWindowArg('mce_auto_focus', true)) {
228
- window.focus();
229
-
230
- // Focus element with mceFocus class
231
- tinymce.each(document.forms, function(f) {
232
- tinymce.each(f.elements, function(e) {
233
- if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) {
234
- e.focus();
235
- return false; // Break loop
236
- }
237
- });
238
- });
239
- }
240
-
241
- document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
242
- },
243
-
244
- _accessHandler : function(e) {
245
- e = e || window.event;
246
-
247
- if (e.keyCode == 13 || e.keyCode == 32) {
248
- e = e.target || e.srcElement;
249
-
250
- if (e.onchange)
251
- e.onchange();
252
-
253
- return tinymce.dom.Event.cancel(e);
254
- }
255
- },
256
-
257
- _closeWinKeyHandler : function(e) {
258
- e = e || window.event;
259
-
260
- if (e.keyCode == 27)
261
- tinyMCEPopup.close();
262
- },
263
-
264
- _wait : function() {
265
- var t = this, ti;
266
-
267
- if (tinymce.isIE && document.location.protocol != 'https:') {
268
- // Fake DOMContentLoaded on IE
269
- document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');
270
- document.getElementById("__ie_onload").onreadystatechange = function() {
271
- if (this.readyState == "complete") {
272
- t._onDOMLoaded();
273
- document.getElementById("__ie_onload").onreadystatechange = null; // Prevent leak
274
- }
275
- };
276
- } else {
277
- if (tinymce.isIE || tinymce.isWebKit) {
278
- ti = setInterval(function() {
279
- if (/loaded|complete/.test(document.readyState)) {
280
- clearInterval(ti);
281
- t._onDOMLoaded();
282
- }
283
- }, 10);
284
- } else {
285
- window.addEventListener('DOMContentLoaded', function() {
286
- t._onDOMLoaded();
287
- }, false);
288
- }
289
- }
290
- }
291
- };
292
-
293
- tinyMCEPopup.init();
294
- tinyMCEPopup._wait(); // Wait for DOM Content Loaded
1
+
2
+ // Uncomment and change this document.domain value if you are loading the script cross subdomains
3
+ // document.domain = 'moxiecode.com';
4
+
5
+ var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return window.dialogArguments||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var e=this,g,a=document.body,c=e.dom.getViewPort(window),d,f;d=e.getWindowArg("mce_width")-c.w;f=e.getWindowArg("mce_height")-c.h;if(e.isWindow){window.resizeBy(d,f)}else{e.editor.windowManager.resizeBy(d,f,e.id)}},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark("simple")},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tinymce-advanced.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: TinyMCE Advanced
4
  Plugin URI: http://www.laptoptips.ca/projects/tinymce-advanced/
5
  Description: Enables advanced features and plugins in TinyMCE.
6
- Version: 3.2
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
9
 
@@ -36,7 +36,7 @@ if ( ! function_exists('tadv_add_scripts') ) {
36
  if ( ! function_exists('tadv_activate') ) {
37
  function tadv_activate() {
38
 
39
- @include_once( WP_PLUGIN_DIR . '/tinymce-advanced/tadv_defaults.php');
40
  $tadv_options = array( 'advlink' => 1, 'advimage' => 1, 'importcss' => 0, 'contextmenu' => 0, 'tadvreplace' => 0 );
41
 
42
  if ( isset($tadv_toolbars) ) {
@@ -55,7 +55,7 @@ add_action( 'activate_tinymce-advanced/tinymce-advanced.php', 'tadv_activate' );
55
 
56
  if ( ! function_exists('tdav_css') ) {
57
  function tdav_css($wp) {
58
- $tadv_options = (array) get_option('tadv_options');
59
 
60
  if ( $tadv_options['importcss'] == '1' )
61
  $wp .= ',' . get_bloginfo('stylesheet_url');
@@ -93,7 +93,7 @@ if ( ! function_exists('tdav_get_file') ) {
93
  $tadv_allbtns = array();
94
  $tadv_hidden_row = 0;
95
 
96
- if ( is_admin() && ! defined('DOING_AJAX') ) {
97
  get_option('tadv_options');
98
  get_option('tadv_toolbars');
99
  get_option('tadv_plugins');
@@ -213,7 +213,7 @@ if ( ! function_exists('tmce_init') ) {
213
  wp_enqueue_script( 'tadv_replace', WP_PLUGIN_URL . '/tinymce-advanced/js/tadv_replace.js', array('editor'), '20080425' );
214
  }
215
  }
216
- add_action( 'admin_print_scripts', 'tmce_init' );
217
 
218
  if ( ! function_exists('tadv_load_plugins') ) {
219
  function tadv_load_plugins($plug) {
@@ -231,7 +231,7 @@ add_action( 'mce_external_plugins', 'tadv_load_plugins', 999 );
231
 
232
  if ( ! function_exists('tadv_load_langs') ) {
233
  function tadv_load_langs($langs) {
234
- $tadv_plugins = (array) get_option('tadv_plugins');
235
  $langpath = WP_PLUGIN_DIR . '/tinymce-advanced/mce/';
236
  $nolangs = array( 'bbcode', 'contextmenu', 'insertdatetime', 'layer', 'nonbreaking', 'print', 'visualchars', 'emotions', 'tadvreplace' );
237
 
@@ -261,5 +261,3 @@ if ( ! function_exists('tadv_menu') ) {
261
  }
262
  }
263
  add_action( 'admin_menu', 'tadv_menu' );
264
-
265
- ?>
3
  Plugin Name: TinyMCE Advanced
4
  Plugin URI: http://www.laptoptips.ca/projects/tinymce-advanced/
5
  Description: Enables advanced features and plugins in TinyMCE.
6
+ Version: 3.2.4
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
9
 
36
  if ( ! function_exists('tadv_activate') ) {
37
  function tadv_activate() {
38
 
39
+ @include_once('tadv_defaults.php');
40
  $tadv_options = array( 'advlink' => 1, 'advimage' => 1, 'importcss' => 0, 'contextmenu' => 0, 'tadvreplace' => 0 );
41
 
42
  if ( isset($tadv_toolbars) ) {
55
 
56
  if ( ! function_exists('tdav_css') ) {
57
  function tdav_css($wp) {
58
+ $tadv_options = get_option('tadv_options', array());
59
 
60
  if ( $tadv_options['importcss'] == '1' )
61
  $wp .= ',' . get_bloginfo('stylesheet_url');
93
  $tadv_allbtns = array();
94
  $tadv_hidden_row = 0;
95
 
96
+ if ( is_admin() && !defined('DOING_AJAX') && !defined('DOING_CRON') ) {
97
  get_option('tadv_options');
98
  get_option('tadv_toolbars');
99
  get_option('tadv_plugins');
213
  wp_enqueue_script( 'tadv_replace', WP_PLUGIN_URL . '/tinymce-advanced/js/tadv_replace.js', array('editor'), '20080425' );
214
  }
215
  }
216
+ add_action( 'admin_enqueue_scripts', 'tmce_init', 25 );
217
 
218
  if ( ! function_exists('tadv_load_plugins') ) {
219
  function tadv_load_plugins($plug) {
231
 
232
  if ( ! function_exists('tadv_load_langs') ) {
233
  function tadv_load_langs($langs) {
234
+ $tadv_plugins = get_option('tadv_plugins', array());
235
  $langpath = WP_PLUGIN_DIR . '/tinymce-advanced/mce/';
236
  $nolangs = array( 'bbcode', 'contextmenu', 'insertdatetime', 'layer', 'nonbreaking', 'print', 'visualchars', 'emotions', 'tadvreplace' );
237
 
261
  }
262
  }
263
  add_action( 'admin_menu', 'tadv_menu' );
 
 
utils/editable_selects.js CHANGED
@@ -1,69 +1,69 @@
1
- /**
2
- * $Id: editable_selects.js 867 2008-06-09 20:33:40Z spocke $
3
- *
4
- * Makes select boxes editable.
5
- *
6
- * @author Moxiecode
7
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
- */
9
-
10
- var TinyMCE_EditableSelects = {
11
- editSelectElm : null,
12
-
13
- init : function() {
14
- var nl = document.getElementsByTagName("select"), i, d = document, o;
15
-
16
- for (i=0; i<nl.length; i++) {
17
- if (nl[i].className.indexOf('mceEditableSelect') != -1) {
18
- o = new Option('(value)', '__mce_add_custom__');
19
-
20
- o.className = 'mceAddSelectValue';
21
-
22
- nl[i].options[nl[i].options.length] = o;
23
- nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
24
- }
25
- }
26
- },
27
-
28
- onChangeEditableSelect : function(e) {
29
- var d = document, ne, se = window.event ? window.event.srcElement : e.target;
30
-
31
- if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
32
- ne = d.createElement("input");
33
- ne.id = se.id + "_custom";
34
- ne.name = se.name + "_custom";
35
- ne.type = "text";
36
-
37
- ne.style.width = se.offsetWidth + 'px';
38
- se.parentNode.insertBefore(ne, se);
39
- se.style.display = 'none';
40
- ne.focus();
41
- ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
42
- ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;
43
- TinyMCE_EditableSelects.editSelectElm = se;
44
- }
45
- },
46
-
47
- onBlurEditableSelectInput : function() {
48
- var se = TinyMCE_EditableSelects.editSelectElm;
49
-
50
- if (se) {
51
- if (se.previousSibling.value != '') {
52
- addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
53
- selectByValue(document.forms[0], se.id, se.previousSibling.value);
54
- } else
55
- selectByValue(document.forms[0], se.id, '');
56
-
57
- se.style.display = 'inline';
58
- se.parentNode.removeChild(se.previousSibling);
59
- TinyMCE_EditableSelects.editSelectElm = null;
60
- }
61
- },
62
-
63
- onKeyDown : function(e) {
64
- e = e || window.event;
65
-
66
- if (e.keyCode == 13)
67
- TinyMCE_EditableSelects.onBlurEditableSelectInput();
68
- }
69
- };
1
+ /**
2
+ * $Id: editable_selects.js 867 2008-06-09 20:33:40Z spocke $
3
+ *
4
+ * Makes select boxes editable.
5
+ *
6
+ * @author Moxiecode
7
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
+ */
9
+
10
+ var TinyMCE_EditableSelects = {
11
+ editSelectElm : null,
12
+
13
+ init : function() {
14
+ var nl = document.getElementsByTagName("select"), i, d = document, o;
15
+
16
+ for (i=0; i<nl.length; i++) {
17
+ if (nl[i].className.indexOf('mceEditableSelect') != -1) {
18
+ o = new Option('(value)', '__mce_add_custom__');
19
+
20
+ o.className = 'mceAddSelectValue';
21
+
22
+ nl[i].options[nl[i].options.length] = o;
23
+ nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
24
+ }
25
+ }
26
+ },
27
+
28
+ onChangeEditableSelect : function(e) {
29
+ var d = document, ne, se = window.event ? window.event.srcElement : e.target;
30
+
31
+ if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
32
+ ne = d.createElement("input");
33
+ ne.id = se.id + "_custom";
34
+ ne.name = se.name + "_custom";
35
+ ne.type = "text";
36
+
37
+ ne.style.width = se.offsetWidth + 'px';
38
+ se.parentNode.insertBefore(ne, se);
39
+ se.style.display = 'none';
40
+ ne.focus();
41
+ ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
42
+ ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;
43
+ TinyMCE_EditableSelects.editSelectElm = se;
44
+ }
45
+ },
46
+
47
+ onBlurEditableSelectInput : function() {
48
+ var se = TinyMCE_EditableSelects.editSelectElm;
49
+
50
+ if (se) {
51
+ if (se.previousSibling.value != '') {
52
+ addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
53
+ selectByValue(document.forms[0], se.id, se.previousSibling.value);
54
+ } else
55
+ selectByValue(document.forms[0], se.id, '');
56
+
57
+ se.style.display = 'inline';
58
+ se.parentNode.removeChild(se.previousSibling);
59
+ TinyMCE_EditableSelects.editSelectElm = null;
60
+ }
61
+ },
62
+
63
+ onKeyDown : function(e) {
64
+ e = e || window.event;
65
+
66
+ if (e.keyCode == 13)
67
+ TinyMCE_EditableSelects.onBlurEditableSelectInput();
68
+ }
69
+ };
utils/form_utils.js CHANGED
@@ -1,199 +1,199 @@
1
- /**
2
- * $Id: form_utils.js 673 2008-03-06 13:26:20Z spocke $
3
- *
4
- * Various form utilitiy functions.
5
- *
6
- * @author Moxiecode
7
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
- */
9
-
10
- var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
11
-
12
- function getColorPickerHTML(id, target_form_element) {
13
- var h = "";
14
-
15
- h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
16
- h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
17
-
18
- return h;
19
- }
20
-
21
- function updateColor(img_id, form_element_id) {
22
- document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
23
- }
24
-
25
- function setBrowserDisabled(id, state) {
26
- var img = document.getElementById(id);
27
- var lnk = document.getElementById(id + "_link");
28
-
29
- if (lnk) {
30
- if (state) {
31
- lnk.setAttribute("realhref", lnk.getAttribute("href"));
32
- lnk.removeAttribute("href");
33
- tinyMCEPopup.dom.addClass(img, 'disabled');
34
- } else {
35
- if (lnk.getAttribute("realhref"))
36
- lnk.setAttribute("href", lnk.getAttribute("realhref"));
37
-
38
- tinyMCEPopup.dom.removeClass(img, 'disabled');
39
- }
40
- }
41
- }
42
-
43
- function getBrowserHTML(id, target_form_element, type, prefix) {
44
- var option = prefix + "_" + type + "_browser_callback", cb, html;
45
-
46
- cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
47
-
48
- if (!cb)
49
- return "";
50
-
51
- html = "";
52
- html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
53
- html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
54
-
55
- return html;
56
- }
57
-
58
- function openBrowser(img_id, target_form_element, type, option) {
59
- var img = document.getElementById(img_id);
60
-
61
- if (img.className != "mceButtonDisabled")
62
- tinyMCEPopup.openBrowser(target_form_element, type, option);
63
- }
64
-
65
- function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
66
- if (!form_obj || !form_obj.elements[field_name])
67
- return;
68
-
69
- var sel = form_obj.elements[field_name];
70
-
71
- var found = false;
72
- for (var i=0; i<sel.options.length; i++) {
73
- var option = sel.options[i];
74
-
75
- if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
76
- option.selected = true;
77
- found = true;
78
- } else
79
- option.selected = false;
80
- }
81
-
82
- if (!found && add_custom && value != '') {
83
- var option = new Option(value, value);
84
- option.selected = true;
85
- sel.options[sel.options.length] = option;
86
- sel.selectedIndex = sel.options.length - 1;
87
- }
88
-
89
- return found;
90
- }
91
-
92
- function getSelectValue(form_obj, field_name) {
93
- var elm = form_obj.elements[field_name];
94
-
95
- if (elm == null || elm.options == null)
96
- return "";
97
-
98
- return elm.options[elm.selectedIndex].value;
99
- }
100
-
101
- function addSelectValue(form_obj, field_name, name, value) {
102
- var s = form_obj.elements[field_name];
103
- var o = new Option(name, value);
104
- s.options[s.options.length] = o;
105
- }
106
-
107
- function addClassesToList(list_id, specific_option) {
108
- // Setup class droplist
109
- var styleSelectElm = document.getElementById(list_id);
110
- var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
111
- styles = tinyMCEPopup.getParam(specific_option, styles);
112
-
113
- if (styles) {
114
- var stylesAr = styles.split(';');
115
-
116
- for (var i=0; i<stylesAr.length; i++) {
117
- if (stylesAr != "") {
118
- var key, value;
119
-
120
- key = stylesAr[i].split('=')[0];
121
- value = stylesAr[i].split('=')[1];
122
-
123
- styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
124
- }
125
- }
126
- } else {
127
- tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
128
- styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
129
- });
130
- }
131
- }
132
-
133
- function isVisible(element_id) {
134
- var elm = document.getElementById(element_id);
135
-
136
- return elm && elm.style.display != "none";
137
- }
138
-
139
- function convertRGBToHex(col) {
140
- var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
141
-
142
- var rgb = col.replace(re, "$1,$2,$3").split(',');
143
- if (rgb.length == 3) {
144
- r = parseInt(rgb[0]).toString(16);
145
- g = parseInt(rgb[1]).toString(16);
146
- b = parseInt(rgb[2]).toString(16);
147
-
148
- r = r.length == 1 ? '0' + r : r;
149
- g = g.length == 1 ? '0' + g : g;
150
- b = b.length == 1 ? '0' + b : b;
151
-
152
- return "#" + r + g + b;
153
- }
154
-
155
- return col;
156
- }
157
-
158
- function convertHexToRGB(col) {
159
- if (col.indexOf('#') != -1) {
160
- col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
161
-
162
- r = parseInt(col.substring(0, 2), 16);
163
- g = parseInt(col.substring(2, 4), 16);
164
- b = parseInt(col.substring(4, 6), 16);
165
-
166
- return "rgb(" + r + "," + g + "," + b + ")";
167
- }
168
-
169
- return col;
170
- }
171
-
172
- function trimSize(size) {
173
- return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');
174
- }
175
-
176
- function getCSSSize(size) {
177
- size = trimSize(size);
178
-
179
- if (size == "")
180
- return "";
181
-
182
- // Add px
183
- if (/^[0-9]+$/.test(size))
184
- size += 'px';
185
-
186
- return size;
187
- }
188
-
189
- function getStyle(elm, attrib, style) {
190
- var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
191
-
192
- if (val != '')
193
- return '' + val;
194
-
195
- if (typeof(style) == 'undefined')
196
- style = attrib;
197
-
198
- return tinyMCEPopup.dom.getStyle(elm, style);
199
- }
1
+ /**
2
+ * $Id: form_utils.js 996 2009-02-06 17:32:20Z spocke $
3
+ *
4
+ * Various form utilitiy functions.
5
+ *
6
+ * @author Moxiecode
7
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
+ */
9
+
10
+ var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
11
+
12
+ function getColorPickerHTML(id, target_form_element) {
13
+ var h = "";
14
+
15
+ h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
16
+ h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>';
17
+
18
+ return h;
19
+ }
20
+
21
+ function updateColor(img_id, form_element_id) {
22
+ document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
23
+ }
24
+
25
+ function setBrowserDisabled(id, state) {
26
+ var img = document.getElementById(id);
27
+ var lnk = document.getElementById(id + "_link");
28
+
29
+ if (lnk) {
30
+ if (state) {
31
+ lnk.setAttribute("realhref", lnk.getAttribute("href"));
32
+ lnk.removeAttribute("href");
33
+ tinyMCEPopup.dom.addClass(img, 'disabled');
34
+ } else {
35
+ if (lnk.getAttribute("realhref"))
36
+ lnk.setAttribute("href", lnk.getAttribute("realhref"));
37
+
38
+ tinyMCEPopup.dom.removeClass(img, 'disabled');
39
+ }
40
+ }
41
+ }
42
+
43
+ function getBrowserHTML(id, target_form_element, type, prefix) {
44
+ var option = prefix + "_" + type + "_browser_callback", cb, html;
45
+
46
+ cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
47
+
48
+ if (!cb)
49
+ return "";
50
+
51
+ html = "";
52
+ html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
53
+ html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>';
54
+
55
+ return html;
56
+ }
57
+
58
+ function openBrowser(img_id, target_form_element, type, option) {
59
+ var img = document.getElementById(img_id);
60
+
61
+ if (img.className != "mceButtonDisabled")
62
+ tinyMCEPopup.openBrowser(target_form_element, type, option);
63
+ }
64
+
65
+ function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
66
+ if (!form_obj || !form_obj.elements[field_name])
67
+ return;
68
+
69
+ var sel = form_obj.elements[field_name];
70
+
71
+ var found = false;
72
+ for (var i=0; i<sel.options.length; i++) {
73
+ var option = sel.options[i];
74
+
75
+ if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
76
+ option.selected = true;
77
+ found = true;
78
+ } else
79
+ option.selected = false;
80
+ }
81
+
82
+ if (!found && add_custom && value != '') {
83
+ var option = new Option(value, value);
84
+ option.selected = true;
85
+ sel.options[sel.options.length] = option;
86
+ sel.selectedIndex = sel.options.length - 1;
87
+ }
88
+
89
+ return found;
90
+ }
91
+
92
+ function getSelectValue(form_obj, field_name) {
93
+ var elm = form_obj.elements[field_name];
94
+
95
+ if (elm == null || elm.options == null)
96
+ return "";
97
+
98
+ return elm.options[elm.selectedIndex].value;
99
+ }
100
+
101
+ function addSelectValue(form_obj, field_name, name, value) {
102
+ var s = form_obj.elements[field_name];
103
+ var o = new Option(name, value);
104
+ s.options[s.options.length] = o;
105
+ }
106
+
107
+ function addClassesToList(list_id, specific_option) {
108
+ // Setup class droplist
109
+ var styleSelectElm = document.getElementById(list_id);
110
+ var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
111
+ styles = tinyMCEPopup.getParam(specific_option, styles);
112
+
113
+ if (styles) {
114
+ var stylesAr = styles.split(';');
115
+
116
+ for (var i=0; i<stylesAr.length; i++) {
117
+ if (stylesAr != "") {
118
+ var key, value;
119
+
120
+ key = stylesAr[i].split('=')[0];
121
+ value = stylesAr[i].split('=')[1];
122
+
123
+ styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
124
+ }
125
+ }
126
+ } else {
127
+ tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
128
+ styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
129
+ });
130
+ }
131
+ }
132
+
133
+ function isVisible(element_id) {
134
+ var elm = document.getElementById(element_id);
135
+
136
+ return elm && elm.style.display != "none";
137
+ }
138
+
139
+ function convertRGBToHex(col) {
140
+ var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
141
+
142
+ var rgb = col.replace(re, "$1,$2,$3").split(',');
143
+ if (rgb.length == 3) {
144
+ r = parseInt(rgb[0]).toString(16);
145
+ g = parseInt(rgb[1]).toString(16);
146
+ b = parseInt(rgb[2]).toString(16);
147
+
148
+ r = r.length == 1 ? '0' + r : r;
149
+ g = g.length == 1 ? '0' + g : g;
150
+ b = b.length == 1 ? '0' + b : b;
151
+
152
+ return "#" + r + g + b;
153
+ }
154
+
155
+ return col;
156
+ }
157
+
158
+ function convertHexToRGB(col) {
159
+ if (col.indexOf('#') != -1) {
160
+ col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
161
+
162
+ r = parseInt(col.substring(0, 2), 16);
163
+ g = parseInt(col.substring(2, 4), 16);
164
+ b = parseInt(col.substring(4, 6), 16);
165
+
166
+ return "rgb(" + r + "," + g + "," + b + ")";
167
+ }
168
+
169
+ return col;
170
+ }
171
+
172
+ function trimSize(size) {
173
+ return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');
174
+ }
175
+
176
+ function getCSSSize(size) {
177
+ size = trimSize(size);
178
+
179
+ if (size == "")
180
+ return "";
181
+
182
+ // Add px
183
+ if (/^[0-9]+$/.test(size))
184
+ size += 'px';
185
+
186
+ return size;
187
+ }
188
+
189
+ function getStyle(elm, attrib, style) {
190
+ var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
191
+
192
+ if (val != '')
193
+ return '' + val;
194
+
195
+ if (typeof(style) == 'undefined')
196
+ style = attrib;
197
+
198
+ return tinyMCEPopup.dom.getStyle(elm, style);
199
+ }
utils/mctabs.js CHANGED
@@ -1,76 +1,76 @@
1
- /**
2
- * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $
3
- *
4
- * Moxiecode DHTML Tabs script.
5
- *
6
- * @author Moxiecode
7
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
- */
9
-
10
- function MCTabs() {
11
- this.settings = [];
12
- };
13
-
14
- MCTabs.prototype.init = function(settings) {
15
- this.settings = settings;
16
- };
17
-
18
- MCTabs.prototype.getParam = function(name, default_value) {
19
- var value = null;
20
-
21
- value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
22
-
23
- // Fix bool values
24
- if (value == "true" || value == "false")
25
- return (value == "true");
26
-
27
- return value;
28
- };
29
-
30
- MCTabs.prototype.displayTab = function(tab_id, panel_id) {
31
- var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i;
32
-
33
- panelElm= document.getElementById(panel_id);
34
- panelContainerElm = panelElm ? panelElm.parentNode : null;
35
- tabElm = document.getElementById(tab_id);
36
- tabContainerElm = tabElm ? tabElm.parentNode : null;
37
- selectionClass = this.getParam('selection_class', 'current');
38
-
39
- if (tabElm && tabContainerElm) {
40
- nodes = tabContainerElm.childNodes;
41
-
42
- // Hide all other tabs
43
- for (i = 0; i < nodes.length; i++) {
44
- if (nodes[i].nodeName == "LI")
45
- nodes[i].className = '';
46
- }
47
-
48
- // Show selected tab
49
- tabElm.className = 'current';
50
- }
51
-
52
- if (panelElm && panelContainerElm) {
53
- nodes = panelContainerElm.childNodes;
54
-
55
- // Hide all other panels
56
- for (i = 0; i < nodes.length; i++) {
57
- if (nodes[i].nodeName == "DIV")
58
- nodes[i].className = 'panel';
59
- }
60
-
61
- // Show selected panel
62
- panelElm.className = 'current';
63
- }
64
- };
65
-
66
- MCTabs.prototype.getAnchor = function() {
67
- var pos, url = document.location.href;
68
-
69
- if ((pos = url.lastIndexOf('#')) != -1)
70
- return url.substring(pos + 1);
71
-
72
- return "";
73
- };
74
-
75
- // Global instance
76
- var mcTabs = new MCTabs();
1
+ /**
2
+ * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $
3
+ *
4
+ * Moxiecode DHTML Tabs script.
5
+ *
6
+ * @author Moxiecode
7
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
+ */
9
+
10
+ function MCTabs() {
11
+ this.settings = [];
12
+ };
13
+
14
+ MCTabs.prototype.init = function(settings) {
15
+ this.settings = settings;
16
+ };
17
+
18
+ MCTabs.prototype.getParam = function(name, default_value) {
19
+ var value = null;
20
+
21
+ value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
22
+
23
+ // Fix bool values
24
+ if (value == "true" || value == "false")
25
+ return (value == "true");
26
+
27
+ return value;
28
+ };
29
+
30
+ MCTabs.prototype.displayTab = function(tab_id, panel_id) {
31
+ var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i;
32
+
33
+ panelElm= document.getElementById(panel_id);
34
+ panelContainerElm = panelElm ? panelElm.parentNode : null;
35
+ tabElm = document.getElementById(tab_id);
36
+ tabContainerElm = tabElm ? tabElm.parentNode : null;
37
+ selectionClass = this.getParam('selection_class', 'current');
38
+
39
+ if (tabElm && tabContainerElm) {
40
+ nodes = tabContainerElm.childNodes;
41
+
42
+ // Hide all other tabs
43
+ for (i = 0; i < nodes.length; i++) {
44
+ if (nodes[i].nodeName == "LI")
45
+ nodes[i].className = '';
46
+ }
47
+
48
+ // Show selected tab
49
+ tabElm.className = 'current';
50
+ }
51
+
52
+ if (panelElm && panelContainerElm) {
53
+ nodes = panelContainerElm.childNodes;
54
+
55
+ // Hide all other panels
56
+ for (i = 0; i < nodes.length; i++) {
57
+ if (nodes[i].nodeName == "DIV")
58
+ nodes[i].className = 'panel';
59
+ }
60
+
61
+ // Show selected panel
62
+ panelElm.className = 'current';
63
+ }
64
+ };
65
+
66
+ MCTabs.prototype.getAnchor = function() {
67
+ var pos, url = document.location.href;
68
+
69
+ if ((pos = url.lastIndexOf('#')) != -1)
70
+ return url.substring(pos + 1);
71
+
72
+ return "";
73
+ };
74
+
75
+ // Global instance
76
+ var mcTabs = new MCTabs();
utils/validate.js CHANGED
@@ -1,219 +1,219 @@
1
- /**
2
- * $Id: validate.js 758 2008-03-30 13:53:29Z spocke $
3
- *
4
- * Various form validation methods.
5
- *
6
- * @author Moxiecode
7
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
- */
9
-
10
- /**
11
- // String validation:
12
-
13
- if (!Validator.isEmail('myemail'))
14
- alert('Invalid email.');
15
-
16
- // Form validation:
17
-
18
- var f = document.forms['myform'];
19
-
20
- if (!Validator.isEmail(f.myemail))
21
- alert('Invalid email.');
22
- */
23
-
24
- var Validator = {
25
- isEmail : function(s) {
26
- return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
27
- },
28
-
29
- isAbsUrl : function(s) {
30
- return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
31
- },
32
-
33
- isSize : function(s) {
34
- return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
35
- },
36
-
37
- isId : function(s) {
38
- return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
39
- },
40
-
41
- isEmpty : function(s) {
42
- var nl, i;
43
-
44
- if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
45
- return true;
46
-
47
- if (s.type == 'checkbox' && !s.checked)
48
- return true;
49
-
50
- if (s.type == 'radio') {
51
- for (i=0, nl = s.form.elements; i<nl.length; i++) {
52
- if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
53
- return false;
54
- }
55
-
56
- return true;
57
- }
58
-
59
- return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
60
- },
61
-
62
- isNumber : function(s, d) {
63
- return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
64
- },
65
-
66
- test : function(s, p) {
67
- s = s.nodeType == 1 ? s.value : s;
68
-
69
- return s == '' || new RegExp(p).test(s);
70
- }
71
- };
72
-
73
- var AutoValidator = {
74
- settings : {
75
- id_cls : 'id',
76
- int_cls : 'int',
77
- url_cls : 'url',
78
- number_cls : 'number',
79
- email_cls : 'email',
80
- size_cls : 'size',
81
- required_cls : 'required',
82
- invalid_cls : 'invalid',
83
- min_cls : 'min',
84
- max_cls : 'max'
85
- },
86
-
87
- init : function(s) {
88
- var n;
89
-
90
- for (n in s)
91
- this.settings[n] = s[n];
92
- },
93
-
94
- validate : function(f) {
95
- var i, nl, s = this.settings, c = 0;
96
-
97
- nl = this.tags(f, 'label');
98
- for (i=0; i<nl.length; i++)
99
- this.removeClass(nl[i], s.invalid_cls);
100
-
101
- c += this.validateElms(f, 'input');
102
- c += this.validateElms(f, 'select');
103
- c += this.validateElms(f, 'textarea');
104
-
105
- return c == 3;
106
- },
107
-
108
- invalidate : function(n) {
109
- this.mark(n.form, n);
110
- },
111
-
112
- reset : function(e) {
113
- var t = ['label', 'input', 'select', 'textarea'];
114
- var i, j, nl, s = this.settings;
115
-
116
- if (e == null)
117
- return;
118
-
119
- for (i=0; i<t.length; i++) {
120
- nl = this.tags(e.form ? e.form : e, t[i]);
121
- for (j=0; j<nl.length; j++)
122
- this.removeClass(nl[j], s.invalid_cls);
123
- }
124
- },
125
-
126
- validateElms : function(f, e) {
127
- var nl, i, n, s = this.settings, st = true, va = Validator, v;
128
-
129
- nl = this.tags(f, e);
130
- for (i=0; i<nl.length; i++) {
131
- n = nl[i];
132
-
133
- this.removeClass(n, s.invalid_cls);
134
-
135
- if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
136
- st = this.mark(f, n);
137
-
138
- if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
139
- st = this.mark(f, n);
140
-
141
- if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
142
- st = this.mark(f, n);
143
-
144
- if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
145
- st = this.mark(f, n);
146
-
147
- if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
148
- st = this.mark(f, n);
149
-
150
- if (this.hasClass(n, s.size_cls) && !va.isSize(n))
151
- st = this.mark(f, n);
152
-
153
- if (this.hasClass(n, s.id_cls) && !va.isId(n))
154
- st = this.mark(f, n);
155
-
156
- if (this.hasClass(n, s.min_cls, true)) {
157
- v = this.getNum(n, s.min_cls);
158
-
159
- if (isNaN(v) || parseInt(n.value) < parseInt(v))
160
- st = this.mark(f, n);
161
- }
162
-
163
- if (this.hasClass(n, s.max_cls, true)) {
164
- v = this.getNum(n, s.max_cls);
165
-
166
- if (isNaN(v) || parseInt(n.value) > parseInt(v))
167
- st = this.mark(f, n);
168
- }
169
- }
170
-
171
- return st;
172
- },
173
-
174
- hasClass : function(n, c, d) {
175
- return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
176
- },
177
-
178
- getNum : function(n, c) {
179
- c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
180
- c = c.replace(/[^0-9]/g, '');
181
-
182
- return c;
183
- },
184
-
185
- addClass : function(n, c, b) {
186
- var o = this.removeClass(n, c);
187
- n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
188
- },
189
-
190
- removeClass : function(n, c) {
191
- c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
192
- return n.className = c != ' ' ? c : '';
193
- },
194
-
195
- tags : function(f, s) {
196
- return f.getElementsByTagName(s);
197
- },
198
-
199
- mark : function(f, n) {
200
- var s = this.settings;
201
-
202
- this.addClass(n, s.invalid_cls);
203
- this.markLabels(f, n, s.invalid_cls);
204
-
205
- return false;
206
- },
207
-
208
- markLabels : function(f, n, ic) {
209
- var nl, i;
210
-
211
- nl = this.tags(f, "label");
212
- for (i=0; i<nl.length; i++) {
213
- if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
214
- this.addClass(nl[i], ic);
215
- }
216
-
217
- return null;
218
- }
219
- };
1
+ /**
2
+ * $Id: validate.js 758 2008-03-30 13:53:29Z spocke $
3
+ *
4
+ * Various form validation methods.
5
+ *
6
+ * @author Moxiecode
7
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
+ */
9
+
10
+ /**
11
+ // String validation:
12
+
13
+ if (!Validator.isEmail('myemail'))
14
+ alert('Invalid email.');
15
+
16
+ // Form validation:
17
+
18
+ var f = document.forms['myform'];
19
+
20
+ if (!Validator.isEmail(f.myemail))
21
+ alert('Invalid email.');
22
+ */
23
+
24
+ var Validator = {
25
+ isEmail : function(s) {
26
+ return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
27
+ },
28
+
29
+ isAbsUrl : function(s) {
30
+ return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
31
+ },
32
+
33
+ isSize : function(s) {
34
+ return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
35
+ },
36
+
37
+ isId : function(s) {
38
+ return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
39
+ },
40
+
41
+ isEmpty : function(s) {
42
+ var nl, i;
43
+
44
+ if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
45
+ return true;
46
+
47
+ if (s.type == 'checkbox' && !s.checked)
48
+ return true;
49
+
50
+ if (s.type == 'radio') {
51
+ for (i=0, nl = s.form.elements; i<nl.length; i++) {
52
+ if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
53
+ return false;
54
+ }
55
+
56
+ return true;
57
+ }
58
+
59
+ return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
60
+ },
61
+
62
+ isNumber : function(s, d) {
63
+ return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
64
+ },
65
+
66
+ test : function(s, p) {
67
+ s = s.nodeType == 1 ? s.value : s;
68
+
69
+ return s == '' || new RegExp(p).test(s);
70
+ }
71
+ };
72
+
73
+ var AutoValidator = {
74
+ settings : {
75
+ id_cls : 'id',
76
+ int_cls : 'int',
77
+ url_cls : 'url',
78
+ number_cls : 'number',
79
+ email_cls : 'email',
80
+ size_cls : 'size',
81
+ required_cls : 'required',
82
+ invalid_cls : 'invalid',
83
+ min_cls : 'min',
84
+ max_cls : 'max'
85
+ },
86
+
87
+ init : function(s) {
88
+ var n;
89
+
90
+ for (n in s)
91
+ this.settings[n] = s[n];
92
+ },
93
+
94
+ validate : function(f) {
95
+ var i, nl, s = this.settings, c = 0;
96
+
97
+ nl = this.tags(f, 'label');
98
+ for (i=0; i<nl.length; i++)
99
+ this.removeClass(nl[i], s.invalid_cls);
100
+
101
+ c += this.validateElms(f, 'input');
102
+ c += this.validateElms(f, 'select');
103
+ c += this.validateElms(f, 'textarea');
104
+
105
+ return c == 3;
106
+ },
107
+
108
+ invalidate : function(n) {
109
+ this.mark(n.form, n);
110
+ },
111
+
112
+ reset : function(e) {
113
+ var t = ['label', 'input', 'select', 'textarea'];
114
+ var i, j, nl, s = this.settings;
115
+
116
+ if (e == null)
117
+ return;
118
+
119
+ for (i=0; i<t.length; i++) {
120
+ nl = this.tags(e.form ? e.form : e, t[i]);
121
+ for (j=0; j<nl.length; j++)
122
+ this.removeClass(nl[j], s.invalid_cls);
123
+ }
124
+ },
125
+
126
+ validateElms : function(f, e) {
127
+ var nl, i, n, s = this.settings, st = true, va = Validator, v;
128
+
129
+ nl = this.tags(f, e);
130
+ for (i=0; i<nl.length; i++) {
131
+ n = nl[i];
132
+
133
+ this.removeClass(n, s.invalid_cls);
134
+
135
+ if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
136
+ st = this.mark(f, n);
137
+
138
+ if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
139
+ st = this.mark(f, n);
140
+
141
+ if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
142
+ st = this.mark(f, n);
143
+
144
+ if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
145
+ st = this.mark(f, n);
146
+
147
+ if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
148
+ st = this.mark(f, n);
149
+
150
+ if (this.hasClass(n, s.size_cls) && !va.isSize(n))
151
+ st = this.mark(f, n);
152
+
153
+ if (this.hasClass(n, s.id_cls) && !va.isId(n))
154
+ st = this.mark(f, n);
155
+
156
+ if (this.hasClass(n, s.min_cls, true)) {
157
+ v = this.getNum(n, s.min_cls);
158
+
159
+ if (isNaN(v) || parseInt(n.value) < parseInt(v))
160
+ st = this.mark(f, n);
161
+ }
162
+
163
+ if (this.hasClass(n, s.max_cls, true)) {
164
+ v = this.getNum(n, s.max_cls);
165
+
166
+ if (isNaN(v) || parseInt(n.value) > parseInt(v))
167
+ st = this.mark(f, n);
168
+ }
169
+ }
170
+
171
+ return st;
172
+ },
173
+
174
+ hasClass : function(n, c, d) {
175
+ return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
176
+ },
177
+
178
+ getNum : function(n, c) {
179
+ c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
180
+ c = c.replace(/[^0-9]/g, '');
181
+
182
+ return c;
183
+ },
184
+
185
+ addClass : function(n, c, b) {
186
+ var o = this.removeClass(n, c);
187
+ n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
188
+ },
189
+
190
+ removeClass : function(n, c) {
191
+ c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
192
+ return n.className = c != ' ' ? c : '';
193
+ },
194
+
195
+ tags : function(f, s) {
196
+ return f.getElementsByTagName(s);
197
+ },
198
+
199
+ mark : function(f, n) {
200
+ var s = this.settings;
201
+
202
+ this.addClass(n, s.invalid_cls);
203
+ this.markLabels(f, n, s.invalid_cls);
204
+
205
+ return false;
206
+ },
207
+
208
+ markLabels : function(f, n, ic) {
209
+ var nl, i;
210
+
211
+ nl = this.tags(f, "label");
212
+ for (i=0; i<nl.length; i++) {
213
+ if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
214
+ this.addClass(nl[i], ic);
215
+ }
216
+
217
+ return null;
218
+ }
219
+ };