TinyMCE Advanced - Version 3.0.1

Version Description

Download this release

Release Info

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

Code changes from version 3.0 to 3.0.1

css/tadv-styles.css CHANGED
@@ -20,7 +20,7 @@ line-height: 28px;
20
  padding: 0 3px 1px 8px;
21
  }
22
  form#tadvadmin {
23
- margin-left: 20px;
24
  }
25
  #tadvadmin p {
26
  margin: 6px 0;
20
  padding: 0 3px 1px 8px;
21
  }
22
  form#tadvadmin {
23
+ margin-left: 17px;
24
  }
25
  #tadvadmin p {
26
  margin: 6px 0;
images/blockquote.gif ADDED
Binary file
images/cite.gif CHANGED
Binary file
js/tadv_replace.js ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ( 'undefined' != typeof tb ) {
23
+ btn1 = document.createElement('input');
24
+ btn1.type = 'button';
25
+ btn1.value = 'autop';
26
+ btn1.className = 'ed_button';
27
+ btn1.title = 'autop';
28
+ btn1.id = 'ed_autop';
29
+ btn1.onclick = function(){tadvReplace.btn_autop();};
30
+ tb.appendChild(btn1);
31
+
32
+ btn2 = document.createElement('input');
33
+ btn2.type = 'button';
34
+ btn2.value = 'undo';
35
+ btn2.className = 'ed_button';
36
+ btn2.title = 'undo';
37
+ btn2.id = 'ed_undo';
38
+ btn2.style.color = '#888';
39
+ btn2.onclick = function(){tadvReplace.btn_undo();};
40
+ tb.appendChild(btn2);
41
+ }
42
+
43
+ if ( c.value == '<br />\n' ) c.value = '';
44
+ },
45
+
46
+ pre_format : function(c) {
47
+
48
+ c = c.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
49
+ a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
50
+ return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
51
+ });
52
+
53
+ c = c.replace(/<p>(\s|<br \/>|\u00a0)*<\/p>/g, '');
54
+ c = c.replace(/\[\/sourcecode\]\s*<br \/>\s*<br \/>/g, '[/sourcecode]\n');
55
+ c = c.replace(/<p( [^>]*)?>/g, '\n<p$1>');
56
+ c = c.replace(/<\/p>/g, '</p>\n');
57
+ c = c.replace(/<\/p>\s*<p/g, '</p>\n\n<p');
58
+ c = c.replace(/<((blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])[^>]*)>\s*<p/g, '<$1><p');
59
+ c = c.replace(/<\/p>\s*<\/(blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])>/g, '</p></$1>');
60
+ c = c.replace(/<br ?\/?>[\r\n]*/g, '<br />\n');
61
+ c = c.replace(/<li([^>]*)>/g, '\t<li$1>');
62
+
63
+ c = c.replace(/<object[\s\S]+?<\/object>/g, function(a) {
64
+ return a.replace(/[\r\n]*/g, '');
65
+ });
66
+
67
+ return tinymce.trim(c);
68
+ },
69
+
70
+ cache : '',
71
+
72
+ btn_undo : function() {
73
+ var t = this, btn_undo = document.getElementById('ed_undo');
74
+
75
+ if ( t.cache ) document.getElementById('content').value = t.cache;
76
+ btn_undo.style.color = '#888';
77
+ },
78
+
79
+ btn_autop : function() {
80
+ var c = document.getElementById('content'), t = this, sel, btn_undo = document.getElementById('ed_undo'), autop = switchEditors.tadv_wpautop;
81
+ t.cache = c.value;
82
+
83
+ if ( document.selection ) { //ie
84
+ c.focus();
85
+ sel = document.selection.createRange();
86
+ if ( sel.text.length > 0 )
87
+ sel.text = autop(sel.text);
88
+ else c.value = autop(c.value);
89
+
90
+ } else if ( c.selectionEnd > 0 && c.selectionStart != c.selectionEnd ) { //ff
91
+ var startPos = c.selectionStart, endPos = c.selectionEnd, scrollTop = c.scrollTop;
92
+
93
+ c.value = c.value.substring(0, startPos)
94
+ + autop(c.value.substring(startPos, endPos))
95
+ + c.value.substring(endPos, c.value.length);
96
+ c.scrollTop = scrollTop;
97
+ } else
98
+ c.value = autop(c.value);
99
+
100
+ c.focus();
101
+
102
+ btn_undo.style.color = '#000';
103
+ },
104
+
105
+ noautop : function(c) {return c;}
106
+ }
107
+
108
+ addLoadEvent(function(){tadvReplace.init();});
mce/advhr/rule.htm CHANGED
@@ -2,11 +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"></script>
6
- <script type="text/javascript" src="js/rule.js"></script>
7
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
8
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
9
- <link href="css/advhr.css" rel="stylesheet" type="text/css" />
10
  <base target="_self" />
11
  </head>
12
  <body>
@@ -51,11 +51,11 @@
51
 
52
  <div class="mceActionPanel">
53
  <div style="float: left">
54
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
55
  </div>
56
 
57
  <div style="float: right">
58
- <input type="submit" id="insert" name="insert" value="{#insert}" />
59
  </div>
60
  </div>
61
  </form>
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?v=307"></script>
6
+ <script type="text/javascript" src="js/rule.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
9
+ <link href="css/advhr.css?v=307" rel="stylesheet" type="text/css" />
10
  <base target="_self" />
11
  </head>
12
  <body>
51
 
52
  <div class="mceActionPanel">
53
  <div style="float: left">
54
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
55
  </div>
56
 
57
  <div style="float: right">
58
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
59
  </div>
60
  </div>
61
  </form>
mce/advimage/image.htm CHANGED
@@ -2,13 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/validate.js"></script>
9
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
10
- <script type="text/javascript" src="js/image.js"></script>
11
- <link href="css/advimage.css" rel="stylesheet" type="text/css" />
12
  <base target="_self" />
13
  </head>
14
  <body id="advimage" style="display: none">
@@ -226,11 +226,11 @@
226
 
227
  <div class="mceActionPanel">
228
  <div style="float: left">
229
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
230
  </div>
231
 
232
  <div style="float: right">
233
- <input type="submit" id="insert" name="insert" value="{#insert}" />
234
  </div>
235
  </div>
236
  </form>
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js?v=307"></script>
9
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
10
+ <script type="text/javascript" src="js/image.js?v=307"></script>
11
+ <link href="css/advimage.css?v=307" rel="stylesheet" type="text/css" />
12
  <base target="_self" />
13
  </head>
14
  <body id="advimage" style="display: none">
226
 
227
  <div class="mceActionPanel">
228
  <div style="float: left">
229
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
230
  </div>
231
 
232
  <div style="float: right">
233
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
234
  </div>
235
  </div>
236
  </form>
