TinyMCE Advanced - Version 3.1

Version Description

Download this release

Release Info

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

Code changes from version 3.0.1 to 3.1

Files changed (81) hide show
  1. css/tadv-styles.css +127 -121
  2. images/Thumbs.db +0 -0
  3. images/insertfile.gif +0 -0
  4. images/insertimage.gif +0 -0
  5. js/tadv-all.js +0 -4
  6. js/tadv.js +110 -0
  7. js/tadv_replace.js +7 -4
  8. mce/advhr/css/advhr.css +5 -5
  9. mce/advhr/js/rule.js +43 -34
  10. mce/advhr/langs/en_dlg.js +4 -4
  11. mce/advhr/langs/ja_dlg.js +3 -3
  12. mce/advhr/langs/langs.php +2 -2
  13. mce/advhr/rule.htm +63 -63
  14. mce/advimage/css/advimage.css +13 -13
  15. mce/advimage/image.htm +238 -238
  16. mce/advimage/js/image.js +441 -441
  17. mce/advimage/langs/en_dlg.js +42 -42
  18. mce/advimage/langs/ja_dlg.js +40 -40
  19. mce/advimage/langs/langs.php +2 -2
  20. mce/advlink/css/advlink.css +8 -8
  21. mce/advlink/js/advlink.js +527 -528
  22. mce/advlink/langs/en_dlg.js +51 -51
  23. mce/advlink/langs/ja_dlg.js +50 -50
  24. mce/advlink/langs/langs.php +2 -2
  25. mce/advlink/link.htm +339 -339
  26. mce/contextmenu/editor_plugin.js +1 -1
  27. mce/iespell/editor_plugin.js +1 -0
  28. mce/searchreplace/css/searchreplace.css +6 -6
  29. mce/searchreplace/js/searchreplace.js +117 -117
  30. mce/searchreplace/langs/en_dlg.js +15 -15
  31. mce/searchreplace/langs/ja_dlg.js +13 -13
  32. mce/searchreplace/langs/langs.php +2 -2
  33. mce/searchreplace/searchreplace.htm +105 -105
  34. mce/style/css/props.css +13 -13
  35. mce/style/js/props.js +641 -641
  36. mce/style/langs/en_dlg.js +62 -62
  37. mce/style/langs/ja_dlg.js +57 -57
  38. mce/style/langs/langs.php +2 -2
  39. mce/style/props.htm +6 -6
  40. mce/table/cell.htm +184 -184
  41. mce/table/css/cell.css +16 -16
  42. mce/table/css/row.css +25 -25
  43. mce/table/css/table.css +13 -13
  44. mce/table/editor_plugin.js +1 -1
  45. mce/table/js/cell.js +259 -259
  46. mce/table/js/merge_cells.js +29 -29
  47. mce/table/js/row.js +212 -212
  48. mce/table/js/table.js +410 -410
  49. mce/table/langs/en_dlg.js +73 -73
  50. mce/table/langs/ja_dlg.js +70 -70
  51. mce/table/langs/langs.php +2 -2
  52. mce/table/merge_cells.htm +38 -38
  53. mce/table/row.htm +161 -161
  54. mce/table/table.htm +193 -193
  55. mce/xhtmlxtras/abbr.htm +149 -149
  56. mce/xhtmlxtras/acronym.htm +149 -149
  57. mce/xhtmlxtras/attributes.htm +154 -154
  58. mce/xhtmlxtras/cite.htm +149 -149
  59. mce/xhtmlxtras/css/attributes.css +11 -11
  60. mce/xhtmlxtras/css/popup.css +9 -9
  61. mce/xhtmlxtras/del.htm +170 -170
  62. mce/xhtmlxtras/ins.htm +170 -170
  63. mce/xhtmlxtras/js/abbr.js +25 -25
  64. mce/xhtmlxtras/js/acronym.js +25 -25
  65. mce/xhtmlxtras/js/attributes.js +123 -123
  66. mce/xhtmlxtras/js/cite.js +25 -25
  67. mce/xhtmlxtras/js/del.js +50 -50
  68. mce/xhtmlxtras/js/element_common.js +220 -220
  69. mce/xhtmlxtras/js/ins.js +49 -49
  70. mce/xhtmlxtras/langs/en_dlg.js +31 -31
  71. mce/xhtmlxtras/langs/ja_dlg.js +26 -26
  72. mce/xhtmlxtras/langs/langs.php +2 -2
  73. readme.txt +7 -5
  74. tadv_admin.php +210 -233
  75. tadv_defaults.php +0 -2
  76. tiny_mce_popup.js +275 -275
  77. tinymce-advanced.php +72 -138
  78. utils/editable_selects.js +69 -61
  79. utils/form_utils.js +199 -199
  80. utils/mctabs.js +76 -76
  81. utils/validate.js +219 -219
css/tadv-styles.css CHANGED
@@ -1,213 +1,219 @@
1
  body {
2
- height: 100%;
3
  }
4
- input.tadv-chk {
5
- border: none;
6
- padding: 0;
 
7
  }
8
  * html input.tadv-chk {
9
- margin: 0;
10
- background-color:#eaeaea;
11
  }
12
- label.tadv-box {
13
- margin: 0 2px;
14
- padding: 1px 3px 3px 7px;
15
- background-color: #eaeaea;
16
- cursor: default;
17
- line-height: 28px;
18
  }
19
  * html label.tadv-box {
20
- padding: 0 3px 1px 8px;
21
  }
22
  form#tadvadmin {
23
- margin-left: 17px;
24
  }
25
  #tadvadmin p {
26
- margin: 6px 0;
27
  }
28
  .separator, .tadvmodule {
29
- position: relative;
30
- top: 0px;
31
- left: 0px;
32
- z-index: 0;
33
- opacity: 0.999999;
34
  }
35
  #tadvadmin, #tadvzones, #tadvpalette {
36
- -moz-user-select: none;
37
- -khtml-user-select: none;
38
- user-select: none;
39
  }
40
  * ul, * ul li {
41
- list-style-type: none;
42
  }
43
  #tadvadmin p.submit {
44
- padding-right: 10px;
45
  }
46
  #tadvadmin #save {
47
- float: right;
48
  }
49
  .tadv_btn {
50
- margin-left: 20px;
51
  }
52
  #tadvzones {
53
- margin-right: 240px;
54
  }
55
  .tadvdropzone {
56
- float: left;
57
- width: 99.99%;
58
- padding: 0;
59
- height: 40px;
60
- margin: 8px 0;
61
- z-index: -1;
62
  }
63
  .tadvdropzone .descr {
64
- display: none;
65
  }
66
  .tadvdropzone .tadvmodule .tadvitem {
67
- background: url(../images/fade-butt.png) repeat scroll;
68
- border:1px solid #999999;
69
- display:block;
70
- height:20px;
71
- margin:1px;
72
- padding:1px 2px;
73
- width:20px;
74
  }
75
  .tadvdropzone ul {
76
- height: 30px;
77
- background-color: #83B4D5;
78
- width: 99.99%;
79
- float: left;
80
- margin: 0;
81
- padding: 2px 4px;
82
  }
83
  #tadvadmin .tadvmodule {
84
- cursor: crosshair;
85
- position: relative;
86
  }
87
  .tadvdropzone .tadvmodule {
88
- width: 29px;
89
- height: 27px;
90
- margin: 2px 0 0;
91
- padding: 0;
92
- float: left;
93
  }
94
  #tadvadmin img {
95
- border: 0;
96
- vertical-align: -6px;
97
- margin: 0;
98
  }
99
  #tadvpalette li, .tadvdropzone li {
100
- float: left;
101
- margin: 0;
102
- padding: 0;
103
- border: none;
104
- margin-bottom: 0;
105
  }
106
  #tadvpalette {
107
- border: 1px solid #bbb;
108
- background-color: #f0f0ee;
109
- height: 64px;
110
- padding: 4px;
111
- margin: 8px 0;
112
  }
113
  #tadvpalette .tadvmodule .tadvitem {
114
- display: block;
115
- height: 22px;
116
- width: 134px;
117
- border: 1px solid #bbb;
118
- background-color: #fff;
119
- margin: 4px;
120
  }
121
  #tadvpalette .tadvmodule .descr {
122
- display: inline;
123
- margin-left: 2px;
124
  }
125
  * html #tadvpalette .tadvmodule img {
126
- vertical-align: middle;
127
  }
128
  #tadvpalette .tadvitem img {
129
- padding: 1px 0 0 2px;
130
  }
131
  #pre_formatselect.tadvmodule .tadvitem,
132
  #pre_styleselect.tadvmodule .tadvitem,
133
  #pre_fontsizeselect.tadvmodule .tadvitem,
134
  #pre_fontselect.tadvmodule .tadvitem {
135
- width: 98px;
136
  }
137
  #pre_tablecontrols.tadvmodule .tadvitem {
138
- width: 335px;
139
  }
140
  #pre_vipersvideoquicktags.tadvmodule .tadvitem {
141
- width: 305px;
142
  }
143
- .tadvdropzone #pre_formatselect,
144
- .tadvdropzone #pre_styleselect,
145
- .tadvdropzone #pre_fontsizeselect,
146
  .tadvdropzone #pre_fontselect {
147
- width: 101px;
148
  }
149
  .tadvdropzone #pre_formatselect .tadvitem,
150
  .tadvdropzone #pre_styleselect .tadvitem,
151
  .tadvdropzone #pre_fontsizeselect .tadvitem,
152
  .tadvdropzone #pre_fontselect .tadvitem {
153
- width: 92px;
154
  }
155
  .tadvdropzone #pre_tablecontrols {
156
- width: 294px;
157
  }
158
  .tadvdropzone #pre_tablecontrols .tadvitem {
159
- width: 285px;
160
  }
161
  .tadvdropzone #pre_layer {
162
- width: 97px;
163
  }
164
  .tadvdropzone #pre_layer .tadvitem {
165
- width: 88px;
166
  }
167
  .tadvdropzone #pre_vipersvideoquicktags{
168
- width: 215px;
169
  }
170
  .tadvdropzone #pre_vipersvideoquicktags .tadvitem {
171
- width: 206px;
172
  }
173
  #tadvpalette .separator, .tadvdropzone .separator {
174
- float: left;
175
- cursor: crosshair;
176
  }
177
  .separator .tadvitem {
178
- background: #333333 none repeat scroll 0%;
179
- display: block;
180
- height: 26px;
181
- margin: 0 2px;
182
- width: 1px;
183
  }
184
  #tadvpalette .separator .tadvitem {
185
- background: #83B4D5 none repeat scroll 0% 50%;
186
- border: 1px solid #AAAAAA;
187
- display: block;
188
- height: 20px;
189
- margin: 4px;
190
- padding: 1px 3px;
191
  }
192
  * html #tadvpalette .separator .tadvitem img {
193
- margin: 1px 0 -2px 1px;
194
  }
195
  .tadvdropzone .separator {
196
- background: transparent;
197
- display: block;
198
- height: 28px;
199
- margin: 2px 1px 0pt 0pt;
200
  }
201
- #tadvWarnmsg {
202
- color: #ff0000;
203
- font-weight: bold;
204
- height: 26px;
205
- line-height: 26px;
206
  }
207
  #tadv_uninst_div {
208
- display: none;
209
- background: #FFFFE0;
210
- border: 1px solid #E6DB55;
211
- padding: 8px;
212
- margin-left: 20px;
213
- }
 
 
 
 
 
1
  body {
2
+ height: 100%;
3
  }
4
+ input.tadv-chk {
5
+ border: none;
6
+ padding: 0;
7
+ vertical-align: middle;
8
  }
9
  * html input.tadv-chk {
10
+ margin: 0;
11
+ background-color:#eaeaea;
12
  }
13
+ label.tadv-box {
14
+ margin: 0 2px;
15
+ padding: 1px 3px 3px 7px;
16
+ background-color: #eaeaea;
17
+ cursor: default;
18
+ line-height: 28px;
19
  }
20
  * html label.tadv-box {
21
+ padding: 0 3px 1px 8px;
22
  }
23
  form#tadvadmin {
24
+ margin-left: 17px;
25
  }
26
  #tadvadmin p {
27
+ margin: 6px 0;
28
  }
29
  .separator, .tadvmodule {
30
+ position: relative;
31
+ top: 0px;
32
+ left: 0px;
33
+ z-index: 0;
34
+ opacity: 0.999999;
35
  }
36
  #tadvadmin, #tadvzones, #tadvpalette {
37
+ -moz-user-select: none;
38
+ -khtml-user-select: none;
39
+ user-select: none;
40
  }
41
  * ul, * ul li {
42
+ list-style-type: none;
43
  }
44
  #tadvadmin p.submit {
45
+ padding-right: 10px;
46
  }
47
  #tadvadmin #save {
48
+ float: right;
49
  }
50
  .tadv_btn {
51
+ margin-left: 8px;
52
  }
53
  #tadvzones {
54
+ margin-right: 240px;
55
  }
56
  .tadvdropzone {
57
+ float: left;
58
+ width: 99.99%;
59
+ padding: 0;
60
+ height: 40px;
61
+ margin: 8px 0;
62
+ z-index: -1;
63
  }
64
  .tadvdropzone .descr {
65
+ display: none;
66
  }
67
  .tadvdropzone .tadvmodule .tadvitem {
68
+ background: url(../images/fade-butt.png) repeat scroll;
69
+ border:1px solid #999999;
70
+ display:block;
71
+ height:20px;
72
+ margin:1px;
73
+ padding:1px 2px;
74
+ width:20px;
75
  }
76
  .tadvdropzone ul {
77
+ height: 30px;
78
+ background-color: #83B4D5;
79
+ width: 99.99%;
80
+ float: left;
81
+ margin: 0;
82
+ padding: 2px 4px;
83
  }
84
  #tadvadmin .tadvmodule {
85
+ cursor: crosshair;
86
+ position: relative;
87
  }
88
  .tadvdropzone .tadvmodule {
89
+ width: 29px;
90
+ height: 27px;
91
+ margin: 2px 0 0;
92
+ padding: 0;
93
+ float: left;
94
  }
95
  #tadvadmin img {
96
+ border: 0;
97
+ vertical-align: -6px;
98
+ margin: 0;
99
  }
100
  #tadvpalette li, .tadvdropzone li {
101
+ float: left;
102
+ margin: 0;
103
+ padding: 0;
104
+ border: none;
105
+ margin-bottom: 0;
106
  }
107
  #tadvpalette {
108
+ border: 1px solid #bbb;
109
+ background-color: #f0f0ee;
110
+ height: 64px;
111
+ padding: 4px;
112
+ margin: 8px 0;
113
  }
114
  #tadvpalette .tadvmodule .tadvitem {
115
+ display: block;
116
+ height: 22px;
117
+ width: 134px;
118
+ border: 1px solid #bbb;
119
+ background-color: #fff;
120
+ margin: 4px;
121
  }
122
  #tadvpalette .tadvmodule .descr {
123
+ display: inline;
124
+ font-size: 12px;
125
  }
126
  * html #tadvpalette .tadvmodule img {
127
+ vertical-align: middle;
128
  }
129
  #tadvpalette .tadvitem img {
130
+ padding: 1px 0 0 2px;
131
  }
132
  #pre_formatselect.tadvmodule .tadvitem,
133
  #pre_styleselect.tadvmodule .tadvitem,
134
  #pre_fontsizeselect.tadvmodule .tadvitem,
135
  #pre_fontselect.tadvmodule .tadvitem {
136
+ width: 98px;
137
  }
138
  #pre_tablecontrols.tadvmodule .tadvitem {
139
+ width: 335px;
140
  }
141
  #pre_vipersvideoquicktags.tadvmodule .tadvitem {
142
+ width: 305px;
143
  }
144
+ .tadvdropzone #pre_formatselect,
145
+ .tadvdropzone #pre_styleselect,
146
+ .tadvdropzone #pre_fontsizeselect,
147
  .tadvdropzone #pre_fontselect {
148
+ width: 101px;
149
  }
150
  .tadvdropzone #pre_formatselect .tadvitem,
151
  .tadvdropzone #pre_styleselect .tadvitem,
152
  .tadvdropzone #pre_fontsizeselect .tadvitem,
153
  .tadvdropzone #pre_fontselect .tadvitem {
154
+ width: 92px;
155
  }
156
  .tadvdropzone #pre_tablecontrols {
157
+ width: 294px;
158
  }
159
  .tadvdropzone #pre_tablecontrols .tadvitem {
160
+ width: 285px;
161
  }
162
  .tadvdropzone #pre_layer {
163
+ width: 97px;
164
  }
165
  .tadvdropzone #pre_layer .tadvitem {
166
+ width: 88px;
167
  }
168
  .tadvdropzone #pre_vipersvideoquicktags{
169
+ width: 215px;
170
  }
171
  .tadvdropzone #pre_vipersvideoquicktags .tadvitem {
172
+ width: 206px;
173
  }
174
  #tadvpalette .separator, .tadvdropzone .separator {
175
+ float: left;
176
+ cursor: crosshair;
177
  }
178
  .separator .tadvitem {
179
+ background: #333333 none repeat scroll 0%;
180
+ display: block;
181
+ height: 26px;
182
+ margin: 0 2px;
183
+ width: 1px;
184
  }
185
  #tadvpalette .separator .tadvitem {
186
+ background: #83B4D5 none repeat scroll 0% 50%;
187
+ border: 1px solid #AAAAAA;
188
+ display: block;
189
+ height: 20px;
190
+ margin: 4px;
191
+ padding: 1px 3px;
192
  }
193
  * html #tadvpalette .separator .tadvitem img {
194
+ margin: 1px 0 -2px 1px;
195
  }
196
  .tadvdropzone .separator {
197
+ background: transparent;
198
+ display: block;
199
+ height: 28px;
200
+ margin: 2px 1px 0pt 0pt;
201
  }
202
+ #tadvWarnmsg, #tadvWarnmsg2 {
203
+ color: #ff0000;
204
+ font-weight: bold;
205
+ height: 26px;
206
+ line-height: 26px;
207
  }
208
  #tadv_uninst_div {
209
+ display: none;
210
+ background: #FFFFE0;
211
+ border: 1px solid #E6DB55;
212
+ padding: 8px;
213
+ margin-left: 20px;
214
+ }
215
+ .ui-sortable-helper {
216
+ opacity: 0.6;
217
+ filter: alpha(opacity=60);
218
+ z-index: 100;
219
+ }
images/Thumbs.db DELETED
Binary file
images/insertfile.gif ADDED
Binary file
images/insertimage.gif ADDED
Binary file
js/tadv-all.js DELETED
@@ -1,4 +0,0 @@
1
- var Prototype={Version:'1.5.0',BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:'(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',emptyFunction:function(){},K:function(a){return a}};var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};var Abstract=new Object();Object.extend=function(a,b){for(var c in b){a[c]=b[c]}return a};Object.extend(Object,{inspect:function(a){try{if(a===undefined)return'undefined';if(a===null)return'null';return a.inspect?a.inspect():a.toString()}catch(e){if(e instanceof RangeError)return'...';throw e;}},keys:function(a){var b=[];for(var c in a)b.push(c);return b},values:function(a){var b=[];for(var c in a)b.push(a[c]);return b},clone:function(a){return Object.extend({},a)}});Function.prototype.bind=function(){var a=this,args=$A(arguments),object=args.shift();return function(){return a.apply(object,args.concat($A(arguments)))}};Function.prototype.bindAsEventListener=function(b){var c=this,args=$A(arguments),b=args.shift();return function(a){return c.apply(b,[(a||window.event)].concat(args).concat($A(arguments)))}};Object.extend(Number.prototype,{toColorPart:function(){var a=this.toString(16);if(this<16)return'0'+a;return a},succ:function(){return this+1},times:function(a){$R(0,this,true).each(a);return this}});var Try={these:function(){var a;for(var i=0,length=arguments.length;i<length;i++){var b=arguments[i];try{a=b();break}catch(e){}}return a}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},stop:function(){if(!this.timer)return;clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this)}finally{this.currentlyExecuting=false}}}};String.interpret=function(a){return a==null?'':String(a)};Object.extend(String.prototype,{gsub:function(a,b){var c='',source=this,match;b=arguments.callee.prepareReplacement(b);while(source.length>0){if(match=source.match(a)){c+=source.slice(0,match.index);c+=String.interpret(b(match));source=source.slice(match.index+match[0].length)}else{c+=source,source=''}}return c},sub:function(b,c,d){c=this.gsub.prepareReplacement(c);d=d===undefined?1:d;return this.gsub(b,function(a){if(--d<0)return a[0];return c(a)})},scan:function(a,b){this.gsub(a,b);return this},truncate:function(a,b){a=a||30;b=b===undefined?'...':b;return this.length>a?this.slice(0,a-b.length)+b:this},strip:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'')},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'')},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'')},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,'img');var c=new RegExp(Prototype.ScriptFragment,'im');return(this.match(b)||[]).map(function(a){return(a.match(c)||['',''])[1]})},evalScripts:function(){return this.extractScripts().map(function(a){return eval(a)})},escapeHTML:function(){var a=document.createElement('div');var b=document.createTextNode(this);a.appendChild(b);return a.innerHTML},unescapeHTML:function(){var c=document.createElement('div');c.innerHTML=this.stripTags();return c.childNodes[0]?(c.childNodes.length>1?$A(c.childNodes).inject('',function(a,b){return a+b.nodeValue}):c.childNodes[0].nodeValue):''},toQueryParams:function(e){var f=this.strip().match(/([^?#]*)(#.*)?$/);if(!f)return{};return f[1].split(e||'&').inject({},function(a,b){if((b=b.split('='))[0]){var c=decodeURIComponent(b[0]);var d=b[1]?decodeURIComponent(b[1]):undefined;if(a[c]!==undefined){if(a[c].constructor!=Array)a[c]=[a[c]];if(d)a[c].push(d)}else a[c]=d}return a})},toArray:function(){return this.split('')},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},camelize:function(){var a=this.split('-'),len=a.length;if(len==1)return a[0];var b=this.charAt(0)=='-'?a[0].charAt(0).toUpperCase()+a[0].substring(1):a[0];for(var i=1;i<len;i++)b+=a[i].charAt(0).toUpperCase()+a[i].substring(1);return b},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,'/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase()},dasherize:function(){return this.gsub(/_/,'-')},inspect:function(a){var b=this.replace(/\\/g,'\\\\');if(useDoubleQuotes)return'"'+escapedString.replace(/"/g,'\\"')+'"';else return"'"+escapedString.replace(/'/g,'\\\'')+"'"}});String.prototype.gsub.prepareReplacement=function(b){if(typeof b=='function')return b;var c=new Template(b);return function(a){return c.evaluate(a)}};String.prototype.parseQuery=String.prototype.toQueryParams;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(c){return this.template.gsub(this.pattern,function(a){var b=a[1];if(b=='\\')return a[2];return b+String.interpret(c[a[3]])})}};var $break=new Object();var $continue=new Object();var Enumerable={each:function(b){var c=0;try{this._each(function(a){try{b(a,c++)}catch(e){if(e!=$continue)throw e;}})}catch(e){if(e!=$break)throw e;}return this},eachSlice:function(a,b){var c=-a,slices=[],array=this.toArray();while((c+=a)<array.length)slices.push(array.slice(c,c+a));return slices.map(b)},all:function(c){var d=true;this.each(function(a,b){d=d&&!!(c||Prototype.K)(a,b);if(!d)throw $break;});return d},any:function(c){var d=false;this.each(function(a,b){if(d=!!(c||Prototype.K)(a,b))throw $break;});return d},collect:function(c){var d=[];this.each(function(a,b){d.push((c||Prototype.K)(a,b))});return d},detect:function(c){var d;this.each(function(a,b){if(c(a,b)){d=a;throw $break;}});return d},findAll:function(c){var d=[];this.each(function(a,b){if(c(a,b))d.push(a)});return d},grep:function(d,e){var f=[];this.each(function(a,b){var c=a.toString();if(c.match(d))f.push((e||Prototype.K)(a,b))});return f},include:function(b){var c=false;this.each(function(a){if(a==b){c=true;throw $break;}});return c},inGroupsOf:function(b,c){c=c===undefined?null:c;return this.eachSlice(b,function(a){while(a.length<b)a.push(c);return a})},inject:function(c,d){this.each(function(a,b){c=d(c,a,b)});return c},invoke:function(b){var c=$A(arguments).slice(1);return this.map(function(a){return a[b].apply(a,c)})},max:function(c){var d;this.each(function(a,b){a=(c||Prototype.K)(a,b);if(d==undefined||a>=d)d=a});return d},min:function(c){var d;this.each(function(a,b){a=(c||Prototype.K)(a,b);if(d==undefined||a<d)d=a});return d},partition:function(c){var d=[],falses=[];this.each(function(a,b){((c||Prototype.K)(a,b)?d:falses).push(a)});return[d,falses]},pluck:function(c){var d=[];this.each(function(a,b){d.push(a[c])});return d},reject:function(c){var d=[];this.each(function(a,b){if(!c(a,b))d.push(a)});return d},sortBy:function(e){return this.map(function(a,b){return{value:a,criteria:e(a,b)}}).sort(function(c,d){var a=c.criteria,b=d.criteria;return a<b?-1:a>b?1:0}).pluck('value')},toArray:function(){return this.map()},zip:function(){var c=Prototype.K,args=$A(arguments);if(typeof args.last()=='function')c=args.pop();var d=[this].concat(args).map($A);return this.map(function(a,b){return c(d.pluck(b))})},size:function(){return this.toArray().length},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>'}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(a){if(!a)return[];if(a.toArray){return a.toArray()}else{var b=[];for(var i=0,length=a.length;i<length;i++)b.push(a[i]);return b}};Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(a){for(var i=0,length=this.length;i<length;i++)a(this[i])},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(a,b){return a.concat(b&&b.constructor==Array?b.flatten():[b])})},without:function(){var b=$A(arguments);return this.select(function(a){return!b.include(a)})},indexOf:function(a){for(var i=0,length=this.length;i<length;i++)if(this[i]==a)return i;return-1},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(){return this.inject([],function(a,b){return a.include(b)?a:a.concat([b])})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']'}});Array.prototype.toArray=Array.prototype.clone;function $w(a){a=a.strip();return a?a.split(/\s+/):[]}if(window.opera){Array.prototype.concat=function(){var a=[];for(var i=0,length=this.length;i<length;i++)a.push(this[i]);for(var i=0,length=arguments.length;i<length;i++){if(arguments[i].constructor==Array){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++)a.push(arguments[i][j])}else{a.push(arguments[i])}}return a}}var Hash=function(a){Object.extend(this,a||{})};Object.extend(Hash,{toQueryString:function(d){var e=[];this.prototype._each.call(d,function(b){if(!b.key)return;if(b.value&&b.value.constructor==Array){var c=b.value.compact();if(c.length<2)b.value=c.reduce();else{key=encodeURIComponent(b.key);c.each(function(a){a=a!=undefined?encodeURIComponent(a):'';e.push(key+'='+encodeURIComponent(a))});return}}if(b.value==undefined)b[1]='';e.push(b.map(encodeURIComponent).join('='))});return e.join('&')}});Object.extend(Hash.prototype,Enumerable);Object.extend(Hash.prototype,{_each:function(a){for(var b in this){var c=this[b];if(c&&c==Hash.prototype[b])continue;var d=[b,c];d.key=b;d.value=c;a(d)}},keys:function(){return this.pluck('key')},values:function(){return this.pluck('value')},merge:function(c){return $H(c).inject(this,function(a,b){a[b.key]=b.value;return a})},remove:function(){var a;for(var i=0,length=arguments.length;i<length;i++){var b=this[arguments[i]];if(b!==undefined){if(a===undefined)a=b;else{if(a.constructor!=Array)a=[a];a.push(b)}}delete this[arguments[i]]}return a},toQueryString:function(){return Hash.toQueryString(this)},inspect:function(){return'#<Hash:{'+this.map(function(a){return a.map(Object.inspect).join(': ')}).join(', ')+'}>'}});function $H(a){if(a&&a.constructor==Hash)return a;return new Hash(a)};ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(a,b,c){this.start=a;this.end=b;this.exclusive=c},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a<this.start)return false;if(this.exclusive)return a<this.end;return a<=this.end}});var $R=function(a,b,c){return new ObjectRange(a,b,c)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a))this.responders.push(a)},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(b,c,d,f){this.each(function(a){if(typeof a[b]=='function'){try{a[b].apply(a,[c,d,f])}catch(e){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(a){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:''};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=='string')this.options.parameters=this.options.parameters.toQueryParams()}};Ajax.Request=Class.create();Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(a,b){this.transport=Ajax.getTransport();this.setOptions(b);this.request(a)},request:function(a){this.url=a;this.method=this.options.method;var b=this.options.parameters;if(!['get','post'].include(this.method)){b['_method']=this.method;this.method='post'}b=Hash.toQueryString(b);if(b&&/Konqueror|Safari|KHTML/.test(navigator.userAgent))b+='&_=';if(this.method=='get'&&b)this.url+=(this.url.indexOf('?')>-1?'&':'?')+b;try{Ajax.Responders.dispatch('onCreate',this,this.transport);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous)setTimeout(function(){this.respondToReadyState(1)}.bind(this),10);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();var c=this.method=='post'?(this.options.postBody||b):null;this.transport.send(c);if(!this.options.asynchronous&&this.transport.overrideMimeType)this.onStateChange()}catch(e){this.dispatchException(e)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete))this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var b={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){b['Content-type']=this.options.contentType+(this.options.encoding?'; charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)b['Connection']='close'}if(typeof this.options.requestHeaders=='object'){var c=this.options.requestHeaders;if(typeof c.push=='function')for(var i=0,length=c.length;i<length;i+=2)b[c[i]]=c[i+1];else $H(c).each(function(a){b[a.key]=a.value})}for(var d in b)this.transport.setRequestHeader(d,b[d])},success:function(){return!this.transport.status||(this.transport.status>=200&&this.transport.status<300)},respondToReadyState:function(a){var b=Ajax.Request.Events[a];var c=this.transport,json=this.evalJSON();if(b=='Complete'){try{this._complete=true;(this.options['on'+this.transport.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(c,json)}catch(e){this.dispatchException(e)}if((this.getHeader('Content-type')||'text/javascript').strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i))this.evalResponse()}try{(this.options['on'+b]||Prototype.emptyFunction)(c,json);Ajax.Responders.dispatch('on'+b,this,c,json)}catch(e){this.dispatchException(e)}if(b=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction}},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(e){return null}},evalJSON:function(){try{var a=this.getHeader('X-JSON');return a?eval('('+a+')'):null}catch(e){return null}},evalResponse:function(){try{return eval(this.transport.responseText)}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch('onException',this,a)}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(c,d,e){this.container={success:(c.success||c),failure:(c.failure||(c.success?null:c))};this.transport=Ajax.getTransport();this.setOptions(e);var f=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(a,b){this.updateContent();f(a,b)}).bind(this);this.request(d)},updateContent:function(){var a=this.container[this.success()?'success':'failure'];var b=this.transport.responseText;if(!this.options.evalScripts)b=b.stripScripts();if(a=$(a)){if(this.options.insertion)new this.options.insertion(a,b);else a.update(b)}if(this.success()){if(this.onComplete)setTimeout(this.onComplete.bind(this),10)}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(a,b,c){this.setOptions(c);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=b;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(a){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)elements.push($(arguments[i]));return elements}if(typeof a=='string')a=document.getElementById(a);return Element.extend(a)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(a,b){var c=[];var d=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=d.snapshotLength;i<length;i++)c.push(d.snapshotItem(i));return c}}document.getElementsByClassName=function(a,b){if(Prototype.BrowserFeatures.XPath){var q=".//*[contains(concat(' ', @class, ' '), ' "+a+" ')]";return document._getElementsByXPath(q,b)}else{var c=($(b)||document.body).getElementsByTagName('*');var d=[],child;for(var i=0,length=c.length;i<length;i++){child=c[i];if(Element.hasClassName(child,a))d.push(Element.extend(child))}return d}};if(!window.Element)var Element=new Object();Element.extend=function(a){if(!a||_nativeExtensions||a.nodeType==3)return a;if(!a._extended&&a.tagName&&a!=window){var b=Object.clone(Element.Methods),cache=Element.extend.cache;if(a.tagName=='FORM')Object.extend(b,Form.Methods);if(['INPUT','TEXTAREA','SELECT'].include(a.tagName))Object.extend(b,Form.Element.Methods);Object.extend(b,Element.Methods.Simulated);for(var c in b){var d=b[c];if(typeof d=='function'&&!(c in a))a[c]=cache.findOrStore(d)}}a._extended=true;return a};Element.extend.cache={findOrStore:function(a){return this[a]=this[a]||function(){return a.apply(null,[this].concat($A(arguments)))}}};Element.Methods={visible:function(a){return $(a).style.display!='none'},toggle:function(a){a=$(a);Element[Element.visible(a)?'hide':'show'](a);return a},hide:function(a){$(a).style.display='none';return a},show:function(a){$(a).style.display='';return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(a,b){b=typeof b=='undefined'?'':b.toString();$(a).innerHTML=b.stripScripts();setTimeout(function(){b.evalScripts()},10);return a},replace:function(a,b){a=$(a);b=typeof b=='undefined'?'':b.toString();if(a.outerHTML){a.outerHTML=b.stripScripts()}else{var c=a.ownerDocument.createRange();c.selectNodeContents(a);a.parentNode.replaceChild(c.createContextualFragment(b.stripScripts()),a)}setTimeout(function(){b.evalScripts()},10);return a},inspect:function(d){d=$(d);var e='<'+d.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(a){var b=a.first(),attribute=a.last();var c=(d[b]||'').toString();if(c)e+=' '+attribute+'='+c.inspect(true)});return e+'>'},recursivelyCollect:function(a,b){a=$(a);var c=[];while(a=a[b])if(a.nodeType==1)c.push(Element.extend(a));return c},ancestors:function(a){return $(a).recursivelyCollect('parentNode')},descendants:function(a){return $A($(a).getElementsByTagName('*'))},immediateDescendants:function(a){if(!(a=$(a).firstChild))return[];while(a&&a.nodeType!=1)a=a.nextSibling;if(a)return[a].concat($(a).nextSiblings());return[]},previousSiblings:function(a){return $(a).recursivelyCollect('previousSibling')},nextSiblings:function(a){return $(a).recursivelyCollect('nextSibling')},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(a,b){if(typeof b=='string')b=new Selector(b);return b.match($(a))},up:function(a,b,c){return Selector.findElement($(a).ancestors(),b,c)},down:function(a,b,c){return Selector.findElement($(a).descendants(),b,c)},previous:function(a,b,c){return Selector.findElement($(a).previousSiblings(),b,c)},next:function(a,b,c){return Selector.findElement($(a).nextSiblings(),b,c)},getElementsBySelector:function(){var a=$A(arguments),element=$(a.shift());return Selector.findChildElements(element,a)},getElementsByClassName:function(a,b){return document.getElementsByClassName(b,a)},readAttribute:function(a,b){a=$(a);if(document.all&&!window.opera){var t=Element._attributeTranslations;if(t.values[b])return t.values[b](a,b);if(t.names[b])b=t.names[b];var c=a.attributes[b];if(c)return c.nodeValue}return a.getAttribute(b)},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a)))return;var c=a.className;if(c.length==0)return false;if(c==b||c.match(new RegExp("(^|\\s)"+b+"(\\s|$)")))return true;return false},addClassName:function(a,b){if(!(a=$(a)))return;Element.classNames(a).add(b);return a},removeClassName:function(a,b){if(!(a=$(a)))return;Element.classNames(a).remove(b);return a},toggleClassName:function(a,b){if(!(a=$(a)))return;Element.classNames(a)[a.hasClassName(b)?'remove':'add'](b);return a},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first()},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first()},cleanWhitespace:function(a){a=$(a);var b=a.firstChild;while(b){var c=b.nextSibling;if(b.nodeType==3&&!/\S/.test(b.nodeValue))a.removeChild(b);b=c}return a},empty:function(a){return $(a).innerHTML.match(/^\s*$/)},descendantOf:function(a,b){a=$(a),b=$(b);while(a=a.parentNode)if(a==b)return true;return false},scrollTo:function(a){a=$(a);var b=Position.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(a,b){a=$(a);if(['float','cssFloat'].include(b))b=(typeof a.style.styleFloat!='undefined'?'styleFloat':'cssFloat');b=b.camelize();var c=a.style[b];if(!c){if(document.defaultView&&document.defaultView.getComputedStyle){var d=document.defaultView.getComputedStyle(a,null);c=d?d[b]:null}else if(a.currentStyle){c=a.currentStyle[b]}}if((c=='auto')&&['width','height'].include(b)&&(a.getStyle('display')!='none'))c=a['offset'+b.capitalize()]+'px';if(window.opera&&['left','top','right','bottom'].include(b))if(Element.getStyle(a,'position')=='static')c='auto';if(b=='opacity'){if(c)return parseFloat(c);if(c=(a.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))if(c[1])return parseFloat(c[1])/100;return 1.0}return c=='auto'?null:c},setStyle:function(a,b){a=$(a);for(var c in b){var d=b[c];if(c=='opacity'){if(d==1){d=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1.0;if(/MSIE/.test(navigator.userAgent)&&!window.opera)a.style.filter=a.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'')}else if(d==''){if(/MSIE/.test(navigator.userAgent)&&!window.opera)a.style.filter=a.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'')}else{if(d<0.00001)d=0;if(/MSIE/.test(navigator.userAgent)&&!window.opera)a.style.filter=a.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'')+'alpha(opacity='+d*100+')'}}else if(['float','cssFloat'].include(c))c=(typeof a.style.styleFloat!='undefined')?'styleFloat':'cssFloat';a.style[c.camelize()]=d}return a},getDimensions:function(a){a=$(a);var b=$(a).getStyle('display');if(b!='none'&&b!=null)return{width:a.offsetWidth,height:a.offsetHeight};var c=a.style;var d=c.visibility;var e=c.position;var f=c.display;c.visibility='hidden';c.position='absolute';c.display='block';var g=a.clientWidth;var h=a.clientHeight;c.display=f;c.position=e;c.visibility=d;return{width:g,height:h}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,'position');if(b=='static'||!b){a._madePositioned=true;a.style.position='relative';if(window.opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=''}return a},makeClipping:function(a){a=$(a);if(a._overflow)return a;a._overflow=a.style.overflow||'auto';if((Element.getStyle(a,'overflow')||'visible')!='hidden')a.style.overflow='hidden';return a},undoClipping:function(a){a=$(a);if(!a._overflow)return a;a.style.overflow=a._overflow=='auto'?'':a._overflow;a._overflow=null;return a}};Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf});Element._attributeTranslations={};Element._attributeTranslations.names={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"};Element._attributeTranslations.values={_getAttr:function(a,b){return a.getAttribute(b,2)},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){var b=a.getAttributeNode('title');return b.specified?b.nodeValue:null}};Object.extend(Element._attributeTranslations.values,{href:Element._attributeTranslations.values._getAttr,src:Element._attributeTranslations.values._getAttr,disabled:Element._attributeTranslations.values._flag,checked:Element._attributeTranslations.values._flag,readonly:Element._attributeTranslations.values._flag,multiple:Element._attributeTranslations.values._flag});Element.Methods.Simulated={hasAttribute:function(a,b){var t=Element._attributeTranslations;b=t.names[b]||b;return $(a).getAttributeNode(b).specified}};if(document.all&&!window.opera){Element.Methods.update=function(b,c){b=$(b);c=typeof c=='undefined'?'':c.toString();var d=b.tagName.toUpperCase();if(['THEAD','TBODY','TR','TD'].include(d)){var e=document.createElement('div');switch(d){case'THEAD':case'TBODY':e.innerHTML='<table><tbody>'+c.stripScripts()+'</tbody></table>';depth=2;break;case'TR':e.innerHTML='<table><tbody><tr>'+c.stripScripts()+'</tr></tbody></table>';depth=3;break;case'TD':e.innerHTML='<table><tbody><tr><td>'+c.stripScripts()+'</td></tr></tbody></table>';depth=4}$A(b.childNodes).each(function(a){b.removeChild(a)});depth.times(function(){e=e.firstChild});$A(e.childNodes).each(function(a){b.appendChild(a)})}else{b.innerHTML=c.stripScripts()}setTimeout(function(){c.evalScripts()},10);return b}};Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))['','Form','Input','TextArea','Select'].each(function(a){var b='HTML'+a+'Element';if(window[b])return;var c=window[b]={};c.prototype=document.createElement(a?a.toLowerCase():'div').__proto__});Element.addMethods=function(g){Object.extend(Element.Methods,g||{});function copy(a,b,c){c=c||false;var d=Element.extend.cache;for(var e in a){var f=a[e];if(!c||!(e in b))b[e]=d.findOrStore(f)}}if(typeof HTMLElement!='undefined'){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true);copy(Form.Methods,HTMLFormElement.prototype);[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(a){copy(Form.Element.Methods,a.prototype)});_nativeExtensions=true}};var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(a){this.adjacency=a};Abstract.Insertion.prototype={initialize:function(a,b){this.element=$(a);this.content=b.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content)}catch(e){var c=this.element.tagName.toUpperCase();if(['TBODY','TR'].include(c)){this.insertContent(this.contentFromAnonymousTable())}else{throw e;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange)this.initializeRange();this.insertContent([this.range.createContextualFragment(this.content)])}setTimeout(function(){b.evalScripts()},10)},contentFromAnonymousTable:function(){var a=document.createElement('div');a.innerHTML='<table><tbody>'+this.content+'</tbody></table>';return $A(a.childNodes[0].childNodes[0].childNodes)}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion('beforeBegin'),{initializeRange:function(){this.range.setStartBefore(this.element)},insertContent:function(b){b.each((function(a){this.element.parentNode.insertBefore(a,this.element)}).bind(this))}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion('afterBegin'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true)},insertContent:function(b){b.reverse(false).each((function(a){this.element.insertBefore(a,this.element.firstChild)}).bind(this))}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion('beforeEnd'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element)},insertContent:function(b){b.each((function(a){this.element.appendChild(a)}).bind(this))}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion('afterEnd'),{initializeRange:function(){this.range.setStartAfter(this.element)},insertContent:function(b){b.each((function(a){this.element.parentNode.insertBefore(a,this.element.nextSibling)}).bind(this))}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(b){this.element.className.split(/\s+/).select(function(a){return a.length>0})._each(b)},set:function(a){this.element.className=a},add:function(a){if(this.include(a))return;this.set($A(this).concat(a).join(' '))},remove:function(a){if(!this.include(a))return;this.set($A(this).without(a).join(' '))},toString:function(){return $A(this).join(' ')}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(a){this.params={classNames:[]};this.expression=a.toString().strip();this.parseExpression();this.compileMatcher()},parseExpression:function(){function abort(a){throw'Parse error in selector: '+a;}if(this.expression=='')abort('empty expression');var b=this.params,expr=this.expression,match,modifier,clause,rest;while(match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){b.attributes=b.attributes||[];b.attributes.push({name:match[2],operator:match[3],value:match[4]||match[5]||''});expr=match[1]}if(expr=='*')return this.params.wildcard=true;while(match=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){modifier=match[1],clause=match[2],rest=match[3];switch(modifier){case'#':b.id=clause;break;case'.':b.classNames.push(clause);break;case'':case undefined:b.tagName=clause.toUpperCase();break;default:abort(expr.inspect())}expr=rest}if(expr.length>0)abort(expr.inspect())},buildMatchExpression:function(){var e=this.params,conditions=[],clause;if(e.wildcard)conditions.push('true');if(clause=e.id)conditions.push('element.readAttribute("id") == '+clause.inspect());if(clause=e.tagName)conditions.push('element.tagName.toUpperCase() == '+clause.inspect());if((clause=e.classNames).length>0)for(var i=0,length=clause.length;i<length;i++)conditions.push('element.hasClassName('+clause[i].inspect()+')');if(clause=e.attributes){clause.each(function(b){var c='element.readAttribute('+b.name.inspect()+')';var d=function(a){return c+' && '+c+'.split('+a.inspect()+')'};switch(b.operator){case'=':conditions.push(c+' == '+b.value.inspect());break;case'~=':conditions.push(d(' ')+'.include('+b.value.inspect()+')');break;case'|=':conditions.push(d('-')+'.first().toUpperCase() == '+b.value.toUpperCase().inspect());break;case'!=':conditions.push(c+' != '+b.value.inspect());break;case'':case undefined:conditions.push('element.hasAttribute('+b.name.inspect()+')');break;default:throw'Unknown operator '+b.operator+' in selector';}})}return conditions.join(' && ')},compileMatcher:function(){this.match=new Function('element','if(!element.tagName){ return false;} return '+this.buildMatchExpression())},findElements:function(a){var b;if(b=$(this.params.id))if(this.match(b))if(!a||Element.childOf(b,a))return[b];a=(a||document).getElementsByTagName(this.params.tagName||'*');var c=[];for(var i=0,length=a.length;i<length;i++)if(this.match(b=a[i]))c.push(Element.extend(b));return c},toString:function(){return this.expression}};Object.extend(Selector,{matchElements:function(a,b){var c=new Selector(b);return a.select(c.match.bind(c)).map(Element.extend)},findElement:function(a,b,c){if(typeof b=='number')c=b,b=false;return Selector.matchElements(a,b||'*')[c||0]},findChildElements:function(g,h){return h.map(function(f){return f.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null],function(c,d){var e=new Selector(d);return c.inject([],function(a,b){return a.concat(e.findElements(b||g))})})}).flatten()}});function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(d,e){var f=d.inject({},function(a,b){if(!b.disabled&&b.name){var c=b.name,value=$(b).getValue();if(value!=undefined){if(a[c]){if(a[c].constructor!=Array)a[c]=[a[c]];a[c].push(value)}else a[c]=value}}return a});return e?f:Hash.toQueryString(f)}};Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(c){return $A($(c).getElementsByTagName('*')).inject([],function(a,b){if(Form.Element.Serializers[b.tagName.toLowerCase()])a.push(Element.extend(b));return a})},getInputs:function(a,b,c){a=$(a);var d=a.getElementsByTagName('input');if(!b&&!c)return $A(d).map(Element.extend);for(var i=0,matchingInputs=[],length=d.length;i<length;i++){var e=d[i];if((b&&e.type!=b)||(c&&e.name!=c))continue;matchingInputs.push(Element.extend(e))}return matchingInputs},disable:function(b){b=$(b);b.getElements().each(function(a){a.blur();a.disabled='true'});return b},enable:function(b){b=$(b);b.getElements().each(function(a){a.disabled=''});return b},findFirstElement:function(b){return $(b).getElements().find(function(a){return a.type!='hidden'&&!a.disabled&&['input','select','textarea'].include(a.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a}};Object.extend(Form,Form.Methods);Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Hash.toQueryString(c)}}return''},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},clear:function(a){$(a).value='';return a},present:function(a){return $(a).value!=''},activate:function(a){a=$(a);a.focus();if(a.select&&(a.tagName.toLowerCase()!='input'||!['button','reset','submit'].include(a.type)))a.select();return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.blur();a.disabled=false;return a}};Object.extend(Form.Element,Form.Element.Methods);var Field=Form.Element;var $F=Form.Element.getValue;Form.Element.Serializers={input:function(a){switch(a.type.toLowerCase()){case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(a);default:return Form.Element.Serializers.textarea(a)}},inputSelector:function(a){return a.checked?a.value:null},textarea:function(a){return a.value},select:function(a){return this[a.type=='select-one'?'selectOne':'selectMany'](a)},selectOne:function(a){var b=a.selectedIndex;return b>=0?this.optionValue(a.options[b]):null},selectMany:function(a){var b,length=a.length;if(!length)return null;for(var i=0,b=[];i<length;i++){var c=a.options[i];if(c.selected)b.push(this.optionValue(c))}return b},optionValue:function(a){return Element.extend(a).hasAttribute('value')?a.value:a.text}};Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(a,b,c){this.frequency=b;this.element=$(a);this.callback=c;this.lastValue=this.getValue();this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},onTimerEvent:function(){var a=this.getValue();var b=('string'==typeof this.lastValue&&'string'==typeof a?this.lastValue!=a:String(this.lastValue)!=String(a));if(b){this.callback(this.element,a);this.lastValue=a}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')this.registerFormCallbacks();else this.registerCallback(this.element)},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback.bind(this))},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case'checkbox':case'radio':Event.observe(a,'click',this.onElementEvent.bind(this));break;default:Event.observe(a,'change',this.onElementEvent.bind(this));break}}}};Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event=new Object()}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(a){return a.target||a.srcElement},isLeftClick:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))},pointerX:function(a){return a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(a){return a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))},stop:function(a){if(a.preventDefault){a.preventDefault();a.stopPropagation()}else{a.returnValue=false;a.cancelBubble=true}},findElement:function(a,b){var c=Event.element(a);while(c.parentNode&&(!c.tagName||(c.tagName.toUpperCase()!=b.toUpperCase())))c=c.parentNode;return c},observers:false,_observeAndCache:function(a,b,c,d){if(!this.observers)this.observers=[];if(a.addEventListener){this.observers.push([a,b,c,d]);a.addEventListener(b,c,d)}else if(a.attachEvent){this.observers.push([a,b,c,d]);a.attachEvent('on'+b,c)}},unloadCache:function(){if(!Event.observers)return;for(var i=0,length=Event.observers.length;i<length;i++){Event.stopObserving.apply(this,Event.observers[i]);Event.observers[i][0]=null}Event.observers=false},observe:function(a,b,c,d){a=$(a);d=d||false;if(b=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.attachEvent))b='keydown';Event._observeAndCache(a,b,c,d)},stopObserving:function(a,b,c,d){a=$(a);d=d||false;if(b=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.detachEvent))b='keydown';if(a.removeEventListener){a.removeEventListener(b,c,d)}else if(a.detachEvent){try{a.detachEvent('on'+b,c)}catch(e){}}}});if(navigator.appVersion.match(/\bMSIE\b/))Event.observe(window,'unload',Event.unloadCache,false);var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},realOffset:function(a){var b=0,valueL=0;do{b+=a.scrollTop||0;valueL+=a.scrollLeft||0;a=a.parentNode}while(a);return[valueL,b]},cumulativeOffset:function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;a=a.offsetParent}while(a);return[valueL,b]},positionedOffset:function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;a=a.offsetParent;if(a){if(a.tagName=='BODY')break;var p=Element.getStyle(a,'position');if(p=='relative'||p=='absolute')break}}while(a);return[valueL,b]},offsetParent:function(a){if(a.offsetParent)return a.offsetParent;if(a==document.body)return a;while((a=a.parentNode)&&a!=document.body)if(Element.getStyle(a,'position')!='static')return a;return document.body},within:function(a,b,c){if(this.includeScrollOffsets)return this.withinIncludingScrolloffsets(a,b,c);this.xcomp=b;this.ycomp=c;this.offset=this.cumulativeOffset(a);return(c>=this.offset[1]&&c<this.offset[1]+a.offsetHeight&&b>=this.offset[0]&&b<this.offset[0]+a.offsetWidth)},withinIncludingScrolloffsets:function(a,b,c){var d=this.realOffset(a);this.xcomp=b+d[0]-this.deltaX;this.ycomp=c+d[1]-this.deltaY;this.offset=this.cumulativeOffset(a);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+a.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+a.offsetWidth)},overlap:function(a,b){if(!a)return 0;if(a=='vertical')return((this.offset[1]+b.offsetHeight)-this.ycomp)/b.offsetHeight;if(a=='horizontal')return((this.offset[0]+b.offsetWidth)-this.xcomp)/b.offsetWidth},page:function(a){var b=0,valueL=0;var c=a;do{b+=c.offsetTop||0;valueL+=c.offsetLeft||0;if(c.offsetParent==document.body)if(Element.getStyle(c,'position')=='absolute')break}while(c=c.offsetParent);c=a;do{if(!window.opera||c.tagName=='BODY'){b-=c.scrollTop||0;valueL-=c.scrollLeft||0}}while(c=c.parentNode);return[valueL,b]},clone:function(a,b){var c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});a=$(a);var p=Position.page(a);b=$(b);var d=[0,0];var e=null;if(Element.getStyle(b,'position')=='absolute'){e=Position.offsetParent(b);d=Position.page(e)}if(e==document.body){d[0]-=document.body.offsetLeft;d[1]-=document.body.offsetTop}if(c.setLeft)b.style.left=(p[0]-d[0]+c.offsetLeft)+'px';if(c.setTop)b.style.top=(p[1]-d[1]+c.offsetTop)+'px';if(c.setWidth)b.style.width=a.offsetWidth+'px';if(c.setHeight)b.style.height=a.offsetHeight+'px'},absolutize:function(a){a=$(a);if(a.style.position=='absolute')return;Position.prepare();var b=Position.positionedOffset(a);var c=b[1];var d=b[0];var e=a.clientWidth;var f=a.clientHeight;a._originalLeft=d-parseFloat(a.style.left||0);a._originalTop=c-parseFloat(a.style.top||0);a._originalWidth=a.style.width;a._originalHeight=a.style.height;a.style.position='absolute';a.style.top=c+'px';a.style.left=d+'px';a.style.width=e+'px';a.style.height=f+'px'},relativize:function(a){a=$(a);if(a.style.position=='relative')return;Position.prepare();a.style.position='relative';var b=parseFloat(a.style.top||0)-(a._originalTop||0);var c=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=b+'px';a.style.left=c+'px';a.style.height=a._originalHeight;a.style.width=a._originalWidth}};if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;if(a.offsetParent==document.body)if(Element.getStyle(a,'position')=='absolute')break;a=a.offsetParent}while(a);return[valueL,b]}}Element.addMethods();
2
- String.prototype.parseColor=function(){var a='#';if(this.slice(0,4)=='rgb('){var b=this.slice(4,this.length-1).split(',');var i=0;do{a+=parseInt(b[i]).toColorPart()}while(++i<3)}else{if(this.slice(0,1)=='#'){if(this.length==4)for(var i=1;i<4;i++)a+=(this.charAt(i)+this.charAt(i)).toLowerCase();if(this.length==7)a=this.toLowerCase()}};return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(b){return $A($(b).childNodes).collect(function(a){return(a.nodeType==3?a.nodeValue:(a.hasChildNodes()?Element.collectTextNodes(a):''))}).flatten().join('')};Element.collectTextNodesIgnoreClass=function(b,c){return $A($(b).childNodes).collect(function(a){return(a.nodeType==3?a.nodeValue:((a.hasChildNodes()&&!Element.hasClassName(a,c))?Element.collectTextNodesIgnoreClass(a,c):''))}).flatten().join('')};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+'em'});if(navigator.appVersion.indexOf('AppleWebKit')>0)window.scrollBy(0,0);return a};Element.getOpacity=function(a){return $(a).getStyle('opacity')};Element.setOpacity=function(a,b){return $(a).setStyle({opacity:b})};Element.getInlineOpacity=function(a){return $(a).style.opacity||''};Element.forceRerendering=function(a){try{a=$(a);var n=document.createTextNode(' ');a.appendChild(n);a.removeChild(n)}catch(e){}};Array.prototype.call=function(){var a=arguments;this.each(function(f){f.apply(this,a)})};var Effect={_elementDoesNotExistError:{name:'ElementDoesNotExistError',message:'The specified DOM element does not exist, but is required for this effect to operate'},tagifyText:function(c){if(typeof Builder=='undefined')throw("Effect.tagifyText requires including script.aculo.us' builder.js library");var d='position:relative';if(/MSIE/.test(navigator.userAgent)&&!window.opera)d+=';zoom:1';c=$(c);$A(c.childNodes).each(function(b){if(b.nodeType==3){b.nodeValue.toArray().each(function(a){c.insertBefore(Builder.node('span',{style:d},a==' '?String.fromCharCode(160):a),b)});Element.remove(b)}})},multiple:function(c,d){var e;if(((typeof c=='object')||(typeof c=='function'))&&(c.length))e=c;else e=$(c).childNodes;var f=Object.extend({speed:0.1,delay:0.0},arguments[2]||{});var g=f.delay;$A(e).each(function(a,b){new d(a,Object.extend(f,{delay:b*f.speed+g}))})},PAIRS:{'slide':['SlideDown','SlideUp'],'blind':['BlindDown','BlindUp'],'appear':['Appear','Fade']},toggle:function(a,b){a=$(a);b=(b||'appear').toLowerCase();var c=Object.extend({queue:{position:'end',scope:(a.id||'global'),limit:1}},arguments[2]||{});Effect[a.visible()?Effect.PAIRS[b][1]:Effect.PAIRS[b][0]](a,c)}};var Effect2=Effect;Effect.Transitions={linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){return((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(a,b){b=b||5;return(Math.round((a%(1/b))*b)==0?((a*b*2)-Math.floor(a*b*2)):1-((a*b*2)-Math.floor(a*b*2)))},none:function(a){return 0},full:function(a){return 1}};Effect.ScopedQueue=Class.create();Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(a){var b=new Date().getTime();var c=(typeof a.options.queue=='string')?a.options.queue:a.options.queue.position;switch(c){case'front':this.effects.findAll(function(e){return e.state=='idle'}).each(function(e){e.startOn+=a.finishOn;e.finishOn+=a.finishOn});break;case'with-last':b=this.effects.pluck('startOn').max()||b;break;case'end':b=this.effects.pluck('finishOn').max()||b;break}a.startOn+=b;a.finishOn+=b;if(!a.options.queue.limit||(this.effects.length<a.options.queue.limit))this.effects.push(a);if(!this.interval)this.interval=setInterval(this.loop.bind(this),15)},remove:function(a){this.effects=this.effects.reject(function(e){return e==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var a=new Date().getTime();for(var i=0,len=this.effects.length;i<len;i++)if(this.effects[i])this.effects[i].loop(a)}});Effect.Queues={instances:$H(),get:function(a){if(typeof a!='string')return a;if(!this.instances[a])this.instances[a]=new Effect.ScopedQueue();return this.instances[a]}};Effect.Queue=Effect.Queues.get('global');Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1.0,fps:60.0,sync:false,from:0.0,to:1.0,delay:0.0,queue:'parallel'};Effect.Base=function(){};Effect.Base.prototype={position:null,start:function(a){this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state='idle';this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.event('beforeStart');if(!this.options.sync)Effect.Queues.get(typeof this.options.queue=='string'?'global':this.options.queue.scope).add(this)},loop:function(a){if(a>=this.startOn){if(a>=this.finishOn){this.render(1.0);this.cancel();this.event('beforeFinish');if(this.finish)this.finish();this.event('afterFinish');return}var b=(a-this.startOn)/(this.finishOn-this.startOn);var c=Math.round(b*this.options.fps*this.options.duration);if(c>this.currentFrame){this.render(b);this.currentFrame=c}}},render:function(a){if(this.state=='idle'){this.state='running';this.event('beforeSetup');if(this.setup)this.setup();this.event('afterSetup')}if(this.state=='running'){if(this.options.transition)a=this.options.transition(a);a*=(this.options.to-this.options.from);a+=this.options.from;this.position=a;this.event('beforeUpdate');if(this.update)this.update(a);this.event('afterUpdate')}},cancel:function(){if(!this.options.sync)Effect.Queues.get(typeof this.options.queue=='string'?'global':this.options.queue.scope).remove(this);this.state='finished'},event:function(a){if(this.options[a+'Internal'])this.options[a+'Internal'](this);if(this.options[a])this.options[a](this)},inspect:function(){var a=$H();for(property in this)if(typeof this[property]!='function')a[property]=this[property];return'#<Effect:'+a.inspect()+',options:'+$H(this.options).inspect()+'>'}};Effect.Parallel=Class.create();Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke('render',a)},finish:function(b){this.effects.each(function(a){a.render(1.0);a.cancel();a.event('beforeFinish');if(a.finish)a.finish(b);a.event('afterFinish')})}});Effect.Event=Class.create();Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){var a=Object.extend({duration:0},arguments[0]||{});this.start(a)},update:Prototype.emptyFunction});Effect.Opacity=Class.create();Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(a){this.element=$(a);if(!this.element)throw(Effect._elementDoesNotExistError);if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout))this.element.setStyle({zoom:1});var b=Object.extend({from:this.element.getOpacity()||0.0,to:1.0},arguments[1]||{});this.start(b)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create();Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(a){this.element=$(a);if(!this.element)throw(Effect._elementDoesNotExistError);var b=Object.extend({x:0,y:0,mode:'relative'},arguments[1]||{});this.start(b)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle('left')||'0');this.originalTop=parseFloat(this.element.getStyle('top')||'0');if(this.options.mode=='absolute'){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:Math.round(this.options.x*a+this.originalLeft)+'px',top:Math.round(this.options.y*a+this.originalTop)+'px'})}});Effect.MoveBy=function(a,b,c){return new Effect.Move(a,Object.extend({x:c,y:b},arguments[3]||{}))};Effect.Scale=Class.create();Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(a,b){this.element=$(a);if(!this.element)throw(Effect._elementDoesNotExistError);var c=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:'box',scaleFrom:100.0,scaleTo:b},arguments[2]||{});this.start(c)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle('position');this.originalStyle={};['top','left','width','height','fontSize'].each(function(k){this.originalStyle[k]=this.element.style[k]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var b=this.element.getStyle('font-size')||'100%';['em','px','%','pt'].each(function(a){if(b.indexOf(a)>0){this.fontSize=parseFloat(b);this.fontSizeType=a}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=='box')this.dims=[this.element.offsetHeight,this.element.offsetWidth];if(/^content/.test(this.options.scaleMode))this.dims=[this.element.scrollHeight,this.element.scrollWidth];if(!this.dims)this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]},update:function(a){var b=(this.options.scaleFrom/100.0)+(this.factor*a);if(this.options.scaleContent&&this.fontSize)this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType});this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish)this.element.setStyle(this.originalStyle)},setDimensions:function(a,b){var d={};if(this.options.scaleX)d.width=Math.round(b)+'px';if(this.options.scaleY)d.height=Math.round(a)+'px';if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var e=(b-this.dims[1])/2;if(this.elementPositioning=='absolute'){if(this.options.scaleY)d.top=this.originalTop-c+'px';if(this.options.scaleX)d.left=this.originalLeft-e+'px'}else{if(this.options.scaleY)d.top=-c+'px';if(this.options.scaleX)d.left=-e+'px'}}this.element.setStyle(d)}});Effect.Highlight=Class.create();Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(a){this.element=$(a);if(!this.element)throw(Effect._elementDoesNotExistError);var b=Object.extend({startcolor:'#ffff99'},arguments[1]||{});this.start(b)},setup:function(){if(this.element.getStyle('display')=='none'){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle('background-image');this.element.setStyle({backgroundImage:'none'})}if(!this.options.endcolor)this.options.endcolor=this.element.getStyle('background-color').parseColor('#ffffff');if(!this.options.restorecolor)this.options.restorecolor=this.element.getStyle('background-color');this._base=$R(0,2).map(function(i){return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(i){return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject('#',function(m,v,i){return m+(Math.round(this._base[i]+(this._delta[i]*a)).toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=Class.create();Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(a){this.element=$(a);this.start(arguments[1]||{})},setup:function(){Position.prepare();var a=Position.cumulativeOffset(this.element);if(this.options.offset)a[1]+=this.options.offset;var b=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);this.scrollStart=Position.deltaY;this.delta=(a[1]>b?b:a[1])-this.scrollStart},update:function(a){Position.prepare();window.scrollTo(Position.deltaX,this.scrollStart+(a*this.delta))}});Effect.Fade=function(b){b=$(b);var c=b.getInlineOpacity();var d=Object.extend({from:b.getOpacity()||1.0,to:0.0,afterFinishInternal:function(a){if(a.options.to!=0)return;a.element.hide().setStyle({opacity:c})}},arguments[1]||{});return new Effect.Opacity(b,d)};Effect.Appear=function(b){b=$(b);var c=Object.extend({from:(b.getStyle('display')=='none'?0.0:b.getOpacity()||0.0),to:1.0,afterFinishInternal:function(a){a.element.forceRerendering()},beforeSetup:function(a){a.element.setOpacity(a.options.from).show()}},arguments[1]||{});return new Effect.Opacity(b,c)};Effect.Puff=function(b){b=$(b);var c={opacity:b.getInlineOpacity(),position:b.getStyle('position'),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0.0})],Object.extend({duration:1.0,beforeSetupInternal:function(a){Position.absolutize(a.effects[0].element)},afterFinishInternal:function(a){a.effects[0].element.hide().setStyle(c)}},arguments[1]||{}))};Effect.BlindUp=function(b){b=$(b);b.makeClipping();return new Effect.Scale(b,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(a){a.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var c=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(a){a.element.makeClipping().setStyle({height:'0px'}).show()},afterFinishInternal:function(a){a.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(c){c=$(c);var d=c.getInlineOpacity();return new Effect.Appear(c,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(b){new Effect.Scale(b.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(a){a.element.makePositioned().makeClipping()},afterFinishInternal:function(a){a.element.hide().undoClipping().undoPositioned().setStyle({opacity:d})}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var c={top:b.getStyle('top'),left:b.getStyle('left'),opacity:b.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0.0})],Object.extend({duration:0.5,beforeSetup:function(a){a.effects[0].element.makePositioned()},afterFinishInternal:function(a){a.effects[0].element.hide().undoPositioned().setStyle(c)}},arguments[1]||{}))};Effect.Shake=function(g){g=$(g);var h={top:g.getStyle('top'),left:g.getStyle('left')};return new Effect.Move(g,{x:20,y:0,duration:0.05,afterFinishInternal:function(f){new Effect.Move(f.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(e){new Effect.Move(e.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(d){new Effect.Move(d.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(c){new Effect.Move(c.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(b){new Effect.Move(b.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(a){a.element.undoPositioned().setStyle(h)}})}})}})}})}})}})};Effect.SlideDown=function(b){b=$(b).cleanWhitespace();var c=b.down().getStyle('bottom');var d=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(a){a.element.makePositioned();a.element.down().makePositioned();if(window.opera)a.element.setStyle({top:''});a.element.makeClipping().setStyle({height:'0px'}).show()},afterUpdateInternal:function(a){a.element.down().setStyle({bottom:(a.dims[0]-a.element.clientHeight)+'px'})},afterFinishInternal:function(a){a.element.undoClipping().undoPositioned();a.element.down().undoPositioned().setStyle({bottom:c})}},arguments[1]||{}))};Effect.SlideUp=function(b){b=$(b).cleanWhitespace();var c=b.down().getStyle('bottom');return new Effect.Scale(b,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:'box',scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(a){a.element.makePositioned();a.element.down().makePositioned();if(window.opera)a.element.setStyle({top:''});a.element.makeClipping().show()},afterUpdateInternal:function(a){a.element.down().setStyle({bottom:(a.dims[0]-a.element.clientHeight)+'px'})},afterFinishInternal:function(a){a.element.hide().undoClipping().undoPositioned().setStyle({bottom:c});a.element.down().undoPositioned()}},arguments[1]||{}))};Effect.Squish=function(b){return new Effect.Scale(b,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(a){a.element.makeClipping()},afterFinishInternal:function(a){a.element.hide().undoClipping()}})};Effect.Grow=function(c){c=$(c);var d=Object.extend({direction:'center',moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var e={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var f=c.getDimensions();var g,initialMoveY;var h,moveY;switch(d.direction){case'top-left':g=initialMoveY=h=moveY=0;break;case'top-right':g=f.width;initialMoveY=moveY=0;h=-f.width;break;case'bottom-left':g=h=0;initialMoveY=f.height;moveY=-f.height;break;case'bottom-right':g=f.width;initialMoveY=f.height;h=-f.width;moveY=-f.height;break;case'center':g=f.width/2;initialMoveY=f.height/2;h=-f.width/2;moveY=-f.height/2;break};return new Effect.Move(c,{x:g,y:initialMoveY,duration:0.01,beforeSetup:function(a){a.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(b){new Effect.Parallel([new Effect.Opacity(b.element,{sync:true,to:1.0,from:0.0,transition:d.opacityTransition}),new Effect.Move(b.element,{x:h,y:moveY,sync:true,transition:d.moveTransition}),new Effect.Scale(b.element,100,{scaleMode:{originalHeight:f.height,originalWidth:f.width},sync:true,scaleFrom:window.opera?1:0,transition:d.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(a){a.effects[0].element.setStyle({height:'0px'}).show()},afterFinishInternal:function(a){a.effects[0].element.undoClipping().undoPositioned().setStyle(e)}},d))}})};Effect.Shrink=function(b){b=$(b);var c=Object.extend({direction:'center',moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var d={top:b.style.top,left:b.style.left,height:b.style.height,width:b.style.width,opacity:b.getInlineOpacity()};var e=b.getDimensions();var f,moveY;switch(c.direction){case'top-left':f=moveY=0;break;case'top-right':f=e.width;moveY=0;break;case'bottom-left':f=0;moveY=e.height;break;case'bottom-right':f=e.width;moveY=e.height;break;case'center':f=e.width/2;moveY=e.height/2;break};return new Effect.Parallel([new Effect.Opacity(b,{sync:true,to:0.0,from:1.0,transition:c.opacityTransition}),new Effect.Scale(b,window.opera?1:0,{sync:true,transition:c.scaleTransition,restoreAfterFinish:true}),new Effect.Move(b,{x:f,y:moveY,sync:true,transition:c.moveTransition})],Object.extend({beforeStartInternal:function(a){a.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(a){a.effects[0].element.hide().undoClipping().undoPositioned().setStyle(d)}},c))};Effect.Pulsate=function(b){b=$(b);var c=arguments[1]||{};var d=b.getInlineOpacity();var e=c.transition||Effect.Transitions.sinoidal;var f=function(a){return e(1-Effect.Transitions.pulse(a,c.pulses))};f.bind(e);return new Effect.Opacity(b,Object.extend(Object.extend({duration:2.0,from:0,afterFinishInternal:function(a){a.element.setStyle({opacity:d})}},c),{transition:f}))};Effect.Fold=function(c){c=$(c);var d={top:c.style.top,left:c.style.left,width:c.style.width,height:c.style.height};c.makeClipping();return new Effect.Scale(c,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(b){new Effect.Scale(c,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(a){a.element.hide().undoClipping().setStyle(d)}})}},arguments[1]||{}))};Effect.Morph=Class.create();Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(c){this.element=$(c);if(!this.element)throw(Effect._elementDoesNotExistError);var d=Object.extend({style:{}},arguments[1]||{});if(typeof d.style=='string'){if(d.style.indexOf(':')==-1){var e='',selector='.'+d.style;$A(document.styleSheets).reverse().each(function(b){if(b.cssRules)cssRules=b.cssRules;else if(b.rules)cssRules=b.rules;$A(cssRules).reverse().each(function(a){if(selector==a.selectorText){e=a.style.cssText;throw $break;}});if(e)throw $break;});this.style=e.parseStyle();d.afterFinishInternal=function(b){b.element.addClassName(b.options.style);b.transforms.each(function(a){if(a.style!='opacity')b.element.style[a.style.camelize()]=''})}}else this.style=d.style.parseStyle()}else this.style=$H(d.style);this.start(d)},setup:function(){function parseColor(a){if(!a||['rgba(0, 0, 0, 0)','transparent'].include(a))a='#ffffff';a=a.parseColor();return $R(0,2).map(function(i){return parseInt(a.slice(i*2+1,i*2+3),16)})};this.transforms=this.style.map(function(a){var b=a[0].underscore().dasherize(),value=a[1],unit=null;if(value.parseColor('#zzzzzz')!='#zzzzzz'){value=value.parseColor();unit='color'}else if(b=='opacity'){value=parseFloat(value);if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout))this.element.setStyle({zoom:1})}else if(Element.CSS_LENGTH.test(value))var c=value.match(/^([\+\-]?[0-9\.]+)(.*)$/),value=parseFloat(c[1]),unit=(c.length==3)?c[2]:null;var d=this.element.getStyle(b);return $H({style:b,originalValue:unit=='color'?parseColor(d):parseFloat(d||0),targetValue:unit=='color'?parseColor(value):value,unit:unit})}.bind(this)).reject(function(a){return((a.originalValue==a.targetValue)||(a.unit!='color'&&(isNaN(a.originalValue)||isNaN(a.targetValue))))})},update:function(b){var c=$H(),value=null;this.transforms.each(function(a){value=a.unit=='color'?$R(0,2).inject('#',function(m,v,i){return m+(Math.round(a.originalValue[i]+(a.targetValue[i]-a.originalValue[i])*b)).toColorPart()}):a.originalValue+Math.round(((a.targetValue-a.originalValue)*b)*1000)/1000+a.unit;c[a.style]=value});this.element.setStyle(c)}});Effect.Transform=Class.create();Object.extend(Effect.Transform.prototype,{initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(c){c.each(function(a){var b=$H(a).values().first();this.tracks.push($H({ids:$H(a).keys().first(),effect:Effect.Morph,options:{style:b}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var b=[$(a.ids)||$$(a.ids)].flatten();return b.map(function(e){return new a.effect(e,Object.extend({sync:true},a.options))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w('backgroundColor backgroundPosition borderBottomColor borderBottomStyle '+'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth '+'borderRightColor borderRightStyle borderRightWidth borderSpacing '+'borderTopColor borderTopStyle borderTopWidth bottom clip color '+'fontSize fontWeight height left letterSpacing lineHeight '+'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+'maxWidth minHeight minWidth opacity outlineColor outlineOffset '+'outlineWidth paddingBottom paddingLeft paddingRight paddingTop '+'right textIndent top width wordSpacing zIndex');Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.prototype.parseStyle=function(){var b=Element.extend(document.createElement('div'));b.innerHTML='<div style="'+this+'"></div>';var c=b.down().style,styleRules=$H();Element.CSS_PROPERTIES.each(function(a){if(c[a])styleRules[a]=c[a]});if(/MSIE/.test(navigator.userAgent)&&!window.opera&&this.indexOf('opacity')>-1){styleRules.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]};return styleRules};Element.morph=function(a,b){new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a};['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom','collectTextNodes','collectTextNodesIgnoreClass','morph'].each(function(f){Element.Methods[f]=Element[f]});Element.Methods.visualEffect=function(a,b,c){s=b.gsub(/_/,'-').camelize();effect_class=s.charAt(0).toUpperCase()+s.substring(1);new Effect[effect_class](a,c);return $(a)};Element.addMethods();
3
- var Builder={NODEMAP:{AREA:'map',CAPTION:'table',COL:'table',COLGROUP:'table',LEGEND:'fieldset',OPTGROUP:'select',OPTION:'select',PARAM:'object',TBODY:'table',TD:'table',TFOOT:'table',TH:'table',THEAD:'table',TR:'table'},node:function(a){a=a.toUpperCase();var b=this.NODEMAP[a]||'div';var c=document.createElement(b);try{c.innerHTML="<"+a+"></"+a+">"}catch(e){}var d=c.firstChild||null;if(d&&(d.tagName.toUpperCase()!=a))d=d.getElementsByTagName(a)[0];if(!d)d=document.createElement(a);if(!d)return;if(arguments[1])if(this._isStringOrNumber(arguments[1])||(arguments[1]instanceof Array)){this._children(d,arguments[1])}else{var f=this._attributes(arguments[1]);if(f.length){try{c.innerHTML="<"+a+" "+f+"></"+a+">"}catch(e){}d=c.firstChild||null;if(!d){d=document.createElement(a);for(attr in arguments[1])d[attr=='class'?'className':attr]=arguments[1][attr]}if(d.tagName.toUpperCase()!=a)d=c.getElementsByTagName(a)[0]}};if(arguments[2])this._children(d,arguments[2]);return d},_text:function(a){return document.createTextNode(a)},ATTR_MAP:{'className':'class','htmlFor':'for'},_attributes:function(a){var b=[];for(attribute in a)b.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+a[attribute].toString().escapeHTML()+'"');return b.join(" ")},_children:function(a,b){if(typeof b=='object'){b.flatten().each(function(e){if(typeof e=='object')a.appendChild(e);else if(Builder._isStringOrNumber(e))a.appendChild(Builder._text(e))})}else if(Builder._isStringOrNumber(b))a.appendChild(Builder._text(b))},_isStringOrNumber:function(a){return(typeof a=='string'||typeof a=='number')},build:function(a){var b=this.node('div');$(b).update(a.strip());return b.down()},dump:function(b){if(typeof b!='object'&&typeof b!='function')b=window;var c=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY "+"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET "+"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);c.each(function(a){b[a]=function(){return Builder.node.apply(Builder,[a].concat($A(arguments)))}})}};
4
- if(typeof Effect=='undefined')throw("dragdrop.js requires including script.aculo.us' effects.js library");var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(d){return d.element==$(a)})},add:function(a){a=$(a);var b=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(b.containment){b._containers=[];var d=b.containment;if((typeof d=='object')&&(d.constructor==Array)){d.each(function(c){b._containers.push($(c))})}else{b._containers.push($(d))}};if(b.accept)b.accept=[b.accept].flatten();Element.makePositioned(a);b.element=a;this.drops.push(b)},findDeepestChild:function(a){deepest=a[0];for(i=1;i<a.length;++i)if(Element.isParent(a[i].element,deepest.element))deepest=a[i];return deepest},isContained:function(a,b){var d;if(b.tree){d=a.treeNode}else{d=a.parentNode}return b._containers.detect(function(c){return d==c})},isAffected:function(a,b,c){return((c.element!=b)&&((!c._containers)||this.isContained(b,c))&&((!c.accept)||(Element.classNames(b).detect(function(v){return c.accept.include(v)})))&&Position.within(c.element,a[0],a[1]))},deactivate:function(a){if(a.hoverclass)Element.removeClassName(a.element,a.hoverclass);this.last_active=null},activate:function(a){if(a.hoverclass)Element.addClassName(a.element,a.hoverclass);this.last_active=a},show:function(b,c){if(!this.drops.length)return;var d=[];if(this.last_active)this.deactivate(this.last_active);this.drops.each(function(a){if(Droppables.isAffected(b,c,a))d.push(a)});if(d.length>0){drop=Droppables.findDeepestChild(d);Position.within(drop.element,b[0],b[1]);if(drop.onHover)drop.onHover(c,drop.element,Position.overlap(drop.overlap,drop.element));Droppables.activate(drop)}},fire:function(a,b){if(!this.last_active)return;Position.prepare();if(this.isAffected([Event.pointerX(a),Event.pointerY(a)],b,this.last_active))if(this.last_active.onDrop)this.last_active.onDrop(b,this.last_active.element,a)},reset:function(){if(this.last_active)this.deactivate(this.last_active)}};var Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)};this.drags.push(a)},unregister:function(a){this.drags=this.drags.reject(function(d){return d==a});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay)}else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(!this.activeDraggable)return;var b=[Event.pointerX(a),Event.pointerY(a)];if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect()))return;this._lastPointer=b;if(document.createCDATASection==null){try{spdfix.innerHTML=b[0]}catch(e){spdfix=document.createElement('div');spdfix.style.display='none';document.body.insertBefore(spdfix,document.body.firstChild)}};this.activeDraggable.updateDrag(a,b)},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable)return;this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null},keyPress:function(a){if(this.activeDraggable)this.activeDraggable.keyPress(a)},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(a){this.observers=this.observers.reject(function(o){return o.element==a});this._cacheObserverCallbacks()},notify:function(a,b,c){if(this[a+'Count']>0)this.observers.each(function(o){if(o[a])o[a](a,b,c)});if(b.options[a])b.options[a](b,c)},_cacheObserverCallbacks:function(){['onStart','onEnd','onDrag'].each(function(a){Draggables[a+'Count']=Draggables.observers.select(function(o){return o[a]}).length})}};var Draggable=Class.create();Draggable._dragging={};Draggable.prototype={initialize:function(e){var f={handle:false,reverteffect:function(a,b,c){var d=Math.sqrt(Math.abs(b^2)+Math.abs(c^2))*0.02;new Effect.Move(a,{x:-c,y:-b,duration:d,queue:{scope:'_draggable',position:'end'}})},endeffect:function(a){var b=typeof a._opacity=='number'?a._opacity:1.0;new Effect.Opacity(a,{duration:0.2,from:0.7,to:b,queue:{scope:'_draggable',position:'end'},afterFinish:function(){Draggable._dragging[a]=false}})},zindex:1000,revert:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||typeof arguments[1].endeffect=='undefined')Object.extend(f,{starteffect:function(a){a._opacity=Element.getOpacity(a);Draggable._dragging[a]=true;new Effect.Opacity(a,{duration:0.2,from:a._opacity,to:0.7})}});var g=Object.extend(f,arguments[1]||{});this.element=$(e);if(g.handle&&(typeof g.handle=='string'))this.handle=this.element.down('.'+g.handle,0);if(!this.handle)this.handle=$(g.handle);if(!this.handle)this.handle=this.element;if(g.scroll&&!g.scroll.scrollTo&&!g.scroll.outerHTML){g.scroll=$(g.scroll);this._isScrollChild=Element.childOf(this.element,g.scroll)};Element.makePositioned(this.element);this.options=g;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return([parseInt(Element.getStyle(this.element,'left')||'0'),parseInt(Element.getStyle(this.element,'top')||'0')])},initDrag:function(a){if(typeof Draggable._dragging[this.element]!='undefined'&&Draggable._dragging[this.element])return;if(Event.isLeftClick(a)){var b=Event.element(a);if((tag_name=b.tagName.toUpperCase())&&(tag_name=='INPUT'||tag_name=='SELECT'||tag_name=='OPTION'||tag_name=='BUTTON'||tag_name=='TEXTAREA'))return;var c=[Event.pointerX(a),Event.pointerY(a)];var d=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(i){return(c[i]-d[i])});Draggables.activate(this);Event.stop(a)}},startDrag:function(a){this.dragging=true;if(!this.delta)this.delta=this.currentDelta();if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,'z-index')||0);this.element.style.zIndex=this.options.zindex};if(this.options.ghosting){this._clone=this.element.cloneNode(true);Position.absolutize(this.element);this.element.parentNode.insertBefore(this._clone,this.element)};if(this.options.scroll){if(this.options.scroll==window){var b=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=b.left;this.originalScrollTop=b.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}};Draggables.notify('onStart',this,a);if(this.options.starteffect)this.options.starteffect(this.element)},updateDrag:function(a,b){if(!this.dragging)this.startDrag(a);Position.prepare();Droppables.show(b,this.element);Draggables.notify('onDrag',this,a);this.draw(b);if(this.options.change)this.options.change(this);if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]}}else{p=Position.page(this.options.scroll);p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight)};var c=[0,0];if(b[0]<(p[0]+this.options.scrollSensitivity))c[0]=b[0]-(p[0]+this.options.scrollSensitivity);if(b[1]<(p[1]+this.options.scrollSensitivity))c[1]=b[1]-(p[1]+this.options.scrollSensitivity);if(b[0]>(p[2]-this.options.scrollSensitivity))c[0]=b[0]-(p[2]-this.options.scrollSensitivity);if(b[1]>(p[3]-this.options.scrollSensitivity))c[1]=b[1]-(p[3]-this.options.scrollSensitivity);this.startScrolling(c)};if(navigator.appVersion.indexOf('AppleWebKit')>0)window.scrollBy(0,0);Event.stop(a)},finishDrag:function(a,b){this.dragging=false;if(this.options.ghosting){Position.relativize(this.element);Element.remove(this._clone);this._clone=null};if(b)Droppables.fire(a,this.element);Draggables.notify('onEnd',this,a);var c=this.options.revert;if(c&&typeof c=='function')c=c(this.element);var d=this.currentDelta();if(c&&this.options.reverteffect){this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0])}else{this.delta=d};if(this.options.zindex)this.element.style.zIndex=this.originalZ;if(this.options.endeffect)this.options.endeffect(this.element);Draggables.deactivate(this);Droppables.reset()},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC)return;this.finishDrag(a,false);Event.stop(a)},endDrag:function(a){if(!this.dragging)return;this.stopScrolling();this.finishDrag(a,true);Event.stop(a)},draw:function(a){var b=Position.cumulativeOffset(this.element);if(this.options.ghosting){var r=Position.realOffset(this.element);b[0]+=r[0]-Position.deltaX;b[1]+=r[1]-Position.deltaY};var d=this.currentDelta();b[0]-=d[0];b[1]-=d[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){b[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;b[1]-=this.options.scroll.scrollTop-this.originalScrollTop};var p=[0,1].map(function(i){return(a[i]-b[i]-this.offset[i])}.bind(this));if(this.options.snap){if(typeof this.options.snap=='function'){p=this.options.snap(p[0],p[1],this)}else{if(this.options.snap instanceof Array){p=p.map(function(v,i){return Math.round(v/this.options.snap[i])*this.options.snap[i]}.bind(this))}else{p=p.map(function(v){return Math.round(v/this.options.snap)*this.options.snap}.bind(this))}}};var c=this.element.style;if((!this.options.constraint)||(this.options.constraint=='horizontal'))c.left=p[0]+"px";if((!this.options.constraint)||(this.options.constraint=='vertical'))c.top=p[1]+"px";if(c.visibility=="hidden")c.visibility=""},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(!(a[0]||a[1]))return;this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var a=new Date();var b=a-this.lastScrolled;this.lastScrolled=a;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=b/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*b/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*b/1000};Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify('onDrag',this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*b/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*b/1000;if(Draggables._lastScrollPointer[0]<0)Draggables._lastScrollPointer[0]=0;if(Draggables._lastScrollPointer[1]<0)Draggables._lastScrollPointer[1]=0;this.draw(Draggables._lastScrollPointer)};if(this.options.change)this.options.change(this)},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else if(w.document.body){T=body.scrollTop;L=body.scrollLeft};if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}};return{top:T,left:L,width:W,height:H}}};var SortableObserver=Class.create();SortableObserver.prototype={initialize:function(a,b){this.element=$(a);this.observer=b;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element))this.observer(this.element)}};var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){while(a.tagName.toUpperCase()!="BODY"){if(a.id&&Sortable.sortables[a.id])return a;a=a.parentNode}},options:function(a){a=Sortable._findRootElement($(a));if(!a)return;return Sortable.sortables[a.id]},destroy:function(a){var s=Sortable.options(a);if(s){Draggables.removeObserver(s.element);s.droppables.each(function(d){Droppables.remove(d)});s.draggables.invoke('destroy');delete Sortable.sortables[s.element.id]}},create:function(b){b=$(b);var c=Object.extend({element:b,tag:'li',dropOnEmpty:false,tree:false,treeTag:'ul',overlap:'vertical',constraint:'vertical',containment:b,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(b);var d={revert:true,scroll:c.scroll,scrollSpeed:c.scrollSpeed,scrollSensitivity:c.scrollSensitivity,delay:c.delay,ghosting:c.ghosting,constraint:c.constraint,handle:c.handle};if(c.starteffect)d.starteffect=c.starteffect;if(c.reverteffect)d.reverteffect=c.reverteffect;else if(c.ghosting)d.reverteffect=function(a){a.style.top=0;a.style.left=0};if(c.endeffect)d.endeffect=c.endeffect;if(c.zindex)d.zindex=c.zindex;var f={overlap:c.overlap,containment:c.containment,tree:c.tree,hoverclass:c.hoverclass,onHover:Sortable.onHover};var g={onHover:Sortable.onEmptyHover,overlap:c.overlap,containment:c.containment,tree:c.tree,hoverclass:c.hoverclass};Element.cleanWhitespace(b);c.draggables=[];c.droppables=[];if(c.dropOnEmpty||c.tree){Droppables.add(b,g);c.droppables.push(b)};(this.findElements(b,c)||[]).each(function(e){var a=c.handle?$(e).down('.'+c.handle,0):e;c.draggables.push(new Draggable(e,Object.extend(d,{handle:a})));Droppables.add(e,f);if(c.tree)e.treeNode=b;c.droppables.push(e)});if(c.tree){(Sortable.findTreeElements(b,c)||[]).each(function(e){Droppables.add(e,g);e.treeNode=b;c.droppables.push(e)})};this.sortables[b.id]=c;Draggables.addObserver(new SortableObserver(b,c.onUpdate))},findElements:function(a,b){return Element.findChildren(a,b.only,b.tree?true:false,b.tag)},findTreeElements:function(a,b){return Element.findChildren(a,b.only,b.tree?true:false,b.treeTag)},onHover:function(a,b,c){if(Sortable.options(b).tree){if(Element.isParent(b,a)||(c>.33&&c<.66)){return}}else{if(Element.isParent(a,b)){return}};if(c>0.5){Sortable.mark(b,'before');if(b.previousSibling!=a){var d=a.parentNode;a.style.visibility="hidden";b.parentNode.insertBefore(a,b);if(b.parentNode!=d)Sortable.options(d).onChange(a,"left_to",b);Sortable.options(b.parentNode).onChange(a,"left_to",b)}}else{Sortable.mark(b,'after');var e=b.nextSibling||null;if(e!=a){var d=a.parentNode;a.style.visibility="hidden";b.parentNode.insertBefore(a,e);if(b.parentNode!=d)Sortable.options(d).onChange(a,"right_to",b);Sortable.options(b.parentNode).onChange(a,"right_to",b)}}},onEmptyHover:function(a,b,c){var d=a.parentNode;var e=Sortable.options(b);if(Sortable.options(b).tree){if(!Element.isParent(b,a)){var f;var g=Sortable.findElements(b,{tag:e.tag,only:e.only});var h=null;if(g){var i=Element.offsetSize(b,e.overlap)*(1.0-c);for(f=0;f<g.length;f+=1){if(i-Element.offsetSize(g[f],e.overlap)>=0){i-=Element.offsetSize(g[f],e.overlap)}else if(i-(Element.offsetSize(g[f],e.overlap)/2)>=0){h=f+1<g.length?1:null;break}else{h=1;break}}};if(h==null){b.appendChild(a);Sortable.options(d).onChange(a);e.onChange(a)}}}else{if(Element.isParent(a,b))return;b.appendChild(a);Sortable.options(d).onChange(a);e.onChange(a)}},unmark:function(){if(Sortable._marker)Sortable._marker.hide()},mark:function(a,b){var c=Sortable.options(a.parentNode);if(c&&!c.ghosting)return;if(!Sortable._marker){Sortable._marker=($('dropmarker')||Element.extend(document.createElement('DIV'))).hide().addClassName('dropmarker').setStyle({position:'absolute'});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)};var d=Position.cumulativeOffset(a);Sortable._marker.setStyle({left:d[0]+'px',top:d[1]+'px'});if(b=='after')if(c.overlap=='horizontal')Sortable._marker.setStyle({left:(d[0]+a.clientWidth)+'px'});else Sortable._marker.setStyle({top:(d[1]+a.clientHeight)+'px'});Sortable._marker.show()},_tree:function(a,b,c){var d=Sortable.findElements(a,b)||[];for(var i=0;i<d.length;++i){var e=d[i].id.match(b.format);if(!e)continue;var f={id:encodeURIComponent(e?e[1]:null),element:a,parent:c,children:[],position:c.children.length,container:$(d[i]).down(b.treeTag)};if(f.container)this._tree(f.container,b,f);c.children.push(f)};return c},tree:function(a){a=$(a);var b=this.options(a);var c=Object.extend({tag:b.tag,treeTag:b.treeTag,only:b.only,name:a.id,format:b.format},arguments[1]||{});var d={id:null,parent:null,children:[],container:a,position:0};return Sortable._tree(a,c,d)},_constructIndex:function(a){var b='';do{if(a.id)b='['+a.position+']'+b}while((a=a.parent)!=null);return b},sequence:function(b){b=$(b);var c=Object.extend(this.options(b),arguments[1]||{});return $(this.findElements(b,c)||[]).map(function(a){return a.id.match(c.format)?a.id.match(c.format)[1]:''})},setSequence:function(b,c){b=$(b);var d=Object.extend(this.options(b),arguments[2]||{});var e={};this.findElements(b,d).each(function(n){if(n.id.match(d.format))e[n.id.match(d.format)[1]]=[n,n.parentNode];n.parentNode.removeChild(n)});c.each(function(a){var n=e[a];if(n){n[1].appendChild(n[0]);delete e[a]}})},serialize:function(b){b=$(b);var c=Object.extend(Sortable.options(b),arguments[1]||{});var d=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:b.id);if(c.tree){return Sortable.tree(b,arguments[1]).children.map(function(a){return[d+Sortable._constructIndex(a)+"[id]="+encodeURIComponent(a.id)].concat(a.children.map(arguments.callee))}).flatten().join('&')}else{return Sortable.sequence(b,arguments[1]).map(function(a){return d+"[]="+encodeURIComponent(a)}).join('&')}}};Element.isParent=function(a,b){if(!a.parentNode||a==b)return false;if(a.parentNode==b)return true;return Element.isParent(a.parentNode,b)};Element.findChildren=function(b,c,d,f){if(!b.hasChildNodes())return null;f=f.toUpperCase();if(c)c=[c].flatten();var g=[];$A(b.childNodes).each(function(e){if(e.tagName&&e.tagName.toUpperCase()==f&&(!c||(Element.classNames(e).detect(function(v){return c.include(v)}))))g.push(e);if(d){var a=Element.findChildren(e,c,d,f);if(a)g.push(a)}});return(g.length>0?g.flatten():[])};Element.offsetSize=function(a,b){return a['offset'+((b=='vertical'||b=='height')?'Height':'Width')]};
 
 
 
 
js/tadv.js ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // TinyMCE Advanced jQuery sortables
2
+
3
+ (function($) {
4
+ tadvSortable = {
5
+
6
+ init : function() {
7
+ $("#toolbar_1").sortable({
8
+ connectWith: ["#toolbar_2, #toolbar_3, #toolbar_4, #tadvpalette"],
9
+ items : 'li',
10
+ stop : tadvSortable.update,
11
+ revert : true,
12
+ containment : '#contain'
13
+ });
14
+
15
+ $("#toolbar_2").sortable({
16
+ connectWith: ["#toolbar_1, #toolbar_3, #toolbar_4, #tadvpalette"],
17
+ items : 'li',
18
+ stop : tadvSortable.update,
19
+ revert : true,
20
+ containment : '#contain'
21
+ });
22
+
23
+ $("#toolbar_3").sortable({
24
+ connectWith: ["#toolbar_2, #toolbar_1, #toolbar_4, #tadvpalette"],
25
+ items : 'li',
26
+ stop : tadvSortable.update,
27
+ revert : true,
28
+ containment : '#contain'
29
+ });
30
+
31
+ $("#toolbar_4").sortable({
32
+ connectWith: ["#toolbar_2, #toolbar_3, #toolbar_1, #tadvpalette"],
33
+ items : 'li',
34
+ stop : tadvSortable.update,
35
+ revert : true,
36
+ containment : '#contain'
37
+ });
38
+
39
+ $("#tadvpalette").sortable({
40
+ connectWith: ["#toolbar_1, #toolbar_2, #toolbar_3, #toolbar_4"],
41
+ items : 'li',
42
+ stop : tadvSortable.update,
43
+ revert : true,
44
+ containment : '#contain'
45
+ });
46
+
47
+ this.update();
48
+ $(window).resize(function(){
49
+ tadvSortable.update();
50
+ });
51
+ },
52
+
53
+ I : function(a) {
54
+ return document.getElementById(a);
55
+ },
56
+
57
+ serialize : function() {
58
+ var tb1, tb2, tb3, tb4;
59
+
60
+ tb1 = $('#toolbar_1').sortable('serialize',{expression : '([^_]+)_(.+)'});
61
+ tb2 = $('#toolbar_2').sortable('serialize',{expression : '([^_]+)_(.+)'});
62
+ tb3 = $('#toolbar_3').sortable('serialize',{expression : '([^_]+)_(.+)'})
63
+ tb4 = $('#toolbar_4').sortable('serialize',{expression : '([^_]+)_(.+)'})
64
+
65
+ $('#toolbar_1order').val(tb1);
66
+ $('#toolbar_2order').val(tb2);
67
+ $('#toolbar_3order').val(tb3);
68
+ $('#toolbar_4order').val(tb4);
69
+
70
+ if ( (tb1.indexOf('wp_adv') != -1 && ! tb2) ||
71
+ (tb2.indexOf('wp_adv') != -1 && ! tb3) ||
72
+ (tb3.indexOf('wp_adv') != -1 && ! tb4) ||
73
+ tb4.indexOf('wp_adv') != -1 ) {
74
+ $('#sink_err').css('display', 'inline');
75
+ return false;
76
+ }
77
+ $('#tadvadmin').submit();
78
+ },
79
+
80
+ reset : function() {
81
+ var pd = this.I('tadvpalette');
82
+ if( pd.childNodes.length > 6 ) {
83
+ var last = pd.lastChild.previousSibling;
84
+ pd.style.height = last.offsetTop + last.offsetHeight + 30 + "px";
85
+ } else pd.style.height = "60px";
86
+ },
87
+
88
+ update : function() {
89
+ var t = tadvSortable, w;
90
+
91
+ t.reset();
92
+ $('#too_long').css('display', 'none');
93
+ $('#sink_err').css('display', 'none');
94
+
95
+ $('.container').each(function(no,o){
96
+ var kids = o.childNodes, tbwidth = o.clientWidth, W = 0;
97
+
98
+ for( i = 0; i < kids.length; i++ ) {
99
+ if ( w = kids[i].offsetWidth )
100
+ W += w;
101
+ }
102
+
103
+ if( (W+8) > tbwidth )
104
+ $('#too_long').css('display', 'inline');
105
+ });
106
+ }
107
+ }
108
+ }(jQuery));
109
+
110
+ jQuery(document).ready(function(){ tadvSortable.init(); });
js/tadv_replace.js CHANGED
@@ -19,6 +19,8 @@ tadvReplace = {
19
  }
20
  }
21
 
 
 
22
  if ( 'undefined' != typeof tb ) {
23
  btn1 = document.createElement('input');
24
  btn1.type = 'button';
@@ -39,8 +41,7 @@ tadvReplace = {
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) {
@@ -50,7 +51,7 @@ tadvReplace = {
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');
@@ -59,6 +60,8 @@ tadvReplace = {
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, '');
@@ -77,7 +80,7 @@ tadvReplace = {
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
19
  }
20
  }
21
 
22
+ if ( c.value == '<br />\n' ) c.value = '';
23
+ /*
24
  if ( 'undefined' != typeof tb ) {
25
  btn1 = document.createElement('input');
26
  btn1.type = 'button';
41
  btn2.onclick = function(){tadvReplace.btn_undo();};
42
  tb.appendChild(btn2);
43
  }
44
+ */
 
45
  },
46
 
47
  pre_format : function(c) {
51
  return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
52
  });
53
 
54
+ c = c.replace(/<p>(\s|<br ?\/?>|\u00a0)*<\/p>/g, '<p><br class="spacer_" /></p>'); // keep empty paragraphs...
55
  c = c.replace(/\[\/sourcecode\]\s*<br \/>\s*<br \/>/g, '[/sourcecode]\n');
56
  c = c.replace(/<p( [^>]*)?>/g, '\n<p$1>');
57
  c = c.replace(/<\/p>/g, '</p>\n');
60
  c = c.replace(/<\/p>\s*<\/(blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])>/g, '</p></$1>');
61
  c = c.replace(/<br ?\/?>[\r\n]*/g, '<br />\n');
62
  c = c.replace(/<li([^>]*)>/g, '\t<li$1>');
63
+ c = c.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
64
+ c = c.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
65
 
66
  c = c.replace(/<object[\s\S]+?<\/object>/g, function(a) {
67
  return a.replace(/[\r\n]*/g, '');
80
  },
81
 
82
  btn_autop : function() {
83
+ var c = document.getElementById('content'), t = this, sel, btn_undo = document.getElementById('ed_undo'), autop = switchEditors.tadv_pre_wpautop;
84
  t.cache = c.value;
85
 
86
  if ( document.selection ) { //ie
mce/advhr/css/advhr.css CHANGED
@@ -1,5 +1,5 @@
1
- input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
2
- .panel_wrapper div.current {height:80px;}
3
- #width {width:50px; vertical-align:middle;}
4
- #width2 {width:50px; vertical-align:middle;}
5
- #size {width:100px;}
1
+ input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
2
+ .panel_wrapper div.current {height:80px;}
3
+ #width {width:50px; vertical-align:middle;}
4
+ #width2 {width:50px; vertical-align:middle;}
5
+ #size {width:100px;}
mce/advhr/js/rule.js CHANGED
@@ -1,34 +1,43 @@
1
- var AdvHRDialog = {
2
- init : function(ed) {
3
- var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
4
-
5
- w = dom.getAttrib(n, 'width');
6
- f.width.value = w ? parseInt(w) : '';
7
- f.size.value = dom.getAttrib(n, 'size');
8
- f.noshade.checked = !!dom.getAttrib(n, 'noshade');
9
- selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
10
- },
11
-
12
- update : function() {
13
- var ed = tinyMCEPopup.editor, h, f = document.forms[0];
14
-
15
- h = '<hr';
16
-
17
- if (f.size.value)
18
- h += ' size="' + f.size.value + '"';
19
-
20
- if (f.width.value)
21
- h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
22
-
23
- if (f.noshade.checked)
24
- h += ' noshade="noshade"';
25
-
26
- h += ' />';
27
-
28
- ed.execCommand("mceInsertContent", false, h);
29
- tinyMCEPopup.close();
30
- }
31
- };
32
-
33
- tinyMCEPopup.requireLangPack();
34
- tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
 
 
 
 
 
 
 
 
 
1
+ var AdvHRDialog = {
2
+ init : function(ed) {
3
+ var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
4
+
5
+ w = dom.getAttrib(n, 'width');
6
+ f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
7
+ f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
8
+ f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
9
+ selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
10
+ },
11
+
12
+ update : function() {
13
+ var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';
14
+
15
+ h = '<hr';
16
+
17
+ if (f.size.value) {
18
+ h += ' size="' + f.size.value + '"';
19
+ st += ' height:' + f.size.value + 'px;';
20
+ }
21
+
22
+ if (f.width.value) {
23
+ h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
24
+ st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
25
+ }
26
+
27
+ if (f.noshade.checked) {
28
+ h += ' noshade="noshade"';
29
+ st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
30
+ }
31
+
32
+ if (ed.settings.inline_styles)
33
+ h += ' style="' + tinymce.trim(st) + '"';
34
+
35
+ h += ' />';
36
+
37
+ ed.execCommand("mceInsertContent", false, h);
38
+ tinyMCEPopup.close();
39
+ }
40
+ };
41
+
42
+ tinyMCEPopup.requireLangPack();
43
+ tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
mce/advhr/langs/en_dlg.js CHANGED
@@ -1,5 +1,5 @@
1
- tinyMCE.addI18n('en.advhr_dlg',{
2
- width:"Width",
3
- size:"Height",
4
- noshade:"No shadow"
5
  });
1
+ tinyMCE.addI18n('en.advhr_dlg',{
2
+ width:"Width",
3
+ size:"Height",
4
+ noshade:"No shadow"
5
  });
mce/advhr/langs/ja_dlg.js CHANGED
@@ -1,5 +1,5 @@
1
  tinyMCE.addI18n('ja.advhr_dlg',{
2
- width:"\u5BBD",
3
- size:"\u957F",
4
- noshade:"\u65E0\u9634\u5F71"
5
  });
1
  tinyMCE.addI18n('ja.advhr_dlg',{
2
+ width:"\u5E45",
3
+ size:"\u9AD8\u3055",
4
+ noshade:"\u5F71\u306A\u3057"
5
  });
mce/advhr/langs/langs.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
- if ( is_file($lang_file) && is_readable($lang_file) ) {
5
  $strings .= getFileContents($lang_file);
6
- }
7
  ?>
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
+ if ( is_file($lang_file) && is_readable($lang_file) )
5
  $strings .= getFileContents($lang_file);
6
+ else $strings .= getFileContents(dirname(__FILE__) . '/en_dlg.js');
7
  ?>
mce/advhr/rule.htm CHANGED
@@ -1,63 +1,63 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#advhr.advhr_desc}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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>
13
- <form onsubmit="AdvHRDialog.update();return false;" action="#">
14
- <div class="tabs">
15
- <ul>
16
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>
17
- </ul>
18
- </div>
19
-
20
- <div class="panel_wrapper">
21
- <div id="general_panel" class="panel current">
22
- <table border="0" cellpadding="4" cellspacing="0">
23
- <tr>
24
- <td><label for="width">{#advhr_dlg.width}</label></td>
25
- <td nowrap="nowrap">
26
- <input id="width" name="width" type="text" value="" class="mceFocus" />
27
- <select name="width2" id="width2">
28
- <option value="">px</option>
29
- <option value="%">%</option>
30
- </select>
31
- </td>
32
- </tr>
33
- <tr>
34
- <td><label for="size">{#advhr_dlg.size}</label></td>
35
- <td><select id="size" name="size">
36
- <option value="">Normal</option>
37
- <option value="1">1</option>
38
- <option value="2">2</option>
39
- <option value="3">3</option>
40
- <option value="4">4</option>
41
- <option value="5">5</option>
42
- </select></td>
43
- </tr>
44
- <tr>
45
- <td><label for="noshade">{#advhr_dlg.noshade}</label></td>
46
- <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
47
- </tr>
48
- </table>
49
- </div>
50
- </div>
51
-
52
- <div class="mceActionPanel">
53
- <div style="float: left">
54
- <input type="submit" id="insert" name="insert" value="{#insert}" />
55
- </div>
56
-
57
- <div style="float: right">
58
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
59
- </div>
60
- </div>
61
- </form>
62
- </body>
63
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#advhr.advhr_desc}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="js/rule.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
9
+ <link href="css/advhr.css?ver=311" rel="stylesheet" type="text/css" />
10
+ <base target="_self" />
11
+ </head>
12
+ <body>
13
+ <form onsubmit="AdvHRDialog.update();return false;" action="#">
14
+ <div class="tabs">
15
+ <ul>
16
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>
17
+ </ul>
18
+ </div>
19
+
20
+ <div class="panel_wrapper">
21
+ <div id="general_panel" class="panel current">
22
+ <table border="0" cellpadding="4" cellspacing="0">
23
+ <tr>
24
+ <td><label for="width">{#advhr_dlg.width}</label></td>
25
+ <td nowrap="nowrap">
26
+ <input id="width" name="width" type="text" value="" class="mceFocus" />
27
+ <select name="width2" id="width2">
28
+ <option value="">px</option>
29
+ <option value="%">%</option>
30
+ </select>
31
+ </td>
32
+ </tr>
33
+ <tr>
34
+ <td><label for="size">{#advhr_dlg.size}</label></td>
35
+ <td><select id="size" name="size">
36
+ <option value="">Normal</option>
37
+ <option value="1">1</option>
38
+ <option value="2">2</option>
39
+ <option value="3">3</option>
40
+ <option value="4">4</option>
41
+ <option value="5">5</option>
42
+ </select></td>
43
+ </tr>
44
+ <tr>
45
+ <td><label for="noshade">{#advhr_dlg.noshade}</label></td>
46
+ <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
47
+ </tr>
48
+ </table>
49
+ </div>
50
+ </div>
51
+
52
+ <div class="mceActionPanel">
53
+ <div style="float: left">
54
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
55
+ </div>
56
+
57
+ <div style="float: right">
58
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
59
+ </div>
60
+ </div>
61
+ </form>
62
+ </body>
63
+ </html>
mce/advimage/css/advimage.css CHANGED
@@ -1,13 +1,13 @@
1
- #src_list, #over_list, #out_list {width:280px;}
2
- .mceActionPanel {margin-top:7px;}
3
- .alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
4
- .checkbox {border:0;}
5
- .panel_wrapper div.current {height:305px;}
6
- #prev {margin:0; border:1px solid #000; width:99%; height:150px; overflow:auto;}
7
- #align, #classlist {width:150px;}
8
- #width, #height {vertical-align:middle; width:50px; text-align:center;}
9
- #vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
10
- #class_list {width:180px;}
11
- input {width: 280px;}
12
- #constrain, #onmousemovecheck {width:auto;}
13
- #id, #dir, #lang, #usemap, #longdesc {width:200px;}
1
+ #src_list, #over_list, #out_list {width:280px;}
2
+ .mceActionPanel {margin-top:7px;}
3
+ .alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
4
+ .checkbox {border:0;}
5
+ .panel_wrapper div.current {height:305px;}
6
+ #prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
7
+ #align, #classlist {width:150px;}
8
+ #width, #height {vertical-align:middle; width:50px; text-align:center;}
9
+ #vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
10
+ #class_list {width:180px;}
11
+ input {width: 280px;}
12
+ #constrain, #onmousemovecheck {width:auto;}
13
+ #id, #dir, #lang, #usemap, #longdesc {width:200px;}
mce/advimage/image.htm CHANGED
@@ -1,238 +1,238 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#advimage_dlg.dialog_title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
15
- <form onsubmit="ImageDialog.insert();return false;" action="#">
16
- <div class="tabs">
17
- <ul>
18
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>
19
- <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>
20
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>
21
- </ul>
22
- </div>
23
-
24
- <div class="panel_wrapper">
25
- <div id="general_panel" class="panel current">
26
- <fieldset>
27
- <legend>{#advimage_dlg.general}</legend>
28
-
29
- <table class="properties">
30
- <tr>
31
- <td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
32
- <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
33
- <tr>
34
- <td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td>
35
- <td id="srcbrowsercontainer">&nbsp;</td>
36
- </tr>
37
- </table></td>
38
- </tr>
39
- <tr>
40
- <td><label for="src_list">{#advimage_dlg.image_list}</label></td>
41
- <td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"></select></td>
42
- </tr>
43
- <tr>
44
- <td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
45
- <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
46
- </tr>
47
- <tr>
48
- <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
49
- <td colspan="2"><input id="title" name="title" type="text" value="" /></td>
50
- </tr>
51
- </table>
52
- </fieldset>
53
-
54
- <fieldset>
55
- <legend>{#advimage_dlg.preview}</legend>
56
- <div id="prev"></div>
57
- </fieldset>
58
- </div>
59
-
60
- <div id="appearance_panel" class="panel">
61
- <fieldset>
62
- <legend>{#advimage_dlg.tab_appearance}</legend>
63
-
64
- <table border="0" cellpadding="4" cellspacing="0">
65
- <tr>
66
- <td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td>
67
- <td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();">
68
- <option value="">{#not_set}</option>
69
- <option value="baseline">{#advimage_dlg.align_baseline}</option>
70
- <option value="top">{#advimage_dlg.align_top}</option>
71
- <option value="middle">{#advimage_dlg.align_middle}</option>
72
- <option value="bottom">{#advimage_dlg.align_bottom}</option>
73
- <option value="text-top">{#advimage_dlg.align_texttop}</option>
74
- <option value="text-bottom">{#advimage_dlg.align_textbottom}</option>
75
- <option value="left">{#advimage_dlg.align_left}</option>
76
- <option value="right">{#advimage_dlg.align_right}</option>
77
- </select>
78
- </td>
79
- <td rowspan="6" valign="top">
80
- <div class="alignPreview">
81
- <img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />
82
- Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
83
- nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
84
- edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
85
- erat volutpat.
86
- </div>
87
- </td>
88
- </tr>
89
-
90
- <tr>
91
- <td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
92
- <td nowrap="nowrap">
93
- <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x
94
- <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px
95
- </td>
96
- </tr>
97
-
98
- <tr>
99
- <td>&nbsp;</td>
100
- <td><table border="0" cellpadding="0" cellspacing="0">
101
- <tr>
102
- <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
103
- <td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>
104
- </tr>
105
- </table></td>
106
- </tr>
107
-
108
- <tr>
109
- <td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td>
110
- <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />
111
- </td>
112
- </tr>
113
-
114
- <tr>
115
- <td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td>
116
- <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td>
117
- </tr>
118
-
119
- <tr>
120
- <td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td>
121
- <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td>
122
- </tr>
123
-
124
- <tr>
125
- <td><label for="class_list">{#class_name}</label></td>
126
- <td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"></select></td>
127
- </tr>
128
-
129
- <tr>
130
- <td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td>
131
- <td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td>
132
- </tr>
133
-
134
- <!-- <tr>
135
- <td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td>
136
- <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
137
- </tr> -->
138
- </table>
139
- </fieldset>
140
- </div>
141
-
142
- <div id="advanced_panel" class="panel">
143
- <fieldset>
144
- <legend>{#advimage_dlg.swap_image}</legend>
145
-
146
- <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" />
147
- <label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>
148
-
149
- <table border="0" cellpadding="4" cellspacing="0" width="100%">
150
- <tr>
151
- <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td>
152
- <td><table border="0" cellspacing="0" cellpadding="0">
153
- <tr>
154
- <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
155
- <td id="onmouseoversrccontainer">&nbsp;</td>
156
- </tr>
157
- </table></td>
158
- </tr>
159
- <tr>
160
- <td><label for="over_list">{#advimage_dlg.image_list}</label></td>
161
- <td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"></select></td>
162
- </tr>
163
- <tr>
164
- <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
165
- <td class="column2"><table border="0" cellspacing="0" cellpadding="0">
166
- <tr>
167
- <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
168
- <td id="onmouseoutsrccontainer">&nbsp;</td>
169
- </tr>
170
- </table></td>
171
- </tr>
172
- <tr>
173
- <td><label for="out_list">{#advimage_dlg.image_list}</label></td>
174
- <td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"></select></td>
175
- </tr>
176
- </table>
177
- </fieldset>
178
-
179
- <fieldset>
180
- <legend>{#advimage_dlg.misc}</legend>
181
-
182
- <table border="0" cellpadding="4" cellspacing="0">
183
- <tr>
184
- <td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
185
- <td><input id="id" name="id" type="text" value="" /></td>
186
- </tr>
187
-
188
- <tr>
189
- <td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
190
- <td>
191
- <select id="dir" name="dir" onchange="ImageDialog.changeAppearance();">
192
- <option value="">{#not_set}</option>
193
- <option value="ltr">{#advimage_dlg.ltr}</option>
194
- <option value="rtl">{#advimage_dlg.rtl}</option>
195
- </select>
196
- </td>
197
- </tr>
198
-
199
- <tr>
200
- <td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td>
201
- <td>
202
- <input id="lang" name="lang" type="text" value="" />
203
- </td>
204
- </tr>
205
-
206
- <tr>
207
- <td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td>
208
- <td>
209
- <input id="usemap" name="usemap" type="text" value="" />
210
- </td>
211
- </tr>
212
-
213
- <tr>
214
- <td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>
215
- <td><table border="0" cellspacing="0" cellpadding="0">
216
- <tr>
217
- <td><input id="longdesc" name="longdesc" type="text" value="" /></td>
218
- <td id="longdesccontainer">&nbsp;</td>
219
- </tr>
220
- </table></td>
221
- </tr>
222
- </table>
223
- </fieldset>
224
- </div>
225
- </div>
226
-
227
- <div class="mceActionPanel">
228
- <div style="float: left">
229
- <input type="submit" id="insert" name="insert" value="{#insert}" />
230
- </div>
231
-
232
- <div style="float: right">
233
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
234
- </div>
235
- </div>
236
- </form>
237
- </body>
238
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#advimage_dlg.dialog_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js?ver=311"></script>
9
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
10
+ <script type="text/javascript" src="js/image.js?ver=311"></script>
11
+ <link href="css/advimage.css?ver=311" rel="stylesheet" type="text/css" />
12
+ <base target="_self" />
13
+ </head>
14
+ <body id="advimage" style="display: none">
15
+ <form onsubmit="ImageDialog.insert();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>
19
+ <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>
20
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>
21
+ </ul>
22
+ </div>
23
+
24
+ <div class="panel_wrapper">
25
+ <div id="general_panel" class="panel current">
26
+ <fieldset>
27
+ <legend>{#advimage_dlg.general}</legend>
28
+
29
+ <table class="properties">
30
+ <tr>
31
+ <td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
32
+ <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
33
+ <tr>
34
+ <td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td>
35
+ <td id="srcbrowsercontainer">&nbsp;</td>
36
+ </tr>
37
+ </table></td>
38
+ </tr>
39
+ <tr>
40
+ <td><label for="src_list">{#advimage_dlg.image_list}</label></td>
41
+ <td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"></select></td>
42
+ </tr>
43
+ <tr>
44
+ <td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
45
+ <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
46
+ </tr>
47
+ <tr>
48
+ <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
49
+ <td colspan="2"><input id="title" name="title" type="text" value="" /></td>
50
+ </tr>
51
+ </table>
52
+ </fieldset>
53
+
54
+ <fieldset>
55
+ <legend>{#advimage_dlg.preview}</legend>
56
+ <div id="prev"></div>
57
+ </fieldset>
58
+ </div>
59
+
60
+ <div id="appearance_panel" class="panel">
61
+ <fieldset>
62
+ <legend>{#advimage_dlg.tab_appearance}</legend>
63
+
64
+ <table border="0" cellpadding="4" cellspacing="0">
65
+ <tr>
66
+ <td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td>
67
+ <td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();">
68
+ <option value="">{#not_set}</option>
69
+ <option value="baseline">{#advimage_dlg.align_baseline}</option>
70
+ <option value="top">{#advimage_dlg.align_top}</option>
71
+ <option value="middle">{#advimage_dlg.align_middle}</option>
72
+ <option value="bottom">{#advimage_dlg.align_bottom}</option>
73
+ <option value="text-top">{#advimage_dlg.align_texttop}</option>
74
+ <option value="text-bottom">{#advimage_dlg.align_textbottom}</option>
75
+ <option value="left">{#advimage_dlg.align_left}</option>
76
+ <option value="right">{#advimage_dlg.align_right}</option>
77
+ </select>
78
+ </td>
79
+ <td rowspan="6" valign="top">
80
+ <div class="alignPreview">
81
+ <img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />
82
+ Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
83
+ nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
84
+ edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
85
+ erat volutpat.
86
+ </div>
87
+ </td>
88
+ </tr>
89
+
90
+ <tr>
91
+ <td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
92
+ <td nowrap="nowrap">
93
+ <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x
94
+ <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px
95
+ </td>
96
+ </tr>
97
+
98
+ <tr>
99
+ <td>&nbsp;</td>
100
+ <td><table border="0" cellpadding="0" cellspacing="0">
101
+ <tr>
102
+ <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
103
+ <td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>
104
+ </tr>
105
+ </table></td>
106
+ </tr>
107
+
108
+ <tr>
109
+ <td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td>
110
+ <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />
111
+ </td>
112
+ </tr>
113
+
114
+ <tr>
115
+ <td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td>
116
+ <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td>
117
+ </tr>
118
+
119
+ <tr>
120
+ <td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td>
121
+ <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td>
122
+ </tr>
123
+
124
+ <tr>
125
+ <td><label for="class_list">{#class_name}</label></td>
126
+ <td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"></select></td>
127
+ </tr>
128
+
129
+ <tr>
130
+ <td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td>
131
+ <td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td>
132
+ </tr>
133
+
134
+ <!-- <tr>
135
+ <td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td>
136
+ <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
137
+ </tr> -->
138
+ </table>
139
+ </fieldset>
140
+ </div>
141
+
142
+ <div id="advanced_panel" class="panel">
143
+ <fieldset>
144
+ <legend>{#advimage_dlg.swap_image}</legend>
145
+
146
+ <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" />
147
+ <label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>
148
+
149
+ <table border="0" cellpadding="4" cellspacing="0" width="100%">
150
+ <tr>
151
+ <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td>
152
+ <td><table border="0" cellspacing="0" cellpadding="0">
153
+ <tr>
154
+ <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
155
+ <td id="onmouseoversrccontainer">&nbsp;</td>
156
+ </tr>
157
+ </table></td>
158
+ </tr>
159
+ <tr>
160
+ <td><label for="over_list">{#advimage_dlg.image_list}</label></td>
161
+ <td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"></select></td>
162
+ </tr>
163
+ <tr>
164
+ <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
165
+ <td class="column2"><table border="0" cellspacing="0" cellpadding="0">
166
+ <tr>
167
+ <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
168
+ <td id="onmouseoutsrccontainer">&nbsp;</td>
169
+ </tr>
170
+ </table></td>
171
+ </tr>
172
+ <tr>
173
+ <td><label for="out_list">{#advimage_dlg.image_list}</label></td>
174
+ <td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"></select></td>
175
+ </tr>
176
+ </table>
177
+ </fieldset>
178
+
179
+ <fieldset>
180
+ <legend>{#advimage_dlg.misc}</legend>
181
+
182
+ <table border="0" cellpadding="4" cellspacing="0">
183
+ <tr>
184
+ <td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
185
+ <td><input id="id" name="id" type="text" value="" /></td>
186
+ </tr>
187
+
188
+ <tr>
189
+ <td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
190
+ <td>
191
+ <select id="dir" name="dir" onchange="ImageDialog.changeAppearance();">
192
+ <option value="">{#not_set}</option>
193
+ <option value="ltr">{#advimage_dlg.ltr}</option>
194
+ <option value="rtl">{#advimage_dlg.rtl}</option>
195
+ </select>
196
+ </td>
197
+ </tr>
198
+
199
+ <tr>
200
+ <td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td>
201
+ <td>
202
+ <input id="lang" name="lang" type="text" value="" />
203
+ </td>
204
+ </tr>
205
+
206
+ <tr>
207
+ <td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td>
208
+ <td>
209
+ <input id="usemap" name="usemap" type="text" value="" />
210
+ </td>
211
+ </tr>
212
+
213
+ <tr>
214
+ <td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>
215
+ <td><table border="0" cellspacing="0" cellpadding="0">
216
+ <tr>
217
+ <td><input id="longdesc" name="longdesc" type="text" value="" /></td>
218
+ <td id="longdesccontainer">&nbsp;</td>
219
+ </tr>
220
+ </table></td>
221
+ </tr>
222
+ </table>
223
+ </fieldset>
224
+ </div>
225
+ </div>
226
+
227
+ <div class="mceActionPanel">
228
+ <div style="float: left">
229
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
230
+ </div>
231
+
232
+ <div style="float: right">
233
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
234
+ </div>
235
+ </div>
236
+ </form>
237
+ </body>
238
+ </html>
mce/advimage/js/image.js CHANGED
@@ -1,441 +1,441 @@
1
- var ImageDialog = {
2
- preInit : function() {
3
- var url;
4
-
5
- tinyMCEPopup.requireLangPack();
6
-
7
- if (url = tinyMCEPopup.getParam("external_image_list_url"))
8
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
9
- },
10
-
11
- init : function(ed) {
12
- var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();
13
-
14
- tinyMCEPopup.resizeToInnerSize();
15
- this.fillClassList('class_list');
16
- this.fillFileList('src_list', 'tinyMCEImageList');
17
- this.fillFileList('over_list', 'tinyMCEImageList');
18
- this.fillFileList('out_list', 'tinyMCEImageList');
19
- TinyMCE_EditableSelects.init();
20
-
21
- if (n.nodeName == 'IMG') {
22
- nl.src.value = dom.getAttrib(n, 'src');
23
- nl.width.value = dom.getAttrib(n, 'width');
24
- nl.height.value = dom.getAttrib(n, 'height');
25
- nl.alt.value = dom.getAttrib(n, 'alt');
26
- nl.title.value = dom.getAttrib(n, 'title');
27
- nl.vspace.value = this.getAttrib(n, 'vspace');
28
- nl.hspace.value = this.getAttrib(n, 'hspace');
29
- nl.border.value = this.getAttrib(n, 'border');
30
- selectByValue(f, 'align', this.getAttrib(n, 'align'));
31
- selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);
32
- nl.style.value = dom.getAttrib(n, 'style');
33
- nl.id.value = dom.getAttrib(n, 'id');
34
- nl.dir.value = dom.getAttrib(n, 'dir');
35
- nl.lang.value = dom.getAttrib(n, 'lang');
36
- nl.usemap.value = dom.getAttrib(n, 'usemap');
37
- nl.longdesc.value = dom.getAttrib(n, 'longdesc');
38
- nl.insert.value = ed.getLang('update');
39
-
40
- if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))
41
- nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
42
-
43
- if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))
44
- nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
45
-
46
- if (ed.settings.inline_styles) {
47
- // Move attribs to styles
48
- if (dom.getAttrib(n, 'align'))
49
- this.updateStyle('align');
50
-
51
- if (dom.getAttrib(n, 'hspace'))
52
- this.updateStyle('hspace');
53
-
54
- if (dom.getAttrib(n, 'border'))
55
- this.updateStyle('border');
56
-
57
- if (dom.getAttrib(n, 'vspace'))
58
- this.updateStyle('vspace');
59
- }
60
- }
61
-
62
- // Setup browse button
63
- document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
64
- if (isVisible('srcbrowser'))
65
- document.getElementById('src').style.width = '260px';
66
-
67
- // Setup browse button
68
- document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');
69
- if (isVisible('overbrowser'))
70
- document.getElementById('onmouseoversrc').style.width = '260px';
71
-
72
- // Setup browse button
73
- document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');
74
- if (isVisible('outbrowser'))
75
- document.getElementById('onmouseoutsrc').style.width = '260px';
76
-
77
- // If option enabled default contrain proportions to checked
78
- if (ed.getParam("advimage_constrain_proportions", true))
79
- f.constrain.checked = true;
80
-
81
- // Check swap image if valid data
82
- if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)
83
- this.setSwapImage(true);
84
- else
85
- this.setSwapImage(false);
86
-
87
- this.changeAppearance();
88
- this.showPreviewImage(nl.src.value, 1);
89
- },
90
-
91
- insert : function(file, title) {
92
- var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
93
-
94
- if (f.src.value === '') {
95
- if (ed.selection.getNode().nodeName == 'IMG') {
96
- ed.dom.remove(ed.selection.getNode());
97
- ed.execCommand('mceRepaint');
98
- }
99
-
100
- tinyMCEPopup.close();
101
- return;
102
- }
103
-
104
- if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
105
- if (!f.alt.value) {
106
- tinyMCEPopup.editor.windowManager.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
107
- if (s)
108
- t.insertAndClose();
109
- });
110
-
111
- return;
112
- }
113
- }
114
-
115
- t.insertAndClose();
116
- },
117
-
118
- insertAndClose : function() {
119
- var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
120
-
121
- tinyMCEPopup.restoreSelection();
122
-
123
- // Fixes crash in Safari
124
- if (tinymce.isWebKit)
125
- ed.getWin().focus();
126
-
127
- if (!ed.settings.inline_styles) {
128
- args = {
129
- vspace : nl.vspace.value,
130
- hspace : nl.hspace.value,
131
- border : nl.border.value,
132
- align : getSelectValue(f, 'align')
133
- };
134
- } else {
135
- // Remove deprecated values
136
- args = {
137
- vspace : '',
138
- hspace : '',
139
- border : '',
140
- align : ''
141
- };
142
- }
143
-
144
- tinymce.extend(args, {
145
- src : nl.src.value,
146
- width : nl.width.value,
147
- height : nl.height.value,
148
- alt : nl.alt.value,
149
- title : nl.title.value,
150
- 'class' : getSelectValue(f, 'class_list'),
151
- style : nl.style.value,
152
- id : nl.id.value,
153
- dir : nl.dir.value,
154
- lang : nl.lang.value,
155
- usemap : nl.usemap.value,
156
- longdesc : nl.longdesc.value
157
- });
158
-
159
- args.onmouseover = args.onmouseout = '';
160
-
161
- if (f.onmousemovecheck.checked) {
162
- if (nl.onmouseoversrc.value)
163
- args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";
164
-
165
- if (nl.onmouseoutsrc.value)
166
- args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";
167
- }
168
-
169
- el = ed.selection.getNode();
170
-
171
- if (el && el.nodeName == 'IMG') {
172
- ed.dom.setAttribs(el, args);
173
- } else {
174
- ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" src="javascript:;" />', {skip_undo : 1});
175
- ed.dom.setAttribs('__mce_tmp', args);
176
- ed.dom.setAttrib('__mce_tmp', 'id', '');
177
- ed.undoManager.add();
178
- }
179
-
180
- tinyMCEPopup.close();
181
- },
182
-
183
- getAttrib : function(e, at) {
184
- var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
185
-
186
- if (ed.settings.inline_styles) {
187
- switch (at) {
188
- case 'align':
189
- if (v = dom.getStyle(e, 'float'))
190
- return v;
191
-
192
- if (v = dom.getStyle(e, 'vertical-align'))
193
- return v;
194
-
195
- break;
196
-
197
- case 'hspace':
198
- v = dom.getStyle(e, 'margin-left')
199
- v2 = dom.getStyle(e, 'margin-right');
200
-
201
- if (v && v == v2)
202
- return parseInt(v.replace(/[^0-9]/g, ''));
203
-
204
- break;
205
-
206
- case 'vspace':
207
- v = dom.getStyle(e, 'margin-top')
208
- v2 = dom.getStyle(e, 'margin-bottom');
209
- if (v && v == v2)
210
- return parseInt(v.replace(/[^0-9]/g, ''));
211
-
212
- break;
213
-
214
- case 'border':
215
- v = 0;
216
-
217
- tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
218
- sv = dom.getStyle(e, 'border-' + sv + '-width');
219
-
220
- // False or not the same as prev
221
- if (!sv || (sv != v && v !== 0)) {
222
- v = 0;
223
- return false;
224
- }
225
-
226
- if (sv)
227
- v = sv;
228
- });
229
-
230
- if (v)
231
- return parseInt(v.replace(/[^0-9]/g, ''));
232
-
233
- break;
234
- }
235
- }
236
-
237
- if (v = dom.getAttrib(e, at))
238
- return v;
239
-
240
- return '';
241
- },
242
-
243
- setSwapImage : function(st) {
244
- var f = document.forms[0];
245
-
246
- f.onmousemovecheck.checked = st;
247
- setBrowserDisabled('overbrowser', !st);
248
- setBrowserDisabled('outbrowser', !st);
249
-
250
- if (f.over_list)
251
- f.over_list.disabled = !st;
252
-
253
- if (f.out_list)
254
- f.out_list.disabled = !st;
255
-
256
- f.onmouseoversrc.disabled = !st;
257
- f.onmouseoutsrc.disabled = !st;
258
- },
259
-
260
- fillClassList : function(id) {
261
- var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
262
-
263
- if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
264
- cl = [];
265
-
266
- tinymce.each(v.split(';'), function(v) {
267
- var p = v.split('=');
268
-
269
- cl.push({'title' : p[0], 'class' : p[1]});
270
- });
271
- } else
272
- cl = tinyMCEPopup.editor.dom.getClasses();
273
-
274
- if (cl.length > 0) {
275
- lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
276
-
277
- tinymce.each(cl, function(o) {
278
- lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
279
- });
280
- } else
281
- dom.remove(dom.getParent(id, 'tr'));
282
- },
283
-
284
- fillFileList : function(id, l) {
285
- var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
286
-
287
- l = window[l];
288
-
289
- if (l && l.length > 0) {
290
- lst.options[lst.options.length] = new Option('', '');
291
-
292
- tinymce.each(l, function(o) {
293
- lst.options[lst.options.length] = new Option(o[0], o[1]);
294
- });
295
- } else
296
- dom.remove(dom.getParent(id, 'tr'));
297
- },
298
-
299
- resetImageData : function() {
300
- var f = document.forms[0];
301
-
302
- f.elements.width.value = f.elements.height.value = '';
303
- },
304
-
305
- updateImageData : function(img, st) {
306
- var f = document.forms[0];
307
-
308
- if (!st) {
309
- f.elements.width.value = img.width;
310
- f.elements.height.value = img.height;
311
- }
312
-
313
- this.preloadImg = img;
314
- },
315
-
316
- changeAppearance : function() {
317
- var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');
318
-
319
- if (img) {
320
- if (ed.getParam('inline_styles')) {
321
- ed.dom.setAttrib(img, 'style', f.style.value);
322
- } else {
323
- img.align = f.align.value;
324
- img.border = f.border.value;
325
- img.hspace = f.hspace.value;
326
- img.vspace = f.vspace.value;
327
- }
328
- }
329
- },
330
-
331
- changeHeight : function() {
332
- var f = document.forms[0], tp, t = this;
333
-
334
- if (!f.constrain.checked || !t.preloadImg) {
335
- return;
336
- }
337
-
338
- if (f.width.value == "" || f.height.value == "")
339
- return;
340
-
341
- tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;
342
- f.height.value = tp.toFixed(0);
343
- },
344
-
345
- changeWidth : function() {
346
- var f = document.forms[0], tp, t = this;
347
-
348
- if (!f.constrain.checked || !t.preloadImg) {
349
- return;
350
- }
351
-
352
- if (f.width.value == "" || f.height.value == "")
353
- return;
354
-
355
- tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;
356
- f.width.value = tp.toFixed(0);
357
- },
358
-
359
- updateStyle : function(ty) {
360
- var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
361
-
362
- if (tinyMCEPopup.editor.settings.inline_styles) {
363
- // Handle align
364
- if (ty == 'align') {
365
- dom.setStyle(img, 'float', '');
366
- dom.setStyle(img, 'vertical-align', '');
367
-
368
- v = getSelectValue(f, 'align');
369
- if (v) {
370
- if (v == 'left' || v == 'right')
371
- dom.setStyle(img, 'float', v);
372
- else
373
- img.style.verticalAlign = v;
374
- }
375
- }
376
-
377
- // Handle border
378
- if (ty == 'border') {
379
- dom.setStyle(img, 'border', '');
380
-
381
- v = f.border.value;
382
- if (v || v == '0') {
383
- if (v == '0')
384
- img.style.border = '';
385
- else
386
- img.style.border = v + 'px solid black';
387
- }
388
- }
389
-
390
- // Handle hspace
391
- if (ty == 'hspace') {
392
- dom.setStyle(img, 'marginLeft', '');
393
- dom.setStyle(img, 'marginRight', '');
394
-
395
- v = f.hspace.value;
396
- if (v) {
397
- img.style.marginLeft = v + 'px';
398
- img.style.marginRight = v + 'px';
399
- }
400
- }
401
-
402
- // Handle vspace
403
- if (ty == 'vspace') {
404
- dom.setStyle(img, 'marginTop', '');
405
- dom.setStyle(img, 'marginBottom', '');
406
-
407
- v = f.vspace.value;
408
- if (v) {
409
- img.style.marginTop = v + 'px';
410
- img.style.marginBottom = v + 'px';
411
- }
412
- }
413
-
414
- // Merge
415
- dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText));
416
- }
417
- },
418
-
419
- changeMouseMove : function() {
420
- },
421
-
422
- showPreviewImage : function(u, st) {
423
- if (!u) {
424
- tinyMCEPopup.dom.setHTML('prev', '');
425
- return;
426
- }
427
-
428
- if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
429
- this.resetImageData();
430
-
431
- u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
432
-
433
- if (!st)
434
- tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
435
- else
436
- tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
437
- }
438
- };
439
-
440
- ImageDialog.preInit();
441
- tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
1
+ var ImageDialog = {
2
+ preInit : function() {
3
+ var url;
4
+
5
+ tinyMCEPopup.requireLangPack();
6
+
7
+ if (url = tinyMCEPopup.getParam("external_image_list_url"))
8
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
9
+ },
10
+
11
+ init : function(ed) {
12
+ var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();
13
+
14
+ tinyMCEPopup.resizeToInnerSize();
15
+ this.fillClassList('class_list');
16
+ this.fillFileList('src_list', 'tinyMCEImageList');
17
+ this.fillFileList('over_list', 'tinyMCEImageList');
18
+ this.fillFileList('out_list', 'tinyMCEImageList');
19
+ TinyMCE_EditableSelects.init();
20
+
21
+ if (n.nodeName == 'IMG') {
22
+ nl.src.value = dom.getAttrib(n, 'src');
23
+ nl.width.value = dom.getAttrib(n, 'width');
24
+ nl.height.value = dom.getAttrib(n, 'height');
25
+ nl.alt.value = dom.getAttrib(n, 'alt');
26
+ nl.title.value = dom.getAttrib(n, 'title');
27
+ nl.vspace.value = this.getAttrib(n, 'vspace');
28
+ nl.hspace.value = this.getAttrib(n, 'hspace');
29
+ nl.border.value = this.getAttrib(n, 'border');
30
+ selectByValue(f, 'align', this.getAttrib(n, 'align'));
31
+ selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);
32
+ nl.style.value = dom.getAttrib(n, 'style');
33
+ nl.id.value = dom.getAttrib(n, 'id');
34
+ nl.dir.value = dom.getAttrib(n, 'dir');
35
+ nl.lang.value = dom.getAttrib(n, 'lang');
36
+ nl.usemap.value = dom.getAttrib(n, 'usemap');
37
+ nl.longdesc.value = dom.getAttrib(n, 'longdesc');
38
+ nl.insert.value = ed.getLang('update');
39
+
40
+ if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))
41
+ nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
42
+
43
+ if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))
44
+ nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
45
+
46
+ if (ed.settings.inline_styles) {
47
+ // Move attribs to styles
48
+ if (dom.getAttrib(n, 'align'))
49
+ this.updateStyle('align');
50
+
51
+ if (dom.getAttrib(n, 'hspace'))
52
+ this.updateStyle('hspace');
53
+
54
+ if (dom.getAttrib(n, 'border'))
55
+ this.updateStyle('border');
56
+
57
+ if (dom.getAttrib(n, 'vspace'))
58
+ this.updateStyle('vspace');
59
+ }
60
+ }
61
+
62
+ // Setup browse button
63
+ document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
64
+ if (isVisible('srcbrowser'))
65
+ document.getElementById('src').style.width = '260px';
66
+
67
+ // Setup browse button
68
+ document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');
69
+ if (isVisible('overbrowser'))
70
+ document.getElementById('onmouseoversrc').style.width = '260px';
71
+
72
+ // Setup browse button
73
+ document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');
74
+ if (isVisible('outbrowser'))
75
+ document.getElementById('onmouseoutsrc').style.width = '260px';
76
+
77
+ // If option enabled default contrain proportions to checked
78
+ if (ed.getParam("advimage_constrain_proportions", true))
79
+ f.constrain.checked = true;
80
+
81
+ // Check swap image if valid data
82
+ if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)
83
+ this.setSwapImage(true);
84
+ else
85
+ this.setSwapImage(false);
86
+
87
+ this.changeAppearance();
88
+ this.showPreviewImage(nl.src.value, 1);
89
+ },
90
+
91
+ insert : function(file, title) {
92
+ var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
93
+
94
+ if (f.src.value === '') {
95
+ if (ed.selection.getNode().nodeName == 'IMG') {
96
+ ed.dom.remove(ed.selection.getNode());
97
+ ed.execCommand('mceRepaint');
98
+ }
99
+
100
+ tinyMCEPopup.close();
101
+ return;
102
+ }
103
+
104
+ if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
105
+ if (!f.alt.value) {
106
+ tinyMCEPopup.editor.windowManager.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
107
+ if (s)
108
+ t.insertAndClose();
109
+ });
110
+
111
+ return;
112
+ }
113
+ }
114
+
115
+ t.insertAndClose();
116
+ },
117
+
118
+ insertAndClose : function() {
119
+ var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
120
+
121
+ tinyMCEPopup.restoreSelection();
122
+
123
+ // Fixes crash in Safari
124
+ if (tinymce.isWebKit)
125
+ ed.getWin().focus();
126
+
127
+ if (!ed.settings.inline_styles) {
128
+ args = {
129
+ vspace : nl.vspace.value,
130
+ hspace : nl.hspace.value,
131
+ border : nl.border.value,
132
+ align : getSelectValue(f, 'align')
133
+ };
134
+ } else {
135
+ // Remove deprecated values
136
+ args = {
137
+ vspace : '',
138
+ hspace : '',
139
+ border : '',
140
+ align : ''
141
+ };
142
+ }
143
+
144
+ tinymce.extend(args, {
145
+ src : nl.src.value,
146
+ width : nl.width.value,
147
+ height : nl.height.value,
148
+ alt : nl.alt.value,
149
+ title : nl.title.value,
150
+ 'class' : getSelectValue(f, 'class_list'),
151
+ style : nl.style.value,
152
+ id : nl.id.value,
153
+ dir : nl.dir.value,
154
+ lang : nl.lang.value,
155
+ usemap : nl.usemap.value,
156
+ longdesc : nl.longdesc.value
157
+ });
158
+
159
+ args.onmouseover = args.onmouseout = '';
160
+
161
+ if (f.onmousemovecheck.checked) {
162
+ if (nl.onmouseoversrc.value)
163
+ args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";
164
+
165
+ if (nl.onmouseoutsrc.value)
166
+ args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";
167
+ }
168
+
169
+ el = ed.selection.getNode();
170
+
171
+ if (el && el.nodeName == 'IMG') {
172
+ ed.dom.setAttribs(el, args);
173
+ } else {
174
+ ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
175
+ ed.dom.setAttribs('__mce_tmp', args);
176
+ ed.dom.setAttrib('__mce_tmp', 'id', '');
177
+ ed.undoManager.add();
178
+ }
179
+
180
+ tinyMCEPopup.close();
181
+ },
182
+
183
+ getAttrib : function(e, at) {
184
+ var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
185
+
186
+ if (ed.settings.inline_styles) {
187
+ switch (at) {
188
+ case 'align':
189
+ if (v = dom.getStyle(e, 'float'))
190
+ return v;
191
+
192
+ if (v = dom.getStyle(e, 'vertical-align'))
193
+ return v;
194
+
195
+ break;
196
+
197
+ case 'hspace':
198
+ v = dom.getStyle(e, 'margin-left')
199
+ v2 = dom.getStyle(e, 'margin-right');
200
+
201
+ if (v && v == v2)
202
+ return parseInt(v.replace(/[^0-9]/g, ''));
203
+
204
+ break;
205
+
206
+ case 'vspace':
207
+ v = dom.getStyle(e, 'margin-top')
208
+ v2 = dom.getStyle(e, 'margin-bottom');
209
+ if (v && v == v2)
210
+ return parseInt(v.replace(/[^0-9]/g, ''));
211
+
212
+ break;
213
+
214
+ case 'border':
215
+ v = 0;
216
+
217
+ tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
218
+ sv = dom.getStyle(e, 'border-' + sv + '-width');
219
+
220
+ // False or not the same as prev
221
+ if (!sv || (sv != v && v !== 0)) {
222
+ v = 0;
223
+ return false;
224
+ }
225
+
226
+ if (sv)
227
+ v = sv;
228
+ });
229
+
230
+ if (v)
231
+ return parseInt(v.replace(/[^0-9]/g, ''));
232
+
233
+ break;
234
+ }
235
+ }
236
+
237
+ if (v = dom.getAttrib(e, at))
238
+ return v;
239
+
240
+ return '';
241
+ },
242
+
243
+ setSwapImage : function(st) {
244
+ var f = document.forms[0];
245
+
246
+ f.onmousemovecheck.checked = st;
247
+ setBrowserDisabled('overbrowser', !st);
248
+ setBrowserDisabled('outbrowser', !st);
249
+
250
+ if (f.over_list)
251
+ f.over_list.disabled = !st;
252
+
253
+ if (f.out_list)
254
+ f.out_list.disabled = !st;
255
+
256
+ f.onmouseoversrc.disabled = !st;
257
+ f.onmouseoutsrc.disabled = !st;
258
+ },
259
+
260
+ fillClassList : function(id) {
261
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
262
+
263
+ if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
264
+ cl = [];
265
+
266
+ tinymce.each(v.split(';'), function(v) {
267
+ var p = v.split('=');
268
+
269
+ cl.push({'title' : p[0], 'class' : p[1]});
270
+ });
271
+ } else
272
+ cl = tinyMCEPopup.editor.dom.getClasses();
273
+
274
+ if (cl.length > 0) {
275
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
276
+
277
+ tinymce.each(cl, function(o) {
278
+ lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
279
+ });
280
+ } else
281
+ dom.remove(dom.getParent(id, 'tr'));
282
+ },
283
+
284
+ fillFileList : function(id, l) {
285
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
286
+
287
+ l = window[l];
288
+
289
+ if (l && l.length > 0) {
290
+ lst.options[lst.options.length] = new Option('', '');
291
+
292
+ tinymce.each(l, function(o) {
293
+ lst.options[lst.options.length] = new Option(o[0], o[1]);
294
+ });
295
+ } else
296
+ dom.remove(dom.getParent(id, 'tr'));
297
+ },
298
+
299
+ resetImageData : function() {
300
+ var f = document.forms[0];
301
+
302
+ f.elements.width.value = f.elements.height.value = '';
303
+ },
304
+
305
+ updateImageData : function(img, st) {
306
+ var f = document.forms[0];
307
+
308
+ if (!st) {
309
+ f.elements.width.value = img.width;
310
+ f.elements.height.value = img.height;
311
+ }
312
+
313
+ this.preloadImg = img;
314
+ },
315
+
316
+ changeAppearance : function() {
317
+ var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');
318
+
319
+ if (img) {
320
+ if (ed.getParam('inline_styles')) {
321
+ ed.dom.setAttrib(img, 'style', f.style.value);
322
+ } else {
323
+ img.align = f.align.value;
324
+ img.border = f.border.value;
325
+ img.hspace = f.hspace.value;
326
+ img.vspace = f.vspace.value;
327
+ }
328
+ }
329
+ },
330
+
331
+ changeHeight : function() {
332
+ var f = document.forms[0], tp, t = this;
333
+
334
+ if (!f.constrain.checked || !t.preloadImg) {
335
+ return;
336
+ }
337
+
338
+ if (f.width.value == "" || f.height.value == "")
339
+ return;
340
+
341
+ tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;
342
+ f.height.value = tp.toFixed(0);
343
+ },
344
+
345
+ changeWidth : function() {
346
+ var f = document.forms[0], tp, t = this;
347
+
348
+ if (!f.constrain.checked || !t.preloadImg) {
349
+ return;
350
+ }
351
+
352
+ if (f.width.value == "" || f.height.value == "")
353
+ return;
354
+
355
+ tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;
356
+ f.width.value = tp.toFixed(0);
357
+ },
358
+
359
+ updateStyle : function(ty) {
360
+ var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
361
+
362
+ if (tinyMCEPopup.editor.settings.inline_styles) {
363
+ // Handle align
364
+ if (ty == 'align') {
365
+ dom.setStyle(img, 'float', '');
366
+ dom.setStyle(img, 'vertical-align', '');
367
+
368
+ v = getSelectValue(f, 'align');
369
+ if (v) {
370
+ if (v == 'left' || v == 'right')
371
+ dom.setStyle(img, 'float', v);
372
+ else
373
+ img.style.verticalAlign = v;
374
+ }
375
+ }
376
+
377
+ // Handle border
378
+ if (ty == 'border') {
379
+ dom.setStyle(img, 'border', '');
380
+
381
+ v = f.border.value;
382
+ if (v || v == '0') {
383
+ if (v == '0')
384
+ img.style.border = '0';
385
+ else
386
+ img.style.border = v + 'px solid black';
387
+ }
388
+ }
389
+
390
+ // Handle hspace
391
+ if (ty == 'hspace') {
392
+ dom.setStyle(img, 'marginLeft', '');
393
+ dom.setStyle(img, 'marginRight', '');
394
+
395
+ v = f.hspace.value;
396
+ if (v) {
397
+ img.style.marginLeft = v + 'px';
398
+ img.style.marginRight = v + 'px';
399
+ }
400
+ }
401
+
402
+ // Handle vspace
403
+ if (ty == 'vspace') {
404
+ dom.setStyle(img, 'marginTop', '');
405
+ dom.setStyle(img, 'marginBottom', '');
406
+
407
+ v = f.vspace.value;
408
+ if (v) {
409
+ img.style.marginTop = v + 'px';
410
+ img.style.marginBottom = v + 'px';
411
+ }
412
+ }
413
+
414
+ // Merge
415
+ dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText));
416
+ }
417
+ },
418
+
419
+ changeMouseMove : function() {
420
+ },
421
+
422
+ showPreviewImage : function(u, st) {
423
+ if (!u) {
424
+ tinyMCEPopup.dom.setHTML('prev', '');
425
+ return;
426
+ }
427
+
428
+ if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
429
+ this.resetImageData();
430
+
431
+ u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
432
+
433
+ if (!st)
434
+ tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
435
+ else
436
+ tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
437
+ }
438
+ };
439
+
440
+ ImageDialog.preInit();
441
+ tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
mce/advimage/langs/en_dlg.js CHANGED
@@ -1,43 +1,43 @@
1
- tinyMCE.addI18n('en.advimage_dlg',{
2
- tab_general:"General",
3
- tab_appearance:"Appearance",
4
- tab_advanced:"Advanced",
5
- general:"General",
6
- title:"Title",
7
- preview:"Preview",
8
- constrain_proportions:"Constrain proportions",
9
- langdir:"Language direction",
10
- langcode:"Language code",
11
- long_desc:"Long description link",
12
- style:"Style",
13
- classes:"Classes",
14
- ltr:"Left to right",
15
- rtl:"Right to left",
16
- id:"Id",
17
- map:"Image map",
18
- swap_image:"Swap image",
19
- alt_image:"Alternative image",
20
- mouseover:"for mouse over",
21
- mouseout:"for mouse out",
22
- misc:"Miscellaneous",
23
- example_img:"Appearance preview image",
24
- missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.",
25
- dialog_title:"Insert/edit image",
26
- src:"Image URL",
27
- alt:"Image description",
28
- list:"Image list",
29
- border:"Border",
30
- dimensions:"Dimensions",
31
- vspace:"Vertical space",
32
- hspace:"Horizontal space",
33
- align:"Alignment",
34
- align_baseline:"Baseline",
35
- align_top:"Top",
36
- align_middle:"Middle",
37
- align_bottom:"Bottom",
38
- align_texttop:"Text top",
39
- align_textbottom:"Text bottom",
40
- align_left:"Left",
41
- align_right:"Right",
42
- image_list:"Image list"
43
  });
1
+ tinyMCE.addI18n('en.advimage_dlg',{
2
+ tab_general:"General",
3
+ tab_appearance:"Appearance",
4
+ tab_advanced:"Advanced",
5
+ general:"General",
6
+ title:"Title",
7
+ preview:"Preview",
8
+ constrain_proportions:"Constrain proportions",
9
+ langdir:"Language direction",
10
+ langcode:"Language code",
11
+ long_desc:"Long description link",
12
+ style:"Style",
13
+ classes:"Classes",
14
+ ltr:"Left to right",
15
+ rtl:"Right to left",
16
+ id:"Id",
17
+ map:"Image map",
18
+ swap_image:"Swap image",
19
+ alt_image:"Alternative image",
20
+ mouseover:"for mouse over",
21
+ mouseout:"for mouse out",
22
+ misc:"Miscellaneous",
23
+ example_img:"Appearance preview image",
24
+ missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.",
25
+ dialog_title:"Insert/edit image",
26
+ src:"Image URL",
27
+ alt:"Image description",
28
+ list:"Image list",
29
+ border:"Border",
30
+ dimensions:"Dimensions",
31
+ vspace:"Vertical space",
32
+ hspace:"Horizontal space",
33
+ align:"Alignment",
34
+ align_baseline:"Baseline",
35
+ align_top:"Top",
36
+ align_middle:"Middle",
37
+ align_bottom:"Bottom",
38
+ align_texttop:"Text top",
39
+ align_textbottom:"Text bottom",
40
+ align_left:"Left",
41
+ align_right:"Right",
42
+ image_list:"Image list"
43
  });
mce/advimage/langs/ja_dlg.js CHANGED
@@ -1,43 +1,43 @@
1
  tinyMCE.addI18n('ja.advimage_dlg',{
2
- tab_general:"\u57FA\u672C",
3
- tab_appearance:"\u5916\u89C2",
4
- tab_advanced:"\u9AD8\u7EA7",
5
- general:"\u57FA\u672C",
6
- title:"\u67E5\u627E",
7
- preview:"\u9884\u89C8",
8
- constrain_proportions:"\u4FDD\u6301\u6BD4\u4F8B",
9
- langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411",
10
- langcode:"\u8BED\u8A00\u7F16\u7801",
11
- long_desc:"\u63CF\u8FF0",
12
- style:"\u6837\u5F0F",
13
- classes:"\u6837\u5F0F\u7C7B",
14
- ltr:"\u4ECE\u5DE6\u5230\u53F3",
15
- rtl:"\u4ECE\u53F3\u5230\u5DE6",
16
  id:"Id",
17
- map:"\u56FE\u7247\u70ED\u70B9",
18
- swap_image:"\u5207\u6362\u56FE\u7247",
19
- alt_image:"\u4EA4\u66FF\u56FE\u7247",
20
- mouseover:"\u9F20\u6807\u5212\u8FC7",
21
- mouseout:"\u9F20\u6807\u79FB\u51FA",
22
- misc:"\u5176\u5B83",
23
- example_img:"\u9884\u89C8\u56FE\u7247",
24
- missing_alt:" \u662F\u5426\u4E0D\u4E3A\u56FE\u7247\u52A0\u5165\u8BF4\u660E\u6587\u5B57\uFF0C\u5982\u679C\u4E0D\u52A0\u5165\u8BF4\u660E\u6587\u5B57\uFF0C\u5C06\u5BFC\u81F4\u4E0D\u652F\u6301\u56FE\u7247\u7684\u6D4F\u89C8\u5668\u5FFD\u7565\u672C\u5185\u5BB9",
25
- dialog_title:"\u63D2\u5165/\u7F16\u8F91 \u56FE\u7247",
26
- src:"\u56FE\u7247\u5730\u5740",
27
- alt:"\u56FE\u7247\u8BF4\u660E",
28
- list:"\u56FE\u7247\u6E05\u5355",
29
- border:"\u8FB9\u6846",
30
- dimensions:"\u5C3A\u5BF8",
31
- vspace:"\u5782\u76F4\u95F4\u8DDD",
32
- hspace:"\u6C34\u5E73\u95F4\u8DDD",
33
- align:"\u5BF9\u9F50\u65B9\u5F0F",
34
- align_baseline:"\u57FA\u7EBF",
35
- align_top:"\u9876\u90E8",
36
- align_middle:"\u4E2D\u90E8",
37
- align_bottom:"\u5E95\u90E8",
38
- align_texttop:"\u6587\u5B57\u4E0A\u65B9",
39
- align_textbottom:"\u6587\u5B57\u4E0B\u65B9",
40
- align_left:"\u5C45\u5DE6",
41
- align_right:"\u5C45\u53F3",
42
- image_list:"\u56FE\u7247\u6E05\u5355"
43
  });
1
  tinyMCE.addI18n('ja.advimage_dlg',{
2
+ tab_general:"\u4E00\u822C",
3
+ tab_appearance:"\u8868\u793A",
4
+ tab_advanced:"\u4E0A\u7D1A\u8005\u5411\u3051",
5
+ general:"\u4E00\u822C",
6
+ title:"\u30BF\u30A4\u30C8\u30EB",
7
+ preview:"\u30D7\u30EC\u30D3\u30E5\u30FC",
8
+ constrain_proportions:"\u7E26\u6A2A\u6BD4\u306E\u4FDD\u5B58",
9
+ langdir:"\u6587\u7AE0\u306E\u65B9\u5411",
10
+ langcode:"\u8A00\u8A9E\u30B3\u30FC\u30C9",
11
+ long_desc:"\u8A73\u7D30\u8AAC\u660E\u30EA\u30F3\u30AF",
12
+ style:"\u30B9\u30BF\u30A4\u30EB",
13
+ classes:"\u30AF\u30E9\u30B9",
14
+ ltr:"\u5DE6\u304B\u3089\u53F3",
15
+ rtl:"\u53F3\u304B\u3089\u5DE6",
16
  id:"Id",
17
+ map:"\u30A4\u30E1\u30FC\u30B8\u30DE\u30C3\u30D7",
18
+ swap_image:"\u30ED\u30FC\u30EB\u30AA\u30FC\u30D0\u30FC\u52B9\u679C",
19
+ alt_image:"\u753B\u50CF\u5207\u66FF\u3092\u884C\u3046",
20
+ mouseover:"\u30DE\u30A6\u30B9\u30AA\u30FC\u30D0\u30FC\u6642",
21
+ mouseout:"\u30DE\u30A6\u30B9\u30A2\u30A6\u30C8\u6642",
22
+ misc:"\u305D\u306E\u4ED6",
23
+ example_img:"Appearance preview image",
24
+ missing_alt:"\u753B\u50CF\u306E\u8AAC\u660E\u6587\u304C\u5165\u529B\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u76EE\u306E\u4E0D\u81EA\u7531\u306A\u65B9\u3084\u30C6\u30AD\u30B9\u30C8\u30D6\u30E9\u30A6\u30B6\u3092\u5229\u7528\u3055\u308C\u3066\u3044\u308B\u65B9\u3078\u914D\u616E\u3057\u3001\u753B\u50CF\u8AAC\u660E\u3092\u5165\u529B\u3059\u308B\u3053\u3068\u3092\u304A\u85A6\u3081\u3057\u307E\u3059\u3002",
25
+ dialog_title:"\u753B\u50CF\u306E\u633F\u5165/\u7DE8\u96C6",
26
+ src:"\u753B\u50CFURL",
27
+ alt:"\u753B\u50CF\u306E\u8AAC\u660E",
28
+ list:"\u4E00\u89A7\u304B\u3089\u9078\u3076",
29
+ border:"\u67A0\u7DDA",
30
+ dimensions:"\u30B5\u30A4\u30BA",
31
+ vspace:"\u4E0A\u4E0B\u4F59\u767D",
32
+ hspace:"\u5DE6\u53F3\u4F59\u767D",
33
+ align:"\u914D\u7F6E",
34
+ align_baseline:"Baseline",
35
+ align_top:"Top",
36
+ align_middle:"Middle",
37
+ align_bottom:"Bottom",
38
+ align_texttop:"Text top",
39
+ align_textbottom:"Text bottom",
40
+ align_left:"Left",
41
+ align_right:"Right",
42
+ image_list:"\u4E00\u89A7\u304B\u3089\u9078\u3076"
43
  });
mce/advimage/langs/langs.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
- if ( is_file($lang_file) && is_readable($lang_file) ) {
5
  $strings .= getFileContents($lang_file);
6
- }
7
  ?>
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
+ if ( is_file($lang_file) && is_readable($lang_file) )
5
  $strings .= getFileContents($lang_file);
6
+ else $strings .= getFileContents(dirname(__FILE__) . '/en_dlg.js');
7
  ?>
mce/advlink/css/advlink.css CHANGED
@@ -1,8 +1,8 @@
1
- .mceLinkList, .mceAnchorList, #targetlist {width:280px;}
2
- .mceActionPanel {margin-top:7px;}
3
- .panel_wrapper div.current {height:320px;}
4
- #classlist, #title, #href {width:280px;}
5
- #popupurl, #popupname {width:200px;}
6
- #popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
7
- #id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
8
- #events_panel input {width:200px;}
1
+ .mceLinkList, .mceAnchorList, #targetlist {width:280px;}
2
+ .mceActionPanel {margin-top:7px;}
3
+ .panel_wrapper div.current {height:320px;}
4
+ #classlist, #title, #href {width:280px;}
5
+ #popupurl, #popupname {width:200px;}
6
+ #popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
7
+ #id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
8
+ #events_panel input {width:200px;}
mce/advlink/js/advlink.js CHANGED
@@ -1,528 +1,527 @@
1
- /* Functions for the advlink plugin popup */
2
-
3
- tinyMCEPopup.requireLangPack();
4
-
5
- var templates = {
6
- "window.open" : "window.open('${url}','${target}','${options}')"
7
- };
8
-
9
- function preinit() {
10
- var url;
11
-
12
- if (url = tinyMCEPopup.getParam("external_link_list_url"))
13
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
14
- }
15
-
16
- function changeClass() {
17
- var f = document.forms[0];
18
-
19
- f.classes.value = getSelectValue(f, 'classlist');
20
- }
21
-
22
- function init() {
23
- tinyMCEPopup.resizeToInnerSize();
24
-
25
- var formObj = document.forms[0];
26
- var inst = tinyMCEPopup.editor;
27
- var elm = inst.selection.getNode();
28
- var action = "insert";
29
- var html;
30
-
31
- document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
32
- document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
33
- document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');
34
- document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');
35
- document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
36
-
37
- // Link list
38
- html = getLinkListHTML('linklisthref','href');
39
- if (html == "")
40
- document.getElementById("linklisthrefrow").style.display = 'none';
41
- else
42
- document.getElementById("linklisthrefcontainer").innerHTML = html;
43
-
44
- // Resize some elements
45
- if (isVisible('hrefbrowser'))
46
- document.getElementById('href').style.width = '260px';
47
-
48
- if (isVisible('popupurlbrowser'))
49
- document.getElementById('popupurl').style.width = '180px';
50
-
51
- elm = inst.dom.getParent(elm, "A");
52
- if (elm != null && elm.nodeName == "A")
53
- action = "update";
54
-
55
- formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
56
-
57
- setPopupControlsDisabled(true);
58
-
59
- if (action == "update") {
60
- var href = inst.dom.getAttrib(elm, 'href');
61
- var onclick = inst.dom.getAttrib(elm, 'onclick');
62
-
63
- // Setup form data
64
- setFormValue('href', href);
65
- setFormValue('title', inst.dom.getAttrib(elm, 'title'));
66
- setFormValue('id', inst.dom.getAttrib(elm, 'id'));
67
- setFormValue('style', inst.dom.getAttrib(elm, "style"));
68
- setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));
69
- setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));
70
- setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));
71
- setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));
72
- setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));
73
- setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));
74
- setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
75
- setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
76
- setFormValue('type', inst.dom.getAttrib(elm, 'type'));
77
- setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));
78
- setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));
79
- setFormValue('onclick', onclick);
80
- setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));
81
- setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));
82
- setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));
83
- setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));
84
- setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));
85
- setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));
86
- setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
87
- setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
88
- setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
89
- setFormValue('target', inst.dom.getAttrib(elm, 'target'));
90
- setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
91
-
92
- // Parse onclick data
93
- if (onclick != null && onclick.indexOf('window.open') != -1)
94
- parseWindowOpen(onclick);
95
- else
96
- parseFunction(onclick);
97
-
98
- // Select by the values
99
- selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));
100
- selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));
101
- selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));
102
- selectByValue(formObj, 'linklisthref', href);
103
-
104
- if (href.charAt(0) == '#')
105
- selectByValue(formObj, 'anchorlist', href);
106
-
107
- addClassesToList('classlist', 'advlink_styles');
108
-
109
- selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
110
- selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);
111
- } else
112
- addClassesToList('classlist', 'advlink_styles');
113
- }
114
-
115
- function checkPrefix(n) {
116
- if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
117
- n.value = 'mailto:' + n.value;
118
-
119
- if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
120
- n.value = 'http://' + n.value;
121
- }
122
-
123
- function setFormValue(name, value) {
124
- document.forms[0].elements[name].value = value;
125
- }
126
-
127
- function parseWindowOpen(onclick) {
128
- var formObj = document.forms[0];
129
-
130
- // Preprocess center code
131
- if (onclick.indexOf('return false;') != -1) {
132
- formObj.popupreturn.checked = true;
133
- onclick = onclick.replace('return false;', '');
134
- } else
135
- formObj.popupreturn.checked = false;
136
-
137
- var onClickData = parseLink(onclick);
138
-
139
- if (onClickData != null) {
140
- formObj.ispopup.checked = true;
141
- setPopupControlsDisabled(false);
142
-
143
- var onClickWindowOptions = parseOptions(onClickData['options']);
144
- var url = onClickData['url'];
145
-
146
- formObj.popupname.value = onClickData['target'];
147
- formObj.popupurl.value = url;
148
- formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
149
- formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
150
-
151
- formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
152
- formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
153
-
154
- if (formObj.popupleft.value.indexOf('screen') != -1)
155
- formObj.popupleft.value = "c";
156
-
157
- if (formObj.popuptop.value.indexOf('screen') != -1)
158
- formObj.popuptop.value = "c";
159
-
160
- formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
161
- formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
162
- formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
163
- formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
164
- formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
165
- formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
166
- formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
167
-
168
- buildOnClick();
169
- }
170
- }
171
-
172
- function parseFunction(onclick) {
173
- var formObj = document.forms[0];
174
- var onClickData = parseLink(onclick);
175
-
176
- // TODO: Add stuff here
177
- }
178
-
179
- function getOption(opts, name) {
180
- return typeof(opts[name]) == "undefined" ? "" : opts[name];
181
- }
182
-
183
- function setPopupControlsDisabled(state) {
184
- var formObj = document.forms[0];
185
-
186
- formObj.popupname.disabled = state;
187
- formObj.popupurl.disabled = state;
188
- formObj.popupwidth.disabled = state;
189
- formObj.popupheight.disabled = state;
190
- formObj.popupleft.disabled = state;
191
- formObj.popuptop.disabled = state;
192
- formObj.popuplocation.disabled = state;
193
- formObj.popupscrollbars.disabled = state;
194
- formObj.popupmenubar.disabled = state;
195
- formObj.popupresizable.disabled = state;
196
- formObj.popuptoolbar.disabled = state;
197
- formObj.popupstatus.disabled = state;
198
- formObj.popupreturn.disabled = state;
199
- formObj.popupdependent.disabled = state;
200
-
201
- setBrowserDisabled('popupurlbrowser', state);
202
- }
203
-
204
- function parseLink(link) {
205
- link = link.replace(new RegExp('&#39;', 'g'), "'");
206
-
207
- var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
208
-
209
- // Is function name a template function
210
- var template = templates[fnName];
211
- if (template) {
212
- // Build regexp
213
- var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
214
- var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
215
- var replaceStr = "";
216
- for (var i=0; i<variableNames.length; i++) {
217
- // Is string value
218
- if (variableNames[i].indexOf("'${") != -1)
219
- regExp += "'(.*)'";
220
- else // Number value
221
- regExp += "([0-9]*)";
222
-
223
- replaceStr += "$" + (i+1);
224
-
225
- // Cleanup variable name
226
- variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
227
-
228
- if (i != variableNames.length-1) {
229
- regExp += "\\s*,\\s*";
230
- replaceStr += "<delim>";
231
- } else
232
- regExp += ".*";
233
- }
234
-
235
- regExp += "\\);?";
236
-
237
- // Build variable array
238
- var variables = [];
239
- variables["_function"] = fnName;
240
- var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
241
- for (var i=0; i<variableNames.length; i++)
242
- variables[variableNames[i]] = variableValues[i];
243
-
244
- return variables;
245
- }
246
-
247
- return null;
248
- }
249
-
250
- function parseOptions(opts) {
251
- if (opts == null || opts == "")
252
- return [];
253
-
254
- // Cleanup the options
255
- opts = opts.toLowerCase();
256
- opts = opts.replace(/;/g, ",");
257
- opts = opts.replace(/[^0-9a-z=,]/g, "");
258
-
259
- var optionChunks = opts.split(',');
260
- var options = [];
261
-
262
- for (var i=0; i<optionChunks.length; i++) {
263
- var parts = optionChunks[i].split('=');
264
-
265
- if (parts.length == 2)
266
- options[parts[0]] = parts[1];
267
- }
268
-
269
- return options;
270
- }
271
-
272
- function buildOnClick() {
273
- var formObj = document.forms[0];
274
-
275
- if (!formObj.ispopup.checked) {
276
- formObj.onclick.value = "";
277
- return;
278
- }
279
-
280
- var onclick = "window.open('";
281
- var url = formObj.popupurl.value;
282
-
283
- onclick += url + "','";
284
- onclick += formObj.popupname.value + "','";
285
-
286
- if (formObj.popuplocation.checked)
287
- onclick += "location=yes,";
288
-
289
- if (formObj.popupscrollbars.checked)
290
- onclick += "scrollbars=yes,";
291
-
292
- if (formObj.popupmenubar.checked)
293
- onclick += "menubar=yes,";
294
-
295
- if (formObj.popupresizable.checked)
296
- onclick += "resizable=yes,";
297
-
298
- if (formObj.popuptoolbar.checked)
299
- onclick += "toolbar=yes,";
300
-
301
- if (formObj.popupstatus.checked)
302
- onclick += "status=yes,";
303
-
304
- if (formObj.popupdependent.checked)
305
- onclick += "dependent=yes,";
306
-
307
- if (formObj.popupwidth.value != "")
308
- onclick += "width=" + formObj.popupwidth.value + ",";
309
-
310
- if (formObj.popupheight.value != "")
311
- onclick += "height=" + formObj.popupheight.value + ",";
312
-
313
- if (formObj.popupleft.value != "") {
314
- if (formObj.popupleft.value != "c")
315
- onclick += "left=" + formObj.popupleft.value + ",";
316
- else
317
- onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
318
- }
319
-
320
- if (formObj.popuptop.value != "") {
321
- if (formObj.popuptop.value != "c")
322
- onclick += "top=" + formObj.popuptop.value + ",";
323
- else
324
- onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
325
- }
326
-
327
- if (onclick.charAt(onclick.length-1) == ',')
328
- onclick = onclick.substring(0, onclick.length-1);
329
-
330
- onclick += "');";
331
-
332
- if (formObj.popupreturn.checked)
333
- onclick += "return false;";
334
-
335
- // tinyMCE.debug(onclick);
336
-
337
- formObj.onclick.value = onclick;
338
-
339
- if (formObj.href.value == "")
340
- formObj.href.value = url;
341
- }
342
-
343
- function setAttrib(elm, attrib, value) {
344
- var formObj = document.forms[0];
345
- var valueElm = formObj.elements[attrib.toLowerCase()];
346
- var dom = tinyMCEPopup.editor.dom;
347
-
348
- if (typeof(value) == "undefined" || value == null) {
349
- value = "";
350
-
351
- if (valueElm)
352
- value = valueElm.value;
353
- }
354
-
355
- // Clean up the style
356
- if (attrib == 'style')
357
- value = dom.serializeStyle(dom.parseStyle(value));
358
-
359
- dom.setAttrib(elm, attrib, value);
360
- }
361
-
362
- function getAnchorListHTML(id, target) {
363
- var inst = tinyMCEPopup.editor;
364
- var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i;
365
- var html = "";
366
-
367
- html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';
368
- html += 'this.options[this.selectedIndex].value;">';
369
- html += '<option value="">---</option>';
370
-
371
- for (i=0; i<nodes.length; i++) {
372
- if ((name = inst.dom.getAttrib(nodes[i], "name")) != "")
373
- html += '<option value="#' + name + '">' + name + '</option>';
374
- }
375
-
376
- html += '</select>';
377
-
378
- return html;
379
- }
380
-
381
- function insertAction() {
382
- var inst = tinyMCEPopup.editor;
383
- var elm, elementArray, i;
384
-
385
- elm = inst.selection.getNode();
386
- checkPrefix(document.forms[0].href);
387
-
388
- elm = inst.dom.getParent(elm, "A");
389
-
390
- // Remove element if there is no href
391
- if (!document.forms[0].href.value) {
392
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
393
- i = inst.selection.getBookmark();
394
- inst.dom.remove(elm, 1);
395
- inst.selection.moveToBookmark(i);
396
- tinyMCEPopup.execCommand("mceEndUndoLevel");
397
- tinyMCEPopup.close();
398
- return;
399
- }
400
-
401
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
402
-
403
- // Create new anchor elements
404
- if (elm == null) {
405
- tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
406
-
407
- elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
408
- for (i=0; i<elementArray.length; i++)
409
- setAllAttribs(elm = elementArray[i]);
410
- } else
411
- setAllAttribs(elm);
412
-
413
- // Don't move caret if selection was image
414
- if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {
415
- inst.focus();
416
- inst.selection.select(elm);
417
- inst.selection.collapse(0);
418
- tinyMCEPopup.storeSelection();
419
- }
420
-
421
- tinyMCEPopup.execCommand("mceEndUndoLevel");
422
- tinyMCEPopup.close();
423
- }
424
-
425
- function setAllAttribs(elm) {
426
- var formObj = document.forms[0];
427
- var href = formObj.href.value;
428
- var target = getSelectValue(formObj, 'targetlist');
429
-
430
- setAttrib(elm, 'href', href);
431
- setAttrib(elm, 'mce_href', href);
432
- setAttrib(elm, 'title');
433
- setAttrib(elm, 'target', target == '_self' ? '' : target);
434
- setAttrib(elm, 'id');
435
- setAttrib(elm, 'style');
436
- setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
437
- setAttrib(elm, 'rel');
438
- setAttrib(elm, 'rev');
439
- setAttrib(elm, 'charset');
440
- setAttrib(elm, 'hreflang');
441
- setAttrib(elm, 'dir');
442
- setAttrib(elm, 'lang');
443
- setAttrib(elm, 'tabindex');
444
- setAttrib(elm, 'accesskey');
445
- setAttrib(elm, 'type');
446
- setAttrib(elm, 'onfocus');
447
- setAttrib(elm, 'onblur');
448
- setAttrib(elm, 'onclick');
449
- setAttrib(elm, 'ondblclick');
450
- setAttrib(elm, 'onmousedown');
451
- setAttrib(elm, 'onmouseup');
452
- setAttrib(elm, 'onmouseover');
453
- setAttrib(elm, 'onmousemove');
454
- setAttrib(elm, 'onmouseout');
455
- setAttrib(elm, 'onkeypress');
456
- setAttrib(elm, 'onkeydown');
457
- setAttrib(elm, 'onkeyup');
458
-
459
- // Refresh in old MSIE
460
- if (tinyMCE.isMSIE5)
461
- elm.outerHTML = elm.outerHTML;
462
- }
463
-
464
- function getSelectValue(form_obj, field_name) {
465
- var elm = form_obj.elements[field_name];
466
-
467
- if (elm == null || elm.options == null)
468
- return "";
469
-
470
- return elm.options[elm.selectedIndex].value;
471
- }
472
-
473
- function getLinkListHTML(elm_id, target_form_element, onchange_func) {
474
- if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
475
- return "";
476
-
477
- var html = "";
478
-
479
- html += '<select id="' + elm_id + '" name="' + elm_id + '"';
480
- html += ' class="mceLinkList" onfoc2us="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
481
- html += 'this.options[this.selectedIndex].value;';
482
-
483
- if (typeof(onchange_func) != "undefined")
484
- html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
485
-
486
- html += '"><option value="">---</option>';
487
-
488
- for (var i=0; i<tinyMCELinkList.length; i++)
489
- html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
490
-
491
- html += '</select>';
492
-
493
- return html;
494
-
495
- // tinyMCE.debug('-- image list start --', html, '-- image list end --');
496
- }
497
-
498
- function getTargetListHTML(elm_id, target_form_element) {
499
- var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
500
- var html = '';
501
-
502
- html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
503
- html += 'this.options[this.selectedIndex].value;">';
504
- html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';
505
- html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';
506
- html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';
507
- html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';
508
-
509
- for (var i=0; i<targets.length; i++) {
510
- var key, value;
511
-
512
- if (targets[i] == "")
513
- continue;
514
-
515
- key = targets[i].split('=')[0];
516
- value = targets[i].split('=')[1];
517
-
518
- html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
519
- }
520
-
521
- html += '</select>';
522
-
523
- return html;
524
- }
525
-
526
- // While loading
527
- preinit();
528
- tinyMCEPopup.onInit.add(init);
1
+ /* Functions for the advlink plugin popup */
2
+
3
+ tinyMCEPopup.requireLangPack();
4
+
5
+ var templates = {
6
+ "window.open" : "window.open('${url}','${target}','${options}')"
7
+ };
8
+
9
+ function preinit() {
10
+ var url;
11
+
12
+ if (url = tinyMCEPopup.getParam("external_link_list_url"))
13
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
14
+ }
15
+
16
+ function changeClass() {
17
+ var f = document.forms[0];
18
+
19
+ f.classes.value = getSelectValue(f, 'classlist');
20
+ }
21
+
22
+ function init() {
23
+ tinyMCEPopup.resizeToInnerSize();
24
+
25
+ var formObj = document.forms[0];
26
+ var inst = tinyMCEPopup.editor;
27
+ var elm = inst.selection.getNode();
28
+ var action = "insert";
29
+ var html;
30
+
31
+ document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
32
+ document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
33
+ document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');
34
+ document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');
35
+ document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
36
+
37
+ // Link list
38
+ html = getLinkListHTML('linklisthref','href');
39
+ if (html == "")
40
+ document.getElementById("linklisthrefrow").style.display = 'none';
41
+ else
42
+ document.getElementById("linklisthrefcontainer").innerHTML = html;
43
+
44
+ // Resize some elements
45
+ if (isVisible('hrefbrowser'))
46
+ document.getElementById('href').style.width = '260px';
47
+
48
+ if (isVisible('popupurlbrowser'))
49
+ document.getElementById('popupurl').style.width = '180px';
50
+
51
+ elm = inst.dom.getParent(elm, "A");
52
+ if (elm != null && elm.nodeName == "A")
53
+ action = "update";
54
+
55
+ formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
56
+
57
+ setPopupControlsDisabled(true);
58
+
59
+ if (action == "update") {
60
+ var href = inst.dom.getAttrib(elm, 'href');
61
+ var onclick = inst.dom.getAttrib(elm, 'onclick');
62
+
63
+ // Setup form data
64
+ setFormValue('href', href);
65
+ setFormValue('title', inst.dom.getAttrib(elm, 'title'));
66
+ setFormValue('id', inst.dom.getAttrib(elm, 'id'));
67
+ setFormValue('style', inst.dom.getAttrib(elm, "style"));
68
+ setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));
69
+ setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));
70
+ setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));
71
+ setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));
72
+ setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));
73
+ setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));
74
+ setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
75
+ setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
76
+ setFormValue('type', inst.dom.getAttrib(elm, 'type'));
77
+ setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));
78
+ setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));
79
+ setFormValue('onclick', onclick);
80
+ setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));
81
+ setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));
82
+ setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));
83
+ setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));
84
+ setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));
85
+ setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));
86
+ setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
87
+ setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
88
+ setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
89
+ setFormValue('target', inst.dom.getAttrib(elm, 'target'));
90
+ setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
91
+
92
+ // Parse onclick data
93
+ if (onclick != null && onclick.indexOf('window.open') != -1)
94
+ parseWindowOpen(onclick);
95
+ else
96
+ parseFunction(onclick);
97
+
98
+ // Select by the values
99
+ selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));
100
+ selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));
101
+ selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));
102
+ selectByValue(formObj, 'linklisthref', href);
103
+
104
+ if (href.charAt(0) == '#')
105
+ selectByValue(formObj, 'anchorlist', href);
106
+
107
+ addClassesToList('classlist', 'advlink_styles');
108
+
109
+ selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
110
+ selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);
111
+ } else
112
+ addClassesToList('classlist', 'advlink_styles');
113
+ }
114
+
115
+ function checkPrefix(n) {
116
+ if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
117
+ n.value = 'mailto:' + n.value;
118
+
119
+ if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
120
+ n.value = 'http://' + n.value;
121
+ }
122
+
123
+ function setFormValue(name, value) {
124
+ document.forms[0].elements[name].value = value;
125
+ }
126
+
127
+ function parseWindowOpen(onclick) {
128
+ var formObj = document.forms[0];
129
+
130
+ // Preprocess center code
131
+ if (onclick.indexOf('return false;') != -1) {
132
+ formObj.popupreturn.checked = true;
133
+ onclick = onclick.replace('return false;', '');
134
+ } else
135
+ formObj.popupreturn.checked = false;
136
+
137
+ var onClickData = parseLink(onclick);
138
+
139
+ if (onClickData != null) {
140
+ formObj.ispopup.checked = true;
141
+ setPopupControlsDisabled(false);
142
+
143
+ var onClickWindowOptions = parseOptions(onClickData['options']);
144
+ var url = onClickData['url'];
145
+
146
+ formObj.popupname.value = onClickData['target'];
147
+ formObj.popupurl.value = url;
148
+ formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
149
+ formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
150
+
151
+ formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
152
+ formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
153
+
154
+ if (formObj.popupleft.value.indexOf('screen') != -1)
155
+ formObj.popupleft.value = "c";
156
+
157
+ if (formObj.popuptop.value.indexOf('screen') != -1)
158
+ formObj.popuptop.value = "c";
159
+
160
+ formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
161
+ formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
162
+ formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
163
+ formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
164
+ formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
165
+ formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
166
+ formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
167
+
168
+ buildOnClick();
169
+ }
170
+ }
171
+
172
+ function parseFunction(onclick) {
173
+ var formObj = document.forms[0];
174
+ var onClickData = parseLink(onclick);
175
+
176
+ // TODO: Add stuff here
177
+ }
178
+
179
+ function getOption(opts, name) {
180
+ return typeof(opts[name]) == "undefined" ? "" : opts[name];
181
+ }
182
+
183
+ function setPopupControlsDisabled(state) {
184
+ var formObj = document.forms[0];
185
+
186
+ formObj.popupname.disabled = state;
187
+ formObj.popupurl.disabled = state;
188
+ formObj.popupwidth.disabled = state;
189
+ formObj.popupheight.disabled = state;
190
+ formObj.popupleft.disabled = state;
191
+ formObj.popuptop.disabled = state;
192
+ formObj.popuplocation.disabled = state;
193
+ formObj.popupscrollbars.disabled = state;
194
+ formObj.popupmenubar.disabled = state;
195
+ formObj.popupresizable.disabled = state;
196
+ formObj.popuptoolbar.disabled = state;
197
+ formObj.popupstatus.disabled = state;
198
+ formObj.popupreturn.disabled = state;
199
+ formObj.popupdependent.disabled = state;
200
+
201
+ setBrowserDisabled('popupurlbrowser', state);
202
+ }
203
+
204
+ function parseLink(link) {
205
+ link = link.replace(new RegExp('&#39;', 'g'), "'");
206
+
207
+ var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
208
+
209
+ // Is function name a template function
210
+ var template = templates[fnName];
211
+ if (template) {
212
+ // Build regexp
213
+ var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
214
+ var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
215
+ var replaceStr = "";
216
+ for (var i=0; i<variableNames.length; i++) {
217
+ // Is string value
218
+ if (variableNames[i].indexOf("'${") != -1)
219
+ regExp += "'(.*)'";
220
+ else // Number value
221
+ regExp += "([0-9]*)";
222
+
223
+ replaceStr += "$" + (i+1);
224
+
225
+ // Cleanup variable name
226
+ variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
227
+
228
+ if (i != variableNames.length-1) {
229
+ regExp += "\\s*,\\s*";
230
+ replaceStr += "<delim>";
231
+ } else
232
+ regExp += ".*";
233
+ }
234
+
235
+ regExp += "\\);?";
236
+
237
+ // Build variable array
238
+ var variables = [];
239
+ variables["_function"] = fnName;
240
+ var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
241
+ for (var i=0; i<variableNames.length; i++)
242
+ variables[variableNames[i]] = variableValues[i];
243
+
244
+ return variables;
245
+ }
246
+
247
+ return null;
248
+ }
249
+
250
+ function parseOptions(opts) {
251
+ if (opts == null || opts == "")
252
+ return [];
253
+
254
+ // Cleanup the options
255
+ opts = opts.toLowerCase();
256
+ opts = opts.replace(/;/g, ",");
257
+ opts = opts.replace(/[^0-9a-z=,]/g, "");
258
+
259
+ var optionChunks = opts.split(',');
260
+ var options = [];
261
+
262
+ for (var i=0; i<optionChunks.length; i++) {
263
+ var parts = optionChunks[i].split('=');
264
+
265
+ if (parts.length == 2)
266
+ options[parts[0]] = parts[1];
267
+ }
268
+
269
+ return options;
270
+ }
271
+
272
+ function buildOnClick() {
273
+ var formObj = document.forms[0];
274
+
275
+ if (!formObj.ispopup.checked) {
276
+ formObj.onclick.value = "";
277
+ return;
278
+ }
279
+
280
+ var onclick = "window.open('";
281
+ var url = formObj.popupurl.value;
282
+
283
+ onclick += url + "','";
284
+ onclick += formObj.popupname.value + "','";
285
+
286
+ if (formObj.popuplocation.checked)
287
+ onclick += "location=yes,";
288
+
289
+ if (formObj.popupscrollbars.checked)
290
+ onclick += "scrollbars=yes,";
291
+
292
+ if (formObj.popupmenubar.checked)
293
+ onclick += "menubar=yes,";
294
+
295
+ if (formObj.popupresizable.checked)
296
+ onclick += "resizable=yes,";
297
+
298
+ if (formObj.popuptoolbar.checked)
299
+ onclick += "toolbar=yes,";
300
+
301
+ if (formObj.popupstatus.checked)
302
+ onclick += "status=yes,";
303
+
304
+ if (formObj.popupdependent.checked)
305
+ onclick += "dependent=yes,";
306
+
307
+ if (formObj.popupwidth.value != "")
308
+ onclick += "width=" + formObj.popupwidth.value + ",";
309
+
310
+ if (formObj.popupheight.value != "")
311
+ onclick += "height=" + formObj.popupheight.value + ",";
312
+
313
+ if (formObj.popupleft.value != "") {
314
+ if (formObj.popupleft.value != "c")
315
+ onclick += "left=" + formObj.popupleft.value + ",";
316
+ else
317
+ onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
318
+ }
319
+
320
+ if (formObj.popuptop.value != "") {
321
+ if (formObj.popuptop.value != "c")
322
+ onclick += "top=" + formObj.popuptop.value + ",";
323
+ else
324
+ onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
325
+ }
326
+
327
+ if (onclick.charAt(onclick.length-1) == ',')
328
+ onclick = onclick.substring(0, onclick.length-1);
329
+
330
+ onclick += "');";
331
+
332
+ if (formObj.popupreturn.checked)
333
+ onclick += "return false;";
334
+
335
+ // tinyMCE.debug(onclick);
336
+
337
+ formObj.onclick.value = onclick;
338
+
339
+ if (formObj.href.value == "")
340
+ formObj.href.value = url;
341
+ }
342
+
343
+ function setAttrib(elm, attrib, value) {
344
+ var formObj = document.forms[0];
345
+ var valueElm = formObj.elements[attrib.toLowerCase()];
346
+ var dom = tinyMCEPopup.editor.dom;
347
+
348
+ if (typeof(value) == "undefined" || value == null) {
349
+ value = "";
350
+
351
+ if (valueElm)
352
+ value = valueElm.value;
353
+ }
354
+
355
+ // Clean up the style
356
+ if (attrib == 'style')
357
+ value = dom.serializeStyle(dom.parseStyle(value));
358
+
359
+ dom.setAttrib(elm, attrib, value);
360
+ }
361
+
362
+ function getAnchorListHTML(id, target) {
363
+ var inst = tinyMCEPopup.editor;
364
+ var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i;
365
+ var html = "";
366
+
367
+ html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';
368
+ html += 'this.options[this.selectedIndex].value;">';
369
+ html += '<option value="">---</option>';
370
+
371
+ for (i=0; i<nodes.length; i++) {
372
+ if ((name = inst.dom.getAttrib(nodes[i], "name")) != "")
373
+ html += '<option value="#' + name + '">' + name + '</option>';
374
+ }
375
+
376
+ html += '</select>';
377
+
378
+ return html;
379
+ }
380
+
381
+ function insertAction() {
382
+ var inst = tinyMCEPopup.editor;
383
+ var elm, elementArray, i;
384
+
385
+ elm = inst.selection.getNode();
386
+ checkPrefix(document.forms[0].href);
387
+
388
+ elm = inst.dom.getParent(elm, "A");
389
+
390
+ // Remove element if there is no href
391
+ if (!document.forms[0].href.value) {
392
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
393
+ i = inst.selection.getBookmark();
394
+ inst.dom.remove(elm, 1);
395
+ inst.selection.moveToBookmark(i);
396
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
397
+ tinyMCEPopup.close();
398
+ return;
399
+ }
400
+
401
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
402
+
403
+ // Create new anchor elements
404
+ if (elm == null) {
405
+ tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
406
+
407
+ elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
408
+ for (i=0; i<elementArray.length; i++)
409
+ setAllAttribs(elm = elementArray[i]);
410
+ } else
411
+ setAllAttribs(elm);
412
+
413
+ // Don't move caret if selection was image
414
+ if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {
415
+ inst.focus();
416
+ inst.selection.select(elm);
417
+ inst.selection.collapse(0);
418
+ tinyMCEPopup.storeSelection();
419
+ }
420
+
421
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
422
+ tinyMCEPopup.close();
423
+ }
424
+
425
+ function setAllAttribs(elm) {
426
+ var formObj = document.forms[0];
427
+ var href = formObj.href.value;
428
+ var target = getSelectValue(formObj, 'targetlist');
429
+
430
+ setAttrib(elm, 'href', href);
431
+ setAttrib(elm, 'title');
432
+ setAttrib(elm, 'target', target == '_self' ? '' : target);
433
+ setAttrib(elm, 'id');
434
+ setAttrib(elm, 'style');
435
+ setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
436
+ setAttrib(elm, 'rel');
437
+ setAttrib(elm, 'rev');
438
+ setAttrib(elm, 'charset');
439
+ setAttrib(elm, 'hreflang');
440
+ setAttrib(elm, 'dir');
441
+ setAttrib(elm, 'lang');
442
+ setAttrib(elm, 'tabindex');
443
+ setAttrib(elm, 'accesskey');
444
+ setAttrib(elm, 'type');
445
+ setAttrib(elm, 'onfocus');
446
+ setAttrib(elm, 'onblur');
447
+ setAttrib(elm, 'onclick');
448
+ setAttrib(elm, 'ondblclick');
449
+ setAttrib(elm, 'onmousedown');
450
+ setAttrib(elm, 'onmouseup');
451
+ setAttrib(elm, 'onmouseover');
452
+ setAttrib(elm, 'onmousemove');
453
+ setAttrib(elm, 'onmouseout');
454
+ setAttrib(elm, 'onkeypress');
455
+ setAttrib(elm, 'onkeydown');
456
+ setAttrib(elm, 'onkeyup');
457
+
458
+ // Refresh in old MSIE
459
+ if (tinyMCE.isMSIE5)
460
+ elm.outerHTML = elm.outerHTML;
461
+ }
462
+
463
+ function getSelectValue(form_obj, field_name) {
464
+ var elm = form_obj.elements[field_name];
465
+
466
+ if (!elm || elm.options == null || elm.selectedIndex == -1)
467
+ return "";
468
+
469
+ return elm.options[elm.selectedIndex].value;
470
+ }
471
+
472
+ function getLinkListHTML(elm_id, target_form_element, onchange_func) {
473
+ if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
474
+ return "";
475
+
476
+ var html = "";
477
+
478
+ html += '<select id="' + elm_id + '" name="' + elm_id + '"';
479
+ html += ' class="mceLinkList" onfoc2us="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
480
+ html += 'this.options[this.selectedIndex].value;';
481
+
482
+ if (typeof(onchange_func) != "undefined")
483
+ html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
484
+
485
+ html += '"><option value="">---</option>';
486
+
487
+ for (var i=0; i<tinyMCELinkList.length; i++)
488
+ html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
489
+
490
+ html += '</select>';
491
+
492
+ return html;
493
+
494
+ // tinyMCE.debug('-- image list start --', html, '-- image list end --');
495
+ }
496
+
497
+ function getTargetListHTML(elm_id, target_form_element) {
498
+ var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
499
+ var html = '';
500
+
501
+ html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
502
+ html += 'this.options[this.selectedIndex].value;">';
503
+ html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';
504
+ html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';
505
+ html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';
506
+ html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';
507
+
508
+ for (var i=0; i<targets.length; i++) {
509
+ var key, value;
510
+
511
+ if (targets[i] == "")
512
+ continue;
513
+
514
+ key = targets[i].split('=')[0];
515
+ value = targets[i].split('=')[1];
516
+
517
+ html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
518
+ }
519
+
520
+ html += '</select>';
521
+
522
+ return html;
523
+ }
524
+
525
+ // While loading
526
+ preinit();
527
+ tinyMCEPopup.onInit.add(init);
 
mce/advlink/langs/en_dlg.js CHANGED
@@ -1,52 +1,52 @@
1
- tinyMCE.addI18n('en.advlink_dlg',{
2
- title:"Insert/edit link",
3
- url:"Link URL",
4
- target:"Target",
5
- titlefield:"Title",
6
- is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
7
- is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
8
- list:"Link list",
9
- general_tab:"General",
10
- popup_tab:"Popup",
11
- events_tab:"Events",
12
- advanced_tab:"Advanced",
13
- general_props:"General properties",
14
- popup_props:"Popup properties",
15
- event_props:"Events",
16
- advanced_props:"Advanced properties",
17
- popup_opts:"Options",
18
- anchor_names:"Anchors",
19
- target_same:"Open in this window / frame",
20
- target_parent:"Open in parent window / frame",
21
- target_top:"Open in top frame (replaces all frames)",
22
- target_blank:"Open in new window",
23
- popup:"Javascript popup",
24
- popup_url:"Popup URL",
25
- popup_name:"Window name",
26
- popup_return:"Insert 'return false'",
27
- popup_scrollbars:"Show scrollbars",
28
- popup_statusbar:"Show status bar",
29
- popup_toolbar:"Show toolbars",
30
- popup_menubar:"Show menu bar",
31
- popup_location:"Show location bar",
32
- popup_resizable:"Make window resizable",
33
- popup_dependent:"Dependent (Mozilla/Firefox only)",
34
- popup_size:"Size",
35
- popup_position:"Position (X/Y)",
36
- id:"Id",
37
- style:"Style",
38
- classes:"Classes",
39
- target_name:"Target name",
40
- langdir:"Language direction",
41
- target_langcode:"Target language",
42
- langcode:"Language code",
43
- encoding:"Target character encoding",
44
- mime:"Target MIME type",
45
- rel:"Relationship page to target",
46
- rev:"Relationship target to page",
47
- tabindex:"Tabindex",
48
- accesskey:"Accesskey",
49
- ltr:"Left to right",
50
- rtl:"Right to left",
51
- link_list:"Link list"
52
  });
1
+ tinyMCE.addI18n('en.advlink_dlg',{
2
+ title:"Insert/edit link",
3
+ url:"Link URL",
4
+ target:"Target",
5
+ titlefield:"Title",
6
+ is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
7
+ is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
8
+ list:"Link list",
9
+ general_tab:"General",
10
+ popup_tab:"Popup",
11
+ events_tab:"Events",
12
+ advanced_tab:"Advanced",
13
+ general_props:"General properties",
14
+ popup_props:"Popup properties",
15
+ event_props:"Events",
16
+ advanced_props:"Advanced properties",
17
+ popup_opts:"Options",
18
+ anchor_names:"Anchors",
19
+ target_same:"Open in this window / frame",
20
+ target_parent:"Open in parent window / frame",
21
+ target_top:"Open in top frame (replaces all frames)",
22
+ target_blank:"Open in new window",
23
+ popup:"Javascript popup",
24
+ popup_url:"Popup URL",
25
+ popup_name:"Window name",
26
+ popup_return:"Insert 'return false'",
27
+ popup_scrollbars:"Show scrollbars",
28
+ popup_statusbar:"Show status bar",
29
+ popup_toolbar:"Show toolbars",
30
+ popup_menubar:"Show menu bar",
31
+ popup_location:"Show location bar",
32
+ popup_resizable:"Make window resizable",
33
+ popup_dependent:"Dependent (Mozilla/Firefox only)",
34
+ popup_size:"Size",
35
+ popup_position:"Position (X/Y)",
36
+ id:"Id",
37
+ style:"Style",
38
+ classes:"Classes",
39
+ target_name:"Target name",
40
+ langdir:"Language direction",
41
+ target_langcode:"Target language",
42
+ langcode:"Language code",
43
+ encoding:"Target character encoding",
44
+ mime:"Target MIME type",
45
+ rel:"Relationship page to target",
46
+ rev:"Relationship target to page",
47
+ tabindex:"Tabindex",
48
+ accesskey:"Accesskey",
49
+ ltr:"Left to right",
50
+ rtl:"Right to left",
51
+ link_list:"Link list"
52
  });
mce/advlink/langs/ja_dlg.js CHANGED
@@ -1,52 +1,52 @@
1
  tinyMCE.addI18n('ja.advlink_dlg',{
2
- title:"\u63D2\u5165/\u7F16\u8F91 \u8FDE\u7ED3",
3
- url:"\u8FDE\u7ED3\u5730\u5740",
4
- target:"\u76EE\u6807",
5
- titlefield:"\u67E5\u627E",
6
- is_email:"\u60A8\u8F93\u5165\u7684\u5E94\u8BE5\u662F\u4E00\u4E2A\u7535\u5B50\u90AE\u5BC4\u5730\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u524D\u52A0\u4E0A mailto: ? ",
7
- is_external:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u5916\u90E8\u8FDE\u7ED3\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u524D\u52A0\u4E0A http:// ?",
8
- list:"\u8FDE\u7ED3\u6E05\u5355",
9
- general_tab:"\u57FA\u672C",
10
- popup_tab:"\u5FEB\u663E\u7A97\u53E3",
11
- events_tab:"\u4E8B\u4EF6",
12
- advanced_tab:"\u9AD8\u7EA7",
13
- general_props:"\u57FA\u672C\u5C5E\u6027",
14
- popup_props:"\u5FEB\u663E\u7A97\u53E3\u5C5E\u6027",
15
- event_props:"\u4E8B\u4EF6",
16
- advanced_props:"\u9AD8\u7EA7\u5C5E\u6027",
17
- popup_opts:"\u9009\u9879",
18
- anchor_names:"\u951A\u70B9",
19
- target_same:"\u5728\u5F53\u524D\u7A97\u53E3\u6253\u5F00",
20
- target_parent:"\u5728\u7236\u7A97\u53E3\u6253\u5F00",
21
- target_top:"\u5728\u9876\u5C42\u7A97\u53E3\u6253\u5F00",
22
- target_blank:"\u5728\u65B0\u7A97\u53E3\u6253\u5F00",
23
- popup:"Javascript \u5FEB\u663E\u7A97\u53E3",
24
- popup_url:"\u5F39\u51FA\u7A97\u53E3\u5730\u5740",
25
- popup_name:"\u7A97\u53E3\u540D\u79F0",
26
- popup_return:"\u63D2\u5165 'return false'",
27
- popup_scrollbars:"\u663E\u793A\u6EDA\u52A8\u6761",
28
- popup_statusbar:"\u663E\u793A\u72B6\u6001\u5217",
29
- popup_toolbar:"\u663E\u793A\u5DE5\u5177\u5217",
30
- popup_menubar:"\u663E\u793A\u83DC\u5355\u5217",
31
- popup_location:"\u663E\u793A\u5730\u5740\u680F",
32
- popup_resizable:"\u53EF\u8C03\u6574\u7A97\u53E3\u5927\u5C0F",
33
- popup_dependent:"\u4ECE\u5C5E\u4E8E ( \u4EC5 Mozilla/Firefox \u6709\u6548 )",
34
- popup_size:"\u5927\u5C0F",
35
- popup_position:"\u5750\u6807 (X/Y)",
36
- id:"Id",
37
- style:"\u6837\u5F0F",
38
- classes:"\u6837\u5F0F\u7C7B",
39
- target_name:"\u76EE\u6807\u540D\u79F0",
40
- langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411",
41
- target_langcode:"\u76EE\u6807\u8BED\u8A00",
42
- langcode:"\u8BED\u8A00\u7F16\u7801",
43
- encoding:"\u76EE\u6807\u8BED\u8A00\u7F16\u7801",
44
- mime:"\u76EE\u6807 MIME \u7C7B\u578B",
45
- rel:"rel",
46
- rev:"rev",
47
- tabindex:"Tab\u7D22\u5F15",
48
- accesskey:"\u5FEB\u901F\u952E",
49
- ltr:"\u4ECE\u5DE6\u5230\u53F3",
50
- rtl:"\u4ECE\u53F3\u5230\u5DE6",
51
- link_list:"\u8FDE\u7ED3\u6E05\u5355"
52
  });
1
  tinyMCE.addI18n('ja.advlink_dlg',{
2
+ title:"\u30EA\u30F3\u30AF\u306E\u633F\u5165/\u7DE8\u96C6",
3
+ url:"\u30EA\u30F3\u30AFURL",
4
+ target:"\u30BF\u30FC\u30B2\u30C3\u30C8",
5
+ titlefield:"\u30BF\u30A4\u30C8\u30EB",
6
+ is_email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F\u3002\u30EA\u30F3\u30AF\u306Bmailto:\u3092\u4ED8\u52A0\u3057\u307E\u3059\u304B\uFF1F",
7
+ is_external:"\u30EA\u30F3\u30AF\u306Bhttp://\u3092\u4ED8\u52A0\u3057\u307E\u3059\u304B\uFF1F",
8
+ list:"\u4E00\u89A7\u304B\u3089\u9078\u3076",
9
+ general_tab:"\u4E00\u822C",
10
+ popup_tab:"\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7",
11
+ events_tab:"\u30A4\u30D9\u30F3\u30C8",
12
+ advanced_tab:"\u4E0A\u7D1A\u8005\u5411\u3051",
13
+ general_props:"\u4E00\u822C",
14
+ popup_props:"\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7",
15
+ event_props:"\u30A4\u30D9\u30F3\u30C8",
16
+ advanced_props:"\u4E0A\u7D1A\u8005\u5411\u3051",
17
+ popup_opts:"\u30AA\u30D7\u30B7\u30E7\u30F3",
18
+ anchor_names:"\u30A2\u30F3\u30AB\u30FC",
19
+ target_same:"\u3053\u306E\u30A6\u30A4\u30F3\u30C9\u30A6/\u30D5\u30EC\u30FC\u30E0\u3067\u958B\u304F",
20
+ target_parent:"\u89AA\u30A6\u30A4\u30F3\u30C9\u30A6/\u89AA\u30D5\u30EC\u30FC\u30E0\u3067\u958B\u304F",
21
+ target_top:"\u30C8\u30C3\u30D7\u306E\u30D5\u30EC\u30FC\u30E0\u3067\u958B\u304F",
22
+ target_blank:"\u65B0\u3057\u3044\u30A6\u30A4\u30F3\u30C9\u30A6\u3067\u958B\u304F",
23
+ popup:"Javascript\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7",
24
+ popup_url:"\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7URL",
25
+ popup_name:"\u30A6\u30A4\u30F3\u30C9\u30A6\u540D",
26
+ popup_return:"'return false'\u3092\u633F\u5165\u3059\u308B",
27
+ popup_scrollbars:"\u30B9\u30AF\u30ED\u30FC\u30EB\u30D0\u30FC\u3092\u8868\u793A",
28
+ popup_statusbar:"\u30B9\u30C6\u30FC\u30BF\u30B9\u30D0\u30FC\u3092\u8868\u793A",
29
+ popup_toolbar:"\u30C4\u30FC\u30EB\u30D0\u30FC\u3092\u8868\u793A",
30
+ popup_menubar:"\u30E1\u30CB\u30E5\u30FC\u30D0\u30FC\u3092\u8868\u793A",
31
+ popup_location:"\u30A2\u30C9\u30EC\u30B9\u30D0\u30FC\u3092\u8868\u793A",
32
+ popup_resizable:"\u30A6\u30A4\u30F3\u30C9\u30A6\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u3092\u8A31\u53EF\u3059\u308B",
33
+ popup_dependent:"Dependent (Mozilla/Firefox\u306E\u307F)",
34
+ popup_size:"\u30B5\u30A4\u30BA",
35
+ popup_position:"\u4F4D\u7F6E (X/Y)",
36
+ id:"ID",
37
+ style:"\u30B9\u30BF\u30A4\u30EB",
38
+ classes:"\u30AF\u30E9\u30B9",
39
+ target_name:"\u30BF\u30FC\u30B2\u30C3\u30C8\u540D",
40
+ langdir:"\u6587\u7AE0\u306E\u65B9\u5411",
41
+ target_langcode:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306E\u8A00\u8A9E",
42
+ langcode:"\u8A00\u8A9E\u30B3\u30FC\u30C9",
43
+ encoding:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0",
44
+ mime:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306EMIME\u30BF\u30A4\u30D7",
45
+ rel:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u306B\u5BFE\u3059\u308B\u95A2\u4FC2",
46
+ rev:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306E\u3053\u306E\u30DA\u30FC\u30B8\u306B\u5BFE\u3059\u308B\u95A2\u4FC2",
47
+ tabindex:"\u30BF\u30D6\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9",
48
+ accesskey:"\u30A2\u30AF\u30BB\u30B9\u30AD\u30FC",
49
+ ltr:"\u5DE6\u304B\u3089\u53F3",
50
+ rtl:"\u53F3\u304B\u3089\u5DE6",
51
+ link_list:"\u4E00\u89A7\u304B\u3089\u9078\u3076"
52
  });
mce/advlink/langs/langs.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
- if ( is_file($lang_file) && is_readable($lang_file) ) {
5
  $strings .= getFileContents($lang_file);
6
- }
7
  ?>
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
+ if ( is_file($lang_file) && is_readable($lang_file) )
5
  $strings .= getFileContents($lang_file);
6
+ else $strings .= getFileContents(dirname(__FILE__) . '/en_dlg.js');
7
  ?>
mce/advlink/link.htm CHANGED
@@ -1,339 +1,339 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#advlink_dlg.title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
14
- <form onsubmit="insertAction();return false;" action="#">
15
- <div class="tabs">
16
- <ul>
17
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li>
18
- <li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li>
19
- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li>
20
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li>
21
- </ul>
22
- </div>
23
-
24
- <div class="panel_wrapper">
25
- <div id="general_panel" class="panel current">
26
- <fieldset>
27
- <legend>{#advlink_dlg.general_props}</legend>
28
-
29
- <table border="0" cellpadding="4" cellspacing="0">
30
- <tr>
31
- <td nowrap="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>
32
- <td><table border="0" cellspacing="0" cellpadding="0">
33
- <tr>
34
- <td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>
35
- <td id="hrefbrowsercontainer">&nbsp;</td>
36
- </tr>
37
- </table></td>
38
- </tr>
39
- <tr id="linklisthrefrow">
40
- <td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>
41
- <td colspan="2" id="linklisthrefcontainer">&nbsp;</td>
42
- </tr>
43
- <tr>
44
- <td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>
45
- <td colspan="2" id="anchorlistcontainer">&nbsp;</td>
46
- </tr>
47
- <tr>
48
- <td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>
49
- <td id="targetlistcontainer">&nbsp;</td>
50
- </tr>
51
- <tr>
52
- <td nowrap="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>
53
- <td><input id="title" name="title" type="text" value="" /></td>
54
- </tr>
55
- <tr>
56
- <td><label id="classlabel" for="classlist">{#class_name}</label></td>
57
- <td>
58
- <select id="classlist" name="classlist" onchange="changeClass();">
59
- <option value="" selected>{#not_set}</option>
60
- </select>
61
- </td>
62
- </tr>
63
- </table>
64
- </fieldset>
65
- </div>
66
-
67
- <div id="popup_panel" class="panel">
68
- <fieldset>
69
- <legend>{#advlink_dlg.popup_props}</legend>
70
-
71
- <input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />
72
- <label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label>
73
-
74
- <table border="0" cellpadding="0" cellspacing="4">
75
- <tr>
76
- <td nowrap="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label>&nbsp;</td>
77
- <td>
78
- <table border="0" cellspacing="0" cellpadding="0">
79
- <tr>
80
- <td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>
81
- <td id="popupurlbrowsercontainer">&nbsp;</td>
82
- </tr>
83
- </table>
84
- </td>
85
- </tr>
86
- <tr>
87
- <td nowrap="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label>&nbsp;</td>
88
- <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
89
- </tr>
90
- <tr>
91
- <td nowrap="nowrap"><label>{#advlink_dlg.popup_size}</label>&nbsp;</td>
92
- <td nowrap="nowrap">
93
- <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x
94
- <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px
95
- </td>
96
- </tr>
97
- <tr>
98
- <td nowrap="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label>&nbsp;</td>
99
- <td nowrap="nowrap">
100
- <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /
101
- <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)
102
- </td>
103
- </tr>
104
- </table>
105
-
106
- <fieldset>
107
- <legend>{#advlink_dlg.popup_opts}</legend>
108
-
109
- <table border="0" cellpadding="0" cellspacing="4">
110
- <tr>
111
- <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
112
- <td nowrap="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
113
- <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
114
- <td nowrap="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
115
- </tr>
116
- <tr>
117
- <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
118
- <td nowrap="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
119
- <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
120
- <td nowrap="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
121
- </tr>
122
- <tr>
123
- <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
124
- <td nowrap="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
125
- <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
126
- <td nowrap="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
127
- </tr>
128
- <tr>
129
- <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
130
- <td nowrap="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
131
- <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
132
- <td nowrap="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
133
- </tr>
134
- </table>
135
- </fieldset>
136
- </fieldset>
137
- </div>
138
-
139
- <div id="advanced_panel" class="panel">
140
- <fieldset>
141
- <legend>{#advlink_dlg.advanced_props}</legend>
142
-
143
- <table border="0" cellpadding="0" cellspacing="4">
144
- <tr>
145
- <td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td>
146
- <td><input id="id" name="id" type="text" value="" /></td>
147
- </tr>
148
-
149
- <tr>
150
- <td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>
151
- <td><input type="text" id="style" name="style" value="" /></td>
152
- </tr>
153
-
154
- <tr>
155
- <td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>
156
- <td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
157
- </tr>
158
-
159
- <tr>
160
- <td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>
161
- <td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
162
- </tr>
163
-
164
- <tr>
165
- <td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td>
166
- <td>
167
- <select id="dir" name="dir">
168
- <option value="">{#not_set}</option>
169
- <option value="ltr">{#advlink_dlg.ltr}</option>
170
- <option value="rtl">{#advlink_dlg.rtl}</option>
171
- </select>
172
- </td>
173
- </tr>
174
-
175
- <tr>
176
- <td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>
177
- <td><input type="text" id="hreflang" name="hreflang" value="" /></td>
178
- </tr>
179
-
180
- <tr>
181
- <td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td>
182
- <td>
183
- <input id="lang" name="lang" type="text" value="" />
184
- </td>
185
- </tr>
186
-
187
- <tr>
188
- <td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>
189
- <td><input type="text" id="charset" name="charset" value="" /></td>
190
- </tr>
191
-
192
- <tr>
193
- <td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>
194
- <td><input type="text" id="type" name="type" value="" /></td>
195
- </tr>
196
-
197
- <tr>
198
- <td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>
199
- <td><select id="rel" name="rel">
200
- <option value="">{#not_set}</option>
201
- <option value="lightbox">Lightbox</option>
202
- <option value="alternate">Alternate</option>
203
- <option value="designates">Designates</option>
204
- <option value="stylesheet">Stylesheet</option>
205
- <option value="start">Start</option>
206
- <option value="next">Next</option>
207
- <option value="prev">Prev</option>
208
- <option value="contents">Contents</option>
209
- <option value="index">Index</option>
210
- <option value="glossary">Glossary</option>
211
- <option value="copyright">Copyright</option>
212
- <option value="chapter">Chapter</option>
213
- <option value="subsection">Subsection</option>
214
- <option value="appendix">Appendix</option>
215
- <option value="help">Help</option>
216
- <option value="bookmark">Bookmark</option>
217
- <option value="nofollow">No Follow</option>
218
- <option value="tag">Tag</option>
219
- </select>
220
- </td>
221
- </tr>
222
-
223
- <tr>
224
- <td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>
225
- <td><select id="rev" name="rev">
226
- <option value="">{#not_set}</option>
227
- <option value="alternate">Alternate</option>
228
- <option value="designates">Designates</option>
229
- <option value="stylesheet">Stylesheet</option>
230
- <option value="start">Start</option>
231
- <option value="next">Next</option>
232
- <option value="prev">Prev</option>
233
- <option value="contents">Contents</option>
234
- <option value="index">Index</option>
235
- <option value="glossary">Glossary</option>
236
- <option value="copyright">Copyright</option>
237
- <option value="chapter">Chapter</option>
238
- <option value="subsection">Subsection</option>
239
- <option value="appendix">Appendix</option>
240
- <option value="help">Help</option>
241
- <option value="bookmark">Bookmark</option>
242
- </select>
243
- </td>
244
- </tr>
245
-
246
- <tr>
247
- <td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>
248
- <td><input type="text" id="tabindex" name="tabindex" value="" /></td>
249
- </tr>
250
-
251
- <tr>
252
- <td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>
253
- <td><input type="text" id="accesskey" name="accesskey" value="" /></td>
254
- </tr>
255
- </table>
256
- </fieldset>
257
- </div>
258
-
259
- <div id="events_panel" class="panel">
260
- <fieldset>
261
- <legend>{#advlink_dlg.event_props}</legend>
262
-
263
- <table border="0" cellpadding="0" cellspacing="4">
264
- <tr>
265
- <td class="column1"><label for="onfocus">onfocus</label></td>
266
- <td><input id="onfocus" name="onfocus" type="text" value="" /></td>
267
- </tr>
268
-
269
- <tr>
270
- <td class="column1"><label for="onblur">onblur</label></td>
271
- <td><input id="onblur" name="onblur" type="text" value="" /></td>
272
- </tr>
273
-
274
- <tr>
275
- <td class="column1"><label for="onclick">onclick</label></td>
276
- <td><input id="onclick" name="onclick" type="text" value="" /></td>
277
- </tr>
278
-
279
- <tr>
280
- <td class="column1"><label for="ondblclick">ondblclick</label></td>
281
- <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
282
- </tr>
283
-
284
- <tr>
285
- <td class="column1"><label for="onmousedown">onmousedown</label></td>
286
- <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
287
- </tr>
288
-
289
- <tr>
290
- <td class="column1"><label for="onmouseup">onmouseup</label></td>
291
- <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
292
- </tr>
293
-
294
- <tr>
295
- <td class="column1"><label for="onmouseover">onmouseover</label></td>
296
- <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
297
- </tr>
298
-
299
- <tr>
300
- <td class="column1"><label for="onmousemove">onmousemove</label></td>
301
- <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
302
- </tr>
303
-
304
- <tr>
305
- <td class="column1"><label for="onmouseout">onmouseout</label></td>
306
- <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
307
- </tr>
308
-
309
- <tr>
310
- <td class="column1"><label for="onkeypress">onkeypress</label></td>
311
- <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
312
- </tr>
313
-
314
- <tr>
315
- <td class="column1"><label for="onkeydown">onkeydown</label></td>
316
- <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
317
- </tr>
318
-
319
- <tr>
320
- <td class="column1"><label for="onkeyup">onkeyup</label></td>
321
- <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
322
- </tr>
323
- </table>
324
- </fieldset>
325
- </div>
326
- </div>
327
-
328
- <div class="mceActionPanel">
329
- <div style="float: left">
330
- <input type="submit" id="insert" name="insert" value="{#insert}" />
331
- </div>
332
-
333
- <div style="float: right">
334
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
335
- </div>
336
- </div>
337
- </form>
338
- </body>
339
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#advlink_dlg.title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js?ver=311"></script>
9
+ <script type="text/javascript" src="js/advlink.js?ver=311"></script>
10
+ <link href="css/advlink.css?ver=311" rel="stylesheet" type="text/css" />
11
+ <base target="_self" />
12
+ </head>
13
+ <body id="advlink" style="display: none">
14
+ <form onsubmit="insertAction();return false;" action="#">
15
+ <div class="tabs">
16
+ <ul>
17
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li>
18
+ <li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li>
19
+ <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li>
20
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li>
21
+ </ul>
22
+ </div>
23
+
24
+ <div class="panel_wrapper">
25
+ <div id="general_panel" class="panel current">
26
+ <fieldset>
27
+ <legend>{#advlink_dlg.general_props}</legend>
28
+
29
+ <table border="0" cellpadding="4" cellspacing="0">
30
+ <tr>
31
+ <td nowrap="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>
32
+ <td><table border="0" cellspacing="0" cellpadding="0">
33
+ <tr>
34
+ <td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>
35
+ <td id="hrefbrowsercontainer">&nbsp;</td>
36
+ </tr>
37
+ </table></td>
38
+ </tr>
39
+ <tr id="linklisthrefrow">
40
+ <td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>
41
+ <td colspan="2" id="linklisthrefcontainer">&nbsp;</td>
42
+ </tr>
43
+ <tr>
44
+ <td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>
45
+ <td colspan="2" id="anchorlistcontainer">&nbsp;</td>
46
+ </tr>
47
+ <tr>
48
+ <td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>
49
+ <td id="targetlistcontainer">&nbsp;</td>
50
+ </tr>
51
+ <tr>
52
+ <td nowrap="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>
53
+ <td><input id="title" name="title" type="text" value="" /></td>
54
+ </tr>
55
+ <tr>
56
+ <td><label id="classlabel" for="classlist">{#class_name}</label></td>
57
+ <td>
58
+ <select id="classlist" name="classlist" onchange="changeClass();">
59
+ <option value="" selected>{#not_set}</option>
60
+ </select>
61
+ </td>
62
+ </tr>
63
+ </table>
64
+ </fieldset>
65
+ </div>
66
+
67
+ <div id="popup_panel" class="panel">
68
+ <fieldset>
69
+ <legend>{#advlink_dlg.popup_props}</legend>
70
+
71
+ <input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />
72
+ <label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label>
73
+
74
+ <table border="0" cellpadding="0" cellspacing="4">
75
+ <tr>
76
+ <td nowrap="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label>&nbsp;</td>
77
+ <td>
78
+ <table border="0" cellspacing="0" cellpadding="0">
79
+ <tr>
80
+ <td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>
81
+ <td id="popupurlbrowsercontainer">&nbsp;</td>
82
+ </tr>
83
+ </table>
84
+ </td>
85
+ </tr>
86
+ <tr>
87
+ <td nowrap="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label>&nbsp;</td>
88
+ <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
89
+ </tr>
90
+ <tr>
91
+ <td nowrap="nowrap"><label>{#advlink_dlg.popup_size}</label>&nbsp;</td>
92
+ <td nowrap="nowrap">
93
+ <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x
94
+ <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px
95
+ </td>
96
+ </tr>
97
+ <tr>
98
+ <td nowrap="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label>&nbsp;</td>
99
+ <td nowrap="nowrap">
100
+ <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /
101
+ <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)
102
+ </td>
103
+ </tr>
104
+ </table>
105
+
106
+ <fieldset>
107
+ <legend>{#advlink_dlg.popup_opts}</legend>
108
+
109
+ <table border="0" cellpadding="0" cellspacing="4">
110
+ <tr>
111
+ <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
112
+ <td nowrap="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
113
+ <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
114
+ <td nowrap="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
115
+ </tr>
116
+ <tr>
117
+ <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
118
+ <td nowrap="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
119
+ <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
120
+ <td nowrap="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
121
+ </tr>
122
+ <tr>
123
+ <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
124
+ <td nowrap="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
125
+ <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
126
+ <td nowrap="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
127
+ </tr>
128
+ <tr>
129
+ <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
130
+ <td nowrap="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
131
+ <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
132
+ <td nowrap="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
133
+ </tr>
134
+ </table>
135
+ </fieldset>
136
+ </fieldset>
137
+ </div>
138
+
139
+ <div id="advanced_panel" class="panel">
140
+ <fieldset>
141
+ <legend>{#advlink_dlg.advanced_props}</legend>
142
+
143
+ <table border="0" cellpadding="0" cellspacing="4">
144
+ <tr>
145
+ <td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td>
146
+ <td><input id="id" name="id" type="text" value="" /></td>
147
+ </tr>
148
+
149
+ <tr>
150
+ <td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>
151
+ <td><input type="text" id="style" name="style" value="" /></td>
152
+ </tr>
153
+
154
+ <tr>
155
+ <td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>
156
+ <td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
157
+ </tr>
158
+
159
+ <tr>
160
+ <td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>
161
+ <td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
162
+ </tr>
163
+
164
+ <tr>
165
+ <td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td>
166
+ <td>
167
+ <select id="dir" name="dir">
168
+ <option value="">{#not_set}</option>
169
+ <option value="ltr">{#advlink_dlg.ltr}</option>
170
+ <option value="rtl">{#advlink_dlg.rtl}</option>
171
+ </select>
172
+ </td>
173
+ </tr>
174
+
175
+ <tr>
176
+ <td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>
177
+ <td><input type="text" id="hreflang" name="hreflang" value="" /></td>
178
+ </tr>
179
+
180
+ <tr>
181
+ <td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td>
182
+ <td>
183
+ <input id="lang" name="lang" type="text" value="" />
184
+ </td>
185
+ </tr>
186
+
187
+ <tr>
188
+ <td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>
189
+ <td><input type="text" id="charset" name="charset" value="" /></td>
190
+ </tr>
191
+
192
+ <tr>
193
+ <td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>
194
+ <td><input type="text" id="type" name="type" value="" /></td>
195
+ </tr>
196
+
197
+ <tr>
198
+ <td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>
199
+ <td><select id="rel" name="rel">
200
+ <option value="">{#not_set}</option>
201
+ <option value="lightbox">Lightbox</option>
202
+ <option value="alternate">Alternate</option>
203
+ <option value="designates">Designates</option>
204
+ <option value="stylesheet">Stylesheet</option>
205
+ <option value="start">Start</option>
206
+ <option value="next">Next</option>
207
+ <option value="prev">Prev</option>
208
+ <option value="contents">Contents</option>
209
+ <option value="index">Index</option>
210
+ <option value="glossary">Glossary</option>
211
+ <option value="copyright">Copyright</option>
212
+ <option value="chapter">Chapter</option>
213
+ <option value="subsection">Subsection</option>
214
+ <option value="appendix">Appendix</option>
215
+ <option value="help">Help</option>
216
+ <option value="bookmark">Bookmark</option>
217
+ <option value="nofollow">No Follow</option>
218
+ <option value="tag">Tag</option>
219
+ </select>
220
+ </td>
221
+ </tr>
222
+
223
+ <tr>
224
+ <td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>
225
+ <td><select id="rev" name="rev">
226
+ <option value="">{#not_set}</option>
227
+ <option value="alternate">Alternate</option>
228
+ <option value="designates">Designates</option>
229
+ <option value="stylesheet">Stylesheet</option>
230
+ <option value="start">Start</option>
231
+ <option value="next">Next</option>
232
+ <option value="prev">Prev</option>
233
+ <option value="contents">Contents</option>
234
+ <option value="index">Index</option>
235
+ <option value="glossary">Glossary</option>
236
+ <option value="copyright">Copyright</option>
237
+ <option value="chapter">Chapter</option>
238
+ <option value="subsection">Subsection</option>
239
+ <option value="appendix">Appendix</option>
240
+ <option value="help">Help</option>
241
+ <option value="bookmark">Bookmark</option>
242
+ </select>
243
+ </td>
244
+ </tr>
245
+
246
+ <tr>
247
+ <td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>
248
+ <td><input type="text" id="tabindex" name="tabindex" value="" /></td>
249
+ </tr>
250
+
251
+ <tr>
252
+ <td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>
253
+ <td><input type="text" id="accesskey" name="accesskey" value="" /></td>
254
+ </tr>
255
+ </table>
256
+ </fieldset>
257
+ </div>
258
+
259
+ <div id="events_panel" class="panel">
260
+ <fieldset>
261
+ <legend>{#advlink_dlg.event_props}</legend>
262
+
263
+ <table border="0" cellpadding="0" cellspacing="4">
264
+ <tr>
265
+ <td class="column1"><label for="onfocus">onfocus</label></td>
266
+ <td><input id="onfocus" name="onfocus" type="text" value="" /></td>
267
+ </tr>
268
+
269
+ <tr>
270
+ <td class="column1"><label for="onblur">onblur</label></td>
271
+ <td><input id="onblur" name="onblur" type="text" value="" /></td>
272
+ </tr>
273
+
274
+ <tr>
275
+ <td class="column1"><label for="onclick">onclick</label></td>
276
+ <td><input id="onclick" name="onclick" type="text" value="" /></td>
277
+ </tr>
278
+
279
+ <tr>
280
+ <td class="column1"><label for="ondblclick">ondblclick</label></td>
281
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
282
+ </tr>
283
+
284
+ <tr>
285
+ <td class="column1"><label for="onmousedown">onmousedown</label></td>
286
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
287
+ </tr>
288
+
289
+ <tr>
290
+ <td class="column1"><label for="onmouseup">onmouseup</label></td>
291
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
292
+ </tr>
293
+
294
+ <tr>
295
+ <td class="column1"><label for="onmouseover">onmouseover</label></td>
296
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
297
+ </tr>
298
+
299
+ <tr>
300
+ <td class="column1"><label for="onmousemove">onmousemove</label></td>
301
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
302
+ </tr>
303
+
304
+ <tr>
305
+ <td class="column1"><label for="onmouseout">onmouseout</label></td>
306
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
307
+ </tr>
308
+
309
+ <tr>
310
+ <td class="column1"><label for="onkeypress">onkeypress</label></td>
311
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
312
+ </tr>
313
+
314
+ <tr>
315
+ <td class="column1"><label for="onkeydown">onkeydown</label></td>
316
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
317
+ </tr>
318
+
319
+ <tr>
320
+ <td class="column1"><label for="onkeyup">onkeyup</label></td>
321
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
322
+ </tr>
323
+ </table>
324
+ </fieldset>
325
+ </div>
326
+ </div>
327
+
328
+ <div class="mceActionPanel">
329
+ <div style="float: left">
330
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
331
+ </div>
332
+
333
+ <div style="float: right">
334
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
335
+ </div>
336
+ </div>
337
+ </form>
338
+ </body>
339
+ </html>
mce/contextmenu/editor_plugin.js CHANGED
@@ -1 +1 @@
1
- (function(){var Event=tinymce.dom.Event,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.ContextMenu',{init:function(ed){var t=this;t.editor=ed;t.onContextMenu=new tinymce.util.Dispatcher(this);ed.onContextMenu.add(function(ed,e){if(!e.ctrlKey){t._getMenu(ed).showMenu(e.clientX,e.clientY);Event.add(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);})();
1
+ (function(){var Event=tinymce.dom.Event,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.ContextMenu',{init:function(ed){var t=this;t.editor=ed;t.onContextMenu=new tinymce.util.Dispatcher(this);ed.onContextMenu.add(function(ed,e){if(!e.ctrlKey){t._getMenu(ed).showMenu(e.clientX,e.clientY);Event.add(ed.getDoc(),'click',hide);Event.cancel(e);}});function hide(){if(t._menu){t._menu.removeAll();t._menu.destroy();Event.remove(ed.getDoc(),'click',hide);}};ed.onMouseDown.add(hide);ed.onKeyDown.add(hide);},getInfo:function(){return{longname:'Contextmenu',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_getMenu:function(ed){var t=this,m=t._menu,se=ed.selection,col=se.isCollapsed(),el=se.getNode()||ed.getBody(),am,p1,p2;if(m){m.removeAll();m.destroy();}p1=DOM.getPos(ed.getContentAreaContainer());p2=DOM.getPos(ed.getContainer());m=ed.controlManager.createDropMenu('contextmenu',{offset_x:p1.x+ed.getParam('contextmenu_offset_x',0),offset_y:p1.y+ed.getParam('contextmenu_offset_y',0),constrain:1});t._menu=m;m.add({title:'advanced.cut_desc',icon:'cut',cmd:'Cut'}).setDisabled(col);m.add({title:'advanced.copy_desc',icon:'copy',cmd:'Copy'}).setDisabled(col);m.add({title:'advanced.paste_desc',icon:'paste',cmd:'Paste'});if((el.nodeName=='A'&&!ed.dom.getAttrib(el,'name'))||!col){m.addSeparator();m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});}m.addSeparator();m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();am=m.addMenu({title:'contextmenu.align'});am.add({title:'contextmenu.left',icon:'justifyleft',cmd:'JustifyLeft'});am.add({title:'contextmenu.center',icon:'justifycenter',cmd:'JustifyCenter'});am.add({title:'contextmenu.right',icon:'justifyright',cmd:'JustifyRight'});am.add({title:'contextmenu.full',icon:'justifyfull',cmd:'JustifyFull'});t.onContextMenu.dispatch(t,m,el,col);return m;}});tinymce.PluginManager.add('contextmenu',tinymce.plugins.ContextMenu);})();
mce/iespell/editor_plugin.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(){tinymce.create('tinymce.plugins.IESpell',{init:function(ed,url){var t=this,sp;if(!tinymce.isIE)return;t.editor=ed;ed.addCommand('mceIESpell',function(){try{sp=new ActiveXObject("ieSpell.ieSpellExtension");sp.CheckDocumentNode(ed.getDoc().documentElement);}catch(e){if(e.number==-2146827859){ed.windowManager.confirm(ed.getLang("iespell.download"),function(s){if(s)window.open('http://www.iespell.com/download.php','ieSpellDownload','');});}else ed.windowManager.alert("Error Loading ieSpell: Exception "+e.number);}});ed.addButton('iespell',{title:'iespell.iespell_desc',cmd:'mceIESpell'});},getInfo:function(){return{longname:'IESpell (IE Only)',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('iespell',tinymce.plugins.IESpell);})();
mce/searchreplace/css/searchreplace.css CHANGED
@@ -1,6 +1,6 @@
1
- .panel_wrapper {height:85px;}
2
- .panel_wrapper div.current {height:85px;}
3
-
4
- /* IE */
5
- * html .panel_wrapper {height:100px;}
6
- * html .panel_wrapper div.current {height:100px;}
1
+ .panel_wrapper {height:85px;}
2
+ .panel_wrapper div.current {height:85px;}
3
+
4
+ /* IE */
5
+ * html .panel_wrapper {height:100px;}
6
+ * html .panel_wrapper div.current {height:100px;}
mce/searchreplace/js/searchreplace.js CHANGED
@@ -1,117 +1,117 @@
1
- tinyMCEPopup.requireLangPack();
2
-
3
- var SearchReplaceDialog = {
4
- init : function(ed) {
5
- var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
6
-
7
- this.switchMode(m);
8
-
9
- f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
10
-
11
- // Focus input field
12
- f[m + '_panel_searchstring'].focus();
13
- },
14
-
15
- switchMode : function(m) {
16
- var f, lm = this.lastMode;
17
-
18
- if (lm != m) {
19
- f = document.forms[0];
20
-
21
- if (lm) {
22
- f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
23
- f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
24
- f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
25
- f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
26
- }
27
-
28
- mcTabs.displayTab(m + '_tab', m + '_panel');
29
- document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
30
- document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
31
- this.lastMode = m;
32
- }
33
- },
34
-
35
- searchNext : function(a) {
36
- var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
37
-
38
- // Get input
39
- f = document.forms[0];
40
- s = f[m + '_panel_searchstring'].value;
41
- b = f[m + '_panel_backwardsu'].checked;
42
- ca = f[m + '_panel_casesensitivebox'].checked;
43
- rs = f['replace_panel_replacestring'].value;
44
-
45
- function fix() {
46
- // Correct Firefox graphics glitches
47
- r = se.getRng().cloneRange();
48
- ed.getDoc().execCommand('SelectAll', false, null);
49
- se.setRng(r);
50
- };
51
-
52
- function replace() {
53
- if (tinymce.isIE)
54
- ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE
55
- else
56
- ed.getDoc().execCommand('InsertHTML', false, rs);
57
- };
58
-
59
- // IE flags
60
- if (ca)
61
- fl = fl | 4;
62
-
63
- switch (a) {
64
- case 'all':
65
- if (tinymce.isIE) {
66
- while (r.findText(s, b ? -1 : 1, fl)) {
67
- r.scrollIntoView();
68
- r.select();
69
- replace();
70
- fo = 1;
71
- }
72
-
73
- tinyMCEPopup.storeSelection();
74
- } else {
75
- while (w.find(s, ca, b, false, false, false, false)) {
76
- replace();
77
- fo = 1;
78
- }
79
- }
80
-
81
- if (fo)
82
- wm.alert(ed.getLang('searchreplace_dlg.allreplaced'));
83
- else
84
- wm.alert(ed.getLang('searchreplace_dlg.notfound'));
85
-
86
- return;
87
-
88
- case 'current':
89
- replace();
90
- break;
91
- }
92
-
93
- se.collapse(b);
94
- r = se.getRng();
95
-
96
- // Whats the point
97
- if (!s)
98
- return;
99
-
100
- if (tinymce.isIE) {
101
- if (r.findText(s, b ? -1 : 1, fl)) {
102
- r.scrollIntoView();
103
- r.select();
104
- } else
105
- wm.alert(ed.getLang('searchreplace_dlg.notfound'));
106
-
107
- tinyMCEPopup.storeSelection();
108
- } else {
109
- if (!w.find(s, ca, b, false, false, false, false))
110
- wm.alert(ed.getLang('searchreplace_dlg.notfound'));
111
- else
112
- fix();
113
- }
114
- }
115
- };
116
-
117
- tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var SearchReplaceDialog = {
4
+ init : function(ed) {
5
+ var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
6
+
7
+ this.switchMode(m);
8
+
9
+ f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
10
+
11
+ // Focus input field
12
+ f[m + '_panel_searchstring'].focus();
13
+ },
14
+
15
+ switchMode : function(m) {
16
+ var f, lm = this.lastMode;
17
+
18
+ if (lm != m) {
19
+ f = document.forms[0];
20
+
21
+ if (lm) {
22
+ f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
23
+ f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
24
+ f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
25
+ f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
26
+ }
27
+
28
+ mcTabs.displayTab(m + '_tab', m + '_panel');
29
+ document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
30
+ document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
31
+ this.lastMode = m;
32
+ }
33
+ },
34
+
35
+ searchNext : function(a) {
36
+ var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
37
+
38
+ // Get input
39
+ f = document.forms[0];
40
+ s = f[m + '_panel_searchstring'].value;
41
+ b = f[m + '_panel_backwardsu'].checked;
42
+ ca = f[m + '_panel_casesensitivebox'].checked;
43
+ rs = f['replace_panel_replacestring'].value;
44
+
45
+ function fix() {
46
+ // Correct Firefox graphics glitches
47
+ r = se.getRng().cloneRange();
48
+ ed.getDoc().execCommand('SelectAll', false, null);
49
+ se.setRng(r);
50
+ };
51
+
52
+ function replace() {
53
+ if (tinymce.isIE)
54
+ ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE
55
+ else
56
+ ed.getDoc().execCommand('InsertHTML', false, rs);
57
+ };
58
+
59
+ // IE flags
60
+ if (ca)
61
+ fl = fl | 4;
62
+
63
+ switch (a) {
64
+ case 'all':
65
+ if (tinymce.isIE) {
66
+ while (r.findText(s, b ? -1 : 1, fl)) {
67
+ r.scrollIntoView();
68
+ r.select();
69
+ replace();
70
+ fo = 1;
71
+ }
72
+
73
+ tinyMCEPopup.storeSelection();
74
+ } else {
75
+ while (w.find(s, ca, b, false, false, false, false)) {
76
+ replace();
77
+ fo = 1;
78
+ }
79
+ }
80
+
81
+ if (fo)
82
+ wm.alert(ed.getLang('searchreplace_dlg.allreplaced'));
83
+ else
84
+ wm.alert(ed.getLang('searchreplace_dlg.notfound'));
85
+
86
+ return;
87
+
88
+ case 'current':
89
+ replace();
90
+ break;
91
+ }
92
+
93
+ se.collapse(b);
94
+ r = se.getRng();
95
+
96
+ // Whats the point
97
+ if (!s)
98
+ return;
99
+
100
+ if (tinymce.isIE) {
101
+ if (r.findText(s, b ? -1 : 1, fl)) {
102
+ r.scrollIntoView();
103
+ r.select();
104
+ } else
105
+ wm.alert(ed.getLang('searchreplace_dlg.notfound'));
106
+
107
+ tinyMCEPopup.storeSelection();
108
+ } else {
109
+ if (!w.find(s, ca, b, false, false, false, false))
110
+ wm.alert(ed.getLang('searchreplace_dlg.notfound'));
111
+ else
112
+ fix();
113
+ }
114
+ }
115
+ };
116
+
117
+ tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
mce/searchreplace/langs/en_dlg.js CHANGED
@@ -1,16 +1,16 @@
1
- tinyMCE.addI18n('en.searchreplace_dlg',{
2
- searchnext_desc:"Find again",
3
- notfound:"The search has been completed. The search string could not be found.",
4
- search_title:"Find",
5
- replace_title:"Find/Replace",
6
- allreplaced:"All occurrences of the search string were replaced.",
7
- findwhat:"Find what",
8
- replacewith:"Replace with",
9
- direction:"Direction",
10
- up:"Up",
11
- down:"Down",
12
- mcase:"Match case",
13
- findnext:"Find next",
14
- replace:"Replace",
15
- replaceall:"Replace all"
16
  });
1
+ tinyMCE.addI18n('en.searchreplace_dlg',{
2
+ searchnext_desc:"Find again",
3
+ notfound:"The search has been completed. The search string could not be found.",
4
+ search_title:"Find",
5
+ replace_title:"Find/Replace",
6
+ allreplaced:"All occurrences of the search string were replaced.",
7
+ findwhat:"Find what",
8
+ replacewith:"Replace with",
9
+ direction:"Direction",
10
+ up:"Up",
11
+ down:"Down",
12
+ mcase:"Match case",
13
+ findnext:"Find next",
14
+ replace:"Replace",
15
+ replaceall:"Replace all"
16
  });
mce/searchreplace/langs/ja_dlg.js CHANGED
@@ -1,16 +1,16 @@
1
  tinyMCE.addI18n('ja.searchreplace_dlg',{
2
- searchnext_desc:"\u518D\u6B21\u67E5\u627E",
3
- notfound:"\u67E5\u627E\u5DF2\u5B8C\u6210 ! \u627E\u4E0D\u5230\u4EFB\u4F55\u76EE\u6807\u3002 ",
4
- search_title:"\u67E5\u627E",
5
- replace_title:"\u67E5\u627E/\u66FF\u6362",
6
- allreplaced:"\u5DF2\u66FF\u6362\u6240\u6709\u5339\u914D\u7684\u5B57\u7B26\u4E32.",
7
- findwhat:"\u67E5\u627E\u76EE\u6807",
8
- replacewith:"\u66FF\u6362\u4E3A",
9
  direction:"\u65B9\u5411",
10
- up:"\u5411\u4E0A",
11
- down:"\u5411\u4E0B",
12
- mcase:"\u533A\u5206\u5927\u5C0F\u5199",
13
- findnext:"\u67E5\u627E\u4E0B\u4E00\u4E2A",
14
- replace:"\u66FF\u6362",
15
- replaceall:"\u5168\u90E8\u66FF\u6362"
16
  });
1
  tinyMCE.addI18n('ja.searchreplace_dlg',{
2
+ searchnext_desc:"\u518D\u691C\u7D22",
3
+ notfound:"\u6700\u5F8C\u307E\u3067\u691C\u7D22\u3057\u307E\u3057\u305F\u304C\u3001\u691C\u7D22\u6587\u5B57\u5217\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
4
+ search_title:"\u691C\u7D22",
5
+ replace_title:"\u691C\u7D22/\u7F6E\u63DB",
6
+ allreplaced:"\u5168\u3066\u7F6E\u63DB\u3055\u308C\u307E\u3057\u305F\u3002",
7
+ findwhat:"\u691C\u7D22\u6587\u5B57\u5217",
8
+ replacewith:"\u7F6E\u63DB\u6587\u5B57\u5217",
9
  direction:"\u65B9\u5411",
10
+ up:"\u4E0A\u3078",
11
+ down:"\u4E0B\u3078",
12
+ mcase:"\u5927\u6587\u5B57/\u5C0F\u6587\u5B57\u3092\u533A\u5225\u3059\u308B",
13
+ findnext:"\u6B21\u3078",
14
+ replace:"\u7F6E\u63DB",
15
+ replaceall:"\u5168\u3066\u7F6E\u63DB"
16
  });
mce/searchreplace/langs/langs.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
- if ( is_file($lang_file) && is_readable($lang_file) ) {
5
  $strings .= getFileContents($lang_file);
6
- }
7
  ?>
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
+ if ( is_file($lang_file) && is_readable($lang_file) )
5
  $strings .= getFileContents($lang_file);
6
+ else $strings .= getFileContents(dirname(__FILE__) . '/en_dlg.js');
7
  ?>
mce/searchreplace/searchreplace.htm CHANGED
@@ -1,105 +1,105 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#searchreplace_dlg.replace_title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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;">
13
- <form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">
14
- <div class="tabs">
15
- <ul>
16
- <li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>
17
- <li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>
18
- </ul>
19
- </div>
20
-
21
- <div class="panel_wrapper">
22
- <div id="search_panel" class="panel">
23
- <table border="0" cellspacing="0" cellpadding="2">
24
- <tr>
25
- <td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
26
- <td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>
27
- </tr>
28
- <tr>
29
- <td colspan="2">
30
- <table border="0" cellspacing="0" cellpadding="0" class="direction">
31
- <tr>
32
- <td><label>{#searchreplace_dlg.direction}</label></td>
33
- <td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
34
- <td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
35
- <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>
36
- <td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
37
- </tr>
38
- </table>
39
- </td>
40
- </tr>
41
- <tr>
42
- <td colspan="2">
43
- <table border="0" cellspacing="0" cellpadding="0">
44
- <tr>
45
- <td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
46
- <td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
47
- </tr>
48
- </table>
49
- </td>
50
- </tr>
51
- </table>
52
- </div>
53
-
54
- <div id="replace_panel" class="panel">
55
- <table border="0" cellspacing="0" cellpadding="2">
56
- <tr>
57
- <td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
58
- <td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>
59
- </tr>
60
- <tr>
61
- <td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>
62
- <td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>
63
- </tr>
64
- <tr>
65
- <td colspan="2">
66
- <table border="0" cellspacing="0" cellpadding="0" class="direction">
67
- <tr>
68
- <td><label>{#searchreplace_dlg.direction}</label></td>
69
- <td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
70
- <td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
71
- <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>
72
- <td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
73
- </tr>
74
- </table>
75
- </td>
76
- </tr>
77
- <tr>
78
- <td colspan="2">
79
- <table border="0" cellspacing="0" cellpadding="0">
80
- <tr>
81
- <td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
82
- <td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
83
- </tr>
84
- </table>
85
- </td>
86
- </tr>
87
- </table>
88
- </div>
89
-
90
- </div>
91
-
92
- <div class="mceActionPanel">
93
- <div style="float: left">
94
- <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
95
- <input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
96
- <input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
97
- </div>
98
-
99
- <div style="float: right">
100
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
101
- </div>
102
- </div>
103
- </form>
104
- </body>
105
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#searchreplace_dlg.replace_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="js/searchreplace.js?ver=311"></script>
9
+ <link rel="stylesheet" type="text/css" href="css/searchreplace.css?ver=311" />
10
+ <base target="_self" />
11
+ </head>
12
+ <body style="display:none;">
13
+ <form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">
14
+ <div class="tabs">
15
+ <ul>
16
+ <li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>
17
+ <li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>
18
+ </ul>
19
+ </div>
20
+
21
+ <div class="panel_wrapper">
22
+ <div id="search_panel" class="panel">
23
+ <table border="0" cellspacing="0" cellpadding="2">
24
+ <tr>
25
+ <td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
26
+ <td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>
27
+ </tr>
28
+ <tr>
29
+ <td colspan="2">
30
+ <table border="0" cellspacing="0" cellpadding="0" class="direction">
31
+ <tr>
32
+ <td><label>{#searchreplace_dlg.direction}</label></td>
33
+ <td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
34
+ <td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
35
+ <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>
36
+ <td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
37
+ </tr>
38
+ </table>
39
+ </td>
40
+ </tr>
41
+ <tr>
42
+ <td colspan="2">
43
+ <table border="0" cellspacing="0" cellpadding="0">
44
+ <tr>
45
+ <td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
46
+ <td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </div>
53
+
54
+ <div id="replace_panel" class="panel">
55
+ <table border="0" cellspacing="0" cellpadding="2">
56
+ <tr>
57
+ <td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
58
+ <td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>
59
+ </tr>
60
+ <tr>
61
+ <td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>
62
+ <td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>
63
+ </tr>
64
+ <tr>
65
+ <td colspan="2">
66
+ <table border="0" cellspacing="0" cellpadding="0" class="direction">
67
+ <tr>
68
+ <td><label>{#searchreplace_dlg.direction}</label></td>
69
+ <td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
70
+ <td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
71
+ <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>
72
+ <td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
73
+ </tr>
74
+ </table>
75
+ </td>
76
+ </tr>
77
+ <tr>
78
+ <td colspan="2">
79
+ <table border="0" cellspacing="0" cellpadding="0">
80
+ <tr>
81
+ <td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
82
+ <td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
83
+ </tr>
84
+ </table>
85
+ </td>
86
+ </tr>
87
+ </table>
88
+ </div>
89
+
90
+ </div>
91
+
92
+ <div class="mceActionPanel">
93
+ <div style="float: left">
94
+ <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
95
+ <input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
96
+ <input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
97
+ </div>
98
+
99
+ <div style="float: right">
100
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
101
+ </div>
102
+ </div>
103
+ </form>
104
+ </body>
105
+ </html>
mce/style/css/props.css CHANGED
@@ -1,13 +1,13 @@
1
- #text_font {width:250px;}
2
- #text_size {width:70px;}
3
- .mceAddSelectValue {background:#DDD;}
4
- select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;}
5
- #box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;}
6
- #positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;}
7
- #positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;}
8
- .panel_wrapper div.current {padding-top:10px;height:230px;}
9
- .delim {border-left:1px solid gray;}
10
- .tdelim {border-bottom:1px solid gray;}
11
- #block_display {width:145px;}
12
- #list_type {width:115px;}
13
- .disabled {background:#EEE;}
1
+ #text_font {width:250px;}
2
+ #text_size {width:70px;}
3
+ .mceAddSelectValue {background:#DDD;}
4
+ select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;}
5
+ #box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;}
6
+ #positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;}
7
+ #positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;}
8
+ .panel_wrapper div.current {padding-top:10px;height:230px;}
9
+ .delim {border-left:1px solid gray;}
10
+ .tdelim {border-bottom:1px solid gray;}
11
+ #block_display {width:145px;}
12
+ #list_type {width:115px;}
13
+ .disabled {background:#EEE;}
mce/style/js/props.js CHANGED
@@ -1,641 +1,641 @@
1
- tinyMCEPopup.requireLangPack();
2
-
3
- var defaultFonts = "" +
4
- "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" +
5
- "Times New Roman, Times, serif=Times New Roman, Times, serif;" +
6
- "Courier New, Courier, mono=Courier New, Courier, mono;" +
7
- "Times New Roman, Times, serif=Times New Roman, Times, serif;" +
8
- "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" +
9
- "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" +
10
- "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";
11
-
12
- var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";
13
- var defaultMeasurement = "+pixels=px;points=pt;em;in;cm;mm;picas;ems;exs;%";
14
- var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%";
15
- var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%";
16
- var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";
17
- var defaultTextStyle = "normal;italic;oblique";
18
- var defaultVariant = "normal;small-caps";
19
- var defaultLineHeight = "normal";
20
- var defaultAttachment = "fixed;scroll";
21
- var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y";
22
- var defaultPosH = "left;center;right";
23
- var defaultPosV = "top;center;bottom";
24
- var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom";
25
- var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none";
26
- var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset";
27
- var defaultBorderWidth = "thin;medium;thick";
28
- var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none";
29
-
30
- function init() {
31
- var ce = document.getElementById('container'), h;
32
-
33
- ce.style.cssText = tinyMCEPopup.getWindowArg('style_text');
34
-
35
- h = getBrowserHTML('background_image_browser','background_image','image','advimage');
36
- document.getElementById("background_image_browser").innerHTML = h;
37
-
38
- document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color');
39
- document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color');
40
- document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top');
41
- document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right');
42
- document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');
43
- document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left');
44
-
45
- fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true);
46
- fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true);
47
- fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true);
48
- fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true);
49
- fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true);
50
- fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true);
51
- fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true);
52
- fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true);
53
- fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true);
54
-
55
- fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true);
56
- fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true);
57
-
58
- fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true);
59
- fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true);
60
-
61
- fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true);
62
- fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true);
63
-
64
- fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true);
65
- fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true);
66
- fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true);
67
- fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true);
68
- fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true);
69
- fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true);
70
- fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true);
71
- fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true);
72
- fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true);
73
-
74
- fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true);
75
- fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true);
76
- fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true);
77
- fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true);
78
- fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true);
79
- fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true);
80
- fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true);
81
- fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true);
82
- fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true);
83
- fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true);
84
- fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true);
85
- fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true);
86
-
87
- fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true);
88
- fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true);
89
- fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true);
90
- fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true);
91
-
92
- fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true);
93
- fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true);
94
- fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true);
95
- fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true);
96
-
97
- fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true);
98
- fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true);
99
- fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true);
100
- fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true);
101
-
102
- fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true);
103
- fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true);
104
-
105
- fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true);
106
- fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true);
107
-
108
- fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true);
109
- fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true);
110
- fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true);
111
-
112
- fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true);
113
- fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true);
114
- fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true);
115
- fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true);
116
-
117
- fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true);
118
- fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true);
119
- fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true);
120
- fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true);
121
-
122
- TinyMCE_EditableSelects.init();
123
- setupFormData();
124
- showDisabledControls();
125
- }
126
-
127
- function setupFormData() {
128
- var ce = document.getElementById('container'), f = document.forms[0], s, b, i;
129
-
130
- // Setup text fields
131
-
132
- selectByValue(f, 'text_font', ce.style.fontFamily, true, true);
133
- selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true);
134
- selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize));
135
- selectByValue(f, 'text_weight', ce.style.fontWeight, true, true);
136
- selectByValue(f, 'text_style', ce.style.fontStyle, true, true);
137
- selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true);
138
- selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight));
139
- selectByValue(f, 'text_case', ce.style.textTransform, true, true);
140
- selectByValue(f, 'text_variant', ce.style.fontVariant, true, true);
141
- f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color);
142
- updateColor('text_color_pick', 'text_color');
143
- f.text_underline.checked = inStr(ce.style.textDecoration, 'underline');
144
- f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');
145
- f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');
146
- f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');
147
-
148
- // Setup background fields
149
-
150
- f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor);
151
- updateColor('background_color_pick', 'background_color');
152
- f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
153
- selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true);
154
- selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true);
155
- selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true);
156
- selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0)));
157
- selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true);
158
- selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1)));
159
-
160
- // Setup block fields
161
-
162
- selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true);
163
- selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing));
164
- selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true);
165
- selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing));
166
- selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true);
167
- selectByValue(f, 'block_text_align', ce.style.textAlign, true, true);
168
- f.block_text_indent.value = getNum(ce.style.textIndent);
169
- selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent));
170
- selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true);
171
- selectByValue(f, 'block_display', ce.style.display, true, true);
172
-
173
- // Setup box fields
174
-
175
- f.box_width.value = getNum(ce.style.width);
176
- selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width));
177
-
178
- f.box_height.value = getNum(ce.style.height);
179
- selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));
180
-
181
- if (tinymce.isGecko)
182
- selectByValue(f, 'box_float', ce.style.cssFloat, true, true);
183
- else
184
- selectByValue(f, 'box_float', ce.style.styleFloat, true, true);
185
-
186
- selectByValue(f, 'box_clear', ce.style.clear, true, true);
187
-
188
- setupBox(f, ce, 'box_padding', 'padding', '');
189
- setupBox(f, ce, 'box_margin', 'margin', '');
190
-
191
- // Setup border fields
192
-
193
- setupBox(f, ce, 'border_style', 'border', 'Style');
194
- setupBox(f, ce, 'border_width', 'border', 'Width');
195
- setupBox(f, ce, 'border_color', 'border', 'Color');
196
-
197
- updateColor('border_color_top_pick', 'border_color_top');
198
- updateColor('border_color_right_pick', 'border_color_right');
199
- updateColor('border_color_bottom_pick', 'border_color_bottom');
200
- updateColor('border_color_left_pick', 'border_color_left');
201
-
202
- f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value);
203
- f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value);
204
- f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value);
205
- f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value);
206
-
207
- // Setup list fields
208
-
209
- selectByValue(f, 'list_type', ce.style.listStyleType, true, true);
210
- selectByValue(f, 'list_position', ce.style.listStylePosition, true, true);
211
- f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
212
-
213
- // Setup box fields
214
-
215
- selectByValue(f, 'positioning_type', ce.style.position, true, true);
216
- selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true);
217
- selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true);
218
- f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : "";
219
-
220
- f.positioning_width.value = getNum(ce.style.width);
221
- selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));
222
-
223
- f.positioning_height.value = getNum(ce.style.height);
224
- selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
225
-
226
- setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']);
227
-
228
- s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
229
- s = s.replace(/,/g, ' ');
230
-
231
- if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) {
232
- f.positioning_clip_top.value = getNum(getVal(s, 0));
233
- selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
234
- f.positioning_clip_right.value = getNum(getVal(s, 1));
235
- selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));
236
- f.positioning_clip_bottom.value = getNum(getVal(s, 2));
237
- selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2)));
238
- f.positioning_clip_left.value = getNum(getVal(s, 3));
239
- selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3)));
240
- } else {
241
- f.positioning_clip_top.value = getNum(getVal(s, 0));
242
- selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
243
- f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value;
244
- }
245
-
246
- // setupBox(f, ce, '', 'border', 'Color');
247
- }
248
-
249
- function getMeasurement(s) {
250
- return s.replace(/^([0-9]+)(.*)$/, "$2");
251
- }
252
-
253
- function getNum(s) {
254
- if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s))
255
- return s.replace(/[^0-9]/g, '');
256
-
257
- return s;
258
- }
259
-
260
- function inStr(s, n) {
261
- return new RegExp(n, 'gi').test(s);
262
- }
263
-
264
- function getVal(s, i) {
265
- var a = s.split(' ');
266
-
267
- if (a.length > 1)
268
- return a[i];
269
-
270
- return "";
271
- }
272
-
273
- function setValue(f, n, v) {
274
- if (f.elements[n].type == "text")
275
- f.elements[n].value = v;
276
- else
277
- selectByValue(f, n, v, true, true);
278
- }
279
-
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;
286
-
287
- setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
288
- f.elements[fp + "_top"].disabled = false;
289
-
290
- f.elements[fp + "_right"].value = "";
291
- f.elements[fp + "_right"].disabled = true;
292
- f.elements[fp + "_bottom"].value = "";
293
- f.elements[fp + "_bottom"].disabled = true;
294
- f.elements[fp + "_left"].value = "";
295
- f.elements[fp + "_left"].disabled = true;
296
-
297
- if (f.elements[fp + "_top_measurement"]) {
298
- selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
299
- f.elements[fp + "_left_measurement"].disabled = true;
300
- f.elements[fp + "_bottom_measurement"].disabled = true;
301
- f.elements[fp + "_right_measurement"].disabled = true;
302
- }
303
- } else {
304
- f.elements[fp + "_same"].checked = false;
305
-
306
- setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
307
- f.elements[fp + "_top"].disabled = false;
308
-
309
- setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf]));
310
- f.elements[fp + "_right"].disabled = false;
311
-
312
- setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf]));
313
- f.elements[fp + "_bottom"].disabled = false;
314
-
315
- setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf]));
316
- f.elements[fp + "_left"].disabled = false;
317
-
318
- if (f.elements[fp + "_top_measurement"]) {
319
- selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
320
- selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf]));
321
- selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf]));
322
- selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf]));
323
- f.elements[fp + "_left_measurement"].disabled = false;
324
- f.elements[fp + "_bottom_measurement"].disabled = false;
325
- f.elements[fp + "_right_measurement"].disabled = false;
326
- }
327
- }
328
- }
329
-
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 = "";
338
-
339
- a[0] = e.style[pr + b[0] + sf];
340
- a[1] = e.style[pr + b[1] + sf];
341
- a[2] = e.style[pr + b[2] + sf];
342
- a[3] = e.style[pr + b[3] + sf];
343
-
344
- for (i=0; i<a.length; i++) {
345
- if (a[i] == null)
346
- return false;
347
-
348
- for (x=0; x<a.length; x++) {
349
- if (a[x] != a[i])
350
- return false;
351
- }
352
- }
353
-
354
- return true;
355
- };
356
-
357
- function hasEqualValues(a) {
358
- var i, x;
359
-
360
- for (i=0; i<a.length; i++) {
361
- if (a[i] == null)
362
- return false;
363
-
364
- for (x=0; x<a.length; x++) {
365
- if (a[x] != a[i])
366
- return false;
367
- }
368
- }
369
-
370
- return true;
371
- }
372
-
373
- function applyAction() {
374
- var ce = document.getElementById('container'), ed = tinyMCEPopup.editor;
375
-
376
- generateCSS();
377
-
378
- tinyMCEPopup.restoreSelection();
379
- ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText)));
380
- }
381
-
382
- function updateAction() {
383
- applyAction();
384
- tinyMCEPopup.close();
385
- }
386
-
387
- function generateCSS() {
388
- var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t;
389
-
390
- ce.style.cssText = "";
391
-
392
- // Build text styles
393
- ce.style.fontFamily = f.text_font.value;
394
- ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : "");
395
- ce.style.fontStyle = f.text_style.value;
396
- ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : "");
397
- ce.style.textTransform = f.text_case.value;
398
- ce.style.fontWeight = f.text_weight.value;
399
- ce.style.fontVariant = f.text_variant.value;
400
- ce.style.color = f.text_color.value;
401
-
402
- s = "";
403
- s += f.text_underline.checked ? " underline" : "";
404
- s += f.text_overline.checked ? " overline" : "";
405
- s += f.text_linethrough.checked ? " line-through" : "";
406
- s += f.text_blink.checked ? " blink" : "";
407
- s = s.length > 0 ? s.substring(1) : s;
408
-
409
- if (f.text_none.checked)
410
- s = "none";
411
-
412
- ce.style.textDecoration = s;
413
-
414
- // Build background styles
415
-
416
- ce.style.backgroundColor = f.background_color.value;
417
- ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : "";
418
- ce.style.backgroundRepeat = f.background_repeat.value;
419
- ce.style.backgroundAttachment = f.background_attachment.value;
420
-
421
- if (f.background_hpos.value != "") {
422
- s = "";
423
- s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " ";
424
- s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : "");
425
- ce.style.backgroundPosition = s;
426
- }
427
-
428
- // Build block styles
429
-
430
- ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : "");
431
- ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : "");
432
- ce.style.verticalAlign = f.block_vertical_alignment.value;
433
- ce.style.textAlign = f.block_text_align.value;
434
- ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : "");
435
- ce.style.whiteSpace = f.block_whitespace.value;
436
- ce.style.display = f.block_display.value;
437
-
438
- // Build box styles
439
-
440
- ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");
441
- ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");
442
- ce.style.styleFloat = f.box_float.value;
443
-
444
- if (tinymce.isGecko)
445
- ce.style.cssFloat = f.box_float.value;
446
-
447
- ce.style.clear = f.box_clear.value;
448
-
449
- if (!f.box_padding_same.checked) {
450
- ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
451
- ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : "");
452
- ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : "");
453
- ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : "");
454
- } else
455
- ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
456
-
457
- if (!f.box_margin_same.checked) {
458
- ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
459
- ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : "");
460
- ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : "");
461
- ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : "");
462
- } else
463
- ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
464
-
465
- // Build border styles
466
-
467
- if (!f.border_style_same.checked) {
468
- ce.style.borderTopStyle = f.border_style_top.value;
469
- ce.style.borderRightStyle = f.border_style_right.value;
470
- ce.style.borderBottomStyle = f.border_style_bottom.value;
471
- ce.style.borderLeftStyle = f.border_style_left.value;
472
- } else
473
- ce.style.borderStyle = f.border_style_top.value;
474
-
475
- if (!f.border_width_same.checked) {
476
- ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");
477
- ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : "");
478
- ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");
479
- ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");
480
- } else
481
- ce.style.borderWidth = f.border_width_top.value;
482
-
483
- if (!f.border_color_same.checked) {
484
- ce.style.borderTopColor = f.border_color_top.value;
485
- ce.style.borderRightColor = f.border_color_right.value;
486
- ce.style.borderBottomColor = f.border_color_bottom.value;
487
- ce.style.borderLeftColor = f.border_color_left.value;
488
- } else
489
- ce.style.borderColor = f.border_color_top.value;
490
-
491
- // Build list styles
492
-
493
- ce.style.listStyleType = f.list_type.value;
494
- ce.style.listStylePosition = f.list_position.value;
495
- ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : "";
496
-
497
- // Build positioning styles
498
-
499
- ce.style.position = f.positioning_type.value;
500
- ce.style.visibility = f.positioning_visibility.value;
501
-
502
- if (ce.style.width == "")
503
- ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : "");
504
-
505
- if (ce.style.height == "")
506
- ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : "");
507
-
508
- ce.style.zIndex = f.positioning_zindex.value;
509
- ce.style.overflow = f.positioning_overflow.value;
510
-
511
- if (!f.positioning_placement_same.checked) {
512
- ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
513
- ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : "");
514
- ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : "");
515
- ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : "");
516
- } else {
517
- s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
518
- ce.style.top = s;
519
- ce.style.right = s;
520
- ce.style.bottom = s;
521
- ce.style.left = s;
522
- }
523
-
524
- if (!f.positioning_clip_same.checked) {
525
- s = "rect(";
526
- s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " ";
527
- s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " ";
528
- s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " ";
529
- s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto");
530
- s += ")";
531
-
532
- if (s != "rect(auto auto auto auto)")
533
- ce.style.clip = s;
534
- } else {
535
- s = "rect(";
536
- t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto";
537
- s += t + " ";
538
- s += t + " ";
539
- s += t + " ";
540
- s += t + ")";
541
-
542
- if (s != "rect(auto auto auto auto)")
543
- ce.style.clip = s;
544
- }
545
-
546
- ce.style.cssText = ce.style.cssText;
547
- }
548
-
549
- function isNum(s) {
550
- return new RegExp('[0-9]+', 'g').test(s);
551
- }
552
-
553
- function showDisabledControls() {
554
- var f = document.forms, i, a;
555
-
556
- for (i=0; i<f.length; i++) {
557
- for (a=0; a<f[i].elements.length; a++) {
558
- if (f[i].elements[a].disabled)
559
- tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled");
560
- else
561
- tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled");
562
- }
563
- }
564
- }
565
-
566
- function fillSelect(f, s, param, dval, sep, em) {
567
- var i, ar, p, se;
568
-
569
- f = document.forms[f];
570
- sep = typeof(sep) == "undefined" ? ";" : sep;
571
-
572
- if (em)
573
- addSelectValue(f, s, "", "");
574
-
575
- ar = tinyMCEPopup.getParam(param, dval).split(sep);
576
- for (i=0; i<ar.length; i++) {
577
- se = false;
578
-
579
- if (ar[i].charAt(0) == '+') {
580
- ar[i] = ar[i].substring(1);
581
- se = true;
582
- }
583
-
584
- p = ar[i].split('=');
585
-
586
- if (p.length > 1) {
587
- addSelectValue(f, s, p[0], p[1]);
588
-
589
- if (se)
590
- selectByValue(f, s, p[1]);
591
- } else {
592
- addSelectValue(f, s, p[0], p[0]);
593
-
594
- if (se)
595
- selectByValue(f, s, p[0]);
596
- }
597
- }
598
- }
599
-
600
- function toggleSame(ce, pre) {
601
- var el = document.forms[0].elements, i;
602
-
603
- if (ce.checked) {
604
- el[pre + "_top"].disabled = false;
605
- el[pre + "_right"].disabled = true;
606
- el[pre + "_bottom"].disabled = true;
607
- el[pre + "_left"].disabled = true;
608
-
609
- if (el[pre + "_top_measurement"]) {
610
- el[pre + "_top_measurement"].disabled = false;
611
- el[pre + "_right_measurement"].disabled = true;
612
- el[pre + "_bottom_measurement"].disabled = true;
613
- el[pre + "_left_measurement"].disabled = true;
614
- }
615
- } else {
616
- el[pre + "_top"].disabled = false;
617
- el[pre + "_right"].disabled = false;
618
- el[pre + "_bottom"].disabled = false;
619
- el[pre + "_left"].disabled = false;
620
-
621
- if (el[pre + "_top_measurement"]) {
622
- el[pre + "_top_measurement"].disabled = false;
623
- el[pre + "_right_measurement"].disabled = false;
624
- el[pre + "_bottom_measurement"].disabled = false;
625
- el[pre + "_left_measurement"].disabled = false;
626
- }
627
- }
628
-
629
- showDisabledControls();
630
- }
631
-
632
- function synch(fr, to) {
633
- var f = document.forms[0];
634
-
635
- f.elements[to].value = f.elements[fr].value;
636
-
637
- if (f.elements[fr + "_measurement"])
638
- selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);
639
- }
640
-
641
- tinyMCEPopup.onInit.add(init);
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var defaultFonts = "" +
4
+ "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" +
5
+ "Times New Roman, Times, serif=Times New Roman, Times, serif;" +
6
+ "Courier New, Courier, mono=Courier New, Courier, mono;" +
7
+ "Times New Roman, Times, serif=Times New Roman, Times, serif;" +
8
+ "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" +
9
+ "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" +
10
+ "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";
11
+
12
+ var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";
13
+ var defaultMeasurement = "+pixels=px;points=pt;em;in;cm;mm;picas;ems;exs;%";
14
+ var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%";
15
+ var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%";
16
+ var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";
17
+ var defaultTextStyle = "normal;italic;oblique";
18
+ var defaultVariant = "normal;small-caps";
19
+ var defaultLineHeight = "normal";
20
+ var defaultAttachment = "fixed;scroll";
21
+ var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y";
22
+ var defaultPosH = "left;center;right";
23
+ var defaultPosV = "top;center;bottom";
24
+ var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom";
25
+ var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none";
26
+ var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset";
27
+ var defaultBorderWidth = "thin;medium;thick";
28
+ var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none";
29
+
30
+ function init() {
31
+ var ce = document.getElementById('container'), h;
32
+
33
+ ce.style.cssText = tinyMCEPopup.getWindowArg('style_text');
34
+
35
+ h = getBrowserHTML('background_image_browser','background_image','image','advimage');
36
+ document.getElementById("background_image_browser").innerHTML = h;
37
+
38
+ document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color');
39
+ document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color');
40
+ document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top');
41
+ document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right');
42
+ document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');
43
+ document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left');
44
+
45
+ fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true);
46
+ fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true);
47
+ fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true);
48
+ fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true);
49
+ fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true);
50
+ fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true);
51
+ fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true);
52
+ fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true);
53
+ fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true);
54
+
55
+ fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true);
56
+ fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true);
57
+
58
+ fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true);
59
+ fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true);
60
+
61
+ fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true);
62
+ fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true);
63
+
64
+ fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true);
65
+ fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true);
66
+ fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true);
67
+ fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true);
68
+ fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true);
69
+ fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true);
70
+ fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true);
71
+ fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true);
72
+ fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true);
73
+
74
+ fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true);
75
+ fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true);
76
+ fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true);
77
+ fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true);
78
+ fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true);
79
+ fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true);
80
+ fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true);
81
+ fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true);
82
+ fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true);
83
+ fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true);
84
+ fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true);
85
+ fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true);
86
+
87
+ fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true);
88
+ fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true);
89
+ fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true);
90
+ fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true);
91
+
92
+ fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true);
93
+ fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true);
94
+ fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true);
95
+ fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true);
96
+
97
+ fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true);
98
+ fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true);
99
+ fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true);
100
+ fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true);
101
+
102
+ fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true);
103
+ fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true);
104
+
105
+ fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true);
106
+ fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true);
107
+
108
+ fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true);
109
+ fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true);
110
+ fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true);
111
+
112
+ fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true);
113
+ fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true);
114
+ fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true);
115
+ fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true);
116
+
117
+ fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true);
118
+ fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true);
119
+ fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true);
120
+ fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true);
121
+
122
+ TinyMCE_EditableSelects.init();
123
+ setupFormData();
124
+ showDisabledControls();
125
+ }
126
+
127
+ function setupFormData() {
128
+ var ce = document.getElementById('container'), f = document.forms[0], s, b, i;
129
+
130
+ // Setup text fields
131
+
132
+ selectByValue(f, 'text_font', ce.style.fontFamily, true, true);
133
+ selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true);
134
+ selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize));
135
+ selectByValue(f, 'text_weight', ce.style.fontWeight, true, true);
136
+ selectByValue(f, 'text_style', ce.style.fontStyle, true, true);
137
+ selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true);
138
+ selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight));
139
+ selectByValue(f, 'text_case', ce.style.textTransform, true, true);
140
+ selectByValue(f, 'text_variant', ce.style.fontVariant, true, true);
141
+ f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color);
142
+ updateColor('text_color_pick', 'text_color');
143
+ f.text_underline.checked = inStr(ce.style.textDecoration, 'underline');
144
+ f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');
145
+ f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');
146
+ f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');
147
+
148
+ // Setup background fields
149
+
150
+ f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor);
151
+ updateColor('background_color_pick', 'background_color');
152
+ f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
153
+ selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true);
154
+ selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true);
155
+ selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true);
156
+ selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0)));
157
+ selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true);
158
+ selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1)));
159
+
160
+ // Setup block fields
161
+
162
+ selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true);
163
+ selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing));
164
+ selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true);
165
+ selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing));
166
+ selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true);
167
+ selectByValue(f, 'block_text_align', ce.style.textAlign, true, true);
168
+ f.block_text_indent.value = getNum(ce.style.textIndent);
169
+ selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent));
170
+ selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true);
171
+ selectByValue(f, 'block_display', ce.style.display, true, true);
172
+
173
+ // Setup box fields
174
+
175
+ f.box_width.value = getNum(ce.style.width);
176
+ selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width));
177
+
178
+ f.box_height.value = getNum(ce.style.height);
179
+ selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));
180
+
181
+ if (tinymce.isGecko)
182
+ selectByValue(f, 'box_float', ce.style.cssFloat, true, true);
183
+ else
184
+ selectByValue(f, 'box_float', ce.style.styleFloat, true, true);
185
+
186
+ selectByValue(f, 'box_clear', ce.style.clear, true, true);
187
+
188
+ setupBox(f, ce, 'box_padding', 'padding', '');
189
+ setupBox(f, ce, 'box_margin', 'margin', '');
190
+
191
+ // Setup border fields
192
+
193
+ setupBox(f, ce, 'border_style', 'border', 'Style');
194
+ setupBox(f, ce, 'border_width', 'border', 'Width');
195
+ setupBox(f, ce, 'border_color', 'border', 'Color');
196
+
197
+ updateColor('border_color_top_pick', 'border_color_top');
198
+ updateColor('border_color_right_pick', 'border_color_right');
199
+ updateColor('border_color_bottom_pick', 'border_color_bottom');
200
+ updateColor('border_color_left_pick', 'border_color_left');
201
+
202
+ f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value);
203
+ f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value);
204
+ f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value);
205
+ f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value);
206
+
207
+ // Setup list fields
208
+
209
+ selectByValue(f, 'list_type', ce.style.listStyleType, true, true);
210
+ selectByValue(f, 'list_position', ce.style.listStylePosition, true, true);
211
+ f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
212
+
213
+ // Setup box fields
214
+
215
+ selectByValue(f, 'positioning_type', ce.style.position, true, true);
216
+ selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true);
217
+ selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true);
218
+ f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : "";
219
+
220
+ f.positioning_width.value = getNum(ce.style.width);
221
+ selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));
222
+
223
+ f.positioning_height.value = getNum(ce.style.height);
224
+ selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
225
+
226
+ setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']);
227
+
228
+ s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
229
+ s = s.replace(/,/g, ' ');
230
+
231
+ if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) {
232
+ f.positioning_clip_top.value = getNum(getVal(s, 0));
233
+ selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
234
+ f.positioning_clip_right.value = getNum(getVal(s, 1));
235
+ selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));
236
+ f.positioning_clip_bottom.value = getNum(getVal(s, 2));
237
+ selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2)));
238
+ f.positioning_clip_left.value = getNum(getVal(s, 3));
239
+ selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3)));
240
+ } else {
241
+ f.positioning_clip_top.value = getNum(getVal(s, 0));
242
+ selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
243
+ f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value;
244
+ }
245
+
246
+ // setupBox(f, ce, '', 'border', 'Color');
247
+ }
248
+
249
+ function getMeasurement(s) {
250
+ return s.replace(/^([0-9]+)(.*)$/, "$2");
251
+ }
252
+
253
+ function getNum(s) {
254
+ if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s))
255
+ return s.replace(/[^0-9]/g, '');
256
+
257
+ return s;
258
+ }
259
+
260
+ function inStr(s, n) {
261
+ return new RegExp(n, 'gi').test(s);
262
+ }
263
+
264
+ function getVal(s, i) {
265
+ var a = s.split(' ');
266
+
267
+ if (a.length > 1)
268
+ return a[i];
269
+
270
+ return "";
271
+ }
272
+
273
+ function setValue(f, n, v) {
274
+ if (f.elements[n].type == "text")
275
+ f.elements[n].value = v;
276
+ else
277
+ selectByValue(f, n, v, true, true);
278
+ }
279
+
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;
286
+
287
+ setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
288
+ f.elements[fp + "_top"].disabled = false;
289
+
290
+ f.elements[fp + "_right"].value = "";
291
+ f.elements[fp + "_right"].disabled = true;
292
+ f.elements[fp + "_bottom"].value = "";
293
+ f.elements[fp + "_bottom"].disabled = true;
294
+ f.elements[fp + "_left"].value = "";
295
+ f.elements[fp + "_left"].disabled = true;
296
+
297
+ if (f.elements[fp + "_top_measurement"]) {
298
+ selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
299
+ f.elements[fp + "_left_measurement"].disabled = true;
300
+ f.elements[fp + "_bottom_measurement"].disabled = true;
301
+ f.elements[fp + "_right_measurement"].disabled = true;
302
+ }
303
+ } else {
304
+ f.elements[fp + "_same"].checked = false;
305
+
306
+ setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
307
+ f.elements[fp + "_top"].disabled = false;
308
+
309
+ setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf]));
310
+ f.elements[fp + "_right"].disabled = false;
311
+
312
+ setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf]));
313
+ f.elements[fp + "_bottom"].disabled = false;
314
+
315
+ setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf]));
316
+ f.elements[fp + "_left"].disabled = false;
317
+
318
+ if (f.elements[fp + "_top_measurement"]) {
319
+ selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
320
+ selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf]));
321
+ selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf]));
322
+ selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf]));
323
+ f.elements[fp + "_left_measurement"].disabled = false;
324
+ f.elements[fp + "_bottom_measurement"].disabled = false;
325
+ f.elements[fp + "_right_measurement"].disabled = false;
326
+ }
327
+ }
328
+ }
329
+
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 = "";
338
+
339
+ a[0] = e.style[pr + b[0] + sf];
340
+ a[1] = e.style[pr + b[1] + sf];
341
+ a[2] = e.style[pr + b[2] + sf];
342
+ a[3] = e.style[pr + b[3] + sf];
343
+
344
+ for (i=0; i<a.length; i++) {
345
+ if (a[i] == null)
346
+ return false;
347
+
348
+ for (x=0; x<a.length; x++) {
349
+ if (a[x] != a[i])
350
+ return false;
351
+ }
352
+ }
353
+
354
+ return true;
355
+ };
356
+
357
+ function hasEqualValues(a) {
358
+ var i, x;
359
+
360
+ for (i=0; i<a.length; i++) {
361
+ if (a[i] == null)
362
+ return false;
363
+
364
+ for (x=0; x<a.length; x++) {
365
+ if (a[x] != a[i])
366
+ return false;
367
+ }
368
+ }
369
+
370
+ return true;
371
+ }
372
+
373
+ function applyAction() {
374
+ var ce = document.getElementById('container'), ed = tinyMCEPopup.editor;
375
+
376
+ generateCSS();
377
+
378
+ tinyMCEPopup.restoreSelection();
379
+ ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText)));
380
+ }
381
+
382
+ function updateAction() {
383
+ applyAction();
384
+ tinyMCEPopup.close();
385
+ }
386
+
387
+ function generateCSS() {
388
+ var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t;
389
+
390
+ ce.style.cssText = "";
391
+
392
+ // Build text styles
393
+ ce.style.fontFamily = f.text_font.value;
394
+ ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : "");
395
+ ce.style.fontStyle = f.text_style.value;
396
+ ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : "");
397
+ ce.style.textTransform = f.text_case.value;
398
+ ce.style.fontWeight = f.text_weight.value;
399
+ ce.style.fontVariant = f.text_variant.value;
400
+ ce.style.color = f.text_color.value;
401
+
402
+ s = "";
403
+ s += f.text_underline.checked ? " underline" : "";
404
+ s += f.text_overline.checked ? " overline" : "";
405
+ s += f.text_linethrough.checked ? " line-through" : "";
406
+ s += f.text_blink.checked ? " blink" : "";
407
+ s = s.length > 0 ? s.substring(1) : s;
408
+
409
+ if (f.text_none.checked)
410
+ s = "none";
411
+
412
+ ce.style.textDecoration = s;
413
+
414
+ // Build background styles
415
+
416
+ ce.style.backgroundColor = f.background_color.value;
417
+ ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : "";
418
+ ce.style.backgroundRepeat = f.background_repeat.value;
419
+ ce.style.backgroundAttachment = f.background_attachment.value;
420
+
421
+ if (f.background_hpos.value != "") {
422
+ s = "";
423
+ s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " ";
424
+ s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : "");
425
+ ce.style.backgroundPosition = s;
426
+ }
427
+
428
+ // Build block styles
429
+
430
+ ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : "");
431
+ ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : "");
432
+ ce.style.verticalAlign = f.block_vertical_alignment.value;
433
+ ce.style.textAlign = f.block_text_align.value;
434
+ ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : "");
435
+ ce.style.whiteSpace = f.block_whitespace.value;
436
+ ce.style.display = f.block_display.value;
437
+
438
+ // Build box styles
439
+
440
+ ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");
441
+ ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");
442
+ ce.style.styleFloat = f.box_float.value;
443
+
444
+ if (tinymce.isGecko)
445
+ ce.style.cssFloat = f.box_float.value;
446
+
447
+ ce.style.clear = f.box_clear.value;
448
+
449
+ if (!f.box_padding_same.checked) {
450
+ ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
451
+ ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : "");
452
+ ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : "");
453
+ ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : "");
454
+ } else
455
+ ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
456
+
457
+ if (!f.box_margin_same.checked) {
458
+ ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
459
+ ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : "");
460
+ ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : "");
461
+ ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : "");
462
+ } else
463
+ ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
464
+
465
+ // Build border styles
466
+
467
+ if (!f.border_style_same.checked) {
468
+ ce.style.borderTopStyle = f.border_style_top.value;
469
+ ce.style.borderRightStyle = f.border_style_right.value;
470
+ ce.style.borderBottomStyle = f.border_style_bottom.value;
471
+ ce.style.borderLeftStyle = f.border_style_left.value;
472
+ } else
473
+ ce.style.borderStyle = f.border_style_top.value;
474
+
475
+ if (!f.border_width_same.checked) {
476
+ ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");
477
+ ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : "");
478
+ ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");
479
+ ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");
480
+ } else
481
+ ce.style.borderWidth = f.border_width_top.value;
482
+
483
+ if (!f.border_color_same.checked) {
484
+ ce.style.borderTopColor = f.border_color_top.value;
485
+ ce.style.borderRightColor = f.border_color_right.value;
486
+ ce.style.borderBottomColor = f.border_color_bottom.value;
487
+ ce.style.borderLeftColor = f.border_color_left.value;
488
+ } else
489
+ ce.style.borderColor = f.border_color_top.value;
490
+
491
+ // Build list styles
492
+
493
+ ce.style.listStyleType = f.list_type.value;
494
+ ce.style.listStylePosition = f.list_position.value;
495
+ ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : "";
496
+
497
+ // Build positioning styles
498
+
499
+ ce.style.position = f.positioning_type.value;
500
+ ce.style.visibility = f.positioning_visibility.value;
501
+
502
+ if (ce.style.width == "")
503
+ ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : "");
504
+
505
+ if (ce.style.height == "")
506
+ ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : "");
507
+
508
+ ce.style.zIndex = f.positioning_zindex.value;
509
+ ce.style.overflow = f.positioning_overflow.value;
510
+
511
+ if (!f.positioning_placement_same.checked) {
512
+ ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
513
+ ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : "");
514
+ ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : "");
515
+ ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : "");
516
+ } else {
517
+ s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
518
+ ce.style.top = s;
519
+ ce.style.right = s;
520
+ ce.style.bottom = s;
521
+ ce.style.left = s;
522
+ }
523
+
524
+ if (!f.positioning_clip_same.checked) {
525
+ s = "rect(";
526
+ s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " ";
527
+ s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " ";
528
+ s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " ";
529
+ s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto");
530
+ s += ")";
531
+
532
+ if (s != "rect(auto auto auto auto)")
533
+ ce.style.clip = s;
534
+ } else {
535
+ s = "rect(";
536
+ t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto";
537
+ s += t + " ";
538
+ s += t + " ";
539
+ s += t + " ";
540
+ s += t + ")";
541
+
542
+ if (s != "rect(auto auto auto auto)")
543
+ ce.style.clip = s;
544
+ }
545
+
546
+ ce.style.cssText = ce.style.cssText;
547
+ }
548
+
549
+ function isNum(s) {
550
+ return new RegExp('[0-9]+', 'g').test(s);
551
+ }
552
+
553
+ function showDisabledControls() {
554
+ var f = document.forms, i, a;
555
+
556
+ for (i=0; i<f.length; i++) {
557
+ for (a=0; a<f[i].elements.length; a++) {
558
+ if (f[i].elements[a].disabled)
559
+ tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled");
560
+ else
561
+ tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled");
562
+ }
563
+ }
564
+ }
565
+
566
+ function fillSelect(f, s, param, dval, sep, em) {
567
+ var i, ar, p, se;
568
+
569
+ f = document.forms[f];
570
+ sep = typeof(sep) == "undefined" ? ";" : sep;
571
+
572
+ if (em)
573
+ addSelectValue(f, s, "", "");
574
+
575
+ ar = tinyMCEPopup.getParam(param, dval).split(sep);
576
+ for (i=0; i<ar.length; i++) {
577
+ se = false;
578
+
579
+ if (ar[i].charAt(0) == '+') {
580
+ ar[i] = ar[i].substring(1);
581
+ se = true;
582
+ }
583
+
584
+ p = ar[i].split('=');
585
+
586
+ if (p.length > 1) {
587
+ addSelectValue(f, s, p[0], p[1]);
588
+
589
+ if (se)
590
+ selectByValue(f, s, p[1]);
591
+ } else {
592
+ addSelectValue(f, s, p[0], p[0]);
593
+
594
+ if (se)
595
+ selectByValue(f, s, p[0]);
596
+ }
597
+ }
598
+ }
599
+
600
+ function toggleSame(ce, pre) {
601
+ var el = document.forms[0].elements, i;
602
+
603
+ if (ce.checked) {
604
+ el[pre + "_top"].disabled = false;
605
+ el[pre + "_right"].disabled = true;
606
+ el[pre + "_bottom"].disabled = true;
607
+ el[pre + "_left"].disabled = true;
608
+
609
+ if (el[pre + "_top_measurement"]) {
610
+ el[pre + "_top_measurement"].disabled = false;
611
+ el[pre + "_right_measurement"].disabled = true;
612
+ el[pre + "_bottom_measurement"].disabled = true;
613
+ el[pre + "_left_measurement"].disabled = true;
614
+ }
615
+ } else {
616
+ el[pre + "_top"].disabled = false;
617
+ el[pre + "_right"].disabled = false;
618
+ el[pre + "_bottom"].disabled = false;
619
+ el[pre + "_left"].disabled = false;
620
+
621
+ if (el[pre + "_top_measurement"]) {
622
+ el[pre + "_top_measurement"].disabled = false;
623
+ el[pre + "_right_measurement"].disabled = false;
624
+ el[pre + "_bottom_measurement"].disabled = false;
625
+ el[pre + "_left_measurement"].disabled = false;
626
+ }
627
+ }
628
+
629
+ showDisabledControls();
630
+ }
631
+
632
+ function synch(fr, to) {
633
+ var f = document.forms[0];
634
+
635
+ f.elements[to].value = f.elements[fr].value;
636
+
637
+ if (f.elements[fr + "_measurement"])
638
+ selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);
639
+ }
640
+
641
+ tinyMCEPopup.onInit.add(init);
mce/style/langs/en_dlg.js CHANGED
@@ -1,63 +1,63 @@
1
- tinyMCE.addI18n('en.style_dlg',{
2
- title:"Edit CSS Style",
3
- apply:"Apply",
4
- text_tab:"Text",
5
- background_tab:"Background",
6
- block_tab:"Block",
7
- box_tab:"Box",
8
- border_tab:"Border",
9
- list_tab:"List",
10
- positioning_tab:"Positioning",
11
- text_props:"Text",
12
- text_font:"Font",
13
- text_size:"Size",
14
- text_weight:"Weight",
15
- text_style:"Style",
16
- text_variant:"Variant",
17
- text_lineheight:"Line height",
18
- text_case:"Case",
19
- text_color:"Color",
20
- text_decoration:"Decoration",
21
- text_overline:"overline",
22
- text_underline:"underline",
23
- text_striketrough:"strikethrough",
24
- text_blink:"blink",
25
- text_none:"none",
26
- background_color:"Background color",
27
- background_image:"Background image",
28
- background_repeat:"Repeat",
29
- background_attachment:"Attachment",
30
- background_hpos:"Horizontal position",
31
- background_vpos:"Vertical position",
32
- block_wordspacing:"Word spacing",
33
- block_letterspacing:"Letter spacing",
34
- block_vertical_alignment:"Vertical alignment",
35
- block_text_align:"Text align",
36
- block_text_indent:"Text indent",
37
- block_whitespace:"Whitespace",
38
- block_display:"Display",
39
- box_width:"Width",
40
- box_height:"Height",
41
- box_float:"Float",
42
- box_clear:"Clear",
43
- padding:"Padding",
44
- same:"Same for all",
45
- top:"Top",
46
- right:"Right",
47
- bottom:"Bottom",
48
- left:"Left",
49
- margin:"Margin",
50
- style:"Style",
51
- width:"Width",
52
- height:"Height",
53
- color:"Color",
54
- list_type:"Type",
55
- bullet_image:"Bullet image",
56
- position:"Position",
57
- positioning_type:"Type",
58
- visibility:"Visibility",
59
- zindex:"Z-index",
60
- overflow:"Overflow",
61
- placement:"Placement",
62
- clip:"Clip"
63
  });
1
+ tinyMCE.addI18n('en.style_dlg',{
2
+ title:"Edit CSS Style",
3
+ apply:"Apply",
4
+ text_tab:"Text",
5
+ background_tab:"Background",
6
+ block_tab:"Block",
7
+ box_tab:"Box",
8
+ border_tab:"Border",
9
+ list_tab:"List",
10
+ positioning_tab:"Positioning",
11
+ text_props:"Text",
12
+ text_font:"Font",
13
+ text_size:"Size",
14
+ text_weight:"Weight",
15
+ text_style:"Style",
16
+ text_variant:"Variant",
17
+ text_lineheight:"Line height",
18
+ text_case:"Case",
19
+ text_color:"Color",
20
+ text_decoration:"Decoration",
21
+ text_overline:"overline",
22
+ text_underline:"underline",
23
+ text_striketrough:"strikethrough",
24
+ text_blink:"blink",
25
+ text_none:"none",
26
+ background_color:"Background color",
27
+ background_image:"Background image",
28
+ background_repeat:"Repeat",
29
+ background_attachment:"Attachment",
30
+ background_hpos:"Horizontal position",
31
+ background_vpos:"Vertical position",
32
+ block_wordspacing:"Word spacing",
33
+ block_letterspacing:"Letter spacing",
34
+ block_vertical_alignment:"Vertical alignment",
35
+ block_text_align:"Text align",
36
+ block_text_indent:"Text indent",
37
+ block_whitespace:"Whitespace",
38
+ block_display:"Display",
39
+ box_width:"Width",
40
+ box_height:"Height",
41
+ box_float:"Float",
42
+ box_clear:"Clear",
43
+ padding:"Padding",
44
+ same:"Same for all",
45
+ top:"Top",
46
+ right:"Right",
47
+ bottom:"Bottom",
48
+ left:"Left",
49
+ margin:"Margin",
50
+ style:"Style",
51
+ width:"Width",
52
+ height:"Height",
53
+ color:"Color",
54
+ list_type:"Type",
55
+ bullet_image:"Bullet image",
56
+ position:"Position",
57
+ positioning_type:"Type",
58
+ visibility:"Visibility",
59
+ zindex:"Z-index",
60
+ overflow:"Overflow",
61
+ placement:"Placement",
62
+ clip:"Clip"
63
  });
mce/style/langs/ja_dlg.js CHANGED
@@ -1,63 +1,63 @@
1
  tinyMCE.addI18n('ja.style_dlg',{
2
- title:"\u7F16\u8F91 CSS \u6837\u5F0F\u8868",
3
- apply:"\u5E94\u7528",
4
  text_tab:"\u6587\u5B57",
5
  background_tab:"\u80CC\u666F",
6
- block_tab:"\u533A\u5757",
7
- box_tab:"\u76D2\u6A21\u578B",
8
- border_tab:"\u8FB9\u6846",
9
- list_tab:"\u5217\u8868",
10
- positioning_tab:"\u4F4D\u7F6E",
11
- text_props:"\u6587\u5B57",
12
- text_font:"\u5B57\u4F53",
13
- text_size:"\u5927\u5C0F",
14
- text_weight:"\u5BBD\u5EA6",
15
- text_style:"\u6837\u5F0F",
16
- text_variant:"\u53D8\u4F53",
17
- text_lineheight:"\u884C\u9AD8",
18
- text_case:"\u5B57\u4F53",
19
- text_color:"\u989C\u8272",
20
- text_decoration:"\u88C5\u9970",
21
- text_overline:"\u4E0A\u5212\u7EBF",
22
- text_underline:"\u5E95\u7EBF",
23
- text_striketrough:"\u4E2D\u5212\u7EBF",
24
- text_blink:"\u95EA\u70C1",
25
- text_none:"\u65E0",
26
- background_color:"\u80CC\u666F\u989C\u8272",
27
- background_image:"\u80CC\u666F\u56FE\u7247",
28
- background_repeat:"\u91CD\u590D",
29
- background_attachment:"\u9644\u4EF6",
30
  background_hpos:"\u6C34\u5E73\u4F4D\u7F6E",
31
  background_vpos:"\u5782\u76F4\u4F4D\u7F6E",
32
- block_wordspacing:"\u8BCD\u95F4\u8DDD",
33
- block_letterspacing:"\u5B57\u6BCD\u95F4\u8DDD",
34
- block_vertical_alignment:"\u5782\u76F4\u5BF9\u9F50\u65B9\u5F0F",
35
- block_text_align:"\u6587\u5B57\u5BF9\u9F50",
36
- block_text_indent:"\u6587\u5B57\u7F29\u8FDB",
37
- block_whitespace:"\u7A7A\u683C",
38
- block_display:"\u663E\u793A\u65B9\u5F0F",
39
- box_width:"\u5BBD\u5EA6",
40
- box_height:"\u9AD8\u5EA6",
41
- box_float:"\u6D6E\u52A8",
42
- box_clear:"\u6E05\u9664",
43
- padding:"\u5185\u8FB9\u8DDD",
44
- same:"\u5168\u90E8\u76F8\u540C",
45
- top:"\u9876\u90E8",
46
- right:"\u53F3\u4FA7",
47
- bottom:"\u5E95\u90E8",
48
- left:"\u5DE6\u4FA7",
49
- margin:"\u8FB9\u8DDD",
50
- style:"\u6837\u5F0F",
51
- width:"\u5BBD\u5EA6",
52
- height:"\u9AD8\u5EA6",
53
- color:"\u989C\u8272",
54
- list_type:"\u5217\u8868\u7C7B\u578B",
55
- bullet_image:"\u6E05\u5355\u56FE\u7247",
56
- position:"\u56FE\u7247\u4F4D\u7F6E",
57
- positioning_type:"\u4F4D\u7F6E\u7C7B\u578B",
58
- visibility:"\u662F\u5426\u53EF\u89C1",
59
- zindex:"Z\u5750\u6807",
60
- overflow:"\u6EA2\u51FA",
61
- placement:"\u5E03\u7F6E",
62
- clip:"\u526A\u8F91"
63
  });
1
  tinyMCE.addI18n('ja.style_dlg',{
2
+ title:"CSS\u7DE8\u96C6",
3
+ apply:"\u9069\u7528",
4
  text_tab:"\u6587\u5B57",
5
  background_tab:"\u80CC\u666F",
6
+ block_tab:"\u30D6\u30ED\u30C3\u30AF",
7
+ box_tab:"\u30DC\u30C3\u30AF\u30B9",
8
+ border_tab:"\u67A0\u7DDA",
9
+ list_tab:"\u30EA\u30B9\u30C8",
10
+ positioning_tab:"\u30DD\u30B8\u30B7\u30E7\u30F3",
11
+ text_props:"Text",
12
+ text_font:"\u30D5\u30A9\u30F3\u30C8",
13
+ text_size:"\u30B5\u30A4\u30BA",
14
+ text_weight:"\u592A\u3055",
15
+ text_style:"\u30B9\u30BF\u30A4\u30EB",
16
+ text_variant:"\u5909\u5F62",
17
+ text_lineheight:"\u884C\u9AD8\u3055",
18
+ text_case:"\u5927\u6587\u5B57/\u5C0F\u6587\u5B57",
19
+ text_color:"\u8272",
20
+ text_decoration:"\u88C5\u98FE",
21
+ text_overline:"\u4E0A\u7DDA",
22
+ text_underline:"\u4E0B\u7DDA",
23
+ text_striketrough:"\u6253\u6D88\u3057\u7DDA",
24
+ text_blink:"\u70B9\u6EC5",
25
+ text_none:"\u306A\u3057",
26
+ background_color:"\u80CC\u666F\u8272",
27
+ background_image:"\u80CC\u666F\u753B\u50CF",
28
+ background_repeat:"\u7E70\u308A\u8FD4\u3057",
29
+ background_attachment:"Attachment",
30
  background_hpos:"\u6C34\u5E73\u4F4D\u7F6E",
31
  background_vpos:"\u5782\u76F4\u4F4D\u7F6E",
32
+ block_wordspacing:"\u5358\u8A9E\u611F\u899A",
33
+ block_letterspacing:"\u6587\u5B57\u9593\u9694",
34
+ block_vertical_alignment:"\u5782\u76F4\u914D\u7F6E",
35
+ block_text_align:"\u6C34\u5E73\u914D\u7F6E",
36
+ block_text_indent:"\u30A4\u30F3\u30C7\u30F3\u30C8",
37
+ block_whitespace:"\u7A7A\u767D\u6587\u5B57",
38
+ block_display:"\u30C7\u30A3\u30B9\u30D7\u30EC\u30A4",
39
+ box_width:"\u5E45",
40
+ box_height:"\u9AD8\u3055",
41
+ box_float:"\u56DE\u308A\u8FBC\u307F",
42
+ box_clear:"\u56DE\u308A\u8FBC\u307F\u89E3\u9664",
43
+ padding:"\u30D1\u30C7\u30A3\u30F3\u30B0",
44
+ same:"\u5168\u3066\u540C\u3058\u306B\u3059\u308B",
45
+ top:"\u4E0A",
46
+ right:"\u53F3",
47
+ bottom:"\u4E0B",
48
+ left:"\u5DE6",
49
+ margin:"\u30DE\u30FC\u30B8\u30F3",
50
+ style:"\u30B9\u30BF\u30A4\u30EB",
51
+ width:"\u5E45",
52
+ height:"\u9AD8\u3055",
53
+ color:"\u8272",
54
+ list_type:"\u30DE\u30FC\u30AB\u30FC\u7A2E\u985E",
55
+ bullet_image:"\u30DE\u30FC\u30AB\u30FC\u753B\u50CF",
56
+ position:"\u30DE\u30FC\u30AB\u30FC\u8868\u793A\u4F4D\u7F6E",
57
+ positioning_type:"\u914D\u7F6E\u65B9\u6CD5",
58
+ visibility:"\u8868\u793A",
59
+ zindex:"Z-Index",
60
+ overflow:"\u30AA\u30FC\u30D0\u30FC\u30D5\u30ED\u30FC",
61
+ placement:"\u4F4D\u7F6E",
62
+ clip:"\u5207\u308A\u629C\u304D"
63
  });
mce/style/langs/langs.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
- if ( is_file($lang_file) && is_readable($lang_file) ) {
5
  $strings .= getFileContents($lang_file);
6
- }
7
  ?>
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
+ if ( is_file($lang_file) && is_readable($lang_file) )
5
  $strings .= getFileContents($lang_file);
6
+ else $strings .= getFileContents(dirname(__FILE__) . '/en_dlg.js');
7
  ?>
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?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
 
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title>{#style_dlg.title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
9
+ <script type="text/javascript" src="js/props.js?ver=311"></script>
10
+ <link href="css/props.css?ver=311" rel="stylesheet" type="text/css" />
11
  <base target="_self" />
12
  </head>
13
 
mce/table/cell.htm CHANGED
@@ -1,184 +1,184 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#table_dlg.cell_title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
14
- <form onsubmit="updateAction();return false;" action="#">
15
- <div class="tabs">
16
- <ul>
17
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
18
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
19
- </ul>
20
- </div>
21
-
22
- <div class="panel_wrapper">
23
- <div id="general_panel" class="panel current">
24
- <fieldset>
25
- <legend>{#table_dlg.general_props}</legend>
26
-
27
- <table border="0" cellpadding="4" cellspacing="0">
28
- <tr>
29
- <td><label for="align">{#table_dlg.align}</label></td>
30
- <td>
31
- <select id="align" name="align" class="mceFocus">
32
- <option value="">{#not_set}</option>
33
- <option value="center">{#table_dlg.align_middle}</option>
34
- <option value="left">{#table_dlg.align_left}</option>
35
- <option value="right">{#table_dlg.align_right}</option>
36
- </select>
37
- </td>
38
-
39
- <td><label for="celltype">{#table_dlg.cell_type}</label></td>
40
- <td>
41
- <select id="celltype" name="celltype">
42
- <option value="td">{#table_dlg.td}</option>
43
- <option value="th">{#table_dlg.th}</option>
44
- </select>
45
- </td>
46
- </tr>
47
-
48
- <tr>
49
- <td><label for="valign">{#table_dlg.valign}</label></td>
50
- <td>
51
- <select id="valign" name="valign">
52
- <option value="">{#not_set}</option>
53
- <option value="top">{#table_dlg.align_top}</option>
54
- <option value="middle">{#table_dlg.align_middle}</option>
55
- <option value="bottom">{#table_dlg.align_bottom}</option>
56
- </select>
57
- </td>
58
-
59
- <td><label for="scope">{#table_dlg.scope}</label></td>
60
- <td>
61
- <select id="scope" name="scope">
62
- <option value="">{#not_set}</option>
63
- <option value="col">{#table.col}</option>
64
- <option value="row">{#table.row}</option>
65
- <option value="rowgroup">{#table_dlg.rowgroup}</option>
66
- <option value="colgroup">{#table_dlg.colgroup}</option>
67
- </select>
68
- </td>
69
-
70
- </tr>
71
-
72
- <tr>
73
- <td><label for="width">{#table_dlg.width}</label></td>
74
- <td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
75
-
76
- <td><label for="height">{#table_dlg.height}</label></td>
77
- <td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
78
- </tr>
79
-
80
- <tr id="styleSelectRow">
81
- <td><label for="class">{#class_name}</label></td>
82
- <td colspan="3">
83
- <select id="class" name="class" class="mceEditableSelect">
84
- <option value="" selected="selected">{#not_set}</option>
85
- </select>
86
- </td>
87
- </tr>
88
- </table>
89
- </fieldset>
90
- </div>
91
-
92
- <div id="advanced_panel" class="panel">
93
- <fieldset>
94
- <legend>{#table_dlg.advanced_props}</legend>
95
-
96
- <table border="0" cellpadding="0" cellspacing="4">
97
- <tr>
98
- <td class="column1"><label for="id">{#table_dlg.id}</label></td>
99
- <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
100
- </tr>
101
-
102
- <tr>
103
- <td><label for="style">{#table_dlg.style}</label></td>
104
- <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
105
- </tr>
106
-
107
- <tr>
108
- <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
109
- <td>
110
- <select id="dir" name="dir" style="width: 200px">
111
- <option value="">{#not_set}</option>
112
- <option value="ltr">{#table_dlg.ltr}</option>
113
- <option value="rtl">{#table_dlg.rtl}</option>
114
- </select>
115
- </td>
116
- </tr>
117
-
118
- <tr>
119
- <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
120
- <td>
121
- <input id="lang" name="lang" type="text" value="" style="width: 200px" />
122
- </td>
123
- </tr>
124
-
125
- <tr>
126
- <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
127
- <td>
128
- <table border="0" cellpadding="0" cellspacing="0">
129
- <tr>
130
- <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
131
- <td id="backgroundimagebrowsercontainer">&nbsp;</td>
132
- </tr>
133
- </table>
134
- </td>
135
- </tr>
136
-
137
- <tr>
138
- <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td>
139
- <td>
140
- <table border="0" cellpadding="0" cellspacing="0">
141
- <tr>
142
- <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
143
- <td id="bordercolor_pickcontainer">&nbsp;</td>
144
- </tr>
145
- </table>
146
- </td>
147
- </tr>
148
-
149
- <tr>
150
- <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
151
- <td>
152
- <table border="0" cellpadding="0" cellspacing="0">
153
- <tr>
154
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
155
- <td id="bgcolor_pickcontainer">&nbsp;</td>
156
- </tr>
157
- </table>
158
- </td>
159
- </tr>
160
- </table>
161
- </fieldset>
162
- </div>
163
- </div>
164
-
165
- <div class="mceActionPanel">
166
- <div>
167
- <select id="action" name="action">
168
- <option value="cell">{#table_dlg.cell_cell}</option>
169
- <option value="row">{#table_dlg.cell_row}</option>
170
- <option value="all">{#table_dlg.cell_all}</option>
171
- </select>
172
- </div>
173
-
174
- <div style="float: left">
175
- <div><input type="submit" id="insert" name="insert" value="{#update}" /></div>
176
- </div>
177
-
178
- <div style="float: right">
179
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
180
- </div>
181
- </div>
182
- </form>
183
- </body>
184
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#table_dlg.cell_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
9
+ <script type="text/javascript" src="js/cell.js?ver=311"></script>
10
+ <link href="css/cell.css?ver=311" rel="stylesheet" type="text/css" />
11
+ <base target="_self" />
12
+ </head>
13
+ <body id="tablecell" style="display: none">
14
+ <form onsubmit="updateAction();return false;" action="#">
15
+ <div class="tabs">
16
+ <ul>
17
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
18
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
19
+ </ul>
20
+ </div>
21
+
22
+ <div class="panel_wrapper">
23
+ <div id="general_panel" class="panel current">
24
+ <fieldset>
25
+ <legend>{#table_dlg.general_props}</legend>
26
+
27
+ <table border="0" cellpadding="4" cellspacing="0">
28
+ <tr>
29
+ <td><label for="align">{#table_dlg.align}</label></td>
30
+ <td>
31
+ <select id="align" name="align" class="mceFocus">
32
+ <option value="">{#not_set}</option>
33
+ <option value="center">{#table_dlg.align_middle}</option>
34
+ <option value="left">{#table_dlg.align_left}</option>
35
+ <option value="right">{#table_dlg.align_right}</option>
36
+ </select>
37
+ </td>
38
+
39
+ <td><label for="celltype">{#table_dlg.cell_type}</label></td>
40
+ <td>
41
+ <select id="celltype" name="celltype">
42
+ <option value="td">{#table_dlg.td}</option>
43
+ <option value="th">{#table_dlg.th}</option>
44
+ </select>
45
+ </td>
46
+ </tr>
47
+
48
+ <tr>
49
+ <td><label for="valign">{#table_dlg.valign}</label></td>
50
+ <td>
51
+ <select id="valign" name="valign">
52
+ <option value="">{#not_set}</option>
53
+ <option value="top">{#table_dlg.align_top}</option>
54
+ <option value="middle">{#table_dlg.align_middle}</option>
55
+ <option value="bottom">{#table_dlg.align_bottom}</option>
56
+ </select>
57
+ </td>
58
+
59
+ <td><label for="scope">{#table_dlg.scope}</label></td>
60
+ <td>
61
+ <select id="scope" name="scope">
62
+ <option value="">{#not_set}</option>
63
+ <option value="col">{#table.col}</option>
64
+ <option value="row">{#table.row}</option>
65
+ <option value="rowgroup">{#table_dlg.rowgroup}</option>
66
+ <option value="colgroup">{#table_dlg.colgroup}</option>
67
+ </select>
68
+ </td>
69
+
70
+ </tr>
71
+
72
+ <tr>
73
+ <td><label for="width">{#table_dlg.width}</label></td>
74
+ <td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
75
+
76
+ <td><label for="height">{#table_dlg.height}</label></td>
77
+ <td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
78
+ </tr>
79
+
80
+ <tr id="styleSelectRow">
81
+ <td><label for="class">{#class_name}</label></td>
82
+ <td colspan="3">
83
+ <select id="class" name="class" class="mceEditableSelect">
84
+ <option value="" selected="selected">{#not_set}</option>
85
+ </select>
86
+ </td>
87
+ </tr>
88
+ </table>
89
+ </fieldset>
90
+ </div>
91
+
92
+ <div id="advanced_panel" class="panel">
93
+ <fieldset>
94
+ <legend>{#table_dlg.advanced_props}</legend>
95
+
96
+ <table border="0" cellpadding="0" cellspacing="4">
97
+ <tr>
98
+ <td class="column1"><label for="id">{#table_dlg.id}</label></td>
99
+ <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td><label for="style">{#table_dlg.style}</label></td>
104
+ <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
109
+ <td>
110
+ <select id="dir" name="dir" style="width: 200px">
111
+ <option value="">{#not_set}</option>
112
+ <option value="ltr">{#table_dlg.ltr}</option>
113
+ <option value="rtl">{#table_dlg.rtl}</option>
114
+ </select>
115
+ </td>
116
+ </tr>
117
+
118
+ <tr>
119
+ <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
120
+ <td>
121
+ <input id="lang" name="lang" type="text" value="" style="width: 200px" />
122
+ </td>
123
+ </tr>
124
+
125
+ <tr>
126
+ <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
127
+ <td>
128
+ <table border="0" cellpadding="0" cellspacing="0">
129
+ <tr>
130
+ <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
131
+ <td id="backgroundimagebrowsercontainer">&nbsp;</td>
132
+ </tr>
133
+ </table>
134
+ </td>
135
+ </tr>
136
+
137
+ <tr>
138
+ <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td>
139
+ <td>
140
+ <table border="0" cellpadding="0" cellspacing="0">
141
+ <tr>
142
+ <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
143
+ <td id="bordercolor_pickcontainer">&nbsp;</td>
144
+ </tr>
145
+ </table>
146
+ </td>
147
+ </tr>
148
+
149
+ <tr>
150
+ <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
151
+ <td>
152
+ <table border="0" cellpadding="0" cellspacing="0">
153
+ <tr>
154
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
155
+ <td id="bgcolor_pickcontainer">&nbsp;</td>
156
+ </tr>
157
+ </table>
158
+ </td>
159
+ </tr>
160
+ </table>
161
+ </fieldset>
162
+ </div>
163
+ </div>
164
+
165
+ <div class="mceActionPanel">
166
+ <div>
167
+ <select id="action" name="action">
168
+ <option value="cell">{#table_dlg.cell_cell}</option>
169
+ <option value="row">{#table_dlg.cell_row}</option>
170
+ <option value="all">{#table_dlg.cell_all}</option>
171
+ </select>
172
+ </div>
173
+
174
+ <div style="float: left">
175
+ <div><input type="submit" id="insert" name="insert" value="{#update}" /></div>
176
+ </div>
177
+
178
+ <div style="float: right">
179
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
180
+ </div>
181
+ </div>
182
+ </form>
183
+ </body>
184
+ </html>
mce/table/css/cell.css CHANGED
@@ -1,17 +1,17 @@
1
- /* CSS file for cell dialog in the table plugin */
2
-
3
- .panel_wrapper div.current {
4
- height: 200px;
5
- }
6
-
7
- .advfield {
8
- width: 200px;
9
- }
10
-
11
- #action {
12
- margin-bottom: 3px;
13
- }
14
-
15
- #class {
16
- width: 150px;
17
  }
1
+ /* CSS file for cell dialog in the table plugin */
2
+
3
+ .panel_wrapper div.current {
4
+ height: 200px;
5
+ }
6
+
7
+ .advfield {
8
+ width: 200px;
9
+ }
10
+
11
+ #action {
12
+ margin-bottom: 3px;
13
+ }
14
+
15
+ #class {
16
+ width: 150px;
17
  }
mce/table/css/row.css CHANGED
@@ -1,25 +1,25 @@
1
- /* CSS file for row dialog in the table plugin */
2
-
3
- .panel_wrapper div.current {
4
- height: 200px;
5
- }
6
-
7
- .advfield {
8
- width: 200px;
9
- }
10
-
11
- #action {
12
- margin-bottom: 3px;
13
- }
14
-
15
- #rowtype,#align,#valign,#class,#height {
16
- width: 150px;
17
- }
18
-
19
- #height {
20
- width: 50px;
21
- }
22
-
23
- .col2 {
24
- padding-left: 20px;
25
- }
1
+ /* CSS file for row dialog in the table plugin */
2
+
3
+ .panel_wrapper div.current {
4
+ height: 200px;
5
+ }
6
+
7
+ .advfield {
8
+ width: 200px;
9
+ }
10
+
11
+ #action {
12
+ margin-bottom: 3px;
13
+ }
14
+
15
+ #rowtype,#align,#valign,#class,#height {
16
+ width: 150px;
17
+ }
18
+
19
+ #height {
20
+ width: 50px;
21
+ }
22
+
23
+ .col2 {
24
+ padding-left: 20px;
25
+ }
mce/table/css/table.css CHANGED
@@ -1,13 +1,13 @@
1
- /* CSS file for table dialog in the table plugin */
2
-
3
- .panel_wrapper div.current {
4
- height: 245px;
5
- }
6
-
7
- .advfield {
8
- width: 200px;
9
- }
10
-
11
- #class {
12
- width: 150px;
13
- }
1
+ /* CSS file for table dialog in the table plugin */
2
+
3
+ .panel_wrapper div.current {
4
+ height: 245px;
5
+ }
6
+
7
+ .advfield {
8
+ width: 200px;
9
+ }
10
+
11
+ #class {
12
+ width: 150px;
13
+ }
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});});}});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);})();
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')){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(ed.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(e);}ed.undoManager.add();}});if(!tinymce.isIE){if(ed.getParam('table_selection',true)){ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='TABLE')ed.selection.select(e);});}}ed.onNodeChange.add(function(ed,cm,n){var p=ed.dom.getParent(n,'td,th,caption');cm.setActive('table',n.nodeName==='TABLE'||!!p);if(p&&p.nodeName==='CAPTION')p=null;cm.setDisabled('delete_table',!p);cm.setDisabled('delete_col',!p);cm.setDisabled('delete_table',!p);cm.setDisabled('delete_row',!p);cm.setDisabled('col_after',!p);cm.setDisabled('col_before',!p);cm.setDisabled('row_after',!p);cm.setDisabled('row_before',!p);cm.setDisabled('row_props',!p);cm.setDisabled('cell_props',!p);cm.setDisabled('split_cells',!p||(parseInt(ed.dom.getAttrib(p,'colspan','1'))<2&&parseInt(ed.dom.getAttrib(p,'rowspan','1'))<2));cm.setDisabled('merge_cells',!p);});if(!tinymce.isIE){ed.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?'<$1$2>&nbsp;</$1>':'<$1$2><br mce_bogus="1" /></$1>');});}},execCommand:function(cmd,ui,val){var ed=this.editor,b;switch(cmd){case"mceTableMoveToNextRow":case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":ed.execCommand('mceBeginUndoLevel');this._doExecCommand(cmd,ui,val);ed.execCommand('mceEndUndoLevel');return true;}return false;},getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_doExecCommand:function(command,user_interface,value){var inst=this.editor,ed=inst,url=this.url;var focusElm=inst.selection.getNode();var trElm=inst.dom.getParent(focusElm,"tr");var tdElm=inst.dom.getParent(focusElm,"td,th");var tableElm=inst.dom.getParent(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function select(dx,dy){var td;grid=getTableGrid(tableElm);dx=dx||0;dy=dy||0;dx=Math.max(cpos.cellindex+dx,0);dy=Math.max(cpos.rowindex+dy,0);inst.execCommand('mceRepaint');td=getCell(grid,dy,dx);if(td){inst.selection.select(td.firstChild||td);inst.selection.collapse(1);}};function makeTD(){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}function getColRowSpan(td){var colspan=inst.dom.getAttrib(td,"colspan");var rowspan=inst.dom.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){var x,y;for(y=0;y<grid.length;y++){for(x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y};}}return null;}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null;}function getNextCell(table,cell){var cells=[],x=0,i,j,cell,nextCell;for(i=0;i<table.rows.length;i++)for(j=0;j<table.rows[i].cells.length;j++,x++)cells[x]=table.rows[i].cells[j];for(i=0;i<cells.length;i++)if(cells[i]==cell)if(nextCell=cells[i+1])return nextCell;}function getTableGrid(table){var grid=[],rows=table.rows,x,y,td,sd,xstart,x2,y2;for(y=0;y<rows.length;y++){for(x=0;x<rows[y].cells.length;x++){td=rows[y].cells[x];sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=[];for(x2=xstart;x2<xstart+sd['colspan'];x2++)grid[y2][x2]=td;}}}return grid;}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table),cpos=getCellPos(grid,td);var cells,lastElm;if(new_tr.cells.length!=tr.childNodes.length){cells=tr.childNodes;lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true;}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true;}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node;}}return null;}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue;}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';if(tinymce.isIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=inst.dom.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break;}}}if(newTD==null){newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableMoveToNextRow":var nextCell=getNextCell(tableElm,tdElm);if(!nextCell){inst.execCommand("mceTableInsertRowAfter",tdElm);nextCell=getNextCell(tableElm,tdElm);}inst.selection.select(nextCell);inst.selection.collapse(true);return true;case"mceTableRowProps":if(trElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/row.htm',width:400+parseInt(inst.getLang('table.rowprops_delta_width',0)),height:295+parseInt(inst.getLang('table.rowprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/cell.htm',width:400+parseInt(inst.getLang('table.cellprops_delta_width',0)),height:295+parseInt(inst.getLang('table.cellprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceInsertTable":if(user_interface){inst.windowManager.open({url:url+'/table.htm',width:400+parseInt(inst.getLang('table.table_delta_width',0)),height:320+parseInt(inst.getLang('table.table_delta_height',0)),inline:1},{plugin_url:url,action:value?value.action:0});}return true;case"mceTableDelete":var table=inst.dom.getParent(inst.selection.getNode(),"table");if(table){table.parentNode.removeChild(table);inst.execCommand('mceRepaint');}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);select(0,1);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}select(0,1);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);select(0,-1);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(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)&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}select(-1);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");break;case"mceTableMergeCells":var rows=[];var sel=inst.selection.getSel();var grid=getTableGrid(tableElm);if(tinymce.isIE||sel.rangeCount==1){if(user_interface){var sp=getColRowSpan(tdElm);inst.windowManager.open({url:url+'/merge_cells.htm',width:240+parseInt(inst.getLang('table.merge_cells_delta_width',0)),height:110+parseInt(inst.getLang('table.merge_cells_delta_height',0)),inline:1},{action:"update",numcols:sp.colspan,numrows:sp.rowspan,plugin_url:url});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=[];for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td;}}if(rowCells.length>0)rows[rows.length]=rowCells;var td=getCell(grid,cpos.rowindex,cpos.cellindex);each(ed.dom.select('br',td),function(e,i){if(i>0&&ed.dom.getAttrib('mce_bogus'))ed.dom.remove(e);});}}}else{var cells=[];var sel=inst.selection.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD"||tdElm.nodeName=="TH")cells[cells.length]=tdElm;}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=[];for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td;}}}if(rowCells.length>0)rows[rows.length]=rowCells;}var curRow=[];var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y;}x2=x;y2=y;grid[y][x]._selected=true;}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true;}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true;}lastRowSpan=sd['rowspan'];}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true;}lastColSpan=sd['colspan'];}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=html.replace(/[ \t\r\n]/g,"");if(chk!="<br/>"&&chk!="<br>"&&chk!='<br mce_bogus="1"/>'&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}each(ed.dom.select('br',tdElm),function(e,i){if(i>0&&ed.dom.getAttrib(e,'mce_bogus'))ed.dom.remove(e);});break;}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");inst.addVisual(tableElm);inst.nodeChanged();}return true;}return false;}});tinymce.PluginManager.add('table',tinymce.plugins.TablePlugin);})();
mce/table/js/cell.js CHANGED
@@ -1,259 +1,259 @@
1
- tinyMCEPopup.requireLangPack();
2
-
3
- var ed;
4
-
5
- function init() {
6
- ed = tinyMCEPopup.editor;
7
- tinyMCEPopup.resizeToInnerSize();
8
-
9
- document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
10
- document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
11
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
12
-
13
- var inst = ed;
14
- var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th");
15
- var formObj = document.forms[0];
16
- var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));
17
-
18
- // Get table cell data
19
- var celltype = tdElm.nodeName.toLowerCase();
20
- var align = ed.dom.getAttrib(tdElm, 'align');
21
- var valign = ed.dom.getAttrib(tdElm, 'valign');
22
- var width = trimSize(getStyle(tdElm, 'width', 'width'));
23
- var height = trimSize(getStyle(tdElm, 'height', 'height'));
24
- var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
25
- var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
26
- var className = ed.dom.getAttrib(tdElm, 'class');
27
- var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
28
- var id = ed.dom.getAttrib(tdElm, 'id');
29
- var lang = ed.dom.getAttrib(tdElm, 'lang');
30
- var dir = ed.dom.getAttrib(tdElm, 'dir');
31
- var scope = ed.dom.getAttrib(tdElm, 'scope');
32
-
33
- // Setup form
34
- addClassesToList('class', 'table_cell_styles');
35
- TinyMCE_EditableSelects.init();
36
-
37
- formObj.bordercolor.value = bordercolor;
38
- formObj.bgcolor.value = bgcolor;
39
- formObj.backgroundimage.value = backgroundimage;
40
- formObj.width.value = width;
41
- formObj.height.value = height;
42
- formObj.id.value = id;
43
- formObj.lang.value = lang;
44
- formObj.style.value = ed.dom.serializeStyle(st);
45
- selectByValue(formObj, 'align', align);
46
- selectByValue(formObj, 'valign', valign);
47
- selectByValue(formObj, 'class', className, true, true);
48
- selectByValue(formObj, 'celltype', celltype);
49
- selectByValue(formObj, 'dir', dir);
50
- selectByValue(formObj, 'scope', scope);
51
-
52
- // Resize some elements
53
- if (isVisible('backgroundimagebrowser'))
54
- document.getElementById('backgroundimage').style.width = '180px';
55
-
56
- updateColor('bordercolor_pick', 'bordercolor');
57
- updateColor('bgcolor_pick', 'bgcolor');
58
- }
59
-
60
- function updateAction() {
61
- var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
62
-
63
- tinyMCEPopup.restoreSelection();
64
- el = ed.selection.getNode();
65
- tdElm = ed.dom.getParent(el, "td,th");
66
- trElm = ed.dom.getParent(el, "tr");
67
- tableElm = ed.dom.getParent(el, "table");
68
-
69
- ed.execCommand('mceBeginUndoLevel');
70
-
71
- switch (getSelectValue(formObj, 'action')) {
72
- case "cell":
73
- var celltype = getSelectValue(formObj, 'celltype');
74
- var scope = getSelectValue(formObj, 'scope');
75
-
76
- if (ed.getParam("accessibility_warnings")) {
77
- if (celltype == "th" && scope == "")
78
- var answer = confirm(ed.getLang('table_dlg.missing_scope', '', true));
79
- else
80
- var answer = true;
81
-
82
- if (!answer)
83
- return;
84
- }
85
-
86
- updateCell(tdElm);
87
- break;
88
-
89
- case "row":
90
- var cell = trElm.firstChild;
91
-
92
- if (cell.nodeName != "TD" && cell.nodeName != "TH")
93
- cell = nextCell(cell);
94
-
95
- do {
96
- cell = updateCell(cell, true);
97
- } while ((cell = nextCell(cell)) != null);
98
-
99
- break;
100
-
101
- case "all":
102
- var rows = tableElm.getElementsByTagName("tr");
103
-
104
- for (var i=0; i<rows.length; i++) {
105
- var cell = rows[i].firstChild;
106
-
107
- if (cell.nodeName != "TD" && cell.nodeName != "TH")
108
- cell = nextCell(cell);
109
-
110
- do {
111
- cell = updateCell(cell, true);
112
- } while ((cell = nextCell(cell)) != null);
113
- }
114
-
115
- break;
116
- }
117
-
118
- ed.addVisual();
119
- ed.nodeChanged();
120
- inst.execCommand('mceEndUndoLevel');
121
- tinyMCEPopup.close();
122
- }
123
-
124
- function nextCell(elm) {
125
- while ((elm = elm.nextSibling) != null) {
126
- if (elm.nodeName == "TD" || elm.nodeName == "TH")
127
- return elm;
128
- }
129
-
130
- return null;
131
- }
132
-
133
- function updateCell(td, skip_id) {
134
- var inst = ed;
135
- var formObj = document.forms[0];
136
- var curCellType = td.nodeName.toLowerCase();
137
- var celltype = getSelectValue(formObj, 'celltype');
138
- var doc = inst.getDoc();
139
- var dom = ed.dom;
140
-
141
- if (!skip_id)
142
- td.setAttribute('id', formObj.id.value);
143
-
144
- td.setAttribute('align', formObj.align.value);
145
- td.setAttribute('vAlign', formObj.valign.value);
146
- td.setAttribute('lang', formObj.lang.value);
147
- td.setAttribute('dir', getSelectValue(formObj, 'dir'));
148
- td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));
149
- td.setAttribute('scope', formObj.scope.value);
150
- ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
151
-
152
- // Clear deprecated attributes
153
- ed.dom.setAttrib(td, 'width', '');
154
- ed.dom.setAttrib(td, 'height', '');
155
- ed.dom.setAttrib(td, 'bgColor', '');
156
- ed.dom.setAttrib(td, 'borderColor', '');
157
- ed.dom.setAttrib(td, 'background', '');
158
-
159
- // Set styles
160
- td.style.width = getCSSSize(formObj.width.value);
161
- td.style.height = getCSSSize(formObj.height.value);
162
- if (formObj.bordercolor.value != "") {
163
- td.style.borderColor = formObj.bordercolor.value;
164
- td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
165
- td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
166
- } else
167
- td.style.borderColor = '';
168
-
169
- td.style.backgroundColor = formObj.bgcolor.value;
170
-
171
- if (formObj.backgroundimage.value != "")
172
- td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
173
- else
174
- td.style.backgroundImage = '';
175
-
176
- if (curCellType != celltype) {
177
- // changing to a different node type
178
- var newCell = doc.createElement(celltype);
179
-
180
- for (var c=0; c<td.childNodes.length; c++)
181
- newCell.appendChild(td.childNodes[c].cloneNode(1));
182
-
183
- for (var a=0; a<td.attributes.length; a++)
184
- ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name));
185
-
186
- td.parentNode.replaceChild(newCell, td);
187
- td = newCell;
188
- }
189
-
190
- dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText)));
191
-
192
- return td;
193
- }
194
-
195
- function changedBackgroundImage() {
196
- var formObj = document.forms[0];
197
- var st = ed.dom.parseStyle(formObj.style.value);
198
-
199
- st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
200
-
201
- formObj.style.value = ed.dom.serializeStyle(st);
202
- }
203
-
204
- function changedSize() {
205
- var formObj = document.forms[0];
206
- var st = ed.dom.parseStyle(formObj.style.value);
207
-
208
- var width = formObj.width.value;
209
- if (width != "")
210
- st['width'] = getCSSSize(width);
211
- else
212
- st['width'] = "";
213
-
214
- var height = formObj.height.value;
215
- if (height != "")
216
- st['height'] = getCSSSize(height);
217
- else
218
- st['height'] = "";
219
-
220
- formObj.style.value = ed.dom.serializeStyle(st);
221
- }
222
-
223
- function changedColor() {
224
- var formObj = document.forms[0];
225
- var st = ed.dom.parseStyle(formObj.style.value);
226
-
227
- st['background-color'] = formObj.bgcolor.value;
228
- st['border-color'] = formObj.bordercolor.value;
229
-
230
- formObj.style.value = ed.dom.serializeStyle(st);
231
- }
232
-
233
- function changedStyle() {
234
- var formObj = document.forms[0];
235
- var st = ed.dom.parseStyle(formObj.style.value);
236
-
237
- if (st['background-image'])
238
- formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
239
- else
240
- formObj.backgroundimage.value = '';
241
-
242
- if (st['width'])
243
- formObj.width.value = trimSize(st['width']);
244
-
245
- if (st['height'])
246
- formObj.height.value = trimSize(st['height']);
247
-
248
- if (st['background-color']) {
249
- formObj.bgcolor.value = st['background-color'];
250
- updateColor('bgcolor_pick','bgcolor');
251
- }
252
-
253
- if (st['border-color']) {
254
- formObj.bordercolor.value = st['border-color'];
255
- updateColor('bordercolor_pick','bordercolor');
256
- }
257
- }
258
-
259
- tinyMCEPopup.onInit.add(init);
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var ed;
4
+
5
+ function init() {
6
+ ed = tinyMCEPopup.editor;
7
+ tinyMCEPopup.resizeToInnerSize();
8
+
9
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
10
+ document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
11
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
12
+
13
+ var inst = ed;
14
+ var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th");
15
+ var formObj = document.forms[0];
16
+ var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));
17
+
18
+ // Get table cell data
19
+ var celltype = tdElm.nodeName.toLowerCase();
20
+ var align = ed.dom.getAttrib(tdElm, 'align');
21
+ var valign = ed.dom.getAttrib(tdElm, 'valign');
22
+ var width = trimSize(getStyle(tdElm, 'width', 'width'));
23
+ var height = trimSize(getStyle(tdElm, 'height', 'height'));
24
+ var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
25
+ var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
26
+ var className = ed.dom.getAttrib(tdElm, 'class');
27
+ var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
28
+ var id = ed.dom.getAttrib(tdElm, 'id');
29
+ var lang = ed.dom.getAttrib(tdElm, 'lang');
30
+ var dir = ed.dom.getAttrib(tdElm, 'dir');
31
+ var scope = ed.dom.getAttrib(tdElm, 'scope');
32
+
33
+ // Setup form
34
+ addClassesToList('class', 'table_cell_styles');
35
+ TinyMCE_EditableSelects.init();
36
+
37
+ formObj.bordercolor.value = bordercolor;
38
+ formObj.bgcolor.value = bgcolor;
39
+ formObj.backgroundimage.value = backgroundimage;
40
+ formObj.width.value = width;
41
+ formObj.height.value = height;
42
+ formObj.id.value = id;
43
+ formObj.lang.value = lang;
44
+ formObj.style.value = ed.dom.serializeStyle(st);
45
+ selectByValue(formObj, 'align', align);
46
+ selectByValue(formObj, 'valign', valign);
47
+ selectByValue(formObj, 'class', className, true, true);
48
+ selectByValue(formObj, 'celltype', celltype);
49
+ selectByValue(formObj, 'dir', dir);
50
+ selectByValue(formObj, 'scope', scope);
51
+
52
+ // Resize some elements
53
+ if (isVisible('backgroundimagebrowser'))
54
+ document.getElementById('backgroundimage').style.width = '180px';
55
+
56
+ updateColor('bordercolor_pick', 'bordercolor');
57
+ updateColor('bgcolor_pick', 'bgcolor');
58
+ }
59
+
60
+ function updateAction() {
61
+ var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
62
+
63
+ tinyMCEPopup.restoreSelection();
64
+ el = ed.selection.getNode();
65
+ tdElm = ed.dom.getParent(el, "td,th");
66
+ trElm = ed.dom.getParent(el, "tr");
67
+ tableElm = ed.dom.getParent(el, "table");
68
+
69
+ ed.execCommand('mceBeginUndoLevel');
70
+
71
+ switch (getSelectValue(formObj, 'action')) {
72
+ case "cell":
73
+ var celltype = getSelectValue(formObj, 'celltype');
74
+ var scope = getSelectValue(formObj, 'scope');
75
+
76
+ if (ed.getParam("accessibility_warnings")) {
77
+ if (celltype == "th" && scope == "")
78
+ var answer = confirm(ed.getLang('table_dlg.missing_scope', '', true));
79
+ else
80
+ var answer = true;
81
+
82
+ if (!answer)
83
+ return;
84
+ }
85
+
86
+ updateCell(tdElm);
87
+ break;
88
+
89
+ case "row":
90
+ var cell = trElm.firstChild;
91
+
92
+ if (cell.nodeName != "TD" && cell.nodeName != "TH")
93
+ cell = nextCell(cell);
94
+
95
+ do {
96
+ cell = updateCell(cell, true);
97
+ } while ((cell = nextCell(cell)) != null);
98
+
99
+ break;
100
+
101
+ case "all":
102
+ var rows = tableElm.getElementsByTagName("tr");
103
+
104
+ for (var i=0; i<rows.length; i++) {
105
+ var cell = rows[i].firstChild;
106
+
107
+ if (cell.nodeName != "TD" && cell.nodeName != "TH")
108
+ cell = nextCell(cell);
109
+
110
+ do {
111
+ cell = updateCell(cell, true);
112
+ } while ((cell = nextCell(cell)) != null);
113
+ }
114
+
115
+ break;
116
+ }
117
+
118
+ ed.addVisual();
119
+ ed.nodeChanged();
120
+ inst.execCommand('mceEndUndoLevel');
121
+ tinyMCEPopup.close();
122
+ }
123
+
124
+ function nextCell(elm) {
125
+ while ((elm = elm.nextSibling) != null) {
126
+ if (elm.nodeName == "TD" || elm.nodeName == "TH")
127
+ return elm;
128
+ }
129
+
130
+ return null;
131
+ }
132
+
133
+ function updateCell(td, skip_id) {
134
+ var inst = ed;
135
+ var formObj = document.forms[0];
136
+ var curCellType = td.nodeName.toLowerCase();
137
+ var celltype = getSelectValue(formObj, 'celltype');
138
+ var doc = inst.getDoc();
139
+ var dom = ed.dom;
140
+
141
+ if (!skip_id)
142
+ td.setAttribute('id', formObj.id.value);
143
+
144
+ td.setAttribute('align', formObj.align.value);
145
+ td.setAttribute('vAlign', formObj.valign.value);
146
+ td.setAttribute('lang', formObj.lang.value);
147
+ td.setAttribute('dir', getSelectValue(formObj, 'dir'));
148
+ td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));
149
+ td.setAttribute('scope', formObj.scope.value);
150
+ ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
151
+
152
+ // Clear deprecated attributes
153
+ ed.dom.setAttrib(td, 'width', '');
154
+ ed.dom.setAttrib(td, 'height', '');
155
+ ed.dom.setAttrib(td, 'bgColor', '');
156
+ ed.dom.setAttrib(td, 'borderColor', '');
157
+ ed.dom.setAttrib(td, 'background', '');
158
+
159
+ // Set styles
160
+ td.style.width = getCSSSize(formObj.width.value);
161
+ td.style.height = getCSSSize(formObj.height.value);
162
+ if (formObj.bordercolor.value != "") {
163
+ td.style.borderColor = formObj.bordercolor.value;
164
+ td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
165
+ td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
166
+ } else
167
+ td.style.borderColor = '';
168
+
169
+ td.style.backgroundColor = formObj.bgcolor.value;
170
+
171
+ if (formObj.backgroundimage.value != "")
172
+ td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
173
+ else
174
+ td.style.backgroundImage = '';
175
+
176
+ if (curCellType != celltype) {
177
+ // changing to a different node type
178
+ var newCell = doc.createElement(celltype);
179
+
180
+ for (var c=0; c<td.childNodes.length; c++)
181
+ newCell.appendChild(td.childNodes[c].cloneNode(1));
182
+
183
+ for (var a=0; a<td.attributes.length; a++)
184
+ ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name));
185
+
186
+ td.parentNode.replaceChild(newCell, td);
187
+ td = newCell;
188
+ }
189
+
190
+ dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText)));
191
+
192
+ return td;
193
+ }
194
+
195
+ function changedBackgroundImage() {
196
+ var formObj = document.forms[0];
197
+ var st = ed.dom.parseStyle(formObj.style.value);
198
+
199
+ st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
200
+
201
+ formObj.style.value = ed.dom.serializeStyle(st);
202
+ }
203
+
204
+ function changedSize() {
205
+ var formObj = document.forms[0];
206
+ var st = ed.dom.parseStyle(formObj.style.value);
207
+
208
+ var width = formObj.width.value;
209
+ if (width != "")
210
+ st['width'] = getCSSSize(width);
211
+ else
212
+ st['width'] = "";
213
+
214
+ var height = formObj.height.value;
215
+ if (height != "")
216
+ st['height'] = getCSSSize(height);
217
+ else
218
+ st['height'] = "";
219
+
220
+ formObj.style.value = ed.dom.serializeStyle(st);
221
+ }
222
+
223
+ function changedColor() {
224
+ var formObj = document.forms[0];
225
+ var st = ed.dom.parseStyle(formObj.style.value);
226
+
227
+ st['background-color'] = formObj.bgcolor.value;
228
+ st['border-color'] = formObj.bordercolor.value;
229
+
230
+ formObj.style.value = ed.dom.serializeStyle(st);
231
+ }
232
+
233
+ function changedStyle() {
234
+ var formObj = document.forms[0];
235
+ var st = ed.dom.parseStyle(formObj.style.value);
236
+
237
+ if (st['background-image'])
238
+ formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
239
+ else
240
+ formObj.backgroundimage.value = '';
241
+
242
+ if (st['width'])
243
+ formObj.width.value = trimSize(st['width']);
244
+
245
+ if (st['height'])
246
+ formObj.height.value = trimSize(st['height']);
247
+
248
+ if (st['background-color']) {
249
+ formObj.bgcolor.value = st['background-color'];
250
+ updateColor('bgcolor_pick','bgcolor');
251
+ }
252
+
253
+ if (st['border-color']) {
254
+ formObj.bordercolor.value = st['border-color'];
255
+ updateColor('bordercolor_pick','bordercolor');
256
+ }
257
+ }
258
+
259
+ tinyMCEPopup.onInit.add(init);
mce/table/js/merge_cells.js CHANGED
@@ -1,29 +1,29 @@
1
- tinyMCEPopup.requireLangPack();
2
-
3
- function init() {
4
- var f = document.forms[0], v;
5
-
6
- tinyMCEPopup.resizeToInnerSize();
7
-
8
- f.numcols.value = tinyMCEPopup.getWindowArg('numcols', 1);
9
- f.numrows.value = tinyMCEPopup.getWindowArg('numcols', 1);
10
- }
11
-
12
- function mergeCells() {
13
- var args = [], f = document.forms[0];
14
-
15
- tinyMCEPopup.restoreSelection();
16
-
17
- if (!AutoValidator.validate(f)) {
18
- alert(tinyMCEPopup.getLang('invalid_data'));
19
- return false;
20
- }
21
-
22
- args["numcols"] = f.numcols.value;
23
- args["numrows"] = f.numrows.value;
24
-
25
- tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
26
- tinyMCEPopup.close();
27
- }
28
-
29
- tinyMCEPopup.onInit.add(init);
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ function init() {
4
+ var f = document.forms[0], v;
5
+
6
+ tinyMCEPopup.resizeToInnerSize();
7
+
8
+ f.numcols.value = tinyMCEPopup.getWindowArg('numcols', 1);
9
+ f.numrows.value = tinyMCEPopup.getWindowArg('numrows', 1);
10
+ }
11
+
12
+ function mergeCells() {
13
+ var args = [], f = document.forms[0];
14
+
15
+ tinyMCEPopup.restoreSelection();
16
+
17
+ if (!AutoValidator.validate(f)) {
18
+ alert(tinyMCEPopup.getLang('invalid_data'));
19
+ return false;
20
+ }
21
+
22
+ args["numcols"] = f.numcols.value;
23
+ args["numrows"] = f.numrows.value;
24
+
25
+ tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
26
+ tinyMCEPopup.close();
27
+ }
28
+
29
+ tinyMCEPopup.onInit.add(init);
mce/table/js/row.js CHANGED
@@ -1,212 +1,212 @@
1
- tinyMCEPopup.requireLangPack();
2
-
3
- function init() {
4
- tinyMCEPopup.resizeToInnerSize();
5
-
6
- document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
7
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
8
-
9
- var inst = tinyMCEPopup.editor;
10
- var dom = inst.dom;
11
- var trElm = dom.getParent(inst.selection.getNode(), "tr");
12
- var formObj = document.forms[0];
13
- var st = dom.parseStyle(dom.getAttrib(trElm, "style"));
14
-
15
- // Get table row data
16
- var rowtype = trElm.parentNode.nodeName.toLowerCase();
17
- var align = dom.getAttrib(trElm, 'align');
18
- var valign = dom.getAttrib(trElm, 'valign');
19
- var height = trimSize(getStyle(trElm, 'height', 'height'));
20
- var className = dom.getAttrib(trElm, 'class');
21
- var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
22
- var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
23
- var id = dom.getAttrib(trElm, 'id');
24
- var lang = dom.getAttrib(trElm, 'lang');
25
- var dir = dom.getAttrib(trElm, 'dir');
26
-
27
- // Setup form
28
- addClassesToList('class', 'table_row_styles');
29
- TinyMCE_EditableSelects.init();
30
-
31
- formObj.bgcolor.value = bgcolor;
32
- formObj.backgroundimage.value = backgroundimage;
33
- formObj.height.value = height;
34
- formObj.id.value = id;
35
- formObj.lang.value = lang;
36
- formObj.style.value = dom.serializeStyle(st);
37
- selectByValue(formObj, 'align', align);
38
- selectByValue(formObj, 'valign', valign);
39
- selectByValue(formObj, 'class', className, true, true);
40
- selectByValue(formObj, 'rowtype', rowtype);
41
- selectByValue(formObj, 'dir', dir);
42
-
43
- // Resize some elements
44
- if (isVisible('backgroundimagebrowser'))
45
- document.getElementById('backgroundimage').style.width = '180px';
46
-
47
- updateColor('bgcolor_pick', 'bgcolor');
48
- }
49
-
50
- function updateAction() {
51
- var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];
52
- var action = getSelectValue(formObj, 'action');
53
-
54
- tinyMCEPopup.restoreSelection();
55
- trElm = dom.getParent(inst.selection.getNode(), "tr");
56
- tableElm = dom.getParent(inst.selection.getNode(), "table");
57
-
58
- inst.execCommand('mceBeginUndoLevel');
59
-
60
- switch (action) {
61
- case "row":
62
- updateRow(trElm);
63
- break;
64
-
65
- case "all":
66
- var rows = tableElm.getElementsByTagName("tr");
67
-
68
- for (var i=0; i<rows.length; i++)
69
- updateRow(rows[i], true);
70
-
71
- break;
72
-
73
- case "odd":
74
- case "even":
75
- var rows = tableElm.getElementsByTagName("tr");
76
-
77
- for (var i=0; i<rows.length; i++) {
78
- if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
79
- updateRow(rows[i], true, true);
80
- }
81
-
82
- break;
83
- }
84
-
85
- inst.addVisual();
86
- inst.nodeChanged();
87
- inst.execCommand('mceEndUndoLevel');
88
- tinyMCEPopup.close();
89
- }
90
-
91
- function updateRow(tr_elm, skip_id, skip_parent) {
92
- var inst = tinyMCEPopup.editor;
93
- var formObj = document.forms[0];
94
- var dom = inst.dom;
95
- var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
96
- var rowtype = getSelectValue(formObj, 'rowtype');
97
- var doc = inst.getDoc();
98
-
99
- // Update row element
100
- if (!skip_id)
101
- tr_elm.setAttribute('id', formObj.id.value);
102
-
103
- tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
104
- tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
105
- tr_elm.setAttribute('lang', formObj.lang.value);
106
- tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
107
- tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));
108
- dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
109
-
110
- // Clear deprecated attributes
111
- tr_elm.setAttribute('background', '');
112
- tr_elm.setAttribute('bgColor', '');
113
- tr_elm.setAttribute('height', '');
114
-
115
- // Set styles
116
- tr_elm.style.height = getCSSSize(formObj.height.value);
117
- tr_elm.style.backgroundColor = formObj.bgcolor.value;
118
-
119
- if (formObj.backgroundimage.value != "")
120
- tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
121
- else
122
- tr_elm.style.backgroundImage = '';
123
-
124
- // Setup new rowtype
125
- if (curRowType != rowtype && !skip_parent) {
126
- // first, clone the node we are working on
127
- var newRow = tr_elm.cloneNode(1);
128
-
129
- // next, find the parent of its new destination (creating it if necessary)
130
- var theTable = dom.getParent(tr_elm, "table");
131
- var dest = rowtype;
132
- var newParent = null;
133
- for (var i = 0; i < theTable.childNodes.length; i++) {
134
- if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
135
- newParent = theTable.childNodes[i];
136
- }
137
-
138
- if (newParent == null) {
139
- newParent = doc.createElement(dest);
140
-
141
- if (dest == "thead") {
142
- if (theTable.firstChild.nodeName == 'CAPTION')
143
- inst.dom.insertAfter(newParent, theTable.firstChild);
144
- else
145
- theTable.insertBefore(newParent, theTable.firstChild);
146
- } else
147
- theTable.appendChild(newParent);
148
- }
149
-
150
- // append the row to the new parent
151
- newParent.appendChild(newRow);
152
-
153
- // remove the original
154
- tr_elm.parentNode.removeChild(tr_elm);
155
-
156
- // set tr_elm to the new node
157
- tr_elm = newRow;
158
- }
159
-
160
- dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));
161
- }
162
-
163
- function changedBackgroundImage() {
164
- var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
165
- var st = dom.parseStyle(formObj.style.value);
166
-
167
- st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
168
-
169
- formObj.style.value = dom.serializeStyle(st);
170
- }
171
-
172
- function changedStyle() {
173
- var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
174
- var st = dom.parseStyle(formObj.style.value);
175
-
176
- if (st['background-image'])
177
- formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
178
- else
179
- formObj.backgroundimage.value = '';
180
-
181
- if (st['height'])
182
- formObj.height.value = trimSize(st['height']);
183
-
184
- if (st['background-color']) {
185
- formObj.bgcolor.value = st['background-color'];
186
- updateColor('bgcolor_pick','bgcolor');
187
- }
188
- }
189
-
190
- function changedSize() {
191
- var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
192
- var st = dom.parseStyle(formObj.style.value);
193
-
194
- var height = formObj.height.value;
195
- if (height != "")
196
- st['height'] = getCSSSize(height);
197
- else
198
- st['height'] = "";
199
-
200
- formObj.style.value = dom.serializeStyle(st);
201
- }
202
-
203
- function changedColor() {
204
- var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
205
- var st = dom.parseStyle(formObj.style.value);
206
-
207
- st['background-color'] = formObj.bgcolor.value;
208
-
209
- formObj.style.value = dom.serializeStyle(st);
210
- }
211
-
212
- tinyMCEPopup.onInit.add(init);
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ function init() {
4
+ tinyMCEPopup.resizeToInnerSize();
5
+
6
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
7
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
8
+
9
+ var inst = tinyMCEPopup.editor;
10
+ var dom = inst.dom;
11
+ var trElm = dom.getParent(inst.selection.getNode(), "tr");
12
+ var formObj = document.forms[0];
13
+ var st = dom.parseStyle(dom.getAttrib(trElm, "style"));
14
+
15
+ // Get table row data
16
+ var rowtype = trElm.parentNode.nodeName.toLowerCase();
17
+ var align = dom.getAttrib(trElm, 'align');
18
+ var valign = dom.getAttrib(trElm, 'valign');
19
+ var height = trimSize(getStyle(trElm, 'height', 'height'));
20
+ var className = dom.getAttrib(trElm, 'class');
21
+ var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
22
+ var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
23
+ var id = dom.getAttrib(trElm, 'id');
24
+ var lang = dom.getAttrib(trElm, 'lang');
25
+ var dir = dom.getAttrib(trElm, 'dir');
26
+
27
+ // Setup form
28
+ addClassesToList('class', 'table_row_styles');
29
+ TinyMCE_EditableSelects.init();
30
+
31
+ formObj.bgcolor.value = bgcolor;
32
+ formObj.backgroundimage.value = backgroundimage;
33
+ formObj.height.value = height;
34
+ formObj.id.value = id;
35
+ formObj.lang.value = lang;
36
+ formObj.style.value = dom.serializeStyle(st);
37
+ selectByValue(formObj, 'align', align);
38
+ selectByValue(formObj, 'valign', valign);
39
+ selectByValue(formObj, 'class', className, true, true);
40
+ selectByValue(formObj, 'rowtype', rowtype);
41
+ selectByValue(formObj, 'dir', dir);
42
+
43
+ // Resize some elements
44
+ if (isVisible('backgroundimagebrowser'))
45
+ document.getElementById('backgroundimage').style.width = '180px';
46
+
47
+ updateColor('bgcolor_pick', 'bgcolor');
48
+ }
49
+
50
+ function updateAction() {
51
+ var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];
52
+ var action = getSelectValue(formObj, 'action');
53
+
54
+ tinyMCEPopup.restoreSelection();
55
+ trElm = dom.getParent(inst.selection.getNode(), "tr");
56
+ tableElm = dom.getParent(inst.selection.getNode(), "table");
57
+
58
+ inst.execCommand('mceBeginUndoLevel');
59
+
60
+ switch (action) {
61
+ case "row":
62
+ updateRow(trElm);
63
+ break;
64
+
65
+ case "all":
66
+ var rows = tableElm.getElementsByTagName("tr");
67
+
68
+ for (var i=0; i<rows.length; i++)
69
+ updateRow(rows[i], true);
70
+
71
+ break;
72
+
73
+ case "odd":
74
+ case "even":
75
+ var rows = tableElm.getElementsByTagName("tr");
76
+
77
+ for (var i=0; i<rows.length; i++) {
78
+ if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
79
+ updateRow(rows[i], true, true);
80
+ }
81
+
82
+ break;
83
+ }
84
+
85
+ inst.addVisual();
86
+ inst.nodeChanged();
87
+ inst.execCommand('mceEndUndoLevel');
88
+ tinyMCEPopup.close();
89
+ }
90
+
91
+ function updateRow(tr_elm, skip_id, skip_parent) {
92
+ var inst = tinyMCEPopup.editor;
93
+ var formObj = document.forms[0];
94
+ var dom = inst.dom;
95
+ var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
96
+ var rowtype = getSelectValue(formObj, 'rowtype');
97
+ var doc = inst.getDoc();
98
+
99
+ // Update row element
100
+ if (!skip_id)
101
+ tr_elm.setAttribute('id', formObj.id.value);
102
+
103
+ tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
104
+ tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
105
+ tr_elm.setAttribute('lang', formObj.lang.value);
106
+ tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
107
+ tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));
108
+ dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
109
+
110
+ // Clear deprecated attributes
111
+ tr_elm.setAttribute('background', '');
112
+ tr_elm.setAttribute('bgColor', '');
113
+ tr_elm.setAttribute('height', '');
114
+
115
+ // Set styles
116
+ tr_elm.style.height = getCSSSize(formObj.height.value);
117
+ tr_elm.style.backgroundColor = formObj.bgcolor.value;
118
+
119
+ if (formObj.backgroundimage.value != "")
120
+ tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
121
+ else
122
+ tr_elm.style.backgroundImage = '';
123
+
124
+ // Setup new rowtype
125
+ if (curRowType != rowtype && !skip_parent) {
126
+ // first, clone the node we are working on
127
+ var newRow = tr_elm.cloneNode(1);
128
+
129
+ // next, find the parent of its new destination (creating it if necessary)
130
+ var theTable = dom.getParent(tr_elm, "table");
131
+ var dest = rowtype;
132
+ var newParent = null;
133
+ for (var i = 0; i < theTable.childNodes.length; i++) {
134
+ if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
135
+ newParent = theTable.childNodes[i];
136
+ }
137
+
138
+ if (newParent == null) {
139
+ newParent = doc.createElement(dest);
140
+
141
+ if (dest == "thead") {
142
+ if (theTable.firstChild.nodeName == 'CAPTION')
143
+ inst.dom.insertAfter(newParent, theTable.firstChild);
144
+ else
145
+ theTable.insertBefore(newParent, theTable.firstChild);
146
+ } else
147
+ theTable.appendChild(newParent);
148
+ }
149
+
150
+ // append the row to the new parent
151
+ newParent.appendChild(newRow);
152
+
153
+ // remove the original
154
+ tr_elm.parentNode.removeChild(tr_elm);
155
+
156
+ // set tr_elm to the new node
157
+ tr_elm = newRow;
158
+ }
159
+
160
+ dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));
161
+ }
162
+
163
+ function changedBackgroundImage() {
164
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
165
+ var st = dom.parseStyle(formObj.style.value);
166
+
167
+ st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
168
+
169
+ formObj.style.value = dom.serializeStyle(st);
170
+ }
171
+
172
+ function changedStyle() {
173
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
174
+ var st = dom.parseStyle(formObj.style.value);
175
+
176
+ if (st['background-image'])
177
+ formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
178
+ else
179
+ formObj.backgroundimage.value = '';
180
+
181
+ if (st['height'])
182
+ formObj.height.value = trimSize(st['height']);
183
+
184
+ if (st['background-color']) {
185
+ formObj.bgcolor.value = st['background-color'];
186
+ updateColor('bgcolor_pick','bgcolor');
187
+ }
188
+ }
189
+
190
+ function changedSize() {
191
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
192
+ var st = dom.parseStyle(formObj.style.value);
193
+
194
+ var height = formObj.height.value;
195
+ if (height != "")
196
+ st['height'] = getCSSSize(height);
197
+ else
198
+ st['height'] = "";
199
+
200
+ formObj.style.value = dom.serializeStyle(st);
201
+ }
202
+
203
+ function changedColor() {
204
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
205
+ var st = dom.parseStyle(formObj.style.value);
206
+
207
+ st['background-color'] = formObj.bgcolor.value;
208
+
209
+ formObj.style.value = dom.serializeStyle(st);
210
+ }
211
+
212
+ tinyMCEPopup.onInit.add(init);
mce/table/js/table.js CHANGED
@@ -1,410 +1,410 @@
1
- tinyMCEPopup.requireLangPack();
2
-
3
- var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom;
4
-
5
- function insertTable() {
6
- var formObj = document.forms[0];
7
- var inst = tinyMCEPopup.editor, dom = inst.dom;
8
- var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;
9
- var html = '', capEl, elm;
10
- var cellLimit, rowLimit, colLimit;
11
-
12
- tinyMCEPopup.restoreSelection();
13
-
14
- if (!AutoValidator.validate(formObj)) {
15
- alert(inst.getLang('invalid_data'));
16
- return false;
17
- }
18
-
19
- elm = dom.getParent(inst.selection.getNode(), 'table');
20
-
21
- // Get form data
22
- cols = formObj.elements['cols'].value;
23
- rows = formObj.elements['rows'].value;
24
- border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
25
- cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
26
- cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
27
- align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
28
- frame = formObj.elements['frame'].options[formObj.elements['frame'].selectedIndex].value;
29
- rules = formObj.elements['rules'].options[formObj.elements['rules'].selectedIndex].value;
30
- width = formObj.elements['width'].value;
31
- height = formObj.elements['height'].value;
32
- bordercolor = formObj.elements['bordercolor'].value;
33
- bgcolor = formObj.elements['bgcolor'].value;
34
- className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
35
- id = formObj.elements['id'].value;
36
- summary = formObj.elements['summary'].value;
37
- style = formObj.elements['style'].value;
38
- dir = formObj.elements['dir'].value;
39
- lang = formObj.elements['lang'].value;
40
- background = formObj.elements['backgroundimage'].value;
41
- caption = formObj.elements['caption'].checked;
42
-
43
- cellLimit = tinyMCEPopup.getParam('table_cell_limit', false);
44
- rowLimit = tinyMCEPopup.getParam('table_row_limit', false);
45
- colLimit = tinyMCEPopup.getParam('table_col_limit', false);
46
-
47
- // Validate table size
48
- if (colLimit && cols > colLimit) {
49
- alert(inst.getLang('table_col_limit', '', true, {cols : colLimit}));
50
- return false;
51
- } else if (rowLimit && rows > rowLimit) {
52
- alert(inst.getLang('table_row_limit', '', true, {rows : rowLimit}));
53
- return false;
54
- } else if (cellLimit && cols * rows > cellLimit) {
55
- alert(inst.getLang('table_cell_limit', '', true, {cells : cellLimit}));
56
- return false;
57
- }
58
-
59
- // Update table
60
- if (action == "update") {
61
- inst.execCommand('mceBeginUndoLevel');
62
-
63
- dom.setAttrib(elm, 'cellPadding', cellpadding, true);
64
- dom.setAttrib(elm, 'cellSpacing', cellspacing, true);
65
- dom.setAttrib(elm, 'border', border);
66
- dom.setAttrib(elm, 'align', align);
67
- dom.setAttrib(elm, 'frame', frame);
68
- dom.setAttrib(elm, 'rules', rules);
69
- dom.setAttrib(elm, 'class', className);
70
- dom.setAttrib(elm, 'style', style);
71
- dom.setAttrib(elm, 'id', id);
72
- dom.setAttrib(elm, 'summary', summary);
73
- dom.setAttrib(elm, 'dir', dir);
74
- dom.setAttrib(elm, 'lang', lang);
75
-
76
- capEl = inst.dom.select('caption', elm)[0];
77
-
78
- if (capEl && !caption)
79
- capEl.parentNode.removeChild(capEl);
80
-
81
- if (!capEl && caption) {
82
- capEl = elm.ownerDocument.createElement('caption');
83
-
84
- if (!tinymce.isIE)
85
- capEl.innerHTML = '<br mce_bogus="1"/>';
86
-
87
- elm.insertBefore(capEl, elm.firstChild);
88
- }
89
-
90
- if (width && /(pt|em|cm)$/.test(width)) {
91
- dom.setStyle(elm, 'width', width);
92
- dom.setAttrib(elm, 'width', '');
93
- } else {
94
- dom.setAttrib(elm, 'width', width, true);
95
- dom.setStyle(elm, 'width', '');
96
- }
97
-
98
- // Remove these since they are not valid XHTML
99
- dom.setAttrib(elm, 'borderColor', '');
100
- dom.setAttrib(elm, 'bgColor', '');
101
- dom.setAttrib(elm, 'background', '');
102
-
103
- if (height) {
104
- dom.setStyle(elm, 'height', height);
105
- dom.setAttrib(elm, 'height', '');
106
- }
107
-
108
- if (background != '')
109
- elm.style.backgroundImage = "url('" + background + "')";
110
- else
111
- elm.style.backgroundImage = '';
112
-
113
- /* if (tinyMCEPopup.getParam("inline_styles")) {
114
- if (width != '')
115
- elm.style.width = getCSSSize(width);
116
- }*/
117
-
118
- if (bordercolor != "") {
119
- elm.style.borderColor = bordercolor;
120
- elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
121
- elm.style.borderWidth = border == "" ? "1px" : border;
122
- } else
123
- elm.style.borderColor = '';
124
-
125
- elm.style.backgroundColor = bgcolor;
126
- elm.style.height = getCSSSize(height);
127
-
128
- inst.addVisual();
129
-
130
- // Fix for stange MSIE align bug
131
- //elm.outerHTML = elm.outerHTML;
132
-
133
- inst.nodeChanged();
134
- inst.execCommand('mceEndUndoLevel');
135
-
136
- // Repaint if dimensions changed
137
- if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
138
- inst.execCommand('mceRepaint');
139
-
140
- tinyMCEPopup.close();
141
- return true;
142
- }
143
-
144
- // Create new table
145
- html += '<table';
146
-
147
- html += makeAttrib('id', id);
148
- html += makeAttrib('border', border);
149
- html += makeAttrib('cellpadding', cellpadding);
150
- html += makeAttrib('cellspacing', cellspacing);
151
-
152
- if (width && /(pt|em|cm)$/.test(width)) {
153
- if (style)
154
- style += '; ';
155
-
156
- style += 'width: ' + width;
157
- } else
158
- html += makeAttrib('width', width);
159
-
160
- /* if (height) {
161
- if (style)
162
- style += '; ';
163
-
164
- style += 'height: ' + height;
165
- }*/
166
-
167
- //html += makeAttrib('height', height);
168
- //html += makeAttrib('bordercolor', bordercolor);
169
- //html += makeAttrib('bgcolor', bgcolor);
170
- html += makeAttrib('align', align);
171
- html += makeAttrib('frame', frame);
172
- html += makeAttrib('rules', rules);
173
- html += makeAttrib('class', className);
174
- html += makeAttrib('style', style);
175
- html += makeAttrib('summary', summary);
176
- html += makeAttrib('dir', dir);
177
- html += makeAttrib('lang', lang);
178
- html += '>';
179
-
180
- if (caption) {
181
- if (!tinymce.isIE)
182
- html += '<caption><br mce_bogus="1"/></caption>';
183
- else
184
- html += '<caption></caption>';
185
- }
186
-
187
- for (var y=0; y<rows; y++) {
188
- html += "<tr>";
189
-
190
- for (var x=0; x<cols; x++) {
191
- if (!tinymce.isIE)
192
- html += '<td><br mce_bogus="1"/></td>';
193
- else
194
- html += '<td></td>';
195
- }
196
-
197
- html += "</tr>";
198
- }
199
-
200
- html += "</table>";
201
-
202
- inst.execCommand('mceBeginUndoLevel');
203
- inst.execCommand('mceInsertContent', false, html);
204
- inst.addVisual();
205
- inst.execCommand('mceEndUndoLevel');
206
-
207
- tinyMCEPopup.close();
208
- }
209
-
210
- function makeAttrib(attrib, value) {
211
- var formObj = document.forms[0];
212
- var valueElm = formObj.elements[attrib];
213
-
214
- if (typeof(value) == "undefined" || value == null) {
215
- value = "";
216
-
217
- if (valueElm)
218
- value = valueElm.value;
219
- }
220
-
221
- if (value == "")
222
- return "";
223
-
224
- // XML encode it
225
- value = value.replace(/&/g, '&amp;');
226
- value = value.replace(/\"/g, '&quot;');
227
- value = value.replace(/</g, '&lt;');
228
- value = value.replace(/>/g, '&gt;');
229
-
230
- return ' ' + attrib + '="' + value + '"';
231
- }
232
-
233
- function init() {
234
- tinyMCEPopup.resizeToInnerSize();
235
-
236
- document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
237
- document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
238
- document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
239
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
240
-
241
- var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');
242
- var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
243
- var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame;
244
- var inst = tinyMCEPopup.editor, dom = inst.dom;
245
- var formObj = document.forms[0];
246
- var elm = dom.getParent(inst.selection.getNode(), "table");
247
-
248
- action = tinyMCEPopup.getWindowArg('action');
249
-
250
- if (!action)
251
- action = elm ? "update" : "insert";
252
-
253
- if (elm && action != "insert") {
254
- var rowsAr = elm.rows;
255
- var cols = 0;
256
- for (var i=0; i<rowsAr.length; i++)
257
- if (rowsAr[i].cells.length > cols)
258
- cols = rowsAr[i].cells.length;
259
-
260
- cols = cols;
261
- rows = rowsAr.length;
262
-
263
- st = dom.parseStyle(dom.getAttrib(elm, "style"));
264
- border = trimSize(getStyle(elm, 'border', 'borderWidth'));
265
- cellpadding = dom.getAttrib(elm, 'cellpadding', "");
266
- cellspacing = dom.getAttrib(elm, 'cellspacing', "");
267
- width = trimSize(getStyle(elm, 'width', 'width'));
268
- height = trimSize(getStyle(elm, 'height', 'height'));
269
- bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
270
- bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));
271
- align = dom.getAttrib(elm, 'align', align);
272
- frame = dom.getAttrib(elm, 'frame');
273
- rules = dom.getAttrib(elm, 'rules');
274
- className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, ''));
275
- id = dom.getAttrib(elm, 'id');
276
- summary = dom.getAttrib(elm, 'summary');
277
- style = dom.serializeStyle(st);
278
- dir = dom.getAttrib(elm, 'dir');
279
- lang = dom.getAttrib(elm, 'lang');
280
- background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
281
- formObj.caption.checked = elm.getElementsByTagName('caption').length > 0;
282
-
283
- orgTableWidth = width;
284
- orgTableHeight = height;
285
-
286
- action = "update";
287
- formObj.insert.value = inst.getLang('update');
288
- }
289
-
290
- addClassesToList('class', "table_styles");
291
- TinyMCE_EditableSelects.init();
292
-
293
- // Update form
294
- selectByValue(formObj, 'align', align);
295
- selectByValue(formObj, 'frame', frame);
296
- selectByValue(formObj, 'rules', rules);
297
- selectByValue(formObj, 'class', className, true, true);
298
- formObj.cols.value = cols;
299
- formObj.rows.value = rows;
300
- formObj.border.value = border;
301
- formObj.cellpadding.value = cellpadding;
302
- formObj.cellspacing.value = cellspacing;
303
- formObj.width.value = width;
304
- formObj.height.value = height;
305
- formObj.bordercolor.value = bordercolor;
306
- formObj.bgcolor.value = bgcolor;
307
- formObj.id.value = id;
308
- formObj.summary.value = summary;
309
- formObj.style.value = style;
310
- formObj.dir.value = dir;
311
- formObj.lang.value = lang;
312
- formObj.backgroundimage.value = background;
313
-
314
- updateColor('bordercolor_pick', 'bordercolor');
315
- updateColor('bgcolor_pick', 'bgcolor');
316
-
317
- // Resize some elements
318
- if (isVisible('backgroundimagebrowser'))
319
- document.getElementById('backgroundimage').style.width = '180px';
320
-
321
- // Disable some fields in update mode
322
- if (action == "update") {
323
- formObj.cols.disabled = true;
324
- formObj.rows.disabled = true;
325
- }
326
- }
327
-
328
- function changedSize() {
329
- var formObj = document.forms[0];
330
- var st = dom.parseStyle(formObj.style.value);
331
-
332
- /* var width = formObj.width.value;
333
- if (width != "")
334
- st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : "";
335
- else
336
- st['width'] = "";*/
337
-
338
- var height = formObj.height.value;
339
- if (height != "")
340
- st['height'] = getCSSSize(height);
341
- else
342
- st['height'] = "";
343
-
344
- formObj.style.value = dom.serializeStyle(st);
345
- }
346
-
347
- function changedBackgroundImage() {
348
- var formObj = document.forms[0];
349
- var st = dom.parseStyle(formObj.style.value);
350
-
351
- st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
352
-
353
- formObj.style.value = dom.serializeStyle(st);
354
- }
355
-
356
- function changedBorder() {
357
- var formObj = document.forms[0];
358
- var st = dom.parseStyle(formObj.style.value);
359
-
360
- // Update border width if the element has a color
361
- if (formObj.border.value != "" && formObj.bordercolor.value != "")
362
- st['border-width'] = formObj.border.value + "px";
363
-
364
- formObj.style.value = dom.serializeStyle(st);
365
- }
366
-
367
- function changedColor() {
368
- var formObj = document.forms[0];
369
- var st = dom.parseStyle(formObj.style.value);
370
-
371
- st['background-color'] = formObj.bgcolor.value;
372
-
373
- if (formObj.bordercolor.value != "") {
374
- st['border-color'] = formObj.bordercolor.value;
375
-
376
- // Add border-width if it's missing
377
- if (!st['border-width'])
378
- st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
379
- }
380
-
381
- formObj.style.value = dom.serializeStyle(st);
382
- }
383
-
384
- function changedStyle() {
385
- var formObj = document.forms[0];
386
- var st = dom.parseStyle(formObj.style.value);
387
-
388
- if (st['background-image'])
389
- formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
390
- else
391
- formObj.backgroundimage.value = '';
392
-
393
- if (st['width'])
394
- formObj.width.value = trimSize(st['width']);
395
-
396
- if (st['height'])
397
- formObj.height.value = trimSize(st['height']);
398
-
399
- if (st['background-color']) {
400
- formObj.bgcolor.value = st['background-color'];
401
- updateColor('bgcolor_pick','bgcolor');
402
- }
403
-
404
- if (st['border-color']) {
405
- formObj.bordercolor.value = st['border-color'];
406
- updateColor('bordercolor_pick','bordercolor');
407
- }
408
- }
409
-
410
- tinyMCEPopup.onInit.add(init);
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom;
4
+
5
+ function insertTable() {
6
+ var formObj = document.forms[0];
7
+ var inst = tinyMCEPopup.editor, dom = inst.dom;
8
+ var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;
9
+ var html = '', capEl, elm;
10
+ var cellLimit, rowLimit, colLimit;
11
+
12
+ tinyMCEPopup.restoreSelection();
13
+
14
+ if (!AutoValidator.validate(formObj)) {
15
+ alert(inst.getLang('invalid_data'));
16
+ return false;
17
+ }
18
+
19
+ elm = dom.getParent(inst.selection.getNode(), 'table');
20
+
21
+ // Get form data
22
+ cols = formObj.elements['cols'].value;
23
+ rows = formObj.elements['rows'].value;
24
+ border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
25
+ cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
26
+ cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
27
+ align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
28
+ frame = formObj.elements['frame'].options[formObj.elements['frame'].selectedIndex].value;
29
+ rules = formObj.elements['rules'].options[formObj.elements['rules'].selectedIndex].value;
30
+ width = formObj.elements['width'].value;
31
+ height = formObj.elements['height'].value;
32
+ bordercolor = formObj.elements['bordercolor'].value;
33
+ bgcolor = formObj.elements['bgcolor'].value;
34
+ className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
35
+ id = formObj.elements['id'].value;
36
+ summary = formObj.elements['summary'].value;
37
+ style = formObj.elements['style'].value;
38
+ dir = formObj.elements['dir'].value;
39
+ lang = formObj.elements['lang'].value;
40
+ background = formObj.elements['backgroundimage'].value;
41
+ caption = formObj.elements['caption'].checked;
42
+
43
+ cellLimit = tinyMCEPopup.getParam('table_cell_limit', false);
44
+ rowLimit = tinyMCEPopup.getParam('table_row_limit', false);
45
+ colLimit = tinyMCEPopup.getParam('table_col_limit', false);
46
+
47
+ // Validate table size
48
+ if (colLimit && cols > colLimit) {
49
+ inst.windowManager.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));
50
+ return false;
51
+ } else if (rowLimit && rows > rowLimit) {
52
+ inst.windowManager.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));
53
+ return false;
54
+ } else if (cellLimit && cols * rows > cellLimit) {
55
+ inst.windowManager.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));
56
+ return false;
57
+ }
58
+
59
+ // Update table
60
+ if (action == "update") {
61
+ inst.execCommand('mceBeginUndoLevel');
62
+
63
+ dom.setAttrib(elm, 'cellPadding', cellpadding, true);
64
+ dom.setAttrib(elm, 'cellSpacing', cellspacing, true);
65
+ dom.setAttrib(elm, 'border', border);
66
+ dom.setAttrib(elm, 'align', align);
67
+ dom.setAttrib(elm, 'frame', frame);
68
+ dom.setAttrib(elm, 'rules', rules);
69
+ dom.setAttrib(elm, 'class', className);
70
+ dom.setAttrib(elm, 'style', style);
71
+ dom.setAttrib(elm, 'id', id);
72
+ dom.setAttrib(elm, 'summary', summary);
73
+ dom.setAttrib(elm, 'dir', dir);
74
+ dom.setAttrib(elm, 'lang', lang);
75
+
76
+ capEl = inst.dom.select('caption', elm)[0];
77
+
78
+ if (capEl && !caption)
79
+ capEl.parentNode.removeChild(capEl);
80
+
81
+ if (!capEl && caption) {
82
+ capEl = elm.ownerDocument.createElement('caption');
83
+
84
+ if (!tinymce.isIE)
85
+ capEl.innerHTML = '<br mce_bogus="1"/>';
86
+
87
+ elm.insertBefore(capEl, elm.firstChild);
88
+ }
89
+
90
+ if (width && /(pt|em|cm)$/.test(width)) {
91
+ dom.setStyle(elm, 'width', width);
92
+ dom.setAttrib(elm, 'width', '');
93
+ } else {
94
+ dom.setAttrib(elm, 'width', width, true);
95
+ dom.setStyle(elm, 'width', '');
96
+ }
97
+
98
+ // Remove these since they are not valid XHTML
99
+ dom.setAttrib(elm, 'borderColor', '');
100
+ dom.setAttrib(elm, 'bgColor', '');
101
+ dom.setAttrib(elm, 'background', '');
102
+
103
+ if (height) {
104
+ dom.setStyle(elm, 'height', height);
105
+ dom.setAttrib(elm, 'height', '');
106
+ }
107
+
108
+ if (background != '')
109
+ elm.style.backgroundImage = "url('" + background + "')";
110
+ else
111
+ elm.style.backgroundImage = '';
112
+
113
+ /* if (tinyMCEPopup.getParam("inline_styles")) {
114
+ if (width != '')
115
+ elm.style.width = getCSSSize(width);
116
+ }*/
117
+
118
+ if (bordercolor != "") {
119
+ elm.style.borderColor = bordercolor;
120
+ elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
121
+ elm.style.borderWidth = border == "" ? "1px" : border;
122
+ } else
123
+ elm.style.borderColor = '';
124
+
125
+ elm.style.backgroundColor = bgcolor;
126
+ elm.style.height = getCSSSize(height);
127
+
128
+ inst.addVisual();
129
+
130
+ // Fix for stange MSIE align bug
131
+ //elm.outerHTML = elm.outerHTML;
132
+
133
+ inst.nodeChanged();
134
+ inst.execCommand('mceEndUndoLevel');
135
+
136
+ // Repaint if dimensions changed
137
+ if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
138
+ inst.execCommand('mceRepaint');
139
+
140
+ tinyMCEPopup.close();
141
+ return true;
142
+ }
143
+
144
+ // Create new table
145
+ html += '<table';
146
+
147
+ html += makeAttrib('id', id);
148
+ html += makeAttrib('border', border);
149
+ html += makeAttrib('cellpadding', cellpadding);
150
+ html += makeAttrib('cellspacing', cellspacing);
151
+
152
+ if (width && /(pt|em|cm)$/.test(width)) {
153
+ if (style)
154
+ style += '; ';
155
+
156
+ style += 'width: ' + width;
157
+ } else
158
+ html += makeAttrib('width', width);
159
+
160
+ /* if (height) {
161
+ if (style)
162
+ style += '; ';
163
+
164
+ style += 'height: ' + height;
165
+ }*/
166
+
167
+ //html += makeAttrib('height', height);
168
+ //html += makeAttrib('bordercolor', bordercolor);
169
+ //html += makeAttrib('bgcolor', bgcolor);
170
+ html += makeAttrib('align', align);
171
+ html += makeAttrib('frame', frame);
172
+ html += makeAttrib('rules', rules);
173
+ html += makeAttrib('class', className);
174
+ html += makeAttrib('style', style);
175
+ html += makeAttrib('summary', summary);
176
+ html += makeAttrib('dir', dir);
177
+ html += makeAttrib('lang', lang);
178
+ html += '>';
179
+
180
+ if (caption) {
181
+ if (!tinymce.isIE)
182
+ html += '<caption><br mce_bogus="1"/></caption>';
183
+ else
184
+ html += '<caption></caption>';
185
+ }
186
+
187
+ for (var y=0; y<rows; y++) {
188
+ html += "<tr>";
189
+
190
+ for (var x=0; x<cols; x++) {
191
+ if (!tinymce.isIE)
192
+ html += '<td><br mce_bogus="1"/></td>';
193
+ else
194
+ html += '<td></td>';
195
+ }
196
+
197
+ html += "</tr>";
198
+ }
199
+
200
+ html += "</table>";
201
+
202
+ inst.execCommand('mceBeginUndoLevel');
203
+ inst.execCommand('mceInsertContent', false, html);
204
+ inst.addVisual();
205
+ inst.execCommand('mceEndUndoLevel');
206
+
207
+ tinyMCEPopup.close();
208
+ }
209
+
210
+ function makeAttrib(attrib, value) {
211
+ var formObj = document.forms[0];
212
+ var valueElm = formObj.elements[attrib];
213
+
214
+ if (typeof(value) == "undefined" || value == null) {
215
+ value = "";
216
+
217
+ if (valueElm)
218
+ value = valueElm.value;
219
+ }
220
+
221
+ if (value == "")
222
+ return "";
223
+
224
+ // XML encode it
225
+ value = value.replace(/&/g, '&amp;');
226
+ value = value.replace(/\"/g, '&quot;');
227
+ value = value.replace(/</g, '&lt;');
228
+ value = value.replace(/>/g, '&gt;');
229
+
230
+ return ' ' + attrib + '="' + value + '"';
231
+ }
232
+
233
+ function init() {
234
+ tinyMCEPopup.resizeToInnerSize();
235
+
236
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
237
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
238
+ document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
239
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
240
+
241
+ var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');
242
+ var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
243
+ var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame;
244
+ var inst = tinyMCEPopup.editor, dom = inst.dom;
245
+ var formObj = document.forms[0];
246
+ var elm = dom.getParent(inst.selection.getNode(), "table");
247
+
248
+ action = tinyMCEPopup.getWindowArg('action');
249
+
250
+ if (!action)
251
+ action = elm ? "update" : "insert";
252
+
253
+ if (elm && action != "insert") {
254
+ var rowsAr = elm.rows;
255
+ var cols = 0;
256
+ for (var i=0; i<rowsAr.length; i++)
257
+ if (rowsAr[i].cells.length > cols)
258
+ cols = rowsAr[i].cells.length;
259
+
260
+ cols = cols;
261
+ rows = rowsAr.length;
262
+
263
+ st = dom.parseStyle(dom.getAttrib(elm, "style"));
264
+ border = trimSize(getStyle(elm, 'border', 'borderWidth'));
265
+ cellpadding = dom.getAttrib(elm, 'cellpadding', "");
266
+ cellspacing = dom.getAttrib(elm, 'cellspacing', "");
267
+ width = trimSize(getStyle(elm, 'width', 'width'));
268
+ height = trimSize(getStyle(elm, 'height', 'height'));
269
+ bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
270
+ bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));
271
+ align = dom.getAttrib(elm, 'align', align);
272
+ frame = dom.getAttrib(elm, 'frame');
273
+ rules = dom.getAttrib(elm, 'rules');
274
+ className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, ''));
275
+ id = dom.getAttrib(elm, 'id');
276
+ summary = dom.getAttrib(elm, 'summary');
277
+ style = dom.serializeStyle(st);
278
+ dir = dom.getAttrib(elm, 'dir');
279
+ lang = dom.getAttrib(elm, 'lang');
280
+ background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
281
+ formObj.caption.checked = elm.getElementsByTagName('caption').length > 0;
282
+
283
+ orgTableWidth = width;
284
+ orgTableHeight = height;
285
+
286
+ action = "update";
287
+ formObj.insert.value = inst.getLang('update');
288
+ }
289
+
290
+ addClassesToList('class', "table_styles");
291
+ TinyMCE_EditableSelects.init();
292
+
293
+ // Update form
294
+ selectByValue(formObj, 'align', align);
295
+ selectByValue(formObj, 'frame', frame);
296
+ selectByValue(formObj, 'rules', rules);
297
+ selectByValue(formObj, 'class', className, true, true);
298
+ formObj.cols.value = cols;
299
+ formObj.rows.value = rows;
300
+ formObj.border.value = border;
301
+ formObj.cellpadding.value = cellpadding;
302
+ formObj.cellspacing.value = cellspacing;
303
+ formObj.width.value = width;
304
+ formObj.height.value = height;
305
+ formObj.bordercolor.value = bordercolor;
306
+ formObj.bgcolor.value = bgcolor;
307
+ formObj.id.value = id;
308
+ formObj.summary.value = summary;
309
+ formObj.style.value = style;
310
+ formObj.dir.value = dir;
311
+ formObj.lang.value = lang;
312
+ formObj.backgroundimage.value = background;
313
+
314
+ updateColor('bordercolor_pick', 'bordercolor');
315
+ updateColor('bgcolor_pick', 'bgcolor');
316
+
317
+ // Resize some elements
318
+ if (isVisible('backgroundimagebrowser'))
319
+ document.getElementById('backgroundimage').style.width = '180px';
320
+
321
+ // Disable some fields in update mode
322
+ if (action == "update") {
323
+ formObj.cols.disabled = true;
324
+ formObj.rows.disabled = true;
325
+ }
326
+ }
327
+
328
+ function changedSize() {
329
+ var formObj = document.forms[0];
330
+ var st = dom.parseStyle(formObj.style.value);
331
+
332
+ /* var width = formObj.width.value;
333
+ if (width != "")
334
+ st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : "";
335
+ else
336
+ st['width'] = "";*/
337
+
338
+ var height = formObj.height.value;
339
+ if (height != "")
340
+ st['height'] = getCSSSize(height);
341
+ else
342
+ st['height'] = "";
343
+
344
+ formObj.style.value = dom.serializeStyle(st);
345
+ }
346
+
347
+ function changedBackgroundImage() {
348
+ var formObj = document.forms[0];
349
+ var st = dom.parseStyle(formObj.style.value);
350
+
351
+ st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
352
+
353
+ formObj.style.value = dom.serializeStyle(st);
354
+ }
355
+
356
+ function changedBorder() {
357
+ var formObj = document.forms[0];
358
+ var st = dom.parseStyle(formObj.style.value);
359
+
360
+ // Update border width if the element has a color
361
+ if (formObj.border.value != "" && formObj.bordercolor.value != "")
362
+ st['border-width'] = formObj.border.value + "px";
363
+
364
+ formObj.style.value = dom.serializeStyle(st);
365
+ }
366
+
367
+ function changedColor() {
368
+ var formObj = document.forms[0];
369
+ var st = dom.parseStyle(formObj.style.value);
370
+
371
+ st['background-color'] = formObj.bgcolor.value;
372
+
373
+ if (formObj.bordercolor.value != "") {
374
+ st['border-color'] = formObj.bordercolor.value;
375
+
376
+ // Add border-width if it's missing
377
+ if (!st['border-width'])
378
+ st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
379
+ }
380
+
381
+ formObj.style.value = dom.serializeStyle(st);
382
+ }
383
+
384
+ function changedStyle() {
385
+ var formObj = document.forms[0];
386
+ var st = dom.parseStyle(formObj.style.value);
387
+
388
+ if (st['background-image'])
389
+ formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
390
+ else
391
+ formObj.backgroundimage.value = '';
392
+
393
+ if (st['width'])
394
+ formObj.width.value = trimSize(st['width']);
395
+
396
+ if (st['height'])
397
+ formObj.height.value = trimSize(st['height']);
398
+
399
+ if (st['background-color']) {
400
+ formObj.bgcolor.value = st['background-color'];
401
+ updateColor('bgcolor_pick','bgcolor');
402
+ }
403
+
404
+ if (st['border-color']) {
405
+ formObj.bordercolor.value = st['border-color'];
406
+ updateColor('bordercolor_pick','bordercolor');
407
+ }
408
+ }
409
+
410
+ tinyMCEPopup.onInit.add(init);
mce/table/langs/en_dlg.js CHANGED
@@ -1,74 +1,74 @@
1
- tinyMCE.addI18n('en.table_dlg',{
2
- general_tab:"General",
3
- advanced_tab:"Advanced",
4
- general_props:"General properties",
5
- advanced_props:"Advanced properties",
6
- rowtype:"Row in table part",
7
- title:"Insert/Modify table",
8
- width:"Width",
9
- height:"Height",
10
- cols:"Cols",
11
- rows:"Rows",
12
- cellspacing:"Cellspacing",
13
- cellpadding:"Cellpadding",
14
- border:"Border",
15
- align:"Alignment",
16
- align_default:"Default",
17
- align_left:"Left",
18
- align_right:"Right",
19
- align_middle:"Center",
20
- row_title:"Table row properties",
21
- cell_title:"Table cell properties",
22
- cell_type:"Cell type",
23
- valign:"Vertical alignment",
24
- align_top:"Top",
25
- align_bottom:"Bottom",
26
- bordercolor:"Border color",
27
- bgcolor:"Background color",
28
- merge_cells_title:"Merge table cells",
29
- id:"Id",
30
- style:"Style",
31
- langdir:"Language direction",
32
- langcode:"Language code",
33
- mime:"Target MIME type",
34
- ltr:"Left to right",
35
- rtl:"Right to left",
36
- bgimage:"Background image",
37
- summary:"Summary",
38
- td:"Data",
39
- th:"Header",
40
- cell_cell:"Update current cell",
41
- cell_row:"Update all cells in row",
42
- cell_all:"Update all cells in table",
43
- row_row:"Update current row",
44
- row_odd:"Update odd rows in table",
45
- row_even:"Update even rows in table",
46
- row_all:"Update all rows in table",
47
- thead:"Table Head",
48
- tbody:"Table Body",
49
- tfoot:"Table Foot",
50
- scope:"Scope",
51
- rowgroup:"Row Group",
52
- colgroup:"Col Group",
53
- col_limit:"You've exceeded the maximum number of columns of {$cols}.",
54
- row_limit:"You've exceeded the maximum number of rows of {$rows}.",
55
- cell_limit:"You've exceeded the maximum number of cells of {$cells}.",
56
- missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",
57
- caption:"Table caption",
58
- frame:"Frame",
59
- frame_none:"none",
60
- frame_groups:"groups",
61
- frame_rows:"rows",
62
- frame_cols:"cols",
63
- frame_all:"all",
64
- rules:"Rules",
65
- rules_void:"void",
66
- rules_above:"above",
67
- rules_below:"below",
68
- rules_hsides:"hsides",
69
- rules_lhs:"lhs",
70
- rules_rhs:"rhs",
71
- rules_vsides:"vsides",
72
- rules_box:"box",
73
- rules_border:"border"
74
  });
1
+ tinyMCE.addI18n('en.table_dlg',{
2
+ general_tab:"General",
3
+ advanced_tab:"Advanced",
4
+ general_props:"General properties",
5
+ advanced_props:"Advanced properties",
6
+ rowtype:"Row in table part",
7
+ title:"Insert/Modify table",
8
+ width:"Width",
9
+ height:"Height",
10
+ cols:"Cols",
11
+ rows:"Rows",
12
+ cellspacing:"Cellspacing",
13
+ cellpadding:"Cellpadding",
14
+ border:"Border",
15
+ align:"Alignment",
16
+ align_default:"Default",
17
+ align_left:"Left",
18
+ align_right:"Right",
19
+ align_middle:"Center",
20
+ row_title:"Table row properties",
21
+ cell_title:"Table cell properties",
22
+ cell_type:"Cell type",
23
+ valign:"Vertical alignment",
24
+ align_top:"Top",
25
+ align_bottom:"Bottom",
26
+ bordercolor:"Border color",
27
+ bgcolor:"Background color",
28
+ merge_cells_title:"Merge table cells",
29
+ id:"Id",
30
+ style:"Style",
31
+ langdir:"Language direction",
32
+ langcode:"Language code",
33
+ mime:"Target MIME type",
34
+ ltr:"Left to right",
35
+ rtl:"Right to left",
36
+ bgimage:"Background image",
37
+ summary:"Summary",
38
+ td:"Data",
39
+ th:"Header",
40
+ cell_cell:"Update current cell",
41
+ cell_row:"Update all cells in row",
42
+ cell_all:"Update all cells in table",
43
+ row_row:"Update current row",
44
+ row_odd:"Update odd rows in table",
45
+ row_even:"Update even rows in table",
46
+ row_all:"Update all rows in table",
47
+ thead:"Table Head",
48
+ tbody:"Table Body",
49
+ tfoot:"Table Foot",
50
+ scope:"Scope",
51
+ rowgroup:"Row Group",
52
+ colgroup:"Col Group",
53
+ col_limit:"You've exceeded the maximum number of columns of {$cols}.",
54
+ row_limit:"You've exceeded the maximum number of rows of {$rows}.",
55
+ cell_limit:"You've exceeded the maximum number of cells of {$cells}.",
56
+ missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",
57
+ caption:"Table caption",
58
+ frame:"Frame",
59
+ frame_none:"none",
60
+ frame_groups:"groups",
61
+ frame_rows:"rows",
62
+ frame_cols:"cols",
63
+ frame_all:"all",
64
+ rules:"Rules",
65
+ rules_void:"void",
66
+ rules_above:"above",
67
+ rules_below:"below",
68
+ rules_hsides:"hsides",
69
+ rules_lhs:"lhs",
70
+ rules_rhs:"rhs",
71
+ rules_vsides:"vsides",
72
+ rules_box:"box",
73
+ rules_border:"border"
74
  });
mce/table/langs/ja_dlg.js CHANGED
@@ -1,74 +1,74 @@
1
  tinyMCE.addI18n('ja.table_dlg',{
2
- general_tab:"\u57FA\u672C",
3
- advanced_tab:"\u9AD8\u7EA7",
4
- general_props:"\u57FA\u672C \u5C5E\u6027",
5
- advanced_props:"\u9AD8\u7EA7\u5C5E\u6027",
6
- rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E",
7
- title:"\u63D2\u5165/\u7F16\u8F91 \u8868\u683C",
8
- width:"\u5BBD\u5EA6",
9
- height:"\u9AD8\u5EA6",
10
- cols:"\u5217\u6570",
11
- rows:"\u884C\u6570",
12
- cellspacing:"\u50A8\u5B58\u683C\u95F4\u8DDD",
13
- cellpadding:"\u50A8\u5B58\u683C\u5185\u8DDD",
14
- border:"\u8FB9\u6846",
15
- align:"\u5BF9\u9F50\u65B9\u5F0F",
16
- align_default:"\u9ED8\u8BA4",
17
- align_left:"\u5C45\u5DE6",
18
- align_right:"\u5C45\u53F3",
19
- align_middle:"\u5C45\u4E2D",
20
- row_title:"\u884C \u5C5E\u6027",
21
- cell_title:"\u50A8\u5B58\u683C \u5C5E\u6027",
22
- cell_type:"\u50A8\u5B58\u683C \u7C7B\u522B",
23
- valign:"\u5782\u76F4\u5BF9\u9F50\u65B9\u5F0F",
24
- align_top:"\u9876\u90E8",
25
- align_bottom:"\u5E95\u90E8",
26
- bordercolor:"\u8FB9\u6846\u989C\u8272",
27
- bgcolor:"\u80CC\u666F\u989C\u8272",
28
- merge_cells_title:"\u5408\u5E76\u50A8\u5B58\u683C",
29
- id:"Id",
30
- style:"\u6837\u5F0F",
31
- langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411",
32
- langcode:"\u8BED\u8A00\u7F16\u7801",
33
- mime:"\u76EE\u6807 MIME \u7C7B\u578B",
34
- ltr:"\u4ECE\u5DE6\u5230\u53F3",
35
- rtl:"\u4ECE\u53F3\u5230\u5DE6",
36
- bgimage:"\u80CC\u666F\u56FE\u7247",
37
- summary:"\u6458\u8981",
38
- td:"\u8868\u683C",
39
- th:"\u8868\u5934",
40
- cell_cell:"\u66F4\u65B0\u76EE\u524D\u7684\u50A8\u5B58\u683C",
41
- cell_row:"\u66F4\u65B0\u5F53\u524D\u884C\u7684\u50A8\u5B58\u683C",
42
- cell_all:"\u66F4\u65B0\u5168\u90E8\u50A8\u5B58\u683C",
43
- row_row:"\u66F4\u65B0\u6240\u5728\u884C",
44
- row_odd:"\u66F4\u65B0\u8868\u683C\u7684\u5947\u6570\u884C",
45
- row_even:"\u66F4\u65B0\u8868\u683C\u7684\u5076\u6570\u884C",
46
- row_all:"\u66F4\u65B0\u8868\u683C\u7684\u5168\u90E8\u884C",
47
- thead:"\u8868\u5934",
48
- tbody:"\u8868\u4F53",
49
- tfoot:"\u8868\u811A",
50
- scope:"\u8303\u56F4",
51
- rowgroup:"\u884C\u7EC4",
52
- colgroup:"\u5217\u7EC4",
53
- col_limit:"\u5DF2\u8D85\u8FC7\u9650\u5236\uFF0C\u6700\u591A\u4E3A {$cols} \u5217\u3002",
54
- row_limit:"\u5DF2\u8D85\u8FC7\u9650\u5236\uFF0C\u6700\u591A\u4E3A {$rows} \u884C\u3002",
55
- cell_limit:"\u5DF2\u8D85\u8FC7\u9650\u5236\uFF0C\u6700\u591A\u4E3A{$cells} \u50A8\u5B58\u683C\u3002",
56
- missing_scope:"\u60A8\u786E\u5B9A\u4E0D\u6307\u5B9A\u8868\u5934\u50A8\u5B58\u683C\u7684\u8303\u56F4\u5417\uFF1F\u5982\u679C\u4E0D\u6307\u5B9A\uFF0C\u90E8\u5206\u4F7F\u7528\u8005\u5C06\u5F88\u96BE\u67E5\u770B\u8868\u683C\u5185\u5BB9",
57
- caption:"\u8868\u683C\u6807\u9898",
58
- frame:"\u8FB9\u6846",
59
- frame_none:"\u65E0",
60
- frame_groups:"\u7EC4",
61
  frame_rows:"\u884C",
62
  frame_cols:"\u5217",
63
- frame_all:"\u5168\u90E8",
64
- rules:"\u6807\u5C3A",
65
- rules_void:"\u7A7A",
66
- rules_above:"\u4E4B\u4E0A",
67
- rules_below:"\u4E4B\u4E0B",
68
- rules_hsides:"\u6C34\u5E73\u5927\u5C0F",
69
- rules_lhs:"lhs",
70
- rules_rhs:"rhs",
71
- rules_vsides:"\u5782\u76F4\u5927\u5C0F",
72
- rules_box:"\u76D2",
73
- rules_border:"\u8FB9\u6846"
74
  });
1
  tinyMCE.addI18n('ja.table_dlg',{
2
+ general_tab:"\u4E00\u822C",
3
+ advanced_tab:"\u4E0A\u7D1A\u8005\u5411\u3051",
4
+ general_props:"\u4E00\u822C",
5
+ advanced_props:"\u4E0A\u7D1A\u8005\u5411\u3051",
6
+ rowtype:"\u884C",
7
+ title:"\u8868\u306E\u633F\u5165/\u7DE8\u96C6",
8
+ width:"\u5E45",
9
+ height:"\u9AD8\u3055",
10
+ cols:"\u5217",
11
+ rows:"\u884C",
12
+ cellspacing:"Cellspacing",
13
+ cellpadding:"Cellpadding",
14
+ border:"\u67A0\u7DDA",
15
+ align:"\u914D\u7F6E",
16
+ align_default:"\u30C7\u30D5\u30A9\u30EB\u30C8",
17
+ align_left:"\u5DE6\u63C3\u3048",
18
+ align_right:"\u53F3\u63C3\u3048",
19
+ align_middle:"\u4E2D\u592E\u63C3\u3048",
20
+ row_title:"\u884C\u306E\u30D7\u30ED\u30D1\u30C6\u30A3",
21
+ cell_title:"\u30BB\u30EB\u306E\u30D7\u30ED\u30D1\u30C6\u30A3",
22
+ cell_type:"\u30BB\u30EB\u7A2E\u5225",
23
+ valign:"\u5782\u76F4\u65B9\u5411\u306E\u914D\u7F6E",
24
+ align_top:"\u4E0A\u63C3\u3048",
25
+ align_bottom:"\u4E0B\u63C3\u3048",
26
+ bordercolor:"\u67A0\u7DDA\u306E\u8272",
27
+ bgcolor:"\u80CC\u666F\u8272",
28
+ merge_cells_title:"\u30BB\u30EB\u306E\u7D50\u5408",
29
+ id:"ID",
30
+ style:"\u30B9\u30BF\u30A4\u30EB",
31
+ langdir:"\u6587\u7AE0\u306E\u65B9\u5411",
32
+ langcode:"\u8A00\u8A9E\u30B3\u30FC\u30C9",
33
+ mime:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306EMIME\u30BF\u30A4\u30D7",
34
+ ltr:"\u5DE6\u304B\u3089\u53F3",
35
+ rtl:"\u53F3\u304B\u3089\u5DE6",
36
+ bgimage:"\u80CC\u666F\u753B\u50CF",
37
+ summary:"\u30B5\u30DE\u30EA\u30FC",
38
+ td:"\u65E5\u4ED8",
39
+ th:"\u30D8\u30C3\u30C0",
40
+ cell_cell:"\u9078\u629E\u30BB\u30EB\u306E\u66F4\u65B0",
41
+ cell_row:"\u884C\u5185\u306E\u30BB\u30EB\u306E\u66F4\u65B0",
42
+ cell_all:"\u5168\u3066\u306E\u30BB\u30EB\u306E\u66F4\u65B0",
43
+ row_row:"\u9078\u629E\u884C\u306E\u66F4\u65B0",
44
+ row_odd:"\u5947\u6570\u884C\u306E\u66F4\u65B0",
45
+ row_even:"\u5076\u6570\u884C\u306E\u66F4\u65B0",
46
+ row_all:"\u5168\u3066\u306E\u884C\u306E\u66F4\u65B0",
47
+ thead:"\u8868\u30D8\u30C3\u30C0",
48
+ tbody:"\u8868\u30DC\u30C7\u30A3",
49
+ tfoot:"\u8868\u30D5\u30C3\u30BF",
50
+ scope:"\u30B9\u30B3\u30FC\u30D7",
51
+ rowgroup:"\u884C\u30B0\u30EB\u30FC\u30D7",
52
+ colgroup:"\u5217\u30B0\u30EB\u30FC\u30D7",
53
+ col_limit:"\u5217\u306E\u6700\u5927\u6570\u3092\u8D85\u3048\u307E\u3057\u305F\u3002",
54
+ row_limit:"\u884C\u306E\u6700\u5927\u6570\u3092\u8D85\u3048\u307E\u3057\u305F\u3002",
55
+ cell_limit:"\u30BB\u30EB\u306E\u6700\u5927\u6570\u3092\u8D85\u3048\u307E\u3057\u305F\u3002",
56
+ missing_scope:"\u8868\u306E\u30B9\u30B3\u30FC\u30D7\u5C5E\u6027\u3092\u8A2D\u5B9A\u3057\u3066\u3044\u307E\u305B\u3093\u304C\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F",
57
+ caption:"\u8868\u306B\u898B\u51FA\u3057\u3092\u4ED8\u3051\u308B",
58
+ frame:"\u30BB\u30EB\u67A0\u7DDA",
59
+ frame_none:"\u306A\u3057",
60
+ frame_groups:"\u30B0\u30EB\u30FC\u30D7\u6BCE",
61
  frame_rows:"\u884C",
62
  frame_cols:"\u5217",
63
+ frame_all:"\u5168\u3066",
64
+ rules:"\u8868\u306E\u5916\u67A0",
65
+ rules_void:"\u306A\u3057",
66
+ rules_above:"\u4E0A",
67
+ rules_below:"\u4E0B",
68
+ rules_hsides:"\u4E0A\u4E0B",
69
+ rules_lhs:"\u5DE6",
70
+ rules_rhs:"\u53F3",
71
+ rules_vsides:"\u5DE6\u53F3",
72
+ rules_box:"\u4E0A\u4E0B\u5DE6\u53F3(box)",
73
+ rules_border:"\u4E0A\u4E0B\u5DE6\u53F3(border)"
74
  });
mce/table/langs/langs.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
- if ( is_file($lang_file) && is_readable($lang_file) ) {
5
  $strings .= getFileContents($lang_file);
6
- }
7
  ?>
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
+ if ( is_file($lang_file) && is_readable($lang_file) )
5
  $strings .= getFileContents($lang_file);
6
+ else $strings .= getFileContents(dirname(__FILE__) . '/en_dlg.js');
7
  ?>
mce/table/merge_cells.htm CHANGED
@@ -1,38 +1,38 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#table_dlg.merge_cells_title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
12
- <form onsubmit="mergeCells();return false;" action="#">
13
- <fieldset>
14
- <legend>{#table_dlg.merge_cells_title}</legend>
15
- <table border="0" cellpadding="0" cellspacing="3" width="100%">
16
- <tr>
17
- <td>{#table_dlg.cols}:</td>
18
- <td align="right"><input type="text" name="numcols" value="" class="number min1 mceFocus" style="width: 30px" /></td>
19
- </tr>
20
- <tr>
21
- <td>{#table_dlg.rows}:</td>
22
- <td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>
23
- </tr>
24
- </table>
25
- </fieldset>
26
-
27
- <div class="mceActionPanel">
28
- <div style="float: left">
29
- <input type="submit" id="insert" name="insert" value="{#update}" />
30
- </div>
31
-
32
- <div style="float: right">
33
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
34
- </div>
35
- </div>
36
- </form>
37
- </body>
38
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#table_dlg.merge_cells_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/validate.js?ver=311"></script>
8
+ <script type="text/javascript" src="js/merge_cells.js?ver=311"></script>
9
+ <base target="_self" />
10
+ </head>
11
+ <body style="margin: 8px" style="display: none">
12
+ <form onsubmit="mergeCells();return false;" action="#">
13
+ <fieldset>
14
+ <legend>{#table_dlg.merge_cells_title}</legend>
15
+ <table border="0" cellpadding="0" cellspacing="3" width="100%">
16
+ <tr>
17
+ <td>{#table_dlg.cols}:</td>
18
+ <td align="right"><input type="text" name="numcols" value="" class="number min1 mceFocus" style="width: 30px" /></td>
19
+ </tr>
20
+ <tr>
21
+ <td>{#table_dlg.rows}:</td>
22
+ <td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>
23
+ </tr>
24
+ </table>
25
+ </fieldset>
26
+
27
+ <div class="mceActionPanel">
28
+ <div style="float: left">
29
+ <input type="submit" id="insert" name="insert" value="{#update}" />
30
+ </div>
31
+
32
+ <div style="float: right">
33
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
34
+ </div>
35
+ </div>
36
+ </form>
37
+ </body>
38
+ </html>
mce/table/row.htm CHANGED
@@ -1,161 +1,161 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#table_dlg.row_title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
14
- <form onsubmit="updateAction();return false;">
15
- <div class="tabs">
16
- <ul>
17
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
18
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
19
- </ul>
20
- </div>
21
-
22
- <div class="panel_wrapper">
23
- <div id="general_panel" class="panel current">
24
- <fieldset>
25
- <legend>{#table_dlg.general_props}</legend>
26
-
27
- <table border="0" cellpadding="4" cellspacing="0">
28
- <tr>
29
- <td><label for="rowtype">{#table_dlg.rowtype}</label></td>
30
- <td class="col2">
31
- <select id="rowtype" name="rowtype" class="mceFocus">
32
- <option value="thead">{#table_dlg.thead}</option>
33
- <option value="tbody">{#table_dlg.tbody}</option>
34
- <option value="tfoot">{#table_dlg.tfoot}</option>
35
- </select>
36
- </td>
37
- </tr>
38
-
39
- <tr>
40
- <td><label for="align">{#table_dlg.align}</label></td>
41
- <td class="col2">
42
- <select id="align" name="align">
43
- <option value="">{#not_set}</option>
44
- <option value="center">{#table_dlg.align_middle}</option>
45
- <option value="left">{#table_dlg.align_left}</option>
46
- <option value="right">{#table_dlg.align_right}</option>
47
- </select>
48
- </td>
49
- </tr>
50
-
51
- <tr>
52
- <td><label for="valign">{#table_dlg.valign}</label></td>
53
- <td class="col2">
54
- <select id="valign" name="valign">
55
- <option value="">{#not_set}</option>
56
- <option value="top">{#table_dlg.align_top}</option>
57
- <option value="middle">{#table_dlg.align_middle}</option>
58
- <option value="bottom">{#table_dlg.align_bottom}</option>
59
- </select>
60
- </td>
61
- </tr>
62
-
63
- <tr id="styleSelectRow">
64
- <td><label for="class">{#class_name}</label></td>
65
- <td class="col2">
66
- <select id="class" name="class" class="mceEditableSelect">
67
- <option value="" selected="selected">{#not_set}</option>
68
- </select>
69
- </td>
70
- </tr>
71
-
72
- <tr>
73
- <td><label for="height">{#table_dlg.height}</label></td>
74
- <td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
75
- </tr>
76
- </table>
77
- </fieldset>
78
- </div>
79
-
80
- <div id="advanced_panel" class="panel">
81
- <fieldset>
82
- <legend>{#table_dlg.advanced_props}</legend>
83
-
84
- <table border="0" cellpadding="0" cellspacing="4">
85
- <tr>
86
- <td class="column1"><label for="id">{#table_dlg.id}</label></td>
87
- <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
88
- </tr>
89
-
90
- <tr>
91
- <td><label for="style">{#table_dlg.style}</label></td>
92
- <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
93
- </tr>
94
-
95
- <tr>
96
- <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
97
- <td>
98
- <select id="dir" name="dir" style="width: 200px">
99
- <option value="">{#not_set}</option>
100
- <option value="ltr">{#table_dlg.ltr}</option>
101
- <option value="rtl">{#table_dlg.rtl}</option>
102
- </select>
103
- </td>
104
- </tr>
105
-
106
- <tr>
107
- <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
108
- <td>
109
- <input id="lang" name="lang" type="text" value="" style="width: 200px" />
110
- </td>
111
- </tr>
112
-
113
- <tr>
114
- <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
115
- <td>
116
- <table border="0" cellpadding="0" cellspacing="0">
117
- <tr>
118
- <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
119
- <td id="backgroundimagebrowsercontainer">&nbsp;</td>
120
- </tr>
121
- </table>
122
- </td>
123
- </tr>
124
-
125
- <tr>
126
- <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
127
- <td>
128
- <table border="0" cellpadding="0" cellspacing="0">
129
- <tr>
130
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
131
- <td id="bgcolor_pickcontainer">&nbsp;</td>
132
- </tr>
133
- </table>
134
- </td>
135
- </tr>
136
- </table>
137
- </fieldset>
138
- </div>
139
- </div>
140
-
141
- <div class="mceActionPanel">
142
- <div>
143
- <select id="action" name="action">
144
- <option value="row">{#table_dlg.row_row}</option>
145
- <option value="odd">{#table_dlg.row_odd}</option>
146
- <option value="even">{#table_dlg.row_even}</option>
147
- <option value="all">{#table_dlg.row_all}</option>
148
- </select>
149
- </div>
150
-
151
- <div style="float: left">
152
- <div><input type="submit" id="insert" name="insert" value="{#update}" /></div>
153
- </div>
154
-
155
- <div style="float: right">
156
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
157
- </div>
158
- </div>
159
- </form>
160
- </body>
161
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#table_dlg.row_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
9
+ <script type="text/javascript" src="js/row.js?ver=311"></script>
10
+ <link href="css/row.css?ver=311" rel="stylesheet" type="text/css" />
11
+ <base target="_self" />
12
+ </head>
13
+ <body id="tablerow" style="display: none">
14
+ <form onsubmit="updateAction();return false;">
15
+ <div class="tabs">
16
+ <ul>
17
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
18
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
19
+ </ul>
20
+ </div>
21
+
22
+ <div class="panel_wrapper">
23
+ <div id="general_panel" class="panel current">
24
+ <fieldset>
25
+ <legend>{#table_dlg.general_props}</legend>
26
+
27
+ <table border="0" cellpadding="4" cellspacing="0">
28
+ <tr>
29
+ <td><label for="rowtype">{#table_dlg.rowtype}</label></td>
30
+ <td class="col2">
31
+ <select id="rowtype" name="rowtype" class="mceFocus">
32
+ <option value="thead">{#table_dlg.thead}</option>
33
+ <option value="tbody">{#table_dlg.tbody}</option>
34
+ <option value="tfoot">{#table_dlg.tfoot}</option>
35
+ </select>
36
+ </td>
37
+ </tr>
38
+
39
+ <tr>
40
+ <td><label for="align">{#table_dlg.align}</label></td>
41
+ <td class="col2">
42
+ <select id="align" name="align">
43
+ <option value="">{#not_set}</option>
44
+ <option value="center">{#table_dlg.align_middle}</option>
45
+ <option value="left">{#table_dlg.align_left}</option>
46
+ <option value="right">{#table_dlg.align_right}</option>
47
+ </select>
48
+ </td>
49
+ </tr>
50
+
51
+ <tr>
52
+ <td><label for="valign">{#table_dlg.valign}</label></td>
53
+ <td class="col2">
54
+ <select id="valign" name="valign">
55
+ <option value="">{#not_set}</option>
56
+ <option value="top">{#table_dlg.align_top}</option>
57
+ <option value="middle">{#table_dlg.align_middle}</option>
58
+ <option value="bottom">{#table_dlg.align_bottom}</option>
59
+ </select>
60
+ </td>
61
+ </tr>
62
+
63
+ <tr id="styleSelectRow">
64
+ <td><label for="class">{#class_name}</label></td>
65
+ <td class="col2">
66
+ <select id="class" name="class" class="mceEditableSelect">
67
+ <option value="" selected="selected">{#not_set}</option>
68
+ </select>
69
+ </td>
70
+ </tr>
71
+
72
+ <tr>
73
+ <td><label for="height">{#table_dlg.height}</label></td>
74
+ <td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
75
+ </tr>
76
+ </table>
77
+ </fieldset>
78
+ </div>
79
+
80
+ <div id="advanced_panel" class="panel">
81
+ <fieldset>
82
+ <legend>{#table_dlg.advanced_props}</legend>
83
+
84
+ <table border="0" cellpadding="0" cellspacing="4">
85
+ <tr>
86
+ <td class="column1"><label for="id">{#table_dlg.id}</label></td>
87
+ <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
88
+ </tr>
89
+
90
+ <tr>
91
+ <td><label for="style">{#table_dlg.style}</label></td>
92
+ <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
93
+ </tr>
94
+
95
+ <tr>
96
+ <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
97
+ <td>
98
+ <select id="dir" name="dir" style="width: 200px">
99
+ <option value="">{#not_set}</option>
100
+ <option value="ltr">{#table_dlg.ltr}</option>
101
+ <option value="rtl">{#table_dlg.rtl}</option>
102
+ </select>
103
+ </td>
104
+ </tr>
105
+
106
+ <tr>
107
+ <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
108
+ <td>
109
+ <input id="lang" name="lang" type="text" value="" style="width: 200px" />
110
+ </td>
111
+ </tr>
112
+
113
+ <tr>
114
+ <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
115
+ <td>
116
+ <table border="0" cellpadding="0" cellspacing="0">
117
+ <tr>
118
+ <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
119
+ <td id="backgroundimagebrowsercontainer">&nbsp;</td>
120
+ </tr>
121
+ </table>
122
+ </td>
123
+ </tr>
124
+
125
+ <tr>
126
+ <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
127
+ <td>
128
+ <table border="0" cellpadding="0" cellspacing="0">
129
+ <tr>
130
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
131
+ <td id="bgcolor_pickcontainer">&nbsp;</td>
132
+ </tr>
133
+ </table>
134
+ </td>
135
+ </tr>
136
+ </table>
137
+ </fieldset>
138
+ </div>
139
+ </div>
140
+
141
+ <div class="mceActionPanel">
142
+ <div>
143
+ <select id="action" name="action">
144
+ <option value="row">{#table_dlg.row_row}</option>
145
+ <option value="odd">{#table_dlg.row_odd}</option>
146
+ <option value="even">{#table_dlg.row_even}</option>
147
+ <option value="all">{#table_dlg.row_all}</option>
148
+ </select>
149
+ </div>
150
+
151
+ <div style="float: left">
152
+ <div><input type="submit" id="insert" name="insert" value="{#update}" /></div>
153
+ </div>
154
+
155
+ <div style="float: right">
156
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
157
+ </div>
158
+ </div>
159
+ </form>
160
+ </body>
161
+ </html>
mce/table/table.htm CHANGED
@@ -1,193 +1,193 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#table_dlg.title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
15
- <form onsubmit="insertTable();return false;" action="#">
16
- <div class="tabs">
17
- <ul>
18
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
19
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
20
- </ul>
21
- </div>
22
-
23
- <div class="panel_wrapper">
24
- <div id="general_panel" class="panel current">
25
- <fieldset>
26
- <legend>{#table_dlg.general_props}</legend>
27
- <table border="0" cellpadding="4" cellspacing="0" width="100%">
28
- <tr>
29
- <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td>
30
- <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" /></td>
31
- <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td>
32
- <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
33
- </tr>
34
- <tr>
35
- <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>
36
- <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
37
- <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>
38
- <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
39
- </tr>
40
- <tr>
41
- <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>
42
- <td><select id="align" name="align">
43
- <option value="">{#not_set}</option>
44
- <option value="center">{#table_dlg.align_middle}</option>
45
- <option value="left">{#table_dlg.align_left}</option>
46
- <option value="right">{#table_dlg.align_right}</option>
47
- </select></td>
48
- <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td>
49
- <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>
50
- </tr>
51
- <tr id="width_row">
52
- <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td>
53
- <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
54
- <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td>
55
- <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
56
- </tr>
57
- <tr id="styleSelectRow">
58
- <td><label id="classlabel" for="class">{#class_name}</label></td>
59
- <td colspan="3">
60
- <select id="class" name="class" class="mceEditableSelect">
61
- <option value="" selected>{#not_set}</option>
62
- </select></td>
63
- </tr>
64
- <tr>
65
- <td class="column1"><label for="caption">{#table_dlg.caption}</label></td>
66
- <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>
67
- </tr>
68
- </table>
69
- </fieldset>
70
- </div>
71
-
72
- <div id="advanced_panel" class="panel">
73
- <fieldset>
74
- <legend>{#table_dlg.advanced_props}</legend>
75
-
76
- <table border="0" cellpadding="0" cellspacing="4">
77
- <tr>
78
- <td class="column1"><label for="id">{#table_dlg.id}</label></td>
79
- <td><input id="id" name="id" type="text" value="" class="advfield" /></td>
80
- </tr>
81
-
82
- <tr>
83
- <td class="column1"><label for="summary">{#table_dlg.summary}</label></td>
84
- <td><input id="summary" name="summary" type="text" value="" class="advfield" /></td>
85
- </tr>
86
-
87
- <tr>
88
- <td><label for="style">{#table_dlg.style}</label></td>
89
- <td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>
90
- </tr>
91
-
92
- <tr>
93
- <td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td>
94
- <td>
95
- <input id="lang" name="lang" type="text" value="" class="advfield" />
96
- </td>
97
- </tr>
98
-
99
- <tr>
100
- <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
101
- <td>
102
- <table border="0" cellpadding="0" cellspacing="0">
103
- <tr>
104
- <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
105
- <td id="backgroundimagebrowsercontainer">&nbsp;</td>
106
- </tr>
107
- </table>
108
- </td>
109
- </tr>
110
-
111
- <tr>
112
- <td class="column1"><label for="frame">{#table_dlg.frame}</label></td>
113
- <td>
114
- <select id="frame" name="frame" class="advfield">
115
- <option value="">{#not_set}</option>
116
- <option value="none">{#table_dlg.frame_none}</option>
117
- <option value="groups">{#table_dlg.frame_groups}</option>
118
- <option value="rows">{#table_dlg.frame_rows}</option>
119
- <option value="cols">{#table_dlg.frame_cols}</option>
120
- <option value="all">{#table_dlg.frame_all}</option>
121
- </select>
122
- </td>
123
- </tr>
124
-
125
- <tr>
126
- <td class="column1"><label for="rules">{#table_dlg.rules}</label></td>
127
- <td>
128
- <select id="rules" name="rules" class="advfield">
129
- <option value="">{#not_set}</option>
130
- <option value="void">{#table_dlg.rules_void}</option>
131
- <option value="above">{#table_dlg.rules_above}</option>
132
- <option value="below">{#table_dlg.rules_below}</option>
133
- <option value="hsides">{#table_dlg.rules_hsides}</option>
134
- <option value="lhs">{#table_dlg.rules_lhs}</option>
135
- <option value="rhs">{#table_dlg.rules_rhs}</option>
136
- <option value="vsides">{#table_dlg.rules_vsides}</option>
137
- <option value="box">{#table_dlg.rules_box}</option>
138
- <option value="border">{#table_dlg.rules_border}</option>
139
- </select>
140
- </td>
141
- </tr>
142
-
143
- <tr>
144
- <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
145
- <td>
146
- <select id="dir" name="dir" class="advfield">
147
- <option value="">{#not_set}</option>
148
- <option value="ltr">{#table_dlg.ltr}</option>
149
- <option value="rtl">{#table_dlg.rtl}</option>
150
- </select>
151
- </td>
152
- </tr>
153
-
154
- <tr>
155
- <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td>
156
- <td>
157
- <table border="0" cellpadding="0" cellspacing="0">
158
- <tr>
159
- <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
160
- <td id="bordercolor_pickcontainer">&nbsp;</td>
161
- </tr>
162
- </table>
163
- </td>
164
- </tr>
165
-
166
- <tr>
167
- <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
168
- <td>
169
- <table border="0" cellpadding="0" cellspacing="0">
170
- <tr>
171
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
172
- <td id="bgcolor_pickcontainer">&nbsp;</td>
173
- </tr>
174
- </table>
175
- </td>
176
- </tr>
177
- </table>
178
- </fieldset>
179
- </div>
180
- </div>
181
-
182
- <div class="mceActionPanel">
183
- <div style="float: left">
184
- <input type="submit" id="insert" name="insert" value="{#insert}" />
185
- </div>
186
-
187
- <div style="float: right">
188
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
189
- </div>
190
- </div>
191
- </form>
192
- </body>
193
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#table_dlg.title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js?ver=311"></script>
9
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
10
+ <script type="text/javascript" src="js/table.js?ver=311"></script>
11
+ <link href="css/table.css?ver=311" rel="stylesheet" type="text/css" />
12
+ <base target="_self" />
13
+ </head>
14
+ <body id="table" style="display: none">
15
+ <form onsubmit="insertTable();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
19
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#table_dlg.general_props}</legend>
27
+ <table border="0" cellpadding="4" cellspacing="0" width="100%">
28
+ <tr>
29
+ <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td>
30
+ <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" /></td>
31
+ <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td>
32
+ <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
33
+ </tr>
34
+ <tr>
35
+ <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>
36
+ <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
37
+ <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>
38
+ <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
39
+ </tr>
40
+ <tr>
41
+ <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>
42
+ <td><select id="align" name="align">
43
+ <option value="">{#not_set}</option>
44
+ <option value="center">{#table_dlg.align_middle}</option>
45
+ <option value="left">{#table_dlg.align_left}</option>
46
+ <option value="right">{#table_dlg.align_right}</option>
47
+ </select></td>
48
+ <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td>
49
+ <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>
50
+ </tr>
51
+ <tr id="width_row">
52
+ <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td>
53
+ <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
54
+ <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td>
55
+ <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
56
+ </tr>
57
+ <tr id="styleSelectRow">
58
+ <td><label id="classlabel" for="class">{#class_name}</label></td>
59
+ <td colspan="3">
60
+ <select id="class" name="class" class="mceEditableSelect">
61
+ <option value="" selected>{#not_set}</option>
62
+ </select></td>
63
+ </tr>
64
+ <tr>
65
+ <td class="column1"><label for="caption">{#table_dlg.caption}</label></td>
66
+ <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>
67
+ </tr>
68
+ </table>
69
+ </fieldset>
70
+ </div>
71
+
72
+ <div id="advanced_panel" class="panel">
73
+ <fieldset>
74
+ <legend>{#table_dlg.advanced_props}</legend>
75
+
76
+ <table border="0" cellpadding="0" cellspacing="4">
77
+ <tr>
78
+ <td class="column1"><label for="id">{#table_dlg.id}</label></td>
79
+ <td><input id="id" name="id" type="text" value="" class="advfield" /></td>
80
+ </tr>
81
+
82
+ <tr>
83
+ <td class="column1"><label for="summary">{#table_dlg.summary}</label></td>
84
+ <td><input id="summary" name="summary" type="text" value="" class="advfield" /></td>
85
+ </tr>
86
+
87
+ <tr>
88
+ <td><label for="style">{#table_dlg.style}</label></td>
89
+ <td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>
90
+ </tr>
91
+
92
+ <tr>
93
+ <td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td>
94
+ <td>
95
+ <input id="lang" name="lang" type="text" value="" class="advfield" />
96
+ </td>
97
+ </tr>
98
+
99
+ <tr>
100
+ <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
101
+ <td>
102
+ <table border="0" cellpadding="0" cellspacing="0">
103
+ <tr>
104
+ <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
105
+ <td id="backgroundimagebrowsercontainer">&nbsp;</td>
106
+ </tr>
107
+ </table>
108
+ </td>
109
+ </tr>
110
+
111
+ <tr>
112
+ <td class="column1"><label for="frame">{#table_dlg.frame}</label></td>
113
+ <td>
114
+ <select id="frame" name="frame" class="advfield">
115
+ <option value="">{#not_set}</option>
116
+ <option value="void">{#table_dlg.rules_void}</option>
117
+ <option value="above">{#table_dlg.rules_above}</option>
118
+ <option value="below">{#table_dlg.rules_below}</option>
119
+ <option value="hsides">{#table_dlg.rules_hsides}</option>
120
+ <option value="lhs">{#table_dlg.rules_lhs}</option>
121
+ <option value="rhs">{#table_dlg.rules_rhs}</option>
122
+ <option value="vsides">{#table_dlg.rules_vsides}</option>
123
+ <option value="box">{#table_dlg.rules_box}</option>
124
+ <option value="border">{#table_dlg.rules_border}</option>
125
+ </select>
126
+ </td>
127
+ </tr>
128
+
129
+ <tr>
130
+ <td class="column1"><label for="rules">{#table_dlg.rules}</label></td>
131
+ <td>
132
+ <select id="rules" name="rules" class="advfield">
133
+ <option value="">{#not_set}</option>
134
+ <option value="none">{#table_dlg.frame_none}</option>
135
+ <option value="groups">{#table_dlg.frame_groups}</option>
136
+ <option value="rows">{#table_dlg.frame_rows}</option>
137
+ <option value="cols">{#table_dlg.frame_cols}</option>
138
+ <option value="all">{#table_dlg.frame_all}</option>
139
+ </select>
140
+ </td>
141
+ </tr>
142
+
143
+ <tr>
144
+ <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
145
+ <td>
146
+ <select id="dir" name="dir" class="advfield">
147
+ <option value="">{#not_set}</option>
148
+ <option value="ltr">{#table_dlg.ltr}</option>
149
+ <option value="rtl">{#table_dlg.rtl}</option>
150
+ </select>
151
+ </td>
152
+ </tr>
153
+
154
+ <tr>
155
+ <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td>
156
+ <td>
157
+ <table border="0" cellpadding="0" cellspacing="0">
158
+ <tr>
159
+ <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
160
+ <td id="bordercolor_pickcontainer">&nbsp;</td>
161
+ </tr>
162
+ </table>
163
+ </td>
164
+ </tr>
165
+
166
+ <tr>
167
+ <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
168
+ <td>
169
+ <table border="0" cellpadding="0" cellspacing="0">
170
+ <tr>
171
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
172
+ <td id="bgcolor_pickcontainer">&nbsp;</td>
173
+ </tr>
174
+ </table>
175
+ </td>
176
+ </tr>
177
+ </table>
178
+ </fieldset>
179
+ </div>
180
+ </div>
181
+
182
+ <div class="mceActionPanel">
183
+ <div style="float: left">
184
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
185
+ </div>
186
+
187
+ <div style="float: right">
188
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
189
+ </div>
190
+ </div>
191
+ </form>
192
+ </body>
193
+ </html>
mce/xhtmlxtras/abbr.htm CHANGED
@@ -1,149 +1,149 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#xhtmlxtras_dlg.title_abbr_element}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
15
- <form onsubmit="insertAbbr();return false;" action="#">
16
- <div class="tabs">
17
- <ul>
18
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
- <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
- </ul>
21
- </div>
22
-
23
- <div class="panel_wrapper">
24
- <div id="general_panel" class="panel current">
25
- <fieldset>
26
- <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27
- <table border="0" cellpadding="0" cellspacing="4">
28
- <tr>
29
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30
- <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31
- </tr>
32
- <tr>
33
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34
- <td><input id="id" name="id" type="text" value="" class="field" /></td>
35
- </tr>
36
- <tr>
37
- <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38
- <td>
39
- <select id="class" name="class" class="field mceEditableSelect">
40
- <option value="">{#not_set}</option>
41
- </select>
42
- </td>
43
- </tr>
44
- <tr>
45
- <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46
- <td><input id="style" name="style" type="text" value="" class="field" /></td>
47
- </tr>
48
- <tr>
49
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50
- <td>
51
- <select id="dir" name="dir" class="field">
52
- <option value="">{#not_set}</option>
53
- <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54
- <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55
- </select>
56
- </td>
57
- </tr>
58
- <tr>
59
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60
- <td>
61
- <input id="lang" name="lang" type="text" value="" class="field" />
62
- </td>
63
- </tr>
64
- </table>
65
- </fieldset>
66
- </div>
67
- <div id="events_panel" class="panel">
68
- <fieldset>
69
- <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
-
71
- <table border="0" cellpadding="0" cellspacing="4">
72
- <tr>
73
- <td class="label"><label for="onfocus">onfocus</label>:</td>
74
- <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75
- </tr>
76
-
77
- <tr>
78
- <td class="label"><label for="onblur">onblur</label>:</td>
79
- <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80
- </tr>
81
-
82
- <tr>
83
- <td class="label"><label for="onclick">onclick</label>:</td>
84
- <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85
- </tr>
86
-
87
- <tr>
88
- <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89
- <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90
- </tr>
91
-
92
- <tr>
93
- <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94
- <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95
- </tr>
96
-
97
- <tr>
98
- <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99
- <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100
- </tr>
101
-
102
- <tr>
103
- <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104
- <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105
- </tr>
106
-
107
- <tr>
108
- <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109
- <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110
- </tr>
111
-
112
- <tr>
113
- <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114
- <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115
- </tr>
116
-
117
- <tr>
118
- <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119
- <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120
- </tr>
121
-
122
- <tr>
123
- <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124
- <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125
- </tr>
126
-
127
- <tr>
128
- <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129
- <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130
- </tr>
131
- </table>
132
- </fieldset>
133
- </div>
134
- </div>
135
- <div class="mceActionPanel">
136
- <div style="float: left">
137
- <input type="submit" id="insert" name="insert" value="{#update}" />
138
- </div>
139
- <div style="float: left">
140
- <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" />
141
- </div>
142
- <div style="float: right">
143
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144
- </div>
145
- </div>
146
-
147
- </form>
148
- </body>
149
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.title_abbr_element}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
9
+ <script type="text/javascript" src="js/element_common.js?ver=311"></script>
10
+ <script type="text/javascript" src="js/abbr.js?ver=311"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?ver=311" />
12
+ <base target="_self" />
13
+ </head>
14
+ <body style="display: none">
15
+ <form onsubmit="insertAbbr();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27
+ <table border="0" cellpadding="0" cellspacing="4">
28
+ <tr>
29
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30
+ <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31
+ </tr>
32
+ <tr>
33
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34
+ <td><input id="id" name="id" type="text" value="" class="field" /></td>
35
+ </tr>
36
+ <tr>
37
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38
+ <td>
39
+ <select id="class" name="class" class="field mceEditableSelect">
40
+ <option value="">{#not_set}</option>
41
+ </select>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46
+ <td><input id="style" name="style" type="text" value="" class="field" /></td>
47
+ </tr>
48
+ <tr>
49
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50
+ <td>
51
+ <select id="dir" name="dir" class="field">
52
+ <option value="">{#not_set}</option>
53
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55
+ </select>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60
+ <td>
61
+ <input id="lang" name="lang" type="text" value="" class="field" />
62
+ </td>
63
+ </tr>
64
+ </table>
65
+ </fieldset>
66
+ </div>
67
+ <div id="events_panel" class="panel">
68
+ <fieldset>
69
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
+
71
+ <table border="0" cellpadding="0" cellspacing="4">
72
+ <tr>
73
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
74
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75
+ </tr>
76
+
77
+ <tr>
78
+ <td class="label"><label for="onblur">onblur</label>:</td>
79
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80
+ </tr>
81
+
82
+ <tr>
83
+ <td class="label"><label for="onclick">onclick</label>:</td>
84
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85
+ </tr>
86
+
87
+ <tr>
88
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90
+ </tr>
91
+
92
+ <tr>
93
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115
+ </tr>
116
+
117
+ <tr>
118
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130
+ </tr>
131
+ </table>
132
+ </fieldset>
133
+ </div>
134
+ </div>
135
+ <div class="mceActionPanel">
136
+ <div style="float: left">
137
+ <input type="submit" id="insert" name="insert" value="{#update}" />
138
+ </div>
139
+ <div style="float: left">
140
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" />
141
+ </div>
142
+ <div style="float: right">
143
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144
+ </div>
145
+ </div>
146
+
147
+ </form>
148
+ </body>
149
+ </html>
mce/xhtmlxtras/acronym.htm CHANGED
@@ -1,149 +1,149 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#xhtmlxtras_dlg.title_acronym_element}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
15
- <form onsubmit="insertAcronym();return false;" action="#">
16
- <div class="tabs">
17
- <ul>
18
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
- <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
- </ul>
21
- </div>
22
-
23
- <div class="panel_wrapper">
24
- <div id="general_panel" class="panel current">
25
- <fieldset>
26
- <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27
- <table border="0" cellpadding="0" cellspacing="4">
28
- <tr>
29
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30
- <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31
- </tr>
32
- <tr>
33
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34
- <td><input id="id" name="id" type="text" value="" class="field" /></td>
35
- </tr>
36
- <tr>
37
- <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38
- <td>
39
- <select id="class" name="class" class="field mceEditableSelect">
40
- <option value="">{#not_set}</option>
41
- </select>
42
- </td>
43
- </tr>
44
- <tr>
45
- <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46
- <td><input id="style" name="style" type="text" value="" class="field" /></td>
47
- </tr>
48
- <tr>
49
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50
- <td>
51
- <select id="dir" name="dir" class="field">
52
- <option value="">{#not_set}</option>
53
- <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54
- <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55
- </select>
56
- </td>
57
- </tr>
58
- <tr>
59
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60
- <td>
61
- <input id="lang" name="lang" type="text" value="" class="field" />
62
- </td>
63
- </tr>
64
- </table>
65
- </fieldset>
66
- </div>
67
- <div id="events_panel" class="panel">
68
- <fieldset>
69
- <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
-
71
- <table border="0" cellpadding="0" cellspacing="4">
72
- <tr>
73
- <td class="label"><label for="onfocus">onfocus</label>:</td>
74
- <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75
- </tr>
76
-
77
- <tr>
78
- <td class="label"><label for="onblur">onblur</label>:</td>
79
- <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80
- </tr>
81
-
82
- <tr>
83
- <td class="label"><label for="onclick">onclick</label>:</td>
84
- <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85
- </tr>
86
-
87
- <tr>
88
- <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89
- <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90
- </tr>
91
-
92
- <tr>
93
- <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94
- <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95
- </tr>
96
-
97
- <tr>
98
- <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99
- <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100
- </tr>
101
-
102
- <tr>
103
- <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104
- <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105
- </tr>
106
-
107
- <tr>
108
- <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109
- <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110
- </tr>
111
-
112
- <tr>
113
- <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114
- <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115
- </tr>
116
-
117
- <tr>
118
- <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119
- <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120
- </tr>
121
-
122
- <tr>
123
- <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124
- <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125
- </tr>
126
-
127
- <tr>
128
- <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129
- <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130
- </tr>
131
- </table>
132
- </fieldset>
133
- </div>
134
- </div>
135
- <div class="mceActionPanel">
136
- <div style="float: left">
137
- <input type="submit" id="insert" name="insert" value="{#update}" />
138
- </div>
139
- <div style="float: left">
140
- <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" />
141
- </div>
142
- <div style="float: right">
143
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144
- </div>
145
- </div>
146
-
147
- </form>
148
- </body>
149
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.title_acronym_element}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
9
+ <script type="text/javascript" src="js/element_common.js?ver=311"></script>
10
+ <script type="text/javascript" src="js/acronym.js?ver=311"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?ver=311" />
12
+ <base target="_self" />
13
+ </head>
14
+ <body style="display: none">
15
+ <form onsubmit="insertAcronym();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27
+ <table border="0" cellpadding="0" cellspacing="4">
28
+ <tr>
29
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30
+ <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31
+ </tr>
32
+ <tr>
33
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34
+ <td><input id="id" name="id" type="text" value="" class="field" /></td>
35
+ </tr>
36
+ <tr>
37
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38
+ <td>
39
+ <select id="class" name="class" class="field mceEditableSelect">
40
+ <option value="">{#not_set}</option>
41
+ </select>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46
+ <td><input id="style" name="style" type="text" value="" class="field" /></td>
47
+ </tr>
48
+ <tr>
49
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50
+ <td>
51
+ <select id="dir" name="dir" class="field">
52
+ <option value="">{#not_set}</option>
53
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55
+ </select>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60
+ <td>
61
+ <input id="lang" name="lang" type="text" value="" class="field" />
62
+ </td>
63
+ </tr>
64
+ </table>
65
+ </fieldset>
66
+ </div>
67
+ <div id="events_panel" class="panel">
68
+ <fieldset>
69
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
+
71
+ <table border="0" cellpadding="0" cellspacing="4">
72
+ <tr>
73
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
74
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75
+ </tr>
76
+
77
+ <tr>
78
+ <td class="label"><label for="onblur">onblur</label>:</td>
79
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80
+ </tr>
81
+
82
+ <tr>
83
+ <td class="label"><label for="onclick">onclick</label>:</td>
84
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85
+ </tr>
86
+
87
+ <tr>
88
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90
+ </tr>
91
+
92
+ <tr>
93
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115
+ </tr>
116
+
117
+ <tr>
118
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130
+ </tr>
131
+ </table>
132
+ </fieldset>
133
+ </div>
134
+ </div>
135
+ <div class="mceActionPanel">
136
+ <div style="float: left">
137
+ <input type="submit" id="insert" name="insert" value="{#update}" />
138
+ </div>
139
+ <div style="float: left">
140
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" />
141
+ </div>
142
+ <div style="float: right">
143
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144
+ </div>
145
+ </div>
146
+
147
+ </form>
148
+ </body>
149
+ </html>
mce/xhtmlxtras/attributes.htm CHANGED
@@ -1,154 +1,154 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#xhtmlxtras_dlg.attribs_title}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
14
- <form onsubmit="insertAction();return false;" action="#">
15
- <div class="tabs">
16
- <ul>
17
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_attrib_tab}</a></span></li>
18
- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_events_tab}</a></span></li>
19
- </ul>
20
- </div>
21
-
22
- <div class="panel_wrapper">
23
- <div id="general_panel" class="panel current">
24
- <fieldset>
25
- <legend>{#xhtmlxtras_dlg.attribute_attrib_tab}</legend>
26
- <table border="0" cellpadding="0" cellspacing="4">
27
- <tr>
28
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
29
- <td><input id="title" name="title" type="text" value="" class="mceFocus" /></td>
30
- </tr>
31
- <tr>
32
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
33
- <td><input id="id" name="id" type="text" value="" /></td>
34
- </tr>
35
- <tr>
36
- <td><label id="classlabel" for="classlist">{#class_name}</label></td>
37
- <td>
38
- <select id="classlist" name="classlist" class="mceEditableSelect">
39
- <option value="" selected>{#not_set}</option>
40
- </select>
41
- </td>
42
- </tr>
43
- <tr>
44
- <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
45
- <td><input id="style" name="style" type="text" value="" /></td>
46
- </tr>
47
- <tr>
48
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
49
- <td>
50
- <select id="dir" name="dir">
51
- <option value="">{#not_set}</option>
52
- <option value="ltr">{#xhtmlxtras_dlg.option_ltr}</option>
53
- <option value="rtl">{#xhtmlxtras_dlg.option_rtl}</option>
54
- </select>
55
- </td>
56
- </tr>
57
- <tr>
58
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
59
- <td>
60
- <input id="lang" name="lang" type="text" value="" />
61
- </td>
62
- </tr>
63
- <tr>
64
- <td><label id="tabindexlabel" for="tabindex">{#xhtmlxtras_dlg.attribute_label_tabindex}</label></td>
65
- <td><input type="text" id="tabindex" name="tabindex" value="" /></td>
66
- </tr>
67
-
68
- <tr>
69
- <td><label id="accesskeylabel" for="accesskey">{#xhtmlxtras_dlg.attribute_label_accesskey}</label></td>
70
- <td><input type="text" id="accesskey" name="accesskey" value="" /></td>
71
- </tr>
72
- </table>
73
- </fieldset>
74
- </div>
75
- <div id="events_panel" class="panel">
76
- <fieldset>
77
- <legend>{#xhtmlxtras_dlg.attribute_events_tab}</legend>
78
-
79
- <table border="0" cellpadding="0" cellspacing="4">
80
- <tr>
81
- <td class="label"><label for="onfocus">onfocus</label>:</td>
82
- <td><input id="onfocus" name="onfocus" type="text" value="" /></td>
83
- </tr>
84
-
85
- <tr>
86
- <td class="label"><label for="onblur">onblur</label>:</td>
87
- <td><input id="onblur" name="onblur" type="text" value="" /></td>
88
- </tr>
89
-
90
- <tr>
91
- <td class="label"><label for="onclick">onclick</label>:</td>
92
- <td><input id="onclick" name="onclick" type="text" value="" /></td>
93
- </tr>
94
-
95
- <tr>
96
- <td class="label"><label for="ondblclick">ondblclick</label>:</td>
97
- <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
98
- </tr>
99
-
100
- <tr>
101
- <td class="label"><label for="onmousedown">onmousedown</label>:</td>
102
- <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
103
- </tr>
104
-
105
- <tr>
106
- <td class="label"><label for="onmouseup">onmouseup</label>:</td>
107
- <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
108
- </tr>
109
-
110
- <tr>
111
- <td class="label"><label for="onmouseover">onmouseover</label>:</td>
112
- <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
113
- </tr>
114
-
115
- <tr>
116
- <td class="label"><label for="onmousemove">onmousemove</label>:</td>
117
- <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
118
- </tr>
119
-
120
- <tr>
121
- <td class="label"><label for="onmouseout">onmouseout</label>:</td>
122
- <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
123
- </tr>
124
-
125
- <tr>
126
- <td class="label"><label for="onkeypress">onkeypress</label>:</td>
127
- <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
128
- </tr>
129
-
130
- <tr>
131
- <td class="label"><label for="onkeydown">onkeydown</label>:</td>
132
- <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
133
- </tr>
134
-
135
- <tr>
136
- <td class="label"><label for="onkeyup">onkeyup</label>:</td>
137
- <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
138
- </tr>
139
- </table>
140
- </fieldset>
141
- </div>
142
- </div>
143
- <div class="mceActionPanel">
144
- <div style="float: left">
145
- <input type="submit" id="insert" name="insert" value="{#insert}" />
146
- </div>
147
- <div style="float: right">
148
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
149
- </div>
150
- </div>
151
-
152
- </form>
153
- </body>
154
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.attribs_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
9
+ <script type="text/javascript" src="js/attributes.js?ver=311"></script>
10
+ <link rel="stylesheet" type="text/css" href="css/attributes.css?ver=311" />
11
+ <base target="_self" />
12
+ </head>
13
+ <body style="display: none">
14
+ <form onsubmit="insertAction();return false;" action="#">
15
+ <div class="tabs">
16
+ <ul>
17
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_attrib_tab}</a></span></li>
18
+ <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_events_tab}</a></span></li>
19
+ </ul>
20
+ </div>
21
+
22
+ <div class="panel_wrapper">
23
+ <div id="general_panel" class="panel current">
24
+ <fieldset>
25
+ <legend>{#xhtmlxtras_dlg.attribute_attrib_tab}</legend>
26
+ <table border="0" cellpadding="0" cellspacing="4">
27
+ <tr>
28
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
29
+ <td><input id="title" name="title" type="text" value="" class="mceFocus" /></td>
30
+ </tr>
31
+ <tr>
32
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
33
+ <td><input id="id" name="id" type="text" value="" /></td>
34
+ </tr>
35
+ <tr>
36
+ <td><label id="classlabel" for="classlist">{#class_name}</label></td>
37
+ <td>
38
+ <select id="classlist" name="classlist" class="mceEditableSelect">
39
+ <option value="" selected>{#not_set}</option>
40
+ </select>
41
+ </td>
42
+ </tr>
43
+ <tr>
44
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
45
+ <td><input id="style" name="style" type="text" value="" /></td>
46
+ </tr>
47
+ <tr>
48
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
49
+ <td>
50
+ <select id="dir" name="dir">
51
+ <option value="">{#not_set}</option>
52
+ <option value="ltr">{#xhtmlxtras_dlg.option_ltr}</option>
53
+ <option value="rtl">{#xhtmlxtras_dlg.option_rtl}</option>
54
+ </select>
55
+ </td>
56
+ </tr>
57
+ <tr>
58
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
59
+ <td>
60
+ <input id="lang" name="lang" type="text" value="" />
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td><label id="tabindexlabel" for="tabindex">{#xhtmlxtras_dlg.attribute_label_tabindex}</label></td>
65
+ <td><input type="text" id="tabindex" name="tabindex" value="" /></td>
66
+ </tr>
67
+
68
+ <tr>
69
+ <td><label id="accesskeylabel" for="accesskey">{#xhtmlxtras_dlg.attribute_label_accesskey}</label></td>
70
+ <td><input type="text" id="accesskey" name="accesskey" value="" /></td>
71
+ </tr>
72
+ </table>
73
+ </fieldset>
74
+ </div>
75
+ <div id="events_panel" class="panel">
76
+ <fieldset>
77
+ <legend>{#xhtmlxtras_dlg.attribute_events_tab}</legend>
78
+
79
+ <table border="0" cellpadding="0" cellspacing="4">
80
+ <tr>
81
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
82
+ <td><input id="onfocus" name="onfocus" type="text" value="" /></td>
83
+ </tr>
84
+
85
+ <tr>
86
+ <td class="label"><label for="onblur">onblur</label>:</td>
87
+ <td><input id="onblur" name="onblur" type="text" value="" /></td>
88
+ </tr>
89
+
90
+ <tr>
91
+ <td class="label"><label for="onclick">onclick</label>:</td>
92
+ <td><input id="onclick" name="onclick" type="text" value="" /></td>
93
+ </tr>
94
+
95
+ <tr>
96
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
97
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
98
+ </tr>
99
+
100
+ <tr>
101
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
102
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
103
+ </tr>
104
+
105
+ <tr>
106
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
107
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
108
+ </tr>
109
+
110
+ <tr>
111
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
112
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
113
+ </tr>
114
+
115
+ <tr>
116
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
117
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
118
+ </tr>
119
+
120
+ <tr>
121
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
122
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
123
+ </tr>
124
+
125
+ <tr>
126
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
127
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
128
+ </tr>
129
+
130
+ <tr>
131
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
132
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
133
+ </tr>
134
+
135
+ <tr>
136
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
137
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
138
+ </tr>
139
+ </table>
140
+ </fieldset>
141
+ </div>
142
+ </div>
143
+ <div class="mceActionPanel">
144
+ <div style="float: left">
145
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
146
+ </div>
147
+ <div style="float: right">
148
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
149
+ </div>
150
+ </div>
151
+
152
+ </form>
153
+ </body>
154
+ </html>
mce/xhtmlxtras/cite.htm CHANGED
@@ -1,149 +1,149 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#xhtmlxtras_dlg.title_cite_element}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
15
- <form onsubmit="insertCite();return false;" action="#">
16
- <div class="tabs">
17
- <ul>
18
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
- <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
- </ul>
21
- </div>
22
-
23
- <div class="panel_wrapper">
24
- <div id="general_panel" class="panel current">
25
- <fieldset>
26
- <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27
- <table border="0" cellpadding="0" cellspacing="4">
28
- <tr>
29
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30
- <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31
- </tr>
32
- <tr>
33
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34
- <td><input id="id" name="id" type="text" value="" class="field" /></td>
35
- </tr>
36
- <tr>
37
- <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38
- <td>
39
- <select id="class" name="class" class="field mceEditableSelect">
40
- <option value="">{#not_set}</option>
41
- </select>
42
- </td>
43
- </tr>
44
- <tr>
45
- <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46
- <td><input id="style" name="style" type="text" value="" class="field" /></td>
47
- </tr>
48
- <tr>
49
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50
- <td>
51
- <select id="dir" name="dir" class="field">
52
- <option value="">{#not_set}</option>
53
- <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54
- <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55
- </select>
56
- </td>
57
- </tr>
58
- <tr>
59
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60
- <td>
61
- <input id="lang" name="lang" type="text" value="" class="field" />
62
- </td>
63
- </tr>
64
- </table>
65
- </fieldset>
66
- </div>
67
- <div id="events_panel" class="panel">
68
- <fieldset>
69
- <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
-
71
- <table border="0" cellpadding="0" cellspacing="4">
72
- <tr>
73
- <td class="label"><label for="onfocus">onfocus</label>:</td>
74
- <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75
- </tr>
76
-
77
- <tr>
78
- <td class="label"><label for="onblur">onblur</label>:</td>
79
- <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80
- </tr>
81
-
82
- <tr>
83
- <td class="label"><label for="onclick">onclick</label>:</td>
84
- <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85
- </tr>
86
-
87
- <tr>
88
- <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89
- <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90
- </tr>
91
-
92
- <tr>
93
- <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94
- <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95
- </tr>
96
-
97
- <tr>
98
- <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99
- <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100
- </tr>
101
-
102
- <tr>
103
- <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104
- <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105
- </tr>
106
-
107
- <tr>
108
- <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109
- <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110
- </tr>
111
-
112
- <tr>
113
- <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114
- <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115
- </tr>
116
-
117
- <tr>
118
- <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119
- <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120
- </tr>
121
-
122
- <tr>
123
- <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124
- <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125
- </tr>
126
-
127
- <tr>
128
- <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129
- <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130
- </tr>
131
- </table>
132
- </fieldset>
133
- </div>
134
- </div>
135
- <div class="mceActionPanel">
136
- <div style="float: left">
137
- <input type="submit" id="insert" name="insert" value="{#update}" />
138
- </div>
139
- <div style="float: left">
140
- <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" />
141
- </div>
142
- <div style="float: right">
143
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144
- </div>
145
- </div>
146
-
147
- </form>
148
- </body>
149
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.title_cite_element}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
9
+ <script type="text/javascript" src="js/element_common.js?ver=311"></script>
10
+ <script type="text/javascript" src="js/cite.js?ver=311"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?ver=311" />
12
+ <base target="_self" />
13
+ </head>
14
+ <body style="display: none">
15
+ <form onsubmit="insertCite();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27
+ <table border="0" cellpadding="0" cellspacing="4">
28
+ <tr>
29
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30
+ <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31
+ </tr>
32
+ <tr>
33
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34
+ <td><input id="id" name="id" type="text" value="" class="field" /></td>
35
+ </tr>
36
+ <tr>
37
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38
+ <td>
39
+ <select id="class" name="class" class="field mceEditableSelect">
40
+ <option value="">{#not_set}</option>
41
+ </select>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46
+ <td><input id="style" name="style" type="text" value="" class="field" /></td>
47
+ </tr>
48
+ <tr>
49
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50
+ <td>
51
+ <select id="dir" name="dir" class="field">
52
+ <option value="">{#not_set}</option>
53
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55
+ </select>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60
+ <td>
61
+ <input id="lang" name="lang" type="text" value="" class="field" />
62
+ </td>
63
+ </tr>
64
+ </table>
65
+ </fieldset>
66
+ </div>
67
+ <div id="events_panel" class="panel">
68
+ <fieldset>
69
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
+
71
+ <table border="0" cellpadding="0" cellspacing="4">
72
+ <tr>
73
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
74
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75
+ </tr>
76
+
77
+ <tr>
78
+ <td class="label"><label for="onblur">onblur</label>:</td>
79
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80
+ </tr>
81
+
82
+ <tr>
83
+ <td class="label"><label for="onclick">onclick</label>:</td>
84
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85
+ </tr>
86
+
87
+ <tr>
88
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90
+ </tr>
91
+
92
+ <tr>
93
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115
+ </tr>
116
+
117
+ <tr>
118
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130
+ </tr>
131
+ </table>
132
+ </fieldset>
133
+ </div>
134
+ </div>
135
+ <div class="mceActionPanel">
136
+ <div style="float: left">
137
+ <input type="submit" id="insert" name="insert" value="{#update}" />
138
+ </div>
139
+ <div style="float: left">
140
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" />
141
+ </div>
142
+ <div style="float: right">
143
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
144
+ </div>
145
+ </div>
146
+
147
+ </form>
148
+ </body>
149
+ </html>
mce/xhtmlxtras/css/attributes.css CHANGED
@@ -1,11 +1,11 @@
1
- .panel_wrapper div.current {
2
- height: 290px;
3
- }
4
-
5
- #id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey {
6
- width: 200px;
7
- }
8
-
9
- #events_panel input {
10
- width: 200px;
11
- }
1
+ .panel_wrapper div.current {
2
+ height: 290px;
3
+ }
4
+
5
+ #id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey {
6
+ width: 200px;
7
+ }
8
+
9
+ #events_panel input {
10
+ width: 200px;
11
+ }
mce/xhtmlxtras/css/popup.css CHANGED
@@ -1,9 +1,9 @@
1
- input.field, select.field {width:200px;}
2
- input.picker {width:179px; margin-left: 5px;}
3
- input.disabled {border-color:#F2F2F2;}
4
- img.picker {vertical-align:text-bottom; cursor:pointer;}
5
- h1 {padding: 0 0 5px 0;}
6
- .panel_wrapper div.current {height:160px;}
7
- #xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;}
8
- a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;}
9
- #datetime {width:180px;}
1
+ input.field, select.field {width:200px;}
2
+ input.picker {width:179px; margin-left: 5px;}
3
+ input.disabled {border-color:#F2F2F2;}
4
+ img.picker {vertical-align:text-bottom; cursor:pointer;}
5
+ h1 {padding: 0 0 5px 0;}
6
+ .panel_wrapper div.current {height:160px;}
7
+ #xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;}
8
+ a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;}
9
+ #datetime {width:180px;}
mce/xhtmlxtras/del.htm CHANGED
@@ -1,170 +1,170 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#xhtmlxtras_dlg.title_del_element}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
15
- <form onsubmit="insertDel();return false;" action="#">
16
- <div class="tabs">
17
- <ul>
18
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
- <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
- </ul>
21
- </div>
22
-
23
- <div class="panel_wrapper">
24
- <div id="general_panel" class="panel current">
25
- <fieldset>
26
- <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>
27
- <table border="0" cellpadding="0" cellspacing="4">
28
- <tr>
29
- <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>
30
- <td>
31
- <table border="0" cellspacing="0" cellpadding="0">
32
- <tr>
33
- <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
34
- <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
35
- </tr>
36
- </table>
37
- </td>
38
- </tr>
39
- <tr>
40
- <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>
41
- <td><input id="cite" name="cite" type="text" value="" class="field" /></td>
42
- </tr>
43
- </table>
44
- </fieldset>
45
- <fieldset>
46
- <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
47
- <table border="0" cellpadding="0" cellspacing="4">
48
- <tr>
49
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
50
- <td><input id="title" name="title" type="text" value="" class="field" /></td>
51
- </tr>
52
- <tr>
53
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
54
- <td><input id="id" name="id" type="text" value="" class="field" /></td>
55
- </tr>
56
- <tr>
57
- <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
58
- <td>
59
- <select id="class" name="class" class="field mceEditableSelect">
60
- <option value="">{#not_set}</option>
61
- </select>
62
- </td>
63
- </tr>
64
- <tr>
65
- <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
66
- <td><input id="style" name="style" type="text" value="" class="field" /></td>
67
- </tr>
68
- <tr>
69
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
70
- <td>
71
- <select id="dir" name="dir" class="field">
72
- <option value="">{#not_set}</option>
73
- <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
74
- <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
75
- </select>
76
- </td>
77
- </tr>
78
- <tr>
79
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
80
- <td>
81
- <input id="lang" name="lang" type="text" value="" class="field" />
82
- </td>
83
- </tr>
84
- </table>
85
- </fieldset>
86
- </div>
87
- <div id="events_panel" class="panel">
88
- <fieldset>
89
- <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
90
-
91
- <table border="0" cellpadding="0" cellspacing="4">
92
- <tr>
93
- <td class="label"><label for="onfocus">onfocus</label>:</td>
94
- <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
95
- </tr>
96
-
97
- <tr>
98
- <td class="label"><label for="onblur">onblur</label>:</td>
99
- <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
100
- </tr>
101
-
102
- <tr>
103
- <td class="label"><label for="onclick">onclick</label>:</td>
104
- <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
105
- </tr>
106
-
107
- <tr>
108
- <td class="label"><label for="ondblclick">ondblclick</label>:</td>
109
- <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
110
- </tr>
111
-
112
- <tr>
113
- <td class="label"><label for="onmousedown">onmousedown</label>:</td>
114
- <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
115
- </tr>
116
-
117
- <tr>
118
- <td class="label"><label for="onmouseup">onmouseup</label>:</td>
119
- <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
120
- </tr>
121
-
122
- <tr>
123
- <td class="label"><label for="onmouseover">onmouseover</label>:</td>
124
- <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
125
- </tr>
126
-
127
- <tr>
128
- <td class="label"><label for="onmousemove">onmousemove</label>:</td>
129
- <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
130
- </tr>
131
-
132
- <tr>
133
- <td class="label"><label for="onmouseout">onmouseout</label>:</td>
134
- <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
135
- </tr>
136
-
137
- <tr>
138
- <td class="label"><label for="onkeypress">onkeypress</label>:</td>
139
- <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
140
- </tr>
141
-
142
- <tr>
143
- <td class="label"><label for="onkeydown">onkeydown</label>:</td>
144
- <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
145
- </tr>
146
-
147
- <tr>
148
- <td class="label"><label for="onkeyup">onkeyup</label>:</td>
149
- <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
150
- </tr>
151
- </table>
152
- </fieldset>
153
- </div>
154
- </div>
155
- <div class="mceActionPanel">
156
- <div style="float: left">
157
- <input type="submit" id="insert" name="insert" value="{#update}" />
158
- </div>
159
- <div style="float: left">
160
- <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" />
161
- </div>
162
- <div style="float: right">
163
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
164
- </div>
165
- </div>
166
-
167
- </form>
168
-
169
- </body>
170
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.title_del_element}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
9
+ <script type="text/javascript" src="js/element_common.js?ver=311"></script>
10
+ <script type="text/javascript" src="js/del.js?ver=311"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?ver=311" />
12
+ <base target="_self" />
13
+ </head>
14
+ <body id="xhtmlxtrasins" style="display: none">
15
+ <form onsubmit="insertDel();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>
27
+ <table border="0" cellpadding="0" cellspacing="4">
28
+ <tr>
29
+ <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>
30
+ <td>
31
+ <table border="0" cellspacing="0" cellpadding="0">
32
+ <tr>
33
+ <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
34
+ <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
35
+ </tr>
36
+ </table>
37
+ </td>
38
+ </tr>
39
+ <tr>
40
+ <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>
41
+ <td><input id="cite" name="cite" type="text" value="" class="field" /></td>
42
+ </tr>
43
+ </table>
44
+ </fieldset>
45
+ <fieldset>
46
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
47
+ <table border="0" cellpadding="0" cellspacing="4">
48
+ <tr>
49
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
50
+ <td><input id="title" name="title" type="text" value="" class="field" /></td>
51
+ </tr>
52
+ <tr>
53
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
54
+ <td><input id="id" name="id" type="text" value="" class="field" /></td>
55
+ </tr>
56
+ <tr>
57
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
58
+ <td>
59
+ <select id="class" name="class" class="field mceEditableSelect">
60
+ <option value="">{#not_set}</option>
61
+ </select>
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
66
+ <td><input id="style" name="style" type="text" value="" class="field" /></td>
67
+ </tr>
68
+ <tr>
69
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
70
+ <td>
71
+ <select id="dir" name="dir" class="field">
72
+ <option value="">{#not_set}</option>
73
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
74
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
75
+ </select>
76
+ </td>
77
+ </tr>
78
+ <tr>
79
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
80
+ <td>
81
+ <input id="lang" name="lang" type="text" value="" class="field" />
82
+ </td>
83
+ </tr>
84
+ </table>
85
+ </fieldset>
86
+ </div>
87
+ <div id="events_panel" class="panel">
88
+ <fieldset>
89
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
90
+
91
+ <table border="0" cellpadding="0" cellspacing="4">
92
+ <tr>
93
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
94
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="label"><label for="onblur">onblur</label>:</td>
99
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td class="label"><label for="onclick">onclick</label>:</td>
104
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
109
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
114
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
115
+ </tr>
116
+
117
+ <tr>
118
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
119
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
124
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
129
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
130
+ </tr>
131
+
132
+ <tr>
133
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
134
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
135
+ </tr>
136
+
137
+ <tr>
138
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
139
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
140
+ </tr>
141
+
142
+ <tr>
143
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
144
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
145
+ </tr>
146
+
147
+ <tr>
148
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
149
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
150
+ </tr>
151
+ </table>
152
+ </fieldset>
153
+ </div>
154
+ </div>
155
+ <div class="mceActionPanel">
156
+ <div style="float: left">
157
+ <input type="submit" id="insert" name="insert" value="{#update}" />
158
+ </div>
159
+ <div style="float: left">
160
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" />
161
+ </div>
162
+ <div style="float: right">
163
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
164
+ </div>
165
+ </div>
166
+
167
+ </form>
168
+
169
+ </body>
170
+ </html>
mce/xhtmlxtras/ins.htm CHANGED
@@ -1,170 +1,170 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <title>{#xhtmlxtras_dlg.title_ins_element}</title>
5
- <script type="text/javascript" src="../../tiny_mce_popup.js?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">
15
- <form onsubmit="insertIns();return false;" action="#">
16
- <div class="tabs">
17
- <ul>
18
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
- <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
- </ul>
21
- </div>
22
-
23
- <div class="panel_wrapper">
24
- <div id="general_panel" class="panel current">
25
- <fieldset>
26
- <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>
27
- <table border="0" cellpadding="0" cellspacing="4">
28
- <tr>
29
- <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>
30
- <td>
31
- <table border="0" cellspacing="0" cellpadding="0">
32
- <tr>
33
- <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
34
- <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
35
- </tr>
36
- </table>
37
- </td>
38
- </tr>
39
- <tr>
40
- <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>
41
- <td><input id="cite" name="cite" type="text" value="" class="field" /></td>
42
- </tr>
43
- </table>
44
- </fieldset>
45
- <fieldset>
46
- <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
47
- <table border="0" cellpadding="0" cellspacing="4">
48
- <tr>
49
- <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
50
- <td><input id="title" name="title" type="text" value="" class="field" /></td>
51
- </tr>
52
- <tr>
53
- <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
54
- <td><input id="id" name="id" type="text" value="" class="field" /></td>
55
- </tr>
56
- <tr>
57
- <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
58
- <td>
59
- <select id="class" name="class" class="field mceEditableSelect">
60
- <option value="">{#not_set}</option>
61
- </select>
62
- </td>
63
- </tr>
64
- <tr>
65
- <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
66
- <td><input id="style" name="style" type="text" value="" class="field" /></td>
67
- </tr>
68
- <tr>
69
- <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
70
- <td>
71
- <select id="dir" name="dir" class="field">
72
- <option value="">{#not_set}</option>
73
- <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
74
- <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
75
- </select>
76
- </td>
77
- </tr>
78
- <tr>
79
- <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
80
- <td>
81
- <input id="lang" name="lang" type="text" value="" class="field" />
82
- </td>
83
- </tr>
84
- </table>
85
- </fieldset>
86
- </div>
87
- <div id="events_panel" class="panel">
88
- <fieldset>
89
- <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
90
-
91
- <table border="0" cellpadding="0" cellspacing="4">
92
- <tr>
93
- <td class="label"><label for="onfocus">onfocus</label>:</td>
94
- <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
95
- </tr>
96
-
97
- <tr>
98
- <td class="label"><label for="onblur">onblur</label>:</td>
99
- <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
100
- </tr>
101
-
102
- <tr>
103
- <td class="label"><label for="onclick">onclick</label>:</td>
104
- <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
105
- </tr>
106
-
107
- <tr>
108
- <td class="label"><label for="ondblclick">ondblclick</label>:</td>
109
- <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
110
- </tr>
111
-
112
- <tr>
113
- <td class="label"><label for="onmousedown">onmousedown</label>:</td>
114
- <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
115
- </tr>
116
-
117
- <tr>
118
- <td class="label"><label for="onmouseup">onmouseup</label>:</td>
119
- <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
120
- </tr>
121
-
122
- <tr>
123
- <td class="label"><label for="onmouseover">onmouseover</label>:</td>
124
- <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
125
- </tr>
126
-
127
- <tr>
128
- <td class="label"><label for="onmousemove">onmousemove</label>:</td>
129
- <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
130
- </tr>
131
-
132
- <tr>
133
- <td class="label"><label for="onmouseout">onmouseout</label>:</td>
134
- <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
135
- </tr>
136
-
137
- <tr>
138
- <td class="label"><label for="onkeypress">onkeypress</label>:</td>
139
- <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
140
- </tr>
141
-
142
- <tr>
143
- <td class="label"><label for="onkeydown">onkeydown</label>:</td>
144
- <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
145
- </tr>
146
-
147
- <tr>
148
- <td class="label"><label for="onkeyup">onkeyup</label>:</td>
149
- <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
150
- </tr>
151
- </table>
152
- </fieldset>
153
- </div>
154
- </div>
155
- <div class="mceActionPanel">
156
- <div style="float: left">
157
- <input type="submit" id="insert" name="insert" value="{#update}" />
158
- </div>
159
- <div style="float: left">
160
- <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" />
161
- </div>
162
- <div style="float: right">
163
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
164
- </div>
165
- </div>
166
-
167
- </form>
168
-
169
- </body>
170
- </html>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.title_ins_element}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=311"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=311"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=311"></script>
9
+ <script type="text/javascript" src="js/element_common.js?ver=311"></script>
10
+ <script type="text/javascript" src="js/ins.js?ver=311"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css?ver=311" />
12
+ <base target="_self" />
13
+ </head>
14
+ <body id="xhtmlxtrasins" style="display: none">
15
+ <form onsubmit="insertIns();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>
27
+ <table border="0" cellpadding="0" cellspacing="4">
28
+ <tr>
29
+ <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>
30
+ <td>
31
+ <table border="0" cellspacing="0" cellpadding="0">
32
+ <tr>
33
+ <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
34
+ <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
35
+ </tr>
36
+ </table>
37
+ </td>
38
+ </tr>
39
+ <tr>
40
+ <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>
41
+ <td><input id="cite" name="cite" type="text" value="" class="field" /></td>
42
+ </tr>
43
+ </table>
44
+ </fieldset>
45
+ <fieldset>
46
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
47
+ <table border="0" cellpadding="0" cellspacing="4">
48
+ <tr>
49
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
50
+ <td><input id="title" name="title" type="text" value="" class="field" /></td>
51
+ </tr>
52
+ <tr>
53
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
54
+ <td><input id="id" name="id" type="text" value="" class="field" /></td>
55
+ </tr>
56
+ <tr>
57
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
58
+ <td>
59
+ <select id="class" name="class" class="field mceEditableSelect">
60
+ <option value="">{#not_set}</option>
61
+ </select>
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
66
+ <td><input id="style" name="style" type="text" value="" class="field" /></td>
67
+ </tr>
68
+ <tr>
69
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
70
+ <td>
71
+ <select id="dir" name="dir" class="field">
72
+ <option value="">{#not_set}</option>
73
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
74
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
75
+ </select>
76
+ </td>
77
+ </tr>
78
+ <tr>
79
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
80
+ <td>
81
+ <input id="lang" name="lang" type="text" value="" class="field" />
82
+ </td>
83
+ </tr>
84
+ </table>
85
+ </fieldset>
86
+ </div>
87
+ <div id="events_panel" class="panel">
88
+ <fieldset>
89
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
90
+
91
+ <table border="0" cellpadding="0" cellspacing="4">
92
+ <tr>
93
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
94
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="label"><label for="onblur">onblur</label>:</td>
99
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td class="label"><label for="onclick">onclick</label>:</td>
104
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
109
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
114
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
115
+ </tr>
116
+
117
+ <tr>
118
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
119
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
124
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
129
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
130
+ </tr>
131
+
132
+ <tr>
133
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
134
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
135
+ </tr>
136
+
137
+ <tr>
138
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
139
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
140
+ </tr>
141
+
142
+ <tr>
143
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
144
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
145
+ </tr>
146
+
147
+ <tr>
148
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
149
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
150
+ </tr>
151
+ </table>
152
+ </fieldset>
153
+ </div>
154
+ </div>
155
+ <div class="mceActionPanel">
156
+ <div style="float: left">
157
+ <input type="submit" id="insert" name="insert" value="{#update}" />
158
+ </div>
159
+ <div style="float: left">
160
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" />
161
+ </div>
162
+ <div style="float: right">
163
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
164
+ </div>
165
+ </div>
166
+
167
+ </form>
168
+
169
+ </body>
170
+ </html>
mce/xhtmlxtras/js/abbr.js CHANGED
@@ -1,25 +1,25 @@
1
- /**
2
- * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
- *
4
- * @author Moxiecode - based on work by Andrew Tetlaw
5
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
- */
7
-
8
- function init() {
9
- SXE.initElementDialog('abbr');
10
- if (SXE.currentAction == "update") {
11
- SXE.showRemoveButton();
12
- }
13
- }
14
-
15
- function insertAbbr() {
16
- SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr');
17
- tinyMCEPopup.close();
18
- }
19
-
20
- function removeAbbr() {
21
- SXE.removeElement('abbr');
22
- tinyMCEPopup.close();
23
- }
24
-
25
- tinyMCEPopup.onInit.add(init);
1
+ /**
2
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
+ *
4
+ * @author Moxiecode - based on work by Andrew Tetlaw
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ function init() {
9
+ SXE.initElementDialog('abbr');
10
+ if (SXE.currentAction == "update") {
11
+ SXE.showRemoveButton();
12
+ }
13
+ }
14
+
15
+ function insertAbbr() {
16
+ SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr');
17
+ tinyMCEPopup.close();
18
+ }
19
+
20
+ function removeAbbr() {
21
+ SXE.removeElement('abbr');
22
+ tinyMCEPopup.close();
23
+ }
24
+
25
+ tinyMCEPopup.onInit.add(init);
mce/xhtmlxtras/js/acronym.js CHANGED
@@ -1,25 +1,25 @@
1
- /**
2
- * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
- *
4
- * @author Moxiecode - based on work by Andrew Tetlaw
5
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
- */
7
-
8
- function init() {
9
- SXE.initElementDialog('acronym');
10
- if (SXE.currentAction == "update") {
11
- SXE.showRemoveButton();
12
- }
13
- }
14
-
15
- function insertAcronym() {
16
- SXE.insertElement('acronym');
17
- tinyMCEPopup.close();
18
- }
19
-
20
- function removeAcronym() {
21
- SXE.removeElement('acronym');
22
- tinyMCEPopup.close();
23
- }
24
-
25
- tinyMCEPopup.onInit.add(init);
1
+ /**
2
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
+ *
4
+ * @author Moxiecode - based on work by Andrew Tetlaw
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ function init() {
9
+ SXE.initElementDialog('acronym');
10
+ if (SXE.currentAction == "update") {
11
+ SXE.showRemoveButton();
12
+ }
13
+ }
14
+
15
+ function insertAcronym() {
16
+ SXE.insertElement('acronym');
17
+ tinyMCEPopup.close();
18
+ }
19
+
20
+ function removeAcronym() {
21
+ SXE.removeElement('acronym');
22
+ tinyMCEPopup.close();
23
+ }
24
+
25
+ tinyMCEPopup.onInit.add(init);
mce/xhtmlxtras/js/attributes.js CHANGED
@@ -1,123 +1,123 @@
1
- /**
2
- * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
- *
4
- * @author Moxiecode - based on work by Andrew Tetlaw
5
- * @copyright Copyright � 2004-2006, Moxiecode Systems AB, All rights reserved.
6
- */
7
-
8
- function init() {
9
- tinyMCEPopup.resizeToInnerSize();
10
- var inst = tinyMCEPopup.editor;
11
- var dom = inst.dom;
12
- var elm = inst.selection.getNode();
13
- var f = document.forms[0];
14
- var onclick = dom.getAttrib(elm, 'onclick');
15
-
16
- setFormValue('title', dom.getAttrib(elm, 'title'));
17
- setFormValue('id', dom.getAttrib(elm, 'id'));
18
- setFormValue('style', dom.getAttrib(elm, "style"));
19
- setFormValue('dir', dom.getAttrib(elm, 'dir'));
20
- setFormValue('lang', dom.getAttrib(elm, 'lang'));
21
- setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
22
- setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
23
- setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
24
- setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
25
- setFormValue('onclick', onclick);
26
- setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
27
- setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
28
- setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
29
- setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
30
- setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
31
- setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
32
- setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
33
- setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
34
- setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
35
- className = dom.getAttrib(elm, 'class');
36
-
37
- addClassesToList('classlist', 'advlink_styles');
38
- selectByValue(f, 'classlist', className, true);
39
-
40
- TinyMCE_EditableSelects.init();
41
- }
42
-
43
- function setFormValue(name, value) {
44
- if(value && document.forms[0].elements[name]){
45
- document.forms[0].elements[name].value = value;
46
- }
47
- }
48
-
49
- function insertAction() {
50
- var inst = tinyMCEPopup.editor;
51
- var elm = inst.selection.getNode();
52
-
53
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
54
- setAllAttribs(elm);
55
- tinyMCEPopup.execCommand("mceEndUndoLevel");
56
- tinyMCEPopup.close();
57
- }
58
-
59
- function setAttrib(elm, attrib, value) {
60
- var formObj = document.forms[0];
61
- var valueElm = formObj.elements[attrib.toLowerCase()];
62
- var inst = tinyMCEPopup.editor;
63
- var dom = inst.dom;
64
-
65
- if (typeof(value) == "undefined" || value == null) {
66
- value = "";
67
-
68
- if (valueElm)
69
- value = valueElm.value;
70
- }
71
-
72
- if (value != "") {
73
- dom.setAttrib(elm, attrib.toLowerCase(), value);
74
-
75
- if (attrib == "style")
76
- attrib = "style.cssText";
77
-
78
- if (attrib.substring(0, 2) == 'on')
79
- value = 'return true;' + value;
80
-
81
- if (attrib == "class")
82
- attrib = "className";
83
-
84
- elm[attrib]=value;
85
- } else
86
- elm.removeAttribute(attrib);
87
- }
88
-
89
- function setAllAttribs(elm) {
90
- var f = document.forms[0];
91
-
92
- setAttrib(elm, 'title');
93
- setAttrib(elm, 'id');
94
- setAttrib(elm, 'style');
95
- setAttrib(elm, 'class', getSelectValue(f, 'classlist'));
96
- setAttrib(elm, 'dir');
97
- setAttrib(elm, 'lang');
98
- setAttrib(elm, 'tabindex');
99
- setAttrib(elm, 'accesskey');
100
- setAttrib(elm, 'onfocus');
101
- setAttrib(elm, 'onblur');
102
- setAttrib(elm, 'onclick');
103
- setAttrib(elm, 'ondblclick');
104
- setAttrib(elm, 'onmousedown');
105
- setAttrib(elm, 'onmouseup');
106
- setAttrib(elm, 'onmouseover');
107
- setAttrib(elm, 'onmousemove');
108
- setAttrib(elm, 'onmouseout');
109
- setAttrib(elm, 'onkeypress');
110
- setAttrib(elm, 'onkeydown');
111
- setAttrib(elm, 'onkeyup');
112
-
113
- // Refresh in old MSIE
114
- // if (tinyMCE.isMSIE5)
115
- // elm.outerHTML = elm.outerHTML;
116
- }
117
-
118
- function insertAttribute() {
119
- tinyMCEPopup.close();
120
- }
121
-
122
- tinyMCEPopup.onInit.add(init);
123
- tinyMCEPopup.requireLangPack();
1
+ /**
2
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
+ *
4
+ * @author Moxiecode - based on work by Andrew Tetlaw
5
+ * @copyright Copyright � 2004-2006, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ function init() {
9
+ tinyMCEPopup.resizeToInnerSize();
10
+ var inst = tinyMCEPopup.editor;
11
+ var dom = inst.dom;
12
+ var elm = inst.selection.getNode();
13
+ var f = document.forms[0];
14
+ var onclick = dom.getAttrib(elm, 'onclick');
15
+
16
+ setFormValue('title', dom.getAttrib(elm, 'title'));
17
+ setFormValue('id', dom.getAttrib(elm, 'id'));
18
+ setFormValue('style', dom.getAttrib(elm, "style"));
19
+ setFormValue('dir', dom.getAttrib(elm, 'dir'));
20
+ setFormValue('lang', dom.getAttrib(elm, 'lang'));
21
+ setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
22
+ setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
23
+ setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
24
+ setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
25
+ setFormValue('onclick', onclick);
26
+ setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
27
+ setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
28
+ setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
29
+ setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
30
+ setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
31
+ setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
32
+ setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
33
+ setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
34
+ setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
35
+ className = dom.getAttrib(elm, 'class');
36
+
37
+ addClassesToList('classlist', 'advlink_styles');
38
+ selectByValue(f, 'classlist', className, true);
39
+
40
+ TinyMCE_EditableSelects.init();
41
+ }
42
+
43
+ function setFormValue(name, value) {
44
+ if(value && document.forms[0].elements[name]){
45
+ document.forms[0].elements[name].value = value;
46
+ }
47
+ }
48
+
49
+ function insertAction() {
50
+ var inst = tinyMCEPopup.editor;
51
+ var elm = inst.selection.getNode();
52
+
53
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
54
+ setAllAttribs(elm);
55
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
56
+ tinyMCEPopup.close();
57
+ }
58
+
59
+ function setAttrib(elm, attrib, value) {
60
+ var formObj = document.forms[0];
61
+ var valueElm = formObj.elements[attrib.toLowerCase()];
62
+ var inst = tinyMCEPopup.editor;
63
+ var dom = inst.dom;
64
+
65
+ if (typeof(value) == "undefined" || value == null) {
66
+ value = "";
67
+
68
+ if (valueElm)
69
+ value = valueElm.value;
70
+ }
71
+
72
+ if (value != "") {
73
+ dom.setAttrib(elm, attrib.toLowerCase(), value);
74
+
75
+ if (attrib == "style")
76
+ attrib = "style.cssText";
77
+
78
+ if (attrib.substring(0, 2) == 'on')
79
+ value = 'return true;' + value;
80
+
81
+ if (attrib == "class")
82
+ attrib = "className";
83
+
84
+ elm[attrib]=value;
85
+ } else
86
+ elm.removeAttribute(attrib);
87
+ }
88
+
89
+ function setAllAttribs(elm) {
90
+ var f = document.forms[0];
91
+
92
+ setAttrib(elm, 'title');
93
+ setAttrib(elm, 'id');
94
+ setAttrib(elm, 'style');
95
+ setAttrib(elm, 'class', getSelectValue(f, 'classlist'));
96
+ setAttrib(elm, 'dir');
97
+ setAttrib(elm, 'lang');
98
+ setAttrib(elm, 'tabindex');
99
+ setAttrib(elm, 'accesskey');
100
+ setAttrib(elm, 'onfocus');
101
+ setAttrib(elm, 'onblur');
102
+ setAttrib(elm, 'onclick');
103
+ setAttrib(elm, 'ondblclick');
104
+ setAttrib(elm, 'onmousedown');
105
+ setAttrib(elm, 'onmouseup');
106
+ setAttrib(elm, 'onmouseover');
107
+ setAttrib(elm, 'onmousemove');
108
+ setAttrib(elm, 'onmouseout');
109
+ setAttrib(elm, 'onkeypress');
110
+ setAttrib(elm, 'onkeydown');
111
+ setAttrib(elm, 'onkeyup');
112
+
113
+ // Refresh in old MSIE
114
+ // if (tinyMCE.isMSIE5)
115
+ // elm.outerHTML = elm.outerHTML;
116
+ }
117
+
118
+ function insertAttribute() {
119
+ tinyMCEPopup.close();
120
+ }
121
+
122
+ tinyMCEPopup.onInit.add(init);
123
+ tinyMCEPopup.requireLangPack();
mce/xhtmlxtras/js/cite.js CHANGED
@@ -1,25 +1,25 @@
1
- /**
2
- * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
- *
4
- * @author Moxiecode - based on work by Andrew Tetlaw
5
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
- */
7
-
8
- function init() {
9
- SXE.initElementDialog('cite');
10
- if (SXE.currentAction == "update") {
11
- SXE.showRemoveButton();
12
- }
13
- }
14
-
15
- function insertCite() {
16
- SXE.insertElement('cite');
17
- tinyMCEPopup.close();
18
- }
19
-
20
- function removeCite() {
21
- SXE.removeElement('cite');
22
- tinyMCEPopup.close();
23
- }
24
-
25
- tinyMCEPopup.onInit.add(init);
1
+ /**
2
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
+ *
4
+ * @author Moxiecode - based on work by Andrew Tetlaw
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ function init() {
9
+ SXE.initElementDialog('cite');
10
+ if (SXE.currentAction == "update") {
11
+ SXE.showRemoveButton();
12
+ }
13
+ }
14
+
15
+ function insertCite() {
16
+ SXE.insertElement('cite');
17
+ tinyMCEPopup.close();
18
+ }
19
+
20
+ function removeCite() {
21
+ SXE.removeElement('cite');
22
+ tinyMCEPopup.close();
23
+ }
24
+
25
+ tinyMCEPopup.onInit.add(init);
mce/xhtmlxtras/js/del.js CHANGED
@@ -1,50 +1,50 @@
1
- /**
2
- * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
- *
4
- * @author Moxiecode - based on work by Andrew Tetlaw
5
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
- */
7
-
8
- function init() {
9
- SXE.initElementDialog('del');
10
- if (SXE.currentAction == "update") {
11
- setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
12
- setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
13
- SXE.showRemoveButton();
14
- }
15
- }
16
-
17
- function setElementAttribs(elm) {
18
- setAllCommonAttribs(elm);
19
- setAttrib(elm, 'datetime');
20
- setAttrib(elm, 'cite');
21
- }
22
-
23
- function insertDel() {
24
- var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
25
-
26
- tinyMCEPopup.execCommand('mceBeginUndoLevel');
27
- if (elm == null) {
28
- var s = SXE.inst.selection.getContent();
29
- if(s.length > 0) {
30
- tinyMCEPopup.execCommand('mceInsertContent', false, '<del id="#sxe_temp_del#">' + s + '</del>');
31
- var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
32
- for (var i=0; i<elementArray.length; i++) {
33
- var elm = elementArray[i];
34
- setElementAttribs(elm);
35
- }
36
- }
37
- } else {
38
- setElementAttribs(elm);
39
- }
40
- tinyMCEPopup.editor.nodeChanged();
41
- tinyMCEPopup.execCommand('mceEndUndoLevel');
42
- tinyMCEPopup.close();
43
- }
44
-
45
- function removeDel() {
46
- SXE.removeElement('del');
47
- tinyMCEPopup.close();
48
- }
49
-
50
- tinyMCEPopup.onInit.add(init);
1
+ /**
2
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
+ *
4
+ * @author Moxiecode - based on work by Andrew Tetlaw
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ function init() {
9
+ SXE.initElementDialog('del');
10
+ if (SXE.currentAction == "update") {
11
+ setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
12
+ setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
13
+ SXE.showRemoveButton();
14
+ }
15
+ }
16
+
17
+ function setElementAttribs(elm) {
18
+ setAllCommonAttribs(elm);
19
+ setAttrib(elm, 'datetime');
20
+ setAttrib(elm, 'cite');
21
+ }
22
+
23
+ function insertDel() {
24
+ var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
25
+
26
+ tinyMCEPopup.execCommand('mceBeginUndoLevel');
27
+ if (elm == null) {
28
+ var s = SXE.inst.selection.getContent();
29
+ if(s.length > 0) {
30
+ tinyMCEPopup.execCommand('mceInsertContent', false, '<del id="#sxe_temp_del#">' + s + '</del>');
31
+ var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
32
+ for (var i=0; i<elementArray.length; i++) {
33
+ var elm = elementArray[i];
34
+ setElementAttribs(elm);
35
+ }
36
+ }
37
+ } else {
38
+ setElementAttribs(elm);
39
+ }
40
+ tinyMCEPopup.editor.nodeChanged();
41
+ tinyMCEPopup.execCommand('mceEndUndoLevel');
42
+ tinyMCEPopup.close();
43
+ }
44
+
45
+ function removeDel() {
46
+ SXE.removeElement('del');
47
+ tinyMCEPopup.close();
48
+ }
49
+
50
+ tinyMCEPopup.onInit.add(init);
mce/xhtmlxtras/js/element_common.js CHANGED
@@ -1,221 +1,221 @@
1
- /**
2
- * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
- *
4
- * @author Moxiecode - based on work by Andrew Tetlaw
5
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
- */
7
-
8
- tinyMCEPopup.requireLangPack();
9
-
10
- function initCommonAttributes(elm) {
11
- var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
12
-
13
- // Setup form data for common element attributes
14
- setFormValue('title', dom.getAttrib(elm, 'title'));
15
- setFormValue('id', dom.getAttrib(elm, 'id'));
16
- selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);
17
- setFormValue('style', dom.getAttrib(elm, 'style'));
18
- selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));
19
- setFormValue('lang', dom.getAttrib(elm, 'lang'));
20
- setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
21
- setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
22
- setFormValue('onclick', dom.getAttrib(elm, 'onclick'));
23
- setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
24
- setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
25
- setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
26
- setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
27
- setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
28
- setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
29
- setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
30
- setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
31
- setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
32
- }
33
-
34
- function setFormValue(name, value) {
35
- if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;
36
- }
37
-
38
- function insertDateTime(id) {
39
- document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");
40
- }
41
-
42
- function getDateTime(d, fmt) {
43
- fmt = fmt.replace("%D", "%m/%d/%y");
44
- fmt = fmt.replace("%r", "%I:%M:%S %p");
45
- fmt = fmt.replace("%Y", "" + d.getFullYear());
46
- fmt = fmt.replace("%y", "" + d.getYear());
47
- fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
48
- fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
49
- fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
50
- fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
51
- fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
52
- fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
53
- fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
54
- fmt = fmt.replace("%%", "%");
55
-
56
- return fmt;
57
- }
58
-
59
- function addZeros(value, len) {
60
- var i;
61
-
62
- value = "" + value;
63
-
64
- if (value.length < len) {
65
- for (i=0; i<(len-value.length); i++)
66
- value = "0" + value;
67
- }
68
-
69
- return value;
70
- }
71
-
72
- function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
73
- if (!form_obj || !form_obj.elements[field_name])
74
- return;
75
-
76
- var sel = form_obj.elements[field_name];
77
-
78
- var found = false;
79
- for (var i=0; i<sel.options.length; i++) {
80
- var option = sel.options[i];
81
-
82
- if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
83
- option.selected = true;
84
- found = true;
85
- } else
86
- option.selected = false;
87
- }
88
-
89
- if (!found && add_custom && value != '') {
90
- var option = new Option('Value: ' + value, value);
91
- option.selected = true;
92
- sel.options[sel.options.length] = option;
93
- }
94
-
95
- return found;
96
- }
97
-
98
- function setAttrib(elm, attrib, value) {
99
- var formObj = document.forms[0];
100
- var valueElm = formObj.elements[attrib.toLowerCase()];
101
- tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);
102
- }
103
-
104
- function setAllCommonAttribs(elm) {
105
- setAttrib(elm, 'title');
106
- setAttrib(elm, 'id');
107
- setAttrib(elm, 'class');
108
- setAttrib(elm, 'style');
109
- setAttrib(elm, 'dir');
110
- setAttrib(elm, 'lang');
111
- /*setAttrib(elm, 'onfocus');
112
- setAttrib(elm, 'onblur');
113
- setAttrib(elm, 'onclick');
114
- setAttrib(elm, 'ondblclick');
115
- setAttrib(elm, 'onmousedown');
116
- setAttrib(elm, 'onmouseup');
117
- setAttrib(elm, 'onmouseover');
118
- setAttrib(elm, 'onmousemove');
119
- setAttrib(elm, 'onmouseout');
120
- setAttrib(elm, 'onkeypress');
121
- setAttrib(elm, 'onkeydown');
122
- setAttrib(elm, 'onkeyup');*/
123
- }
124
-
125
- SXE = {
126
- currentAction : "insert",
127
- inst : tinyMCEPopup.editor,
128
- updateElement : null
129
- }
130
-
131
- SXE.focusElement = SXE.inst.selection.getNode();
132
-
133
- SXE.initElementDialog = function(element_name) {
134
- addClassesToList('class', 'xhtmlxtras_styles');
135
- TinyMCE_EditableSelects.init();
136
-
137
- element_name = element_name.toLowerCase();
138
- var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
139
- if (elm != null && elm.nodeName == element_name.toUpperCase()) {
140
- SXE.currentAction = "update";
141
- }
142
-
143
- if (SXE.currentAction == "update") {
144
- initCommonAttributes(elm);
145
- SXE.updateElement = elm;
146
- }
147
-
148
- document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true);
149
- }
150
-
151
- SXE.insertElement = function(element_name) {
152
- var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;
153
-
154
- tinyMCEPopup.execCommand('mceBeginUndoLevel');
155
- if (elm == null) {
156
- var s = SXE.inst.selection.getContent();
157
- if(s.length > 0) {
158
- tagName = element_name;
159
-
160
- if (tinymce.isIE && element_name.indexOf('html:') == 0)
161
- element_name = element_name.substring(5).toLowerCase();
162
-
163
- h = '<' + tagName + ' id="#sxe_temp_' + element_name + '#">' + s + '</' + tagName + '>';
164
-
165
- tinyMCEPopup.execCommand('mceInsertContent', false, h);
166
-
167
- var elementArray = tinymce.grep(SXE.inst.dom.select(element_name), function(n) {return n.id == '#sxe_temp_' + element_name + '#';});
168
- for (var i=0; i<elementArray.length; i++) {
169
- var elm = elementArray[i];
170
-
171
- elm.id = '';
172
- elm.setAttribute('id', '');
173
- elm.removeAttribute('id');
174
-
175
- setAllCommonAttribs(elm);
176
- }
177
- }
178
- } else {
179
- setAllCommonAttribs(elm);
180
- }
181
- SXE.inst.nodeChanged();
182
- tinyMCEPopup.execCommand('mceEndUndoLevel');
183
- }
184
-
185
- SXE.removeElement = function(element_name){
186
- element_name = element_name.toLowerCase();
187
- elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
188
- if(elm && elm.nodeName == element_name.toUpperCase()){
189
- tinyMCEPopup.execCommand('mceBeginUndoLevel');
190
- tinyMCE.execCommand('mceRemoveNode', false, elm);
191
- SXE.inst.nodeChanged();
192
- tinyMCEPopup.execCommand('mceEndUndoLevel');
193
- }
194
- }
195
-
196
- SXE.showRemoveButton = function() {
197
- document.getElementById("remove").style.display = 'block';
198
- }
199
-
200
- SXE.containsClass = function(elm,cl) {
201
- return (elm.className.indexOf(cl) > -1) ? true : false;
202
- }
203
-
204
- SXE.removeClass = function(elm,cl) {
205
- if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {
206
- return true;
207
- }
208
- var classNames = elm.className.split(" ");
209
- var newClassNames = "";
210
- for (var x = 0, cnl = classNames.length; x < cnl; x++) {
211
- if (classNames[x] != cl) {
212
- newClassNames += (classNames[x] + " ");
213
- }
214
- }
215
- elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end
216
- }
217
-
218
- SXE.addClass = function(elm,cl) {
219
- if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;
220
- return true;
221
  }
1
+ /**
2
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
+ *
4
+ * @author Moxiecode - based on work by Andrew Tetlaw
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ tinyMCEPopup.requireLangPack();
9
+
10
+ function initCommonAttributes(elm) {
11
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
12
+
13
+ // Setup form data for common element attributes
14
+ setFormValue('title', dom.getAttrib(elm, 'title'));
15
+ setFormValue('id', dom.getAttrib(elm, 'id'));
16
+ selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);
17
+ setFormValue('style', dom.getAttrib(elm, 'style'));
18
+ selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));
19
+ setFormValue('lang', dom.getAttrib(elm, 'lang'));
20
+ setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
21
+ setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
22
+ setFormValue('onclick', dom.getAttrib(elm, 'onclick'));
23
+ setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
24
+ setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
25
+ setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
26
+ setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
27
+ setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
28
+ setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
29
+ setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
30
+ setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
31
+ setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
32
+ }
33
+
34
+ function setFormValue(name, value) {
35
+ if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;
36
+ }
37
+
38
+ function insertDateTime(id) {
39
+ document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");
40
+ }
41
+
42
+ function getDateTime(d, fmt) {
43
+ fmt = fmt.replace("%D", "%m/%d/%y");
44
+ fmt = fmt.replace("%r", "%I:%M:%S %p");
45
+ fmt = fmt.replace("%Y", "" + d.getFullYear());
46
+ fmt = fmt.replace("%y", "" + d.getYear());
47
+ fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
48
+ fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
49
+ fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
50
+ fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
51
+ fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
52
+ fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
53
+ fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
54
+ fmt = fmt.replace("%%", "%");
55
+
56
+ return fmt;
57
+ }
58
+
59
+ function addZeros(value, len) {
60
+ var i;
61
+
62
+ value = "" + value;
63
+
64
+ if (value.length < len) {
65
+ for (i=0; i<(len-value.length); i++)
66
+ value = "0" + value;
67
+ }
68
+
69
+ return value;
70
+ }
71
+
72
+ function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
73
+ if (!form_obj || !form_obj.elements[field_name])
74
+ return;
75
+
76
+ var sel = form_obj.elements[field_name];
77
+
78
+ var found = false;
79
+ for (var i=0; i<sel.options.length; i++) {
80
+ var option = sel.options[i];
81
+
82
+ if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
83
+ option.selected = true;
84
+ found = true;
85
+ } else
86
+ option.selected = false;
87
+ }
88
+
89
+ if (!found && add_custom && value != '') {
90
+ var option = new Option('Value: ' + value, value);
91
+ option.selected = true;
92
+ sel.options[sel.options.length] = option;
93
+ }
94
+
95
+ return found;
96
+ }
97
+
98
+ function setAttrib(elm, attrib, value) {
99
+ var formObj = document.forms[0];
100
+ var valueElm = formObj.elements[attrib.toLowerCase()];
101
+ tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);
102
+ }
103
+
104
+ function setAllCommonAttribs(elm) {
105
+ setAttrib(elm, 'title');
106
+ setAttrib(elm, 'id');
107
+ setAttrib(elm, 'class');
108
+ setAttrib(elm, 'style');
109
+ setAttrib(elm, 'dir');
110
+ setAttrib(elm, 'lang');
111
+ /*setAttrib(elm, 'onfocus');
112
+ setAttrib(elm, 'onblur');
113
+ setAttrib(elm, 'onclick');
114
+ setAttrib(elm, 'ondblclick');
115
+ setAttrib(elm, 'onmousedown');
116
+ setAttrib(elm, 'onmouseup');
117
+ setAttrib(elm, 'onmouseover');
118
+ setAttrib(elm, 'onmousemove');
119
+ setAttrib(elm, 'onmouseout');
120
+ setAttrib(elm, 'onkeypress');
121
+ setAttrib(elm, 'onkeydown');
122
+ setAttrib(elm, 'onkeyup');*/
123
+ }
124
+
125
+ SXE = {
126
+ currentAction : "insert",
127
+ inst : tinyMCEPopup.editor,
128
+ updateElement : null
129
+ }
130
+
131
+ SXE.focusElement = SXE.inst.selection.getNode();
132
+
133
+ SXE.initElementDialog = function(element_name) {
134
+ addClassesToList('class', 'xhtmlxtras_styles');
135
+ TinyMCE_EditableSelects.init();
136
+
137
+ element_name = element_name.toLowerCase();
138
+ var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
139
+ if (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) {
140
+ SXE.currentAction = "update";
141
+ }
142
+
143
+ if (SXE.currentAction == "update") {
144
+ initCommonAttributes(elm);
145
+ SXE.updateElement = elm;
146
+ }
147
+
148
+ document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true);
149
+ }
150
+
151
+ SXE.insertElement = function(element_name) {
152
+ var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;
153
+
154
+ tinyMCEPopup.execCommand('mceBeginUndoLevel');
155
+ if (elm == null) {
156
+ var s = SXE.inst.selection.getContent();
157
+ if(s.length > 0) {
158
+ tagName = element_name;
159
+
160
+ if (tinymce.isIE && element_name.indexOf('html:') == 0)
161
+ element_name = element_name.substring(5).toLowerCase();
162
+
163
+ h = '<' + tagName + ' id="#sxe_temp_' + element_name + '#">' + s + '</' + tagName + '>';
164
+
165
+ tinyMCEPopup.execCommand('mceInsertContent', false, h);
166
+
167
+ var elementArray = tinymce.grep(SXE.inst.dom.select(element_name), function(n) {return n.id == '#sxe_temp_' + element_name + '#';});
168
+ for (var i=0; i<elementArray.length; i++) {
169
+ var elm = elementArray[i];
170
+
171
+ elm.id = '';
172
+ elm.setAttribute('id', '');
173
+ elm.removeAttribute('id');
174
+
175
+ setAllCommonAttribs(elm);
176
+ }
177
+ }
178
+ } else {
179
+ setAllCommonAttribs(elm);
180
+ }
181
+ SXE.inst.nodeChanged();
182
+ tinyMCEPopup.execCommand('mceEndUndoLevel');
183
+ }
184
+
185
+ SXE.removeElement = function(element_name){
186
+ element_name = element_name.toLowerCase();
187
+ elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
188
+ if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){
189
+ tinyMCEPopup.execCommand('mceBeginUndoLevel');
190
+ tinyMCE.execCommand('mceRemoveNode', false, elm);
191
+ SXE.inst.nodeChanged();
192
+ tinyMCEPopup.execCommand('mceEndUndoLevel');
193
+ }
194
+ }
195
+
196
+ SXE.showRemoveButton = function() {
197
+ document.getElementById("remove").style.display = 'block';
198
+ }
199
+
200
+ SXE.containsClass = function(elm,cl) {
201
+ return (elm.className.indexOf(cl) > -1) ? true : false;
202
+ }
203
+
204
+ SXE.removeClass = function(elm,cl) {
205
+ if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {
206
+ return true;
207
+ }
208
+ var classNames = elm.className.split(" ");
209
+ var newClassNames = "";
210
+ for (var x = 0, cnl = classNames.length; x < cnl; x++) {
211
+ if (classNames[x] != cl) {
212
+ newClassNames += (classNames[x] + " ");
213
+ }
214
+ }
215
+ elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end
216
+ }
217
+
218
+ SXE.addClass = function(elm,cl) {
219
+ if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;
220
+ return true;
221
  }
mce/xhtmlxtras/js/ins.js CHANGED
@@ -1,49 +1,49 @@
1
- /**
2
- * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
- *
4
- * @author Moxiecode - based on work by Andrew Tetlaw
5
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
- */
7
-
8
- function init() {
9
- SXE.initElementDialog('ins');
10
- if (SXE.currentAction == "update") {
11
- setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
12
- setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
13
- SXE.showRemoveButton();
14
- }
15
- }
16
-
17
- function setElementAttribs(elm) {
18
- setAllCommonAttribs(elm);
19
- setAttrib(elm, 'datetime');
20
- setAttrib(elm, 'cite');
21
- }
22
-
23
- function insertIns() {
24
- var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
25
- tinyMCEPopup.execCommand('mceBeginUndoLevel');
26
- if (elm == null) {
27
- var s = SXE.inst.selection.getContent();
28
- if(s.length > 0) {
29
- tinyMCEPopup.execCommand('mceInsertContent', false, '<ins id="#sxe_temp_ins#">' + s + '</ins>');
30
- var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
31
- for (var i=0; i<elementArray.length; i++) {
32
- var elm = elementArray[i];
33
- setElementAttribs(elm);
34
- }
35
- }
36
- } else {
37
- setElementAttribs(elm);
38
- }
39
- tinyMCEPopup.editor.nodeChanged();
40
- tinyMCEPopup.execCommand('mceEndUndoLevel');
41
- tinyMCEPopup.close();
42
- }
43
-
44
- function removeIns() {
45
- SXE.removeElement('ins');
46
- tinyMCEPopup.close();
47
- }
48
-
49
- tinyMCEPopup.onInit.add(init);
1
+ /**
2
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
+ *
4
+ * @author Moxiecode - based on work by Andrew Tetlaw
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ function init() {
9
+ SXE.initElementDialog('ins');
10
+ if (SXE.currentAction == "update") {
11
+ setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
12
+ setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
13
+ SXE.showRemoveButton();
14
+ }
15
+ }
16
+
17
+ function setElementAttribs(elm) {
18
+ setAllCommonAttribs(elm);
19
+ setAttrib(elm, 'datetime');
20
+ setAttrib(elm, 'cite');
21
+ }
22
+
23
+ function insertIns() {
24
+ var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
25
+ tinyMCEPopup.execCommand('mceBeginUndoLevel');
26
+ if (elm == null) {
27
+ var s = SXE.inst.selection.getContent();
28
+ if(s.length > 0) {
29
+ tinyMCEPopup.execCommand('mceInsertContent', false, '<ins id="#sxe_temp_ins#">' + s + '</ins>');
30
+ var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
31
+ for (var i=0; i<elementArray.length; i++) {
32
+ var elm = elementArray[i];
33
+ setElementAttribs(elm);
34
+ }
35
+ }
36
+ } else {
37
+ setElementAttribs(elm);
38
+ }
39
+ tinyMCEPopup.editor.nodeChanged();
40
+ tinyMCEPopup.execCommand('mceEndUndoLevel');
41
+ tinyMCEPopup.close();
42
+ }
43
+
44
+ function removeIns() {
45
+ SXE.removeElement('ins');
46
+ tinyMCEPopup.close();
47
+ }
48
+
49
+ tinyMCEPopup.onInit.add(init);
mce/xhtmlxtras/langs/en_dlg.js CHANGED
@@ -1,32 +1,32 @@
1
- tinyMCE.addI18n('en.xhtmlxtras_dlg',{
2
- attribute_label_title:"Title",
3
- attribute_label_id:"ID",
4
- attribute_label_class:"Class",
5
- attribute_label_style:"Style",
6
- attribute_label_cite:"Cite",
7
- attribute_label_datetime:"Date/Time",
8
- attribute_label_langdir:"Text Direction",
9
- attribute_option_ltr:"Left to right",
10
- attribute_option_rtl:"Right to left",
11
- attribute_label_langcode:"Language",
12
- attribute_label_tabindex:"TabIndex",
13
- attribute_label_accesskey:"AccessKey",
14
- attribute_events_tab:"Events",
15
- attribute_attrib_tab:"Attributes",
16
- general_tab:"General",
17
- attrib_tab:"Attributes",
18
- events_tab:"Events",
19
- fieldset_general_tab:"General Settings",
20
- fieldset_attrib_tab:"Element Attributes",
21
- fieldset_events_tab:"Element Events",
22
- title_ins_element:"Insertion Element",
23
- title_del_element:"Deletion Element",
24
- title_acronym_element:"Acronym Element",
25
- title_abbr_element:"Abbreviation Element",
26
- title_cite_element:"Citation Element",
27
- remove:"Remove",
28
- insert_date:"Insert current date/time",
29
- option_ltr:"Left to right",
30
- option_rtl:"Right to left",
31
- attribs_title:"Insert/Edit Attributes"
32
  });
1
+ tinyMCE.addI18n('en.xhtmlxtras_dlg',{
2
+ attribute_label_title:"Title",
3
+ attribute_label_id:"ID",
4
+ attribute_label_class:"Class",
5
+ attribute_label_style:"Style",
6
+ attribute_label_cite:"Cite",
7
+ attribute_label_datetime:"Date/Time",
8
+ attribute_label_langdir:"Text Direction",
9
+ attribute_option_ltr:"Left to right",
10
+ attribute_option_rtl:"Right to left",
11
+ attribute_label_langcode:"Language",
12
+ attribute_label_tabindex:"TabIndex",
13
+ attribute_label_accesskey:"AccessKey",
14
+ attribute_events_tab:"Events",
15
+ attribute_attrib_tab:"Attributes",
16
+ general_tab:"General",
17
+ attrib_tab:"Attributes",
18
+ events_tab:"Events",
19
+ fieldset_general_tab:"General Settings",
20
+ fieldset_attrib_tab:"Element Attributes",
21
+ fieldset_events_tab:"Element Events",
22
+ title_ins_element:"Insertion Element",
23
+ title_del_element:"Deletion Element",
24
+ title_acronym_element:"Acronym Element",
25
+ title_abbr_element:"Abbreviation Element",
26
+ title_cite_element:"Citation Element",
27
+ remove:"Remove",
28
+ insert_date:"Insert current date/time",
29
+ option_ltr:"Left to right",
30
+ option_rtl:"Right to left",
31
+ attribs_title:"Insert/Edit Attributes"
32
  });
mce/xhtmlxtras/langs/ja_dlg.js CHANGED
@@ -1,32 +1,32 @@
1
  tinyMCE.addI18n('ja.xhtmlxtras_dlg',{
2
- attribute_label_title:"\u67E5\u627E",
3
  attribute_label_id:"ID",
4
- attribute_label_class:"\u6837\u5F0F\u7C7B",
5
- attribute_label_style:"\u6837\u5F0F",
6
  attribute_label_cite:"\u5F15\u7528",
7
- attribute_label_datetime:"\u65E5\u671F/\u65F6\u95F4",
8
- attribute_label_langdir:"\u6587\u5B57\u4E66\u5199\u65B9\u5411",
9
- attribute_option_ltr:"\u4ECE\u5DE6\u5230\u53F3",
10
- attribute_option_rtl:"\u4ECE\u53F3\u5230\u5DE6",
11
- attribute_label_langcode:"\u8BED\u8A00",
12
- attribute_label_tabindex:"Tab\u7D22\u5F15",
13
- attribute_label_accesskey:"\u5FEB\u901F\u952E",
14
- attribute_events_tab:"\u4E8B\u4EF6",
15
  attribute_attrib_tab:"\u5C5E\u6027",
16
- general_tab:"\u57FA\u672C",
17
  attrib_tab:"\u5C5E\u6027",
18
- events_tab:"\u4E8B\u4EF6",
19
- fieldset_general_tab:"\u57FA\u672C",
20
- fieldset_attrib_tab:"\u5BF9\u8C61\u5C5E\u6027",
21
- fieldset_events_tab:"\u5BF9\u8C61\u4E8B\u4EF6",
22
- title_ins_element:"\u63D2\u5165\u5BF9\u8C61",
23
- title_del_element:"\u5220\u9664\u5BF9\u8C61",
24
- title_acronym_element:"\u9996\u5B57\u6BCD\u7F29\u5199\u5BF9\u8C61",
25
- title_abbr_element:"\u7F29\u5199\u5BF9\u8C61",
26
- title_cite_element:"\u5F15\u7528\u5BF9\u8C61",
27
- remove:"\u79FB\u9664",
28
- insert_date:"\u63D2\u5165\u5F53\u524D\u65E5\u671F/\u65F6\u95F4",
29
- option_ltr:"\u4ECE\u5DE6\u5230\u53F3",
30
- option_rtl:"\u4ECE\u53F3\u5230\u5DE6",
31
- attribs_title:"\u63D2\u5165/\u7F16\u8F91 \u5C5E\u6027"
32
  });
1
  tinyMCE.addI18n('ja.xhtmlxtras_dlg',{
2
+ attribute_label_title:"\u30BF\u30A4\u30C8\u30EB",
3
  attribute_label_id:"ID",
4
+ attribute_label_class:"\u30AF\u30E9\u30B9",
5
+ attribute_label_style:"\u30B9\u30BF\u30A4\u30EB",
6
  attribute_label_cite:"\u5F15\u7528",
7
+ attribute_label_datetime:"\u65E5\u4ED8/\u6642\u523B",
8
+ attribute_label_langdir:"\u6587\u7AE0\u306E\u65B9\u5411",
9
+ attribute_option_ltr:"\u5DE6\u304B\u3089\u53F3",
10
+ attribute_option_rtl:"\u53F3\u304B\u3089\u5DE6",
11
+ attribute_label_langcode:"\u8A00\u8A9E",
12
+ attribute_label_tabindex:"\u30BF\u30D6\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9",
13
+ attribute_label_accesskey:"\u30A2\u30AF\u30BB\u30B9\u30AD\u30FC",
14
+ attribute_events_tab:"\u30A4\u30D9\u30F3\u30C8",
15
  attribute_attrib_tab:"\u5C5E\u6027",
16
+ general_tab:"\u4E00\u822C",
17
  attrib_tab:"\u5C5E\u6027",
18
+ events_tab:"\u30A4\u30D9\u30F3\u30C8",
19
+ fieldset_general_tab:"\u4E00\u822C",
20
+ fieldset_attrib_tab:"\u30A8\u30EC\u30E1\u30F3\u30C8\u306E\u5C5E\u6027",
21
+ fieldset_events_tab:"\u30A8\u30EC\u30E1\u30F3\u30C8\u306E\u30A4\u30D9\u30F3\u30C8",
22
+ title_ins_element:"\u30A8\u30EC\u30E1\u30F3\u30C8\u3092\u633F\u5165",
23
+ title_del_element:"\u30A8\u30EC\u30E1\u30F3\u30C8\u3092\u524A\u9664",
24
+ title_acronym_element:"\u982D\u5B57\u8A9E\u30A8\u30EC\u30E1\u30F3\u30C8",
25
+ title_abbr_element:"\u7565\u8A9E\u30A8\u30EC\u30E1\u30F3\u30C8",
26
+ title_cite_element:"\u5F15\u7528\u30A8\u30EC\u30E1\u30F3\u30C8",
27
+ remove:"Remove",
28
+ insert_date:"\u73FE\u5728\u306E\u65E5\u4ED8/\u6642\u523B\u3092\u633F\u5165",
29
+ option_ltr:"\u5DE6\u304B\u3089\u53F3",
30
+ option_rtl:"\u53F3\u304B\u3089\u5DE6",
31
+ attribs_title:"\u5C5E\u6027\u306E\u633F\u5165/\u524A\u9664"
32
  });
mce/xhtmlxtras/langs/langs.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
- if ( is_file($lang_file) && is_readable($lang_file) ) {
5
  $strings .= getFileContents($lang_file);
6
- }
7
  ?>
1
  <?php
2
  $lang_file = dirname(__FILE__) . '/' . $mce_locale . '_dlg.js';
3
 
4
+ if ( is_file($lang_file) && is_readable($lang_file) )
5
  $strings .= getFileContents($lang_file);
6
+ else $strings .= getFileContents(dirname(__FILE__) . '/en_dlg.js');
7
  ?>
readme.txt CHANGED
@@ -2,15 +2,15 @@
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
 
@@ -22,7 +22,9 @@ 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
 
28
  = Some of the features added by this plugin =
2
  Contributors: Andrew Ozz
3
  Donate link:
4
  Tags: wysiwyg, formatting, tinymce, write, edit, post
5
+ Requires at least: 2.6
6
+ Tested up to: 2.6
7
+ Stable tag: 3.1
8
 
9
  Enables most of the advanced features of TinyMCE, the WordPress WYSIWYG editor.
10
 
11
  == Description ==
12
 
13
+ This plugin adds 15 plugins to [TinyMCE](http://tinymce.moxiecode.com/): Advanced hr, Advanced Image, Advanced Link, Context Menu, Emotions (Smilies), Date and Time, IESpell, Layer, Nonbreaking, Print, Search and Replace, Style, Table, Visual Characters and XHTML Extras.
14
 
15
  Version 2.0 includes an admin page for arranging the TinyMCE toolbar buttons, easy installation, a lot of bugfixes, customized "Smilies" plugin that uses the built-in WordPress smilies, etc. The admin page uses Scriptaculous and Prototype.js (similar to the "Widgets" admin page) that lets you "drag and drop" the TinyMCE buttons to arrange your own toolbars and enables/disables the corresponding plugins depending on the used buttons.
16
 
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
+ New in version 3.1: Compatibility with WordPress 2.6 and TinyMCE 3.1, keeps empty paragrarhs when disabling the removal of P and BR tags, the buttons for MCImageManager and MCFileManager can be arranged (if installed).
26
+
27
+ **Language Support:** The plugin interface in only in English, but the TinyMCE plugins include several translations: German, French, Italian, Spanish, Portuguese, Russian, Chinese and Japanese. More translations are available at the [TinyMCE web site](http://tinymce.moxiecode.com/download_i18n.php).
28
 
29
 
30
  = Some of the features added by this plugin =
tadv_admin.php CHANGED
@@ -4,28 +4,43 @@ if ( ! current_user_can('edit_themes') )
4
  wp_die('Cheatin&#8217; uh?');
5
 
6
  if ( isset( $_POST['tadv_uninstall'] ) ) {
7
- check_admin_referer( 'tadv-uninstall' );
8
 
9
  delete_option('tadv_options');
10
- delete_option('tadv_toolbars');
11
- delete_option('tadv_plugins');
12
- delete_option('tadv_btns1');
13
- delete_option('tadv_btns2');
14
- delete_option('tadv_btns3');
15
- delete_option('tadv_btns4');
16
- delete_option('tadv_allbtns');
17
 
18
  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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  $update_tadv_options = false;
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();
@@ -33,57 +48,60 @@ else {
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';
89
  if ( in_array('visualchars', $allbtns) ) $plugins[] = 'visualchars';
@@ -92,292 +110,251 @@ if ( empty($toolbar_1) && empty($toolbar_2) && empty($toolbar_3) && empty($toolb
92
  if ( in_array('styleprops', $allbtns) ) $plugins[] = 'style';
93
  if ( in_array('emotions', $allbtns) ) $plugins[] = 'emotions';
94
  if ( in_array('insertdate', $allbtns) ||
95
- in_array('inserttime', $allbtns) ) $plugins[] = 'insertdatetime';
96
 
97
  if ( in_array('tablecontrols', $allbtns) ) $plugins[] = 'table';
98
  if ( in_array('print', $allbtns) ) $plugins[] = 'print';
99
  if ( in_array('search', $allbtns) ||
100
- in_array('replace', $allbtns) ) $plugins[] = 'searchreplace';
101
 
102
- if ( in_array('cite', $allbtns) ||
103
- in_array('ins', $allbtns) ||
104
- in_array('del', $allbtns) ||
105
- in_array('abbr', $allbtns) ||
106
- in_array('acronym', $allbtns) ||
107
- in_array('attribs', $allbtns) ) $plugins[] = 'xhtmlxtras';
108
 
109
  if ( $tadv_options['advlink'] == '1' ) $plugins[] = 'advlink';
110
  if ( $tadv_options['advimage'] == '1' ) $plugins[] = 'advimage';
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
 
136
- <h2>TinyMCE Buttons Arrangement</h2>
137
 
138
- <form id="tadvadmin" method="post" action="" onsubmit="tadvSerializeAll();">
139
- <p>Drag and drop buttons onto the toolbars below.</p>
140
 
141
  <div id="tadvzones">
142
  <input id="toolbar_1order" name="toolbar_1order" value="" type="hidden" />
143
  <input id="toolbar_2order" name="toolbar_2order" value="" type="hidden" />
144
  <input id="toolbar_3order" name="toolbar_3order" value="" type="hidden" />
145
  <input id="toolbar_4order" name="toolbar_4order" value="" type="hidden" />
146
- <input name="tadv" value="1" type="hidden" />
147
 
148
- <div class="tadvdropzone">
149
- <ul style="position: relative;" id="toolbar_1">
150
  <?php
151
  if ( is_array($tadv_toolbars['toolbar_1']) ) {
152
- $tb1 = array();
153
- foreach( $tadv_toolbars['toolbar_1'] as $k ) {
154
- $t = array_intersect( $buttons, (array) $k );
155
- $tb1 += $t;
156
- }
157
 
158
- foreach( $tb1 as $name => $btn ) {
159
- if ( strpos( $btn, 'separator' ) !== false ) { ?>
160
 
161
- <li class="separator" id="pre_<?php echo $btn; ?>">
162
- <div class="tadvitem"> </div></li>
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
 
175
- <div class="tadvdropzone">
176
- <ul style="position: relative;" id="toolbar_2">
177
  <?php
178
  if ( is_array($tadv_toolbars['toolbar_2']) ) {
179
- $tb2 = array();
180
- foreach( $tadv_toolbars['toolbar_2'] as $k ) {
181
- $t = array_intersect( $buttons, (array) $k );
182
- $tb2 = $tb2 + $t;
183
- }
184
- foreach( $tb2 as $name => $btn ) {
185
- if ( strpos( $btn, 'separator' ) !== false ) { ?>
186
-
187
- <li class="separator" id="pre_<?php echo $btn; ?>">
188
- <div class="tadvitem"> </div></li>
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
 
201
- <div class="tadvdropzone">
202
- <ul style="position: relative;" id="toolbar_3">
203
- <?php
204
  if ( is_array($tadv_toolbars['toolbar_3']) ) {
205
- $tb3 = array();
206
- foreach( $tadv_toolbars['toolbar_3'] as $k ) {
207
- $t = array_intersect( $buttons, (array) $k );
208
- $tb3 += $t;
209
- }
210
- foreach( $tb3 as $name => $btn ) {
211
- if ( strpos( $btn, 'separator' ) !== false ) { ?>
212
-
213
- <li class="separator" id="pre_<?php echo $btn; ?>">
214
- <div class="tadvitem"> </div></li>
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
 
227
- <div class="tadvdropzone">
228
- <ul style="position: relative;" id="toolbar_4">
229
- <?php
230
  if ( is_array($tadv_toolbars['toolbar_4']) ) {
231
- $tb4 = array();
232
- foreach( $tadv_toolbars['toolbar_4'] as $k ) {
233
- $t = array_intersect( $buttons, (array) $k );
234
- $tb4 += $t;
235
- }
236
- foreach( $tb4 as $name => $btn ) {
237
- if ( strpos( $btn, 'separator' ) !== false ) { ?>
238
-
239
- <li class="separator" id="pre_<?php echo $btn; ?>">
240
- <div class="tadvitem"> </div></li>
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>
253
 
254
- <div id="tadvWarnmsg" ></div>
 
 
255
 
256
- <div id="tadvpalettediv">
257
- <ul style="position: relative;" id="tadvpalette">
258
  <?php
259
  if ( is_array($buttons) ) {
260
- foreach( $buttons as $name => $btn ) {
261
- if ( strpos( $btn, 'separator' ) !== false ) { ?>
262
 
263
- <li class="separator" id="pre_<?php echo $btn; ?>">
264
- <div class="tadvitem"> </div></li>
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
- }
272
  } ?>
273
- </ul>
274
  </div>
275
 
276
- <table class="clear" style="margin:10px 0"><tr><td style="padding:2px 12px 8px;">
277
- Also enable:
278
- <label for="advlink" class="tadv-box">Advanced Link &nbsp;
279
- <input type="checkbox" class="tadv-chk" name="advlink" id="advlink" <?php if ( $tadv_options['advlink'] == '1' ) echo ' checked="checked"'; ?> /></label> &bull;
280
-
281
- <label for="advimage" class="tadv-box">Advanced Image &nbsp;
282
- <input type="checkbox" class="tadv-chk" name="advimage" id="advimage" <?php if ( $tadv_options['advimage'] == '1' ) echo ' checked="checked"'; ?> /></label> &bull;
283
-
284
- <label for="contextmenu" class="tadv-box">Context Menu &nbsp;
285
- <input type="checkbox" class="tadv-chk" name="contextmenu" id="contextmenu" <?php if ( $tadv_options['contextmenu'] == '1' ) echo ' checked="checked"'; ?> /></label>
286
- (to show the browser's context menu in Firefox and use the spellchecker, hold down the &quot;Ctrl&quot; key).
287
- </td></tr>
288
-
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>
306
  </td></tr>
307
  <?php }
308
- } // end mce_locale
309
  ?>
310
  </table>
311
 
312
  <p class="submit">
313
  <?php wp_nonce_field( 'tadv-save-buttons-order' ); ?>
314
- <input type="submit" name="save" value="Save Changes" />
315
- <input type="button" name="uninstall" class="tadv_btn" value="Uninstall" onclick="document.getElementById('tadv_uninst_div').style.display = 'block';" />
316
  </p>
317
  </form>
318
- <br class="clear" />
 
 
 
319
 
320
  <div id="tadv_uninst_div" style="">
321
  <form method="post" action="">
322
  <?php wp_nonce_field('tadv-uninstall'); ?>
323
- <div>Uninstalling will remove all saved settings and buttons arrangement from the database.
324
- <input class="button tadv_btn" type="button" name="cancel" value="Cancel" onclick="document.getElementById('tadv_uninst_div').style.display = 'none';" style="margin-left:20px" />
325
- <input class="button tadv_btn" type="submit" name="tadv_uninstall" value="Continue" /></div>
326
  </form>
327
  </div>
328
  </div>
329
 
330
- <script type="text/javascript">
331
- // <![CDATA[
332
- Sortable.create("toolbar_1", {
333
- dropOnEmpty: true,
334
- containment: ["tadvpalette","toolbar_1","toolbar_2","toolbar_3","toolbar_4"],
335
- starteffect: function(element){new Effect.Opacity(element, {duration:0, from:1.0, to:0.7}); },
336
- endeffect: function(element){new Effect.Opacity(element, {duration:0, from:0.7, to:1.0}); },
337
- overlap: 'horizontal',
338
- constraint: false, onUpdate: tadvUpdateAll,
339
- format: /^pre_(.*)$/
340
- });
341
- Sortable.create("toolbar_2", {
342
- dropOnEmpty: true,
343
- containment: ["tadvpalette","toolbar_1","toolbar_2","toolbar_3","toolbar_4"],
344
- starteffect: function(element){new Effect.Opacity(element, {duration:0, from:1.0, to:0.7}); },
345
- endeffect: function(element){new Effect.Opacity(element, {duration:0, from:0.7, to:1.0}); },
346
- overlap: 'horizontal',
347
- constraint: false, onUpdate: tadvUpdateAll,
348
- format: /^pre_(.*)$/
349
- });
350
- Sortable.create("toolbar_3", {
351
- dropOnEmpty: true,
352
- containment: ["tadvpalette","toolbar_1","toolbar_2","toolbar_3","toolbar_4"],
353
- starteffect: function(element){new Effect.Opacity(element, {duration:0, from:1.0, to:0.7}); },
354
- endeffect: function(element){new Effect.Opacity(element, {duration:0, from:0.7, to:1.0}); },
355
- overlap: 'horizontal',
356
- constraint: false, onUpdate: tadvUpdateAll,
357
- format: /^pre_(.*)$/
358
- });
359
- Sortable.create("toolbar_4", {
360
- dropOnEmpty: true,
361
- containment: ["tadvpalette","toolbar_1","toolbar_2","toolbar_3","toolbar_4"],
362
- starteffect: function(element){new Effect.Opacity(element, {duration:0, from:1.0, to:0.7}); },
363
- endeffect: function(element){new Effect.Opacity(element, {duration:0, from:0.7, to:1.0}); },
364
- overlap: 'horizontal',
365
- constraint: false, onUpdate: tadvUpdateAll,
366
- format: /^pre_(.*)$/
367
- });
368
- Sortable.create("tadvpalette", {
369
- dropOnEmpty: true,
370
- containment: ["tadvpalette","toolbar_1","toolbar_2","toolbar_3","toolbar_4"],
371
- starteffect: function(element){new Effect.Opacity(element, {duration:0, from:1.0, to:0.7}); },
372
- endeffect: function(element){new Effect.Opacity(element, {duration:0, from:0.7, to:1.0}); },
373
- overlap: 'horizontal',
374
- constraint: false, onUpdate: tadvUpdateAll,
375
- format: /^pre_(.*)$/
376
- });
377
- // ]]>
378
- </script>
379
-
380
- <?php
381
- if ( $update_tadv_options )
382
- update_option( 'tadv_options', $tadv_options );
383
  ?>
4
  wp_die('Cheatin&#8217; uh?');
5
 
6
  if ( isset( $_POST['tadv_uninstall'] ) ) {
7
+ check_admin_referer( 'tadv-uninstall' );
8
 
9
  delete_option('tadv_options');
10
+ delete_option('tadv_toolbars');
11
+ delete_option('tadv_plugins');
12
+ delete_option('tadv_btns1');
13
+ delete_option('tadv_btns2');
14
+ delete_option('tadv_btns3');
15
+ delete_option('tadv_btns4');
16
+ delete_option('tadv_allbtns');
17
 
18
  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
 
22
+ if ( ! isset($GLOBALS['wp_version']) || version_compare($GLOBALS['wp_version'], '2.6', '<') ) { // if less than 2.6 ?>
23
+ <div class="error" style="text-align:center;margin-top:20px;">
24
+ <form method="post" action="">
25
+ <?php
26
+ wp_nonce_field( 'tadv-uninstall' );
27
+ echo '<p>'.__('This plugin requires WordPress version 2.6 or newer. Please upgrade your WordPress installation or download an', 'tadv').' <a href="http://wordpress.org/extend/plugins/tinymce-advanced/download/">'.__('older version of the plugin.', 'tadv').'</a></p>';
28
+ ?>
29
+ <p><input class="button tadv_btn" type="submit" name="tadv_uninstall" value="<?php _e('Uninstall', 'tadv'); ?>" /></p>
30
+ </form>
31
+ </div>
32
+ <?php
33
+ return;
34
+ }
35
+
36
  $update_tadv_options = false;
37
+ $imgpath = WP_PLUGIN_URL . '/tinymce-advanced/images/';
38
 
39
  $tadv_toolbars = get_option('tadv_toolbars');
40
+ if ( ! is_array($tadv_toolbars) ) {
41
+ @include_once( WP_PLUGIN_DIR . '/tinymce-advanced/tadv_defaults.php');
42
+ $tadv_options = array( 'advlink' => 1, 'advimage' => 1, 'importcss' => 0, 'contextmenu' => 0, 'tadvreplace' => 0 );
43
+ } else {
44
  $tadv_options = get_option('tadv_options');
45
  $tadv_toolbars['toolbar_1'] = isset($tadv_toolbars['toolbar_1']) ? (array) $tadv_toolbars['toolbar_1'] : array();
46
  $tadv_toolbars['toolbar_2'] = isset($tadv_toolbars['toolbar_2']) ? (array) $tadv_toolbars['toolbar_2'] : array();
48
  $tadv_toolbars['toolbar_4'] = isset($tadv_toolbars['toolbar_4']) ? (array) $tadv_toolbars['toolbar_4'] : array();
49
  }
50
 
51
+ if ( isset( $_POST['tadv'] ) ) {
52
+ check_admin_referer( 'tadv-save-buttons-order' );
53
+
54
  $tb1 = $tb2 = $tb3 = $tb4 = $btns = array();
55
  parse_str( $_POST['toolbar_1order'], $tb1 );
56
  parse_str( $_POST['toolbar_2order'], $tb2 );
57
  parse_str( $_POST['toolbar_3order'], $tb3 );
58
  parse_str( $_POST['toolbar_4order'], $tb4 );
59
+
60
+ $tadv_toolbars['toolbar_1'] = (array) $tb1['pre'];
61
+ $tadv_toolbars['toolbar_2'] = (array) $tb2['pre'];
62
+ $tadv_toolbars['toolbar_3'] = (array) $tb3['pre'];
63
+ $tadv_toolbars['toolbar_4'] = (array) $tb4['pre'];
64
 
65
  update_option( 'tadv_toolbars', $tadv_toolbars );
66
 
67
+ $tadv_options['advlink'] = $_POST['advlink'] ? 1 : 0;
68
+ $tadv_options['advimage'] = $_POST['advimage'] ? 1 : 0;
69
+ $tadv_options['contextmenu'] = $_POST['contextmenu'] ? 1 : 0;
70
+ $tadv_options['importcss'] = $_POST['importcss'] ? 1 : 0;
71
+ $tadv_options['fix_autop'] = $_POST['fix_autop'] ? 1 : 0;
72
+ $update_tadv_options = true;
73
  }
74
 
75
  $hidden_row = 0;
76
  $i = 0;
77
  foreach ( $tadv_toolbars as $toolbar ) {
78
  $l = false;
79
+ $i++;
80
 
81
  if ( empty($toolbar) ) {
82
  $btns["toolbar_$i"] = array();
83
  continue;
84
  }
85
 
86
+ foreach( $toolbar as $k => $v ) {
87
+ if ( strpos($v, 'separator') !== false ) $toolbar[$k] = 'separator';
88
+ if ( 'layer' == $v ) $l = $k;
89
+ if ( empty($v) ) unset($toolbar[$k]);
90
+ }
91
+ if ( $l ) array_splice( $toolbar, $l, 1, array('insertlayer', 'moveforward', 'movebackward', 'absolute') );
92
 
93
+ $btns["toolbar_$i"] = $toolbar;
94
  }
95
  extract($btns);
96
 
97
  if ( empty($toolbar_1) && empty($toolbar_2) && empty($toolbar_3) && empty($toolbar_4) ) {
98
+ ?><div class="error" id="message"><p><?php _e('All toolbars are empty! Default buttons loaded.', 'tadv'); ?></p></div><?php
 
 
 
99
 
100
+ @include_once( WP_PLUGIN_DIR . '/tinymce-advanced/tadv_defaults.php');
101
+ $allbtns = array_merge( $tadv_btns1, $tadv_btns2, $tadv_btns3, $tadv_btns4 );
102
+ } else {
103
+ $allbtns = array_merge( $toolbar_1, $toolbar_2, $toolbar_3, $toolbar_4 );
104
+ }
105
  if ( in_array('advhr', $allbtns) ) $plugins[] = 'advhr';
106
  if ( in_array('insertlayer', $allbtns) ) $plugins[] = 'layer';
107
  if ( in_array('visualchars', $allbtns) ) $plugins[] = 'visualchars';
110
  if ( in_array('styleprops', $allbtns) ) $plugins[] = 'style';
111
  if ( in_array('emotions', $allbtns) ) $plugins[] = 'emotions';
112
  if ( in_array('insertdate', $allbtns) ||
113
+ in_array('inserttime', $allbtns) ) $plugins[] = 'insertdatetime';
114
 
115
  if ( in_array('tablecontrols', $allbtns) ) $plugins[] = 'table';
116
  if ( in_array('print', $allbtns) ) $plugins[] = 'print';
117
  if ( in_array('search', $allbtns) ||
118
+ in_array('replace', $allbtns) ) $plugins[] = 'searchreplace';
119
 
120
+ if ( in_array('cite', $allbtns) ||
121
+ in_array('ins', $allbtns) ||
122
+ in_array('del', $allbtns) ||
123
+ in_array('abbr', $allbtns) ||
124
+ in_array('acronym', $allbtns) ||
125
+ in_array('attribs', $allbtns) ) $plugins[] = 'xhtmlxtras';
126
 
127
  if ( $tadv_options['advlink'] == '1' ) $plugins[] = 'advlink';
128
  if ( $tadv_options['advimage'] == '1' ) $plugins[] = 'advimage';
129
  if ( $tadv_options['contextmenu'] == '1' ) $plugins[] = 'contextmenu';
 
130
 
131
+ $buttons = array( 'Kitchen Sink' => 'wp_adv', 'Quote' => 'blockquote', 'Bold' => 'bold', 'Italic' => 'italic', 'Strikethrough' => 'strikethrough', 'Underline' => 'underline', 'Bullet List' => 'bullist', 'Numbered List' => 'numlist', 'Outdent' => 'outdent', 'Indent' => 'indent', 'Allign Left' => 'justifyleft', 'Center' => 'justifycenter', 'Alligh Right' => 'justifyright', 'Justify' => 'justifyfull', 'Cut' => 'cut', 'Copy' => 'copy', 'Paste' => 'paste', 'Link' => 'link', 'Remove Link' => 'unlink', 'Insert Image' => 'image', 'More Tag' => 'wp_more', 'Split Page' => 'wp_page', 'Search' => 'search', 'Replace' => 'replace', '<!--fontselect-->' => 'fontselect', '<!--fontsizeselect-->' => 'fontsizeselect', 'Help' => 'wp_help', 'Full Screen' => 'fullscreen', '<!--styleselect-->' => 'styleselect', '<!--formatselect-->' => 'formatselect', 'Text Color' => 'forecolor', 'Paste as Text' => 'pastetext', 'Paste from Word' => 'pasteword', 'Remove Format' => 'removeformat', 'Clean Code' => 'cleanup', 'Check Spelling' => 'spellchecker', 'Character Map' => 'charmap', 'Print' => 'print', 'Undo' => 'undo', 'Redo' => 'redo', 'Table' => 'tablecontrols', 'Citation' => 'cite', 'Inserted Text' => 'ins', 'Deleted Text' => 'del', 'Abbreviation' => 'abbr', 'Acronym' => 'acronym', 'XHTML Attribs' => 'attribs', 'Layer' => 'layer', 'Advanced HR' => 'advhr', 'View HTML' => 'code', 'Hidden Chars' => 'visualchars', 'NB Space' => 'nonbreaking', 'Sub' => 'sub', 'Sup' => 'sup', 'Visual Aids' => 'visualaid', 'Insert Date' => 'insertdate', 'Insert Time' => 'inserttime', 'Anchor' => 'anchor', 'Style' => 'styleprops', 'Smilies' => 'emotions', 'Insert Movie' => 'media', 'IE Spell' => 'iespell' );
132
+
133
+ if ( function_exists('moxiecode_plugins_url') ) {
134
+ if ( moxiecode_plugins_url('imagemanager') ) $buttons['MCFileManager'] = 'insertimage';
135
+ if ( moxiecode_plugins_url('filemanager') ) $buttons['MCImageManager'] = 'insertfile';
136
+ }
137
 
138
  $tadv_allbtns = array_values($buttons);
139
  $tadv_allbtns[] = 'separator';
140
  $tadv_allbtns[] = '|';
141
 
142
+ if ( get_option('tadv_plugins') != $plugins ) update_option( 'tadv_plugins', $plugins );
143
  if ( get_option('tadv_btns1') != $toolbar_1 ) update_option( 'tadv_btns1', $toolbar_1 );
144
  if ( get_option('tadv_btns2') != $toolbar_2 ) update_option( 'tadv_btns2', $toolbar_2 );
145
  if ( get_option('tadv_btns3') != $toolbar_3 ) update_option( 'tadv_btns3', $toolbar_3 );
146
  if ( get_option('tadv_btns4') != $toolbar_4 ) update_option( 'tadv_btns4', $toolbar_4 );
147
  if ( get_option('tadv_allbtns') != $tadv_allbtns ) update_option( 'tadv_allbtns', $tadv_allbtns );
148
 
149
+ for ( $i = 1; $i < 21; $i++ )
150
  $buttons["s$i"] = "separator$i";
151
 
152
  if ( isset($_POST['tadv']) && isset($_POST['save']) ) { ?>
153
+ <div class="updated" id="message"><p><?php _e('Options saved', 'tadv'); ?></p></div>
154
  <?php } ?>
155
 
156
+ <div class="wrap" id="contain">
157
 
158
+ <h2><?php _e('TinyMCE Buttons Arrangement', 'tadv'); ?></h2>
159
 
160
+ <form id="tadvadmin" method="post" action="" onsubmit="">
161
+ <p><?php _e('Drag and drop buttons onto the toolbars below.', 'tadv'); ?></p>
162
 
163
  <div id="tadvzones">
164
  <input id="toolbar_1order" name="toolbar_1order" value="" type="hidden" />
165
  <input id="toolbar_2order" name="toolbar_2order" value="" type="hidden" />
166
  <input id="toolbar_3order" name="toolbar_3order" value="" type="hidden" />
167
  <input id="toolbar_4order" name="toolbar_4order" value="" type="hidden" />
168
+ <input name="tadv" value="1" type="hidden" />
169
 
170
+ <div class="tadvdropzone">
171
+ <ul style="position: relative;" id="toolbar_1" class="container">
172
  <?php
173
  if ( is_array($tadv_toolbars['toolbar_1']) ) {
174
+ $tb1 = array();
175
+ foreach( $tadv_toolbars['toolbar_1'] as $k ) {
176
+ $t = array_intersect( $buttons, (array) $k );
177
+ $tb1 += $t;
178
+ }
179
 
180
+ foreach( $tb1 as $name => $btn ) {
181
+ if ( strpos( $btn, 'separator' ) !== false ) { ?>
182
 
183
+ <li class="separator" id="pre_<?php echo $btn; ?>">
184
+ <div class="tadvitem"> </div></li>
185
  <?php } else { ?>
186
 
187
+ <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
188
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
189
+ <span class="descr"> <?php echo $name; ?></span></div></li>
190
  <?php }
191
+ }
192
+ $buttons = array_diff( $buttons, $tb1 );
193
  } ?>
194
+ </ul></div>
195
+ <br class="clear" />
196
 
197
+ <div class="tadvdropzone">
198
+ <ul style="position: relative;" id="toolbar_2" class="container">
199
  <?php
200
  if ( is_array($tadv_toolbars['toolbar_2']) ) {
201
+ $tb2 = array();
202
+ foreach( $tadv_toolbars['toolbar_2'] as $k ) {
203
+ $t = array_intersect( $buttons, (array) $k );
204
+ $tb2 = $tb2 + $t;
205
+ }
206
+ foreach( $tb2 as $name => $btn ) {
207
+ if ( strpos( $btn, 'separator' ) !== false ) { ?>
208
+
209
+ <li class="separator" id="pre_<?php echo $btn; ?>">
210
+ <div class="tadvitem"> </div></li>
211
  <?php } else { ?>
212
 
213
+ <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
214
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
215
+ <span class="descr"> <?php echo $name; ?></span></div></li>
216
  <?php }
217
+ }
218
+ $buttons = array_diff( $buttons, $tb2 );
219
  } ?>
220
+ </ul></div>
221
+ <br class="clear" />
222
 
223
+ <div class="tadvdropzone">
224
+ <ul style="position: relative;" id="toolbar_3" class="container">
225
+ <?php
226
  if ( is_array($tadv_toolbars['toolbar_3']) ) {
227
+ $tb3 = array();
228
+ foreach( $tadv_toolbars['toolbar_3'] as $k ) {
229
+ $t = array_intersect( $buttons, (array) $k );
230
+ $tb3 += $t;
231
+ }
232
+ foreach( $tb3 as $name => $btn ) {
233
+ if ( strpos( $btn, 'separator' ) !== false ) { ?>
234
+
235
+ <li class="separator" id="pre_<?php echo $btn; ?>">
236
+ <div class="tadvitem"> </div></li>
237
  <?php } else { ?>
238
 
239
+ <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
240
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
241
+ <span class="descr"> <?php echo $name; ?></span></div></li>
242
  <?php }
243
+ }
244
+ $buttons = array_diff( $buttons, $tb3 );
245
  } ?>
246
+ </ul></div>
247
+ <br class="clear" />
248
 
249
+ <div class="tadvdropzone">
250
+ <ul style="position: relative;" id="toolbar_4" class="container">
251
+ <?php
252
  if ( is_array($tadv_toolbars['toolbar_4']) ) {
253
+ $tb4 = array();
254
+ foreach( $tadv_toolbars['toolbar_4'] as $k ) {
255
+ $t = array_intersect( $buttons, (array) $k );
256
+ $tb4 += $t;
257
+ }
258
+ foreach( $tb4 as $name => $btn ) {
259
+ if ( strpos( $btn, 'separator' ) !== false ) { ?>
260
+
261
+ <li class="separator" id="pre_<?php echo $btn; ?>">
262
+ <div class="tadvitem"> </div></li>
263
  <?php } else { ?>
264
 
265
+ <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
266
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
267
+ <span class="descr"> <?php echo $name; ?></span></div></li>
268
  <?php }
269
+ }
270
+ $buttons = array_diff( $buttons, $tb4 );
271
  } ?>
272
+ </ul></div>
273
+ <br class="clear" />
274
+ </div>
275
 
276
+ <div id="tadvWarnmsg">&nbsp;
277
+ <span id="too_long" style="display:none;"><?php _e('Adding too many buttons will make the toolbar too long and will not display correctly in TinyMCE!', 'tadv'); ?></span>
278
+ </div>
279
 
280
+ <div id="tadvpalettediv">
281
+ <ul style="position: relative;" id="tadvpalette">
282
  <?php
283
  if ( is_array($buttons) ) {
284
+ foreach( $buttons as $name => $btn ) {
285
+ if ( strpos( $btn, 'separator' ) !== false ) { ?>
286
 
287
+ <li class="separator" id="pre_<?php echo $btn; ?>">
288
+ <div class="tadvitem"> </div></li>
289
  <?php } else { ?>
290
 
291
+ <li class="tadvmodule" id="pre_<?php echo $btn; ?>">
292
+ <div class="tadvitem"><img src="<?php echo $imgpath . $btn . '.gif'; ?>" title="<?php echo $name; ?>" />
293
+ <span class="descr"> <?php echo $name; ?></span></div></li>
294
  <?php }
295
+ }
296
  } ?>
297
+ </ul>
298
  </div>
299
 
300
+ <table class="clear" style="margin:10px 0"><tr><td style="padding:2px 12px 8px;">
301
+ Also enable:
302
+ <label for="advlink" class="tadv-box"><?php _e('Advanced Link', 'tadv'); ?> &nbsp;
303
+ <input type="checkbox" class="tadv-chk" name="advlink" id="advlink" <?php if ( $tadv_options['advlink'] == '1' ) echo ' checked="checked"'; ?> /></label> &bull;
304
+
305
+ <label for="advimage" class="tadv-box"><?php _e('Advanced Image', 'tadv'); ?> &nbsp;
306
+ <input type="checkbox" class="tadv-chk" name="advimage" id="advimage" <?php if ( $tadv_options['advimage'] == '1' ) echo ' checked="checked"'; ?> /></label> &bull;
307
+ <label for="contextmenu" class="tadv-box"><?php _e('Context Menu', 'tadv'); ?> &nbsp;
308
+
309
+ <input type="checkbox" class="tadv-chk" name="contextmenu" id="contextmenu" <?php if ( $tadv_options['contextmenu'] == '1' ) echo ' checked="checked"'; ?> /></label>
310
+ <?php _e('(to show the context menu in Firefox and use the spellchecker, hold down the Ctrl key).', 'tadv'); ?>
311
+ </td></tr>
312
+
313
+ <tr><td style="border:1px solid #CD0000;padding:2px 12px 8px;">
314
+ <p style="font-weight:bold;color:#CD0000;"><?php _e('Advanced', 'tadv'); ?></p>
315
+
316
+ <p><label for="importcss" class="tadv-box"><?php _e('Import the current theme CSS classes', 'tadv'); ?> &nbsp;
317
+ <input type="checkbox" class="tadv-chk" name="importcss" id="importcss" <?php if ( $tadv_options['importcss'] == '1' ) echo ' checked="checked"'; ?> /></label></p>
318
+ <p style="font-size:11px;"><?php _e('Custom CSS styles can be added in /wp-content/plugins/tinymce-advanced/css/tadv-mce.css. They will be imported and used in TinyMCE. The file has to be downloaded with FTP, edited and uploaded, overwriting the original. Only CSS classes can be added, also <strong>div.my-class</strong> would not work, but <strong>.my-class</strong> will.', 'tadv'); ?></p>
319
+ <p><label for="fix_autop" class="tadv-box"><?php _e('Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them in the HTML editor', 'tadv'); ?> &nbsp;
320
+ <input type="checkbox" class="tadv-chk" name="fix_autop" id="fix_autop" <?php if ( $tadv_options['fix_autop'] == '1' ) echo ' checked="checked"'; ?> /></label></p>
321
+ <p style="font-size:11px;"><?php _e('This will make it possible to use more advanced HTML without the back-end filtering affecting it much. It also 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.', 'tadv'); ?></p>
322
  </td></tr>
323
  <?php
324
+ $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
325
+ if ( $mce_locale != 'en' ) {
326
+ if ( ! @file_exists(WP_PLUGIN_DIR . '/tinymce-advanced/mce/advlink/langs/' . $mce_locale . '_dlg.js') ) { ?>
327
+ <tr><td style="padding:2px 12px 8px;">
328
+ <p style="font-weight:bold;"><?php _e('Language Settings', 'tadv'); ?></p>
329
+ <p><?php _e('Your WordPress language is set to', 'tadv'); ?> <strong><?php echo get_locale(); ?></strong>. <?php _e('However there is no matching language installed for TinyMCE plugins. This plugin includes several translations: German, French, Italian, Spanish, Portuguese, Russian, Japanese and Chinese. More translations are available at the', 'tadv'); ?> <a href="http://services.moxiecode.com/i18n/"><?php _e('TinyMCE web site.', 'tadv'); ?></a></p>
330
  </td></tr>
331
  <?php }
332
+ } // end mce_locale
333
  ?>
334
  </table>
335
 
336
  <p class="submit">
337
  <?php wp_nonce_field( 'tadv-save-buttons-order' ); ?>
338
+ <input type="button" name="save" value="<?php _e('Save Changes', 'tadv'); ?>" onclick="tadvSortable.serialize();" />
339
+ <input type="button" name="uninstall" class="tadv_btn" value="<?php _e('Uninstall', 'tadv'); ?>" onclick="document.getElementById('tadv_uninst_div').style.display = 'block';" />
340
  </p>
341
  </form>
342
+
343
+ <div id="tadvWarnmsg2">&nbsp;
344
+ <span id="sink_err" style="display:none;"><?php _e('The Kitchen Sink button shows/hides the next toolbar row. It will not work at the current place.', 'tadv'); ?></span>
345
+ </div>
346
 
347
  <div id="tadv_uninst_div" style="">
348
  <form method="post" action="">
349
  <?php wp_nonce_field('tadv-uninstall'); ?>
350
+ <div><?php _e('Uninstalling will remove all saved settings from the database.', 'tadv'); ?>
351
+ <input class="button tadv_btn" type="button" name="cancel" value="<?php _e('Cancel', 'tadv'); ?>" onclick="document.getElementById('tadv_uninst_div').style.display = 'none';" style="margin-left:20px" />
352
+ <input class="button tadv_btn" type="submit" name="tadv_uninstall" value="<?php _e('Continue', 'tadv'); ?>" /></div>
353
  </form>
354
  </div>
355
  </div>
356
 
357
+ <?php
358
+ if ( $update_tadv_options )
359
+ update_option( 'tadv_options', $tadv_options );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  ?>
tadv_defaults.php CHANGED
@@ -1,7 +1,5 @@
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(
1
  <?php
2
 
 
 
3
  $tadv_plugins = array( 'style', 'emotions', 'print', 'searchreplace', 'xhtmlxtras', 'advlink', 'advimage' );
4
 
5
  $tadv_toolbars = array(
tiny_mce_popup.js CHANGED
@@ -1,275 +1,275 @@
1
- // Some global instances
2
- var tinymce = null, tinyMCEPopup, tinyMCE;
3
-
4
- tinyMCEPopup = {
5
- init : function() {
6
- var t = this, w, ti, li, q, i, it;
7
-
8
- li = ('' + document.location.search).replace(/^\?/, '').split('&');
9
- q = {};
10
- for (i=0; i<li.length; i++) {
11
- it = li[i].split('=');
12
- q[unescape(it[0])] = unescape(it[1]);
13
- }
14
-
15
- if (q.mce_rdomain)
16
- document.domain = q.mce_rdomain;
17
-
18
- // Find window & API
19
- w = t.getWin();
20
- tinymce = w.tinymce;
21
- tinyMCE = w.tinyMCE;
22
- t.editor = tinymce.EditorManager.activeEditor;
23
- t.params = t.editor.windowManager.params;
24
-
25
- // Setup local DOM
26
- t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document);
27
- t.dom.loadCSS(t.editor.settings.popup_css);
28
-
29
- // Setup on init listeners
30
- t.listeners = [];
31
- t.onInit = {
32
- add : function(f, s) {
33
- t.listeners.push({func : f, scope : s});
34
- }
35
- };
36
-
37
- t.isWindow = !t.getWindowArg('mce_inline');
38
- t.id = t.getWindowArg('mce_window_id');
39
- t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window);
40
- },
41
-
42
- getWin : function() {
43
- return window.dialogArguments || opener || parent || top;
44
- },
45
-
46
- getWindowArg : function(n, dv) {
47
- var v = this.params[n];
48
-
49
- return tinymce.is(v) ? v : dv;
50
- },
51
-
52
- getParam : function(n, dv) {
53
- return this.editor.getParam(n, dv);
54
- },
55
-
56
- getLang : function(n, dv) {
57
- return this.editor.getLang(n, dv);
58
- },
59
-
60
- execCommand : function(cmd, ui, val, a) {
61
- a = a || {};
62
- a.skip_focus = 1;
63
-
64
- this.restoreSelection();
65
- return this.editor.execCommand(cmd, ui, val, a);
66
- },
67
-
68
- resizeToInnerSize : function() {
69
- var t = this, n, b = document.body, vp = t.dom.getViewPort(window), dw, dh;
70
-
71
- dw = t.getWindowArg('mce_width') - vp.w;
72
- dh = t.getWindowArg('mce_height') - vp.h;
73
-
74
- if (t.isWindow)
75
- window.resizeBy(dw, dh);
76
- else
77
- t.editor.windowManager.resizeBy(dw, dh, t.id);
78
- },
79
-
80
- executeOnLoad : function(s) {
81
- this.onInit.add(function() {
82
- eval(s);
83
- });
84
- },
85
-
86
- storeSelection : function() {
87
- this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark('simple');
88
- },
89
-
90
- restoreSelection : function() {
91
- var t = tinyMCEPopup;
92
-
93
- if (!t.isWindow && tinymce.isIE)
94
- t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
95
- },
96
-
97
- requireLangPack : function() {
98
- var u = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url');
99
-
100
- if (u && this.editor.settings.language) {
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
- }
108
- },
109
-
110
- pickColor : function(e, element_id) {
111
- this.execCommand('mceColorPicker', true, {
112
- color : document.getElementById(element_id).value,
113
- func : function(c) {
114
- document.getElementById(element_id).value = c;
115
-
116
- try {
117
- document.getElementById(element_id).onchange();
118
- } catch (ex) {
119
- // Try fire event, ignore errors
120
- }
121
- }
122
- });
123
- },
124
-
125
- openBrowser : function(element_id, type, option) {
126
- tinyMCEPopup.restoreSelection();
127
- this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
128
- },
129
-
130
- close : function() {
131
- var t = this;
132
-
133
- // To avoid domain relaxing issue in Opera
134
- function close() {
135
- t.editor.windowManager.close(window, t.id);
136
- tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
137
- };
138
-
139
- if (tinymce.isOpera)
140
- t.getWin().setTimeout(close, 0);
141
- else
142
- close();
143
- },
144
-
145
- // Internal functions
146
-
147
- _restoreSelection : function() {
148
- var e = window.event.srcElement;
149
-
150
- if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
151
- tinyMCEPopup.restoreSelection();
152
- },
153
-
154
- /* _restoreSelection : function() {
155
- var e = window.event.srcElement;
156
-
157
- // If user focus a non text input or textarea
158
- if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
159
- tinyMCEPopup.restoreSelection();
160
- },*/
161
-
162
- _onDOMLoaded : function() {
163
- var t = this, ti = document.title, bm, h;
164
-
165
- // Translate page
166
- h = document.body.innerHTML;
167
-
168
- // Replace a=x with a="x" in IE
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 = '';
176
-
177
- // Restore selection in IE when focus is placed on a non textarea or input element of the type text
178
- if (tinymce.isIE)
179
- document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
180
-
181
- t.restoreSelection();
182
- t.resizeToInnerSize();
183
-
184
- // Set inline title
185
- if (!t.isWindow)
186
- t.editor.windowManager.setTitle(ti, t.id);
187
- else
188
- window.focus();
189
-
190
- if (!tinymce.isIE && !t.isWindow) {
191
- tinymce.dom.Event._add(document, 'focus', function() {
192
- t.editor.windowManager.focus(t.id)
193
- });
194
- }
195
-
196
- // Patch for accessibility
197
- tinymce.each(t.dom.select('select'), function(e) {
198
- e.onkeydown = tinyMCEPopup._accessHandler;
199
- });
200
-
201
- // Call onInit
202
- // Init must be called before focus so the selection won't get lost by the focus call
203
- tinymce.each(t.listeners, function(o) {
204
- o.func.call(o.scope, t.editor);
205
- });
206
-
207
- // Move focus to window
208
- if (t.getWindowArg('mce_auto_focus', true)) {
209
- window.focus();
210
-
211
- // Focus element with mceFocus class
212
- tinymce.each(document.forms, function(f) {
213
- tinymce.each(f.elements, function(e) {
214
- if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) {
215
- e.focus();
216
- return false; // Break loop
217
- }
218
- });
219
- });
220
- }
221
-
222
- document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
223
- },
224
-
225
- _accessHandler : function(e) {
226
- e = e || window.event;
227
-
228
- if (e.keyCode == 13 || e.keyCode == 32) {
229
- e = e.target || e.srcElement;
230
-
231
- if (e.onchange)
232
- e.onchange();
233
-
234
- return tinymce.dom.Event.cancel(e);
235
- }
236
- },
237
-
238
- _closeWinKeyHandler : function(e) {
239
- e = e || window.event;
240
-
241
- if (e.keyCode == 27)
242
- tinyMCEPopup.close();
243
- },
244
-
245
- _wait : function() {
246
- var t = this, ti;
247
-
248
- if (tinymce.isIE && document.location.protocol != 'https:') {
249
- // Fake DOMContentLoaded on IE
250
- document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');
251
- document.getElementById("__ie_onload").onreadystatechange = function() {
252
- if (this.readyState == "complete") {
253
- t._onDOMLoaded();
254
- document.getElementById("__ie_onload").onreadystatechange = null; // Prevent leak
255
- }
256
- };
257
- } else {
258
- if (tinymce.isIE || tinymce.isWebKit) {
259
- ti = setInterval(function() {
260
- if (/loaded|complete/.test(document.readyState)) {
261
- clearInterval(ti);
262
- t._onDOMLoaded();
263
- }
264
- }, 10);
265
- } else {
266
- window.addEventListener('DOMContentLoaded', function() {
267
- t._onDOMLoaded();
268
- }, false);
269
- }
270
- }
271
- }
272
- };
273
-
274
- tinyMCEPopup.init();
275
- tinyMCEPopup._wait(); // Wait for DOM Content Loaded
1
+ // Some global instances
2
+ var tinymce = null, tinyMCEPopup, tinyMCE;
3
+
4
+ tinyMCEPopup = {
5
+ init : function() {
6
+ var t = this, w, ti, li, q, i, it;
7
+
8
+ li = ('' + document.location.search).replace(/^\?/, '').split('&');
9
+ q = {};
10
+ for (i=0; i<li.length; i++) {
11
+ it = li[i].split('=');
12
+ q[unescape(it[0])] = unescape(it[1]);
13
+ }
14
+
15
+ if (q.mce_rdomain)
16
+ document.domain = q.mce_rdomain;
17
+
18
+ // Find window & API
19
+ w = t.getWin();
20
+ tinymce = w.tinymce;
21
+ tinyMCE = w.tinyMCE;
22
+ t.editor = tinymce.EditorManager.activeEditor;
23
+ t.params = t.editor.windowManager.params;
24
+
25
+ // Setup local DOM
26
+ t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document);
27
+ t.dom.loadCSS(t.editor.settings.popup_css);
28
+
29
+ // Setup on init listeners
30
+ t.listeners = [];
31
+ t.onInit = {
32
+ add : function(f, s) {
33
+ t.listeners.push({func : f, scope : s});
34
+ }
35
+ };
36
+
37
+ t.isWindow = !t.getWindowArg('mce_inline');
38
+ t.id = t.getWindowArg('mce_window_id');
39
+ t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window);
40
+ },
41
+
42
+ getWin : function() {
43
+ return window.dialogArguments || opener || parent || top;
44
+ },
45
+
46
+ getWindowArg : function(n, dv) {
47
+ var v = this.params[n];
48
+
49
+ return tinymce.is(v) ? v : dv;
50
+ },
51
+
52
+ getParam : function(n, dv) {
53
+ return this.editor.getParam(n, dv);
54
+ },
55
+
56
+ getLang : function(n, dv) {
57
+ return this.editor.getLang(n, dv);
58
+ },
59
+
60
+ execCommand : function(cmd, ui, val, a) {
61
+ a = a || {};
62
+ a.skip_focus = 1;
63
+
64
+ this.restoreSelection();
65
+ return this.editor.execCommand(cmd, ui, val, a);
66
+ },
67
+
68
+ resizeToInnerSize : function() {
69
+ var t = this, n, b = document.body, vp = t.dom.getViewPort(window), dw, dh;
70
+
71
+ dw = t.getWindowArg('mce_width') - vp.w;
72
+ dh = t.getWindowArg('mce_height') - vp.h;
73
+
74
+ if (t.isWindow)
75
+ window.resizeBy(dw, dh);
76
+ else
77
+ t.editor.windowManager.resizeBy(dw, dh, t.id);
78
+ },
79
+
80
+ executeOnLoad : function(s) {
81
+ this.onInit.add(function() {
82
+ eval(s);
83
+ });
84
+ },
85
+
86
+ storeSelection : function() {
87
+ this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark('simple');
88
+ },
89
+
90
+ restoreSelection : function() {
91
+ var t = tinyMCEPopup;
92
+
93
+ if (!t.isWindow && tinymce.isIE)
94
+ t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
95
+ },
96
+
97
+ requireLangPack : function() {
98
+ var u = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url');
99
+
100
+ if (u && this.editor.settings.language) {
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
+ }
108
+ },
109
+
110
+ pickColor : function(e, element_id) {
111
+ this.execCommand('mceColorPicker', true, {
112
+ color : document.getElementById(element_id).value,
113
+ func : function(c) {
114
+ document.getElementById(element_id).value = c;
115
+
116
+ try {
117
+ document.getElementById(element_id).onchange();
118
+ } catch (ex) {
119
+ // Try fire event, ignore errors
120
+ }
121
+ }
122
+ });
123
+ },
124
+
125
+ openBrowser : function(element_id, type, option) {
126
+ tinyMCEPopup.restoreSelection();
127
+ this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
128
+ },
129
+
130
+ close : function() {
131
+ var t = this;
132
+
133
+ // To avoid domain relaxing issue in Opera
134
+ function close() {
135
+ t.editor.windowManager.close(window);
136
+ tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
137
+ };
138
+
139
+ if (tinymce.isOpera)
140
+ t.getWin().setTimeout(close, 0);
141
+ else
142
+ close();
143
+ },
144
+
145
+ // Internal functions
146
+
147
+ _restoreSelection : function() {
148
+ var e = window.event.srcElement;
149
+
150
+ if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
151
+ tinyMCEPopup.restoreSelection();
152
+ },
153
+
154
+ /* _restoreSelection : function() {
155
+ var e = window.event.srcElement;
156
+
157
+ // If user focus a non text input or textarea
158
+ if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
159
+ tinyMCEPopup.restoreSelection();
160
+ },*/
161
+
162
+ _onDOMLoaded : function() {
163
+ var t = this, ti = document.title, bm, h;
164
+
165
+ // Translate page
166
+ h = document.body.innerHTML;
167
+
168
+ // Replace a=x with a="x" in IE
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 = '';
176
+
177
+ // Restore selection in IE when focus is placed on a non textarea or input element of the type text
178
+ if (tinymce.isIE)
179
+ document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
180
+
181
+ t.restoreSelection();
182
+ t.resizeToInnerSize();
183
+
184
+ // Set inline title
185
+ if (!t.isWindow)
186
+ t.editor.windowManager.setTitle(window, ti);
187
+ else
188
+ window.focus();
189
+
190
+ if (!tinymce.isIE && !t.isWindow) {
191
+ tinymce.dom.Event._add(document, 'focus', function() {
192
+ t.editor.windowManager.focus(t.id)
193
+ });
194
+ }
195
+
196
+ // Patch for accessibility
197
+ tinymce.each(t.dom.select('select'), function(e) {
198
+ e.onkeydown = tinyMCEPopup._accessHandler;
199
+ });
200
+
201
+ // Call onInit
202
+ // Init must be called before focus so the selection won't get lost by the focus call
203
+ tinymce.each(t.listeners, function(o) {
204
+ o.func.call(o.scope, t.editor);
205
+ });
206
+
207
+ // Move focus to window
208
+ if (t.getWindowArg('mce_auto_focus', true)) {
209
+ window.focus();
210
+
211
+ // Focus element with mceFocus class
212
+ tinymce.each(document.forms, function(f) {
213
+ tinymce.each(f.elements, function(e) {
214
+ if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) {
215
+ e.focus();
216
+ return false; // Break loop
217
+ }
218
+ });
219
+ });
220
+ }
221
+
222
+ document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
223
+ },
224
+
225
+ _accessHandler : function(e) {
226
+ e = e || window.event;
227
+
228
+ if (e.keyCode == 13 || e.keyCode == 32) {
229
+ e = e.target || e.srcElement;
230
+
231
+ if (e.onchange)
232
+ e.onchange();
233
+
234
+ return tinymce.dom.Event.cancel(e);
235
+ }
236
+ },
237
+
238
+ _closeWinKeyHandler : function(e) {
239
+ e = e || window.event;
240
+
241
+ if (e.keyCode == 27)
242
+ tinyMCEPopup.close();
243
+ },
244
+
245
+ _wait : function() {
246
+ var t = this, ti;
247
+
248
+ if (tinymce.isIE && document.location.protocol != 'https:') {
249
+ // Fake DOMContentLoaded on IE
250
+ document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');
251
+ document.getElementById("__ie_onload").onreadystatechange = function() {
252
+ if (this.readyState == "complete") {
253
+ t._onDOMLoaded();
254
+ document.getElementById("__ie_onload").onreadystatechange = null; // Prevent leak
255
+ }
256
+ };
257
+ } else {
258
+ if (tinymce.isIE || tinymce.isWebKit) {
259
+ ti = setInterval(function() {
260
+ if (/loaded|complete/.test(document.readyState)) {
261
+ clearInterval(ti);
262
+ t._onDOMLoaded();
263
+ }
264
+ }, 10);
265
+ } else {
266
+ window.addEventListener('DOMContentLoaded', function() {
267
+ t._onDOMLoaded();
268
+ }, false);
269
+ }
270
+ }
271
+ }
272
+ };
273
+
274
+ tinyMCEPopup.init();
275
+ tinyMCEPopup._wait(); // Wait for DOM Content Loaded
tinymce-advanced.php CHANGED
@@ -3,119 +3,52 @@
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
 
10
- Some code and ideas from WordPress(http://wordpress.org/). The options page for this plugin uses Prototype.js by Sam Stephenson(http://prototype.conio.net/) and Scriptaculous by Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us). The Javascript files have been compressed and concatenated for faster loading.
11
 
12
  Released under the GPL v.2, http://www.gnu.org/copyleft/gpl.html
13
 
14
- This program is distributed in the hope that it will be useful,
15
- but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- GNU General Public License for more details.
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
-
26
- <script type="text/javascript">
27
- // <![CDATA[
28
- var mceToolbars = ['toolbar_1', 'toolbar_2', 'toolbar_3', 'toolbar_4'];
29
- function initTadv() {
30
- $A(Draggables.drags).map(function(o){o.startDrag(null);o.finishDrag(null);});
31
- tadvResetHeight();
32
- }
33
- function tadvResetHeight() {
34
- var pd = $('tadvpalette');
35
- if( pd.childNodes.length > 6 ) {
36
- var last = pd.lastChild.previousSibling;
37
- pd.style.height = last.offsetTop + last.offsetHeight + 30 + "px";
38
- } else { pd.style.height = "60px"; }
39
- }
40
- function tadvSerializeAll() {
41
- $('toolbar_1order').value = Sortable.serialize('toolbar_1');
42
- $('toolbar_2order').value = Sortable.serialize('toolbar_2');
43
- $('toolbar_3order').value = Sortable.serialize('toolbar_3');
44
- $('toolbar_4order').value = Sortable.serialize('toolbar_4');
45
- }
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();
91
- tadvUpdateAll();
92
- });
93
- Event.observe(window, 'resize', tadvUpdateAll);
94
- // ]]>
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' );
@@ -123,11 +56,11 @@ add_action( 'activate_tinymce-advanced/tinymce-advanced.php', 'tadv_activate' );
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' );
@@ -137,18 +70,18 @@ $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 );
@@ -161,42 +94,42 @@ if ( ! function_exists('tadv_mce_btns2') ) {
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 );
@@ -221,7 +154,7 @@ add_filter( 'tiny_mce_before_init', 'tadv_mce_options' );
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);
@@ -233,28 +166,28 @@ if ( ! function_exists('tadv_htmledit') ) {
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
  }
@@ -263,7 +196,7 @@ add_action( 'mce_external_plugins', 'tadv_load_plugins', 999 );
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;
@@ -278,15 +211,16 @@ 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
  }
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.1
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
9
 
10
+ Some code and ideas from WordPress(http://wordpress.org/). The options page for this plugin uses jQuery (http://jquery.com/).
11
 
12
  Released under the GPL v.2, http://www.gnu.org/copyleft/gpl.html
13
 
14
+ This program is distributed in the hope that it will be useful,
15
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ GNU General Public License for more details.
18
  */
19
 
20
  if ( ! function_exists('tadv_admin_head') ) {
21
  function tadv_admin_head() { ?>
22
+ <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/tinymce-advanced/js/tadv.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  <?php
24
  }
25
  } // end tadv_admin_head
26
 
27
+ if ( ! function_exists('tadv_add_scripts') ) {
28
+ function tadv_add_scripts() {
29
+ wp_enqueue_script( 'jquery-ui-sortable' ); ?>
30
+ <link rel="stylesheet" href="<?php echo WP_PLUGIN_URL; ?>/tinymce-advanced/css/tadv-styles.css?ver=3.1" type="text/css" />
31
+ <?php
32
+ }
33
+ } // end tadv_add_scripts
34
+
35
+
36
  if ( ! function_exists('tadv_activate') ) {
37
  function tadv_activate() {
38
+
39
+ @include_once( WP_PLUGIN_DIR . '/tinymce-advanced/tadv_defaults.php');
40
+ $tadv_options = array( 'advlink' => 1, 'advimage' => 1, 'importcss' => 0, 'contextmenu' => 0, 'tadvreplace' => 0 );
41
+
 
 
42
  if ( isset($tadv_toolbars) ) {
43
  add_option( 'tadv_toolbars', $tadv_toolbars, '', 'no' );
44
+ add_option( 'tadv_options', $tadv_options, '', 'no' );
45
+ add_option( 'tadv_plugins', $tadv_plugins, '', 'no' );
46
+ add_option( 'tadv_btns1', $tadv_btns1, '', 'no' );
47
+ add_option( 'tadv_btns2', $tadv_btns2, '', 'no' );
48
+ add_option( 'tadv_btns3', $tadv_btns3, '', 'no' );
49
+ add_option( 'tadv_btns4', $tadv_btns4, '', 'no' );
50
+ add_option( 'tadv_allbtns', $tadv_allbtns, '', 'no' );
51
+ }
52
  }
53
  }
54
  add_action( 'activate_tinymce-advanced/tinymce-advanced.php', 'tadv_activate' );
56
  if ( ! function_exists('tdav_css') ) {
57
  function tdav_css($wp) {
58
  $tadv_options = (array) get_option('tadv_options');
59
+
60
+ if ( $tadv_options['importcss'] == '1' )
61
  $wp .= ',' . get_bloginfo('stylesheet_url');
62
+
63
+ return $wp .= ',' . WP_PLUGIN_URL . '/tinymce-advanced/css/tadv-mce.css';
64
  }
65
  }
66
  add_filter( 'mce_css', 'tdav_css' );
70
 
71
  if ( ! function_exists('tadv_mce_btns') ) {
72
  function tadv_mce_btns($orig) {
73
+ global $tadv_allbtns, $tadv_hidden_row;
74
  $tadv_btns1 = (array) get_option('tadv_btns1');
75
  $tadv_allbtns = (array) get_option('tadv_allbtns');
76
 
77
  if ( in_array( 'wp_adv', $tadv_btns1 ) )
78
  $tadv_hidden_row = 2;
79
 
80
+ if ( is_array($orig) && ! empty($orig) ) {
81
+ $orig = array_diff( $orig, $tadv_allbtns );
82
  $tadv_btns1 = array_merge( $tadv_btns1, $orig );
83
  }
84
+ return $tadv_btns1;
85
  }
86
  }
87
  add_filter( 'mce_buttons', 'tadv_mce_btns', 999 );
94
  if ( in_array( 'wp_adv', $tadv_btns2 ) )
95
  $tadv_hidden_row = 3;
96
 
97
+ if ( is_array($orig) && ! empty($orig) ) {
98
+ $orig = array_diff( $orig, $tadv_allbtns );
99
  $tadv_btns2 = array_merge( $tadv_btns2, $orig );
100
  }
101
+ return $tadv_btns2;
102
  }
103
  }
104
  add_filter( 'mce_buttons_2', 'tadv_mce_btns2', 999 );
105
 
106
  if ( ! function_exists('tadv_mce_btns3') ) {
107
  function tadv_mce_btns3($orig) {
108
+ global $tadv_allbtns, $tadv_hidden_row;
109
  $tadv_btns3 = (array) get_option('tadv_btns3');
110
 
111
  if ( in_array( 'wp_adv', $tadv_btns3 ) )
112
  $tadv_hidden_row = 4;
113
 
114
+ if ( is_array($orig) && ! empty($orig) ) {
115
+ $orig = array_diff( $orig, $tadv_allbtns );
116
  $tadv_btns3 = array_merge( $tadv_btns3, $orig );
117
  }
118
+ return $tadv_btns3;
119
  }
120
  }
121
  add_filter( 'mce_buttons_3', 'tadv_mce_btns3', 999 );
122
 
123
  if ( ! function_exists('tadv_mce_btns4') ) {
124
  function tadv_mce_btns4($orig) {
125
+ global $tadv_allbtns;
126
+ $tadv_btns4 = (array) get_option('tadv_btns4');
127
 
128
+ if ( is_array($orig) && ! empty($orig) ) {
129
+ $orig = array_diff( $orig, $tadv_allbtns );
130
  $tadv_btns4 = array_merge( $tadv_btns4, $orig );
131
  }
132
+ return $tadv_btns4;
133
  }
134
  }
135
  add_filter( 'mce_buttons_4', 'tadv_mce_btns4', 999 );
154
  if ( ! function_exists('tadv_htmledit') ) {
155
  function tadv_htmledit($c) {
156
  $tadv_options = get_option('tadv_options');
157
+
158
  if ( isset($tadv_options['fix_autop']) && $tadv_options['fix_autop'] == 1 ) {
159
  $c = preg_replace( array('/&amp;/','/&lt;/','/&gt;/'), array('&','<','>'), $c );
160
  $c = wpautop($c);
166
  add_filter('htmledit_pre', 'tadv_htmledit', 999);
167
 
168
  if ( ! function_exists('tmce_init') ) {
169
+ function tmce_init() {
170
+ global $wp_scripts;
171
+ $tadv_options = get_option('tadv_options');
172
+
173
+ if ( ! isset($tadv_options['fix_autop']) || $tadv_options['fix_autop'] != 1 ) return;
174
+
175
+ $queue = $wp_scripts->queue;
176
+ if ( is_array($queue) && in_array( 'autosave', $queue ) )
177
+ wp_enqueue_script( 'tadv_replace', WP_PLUGIN_URL . '/tinymce-advanced/js/tadv_replace.js', array('editor_functions'), '20080425' );
178
+ }
179
  }
180
  add_action( 'admin_print_scripts', 'tmce_init' );
181
 
182
  if ( ! function_exists('tadv_load_plugins') ) {
183
+ function tadv_load_plugins($plug) {
184
+ $tadv_plugins = (array) get_option('tadv_plugins');
185
+ $plugpath = WP_PLUGIN_URL . '/tinymce-advanced/mce/';
186
+
187
  $plug = (array) $plug;
188
+ foreach( $tadv_plugins as $plugin )
189
+ $plug["$plugin"] = $plugpath . $plugin . '/editor_plugin.js';
190
+
191
  return $plug;
192
  }
193
  }
196
  if ( ! function_exists('tadv_load_langs') ) {
197
  function tadv_load_langs($langs) {
198
  $tadv_plugins = (array) get_option('tadv_plugins');
199
+ $langpath = WP_PLUGIN_URL . '/tinymce-advanced/mce/';
200
  $nolangs = array( 'bbcode', 'contextmenu', 'insertdatetime', 'layer', 'nonbreaking', 'print', 'visualchars', 'emotions', 'tadvreplace' );
201
 
202
  $langs = (array) $langs;
211
 
212
  if ( ! function_exists('tadv_page') ) {
213
  function tadv_page() {
214
+ include_once( WP_PLUGIN_DIR . '/tinymce-advanced/tadv_admin.php');
215
  }
216
  }
217
 
218
  if ( ! function_exists('tadv_menu') ) {
219
  function tadv_menu() {
220
+ if ( function_exists('add_management_page') ) {
221
+ $page = add_management_page( 'TinyMCE Advanced', 'TinyMCE Advanced', 9, __FILE__, 'tadv_page' );
222
+ add_action( "admin_print_scripts-$page", 'tadv_add_scripts' );
223
+ add_action( "admin_head-$page", 'tadv_admin_head' );
224
  }
225
  }
226
  }
utils/editable_selects.js CHANGED
@@ -1,61 +1,69 @@
1
- /**
2
- * $Id: editable_selects.js 520 2008-01-07 16:30:32Z spocke $
3
- *
4
- * Makes select boxes editable.
5
- *
6
- * @author Moxiecode
7
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
- */
9
-
10
- var TinyMCE_EditableSelects = {
11
- editSelectElm : null,
12
-
13
- init : function() {
14
- var nl = document.getElementsByTagName("select"), i, d = document, o;
15
-
16
- for (i=0; i<nl.length; i++) {
17
- if (nl[i].className.indexOf('mceEditableSelect') != -1) {
18
- o = new Option('(value)', '__mce_add_custom__');
19
-
20
- o.className = 'mceAddSelectValue';
21
-
22
- nl[i].options[nl[i].options.length] = o;
23
- nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
24
- }
25
- }
26
- },
27
-
28
- onChangeEditableSelect : function(e) {
29
- var d = document, ne, se = window.event ? window.event.srcElement : e.target;
30
-
31
- if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
32
- ne = d.createElement("input");
33
- ne.id = se.id + "_custom";
34
- ne.name = se.name + "_custom";
35
- ne.type = "text";
36
-
37
- ne.style.width = se.offsetWidth + 'px';
38
- se.parentNode.insertBefore(ne, se);
39
- se.style.display = 'none';
40
- ne.focus();
41
- ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
42
- TinyMCE_EditableSelects.editSelectElm = se;
43
- }
44
- },
45
-
46
- onBlurEditableSelectInput : function() {
47
- var se = TinyMCE_EditableSelects.editSelectElm;
48
-
49
- if (se) {
50
- if (se.previousSibling.value != '') {
51
- addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
52
- selectByValue(document.forms[0], se.id, se.previousSibling.value);
53
- } else
54
- selectByValue(document.forms[0], se.id, '');
55
-
56
- se.style.display = 'inline';
57
- se.parentNode.removeChild(se.previousSibling);
58
- TinyMCE_EditableSelects.editSelectElm = null;
59
- }
60
- }
61
- };
 
 
 
 
 
 
 
 
1
+ /**
2
+ * $Id: editable_selects.js 867 2008-06-09 20:33:40Z spocke $
3
+ *
4
+ * Makes select boxes editable.
5
+ *
6
+ * @author Moxiecode
7
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
+ */
9
+
10
+ var TinyMCE_EditableSelects = {
11
+ editSelectElm : null,
12
+
13
+ init : function() {
14
+ var nl = document.getElementsByTagName("select"), i, d = document, o;
15
+
16
+ for (i=0; i<nl.length; i++) {
17
+ if (nl[i].className.indexOf('mceEditableSelect') != -1) {
18
+ o = new Option('(value)', '__mce_add_custom__');
19
+
20
+ o.className = 'mceAddSelectValue';
21
+
22
+ nl[i].options[nl[i].options.length] = o;
23
+ nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
24
+ }
25
+ }
26
+ },
27
+
28
+ onChangeEditableSelect : function(e) {
29
+ var d = document, ne, se = window.event ? window.event.srcElement : e.target;
30
+
31
+ if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
32
+ ne = d.createElement("input");
33
+ ne.id = se.id + "_custom";
34
+ ne.name = se.name + "_custom";
35
+ ne.type = "text";
36
+
37
+ ne.style.width = se.offsetWidth + 'px';
38
+ se.parentNode.insertBefore(ne, se);
39
+ se.style.display = 'none';
40
+ ne.focus();
41
+ ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
42
+ ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;
43
+ TinyMCE_EditableSelects.editSelectElm = se;
44
+ }
45
+ },
46
+
47
+ onBlurEditableSelectInput : function() {
48
+ var se = TinyMCE_EditableSelects.editSelectElm;
49
+
50
+ if (se) {
51
+ if (se.previousSibling.value != '') {
52
+ addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
53
+ selectByValue(document.forms[0], se.id, se.previousSibling.value);
54
+ } else
55
+ selectByValue(document.forms[0], se.id, '');
56
+
57
+ se.style.display = 'inline';
58
+ se.parentNode.removeChild(se.previousSibling);
59
+ TinyMCE_EditableSelects.editSelectElm = null;
60
+ }
61
+ },
62
+
63
+ onKeyDown : function(e) {
64
+ e = e || window.event;
65
+
66
+ if (e.keyCode == 13)
67
+ TinyMCE_EditableSelects.onBlurEditableSelectInput();
68
+ }
69
+ };
utils/form_utils.js CHANGED
@@ -1,199 +1,199 @@
1
- /**
2
- * $Id: form_utils.js 673 2008-03-06 13:26:20Z spocke $
3
- *
4
- * Various form utilitiy functions.
5
- *
6
- * @author Moxiecode
7
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
- */
9
-
10
- var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
11
-
12
- function getColorPickerHTML(id, target_form_element) {
13
- var h = "";
14
-
15
- h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
16
- h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
17
-
18
- return h;
19
- }
20
-
21
- function updateColor(img_id, form_element_id) {
22
- document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
23
- }
24
-
25
- function setBrowserDisabled(id, state) {
26
- var img = document.getElementById(id);
27
- var lnk = document.getElementById(id + "_link");
28
-
29
- if (lnk) {
30
- if (state) {
31
- lnk.setAttribute("realhref", lnk.getAttribute("href"));
32
- lnk.removeAttribute("href");
33
- tinyMCEPopup.dom.addClass(img, 'disabled');
34
- } else {
35
- if (lnk.getAttribute("realhref"))
36
- lnk.setAttribute("href", lnk.getAttribute("realhref"));
37
-
38
- tinyMCEPopup.dom.removeClass(img, 'disabled');
39
- }
40
- }
41
- }
42
-
43
- function getBrowserHTML(id, target_form_element, type, prefix) {
44
- var option = prefix + "_" + type + "_browser_callback", cb, html;
45
-
46
- cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
47
-
48
- if (!cb)
49
- return "";
50
-
51
- html = "";
52
- html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
53
- html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
54
-
55
- return html;
56
- }
57
-
58
- function openBrowser(img_id, target_form_element, type, option) {
59
- var img = document.getElementById(img_id);
60
-
61
- if (img.className != "mceButtonDisabled")
62
- tinyMCEPopup.openBrowser(target_form_element, type, option);
63
- }
64
-
65
- function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
66
- if (!form_obj || !form_obj.elements[field_name])
67
- return;
68
-
69
- var sel = form_obj.elements[field_name];
70
-
71
- var found = false;
72
- for (var i=0; i<sel.options.length; i++) {
73
- var option = sel.options[i];
74
-
75
- if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
76
- option.selected = true;
77
- found = true;
78
- } else
79
- option.selected = false;
80
- }
81
-
82
- if (!found && add_custom && value != '') {
83
- var option = new Option(value, value);
84
- option.selected = true;
85
- sel.options[sel.options.length] = option;
86
- sel.selectedIndex = sel.options.length - 1;
87
- }
88
-
89
- return found;
90
- }
91
-
92
- function getSelectValue(form_obj, field_name) {
93
- var elm = form_obj.elements[field_name];
94
-
95
- if (elm == null || elm.options == null)
96
- return "";
97
-
98
- return elm.options[elm.selectedIndex].value;
99
- }
100
-
101
- function addSelectValue(form_obj, field_name, name, value) {
102
- var s = form_obj.elements[field_name];
103
- var o = new Option(name, value);
104
- s.options[s.options.length] = o;
105
- }
106
-
107
- function addClassesToList(list_id, specific_option) {
108
- // Setup class droplist
109
- var styleSelectElm = document.getElementById(list_id);
110
- var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
111
- styles = tinyMCEPopup.getParam(specific_option, styles);
112
-
113
- if (styles) {
114
- var stylesAr = styles.split(';');
115
-
116
- for (var i=0; i<stylesAr.length; i++) {
117
- if (stylesAr != "") {
118
- var key, value;
119
-
120
- key = stylesAr[i].split('=')[0];
121
- value = stylesAr[i].split('=')[1];
122
-
123
- styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
124
- }
125
- }
126
- } else {
127
- tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
128
- styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
129
- });
130
- }
131
- }
132
-
133
- function isVisible(element_id) {
134
- var elm = document.getElementById(element_id);
135
-
136
- return elm && elm.style.display != "none";
137
- }
138
-
139
- function convertRGBToHex(col) {
140
- var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
141
-
142
- var rgb = col.replace(re, "$1,$2,$3").split(',');
143
- if (rgb.length == 3) {
144
- r = parseInt(rgb[0]).toString(16);
145
- g = parseInt(rgb[1]).toString(16);
146
- b = parseInt(rgb[2]).toString(16);
147
-
148
- r = r.length == 1 ? '0' + r : r;
149
- g = g.length == 1 ? '0' + g : g;
150
- b = b.length == 1 ? '0' + b : b;
151
-
152
- return "#" + r + g + b;
153
- }
154
-
155
- return col;
156
- }
157
-
158
- function convertHexToRGB(col) {
159
- if (col.indexOf('#') != -1) {
160
- col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
161
-
162
- r = parseInt(col.substring(0, 2), 16);
163
- g = parseInt(col.substring(2, 4), 16);
164
- b = parseInt(col.substring(4, 6), 16);
165
-
166
- return "rgb(" + r + "," + g + "," + b + ")";
167
- }
168
-
169
- return col;
170
- }
171
-
172
- function trimSize(size) {
173
- return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');
174
- }
175
-
176
- function getCSSSize(size) {
177
- size = trimSize(size);
178
-
179
- if (size == "")
180
- return "";
181
-
182
- // Add px
183
- if (/^[0-9]+$/.test(size))
184
- size += 'px';
185
-
186
- return size;
187
- }
188
-
189
- function getStyle(elm, attrib, style) {
190
- var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
191
-
192
- if (val != '')
193
- return '' + val;
194
-
195
- if (typeof(style) == 'undefined')
196
- style = attrib;
197
-
198
- return tinyMCEPopup.dom.getStyle(elm, style);
199
- }
1
+ /**
2
+ * $Id: form_utils.js 673 2008-03-06 13:26:20Z spocke $
3
+ *
4
+ * Various form utilitiy functions.
5
+ *
6
+ * @author Moxiecode
7
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
+ */
9
+
10
+ var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
11
+
12
+ function getColorPickerHTML(id, target_form_element) {
13
+ var h = "";
14
+
15
+ h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
16
+ h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
17
+
18
+ return h;
19
+ }
20
+
21
+ function updateColor(img_id, form_element_id) {
22
+ document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
23
+ }
24
+
25
+ function setBrowserDisabled(id, state) {
26
+ var img = document.getElementById(id);
27
+ var lnk = document.getElementById(id + "_link");
28
+
29
+ if (lnk) {
30
+ if (state) {
31
+ lnk.setAttribute("realhref", lnk.getAttribute("href"));
32
+ lnk.removeAttribute("href");
33
+ tinyMCEPopup.dom.addClass(img, 'disabled');
34
+ } else {
35
+ if (lnk.getAttribute("realhref"))
36
+ lnk.setAttribute("href", lnk.getAttribute("realhref"));
37
+
38
+ tinyMCEPopup.dom.removeClass(img, 'disabled');
39
+ }
40
+ }
41
+ }
42
+
43
+ function getBrowserHTML(id, target_form_element, type, prefix) {
44
+ var option = prefix + "_" + type + "_browser_callback", cb, html;
45
+
46
+ cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
47
+
48
+ if (!cb)
49
+ return "";
50
+
51
+ html = "";
52
+ html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
53
+ html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
54
+
55
+ return html;
56
+ }
57
+
58
+ function openBrowser(img_id, target_form_element, type, option) {
59
+ var img = document.getElementById(img_id);
60
+
61
+ if (img.className != "mceButtonDisabled")
62
+ tinyMCEPopup.openBrowser(target_form_element, type, option);
63
+ }
64
+
65
+ function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
66
+ if (!form_obj || !form_obj.elements[field_name])
67
+ return;
68
+
69
+ var sel = form_obj.elements[field_name];
70
+
71
+ var found = false;
72
+ for (var i=0; i<sel.options.length; i++) {
73
+ var option = sel.options[i];
74
+
75
+ if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
76
+ option.selected = true;
77
+ found = true;
78
+ } else
79
+ option.selected = false;
80
+ }
81
+
82
+ if (!found && add_custom && value != '') {
83
+ var option = new Option(value, value);
84
+ option.selected = true;
85
+ sel.options[sel.options.length] = option;
86
+ sel.selectedIndex = sel.options.length - 1;
87
+ }
88
+
89
+ return found;
90
+ }
91
+
92
+ function getSelectValue(form_obj, field_name) {
93
+ var elm = form_obj.elements[field_name];
94
+
95
+ if (elm == null || elm.options == null)
96
+ return "";
97
+
98
+ return elm.options[elm.selectedIndex].value;
99
+ }
100
+
101
+ function addSelectValue(form_obj, field_name, name, value) {
102
+ var s = form_obj.elements[field_name];
103
+ var o = new Option(name, value);
104
+ s.options[s.options.length] = o;
105
+ }
106
+
107
+ function addClassesToList(list_id, specific_option) {
108
+ // Setup class droplist
109
+ var styleSelectElm = document.getElementById(list_id);
110
+ var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
111
+ styles = tinyMCEPopup.getParam(specific_option, styles);
112
+
113
+ if (styles) {
114
+ var stylesAr = styles.split(';');
115
+
116
+ for (var i=0; i<stylesAr.length; i++) {
117
+ if (stylesAr != "") {
118
+ var key, value;
119
+
120
+ key = stylesAr[i].split('=')[0];
121
+ value = stylesAr[i].split('=')[1];
122
+
123
+ styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
124
+ }
125
+ }
126
+ } else {
127
+ tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
128
+ styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
129
+ });
130
+ }
131
+ }
132
+
133
+ function isVisible(element_id) {
134
+ var elm = document.getElementById(element_id);
135
+
136
+ return elm && elm.style.display != "none";
137
+ }
138
+
139
+ function convertRGBToHex(col) {
140
+ var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
141
+
142
+ var rgb = col.replace(re, "$1,$2,$3").split(',');
143
+ if (rgb.length == 3) {
144
+ r = parseInt(rgb[0]).toString(16);
145
+ g = parseInt(rgb[1]).toString(16);
146
+ b = parseInt(rgb[2]).toString(16);
147
+
148
+ r = r.length == 1 ? '0' + r : r;
149
+ g = g.length == 1 ? '0' + g : g;
150
+ b = b.length == 1 ? '0' + b : b;
151
+
152
+ return "#" + r + g + b;
153
+ }
154
+
155
+ return col;
156
+ }
157
+
158
+ function convertHexToRGB(col) {
159
+ if (col.indexOf('#') != -1) {
160
+ col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
161
+
162
+ r = parseInt(col.substring(0, 2), 16);
163
+ g = parseInt(col.substring(2, 4), 16);
164
+ b = parseInt(col.substring(4, 6), 16);
165
+
166
+ return "rgb(" + r + "," + g + "," + b + ")";
167
+ }
168
+
169
+ return col;
170
+ }
171
+
172
+ function trimSize(size) {
173
+ return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');
174
+ }
175
+
176
+ function getCSSSize(size) {
177
+ size = trimSize(size);
178
+
179
+ if (size == "")
180
+ return "";
181
+
182
+ // Add px
183
+ if (/^[0-9]+$/.test(size))
184
+ size += 'px';
185
+
186
+ return size;
187
+ }
188
+
189
+ function getStyle(elm, attrib, style) {
190
+ var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
191
+
192
+ if (val != '')
193
+ return '' + val;
194
+
195
+ if (typeof(style) == 'undefined')
196
+ style = attrib;
197
+
198
+ return tinyMCEPopup.dom.getStyle(elm, style);
199
+ }
utils/mctabs.js CHANGED
@@ -1,76 +1,76 @@
1
- /**
2
- * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $
3
- *
4
- * Moxiecode DHTML Tabs script.
5
- *
6
- * @author Moxiecode
7
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
- */
9
-
10
- function MCTabs() {
11
- this.settings = [];
12
- };
13
-
14
- MCTabs.prototype.init = function(settings) {
15
- this.settings = settings;
16
- };
17
-
18
- MCTabs.prototype.getParam = function(name, default_value) {
19
- var value = null;
20
-
21
- value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
22
-
23
- // Fix bool values
24
- if (value == "true" || value == "false")
25
- return (value == "true");
26
-
27
- return value;
28
- };
29
-
30
- MCTabs.prototype.displayTab = function(tab_id, panel_id) {
31
- var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i;
32
-
33
- panelElm= document.getElementById(panel_id);
34
- panelContainerElm = panelElm ? panelElm.parentNode : null;
35
- tabElm = document.getElementById(tab_id);
36
- tabContainerElm = tabElm ? tabElm.parentNode : null;
37
- selectionClass = this.getParam('selection_class', 'current');
38
-
39
- if (tabElm && tabContainerElm) {
40
- nodes = tabContainerElm.childNodes;
41
-
42
- // Hide all other tabs
43
- for (i = 0; i < nodes.length; i++) {
44
- if (nodes[i].nodeName == "LI")
45
- nodes[i].className = '';
46
- }
47
-
48
- // Show selected tab
49
- tabElm.className = 'current';
50
- }
51
-
52
- if (panelElm && panelContainerElm) {
53
- nodes = panelContainerElm.childNodes;
54
-
55
- // Hide all other panels
56
- for (i = 0; i < nodes.length; i++) {
57
- if (nodes[i].nodeName == "DIV")
58
- nodes[i].className = 'panel';
59
- }
60
-
61
- // Show selected panel
62
- panelElm.className = 'current';
63
- }
64
- };
65
-
66
- MCTabs.prototype.getAnchor = function() {
67
- var pos, url = document.location.href;
68
-
69
- if ((pos = url.lastIndexOf('#')) != -1)
70
- return url.substring(pos + 1);
71
-
72
- return "";
73
- };
74
-
75
- // Global instance
76
- var mcTabs = new MCTabs();
1
+ /**
2
+ * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $
3
+ *
4
+ * Moxiecode DHTML Tabs script.
5
+ *
6
+ * @author Moxiecode
7
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
+ */
9
+
10
+ function MCTabs() {
11
+ this.settings = [];
12
+ };
13
+
14
+ MCTabs.prototype.init = function(settings) {
15
+ this.settings = settings;
16
+ };
17
+
18
+ MCTabs.prototype.getParam = function(name, default_value) {
19
+ var value = null;
20
+
21
+ value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
22
+
23
+ // Fix bool values
24
+ if (value == "true" || value == "false")
25
+ return (value == "true");
26
+
27
+ return value;
28
+ };
29
+
30
+ MCTabs.prototype.displayTab = function(tab_id, panel_id) {
31
+ var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i;
32
+
33
+ panelElm= document.getElementById(panel_id);
34
+ panelContainerElm = panelElm ? panelElm.parentNode : null;
35
+ tabElm = document.getElementById(tab_id);
36
+ tabContainerElm = tabElm ? tabElm.parentNode : null;
37
+ selectionClass = this.getParam('selection_class', 'current');
38
+
39
+ if (tabElm && tabContainerElm) {
40
+ nodes = tabContainerElm.childNodes;
41
+
42
+ // Hide all other tabs
43
+ for (i = 0; i < nodes.length; i++) {
44
+ if (nodes[i].nodeName == "LI")
45
+ nodes[i].className = '';
46
+ }
47
+
48
+ // Show selected tab
49
+ tabElm.className = 'current';
50
+ }
51
+
52
+ if (panelElm && panelContainerElm) {
53
+ nodes = panelContainerElm.childNodes;
54
+
55
+ // Hide all other panels
56
+ for (i = 0; i < nodes.length; i++) {
57
+ if (nodes[i].nodeName == "DIV")
58
+ nodes[i].className = 'panel';
59
+ }
60
+
61
+ // Show selected panel
62
+ panelElm.className = 'current';
63
+ }
64
+ };
65
+
66
+ MCTabs.prototype.getAnchor = function() {
67
+ var pos, url = document.location.href;
68
+
69
+ if ((pos = url.lastIndexOf('#')) != -1)
70
+ return url.substring(pos + 1);
71
+
72
+ return "";
73
+ };
74
+
75
+ // Global instance
76
+ var mcTabs = new MCTabs();
utils/validate.js CHANGED
@@ -1,219 +1,219 @@
1
- /**
2
- * $Id: validate.js 758 2008-03-30 13:53:29Z spocke $
3
- *
4
- * Various form validation methods.
5
- *
6
- * @author Moxiecode
7
- * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
- */
9
-
10
- /**
11
- // String validation:
12
-
13
- if (!Validator.isEmail('myemail'))
14
- alert('Invalid email.');
15
-
16
- // Form validation:
17
-
18
- var f = document.forms['myform'];
19
-
20
- if (!Validator.isEmail(f.myemail))
21
- alert('Invalid email.');
22
- */
23
-
24
- var Validator = {
25
- isEmail : function(s) {
26
- return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
27
- },
28
-
29
- isAbsUrl : function(s) {
30
- return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
31
- },
32
-
33
- isSize : function(s) {
34
- return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
35
- },
36
-
37
- isId : function(s) {
38
- return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
39
- },
40
-
41
- isEmpty : function(s) {
42
- var nl, i;
43
-
44
- if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
45
- return true;
46
-
47
- if (s.type == 'checkbox' && !s.checked)
48
- return true;
49
-
50
- if (s.type == 'radio') {
51
- for (i=0, nl = s.form.elements; i<nl.length; i++) {
52
- if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
53
- return false;
54
- }
55
-
56
- return true;
57
- }
58
-
59
- return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
60
- },
61
-
62
- isNumber : function(s, d) {
63
- return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
64
- },
65
-
66
- test : function(s, p) {
67
- s = s.nodeType == 1 ? s.value : s;
68
-
69
- return s == '' || new RegExp(p).test(s);
70
- }
71
- };
72
-
73
- var AutoValidator = {
74
- settings : {
75
- id_cls : 'id',
76
- int_cls : 'int',
77
- url_cls : 'url',
78
- number_cls : 'number',
79
- email_cls : 'email',
80
- size_cls : 'size',
81
- required_cls : 'required',
82
- invalid_cls : 'invalid',
83
- min_cls : 'min',
84
- max_cls : 'max'
85
- },
86
-
87
- init : function(s) {
88
- var n;
89
-
90
- for (n in s)
91
- this.settings[n] = s[n];
92
- },
93
-
94
- validate : function(f) {
95
- var i, nl, s = this.settings, c = 0;
96
-
97
- nl = this.tags(f, 'label');
98
- for (i=0; i<nl.length; i++)
99
- this.removeClass(nl[i], s.invalid_cls);
100
-
101
- c += this.validateElms(f, 'input');
102
- c += this.validateElms(f, 'select');
103
- c += this.validateElms(f, 'textarea');
104
-
105
- return c == 3;
106
- },
107
-
108
- invalidate : function(n) {
109
- this.mark(n.form, n);
110
- },
111
-
112
- reset : function(e) {
113
- var t = ['label', 'input', 'select', 'textarea'];
114
- var i, j, nl, s = this.settings;
115
-
116
- if (e == null)
117
- return;
118
-
119
- for (i=0; i<t.length; i++) {
120
- nl = this.tags(e.form ? e.form : e, t[i]);
121
- for (j=0; j<nl.length; j++)
122
- this.removeClass(nl[j], s.invalid_cls);
123
- }
124
- },
125
-
126
- validateElms : function(f, e) {
127
- var nl, i, n, s = this.settings, st = true, va = Validator, v;
128
-
129
- nl = this.tags(f, e);
130
- for (i=0; i<nl.length; i++) {
131
- n = nl[i];
132
-
133
- this.removeClass(n, s.invalid_cls);
134
-
135
- if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
136
- st = this.mark(f, n);
137
-
138
- if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
139
- st = this.mark(f, n);
140
-
141
- if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
142
- st = this.mark(f, n);
143
-
144
- if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
145
- st = this.mark(f, n);
146
-
147
- if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
148
- st = this.mark(f, n);
149
-
150
- if (this.hasClass(n, s.size_cls) && !va.isSize(n))
151
- st = this.mark(f, n);
152
-
153
- if (this.hasClass(n, s.id_cls) && !va.isId(n))
154
- st = this.mark(f, n);
155
-
156
- if (this.hasClass(n, s.min_cls, true)) {
157
- v = this.getNum(n, s.min_cls);
158
-
159
- if (isNaN(v) || parseInt(n.value) < parseInt(v))
160
- st = this.mark(f, n);
161
- }
162
-
163
- if (this.hasClass(n, s.max_cls, true)) {
164
- v = this.getNum(n, s.max_cls);
165
-
166
- if (isNaN(v) || parseInt(n.value) > parseInt(v))
167
- st = this.mark(f, n);
168
- }
169
- }
170
-
171
- return st;
172
- },
173
-
174
- hasClass : function(n, c, d) {
175
- return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
176
- },
177
-
178
- getNum : function(n, c) {
179
- c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
180
- c = c.replace(/[^0-9]/g, '');
181
-
182
- return c;
183
- },
184
-
185
- addClass : function(n, c, b) {
186
- var o = this.removeClass(n, c);
187
- n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
188
- },
189
-
190
- removeClass : function(n, c) {
191
- c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
192
- return n.className = c != ' ' ? c : '';
193
- },
194
-
195
- tags : function(f, s) {
196
- return f.getElementsByTagName(s);
197
- },
198
-
199
- mark : function(f, n) {
200
- var s = this.settings;
201
-
202
- this.addClass(n, s.invalid_cls);
203
- this.markLabels(f, n, s.invalid_cls);
204
-
205
- return false;
206
- },
207
-
208
- markLabels : function(f, n, ic) {
209
- var nl, i;
210
-
211
- nl = this.tags(f, "label");
212
- for (i=0; i<nl.length; i++) {
213
- if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
214
- this.addClass(nl[i], ic);
215
- }
216
-
217
- return null;
218
- }
219
- };
1
+ /**
2
+ * $Id: validate.js 758 2008-03-30 13:53:29Z spocke $
3
+ *
4
+ * Various form validation methods.
5
+ *
6
+ * @author Moxiecode
7
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
8
+ */
9
+
10
+ /**
11
+ // String validation:
12
+
13
+ if (!Validator.isEmail('myemail'))
14
+ alert('Invalid email.');
15
+
16
+ // Form validation:
17
+
18
+ var f = document.forms['myform'];
19
+
20
+ if (!Validator.isEmail(f.myemail))
21
+ alert('Invalid email.');
22
+ */
23
+
24
+ var Validator = {
25
+ isEmail : function(s) {
26
+ return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
27
+ },
28
+
29
+ isAbsUrl : function(s) {
30
+ return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
31
+ },
32
+
33
+ isSize : function(s) {
34
+ return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
35
+ },
36
+
37
+ isId : function(s) {
38
+ return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
39
+ },
40
+
41
+ isEmpty : function(s) {
42
+ var nl, i;
43
+
44
+ if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
45
+ return true;
46
+
47
+ if (s.type == 'checkbox' && !s.checked)
48
+ return true;
49
+
50
+ if (s.type == 'radio') {
51
+ for (i=0, nl = s.form.elements; i<nl.length; i++) {
52
+ if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
53
+ return false;
54
+ }
55
+
56
+ return true;
57
+ }
58
+
59
+ return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
60
+ },
61
+
62
+ isNumber : function(s, d) {
63
+ return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
64
+ },
65
+
66
+ test : function(s, p) {
67
+ s = s.nodeType == 1 ? s.value : s;
68
+
69
+ return s == '' || new RegExp(p).test(s);
70
+ }
71
+ };
72
+
73
+ var AutoValidator = {
74
+ settings : {
75
+ id_cls : 'id',
76
+ int_cls : 'int',
77
+ url_cls : 'url',
78
+ number_cls : 'number',
79
+ email_cls : 'email',
80
+ size_cls : 'size',
81
+ required_cls : 'required',
82
+ invalid_cls : 'invalid',
83
+ min_cls : 'min',
84
+ max_cls : 'max'
85
+ },
86
+
87
+ init : function(s) {
88
+ var n;
89
+
90
+ for (n in s)
91
+ this.settings[n] = s[n];
92
+ },
93
+
94
+ validate : function(f) {
95
+ var i, nl, s = this.settings, c = 0;
96
+
97
+ nl = this.tags(f, 'label');
98
+ for (i=0; i<nl.length; i++)
99
+ this.removeClass(nl[i], s.invalid_cls);
100
+
101
+ c += this.validateElms(f, 'input');
102
+ c += this.validateElms(f, 'select');
103
+ c += this.validateElms(f, 'textarea');
104
+
105
+ return c == 3;
106
+ },
107
+
108
+ invalidate : function(n) {
109
+ this.mark(n.form, n);
110
+ },
111
+
112
+ reset : function(e) {
113
+ var t = ['label', 'input', 'select', 'textarea'];
114
+ var i, j, nl, s = this.settings;
115
+
116
+ if (e == null)
117
+ return;
118
+
119
+ for (i=0; i<t.length; i++) {
120
+ nl = this.tags(e.form ? e.form : e, t[i]);
121
+ for (j=0; j<nl.length; j++)
122
+ this.removeClass(nl[j], s.invalid_cls);
123
+ }
124
+ },
125
+
126
+ validateElms : function(f, e) {
127
+ var nl, i, n, s = this.settings, st = true, va = Validator, v;
128
+
129
+ nl = this.tags(f, e);
130
+ for (i=0; i<nl.length; i++) {
131
+ n = nl[i];
132
+
133
+ this.removeClass(n, s.invalid_cls);
134
+
135
+ if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
136
+ st = this.mark(f, n);
137
+
138
+ if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
139
+ st = this.mark(f, n);
140
+
141
+ if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
142
+ st = this.mark(f, n);
143
+
144
+ if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
145
+ st = this.mark(f, n);
146
+
147
+ if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
148
+ st = this.mark(f, n);
149
+
150
+ if (this.hasClass(n, s.size_cls) && !va.isSize(n))
151
+ st = this.mark(f, n);
152
+
153
+ if (this.hasClass(n, s.id_cls) && !va.isId(n))
154
+ st = this.mark(f, n);
155
+
156
+ if (this.hasClass(n, s.min_cls, true)) {
157
+ v = this.getNum(n, s.min_cls);
158
+
159
+ if (isNaN(v) || parseInt(n.value) < parseInt(v))
160
+ st = this.mark(f, n);
161
+ }
162
+
163
+ if (this.hasClass(n, s.max_cls, true)) {
164
+ v = this.getNum(n, s.max_cls);
165
+
166
+ if (isNaN(v) || parseInt(n.value) > parseInt(v))
167
+ st = this.mark(f, n);
168
+ }
169
+ }
170
+
171
+ return st;
172
+ },
173
+
174
+ hasClass : function(n, c, d) {
175
+ return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
176
+ },
177
+
178
+ getNum : function(n, c) {
179
+ c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
180
+ c = c.replace(/[^0-9]/g, '');
181
+
182
+ return c;
183
+ },
184
+
185
+ addClass : function(n, c, b) {
186
+ var o = this.removeClass(n, c);
187
+ n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
188
+ },
189
+
190
+ removeClass : function(n, c) {
191
+ c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
192
+ return n.className = c != ' ' ? c : '';
193
+ },
194
+
195
+ tags : function(f, s) {
196
+ return f.getElementsByTagName(s);
197
+ },
198
+
199
+ mark : function(f, n) {
200
+ var s = this.settings;
201
+
202
+ this.addClass(n, s.invalid_cls);
203
+ this.markLabels(f, n, s.invalid_cls);
204
+
205
+ return false;
206
+ },
207
+
208
+ markLabels : function(f, n, ic) {
209
+ var nl, i;
210
+
211
+ nl = this.tags(f, "label");
212
+ for (i=0; i<nl.length; i++) {
213
+ if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
214
+ this.addClass(nl[i], ic);
215
+ }
216
+
217
+ return null;
218
+ }
219
+ };