mce/advlink/js/advlink.js CHANGED
@@ -235,7 +235,7 @@ function parseLink(link) {
235
  regExp += "\\);?";
236
 
237
  // Build variable array
238
- var variables = new Array();
239
  variables["_function"] = fnName;
240
  var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
241
  for (var i=0; i<variableNames.length; i++)
@@ -249,7 +249,7 @@ function parseLink(link) {
249
 
250
  function parseOptions(opts) {
251
  if (opts == null || opts == "")
252
- return new Array();
253
 
254
  // Cleanup the options
255
  opts = opts.toLowerCase();
@@ -405,44 +405,19 @@ function insertAction() {
405
  tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
406
 
407
  elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
408
- for (i=0; i<elementArray.length; i++) {
409
- elm = elementArray[i];
410
-
411
- // Move cursor to end
412
- try {
413
- tinyMCEPopup.editor.selection.collapse(false);
414
- } catch (ex) {
415
- // Ignore
416
- }
417
-
418
- // Move cursor behind the new anchor
419
- // Don't remember why this was needed so it's now removed
420
- /*
421
- if (tinyMCE.isGecko) {
422
- var sp = inst.getDoc().createTextNode(" ");
423
-
424
- if (elm.nextSibling)
425
- elm.parentNode.insertBefore(sp, elm.nextSibling);
426
- else
427
- elm.parentNode.appendChild(sp);
428
-
429
- // Set range after link
430
- var rng = inst.getDoc().createRange();
431
- rng.setStartAfter(elm);
432
- rng.setEndAfter(elm);
433
-
434
- // Update selection
435
- var sel = inst.getSel();
436
- sel.removeAllRanges();
437
- sel.addRange(rng);
438
- }
439
- */
440
-
441
- setAllAttribs(elm);
442
- }
443
  } else
444
  setAllAttribs(elm);
445
 
 
 
 
 
 
 
 
 
446
  tinyMCEPopup.execCommand("mceEndUndoLevel");
447
  tinyMCEPopup.close();
448
  }
235
  regExp += "\\);?";
236
 
237
  // Build variable array
238
+ var variables = [];
239
  variables["_function"] = fnName;
240
  var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
241
  for (var i=0; i<variableNames.length; i++)
249
 
250
  function parseOptions(opts) {
251
  if (opts == null || opts == "")
252
+ return [];
253
 
254
  // Cleanup the options
255
  opts = opts.toLowerCase();
405
  tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
406
 
407
  elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
408
+ for (i=0; i<elementArray.length; i++)
409
+ setAllAttribs(elm = elementArray[i]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
  } else
411
  setAllAttribs(elm);
412
 
413
+ // Don't move caret if selection was image
414
+ if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {
415
+ inst.focus();
416
+ inst.selection.select(elm);
417
+ inst.selection.collapse(0);
418
+ tinyMCEPopup.storeSelection();
419
+ }
420
+
421
  tinyMCEPopup.execCommand("mceEndUndoLevel");
422
  tinyMCEPopup.close();
423
  }
mce/advlink/link.htm CHANGED
@@ -2,12 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/validate.js"></script>
9
- <script type="text/javascript" src="js/advlink.js"></script>
10
- <link href="css/advlink.css" rel="stylesheet" type="text/css" />
11
  <base target="_self" />
12
  </head>
13
  <body id="advlink" style="display: none">
@@ -327,11 +327,11 @@
327
 
328
  <div class="mceActionPanel">
329
  <div style="float: left">
330
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
331
  </div>
332
 
333
  <div style="float: right">
334
- <input type="submit" id="insert" name="insert" value="{#insert}" />
335
  </div>
336
  </div>
337
  </form>
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js?v=307"></script>
9
+ <script type="text/javascript" src="js/advlink.js?v=307"></script>
10
+ <link href="css/advlink.css?v=307" rel="stylesheet" type="text/css" />
11
  <base target="_self" />
12
  </head>
13
  <body id="advlink" style="display: none">
327
 
328
  <div class="mceActionPanel">
329
  <div style="float: left">
330
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
331
  </div>
332
 
333
  <div style="float: right">
334
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
335
  </div>
336
  </div>
337
  </form>
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.cancel(e);}});function hide(){if(t._menu){t._menu.removeAll();t._menu.destroy();}};ed.onMouseDown.add(hide);ed.onKeyDown.add(hide);Event.add(document,'click',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,offset_y:p1.y,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 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(document,'click',hide);Event.cancel(e);}});function hide(){if(t._menu){t._menu.removeAll();t._menu.destroy();Event.remove(document,'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,offset_y:p1.y,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);})();
mce/emotions/emotions.htm CHANGED
@@ -2,7 +2,7 @@
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title>{#emotions.emotions_desc}</title>
5
- <script type="text/javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
  <script type="text/javascript" type="text/javascript">
7
  var EmotionsDialog = {
8
  init : function(ed) {
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title>{#emotions.emotions_desc}</title>
5
+ <script type="text/javascript" type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
6
  <script type="text/javascript" type="text/javascript">
7
  var EmotionsDialog = {
8
  init : function(ed) {
mce/searchreplace/searchreplace.htm CHANGED
@@ -2,11 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="js/searchreplace.js"></script>
9
- <link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
10
  <base target="_self" />
11
  </head>
12
  <body style="display:none;">
@@ -92,8 +92,8 @@
92
  <div class="mceActionPanel">
93
  <div style="float: left">
94
  <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
95
- <input type="button" class="mceButton" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
96
- <input type="button" class="mceButton" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
97
  </div>
98
 
99
  <div style="float: right">
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="js/searchreplace.js?v=307"></script>
9
+ <link rel="stylesheet" type="text/css" href="css/searchreplace.css?v=307" />
10
  <base target="_self" />
11
  </head>
12
  <body style="display:none;">
92
  <div class="mceActionPanel">
93
  <div style="float: left">
94
  <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
95
+ <input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
96
+ <input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
97
  </div>
98
 
99
  <div style="float: right">
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.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(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);})();
mce/style/js/props.js CHANGED
@@ -223,12 +223,12 @@ function setupFormData() {
223
  f.positioning_height.value = getNum(ce.style.height);
224
  selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
225
 
226
- setupBox(f, ce, 'positioning_placement', '', '', new Array('top', 'right', 'bottom', 'left'));
227
 
228
  s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
229
  s = s.replace(/,/g, ' ');
230
 
231
- if (!hasEqualValues(new Array(getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)))) {
232
  f.positioning_clip_top.value = getNum(getVal(s, 0));
233
  selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
234
  f.positioning_clip_right.value = getNum(getVal(s, 1));
@@ -279,7 +279,7 @@ function setValue(f, n, v) {
279
 
280
  function setupBox(f, ce, fp, pr, sf, b) {
281
  if (typeof(b) == "undefined")
282
- b = new Array('Top', 'Right', 'Bottom', 'Left');
283
 
284
  if (isSame(ce, pr, sf, b)) {
285
  f.elements[fp + "_same"].checked = true;
@@ -328,10 +328,10 @@ function setupBox(f, ce, fp, pr, sf, b) {
328
  }
329
 
330
  function isSame(e, pr, sf, b) {
331
- var a = new Array(), i, x;
332
 
333
  if (typeof(b) == "undefined")
334
- b = new Array('Top', 'Right', 'Bottom', 'Left');
335
 
336
  if (typeof(sf) == "undefined" || sf == null)
337
  sf = "";
223
  f.positioning_height.value = getNum(ce.style.height);
224
  selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
225
 
226
+ setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']);
227
 
228
  s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
229
  s = s.replace(/,/g, ' ');
230
 
231
+ if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) {
232
  f.positioning_clip_top.value = getNum(getVal(s, 0));
233
  selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
234
  f.positioning_clip_right.value = getNum(getVal(s, 1));
279
 
280
  function setupBox(f, ce, fp, pr, sf, b) {
281
  if (typeof(b) == "undefined")
282
+ b = ['Top', 'Right', 'Bottom', 'Left'];
283
 
284
  if (isSame(ce, pr, sf, b)) {
285
  f.elements[fp + "_same"].checked = true;
328
  }
329
 
330
  function isSame(e, pr, sf, b) {
331
+ var a = [], i, x;
332
 
333
  if (typeof(b) == "undefined")
334
+ b = ['Top', 'Right', 'Bottom', 'Left'];
335
 
336
  if (typeof(sf) == "undefined" || sf == null)
337
  sf = "";
mce/style/props.htm CHANGED
@@ -2,12 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
8
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
9
- <script type="text/javascript" src="js/props.js"></script>
10
- <link href="css/props.css" rel="stylesheet" type="text/css" />
11
  <base target="_self" />
12
  </head>
13
 
@@ -711,14 +711,14 @@
711
 
712
  <div class="mceActionPanel">
713
  <div style="float: left">
714
- <div style="float: left"><input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" /></div>
715
 
716
  <div style="float: left">&nbsp;<input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" /></div>
717
  <br style="clear: both" />
718
  </div>
719
 
720
  <div style="float: right">
721
- <input type="submit" id="insert" name="insert" value="{#update}" />
722
  </div>
723
  </div>
724
  </form>
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
9
+ <script type="text/javascript" src="js/props.js?v=307"></script>
10
+ <link href="css/props.css?v=307" rel="stylesheet" type="text/css" />
11
  <base target="_self" />
12
  </head>
13
 
711
 
712
  <div class="mceActionPanel">
713
  <div style="float: left">
714
+ <div style="float: left"><input type="submit" id="insert" name="insert" value="{#update}" /></div>
715
 
716
  <div style="float: left">&nbsp;<input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" /></div>
717
  <br style="clear: both" />
718
  </div>
719
 
720
  <div style="float: right">
721
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
722
  </div>
723
  </div>
724
  </form>
mce/table/cell.htm CHANGED
@@ -2,12 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
- <script type="text/javascript" src="js/cell.js"></script>
10
- <link href="css/cell.css" rel="stylesheet" type="text/css" />
11
  <base target="_self" />
12
  </head>
13
  <body id="tablecell" style="display: none">
@@ -172,11 +172,11 @@
172
  </div>
173
 
174
  <div style="float: left">
175
- <div><input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /></div>
176
  </div>
177
 
178
  <div style="float: right">
179
- <input type="submit" id="insert" name="insert" value="{#update}" />
180
  </div>
181
  </div>
182
  </form>
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
9
+ <script type="text/javascript" src="js/cell.js?v=307"></script>
10
+ <link href="css/cell.css?v=307" rel="stylesheet" type="text/css" />
11
  <base target="_self" />
12
  </head>
13
  <body id="tablecell" style="display: none">
172
  </div>
173
 
174
  <div style="float: left">
175
+ <div><input type="submit" id="insert" name="insert" value="{#update}" /></div>
176
  </div>
177
 
178
  <div style="float: right">
179
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
180
  </div>
181
  </div>
182
  </form>
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]});});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});});}});if(tinymce.isGecko){ed.onKeyPress.add(function(ed,e){var n;if(e.keyCode==46){n=ed.dom.getParent(ed.selection.getNode(),'TD,TH');if(n&&(!n.hasChildNodes()||(n.childNodes.length==1&&n.firstChild.nodeName=='BR')))tinymce.dom.Event.cancel(e);}});}ed.onKeyDown.add(function(ed,e){if(e.keyCode==9&&ed.dom.getParent(ed.selection.getNode(),'TABLE'))ed.undoManager.add();});ed.onNodeChange.add(function(ed,cm,n){var p=ed.dom.getParent(n,'td,th,caption');cm.setActive('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);});},execCommand:function(cmd,ui,val){var ed=this.editor,b;switch(cmd){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 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"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){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(tableElm);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(tableElm);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){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")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 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]});});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'))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"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 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"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){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(tableElm);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(tableElm);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){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);})();
mce/table/merge_cells.htm CHANGED
@@ -2,10 +2,10 @@
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title>{#table_dlg.merge_cells_title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/validate.js"></script>
8
- <script type="text/javascript" src="js/merge_cells.js"></script>
9
  <base target="_self" />
10
  </head>
11
  <body style="margin: 8px" style="display: none">
@@ -26,11 +26,11 @@
26
 
27
  <div class="mceActionPanel">
28
  <div style="float: left">
29
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
30
  </div>
31
 
32
  <div style="float: right">
33
- <input type="submit" id="insert" name="insert" value="{#update}" />
34
  </div>
35
  </div>
36
  </form>
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/validate.js?v=307"></script>
8
+ <script type="text/javascript" src="js/merge_cells.js?v=307"></script>
9
  <base target="_self" />
10
  </head>
11
  <body style="margin: 8px" style="display: none">
26
 
27
  <div class="mceActionPanel">
28
  <div style="float: left">
29
+ <input type="submit" id="insert" name="insert" value="{#update}" />
30
  </div>
31
 
32
  <div style="float: right">
33
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
34
  </div>
35
  </div>
36
  </form>
mce/table/row.htm CHANGED
@@ -2,12 +2,12 @@
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title>{#table_dlg.row_title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
- <script type="text/javascript" src="js/row.js"></script>
10
- <link href="css/row.css" rel="stylesheet" type="text/css" />
11
  <base target="_self" />
12
  </head>
13
  <body id="tablerow" style="display: none">
@@ -149,11 +149,11 @@
149
  </div>
150
 
151
  <div style="float: left">
152
- <div><input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /></div>
153
  </div>
154
 
155
  <div style="float: right">
156
- <input type="submit" id="insert" name="insert" value="{#update}" />
157
  </div>
158
  </div>
159
  </form>
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
9
+ <script type="text/javascript" src="js/row.js?v=307"></script>
10
+ <link href="css/row.css?v=307" rel="stylesheet" type="text/css" />
11
  <base target="_self" />
12
  </head>
13
  <body id="tablerow" style="display: none">
149
  </div>
150
 
151
  <div style="float: left">
152
+ <div><input type="submit" id="insert" name="insert" value="{#update}" /></div>
153
  </div>
154
 
155
  <div style="float: right">
156
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
157
  </div>
158
  </div>
159
  </form>
mce/table/table.htm CHANGED
@@ -2,13 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/validate.js"></script>
9
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
10
- <script type="text/javascript" src="js/table.js"></script>
11
- <link href="css/table.css" rel="stylesheet" type="text/css" />
12
  <base target="_self" />
13
  </head>
14
  <body id="table" style="display: none">
@@ -181,11 +181,11 @@
181
 
182
  <div class="mceActionPanel">
183
  <div style="float: left">
184
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
185
  </div>
186
 
187
  <div style="float: right">
188
- <input type="submit" id="insert" name="insert" value="{#insert}" />
189
  </div>
190
  </div>
191
  </form>
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js?v=307"></script>
9
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
10
+ <script type="text/javascript" src="js/table.js?v=307"></script>
11
+ <link href="css/table.css?v=307" rel="stylesheet" type="text/css" />
12
  <base target="_self" />
13
  </head>
14
  <body id="table" style="display: none">
181
 
182
  <div class="mceActionPanel">
183
  <div style="float: left">
184
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
185
  </div>
186
 
187
  <div style="float: right">
188
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
189
  </div>
190
  </div>
191
  </form>
mce/xhtmlxtras/abbr.htm CHANGED
@@ -2,13 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
- <script type="text/javascript" src="js/element_common.js"></script>
10
- <script type="text/javascript" src="js/abbr.js"></script>
11
- <link rel="stylesheet" type="text/css" href="css/popup.css" />
12
  <base target="_self" />
13
  </head>
14
  <body style="display: none">
@@ -134,13 +134,13 @@
134
  </div>
135
  <div class="mceActionPanel">
136
  <div style="float: left">
137
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
138
  </div>
139
  <div style="float: left">
140
  <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" />
141
  </div>
142
  <div style="float: right">
143
- <input type="submit" id="insert" name="insert" value="{#update}" />
144
  </div>
145
  </div>
146
 
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
9
+ <script type="text/javascript" src="js/element_common.js?v=307"></script>
10
+ <script type="text/javascript" src="js/abbr.js?v=307"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?v=307" />
12
  <base target="_self" />
13
  </head>
14
  <body style="display: none">
134
  </div>
135
  <div class="mceActionPanel">
136
  <div style="float: left">
137
+ <input type="submit" id="insert" name="insert" value="{#update}" />
138
  </div>
139
  <div style="float: left">
140
  <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" />
141
  </div>
142
  <div style="float: right">
143
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144
  </div>
145
  </div>
146
 
mce/xhtmlxtras/acronym.htm CHANGED
@@ -2,13 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
- <script type="text/javascript" src="js/element_common.js"></script>
10
- <script type="text/javascript" src="js/acronym.js"></script>
11
- <link rel="stylesheet" type="text/css" href="css/popup.css" />
12
  <base target="_self" />
13
  </head>
14
  <body style="display: none">
@@ -134,13 +134,13 @@
134
  </div>
135
  <div class="mceActionPanel">
136
  <div style="float: left">
137
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
138
  </div>
139
  <div style="float: left">
140
  <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" />
141
  </div>
142
  <div style="float: right">
143
- <input type="submit" id="insert" name="insert" value="{#update}" />
144
  </div>
145
  </div>
146
 
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
9
+ <script type="text/javascript" src="js/element_common.js?v=307"></script>
10
+ <script type="text/javascript" src="js/acronym.js?v=307"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?v=307" />
12
  <base target="_self" />
13
  </head>
14
  <body style="display: none">
134
  </div>
135
  <div class="mceActionPanel">
136
  <div style="float: left">
137
+ <input type="submit" id="insert" name="insert" value="{#update}" />
138
  </div>
139
  <div style="float: left">
140
  <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" />
141
  </div>
142
  <div style="float: right">
143
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144
  </div>
145
  </div>
146
 
mce/xhtmlxtras/attributes.htm CHANGED
@@ -2,12 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
8
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
9
- <script type="text/javascript" src="js/attributes.js"></script>
10
- <link rel="stylesheet" type="text/css" href="css/attributes.css" />
11
  <base target="_self" />
12
  </head>
13
  <body style="display: none">
@@ -142,10 +142,10 @@
142
  </div>
143
  <div class="mceActionPanel">
144
  <div style="float: left">
145
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
146
  </div>
147
  <div style="float: right">
148
- <input type="submit" id="insert" name="insert" value="{#insert}" />
149
  </div>
150
  </div>
151
 
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
9
+ <script type="text/javascript" src="js/attributes.js?v=307"></script>
10
+ <link rel="stylesheet" type="text/css" href="css/attributes.css?v=307" />
11
  <base target="_self" />
12
  </head>
13
  <body style="display: none">
142
  </div>
143
  <div class="mceActionPanel">
144
  <div style="float: left">
145
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
146
  </div>
147
  <div style="float: right">
148
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
149
  </div>
150
  </div>
151
 
mce/xhtmlxtras/cite.htm CHANGED
@@ -2,13 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
- <script type="text/javascript" src="js/element_common.js"></script>
10
- <script type="text/javascript" src="js/cite.js"></script>
11
- <link rel="stylesheet" type="text/css" href="css/popup.css" />
12
  <base target="_self" />
13
  </head>
14
  <body style="display: none">
@@ -134,13 +134,13 @@
134
  </div>
135
  <div class="mceActionPanel">
136
  <div style="float: left">
137
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
138
  </div>
139
  <div style="float: left">
140
  <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" />
141
  </div>
142
  <div style="float: right">
143
- <input type="submit" id="insert" name="insert" value="{#update}" />
144
  </div>
145
  </div>
146
 
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
9
+ <script type="text/javascript" src="js/element_common.js?v=307"></script>
10
+ <script type="text/javascript" src="js/cite.js?v=307"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?v=307" />
12
  <base target="_self" />
13
  </head>
14
  <body style="display: none">
134
  </div>
135
  <div class="mceActionPanel">
136
  <div style="float: left">
137
+ <input type="submit" id="insert" name="insert" value="{#update}" />
138
  </div>
139
  <div style="float: left">
140
  <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" />
141
  </div>
142
  <div style="float: right">
143
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144
  </div>
145
  </div>
146
 
mce/xhtmlxtras/del.htm CHANGED
@@ -2,13 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
- <script type="text/javascript" src="js/element_common.js"></script>
10
- <script type="text/javascript" src="js/del.js"></script>
11
- <link rel="stylesheet" type="text/css" href="css/popup.css" />
12
  <base target="_self" />
13
  </head>
14
  <body id="xhtmlxtrasins" style="display: none">
@@ -154,13 +154,13 @@
154
  </div>
155
  <div class="mceActionPanel">
156
  <div style="float: left">
157
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
158
  </div>
159
  <div style="float: left">
160
  <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" />
161
  </div>
162
  <div style="float: right">
163
- <input type="submit" id="insert" name="insert" value="{#update}" />
164
  </div>
165
  </div>
166
 
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
9
+ <script type="text/javascript" src="js/element_common.js?v=307"></script>
10
+ <script type="text/javascript" src="js/del.js?v=307"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?v=307" />
12
  <base target="_self" />
13
  </head>
14
  <body id="xhtmlxtrasins" style="display: none">
154
  </div>
155
  <div class="mceActionPanel">
156
  <div style="float: left">
157
+ <input type="submit" id="insert" name="insert" value="{#update}" />
158
  </div>
159
  <div style="float: left">
160
  <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" />
161
  </div>
162
  <div style="float: right">
163
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
164
  </div>
165
  </div>
166
 
mce/xhtmlxtras/ins.htm CHANGED
@@ -2,13 +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"></script>
6
- <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
- <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
- <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
- <script type="text/javascript" src="js/element_common.js"></script>
10
- <script type="text/javascript" src="js/ins.js"></script>
11
- <link rel="stylesheet" type="text/css" href="css/popup.css" />
12
  <base target="_self" />
13
  </head>
14
  <body id="xhtmlxtrasins" style="display: none">
@@ -154,13 +154,13 @@
154
  </div>
155
  <div class="mceActionPanel">
156
  <div style="float: left">
157
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
158
  </div>
159
  <div style="float: left">
160
  <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" />
161
  </div>
162
  <div style="float: right">
163
- <input type="submit" id="insert" name="insert" value="{#update}" />
164
  </div>
165
  </div>
166
 
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?v=307"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
9
+ <script type="text/javascript" src="js/element_common.js?v=307"></script>
10
+ <script type="text/javascript" src="js/ins.js?v=307"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?v=307" />
12
  <base target="_self" />
13
  </head>
14
  <body id="xhtmlxtrasins" style="display: none">
154
  </div>
155
  <div class="mceActionPanel">
156
  <div style="float: left">
157
+ <input type="submit" id="insert" name="insert" value="{#update}" />
158
  </div>
159
  <div style="float: left">
160
  <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" />
161
  </div>
162
  <div style="float: right">
163
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
164
  </div>
165
  </div>
166
 
readme.txt CHANGED
@@ -2,17 +2,15 @@
2
  Contributors: Andrew Ozz
3
  Donate link:
4
  Tags: wysiwyg, formatting, tinymce, write, edit, post
5
- Requires at least: 2.5
6
- Tested up to: 2.5
7
- Stable tag: 3.0
8
 
9
  Enables most of the advanced features of TinyMCE, the WordPress WYSIWYG editor.
10
 
11
  == Description ==
12
 
13
- This plugin adds 14 plugins to TinyMCE: Advanced hr, Advanced Image, Advanced Link, Context Menu, Emotions (Smilies), Date and Time, Layer, Nonbreaking, Print, Search and Replace, Style, Table, Visual Characters and XHTML Extras.
14
-
15
- Version 3.0.1-beta is [available](http://downloads.wordpress.org/plugin/tinymce-advanced.zip). It fixes issues with removal of non-default buttons in TinyMCE, adds an option to disable the removal of P and BR tags when saving and in the HTML editor (autop) and two more buttons to the HTML editor: autop and undo.
16
 
17
  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.
18
 
@@ -22,6 +20,8 @@ New in version 2.2: Deactivate/Uninstall option page, font size drop-down menu a
22
 
23
  New in version 3.0: Support for WordPress 2.5 and TinyMCE 3.0.
24
 
 
 
25
  **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://services.moxiecode.com/i18n/).
26
 
27
 
2
  Contributors: Andrew Ozz
3
  Donate link:
4
  Tags: wysiwyg, formatting, tinymce, write, edit, post
5
+ Requires at least: 2.5.1
6
+ Tested up to: 2.5.1
7
+ Stable tag: 3.0.1
8
 
9
  Enables most of the advanced features of TinyMCE, the WordPress WYSIWYG editor.
10
 
11
  == Description ==
12
 
13
+ This plugin adds 14 plugins to TinyMCE: Advanced hr, Advanced Image, Advanced Link, Context Menu, Emotions (Smilies), Date and Time, 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
 
20
 
21
  New in version 3.0: Support for WordPress 2.5 and TinyMCE 3.0.
22
 
23
+ New in version 3.0.1: Compatibility with WordPress 2.5.1 and TinyMCE 3.0.7, added option to disable the removal of P and BR tags when saving and in the HTML editor (autop), added two more buttons to the HTML editor: autop and undo, fixed the removal of non-default TinyMCE buttons.
24
+
25
  **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://services.moxiecode.com/i18n/).
26
 
27
 
tadv_admin.php CHANGED
@@ -13,12 +13,9 @@ if ( isset( $_POST['tadv_uninstall'] ) ) {
13
  delete_option('tadv_btns2');
14
  delete_option('tadv_btns3');
15
  delete_option('tadv_btns4');
 
16
 
17
- ?>
18
- <h3 style="margin:60px auto auto;text-align:center;"><a href="plugins.php?action=deactivate&amp;plugin=tinymce-advanced%2Ftinymce-advanced.php&amp;_wpnonce=<?php echo wp_create_nonce('deactivate-plugin_tinymce-advanced/tinymce-advanced.php'); ?>">Deactivate TinyMCE Advanced</a></h3>
19
-
20
- <?php
21
- include('admin-footer.php');
22
  exit;
23
  }
24
 
@@ -26,106 +23,66 @@ $update_tadv_options = false;
26
  $imgpath = get_bloginfo('wpurl') . '/wp-content/plugins/tinymce-advanced/images/';
27
 
28
  $tadv_toolbars = get_option('tadv_toolbars');
29
- if ( ! is_array($tadv_toolbars) ) {
30
- $tadv_toolbars = tadv_defaults();
31
- update_option( 'tadv_toolbars', $tadv_toolbars );
32
- }
33
-
34
- $tadv_options = get_option('tadv_options');
35
- if ( ! is_array($tadv_options) ) {
36
- $tadv_options = array( 'advlink' => '1', 'advimage' => '1' );
37
- $update_tadv_options = true;
38
  }
39
 
40
  if ( isset( $_POST['save'] ) ) {
41
  check_admin_referer( 'tadv-save-buttons-order' );
42
- $tb1 = $tb2 = $tb3 = $tb4 = array();
43
  parse_str( $_POST['toolbar_1order'], $tb1 );
44
  parse_str( $_POST['toolbar_2order'], $tb2 );
45
  parse_str( $_POST['toolbar_3order'], $tb3 );
46
  parse_str( $_POST['toolbar_4order'], $tb4 );
47
- $tadv_toolbars = $tb1 + $tb2 + $tb3 + $tb4;
 
 
 
 
 
48
  update_option( 'tadv_toolbars', $tadv_toolbars );
49
 
50
  $tadv_options['advlink'] = $_POST['advlink'] ? 1 : 0;
51
  $tadv_options['advimage'] = $_POST['advimage'] ? 1 : 0;
52
  $tadv_options['contextmenu'] = $_POST['contextmenu'] ? 1 : 0;
53
  $tadv_options['importcss'] = $_POST['importcss'] ? 1 : 0;
 
54
  $update_tadv_options = true;
55
  }
56
 
57
- $btns1 = $btns2 = $btns3 = $btns4 = array();
58
- $hidden_row = false;
59
-
60
- if ( is_array($tadv_toolbars['toolbar_1']) ) {
61
- $btns1 = $tadv_toolbars['toolbar_1'];
62
-
63
- if ( ! empty($btns1) ) {
64
- foreach( $btns1 as $k => $v ) {
65
- if ( strpos($v, 'separator') !== false ) $btns1[$k] = 'separator';
66
- if ( 'layer' == $v ) $l = $k;
67
- if ( 'wp_adv' == $v ) $hidden_row = 2;
68
- if ( empty($v) ) unset($btns1[$k]);
69
- }
70
- if ( $l ) array_splice( $btns1, $l, 1, array('insertlayer', 'moveforward', 'movebackward', 'absolute') );
71
- }
72
- }
73
 
74
- if ( is_array($tadv_toolbars['toolbar_2']) ) {
75
- $btns2 = $tadv_toolbars['toolbar_2'];
76
-
77
- if ( ! empty($btns2) ) {
78
-
79
- foreach( $btns2 as $k => $v ) {
80
- if ( strpos($v, 'separator') !== false ) $btns2[$k] = 'separator';
81
- if ( 'layer' == $v ) $l = $k;
82
- if ( 'wp_adv' == $v ) $hidden_row = 3;
83
- if ( empty($v) ) unset($btns2[$k]);
84
- }
85
-
86
- if ( $l ) array_splice( $btns2, $l, 1, array('insertlayer', 'moveforward', 'movebackward', 'absolute') );
87
  }
88
- }
89
 
90
- if ( is_array($tadv_toolbars['toolbar_3']) ) {
91
- $btns3 = $tadv_toolbars['toolbar_3'];
92
-
93
- if ( ! empty($btns3) ) {
94
-
95
- foreach( $btns3 as $k => $v ) {
96
- if ( strpos($v, 'separator') !== false ) $btns3[$k] = 'separator';
97
- if ( 'layer' == $v ) $l = $k;
98
- if ( 'wp_adv' == $v ) $hidden_row = 4;
99
- if ( empty($v) ) unset($btns3[$k]);
100
- }
101
-
102
- if ( $l ) array_splice( $btns3, $l, 1, array('insertlayer', 'moveforward', 'movebackward', 'absolute') );
103
  }
104
- }
105
 
106
- if ( $hidden_row ) $tadv_options['hidden_row'] = $hidden_row;
107
- $update_tadv_options = true;
108
-
109
- if ( is_array($tadv_toolbars['toolbar_4']) ) {
110
- $btns4 = $tadv_toolbars['toolbar_4'];
111
-
112
- if ( ! empty($btns4) ) {
113
-
114
- foreach( $btns4 as $k => $v ) {
115
- if ( strpos($v, 'separator') !== false ) $btns4[$k] = 'separator';
116
- if ( 'layer' == $v ) $l = $k;
117
- if ( empty($v) ) unset($btns4[$k]);
118
- }
119
-
120
- if ( $l ) array_splice( $btns4, $l, 1, array('insertlayer', 'moveforward', 'movebackward', 'absolute') );
121
- }
122
  }
 
123
 
124
- if ( empty($btns1) && empty($btns2) && empty($btns3) && empty($btns4) ) {
125
  $allbtns = array();
126
  ?><div class="error" id="message"><p>All toolbars are empty!</p></div><?php
127
  } else {
128
- $allbtns = array_merge( $btns1, $btns2, $btns3, $btns4 );
129
 
130
  if ( in_array('advhr', $allbtns) ) $plugins[] = 'advhr';
131
  if ( in_array('insertlayer', $allbtns) ) $plugins[] = 'layer';
@@ -154,34 +111,25 @@ if ( empty($btns1) && empty($btns2) && empty($btns3) && empty($btns4) ) {
154
  if ( $tadv_options['contextmenu'] == '1' ) $plugins[] = 'contextmenu';
155
  }
156
 
157
- if ( get_option('tadv_plugins') != $plugins ) update_option( 'tadv_plugins', $plugins );
158
- if ( get_option('tadv_btns1') != $btns1 ) update_option( 'tadv_btns1', $btns1 );
159
- if ( get_option('tadv_btns2') != $btns2 ) update_option( 'tadv_btns2', $btns2 );
160
- if ( get_option('tadv_btns3') != $btns3 ) update_option( 'tadv_btns3', $btns3 );
161
- if ( get_option('tadv_btns4') != $btns4 ) update_option( 'tadv_btns4', $btns4 );
162
-
163
- $buttons = array( 'Kitchen Sink' => 'wp_adv', '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' );
164
-
165
- $active_plugins = get_settings('active_plugins');
166
- $add = array();
167
- foreach( $active_plugins as $plug ) {
168
- if ( strpos( $plug, 'wpg2' ) !== false ) $add['Gallery 2'] = 'g2image';
169
- if ( strpos( $plug, 'nextgen-gallery' ) !== false ) $add['Nextgen Gallery'] = 'NextGEN';
170
- if ( strpos( $plug, 'vipers-video' ) !== false ) $add["Viper's Video"] = 'vipersvideoquicktags';
171
- if ( strpos( $plug, 'embedded-video' ) !== false ) $add['EmbeddedVideo'] = 'embeddedvideo';
172
- if ( strpos( $plug, 'imagemanager' ) !== false ) $add['Image Manager'] = 'ps_imagemanager_tinymceplugin';
173
- }
174
 
175
- if ( ! empty($add) ) $buttons += $add;
 
 
176
 
177
- $separators = array( 's1' => 'separator1', 's2' => 'separator2', 's3' => 'separator3', 's4' => 'separator4', 's5' => 'separator5', 's6' => 'separator6', 's7' => 'separator7', 's8' => 'separator8', 's9' => 'separator9', 's10' => 'separator10', 's11' => 'separator11', 's12' => 'separator12', 's13' => 'separator13', 's14' => 'separator14', 's15' => 'separator15', 's16' => 'separator16', 's17' => 'separator17', 's18' => 'separator18', 's19' => 'separator19', 's20' => 'separator20' );
 
 
 
 
 
178
 
179
- $buttons += $separators;
 
180
 
181
- if ( isset( $_POST['tadv'] ) ) {
182
- if ( isset($_POST['save']) ) { ?><div class="updated" id="message"><p>Options saved</p></div><?php }
183
- if ( isset($_POST['reset']) ) { ?><div class="updated" id="message"><p>Defaults loaded</p></div><?php }
184
- } ?>
185
 
186
  <div class="wrap">
187
 
@@ -215,13 +163,12 @@ if ( is_array($tadv_toolbars['toolbar_1']) ) {
215
  <?php } else { ?>
216
 
217
  <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
218
- <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
219
  <span class="descr"> <?php echo $name; ?></span></div></li>
220
  <?php }
221
  }
222
  $buttons = array_diff( $buttons, $tb1 );
223
  } ?>
224
-
225
  </ul></div>
226
  <br class="clear" />
227
 
@@ -242,13 +189,12 @@ if ( is_array($tadv_toolbars['toolbar_2']) ) {
242
  <?php } else { ?>
243
 
244
  <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
245
- <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
246
  <span class="descr"> <?php echo $name; ?></span></div></li>
247
  <?php }
248
  }
249
  $buttons = array_diff( $buttons, $tb2 );
250
  } ?>
251
-
252
  </ul></div>
253
  <br class="clear" />
254
 
@@ -269,13 +215,12 @@ if ( is_array($tadv_toolbars['toolbar_3']) ) {
269
  <?php } else { ?>
270
 
271
  <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
272
- <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
273
  <span class="descr"> <?php echo $name; ?></span></div></li>
274
  <?php }
275
  }
276
  $buttons = array_diff( $buttons, $tb3 );
277
  } ?>
278
-
279
  </ul></div>
280
  <br class="clear" />
281
 
@@ -296,16 +241,12 @@ if ( is_array($tadv_toolbars['toolbar_4']) ) {
296
  <?php } else { ?>
297
 
298
  <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
299
- <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
300
  <span class="descr"> <?php echo $name; ?></span></div></li>
301
  <?php }
302
  }
303
  $buttons = array_diff( $buttons, $tb4 );
304
- }
305
-
306
- $tadv_btns_left = is_array($buttons) ? array_values($buttons) : array();
307
- if ( get_option('tadv_btns_left') != $tadv_btns_left ) update_option( 'tadv_btns_left', $tadv_btns_left ); ?>
308
-
309
  </ul></div>
310
  <br class="clear" />
311
  </div>
@@ -324,7 +265,7 @@ if ( is_array($buttons) ) {
324
  <?php } else { ?>
325
 
326
  <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
327
- <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
328
  <span class="descr"> <?php echo $name; ?></span></div></li>
329
  <?php }
330
  }
@@ -348,17 +289,17 @@ if ( is_array($buttons) ) {
348
  <tr><td style="border:1px solid #CD0000;padding:2px 12px 8px;">
349
  <p style="font-weight:bold;color:#CD0000;">Advanced</p>
350
 
351
- <p>&middot; Import the current theme's
352
- <label for="importcss" class="tadv-box">CSS classes &nbsp;
353
  <input type="checkbox" class="tadv-chk" name="importcss" id="importcss" <?php if ( $tadv_options['importcss'] == '1' ) echo ' checked="checked"'; ?> /></label></p>
354
- <p>Custom CSS styles can be added in /wp-content/plugins/tinymce-advanced/css/tadv-mce.css. They will be imported in the Style Select menu. The file has to be downloaded with FTP, edited and uploaded, overwriting the original.</p>
355
- </td></tr>
 
 
 
356
  <?php
357
  $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
358
  if ( $mce_locale != 'en' ) {
359
-
360
- if ( ! file_exists(ABSPATH . PLUGINDIR . '/tinymce-advanced/mce/advlink/langs/' . $mce_locale . '_dlg.js') ) {
361
- ?>
362
  <tr><td style="padding:2px 12px 8px;">
363
  <p style="font-weight:bold;">Language Settings</p>
364
  <p>Your WordPress language is set to <strong><?php echo get_locale(); ?></strong>. However there is no matching language installed for TinyMCE's plugins. This plugin includes several translations: German, French, Italian, Spanish, Portuguese, Russian, Japanese and Chinese. More translations are available at <a href="http://services.moxiecode.com/i18n/">TinyMCE's web site</a>.</p>
13
  delete_option('tadv_btns2');
14
  delete_option('tadv_btns3');
15
  delete_option('tadv_btns4');
16
+ delete_option('tadv_allbtns');
17
 
18
+ echo '<script type="text/javascript">window.location="plugins.php?action=deactivate&plugin=tinymce-advanced/tinymce-advanced.php&_wpnonce=' . wp_create_nonce('deactivate-plugin_tinymce-advanced/tinymce-advanced.php') . '";</script>';
 
 
 
 
19
  exit;
20
  }
21
 
23
  $imgpath = get_bloginfo('wpurl') . '/wp-content/plugins/tinymce-advanced/images/';
24
 
25
  $tadv_toolbars = get_option('tadv_toolbars');
26
+ if ( ! is_array($tadv_toolbars) )
27
+ @include_once( dirname(__FILE__) . '/tadv_defaults.php');
28
+ else {
29
+ $tadv_options = get_option('tadv_options');
30
+ $tadv_toolbars['toolbar_1'] = isset($tadv_toolbars['toolbar_1']) ? (array) $tadv_toolbars['toolbar_1'] : array();
31
+ $tadv_toolbars['toolbar_2'] = isset($tadv_toolbars['toolbar_2']) ? (array) $tadv_toolbars['toolbar_2'] : array();
32
+ $tadv_toolbars['toolbar_3'] = isset($tadv_toolbars['toolbar_3']) ? (array) $tadv_toolbars['toolbar_3'] : array();
33
+ $tadv_toolbars['toolbar_4'] = isset($tadv_toolbars['toolbar_4']) ? (array) $tadv_toolbars['toolbar_4'] : array();
 
34
  }
35
 
36
  if ( isset( $_POST['save'] ) ) {
37
  check_admin_referer( 'tadv-save-buttons-order' );
38
+ $tb1 = $tb2 = $tb3 = $tb4 = $btns = array();
39
  parse_str( $_POST['toolbar_1order'], $tb1 );
40
  parse_str( $_POST['toolbar_2order'], $tb2 );
41
  parse_str( $_POST['toolbar_3order'], $tb3 );
42
  parse_str( $_POST['toolbar_4order'], $tb4 );
43
+
44
+ $tadv_toolbars['toolbar_1'] = (array) $tb1['toolbar_1'];
45
+ $tadv_toolbars['toolbar_2'] = (array) $tb2['toolbar_2'];
46
+ $tadv_toolbars['toolbar_3'] = (array) $tb3['toolbar_3'];
47
+ $tadv_toolbars['toolbar_4'] = (array) $tb4['toolbar_4'];
48
+
49
  update_option( 'tadv_toolbars', $tadv_toolbars );
50
 
51
  $tadv_options['advlink'] = $_POST['advlink'] ? 1 : 0;
52
  $tadv_options['advimage'] = $_POST['advimage'] ? 1 : 0;
53
  $tadv_options['contextmenu'] = $_POST['contextmenu'] ? 1 : 0;
54
  $tadv_options['importcss'] = $_POST['importcss'] ? 1 : 0;
55
+ $tadv_options['fix_autop'] = $_POST['fix_autop'] ? 1 : 0;
56
  $update_tadv_options = true;
57
  }
58
 
59
+ $hidden_row = 0;
60
+ $i = 0;
61
+ foreach ( $tadv_toolbars as $toolbar ) {
62
+ $l = false;
63
+ $i++;
 
 
 
 
 
 
 
 
 
 
 
64
 
65
+ if ( empty($toolbar) ) {
66
+ $btns["toolbar_$i"] = array();
67
+ continue;
 
 
 
 
 
 
 
 
 
 
68
  }
 
69
 
70
+ foreach( $toolbar as $k => $v ) {
71
+ if ( strpos($v, 'separator') !== false ) $toolbar[$k] = 'separator';
72
+ if ( 'layer' == $v ) $l = $k;
73
+ if ( empty($v) ) unset($toolbar[$k]);
 
 
 
 
 
 
 
 
 
74
  }
75
+ if ( $l ) array_splice( $toolbar, $l, 1, array('insertlayer', 'moveforward', 'movebackward', 'absolute') );
76
 
77
+ $btns["toolbar_$i"] = $toolbar;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  }
79
+ extract($btns);
80
 
81
+ if ( empty($toolbar_1) && empty($toolbar_2) && empty($toolbar_3) && empty($toolbar_4) ) {
82
  $allbtns = array();
83
  ?><div class="error" id="message"><p>All toolbars are empty!</p></div><?php
84
  } else {
85
+ $allbtns = array_merge( $toolbar_1, $toolbar_2, $toolbar_3, $toolbar_4 );
86
 
87
  if ( in_array('advhr', $allbtns) ) $plugins[] = 'advhr';
88
  if ( in_array('insertlayer', $allbtns) ) $plugins[] = 'layer';
111
  if ( $tadv_options['contextmenu'] == '1' ) $plugins[] = 'contextmenu';
112
  }
113
 
114
+ $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' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
+ $tadv_allbtns = array_values($buttons);
117
+ $tadv_allbtns[] = 'separator';
118
+ $tadv_allbtns[] = '|';
119
 
120
+ if ( get_option('tadv_plugins') != $plugins ) update_option( 'tadv_plugins', $plugins );
121
+ if ( get_option('tadv_btns1') != $toolbar_1 ) update_option( 'tadv_btns1', $toolbar_1 );
122
+ if ( get_option('tadv_btns2') != $toolbar_2 ) update_option( 'tadv_btns2', $toolbar_2 );
123
+ if ( get_option('tadv_btns3') != $toolbar_3 ) update_option( 'tadv_btns3', $toolbar_3 );
124
+ if ( get_option('tadv_btns4') != $toolbar_4 ) update_option( 'tadv_btns4', $toolbar_4 );
125
+ if ( get_option('tadv_allbtns') != $tadv_allbtns ) update_option( 'tadv_allbtns', $tadv_allbtns );
126
 
127
+ for ( $i = 1; $i < 21; $i++ )
128
+ $buttons["s$i"] = "separator$i";
129
 
130
+ if ( isset($_POST['tadv']) && isset($_POST['save']) ) { ?>
131
+ <div class="updated" id="message"><p>Options saved</p></div>
132
+ <?php } ?>
 
133
 
134
  <div class="wrap">
135
 
163
  <?php } else { ?>
164
 
165
  <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
166
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
167
  <span class="descr"> <?php echo $name; ?></span></div></li>
168
  <?php }
169
  }
170
  $buttons = array_diff( $buttons, $tb1 );
171
  } ?>
 
172
  </ul></div>
173
  <br class="clear" />
174
 
189
  <?php } else { ?>
190
 
191
  <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
192
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
193
  <span class="descr"> <?php echo $name; ?></span></div></li>
194
  <?php }
195
  }
196
  $buttons = array_diff( $buttons, $tb2 );
197
  } ?>
 
198
  </ul></div>
199
  <br class="clear" />
200
 
215
  <?php } else { ?>
216
 
217
  <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
218
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
219
  <span class="descr"> <?php echo $name; ?></span></div></li>
220
  <?php }
221
  }
222
  $buttons = array_diff( $buttons, $tb3 );
223
  } ?>
 
224
  </ul></div>
225
  <br class="clear" />
226
 
241
  <?php } else { ?>
242
 
243
  <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
244
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
245
  <span class="descr"> <?php echo $name; ?></span></div></li>
246
  <?php }
247
  }
248
  $buttons = array_diff( $buttons, $tb4 );
249
+ } ?>
 
 
 
 
250
  </ul></div>
251
  <br class="clear" />
252
  </div>
265
  <?php } else { ?>
266
 
267
  <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
268
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
269
  <span class="descr"> <?php echo $name; ?></span></div></li>
270
  <?php }
271
  }
289
  <tr><td style="border:1px solid #CD0000;padding:2px 12px 8px;">
290
  <p style="font-weight:bold;color:#CD0000;">Advanced</p>
291
 
292
+ <p><label for="importcss" class="tadv-box">Import the current theme's CSS classes &nbsp;
 
293
  <input type="checkbox" class="tadv-chk" name="importcss" id="importcss" <?php if ( $tadv_options['importcss'] == '1' ) echo ' checked="checked"'; ?> /></label></p>
294
+ <p style="font-size:10px;">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.</p>
295
+ <p><label for="fix_autop" class="tadv-box">Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them in the HTML editor &nbsp;
296
+ <input type="checkbox" class="tadv-chk" name="fix_autop" id="fix_autop" <?php if ( $tadv_options['fix_autop'] == '1' ) echo ' checked="checked"'; ?> /></label></p>
297
+ <p style="font-size:10px;">This will make it possible to use more advanced HTML without the back-end filtering affecting it much. It also adds two new buttons to the HTML editor: &quot;autop&quot; that allows wpautop to be run on demand and &quot;undo&quot; that can undo the last changes.</p>
298
+ </td></tr>
299
  <?php
300
  $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
301
  if ( $mce_locale != 'en' ) {
302
+ if ( ! file_exists(ABSPATH . PLUGINDIR . '/tinymce-advanced/mce/advlink/langs/' . $mce_locale . '_dlg.js') ) { ?>
 
 
303
  <tr><td style="padding:2px 12px 8px;">
304
  <p style="font-weight:bold;">Language Settings</p>
305
  <p>Your WordPress language is set to <strong><?php echo get_locale(); ?></strong>. However there is no matching language installed for TinyMCE's plugins. This plugin includes several translations: German, French, Italian, Spanish, Portuguese, Russian, Japanese and Chinese. More translations are available at <a href="http://services.moxiecode.com/i18n/">TinyMCE's web site</a>.</p>
tadv_defaults.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $tadv_options = array( 'advlink' => 1, 'advimage' => 1, 'importcss' => 0, 'contextmenu' => 0, 'tadvreplace' => 0 );
4
+
5
+ $tadv_plugins = array( 'style', 'emotions', 'print', 'searchreplace', 'xhtmlxtras', 'advlink', 'advimage' );
6
+
7
+ $tadv_toolbars = array(
8
+ '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' ),
9
+ 'toolbar_2' => array( 'fontsizeselect', 'formatselect', 'pastetext', 'pasteword', 'removeformat', 'separator8', 'charmap', 'print', 'separator9', 'forecolor', 'emotions', 'separator10', 'sup', 'sub', 'media', 'separator11', 'undo', 'redo', 'attribs', 'wp_help' ),
10
+ 'toolbar_3' => array(),
11
+ 'toolbar_4' => array()
12
+ );
13
+
14
+ $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' );
15
+
16
+ $tadv_btns2 = array( 'fontsizeselect', 'formatselect', 'pastetext', 'pasteword', 'removeformat', 'separator', 'charmap', 'print', 'separator', 'forecolor', 'emotions', 'separator', 'sup', 'sub', 'media', 'separator', 'undo', 'redo', 'attribs', 'wp_help' );
17
+
18
+ $tadv_btns3 = $tadv_btns4 = array();
19
+
20
+ $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', '|' );
21
+ ?>
tiny_mce_popup.js CHANGED
@@ -101,7 +101,7 @@ tinyMCEPopup = {
101
  u += '/langs/' + this.editor.settings.language + '_dlg.js';
102
 
103
  if (!tinymce.ScriptLoader.isDone(u)) {
104
- document.write('<script type="text/javascript" src="' + u + '"></script>');
105
  tinymce.ScriptLoader.markDone(u);
106
  }
107
  }
@@ -169,6 +169,7 @@ tinyMCEPopup = {
169
  if (tinymce.isIE)
170
  h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
171
 
 
172
  document.body.innerHTML = t.editor.translate(h);
173
  document.title = ti = t.editor.translate(ti);
174
  document.body.style.display = '';
@@ -218,7 +219,7 @@ tinyMCEPopup = {
218
  });
219
  }
220
 
221
- document.onkeydown = tinyMCEPopup._closeWinKeyHandler;
222
  },
223
 
224
  _accessHandler : function(e) {
101
  u += '/langs/' + this.editor.settings.language + '_dlg.js';
102
 
103
  if (!tinymce.ScriptLoader.isDone(u)) {
104
+ document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"></script>');
105
  tinymce.ScriptLoader.markDone(u);
106
  }
107
  }
169
  if (tinymce.isIE)
170
  h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
171
 
172
+ document.dir = t.editor.getParam('directionality','');
173
  document.body.innerHTML = t.editor.translate(h);
174
  document.title = ti = t.editor.translate(ti);
175
  document.body.style.display = '';
219
  });
220
  }
221
 
222
+ document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
223
  },
224
 
225
  _accessHandler : function(e) {
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.0
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
9
 
@@ -18,8 +18,8 @@ Released under the GPL v.2, http://www.gnu.org/copyleft/gpl.html
18
  */
19
 
20
  if ( ! function_exists('tadv_admin_head') ) {
21
- function tadv_admin_head() {
22
- ?>
23
  <script type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-content/plugins/tinymce-advanced/js/tadv-all.js?ver=1.7.0-3.0"></script>
24
  <link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-content/plugins/tinymce-advanced/css/tadv-styles.css?ver=3.0" type="text/css" />
25
 
@@ -46,39 +46,45 @@ function tadvSerializeAll() {
46
  function tadvUpdateAll() {
47
  tadvResetHeight();
48
  $('tadvWarnmsg').innerHTML = '';
 
49
  mceToolbars.map(function(o){
50
- var kids = $(o).childNodes;
51
- var tbwidth = $(o).clientWidth;
52
- var kidswidth = 0;
53
- for( i=0; i<kids.length; i++ ) {
54
  kidswidth += kids[i].clientWidth;
55
- }
56
- if( kidswidth > tbwidth ) {
57
  $('tadvWarnmsg').innerHTML = 'Adding too many buttons will make the toolbar too long and will not display correctly in TinyMCE!';
58
- }
59
  });
60
 
61
  var wp_adv = $('pre_wp_adv'), t1 = $('toolbar_1'), t2 = $('toolbar_2'), t3 = $('toolbar_3'), t4 = $('toolbar_4'), tp = $('tadvpalette');
62
- var t2l = (t2.childNodes.length > 0), t3l = (t3.childNodes.length > 0), t4l = (t4.childNodes.length > 0);
63
-
64
- if ( wp_adv.childOf(t4) ) {
65
- if ( t4l ) t3.appendChild(wp_adv);
66
- else if ( t3l ) {t2.appendChild(wp_adv);return false;}
67
- else if ( t2l ) {t1.appendChild(wp_adv);return false;}
68
- } else if ( wp_adv.childOf(t3) ) {
69
- if ( t4l ) return false;
70
- else if ( t3l ) {t2.appendChild(wp_adv);return false;}
71
- else if ( t2l ) {t1.appendChild(wp_adv);return false;}
72
- } else if ( wp_adv.childOf(t2) ) {
73
- if ( t3l ) return false;
74
- else if ( t2l ) {t1.appendChild(wp_adv);return false;}
75
- } else if ( wp_adv.childOf(t1) ) {
76
- if ( t2l ) return false;
77
- } else if ( wp_adv.childOf(tp) ) {
78
- return false;
79
- } else {
80
- tp.appendChild(wp_adv);
81
- };
 
 
 
 
 
 
 
82
  };
83
  Event.observe(window, 'load', function() {
84
  initTadv();
@@ -89,167 +95,201 @@ Event.observe(window, 'resize', tadvUpdateAll);
89
  </script>
90
 
91
  <?php
92
- } } // end tadv_admin_head
 
93
 
94
  if ( ! function_exists('tadv_activate') ) {
95
- function tadv_activate() {
96
-
97
- if ( empty($GLOBALS['wp_version']) || version_compare($GLOBALS['wp_version'], '2.5', '<') ) // if less than 2.5
98
- exit('<h2>This plugin requires WordPress version 2.5 or newer. Please upgrade your WordPress installation or remove the plugin.</h2>');
99
-
100
- $tadv_options = array( 'advlink' => '1', 'advimage' => '1' );
101
- $tadv_plugins = array( 'style', 'emotions', 'print', 'searchreplace', 'xhtmlxtras', 'advlink', 'advimage' );
102
-
103
- $tadv_toolbars = tadv_defaults();
104
- $btns1 = (array) $tadv_toolbars['toolbar_1'];
105
- $btns2 = (array) $tadv_toolbars['toolbar_2'];
106
 
107
- add_option( 'tadv_toolbars', $tadv_toolbars, '', 'no' );
108
- add_option( 'tadv_options', $tadv_options, '', 'no' );
109
- add_option( 'tadv_plugins', $tadv_plugins, '', 'no' );
110
- add_option( 'tadv_btns1', $btns1, '', 'no' );
111
- add_option( 'tadv_btns2', $btns2, '', 'no' );
112
- add_option( 'tadv_btns3', array(), '', 'no' );
113
- add_option( 'tadv_btns4', array(), '', 'no' );
114
- } }
 
 
 
 
 
 
115
  add_action( 'activate_tinymce-advanced/tinymce-advanced.php', 'tadv_activate' );
116
 
117
- if ( ! function_exists('tadv_defaults') ) {
118
- function tadv_defaults() {
119
- $tb1 = 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' );
120
-
121
- $tb2 = array( 'fontsizeselect', 'formatselect', 'pastetext', 'pasteword', 'removeformat', 'separator8', 'charmap', 'print', 'separator9', 'forecolor', 'emotions', 'separator10', 'sup', 'sub', 'media', 'separator11', 'undo', 'redo', 'attribs', 'wp_help' );
122
-
123
- $tadv_toolbars = array( 'toolbar_1' => $tb1, 'toolbar_2' => $tb2, 'toolbar_3' => array(), 'toolbar_4' => array() );
124
-
125
- return $tadv_toolbars;
126
- } }
127
-
128
  if ( ! function_exists('tdav_css') ) {
129
- function tdav_css($wp) {
130
- $tadv_options = (array) get_option('tadv_options');
131
-
132
- if ( $tadv_options['importcss'] == '1' )
133
- $wp .= ',' . get_bloginfo('stylesheet_url');
134
-
135
- return $wp .= ',' . get_bloginfo('wpurl') . '/wp-content/plugins/tinymce-advanced/css/tadv-mce.css';
136
- } }
 
137
  add_filter( 'mce_css', 'tdav_css' );
138
 
139
- $tadv_extra_btns = array();
140
- $tadv_hidden_row = false;
141
 
142
  if ( ! function_exists('tadv_mce_btns') ) {
143
- function tadv_mce_btns($orig) {
144
- global $tadv_extra_btns, $tadv_hidden_row;
145
- $tadv_btns1 = (array) get_option('tadv_btns1');
146
-
147
- if ( in_array( 'wp_adv', $tadv_btns1 ) )
148
- $tadv_hidden_row = 2;
149
-
150
- $tadv_extra_btns = array_merge( (array) $tadv_extra_btns, (array) $orig );
151
- $tadv_extra_btns = array_diff( $tadv_extra_btns, $tadv_btns1 );
152
-
153
- return $tadv_btns1;
154
- } }
155
- add_filter( 'mce_buttons', 'tadv_mce_btns', 99 );
 
 
 
156
 
157
  if ( ! function_exists('tadv_mce_btns2') ) {
158
- function tadv_mce_btns2($orig) {
159
- global $tadv_extra_btns, $tadv_hidden_row;
160
- $tadv_btns2 = (array) get_option('tadv_btns2');
161
-
162
- if ( in_array( 'wp_adv', $tadv_btns2 ) )
163
- $tadv_hidden_row = 3;
164
-
165
- $tadv_extra_btns = array_merge( (array) $tadv_extra_btns, (array) $orig );
166
- $tadv_extra_btns = array_diff( $tadv_extra_btns, $tadv_btns2 );
167
-
168
- return $tadv_btns2;
169
- } }
170
- add_filter( 'mce_buttons_2', 'tadv_mce_btns2', 99 );
 
 
171
 
172
  if ( ! function_exists('tadv_mce_btns3') ) {
173
- function tadv_mce_btns3($orig) {
174
- global $tadv_extra_btns, $tadv_hidden_row;
175
- $tadv_btns3 = (array) get_option('tadv_btns3');
176
-
177
- if ( in_array( 'wp_adv', $tadv_btns3 ) )
178
- $tadv_hidden_row = 4;
179
-
180
- $tadv_extra_btns = array_merge( (array) $tadv_extra_btns, (array) $orig );
181
- $tadv_extra_btns = array_diff( $tadv_extra_btns, $tadv_btns3 );
182
-
183
- return $tadv_btns3;
184
- } }
185
- add_filter( 'mce_buttons_3', 'tadv_mce_btns3', 99 );
 
 
186
 
187
  if ( ! function_exists('tadv_mce_btns4') ) {
188
- function tadv_mce_btns4($orig) {
189
- $tadv_btns_left = (array) get_option('tadv_btns_left');
190
- $tadv_btns4 = (array) get_option('tadv_btns4');
191
-
192
- $orig = array_merge( (array) $tadv_extra_btns, (array) $orig );
193
- $orig = array_diff( $orig, $tadv_btns_left, $tadv_btns4 ); // , array('wp_adv_start', 'wp_adv', 'wp_adv_end', 'separator')
 
 
 
 
 
 
194
 
195
- if ( ! empty($orig) )
196
- $tadv_btns4 = array_merge($orig, $tadv_btns4);
 
 
197
 
198
- return $tadv_btns4;
199
- } }
200
- add_filter( 'mce_buttons_4', 'tadv_mce_btns4', 98 );
201
 
202
- if ( ! function_exists('tadv_options') ) {
203
- function tadv_options($init) {
204
- global $tadv_hidden_row;
205
-
206
- if ( $tadv_hidden_row )
207
- $init['wordpress_adv_toolbar'] = 'toolbar' . $tadv_hidden_row;
208
-
209
- return $init;
210
- } }
211
- add_filter( 'tiny_mce_before_init', 'tadv_options' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
 
213
  if ( ! function_exists('tadv_load_plugins') ) {
214
- function tadv_load_plugins($plug) {
215
- $tadv_plugins = (array) get_option('tadv_plugins');
216
- $plugpath = get_bloginfo('wpurl') . '/wp-content/plugins/tinymce-advanced/mce/';
217
-
218
- $plug = (array) $plug;
219
- foreach( $tadv_plugins as $plugin )
220
- $plug["$plugin"] = $plugpath . $plugin . '/editor_plugin.js';
221
-
222
- return $plug;
223
- } }
224
- add_action( 'mce_external_plugins', 'tadv_load_plugins' );
 
225
 
226
  if ( ! function_exists('tadv_load_langs') ) {
227
- function tadv_load_langs($langs) {
228
- $tadv_plugins = (array) get_option('tadv_plugins');
229
- $langpath = ABSPATH . '/' . PLUGINDIR . '/tinymce-advanced/mce/';
230
- $nolangs = array( 'bbcode', 'contextmenu', 'insertdatetime', 'layer', 'nonbreaking', 'print', 'visualchars', 'emotions' );
231
-
232
- $langs = (array) $langs;
233
- foreach( $tadv_plugins as $plugin ) {
234
- if ( in_array( $plugin, $nolangs ) ) continue;
235
- $langs["$plugin"] = $langpath . $plugin . '/langs/langs.php';
 
 
236
  }
237
-
238
- return $langs;
239
- } }
240
  add_filter( 'mce_external_languages', 'tadv_load_langs' );
241
 
242
  if ( ! function_exists('tadv_page') ) {
243
- function tadv_page() {
244
- require_once('tadv_admin.php');
245
- } }
 
246
 
247
  if ( ! function_exists('tadv_menu') ) {
248
- function tadv_menu() {
249
- if ( function_exists('add_management_page') ) {
250
- $page = add_management_page( 'TinyMCE Advanced', 'TinyMCE Advanced', 9, __FILE__, 'tadv_page' );
251
- add_action( "admin_print_scripts-$page", 'tadv_admin_head' );
 
252
  }
253
- } }
254
  add_action( 'admin_menu', 'tadv_menu' );
 
255
  ?>
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.0.1
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
9
 
18
  */
19
 
20
  if ( ! function_exists('tadv_admin_head') ) {
21
+ function tadv_admin_head() { ?>
22
+
23
  <script type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-content/plugins/tinymce-advanced/js/tadv-all.js?ver=1.7.0-3.0"></script>
24
  <link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-content/plugins/tinymce-advanced/css/tadv-styles.css?ver=3.0" type="text/css" />
25
 
46
  function tadvUpdateAll() {
47
  tadvResetHeight();
48
  $('tadvWarnmsg').innerHTML = '';
49
+
50
  mceToolbars.map(function(o){
51
+ var kids = $(o).childNodes, tbwidth = $(o).clientWidth, kidswidth = 0;
52
+
53
+ for( i=0; i<kids.length; i++ )
 
54
  kidswidth += kids[i].clientWidth;
55
+
56
+ if( (kidswidth+8) > tbwidth )
57
  $('tadvWarnmsg').innerHTML = 'Adding too many buttons will make the toolbar too long and will not display correctly in TinyMCE!';
 
58
  });
59
 
60
  var wp_adv = $('pre_wp_adv'), t1 = $('toolbar_1'), t2 = $('toolbar_2'), t3 = $('toolbar_3'), t4 = $('toolbar_4'), tp = $('tadvpalette');
61
+ var t2l = (t2.childNodes.length > 0 && t2.childNodes[0] != wp_adv), t3l = (t3.childNodes.length > 0 && t3.childNodes[0] != wp_adv), t4l = (t4.childNodes.length > 0 && t4.childNodes[0] != wp_adv);
62
+
63
+ switch (wp_adv.parentNode.id) {
64
+ case 'toolbar_4' :
65
+ if (t4l) {
66
+ t3.appendChild(wp_adv);
67
+ break;
68
+ }
69
+ case 'toolbar_3' :
70
+ if (t4l) break;
71
+ else if (t3l) {
72
+ t2.appendChild(wp_adv);
73
+ break;
74
+ }
75
+ case 'toolbar_2' :
76
+ if (t3l) break;
77
+ else if (t2l) {
78
+ t1.appendChild(wp_adv);
79
+ break;
80
+ }
81
+ case 'toolbar_1' :
82
+ if (t2l) break;
83
+ case 'tadvpalette' :
84
+ break;
85
+ default :
86
+ tp.appendChild(wp_adv);
87
+ }
88
  };
89
  Event.observe(window, 'load', function() {
90
  initTadv();
95
  </script>
96
 
97
  <?php
98
+ }
99
+ } // end tadv_admin_head
100
 
101
  if ( ! function_exists('tadv_activate') ) {
102
+ function tadv_activate() {
103
+
104
+ if ( empty($GLOBALS['wp_version']) || version_compare($GLOBALS['wp_version'], '2.5', '<') ) // if less than 2.5
105
+ exit('<h2>This plugin requires WordPress version 2.5 or newer. Please upgrade your WordPress installation or remove the plugin.</h2>');
 
 
 
 
 
 
 
106
 
107
+ @include_once( dirname(__FILE__) . '/tadv_defaults.php');
108
+
109
+ if ( isset($tadv_toolbars) ) {
110
+ add_option( 'tadv_toolbars', $tadv_toolbars, '', 'no' );
111
+ add_option( 'tadv_options', $tadv_options, '', 'no' );
112
+ add_option( 'tadv_plugins', $tadv_plugins, '', 'no' );
113
+ add_option( 'tadv_btns1', $tadv_btns1, '', 'no' );
114
+ add_option( 'tadv_btns2', $tadv_btns2, '', 'no' );
115
+ add_option( 'tadv_btns3', $tadv_btns3, '', 'no' );
116
+ add_option( 'tadv_btns4', $tadv_btns4, '', 'no' );
117
+ add_option( 'tadv_allbtns', $tadv_allbtns, '', 'no' );
118
+ }
119
+ }
120
+ }
121
  add_action( 'activate_tinymce-advanced/tinymce-advanced.php', 'tadv_activate' );
122
 
 
 
 
 
 
 
 
 
 
 
 
123
  if ( ! function_exists('tdav_css') ) {
124
+ function tdav_css($wp) {
125
+ $tadv_options = (array) get_option('tadv_options');
126
+
127
+ if ( $tadv_options['importcss'] == '1' )
128
+ $wp .= ',' . get_bloginfo('stylesheet_url');
129
+
130
+ return $wp .= ',' . get_bloginfo('wpurl') . '/wp-content/plugins/tinymce-advanced/css/tadv-mce.css';
131
+ }
132
+ }
133
  add_filter( 'mce_css', 'tdav_css' );
134
 
135
+ $tadv_allbtns = array();
136
+ $tadv_hidden_row = 0;
137
 
138
  if ( ! function_exists('tadv_mce_btns') ) {
139
+ function tadv_mce_btns($orig) {
140
+ global $tadv_allbtns, $tadv_hidden_row;
141
+ $tadv_btns1 = (array) get_option('tadv_btns1');
142
+ $tadv_allbtns = (array) get_option('tadv_allbtns');
143
+
144
+ if ( in_array( 'wp_adv', $tadv_btns1 ) )
145
+ $tadv_hidden_row = 2;
146
+
147
+ if ( is_array($orig) && ! empty($orig) ) {
148
+ $orig = array_diff( $orig, $tadv_allbtns );
149
+ $tadv_btns1 = array_merge( $tadv_btns1, $orig );
150
+ }
151
+ return $tadv_btns1;
152
+ }
153
+ }
154
+ add_filter( 'mce_buttons', 'tadv_mce_btns', 999 );
155
 
156
  if ( ! function_exists('tadv_mce_btns2') ) {
157
+ function tadv_mce_btns2($orig) {
158
+ global $tadv_allbtns, $tadv_hidden_row;
159
+ $tadv_btns2 = (array) get_option('tadv_btns2');
160
+
161
+ if ( in_array( 'wp_adv', $tadv_btns2 ) )
162
+ $tadv_hidden_row = 3;
163
+
164
+ if ( is_array($orig) && ! empty($orig) ) {
165
+ $orig = array_diff( $orig, $tadv_allbtns );
166
+ $tadv_btns2 = array_merge( $tadv_btns2, $orig );
167
+ }
168
+ return $tadv_btns2;
169
+ }
170
+ }
171
+ add_filter( 'mce_buttons_2', 'tadv_mce_btns2', 999 );
172
 
173
  if ( ! function_exists('tadv_mce_btns3') ) {
174
+ function tadv_mce_btns3($orig) {
175
+ global $tadv_allbtns, $tadv_hidden_row;
176
+ $tadv_btns3 = (array) get_option('tadv_btns3');
177
+
178
+ if ( in_array( 'wp_adv', $tadv_btns3 ) )
179
+ $tadv_hidden_row = 4;
180
+
181
+ if ( is_array($orig) && ! empty($orig) ) {
182
+ $orig = array_diff( $orig, $tadv_allbtns );
183
+ $tadv_btns3 = array_merge( $tadv_btns3, $orig );
184
+ }
185
+ return $tadv_btns3;
186
+ }
187
+ }
188
+ add_filter( 'mce_buttons_3', 'tadv_mce_btns3', 999 );
189
 
190
  if ( ! function_exists('tadv_mce_btns4') ) {
191
+ function tadv_mce_btns4($orig) {
192
+ global $tadv_allbtns;
193
+ $tadv_btns4 = (array) get_option('tadv_btns4');
194
+
195
+ if ( is_array($orig) && ! empty($orig) ) {
196
+ $orig = array_diff( $orig, $tadv_allbtns );
197
+ $tadv_btns4 = array_merge( $tadv_btns4, $orig );
198
+ }
199
+ return $tadv_btns4;
200
+ }
201
+ }
202
+ add_filter( 'mce_buttons_4', 'tadv_mce_btns4', 999 );
203
 
204
+ if ( ! function_exists('tadv_mce_options') ) {
205
+ function tadv_mce_options($init) {
206
+ global $tadv_hidden_row;
207
+ $tadv_options = get_option('tadv_options');
208
 
209
+ if ( $tadv_hidden_row > 0 )
210
+ $init['wordpress_adv_toolbar'] = 'toolbar' . $tadv_hidden_row;
211
+ else $init['wordpress_adv_hidden'] = false;
212
 
213
+ if ( isset($tadv_options['fix_autop']) && $tadv_options['fix_autop'] == 1 ) {
214
+ $init['apply_source_formatting'] = true;
215
+ }
216
+ return $init;
217
+ }
218
+ }
219
+ add_filter( 'tiny_mce_before_init', 'tadv_mce_options' );
220
+
221
+ if ( ! function_exists('tadv_htmledit') ) {
222
+ function tadv_htmledit($c) {
223
+ $tadv_options = get_option('tadv_options');
224
+
225
+ if ( isset($tadv_options['fix_autop']) && $tadv_options['fix_autop'] == 1 ) {
226
+ $c = preg_replace( array('/&amp;/','/&lt;/','/&gt;/'), array('&','<','>'), $c );
227
+ $c = wpautop($c);
228
+ $c = htmlspecialchars($c, ENT_NOQUOTES);
229
+ }
230
+ return $c;
231
+ }
232
+ }
233
+ add_filter('htmledit_pre', 'tadv_htmledit', 999);
234
+
235
+ if ( ! function_exists('tmce_init') ) {
236
+ function tmce_init() {
237
+ global $wp_scripts;
238
+ $tadv_options = get_option('tadv_options');
239
+
240
+ if ( ! isset($tadv_options['fix_autop']) || $tadv_options['fix_autop'] != 1 ) return;
241
+
242
+ $queue = $wp_scripts->queue;
243
+ if ( is_array($queue) && in_array( 'autosave', $queue ) )
244
+ wp_enqueue_script( 'tadv_replace', get_option('siteurl') . '/wp-content/plugins/tinymce-advanced/js/tadv_replace.js', array('editor_functions'), '20080425' );
245
+ }
246
+ }
247
+ add_action( 'admin_print_scripts', 'tmce_init' );
248
 
249
  if ( ! function_exists('tadv_load_plugins') ) {
250
+ function tadv_load_plugins($plug) {
251
+ $tadv_plugins = (array) get_option('tadv_plugins');
252
+ $plugpath = get_bloginfo('wpurl') . '/wp-content/plugins/tinymce-advanced/mce/';
253
+
254
+ $plug = (array) $plug;
255
+ foreach( $tadv_plugins as $plugin )
256
+ $plug["$plugin"] = $plugpath . $plugin . '/editor_plugin.js';
257
+
258
+ return $plug;
259
+ }
260
+ }
261
+ add_action( 'mce_external_plugins', 'tadv_load_plugins', 999 );
262
 
263
  if ( ! function_exists('tadv_load_langs') ) {
264
+ function tadv_load_langs($langs) {
265
+ $tadv_plugins = (array) get_option('tadv_plugins');
266
+ $langpath = ABSPATH . '/' . PLUGINDIR . '/tinymce-advanced/mce/';
267
+ $nolangs = array( 'bbcode', 'contextmenu', 'insertdatetime', 'layer', 'nonbreaking', 'print', 'visualchars', 'emotions', 'tadvreplace' );
268
+
269
+ $langs = (array) $langs;
270
+ foreach( $tadv_plugins as $plugin ) {
271
+ if ( in_array( $plugin, $nolangs ) ) continue;
272
+ $langs["$plugin"] = $langpath . $plugin . '/langs/langs.php';
273
+ }
274
+ return $langs;
275
  }
276
+ }
 
 
277
  add_filter( 'mce_external_languages', 'tadv_load_langs' );
278
 
279
  if ( ! function_exists('tadv_page') ) {
280
+ function tadv_page() {
281
+ include_once( dirname(__FILE__) . '/tadv_admin.php');
282
+ }
283
+ }
284
 
285
  if ( ! function_exists('tadv_menu') ) {
286
+ function tadv_menu() {
287
+ if ( function_exists('add_management_page') ) {
288
+ $page = add_management_page( 'TinyMCE Advanced', 'TinyMCE Advanced', 9, __FILE__, 'tadv_page' );
289
+ add_action( "admin_print_scripts-$page", 'tadv_admin_head' );
290
+ }
291
  }
292
+ }
293
  add_action( 'admin_menu', 'tadv_menu' );
294
+
295
  ?>
utils/mctabs.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * $Id: mctabs.js 520 2008-01-07 16:30:32Z spocke $
3
  *
4
  * Moxiecode DHTML Tabs script.
5
  *
@@ -8,7 +8,7 @@
8
  */
9
 
10
  function MCTabs() {
11
- this.settings = new Array();
12
  };
13
 
14
  MCTabs.prototype.init = function(settings) {
@@ -28,17 +28,19 @@ MCTabs.prototype.getParam = function(name, default_value) {
28
  };
29
 
30
  MCTabs.prototype.displayTab = function(tab_id, panel_id) {
31
- var panelElm = document.getElementById(panel_id);
32
- var panelContainerElm = panelElm ? panelElm.parentNode : null;
33
- var tabElm = document.getElementById(tab_id);
34
- var tabContainerElm = tabElm ? tabElm.parentNode : null;
35
- var selectionClass = this.getParam('selection_class', 'current');
 
 
36
 
37
  if (tabElm && tabContainerElm) {
38
- var nodes = tabContainerElm.childNodes;
39
 
40
  // Hide all other tabs
41
- for (var i=0; i<nodes.length; i++) {
42
  if (nodes[i].nodeName == "LI")
43
  nodes[i].className = '';
44
  }
@@ -48,10 +50,10 @@ MCTabs.prototype.displayTab = function(tab_id, panel_id) {
48
  }
49
 
50
  if (panelElm && panelContainerElm) {
51
- var nodes = panelContainerElm.childNodes;
52
 
53
  // Hide all other panels
54
- for (var i=0; i<nodes.length; i++) {
55
  if (nodes[i].nodeName == "DIV")
56
  nodes[i].className = 'panel';
57
  }
1
  /**
2
+ * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $
3
  *
4
  * Moxiecode DHTML Tabs script.
5
  *
8
  */
9
 
10
  function MCTabs() {
11
+ this.settings = [];
12
  };
13
 
14
  MCTabs.prototype.init = function(settings) {
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
  }
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
  }
utils/validate.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * $Id: validate.js 673 2008-03-06 13:26:20Z spocke $
3
  *
4
  * Various form validation methods.
5
  *
@@ -110,7 +110,7 @@ var AutoValidator = {
110
  },
111
 
112
  reset : function(e) {
113
- var t = new Array('label', 'input', 'select', 'textarea');
114
  var i, j, nl, s = this.settings;
115
 
116
  if (e == null)
1
  /**
2
+ * $Id: validate.js 758 2008-03-30 13:53:29Z spocke $
3
  *
4
  * Various form validation methods.
5
  *
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)