Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
parent.document.title="TinyMCE_Engine.class.js Overview";
}
</script>
</head>
<body bgcolor="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
<tr align="center" valign="top">
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a> </td>
<td bgcolor="#FFFFFF" class="NavBarCell1Rev"> <font class="NavBarFont1Rev"><b>File</b></font> </td>
<td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a> </td>
<td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a> </td>
</tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>
<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
PREV
NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
<a href="index.html" target="_top"><b>FRAMES</b></a>
<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
<script>
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
}
//-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->
<hr>
<center>
<h2>TinyMCE_Engine.class.js</h2>
</center>
<h4>Summary</h4>
<p>
No overview generated for 'TinyMCE_Engine.class.js'<BR/><BR/>
</p>
<hr>
<table border="1" cellpadding="3" cellspacing="0" width="100%">
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan=2><font size="+2">
<b>Class Summary</b>
</font></td>
</tr>
<tr bgcolor="white" class="TableRowColor">
<td width="15%"><b><a href="TinyMCE_Engine.html">TinyMCE_Engine</a></b></td>
<td> </td>
</tr>
</table>
<hr/>
<!-- ========== METHOD SUMMARY =========== -->
<!-- ========== END METHOD SUMMARY =========== -->
<pre class="sourceview"><span class="comment">/**
* $RCSfile: overview-summary-TinyMCE_Engine.class.js.html,v $
* $Revision: 1.42 $
* $Date: 2006/04/14 20:00:29 $
*
* <span class="attrib">@author</span> Moxiecode
* <span class="attrib">@copyright</span> Copyright 2004-2006, Moxiecode Systems AB, All rights reserved.
*/</span>
<span class="comment">/**
* Core engine class for TinyMCE, a instance of this class is available as a global called tinyMCE.
*
* <span class="attrib">@constructor</span>
*/</span>
<span class="reserved">function</span> TinyMCE_Engine() {
<span class="reserved">this</span>.majorVersion = <span class="literal">"2"</span>;
<span class="reserved">this</span>.minorVersion = <span class="literal">"0.6"</span>;
<span class="reserved">this</span>.releaseDate = <span class="literal">"2006-xx-xx"</span>;
<span class="reserved">this</span>.instances = new Array();
<span class="reserved">this</span>.switchClassCache = new Array();
<span class="reserved">this</span>.windowArgs = new Array();
<span class="reserved">this</span>.loadedFiles = new Array();
<span class="reserved">this</span>.configs = new Array();
<span class="reserved">this</span>.currentConfig = 0;
<span class="reserved">this</span>.eventHandlers = new Array();
<span class="comment">// Browser check</span>
var ua = navigator.userAgent;
<span class="reserved">this</span>.isMSIE = (navigator.appName == <span class="literal">"Microsoft Internet Explorer"</span>);
<span class="reserved">this</span>.isMSIE5 = <span class="reserved">this</span>.isMSIE && (ua.indexOf(<span class="literal">'MSIE 5'</span>) != -1);
<span class="reserved">this</span>.isMSIE5_0 = <span class="reserved">this</span>.isMSIE && (ua.indexOf(<span class="literal">'MSIE 5.0'</span>) != -1);
<span class="reserved">this</span>.isGecko = ua.indexOf(<span class="literal">'Gecko'</span>) != -1;
<span class="reserved">this</span>.isSafari = ua.indexOf(<span class="literal">'Safari'</span>) != -1;
<span class="reserved">this</span>.isOpera = ua.indexOf(<span class="literal">'Opera'</span>) != -1;
<span class="reserved">this</span>.isMac = ua.indexOf(<span class="literal">'Mac'</span>) != -1;
<span class="reserved">this</span>.isNS7 = ua.indexOf(<span class="literal">'Netscape/7'</span>) != -1;
<span class="reserved">this</span>.isNS71 = ua.indexOf(<span class="literal">'Netscape/7.1'</span>) != -1;
<span class="reserved">this</span>.dialogCounter = 0;
<span class="reserved">this</span>.plugins = new Array();
<span class="reserved">this</span>.themes = new Array();
<span class="reserved">this</span>.menus = new Array();
<span class="reserved">this</span>.loadedPlugins = new Array();
<span class="reserved">this</span>.buttonMap = new Array();
<span class="reserved">this</span>.isLoaded = false;
<span class="comment">// Fake MSIE on Opera and if Opera fakes IE, Gecko or Safari cancel those</span>
<span class="reserved">if</span> (<span class="reserved">this</span>.isOpera) {
<span class="reserved">this</span>.isMSIE = true;
<span class="reserved">this</span>.isGecko = false;
<span class="reserved">this</span>.isSafari = false;
}
<span class="comment">// TinyMCE editor id instance counter</span>
<span class="reserved">this</span>.idCounter = 0;
};
TinyMCE_Engine.<span class="reserved">prototype</span> = {
<span class="comment">/**
* Initializes TinyMCE with the specific configuration settings. This method
* may be called multiple times when multiple instances with diffrent settings is to be created.
*
* <span class="attrib">@param</span> {Array} Name/Value array of initialization settings.
*/</span>
init : <span class="reserved">function</span>(settings) {
var theme;
<span class="reserved">this</span>.settings = settings;
<span class="comment">// Check if valid browser has execcommand support</span>
<span class="reserved">if</span> (typeof(document.execCommand) == <span class="literal">'undefined'</span>)
<span class="reserved">return</span>;
<span class="comment">// Get script base path</span>
<span class="reserved">if</span> (!tinyMCE.baseURL) {
var elements = document.getElementsByTagName(<span class="literal">'script'</span>);
<span class="reserved">for</span> (var i=0; i<elements.length; i++) {
<span class="reserved">if</span> (elements[i].src && (elements[i].src.indexOf(<span class="literal">"tiny_mce.js"</span>) != -1 || elements[i].src.indexOf(<span class="literal">"tiny_mce_dev.js"</span>) != -1 || elements[i].src.indexOf(<span class="literal">"tiny_mce_src.js"</span>) != -1 || elements[i].src.indexOf(<span class="literal">"tiny_mce_gzip"</span>) != -1)) {
var src = elements[i].src;
tinyMCE.srcMode = (src.indexOf(<span class="literal">'_src'</span>) != -1 || src.indexOf(<span class="literal">'_dev'</span>) != -1) ? <span class="literal">'_src'</span> : <span class="literal">''</span>;
tinyMCE.gzipMode = src.indexOf(<span class="literal">'_gzip'</span>) != -1;
src = src.substring(0, src.lastIndexOf(<span class="literal">'/'</span>));
<span class="reserved">if</span> (settings.exec_mode == <span class="literal">"src"</span> || settings.exec_mode == <span class="literal">"normal"</span>)
tinyMCE.srcMode = settings.exec_mode == <span class="literal">"src"</span> ? <span class="literal">'_src'</span> : <span class="literal">''</span>;
tinyMCE.baseURL = src;
break;
}
}
}
<span class="comment">// Get document base path</span>
<span class="reserved">this</span>.documentBasePath = document.location.href;
<span class="reserved">if</span> (<span class="reserved">this</span>.documentBasePath.indexOf(<span class="literal">'?'</span>) != -1)
<span class="reserved">this</span>.documentBasePath = <span class="reserved">this</span>.documentBasePath.substring(0, <span class="reserved">this</span>.documentBasePath.indexOf(<span class="literal">'?'</span>));
<span class="reserved">this</span>.documentURL = <span class="reserved">this</span>.documentBasePath;
<span class="reserved">this</span>.documentBasePath = <span class="reserved">this</span>.documentBasePath.substring(0, <span class="reserved">this</span>.documentBasePath.lastIndexOf(<span class="literal">'/'</span>));
<span class="comment">// If not HTTP absolute</span>
<span class="reserved">if</span> (tinyMCE.baseURL.indexOf(<span class="literal">'://'</span>) == -1 && tinyMCE.baseURL.charAt(0) != <span class="literal">'/'</span>) {
<span class="comment">// If site absolute</span>
tinyMCE.baseURL = <span class="reserved">this</span>.documentBasePath + <span class="literal">"/"</span> + tinyMCE.baseURL;
}
<span class="comment">// Set default values on settings</span>
<span class="reserved">this</span>._def(<span class="literal">"mode"</span>, <span class="literal">"none"</span>);
<span class="reserved">this</span>._def(<span class="literal">"theme"</span>, <span class="literal">"advanced"</span>);
<span class="reserved">this</span>._def(<span class="literal">"plugins"</span>, <span class="literal">""</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"language"</span>, <span class="literal">"en"</span>);
<span class="reserved">this</span>._def(<span class="literal">"docs_language"</span>, <span class="reserved">this</span>.settings[<span class="literal">'language'</span>]);
<span class="reserved">this</span>._def(<span class="literal">"elements"</span>, <span class="literal">""</span>);
<span class="reserved">this</span>._def(<span class="literal">"textarea_trigger"</span>, <span class="literal">"mce_editable"</span>);
<span class="reserved">this</span>._def(<span class="literal">"editor_selector"</span>, <span class="literal">""</span>);
<span class="reserved">this</span>._def(<span class="literal">"editor_deselector"</span>, <span class="literal">"mceNoEditor"</span>);
<span class="reserved">this</span>._def(<span class="literal">"valid_elements"</span>, <span class="literal">"+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],-td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang]"</span>);
<span class="reserved">this</span>._def(<span class="literal">"extended_valid_elements"</span>, <span class="literal">""</span>);
<span class="reserved">this</span>._def(<span class="literal">"invalid_elements"</span>, <span class="literal">""</span>);
<span class="reserved">this</span>._def(<span class="literal">"encoding"</span>, <span class="literal">""</span>);
<span class="reserved">this</span>._def(<span class="literal">"urlconverter_callback"</span>, tinyMCE.getParam(<span class="literal">"urlconvertor_callback"</span>, <span class="literal">"TinyMCE_Engine.prototype.convertURL"</span>));
<span class="reserved">this</span>._def(<span class="literal">"save_callback"</span>, <span class="literal">""</span>);
<span class="reserved">this</span>._def(<span class="literal">"debug"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"force_br_newlines"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"force_p_newlines"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"add_form_submit_trigger"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"relative_urls"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"remove_script_host"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"focus_alert"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"document_base_url"</span>, <span class="reserved">this</span>.documentURL);
<span class="reserved">this</span>._def(<span class="literal">"visual"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"visual_table_class"</span>, <span class="literal">"mceVisualAid"</span>);
<span class="reserved">this</span>._def(<span class="literal">"setupcontent_callback"</span>, <span class="literal">""</span>);
<span class="reserved">this</span>._def(<span class="literal">"fix_content_duplication"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"custom_undo_redo"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"custom_undo_redo_levels"</span>, -1);
<span class="reserved">this</span>._def(<span class="literal">"custom_undo_redo_keyboard_shortcuts"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"custom_undo_redo_restore_selection"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"verify_html"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"apply_source_formatting"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"directionality"</span>, <span class="literal">"ltr"</span>);
<span class="reserved">this</span>._def(<span class="literal">"cleanup_on_startup"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"inline_styles"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"convert_newlines_to_brs"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"auto_reset_designmode"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"entities"</span>, <span class="literal">"39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"entity_encoding"</span>, <span class="literal">"named"</span>);
<span class="reserved">this</span>._def(<span class="literal">"cleanup_callback"</span>, <span class="literal">""</span>);
<span class="reserved">this</span>._def(<span class="literal">"add_unload_trigger"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"ask"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"nowrap"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"auto_resize"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"auto_focus"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"cleanup"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"remove_linebreaks"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"button_tile_map"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"submit_patch"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"browsers"</span>, <span class="literal">"msie,safari,gecko,opera"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"dialog_type"</span>, <span class="literal">"window"</span>);
<span class="reserved">this</span>._def(<span class="literal">"accessibility_warnings"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"accessibility_focus"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"merge_styles_invalid_parents"</span>, <span class="literal">""</span>);
<span class="reserved">this</span>._def(<span class="literal">"force_hex_style_colors"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"trim_span_elements"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"convert_fonts_to_spans"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"doctype"</span>, <span class="literal">'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'</span>);
<span class="reserved">this</span>._def(<span class="literal">"font_size_classes"</span>, <span class="literal">''</span>);
<span class="reserved">this</span>._def(<span class="literal">"font_size_style_values"</span>, <span class="literal">'xx-small,x-small,small,medium,large,x-large,xx-large'</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"event_elements"</span>, <span class="literal">'a,img'</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"convert_urls"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"table_inline_editing"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"object_resizing"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"custom_shortcuts"</span>, true);
<span class="reserved">this</span>._def(<span class="literal">"convert_on_click"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"content_css"</span>, <span class="literal">''</span>);
<span class="reserved">this</span>._def(<span class="literal">"fix_list_elements"</span>, false);
<span class="reserved">this</span>._def(<span class="literal">"fix_table_elements"</span>, false);
<span class="comment">// Browser check IE</span>
<span class="reserved">if</span> (<span class="reserved">this</span>.isMSIE && <span class="reserved">this</span>.settings[<span class="literal">'browsers'</span>].indexOf(<span class="literal">'msie'</span>) == -1)
<span class="reserved">return</span>;
<span class="comment">// Browser check Gecko</span>
<span class="reserved">if</span> (<span class="reserved">this</span>.isGecko && <span class="reserved">this</span>.settings[<span class="literal">'browsers'</span>].indexOf(<span class="literal">'gecko'</span>) == -1)
<span class="reserved">return</span>;
<span class="comment">// Browser check Safari</span>
<span class="reserved">if</span> (<span class="reserved">this</span>.isSafari && <span class="reserved">this</span>.settings[<span class="literal">'browsers'</span>].indexOf(<span class="literal">'safari'</span>) == -1)
<span class="reserved">return</span>;
<span class="comment">// Browser check Opera</span>
<span class="reserved">if</span> (<span class="reserved">this</span>.isOpera && <span class="reserved">this</span>.settings[<span class="literal">'browsers'</span>].indexOf(<span class="literal">'opera'</span>) == -1)
<span class="reserved">return</span>;
<span class="comment">// If not super absolute make it so</span>
var baseHREF = tinyMCE.settings[<span class="literal">'document_base_url'</span>];
var h = document.location.href;
var p = h.indexOf(<span class="literal">'://'</span>);
<span class="reserved">if</span> (p > 0 && document.location.protocol != <span class="literal">"file:"</span>) {
p = h.indexOf(<span class="literal">'/'</span>, p + 3);
h = h.substring(0, p);
<span class="reserved">if</span> (baseHREF.indexOf(<span class="literal">'://'</span>) == -1)
baseHREF = h + baseHREF;
tinyMCE.settings[<span class="literal">'document_base_url'</span>] = baseHREF;
tinyMCE.settings[<span class="literal">'document_base_prefix'</span>] = h;
}
<span class="comment">// Trim away query part</span>
<span class="reserved">if</span> (baseHREF.indexOf(<span class="literal">'?'</span>) != -1)
baseHREF = baseHREF.substring(0, baseHREF.indexOf(<span class="literal">'?'</span>));
<span class="reserved">this</span>.settings[<span class="literal">'base_href'</span>] = baseHREF.substring(0, baseHREF.lastIndexOf(<span class="literal">'/'</span>)) + <span class="literal">"/"</span>;
theme = <span class="reserved">this</span>.settings[<span class="literal">'theme'</span>];
<span class="reserved">this</span>.blockRegExp = new RegExp(<span class="literal">"^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dt|dd|dir|fieldset|form|noscript|noframes|menu|isindex|samp)$"</span>, <span class="literal">"i"</span>);
<span class="reserved">this</span>.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40);
<span class="reserved">this</span>.uniqueURL = <span class="literal">'javascript:TINYMCE_UNIQUEURL();'</span>; <span class="comment">// Make unique URL non real URL</span>
<span class="reserved">this</span>.uniqueTag = <span class="literal">'<div id="mceTMPElement" style="display: none">TMP</div>'</span>;
<span class="reserved">this</span>.callbacks = new Array(<span class="literal">'onInit'</span>, <span class="literal">'getInfo'</span>, <span class="literal">'getEditorTemplate'</span>, <span class="literal">'setupContent'</span>, <span class="literal">'onChange'</span>, <span class="literal">'onPageLoad'</span>, <span class="literal">'handleNodeChange'</span>, <span class="literal">'initInstance'</span>, <span class="literal">'execCommand'</span>, <span class="literal">'getControlHTML'</span>, <span class="literal">'handleEvent'</span>, <span class="literal">'cleanup'</span>);
<span class="comment">// Theme url</span>
<span class="reserved">this</span>.settings[<span class="literal">'theme_href'</span>] = tinyMCE.baseURL + <span class="literal">"/themes/"</span> + theme;
<span class="reserved">if</span> (!tinyMCE.isMSIE)
<span class="reserved">this</span>.settings[<span class="literal">'force_br_newlines'</span>] = false;
<span class="reserved">if</span> (tinyMCE.getParam(<span class="literal">"popups_css"</span>, false)) {
var cssPath = tinyMCE.getParam(<span class="literal">"popups_css"</span>, <span class="literal">""</span>);
<span class="comment">// Is relative</span>
<span class="reserved">if</span> (cssPath.indexOf(<span class="literal">'://'</span>) == -1 && cssPath.charAt(0) != <span class="literal">'/'</span>)
<span class="reserved">this</span>.settings[<span class="literal">'popups_css'</span>] = <span class="reserved">this</span>.documentBasePath + <span class="literal">"/"</span> + cssPath;
<span class="reserved">else</span>
<span class="reserved">this</span>.settings[<span class="literal">'popups_css'</span>] = cssPath;
} <span class="reserved">else</span>
<span class="reserved">this</span>.settings[<span class="literal">'popups_css'</span>] = tinyMCE.baseURL + <span class="literal">"/themes/"</span> + theme + <span class="literal">"/css/editor_popup.css"</span>;
<span class="reserved">if</span> (tinyMCE.getParam(<span class="literal">"editor_css"</span>, false)) {
var cssPath = tinyMCE.getParam(<span class="literal">"editor_css"</span>, <span class="literal">""</span>);
<span class="comment">// Is relative</span>
<span class="reserved">if</span> (cssPath.indexOf(<span class="literal">'://'</span>) == -1 && cssPath.charAt(0) != <span class="literal">'/'</span>)
<span class="reserved">this</span>.settings[<span class="literal">'editor_css'</span>] = <span class="reserved">this</span>.documentBasePath + <span class="literal">"/"</span> + cssPath;
<span class="reserved">else</span>
<span class="reserved">this</span>.settings[<span class="literal">'editor_css'</span>] = cssPath;
} <span class="reserved">else</span>
<span class="reserved">this</span>.settings[<span class="literal">'editor_css'</span>] = tinyMCE.baseURL + <span class="literal">"/themes/"</span> + theme + <span class="literal">"/css/editor_ui.css"</span>;
<span class="reserved">if</span> (tinyMCE.settings[<span class="literal">'debug'</span>]) {
var msg = <span class="literal">"Debug: \n"</span>;
msg += <span class="literal">"baseURL: "</span> + <span class="reserved">this</span>.baseURL + <span class="literal">"\n"</span>;
msg += <span class="literal">"documentBasePath: "</span> + <span class="reserved">this</span>.documentBasePath + <span class="literal">"\n"</span>;
msg += <span class="literal">"content_css: "</span> + <span class="reserved">this</span>.settings[<span class="literal">'content_css'</span>] + <span class="literal">"\n"</span>;
msg += <span class="literal">"popups_css: "</span> + <span class="reserved">this</span>.settings[<span class="literal">'popups_css'</span>] + <span class="literal">"\n"</span>;
msg += <span class="literal">"editor_css: "</span> + <span class="reserved">this</span>.settings[<span class="literal">'editor_css'</span>] + <span class="literal">"\n"</span>;
alert(msg);
}
<span class="comment">// Only do this once</span>
<span class="reserved">if</span> (<span class="reserved">this</span>.configs.length == 0) {
<span class="comment">// Is Safari enabled</span>
<span class="reserved">if</span> (<span class="reserved">this</span>.isSafari && <span class="reserved">this</span>.getParam(<span class="literal">'safari_warning'</span>, false))
alert(<span class="literal">"Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false"</span>);
<span class="reserved">if</span> (typeof(TinyMCECompressed) == <span class="literal">"undefined"</span>) {
tinyMCE.addEvent(window, <span class="literal">"DOMContentLoaded"</span>, TinyMCE_Engine.<span class="reserved">prototype</span>.onLoad);
<span class="reserved">if</span> (tinyMCE.isMSIE && !tinyMCE.isOpera) {
<span class="reserved">if</span> (document.body)
tinyMCE.addEvent(document.body, <span class="literal">"readystatechange"</span>, TinyMCE_Engine.<span class="reserved">prototype</span>.onLoad);
<span class="reserved">else</span>
tinyMCE.addEvent(document, <span class="literal">"readystatechange"</span>, TinyMCE_Engine.<span class="reserved">prototype</span>.onLoad);
}
tinyMCE.addEvent(window, <span class="literal">"load"</span>, TinyMCE_Engine.<span class="reserved">prototype</span>.onLoad);
tinyMCE._addUnloadEvents();
}
}
<span class="reserved">this</span>.loadScript(tinyMCE.baseURL + <span class="literal">'/themes/'</span> + <span class="reserved">this</span>.settings[<span class="literal">'theme'</span>] + <span class="literal">'/editor_template'</span> + tinyMCE.srcMode + <span class="literal">'.js'</span>);
<span class="reserved">this</span>.loadScript(tinyMCE.baseURL + <span class="literal">'/langs/'</span> + <span class="reserved">this</span>.settings[<span class="literal">'language'</span>] + <span class="literal">'.js'</span>);
<span class="reserved">this</span>.loadCSS(<span class="reserved">this</span>.settings[<span class="literal">'editor_css'</span>]);
<span class="comment">// Add plugins</span>
var p = tinyMCE.getParam(<span class="literal">'plugins'</span>, <span class="literal">''</span>, true, <span class="literal">','</span>);
<span class="reserved">if</span> (p.length > 0) {
<span class="reserved">for</span> (var i=0; i<p.length; i++) {
<span class="reserved">if</span> (p[i].charAt(0) != <span class="literal">'-'</span>)
<span class="reserved">this</span>.loadScript(tinyMCE.baseURL + <span class="literal">'/plugins/'</span> + p[i] + <span class="literal">'/editor_plugin'</span> + tinyMCE.srcMode + <span class="literal">'.js'</span>);
}
}
<span class="comment">// Setup entities</span>
settings[<span class="literal">'cleanup_entities'</span>] = new Array();
var entities = tinyMCE.getParam(<span class="literal">'entities'</span>, <span class="literal">''</span>, true, <span class="literal">','</span>);
<span class="reserved">for</span> (var i=0; i<entities.length; i+=2)
settings[<span class="literal">'cleanup_entities'</span>][<span class="literal">'c'</span> + entities[i]] = entities[i+1];
<span class="comment">// Save away this config</span>
settings[<span class="literal">'index'</span>] = <span class="reserved">this</span>.configs.length;
<span class="reserved">this</span>.configs[<span class="reserved">this</span>.configs.length] = settings;
},
<span class="comment">/**
* Adds unload event handles to execute triggerSave.
*
* <span class="attrib">@private</span>
*/</span>
_addUnloadEvents : <span class="reserved">function</span>() {
<span class="reserved">if</span> (tinyMCE.isMSIE) {
<span class="reserved">if</span> (tinyMCE.settings[<span class="literal">'add_unload_trigger'</span>]) {
tinyMCE.addEvent(window, <span class="literal">"unload"</span>, TinyMCE_Engine.<span class="reserved">prototype</span>.unloadHandler);
tinyMCE.addEvent(window.document, <span class="literal">"beforeunload"</span>, TinyMCE_Engine.<span class="reserved">prototype</span>.unloadHandler);
}
} <span class="reserved">else</span> {
<span class="reserved">if</span> (tinyMCE.settings[<span class="literal">'add_unload_trigger'</span>])
tinyMCE.addEvent(window, <span class="literal">"unload"</span>, <span class="reserved">function</span> () {tinyMCE.triggerSave(true, true);});
}
},
<span class="comment">/**
* Assigns a default value for a specific config parameter.
*
* <span class="attrib">@param</span> {string} key Settings key to add default value to.
* <span class="attrib">@param</span> {object} def_val Default value to assign if the settings option isn't defined.
* <span class="attrib">@param</span> {boolean} t Trim all white space, if true all whitespace will be removed from option value.
* <span class="attrib">@private</span>
*/</span>
_def : <span class="reserved">function</span>(key, def_val, t) {
var v = tinyMCE.getParam(key, def_val);
v = t ? v.replace(/\s+/g,<span class="literal">""</span>) : v;
<span class="reserved">this</span>.settings[key] = v;
},
<span class="comment">/**
* Returns true/false if the specified plugin is loaded or not.
*
* <span class="attrib">@param</span> {string} n Plugin name to look for.
* <span class="attrib">@return</span> true/false if the specified plugin is loaded or not.
* <span class="attrib">@type</span> boolean
*/</span>
hasPlugin : <span class="reserved">function</span>(n) {
<span class="reserved">return</span> typeof(<span class="reserved">this</span>.plugins[n]) != <span class="literal">"undefined"</span> && <span class="reserved">this</span>.plugins[n] != null;
},
<span class="comment">/**
* Adds the specified plugin to the list of loaded plugins, this will also setup the baseURL
* property of the plugin.
*
* <span class="attrib">@param</span> {string} Plugin name/id.
* <span class="attrib">@param</span> {TinyMCE_Plugin} p Plugin instance to add.
*/</span>
addPlugin : <span class="reserved">function</span>(n, p) {
var op = <span class="reserved">this</span>.plugins[n];
<span class="comment">// Use the previous plugin object base URL used when loading external plugins</span>
p.baseURL = op ? op.baseURL : tinyMCE.baseURL + <span class="literal">"/plugins/"</span> + n;
<span class="reserved">this</span>.plugins[n] = p;
},
<span class="comment">/**
* Sets the baseURL of the specified plugin, this is useful if the plugin is loaded from
* a external location.
*
* <span class="attrib">@param</span> {string} n Plugin name/id to set base URL on. This have to be added before.
* <span class="attrib">@param</span> {string} u Base URL of plugin, this string should be the URL prefix for the plugin without a trailing slash.
*/</span>
setPluginBaseURL : <span class="reserved">function</span>(n, u) {
var op = <span class="reserved">this</span>.plugins[n];
<span class="reserved">if</span> (op)
op.baseURL = u;
<span class="reserved">else</span>
<span class="reserved">this</span>.plugins[n] = {baseURL : u};
},
<span class="comment">/**
* Load plugin from external URL.
*
* <span class="attrib">@param</span> {string} n Plugin name for example \"emotions\".
* <span class="attrib">@param</span> {string} u URL of plugin directory to load.
*/</span>
loadPlugin : <span class="reserved">function</span>(n, u) {
u = u.indexOf(<span class="literal">'.js'</span>) != -1 ? u.substring(0, u.lastIndexOf(<span class="literal">'/'</span>)) : u;
u = u.charAt(u.length-1) == <span class="literal">'/'</span> ? u.substring(0, u.length-1) : u;
<span class="reserved">this</span>.plugins[n] = {baseURL : u};
<span class="reserved">this</span>.loadScript(u + <span class="literal">"/editor_plugin"</span> + (tinyMCE.srcMode ? <span class="literal">'_src'</span> : <span class="literal">''</span>) + <span class="literal">".js"</span>);
},
<span class="comment">/**
* Returns true/false if the specified theme is loaded or not.
*
* <span class="attrib">@param</span> {string} n Theme name/id to check for.
* <span class="attrib">@return</span> true/false if the specified theme is loaded or not.
* <span class="attrib">@type</span> boolean
*/</span>
hasTheme : <span class="reserved">function</span>(n) {
<span class="reserved">return</span> typeof(<span class="reserved">this</span>.themes[n]) != <span class="literal">"undefined"</span> && <span class="reserved">this</span>.themes[n] != null;
},
<span class="comment">/**
* Adds the specified theme in to the list of loaded themes.
*
* <span class="attrib">@param</span> {string} n Theme name/id to add the object reference to.
* <span class="attrib">@param</span> {TinyMCE_Theme} t Theme instance to add to the loaded list.
*/</span>
addTheme : <span class="reserved">function</span>(n, t) {
<span class="reserved">this</span>.themes[n] = t;
},
<span class="comment">/**
* Adds a floating menu instance to TinyMCE.
*
* <span class="attrib">@param</span> {string} n TinyMCE menu id.
* <span class="attrib">@param</span> {TinyMCE_Menu} m TinyMCE menu instance.
*/</span>
addMenu : <span class="reserved">function</span>(n, m) {
<span class="reserved">this</span>.menus[n] = m;
},
<span class="comment">/**
* Checks if the specified menu by name is added to TinyMCE.
*
* <span class="attrib">@param</span> {string} n TinyMCE menu id.
* <span class="attrib">@return</span> true/false if it exists or not.
* <span class="attrib">@type</span> boolean
*/</span>
hasMenu : <span class="reserved">function</span>(n) {
<span class="reserved">return</span> typeof(<span class="reserved">this</span>.plugins[n]) != <span class="literal">"undefined"</span> && <span class="reserved">this</span>.plugins[n] != null;
},
<span class="comment">/**
* Loads the specified script by writing the a script tag to the current page.
* This will also check if the file has been loaded before. This function should only be used
* when the page is loading.
*
* <span class="attrib">@param</span> {string} url Script URL to load.
*/</span>
loadScript : <span class="reserved">function</span>(url) {
<span class="reserved">for</span> (var i=0; i<<span class="reserved">this</span>.loadedFiles.length; i++) {
<span class="reserved">if</span> (<span class="reserved">this</span>.loadedFiles[i] == url)
<span class="reserved">return</span>;
}
document.write(<span class="literal">'<sc'</span>+<span class="literal">'ript language="javascript" type="text/javascript" src="'</span> + url + <span class="literal">'"></script>'</span>);
<span class="reserved">this</span>.loadedFiles[<span class="reserved">this</span>.loadedFiles.length] = url;
},
<span class="comment">/**
* Loads the specified CSS by writing the a link tag to the current page.
* This will also check if the file has been loaded before. This function should only be used
* when the page is loading.
*
* <span class="attrib">@param</span> {string} url CSS file URL to load or comma separated list of files.
*/</span>
loadCSS : <span class="reserved">function</span>(url) {
var ar = url.replace(/\s+/, <span class="literal">''</span>).split(<span class="literal">','</span>);
var lflen = 0, csslen = 0;
var skip = false;
var x = 0, i = 0;
<span class="reserved">for</span> (x = 0,csslen = ar.length; x<csslen; x++) {
ignore_css = false;
<span class="reserved">if</span> (ar[x] != null && ar[x] != <span class="literal">'null'</span> && ar[x].length > 0) {
<span class="comment">/* Make sure it doesn't exist. */</span>
<span class="reserved">for</span> (i=0, lflen=<span class="reserved">this</span>.loadedFiles.length; i<lflen; i++) {
<span class="reserved">if</span> (<span class="reserved">this</span>.loadedFiles[i] == ar[x]) {
skip = true;
break;
}
}
<span class="reserved">if</span> (!skip) {
document.write(<span class="literal">'<link href="'</span> + ar[x] + <span class="literal">'" rel="stylesheet" type="text/css" />'</span>);
<span class="reserved">this</span>.loadedFiles[<span class="reserved">this</span>.loadedFiles.length] = ar[x];
}
}
}
},
<span class="comment">/**
* Imports a CSS file into a allready loaded document. This will add a link element
* to the head element of the document.
*
* <span class="attrib">@param</span> {DOMDocument} doc DOM Document to load CSS into.
* <span class="attrib">@param</span> {string} css CSS File URL to load or comma separated list of files.
*/</span>
importCSS : <span class="reserved">function</span>(doc, css) {
var css_ary = css.replace(/\s+/, <span class="literal">''</span>).split(<span class="literal">','</span>);
var csslen, elm, headArr, x, css_file;
<span class="reserved">for</span> (x = 0, csslen = css_ary.length; x<csslen; x++) {
css_file = css_ary[x];
<span class="reserved">if</span> (css_file != null && css_file != <span class="literal">'null'</span> && css_file.length > 0) {
<span class="comment">// Is relative, make absolute</span>
<span class="reserved">if</span> (css_file.indexOf(<span class="literal">'://'</span>) == -1 && css_file.charAt(0) != <span class="literal">'/'</span>)
css_file = <span class="reserved">this</span>.documentBasePath + <span class="literal">"/"</span> + css_file;
<span class="reserved">if</span> (typeof(doc.createStyleSheet) == <span class="literal">"undefined"</span>) {
elm = doc.createElement(<span class="literal">"link"</span>);
elm.rel = <span class="literal">"stylesheet"</span>;
elm.href = css_file;
<span class="reserved">if</span> ((headArr = doc.getElementsByTagName(<span class="literal">"head"</span>)) != null && headArr.length > 0)
headArr[0].appendChild(elm);
} <span class="reserved">else</span>
doc.createStyleSheet(css_file);
}
}
},
<span class="comment">/**
* Displays a confirm dialog when a user clicks/focus a textarea that is to be converted into
* a TinyMCE instance.
*
* <span class="attrib">@param</span> {DOMEvent} e DOM event instance.
* <span class="attrib">@param</span> {Array} settings Name/Value array of initialization settings.
*/</span>
confirmAdd : <span class="reserved">function</span>(e, settings) {
var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
var elementId = elm.name ? elm.name : elm.id;
tinyMCE.settings = settings;
<span class="reserved">if</span> (tinyMCE.settings[<span class="literal">'convert_on_click'</span>] || (!elm.getAttribute(<span class="literal">'mce_noask'</span>) && confirm(tinyMCELang[<span class="literal">'lang_edit_confirm'</span>])))
tinyMCE.addMCEControl(elm, elementId);
elm.setAttribute(<span class="literal">'mce_noask'</span>, <span class="literal">'true'</span>);
},
<span class="comment">/**
* Moves the contents from the hidden textarea to the editor that gets inserted.
*
* <span class="attrib">@param</span> {string} form_element_name Form element name to move contents from.
* <span class="attrib">@deprecated</span>
*/</span>
updateContent : <span class="reserved">function</span>(form_element_name) {
<span class="comment">// Find MCE instance linked to given form element and copy it's value</span>
var formElement = document.getElementById(form_element_name);
<span class="reserved">for</span> (var n in tinyMCE.instances) {
var inst = tinyMCE.instances[n];
<span class="reserved">if</span> (!tinyMCE.isInstance(inst))
continue;
inst.switchSettings();
<span class="reserved">if</span> (inst.formElement == formElement) {
var doc = inst.getDoc();
tinyMCE._setHTML(doc, inst.formElement.value);
<span class="reserved">if</span> (!tinyMCE.isMSIE)
doc.body.innerHTML = tinyMCE._cleanupHTML(inst, doc, <span class="reserved">this</span>.settings, doc.body, inst.visualAid);
}
}
},
<span class="comment">/**
* Adds a TinyMCE editor control instance to a specific form element.
*
* <span class="attrib">@param</span> {HTMLElement} replace_element HTML element object to replace.
* <span class="attrib">@param</span> {string} form_element_name HTML form element name,
* <span class="attrib">@param</span> {DOMDocument} target_document Target document that holds the element.
*/</span>
addMCEControl : <span class="reserved">function</span>(replace_element, form_element_name, target_document) {
var id = <span class="literal">"mce_editor_"</span> + tinyMCE.idCounter++;
var inst = new TinyMCE_Control(tinyMCE.settings);
inst.editorId = id;
<span class="reserved">this</span>.instances[id] = inst;
inst._onAdd(replace_element, form_element_name, target_document);
},
<span class="comment">/**
* Removes a TinyMCE editor control instance by id.
*
* <span class="attrib">@param</span> {string} editor_id Id of editor instance to remove.
*/</span>
removeMCEControl : <span class="reserved">function</span>(editor_id) {
var inst = tinyMCE.getInstanceById(editor_id);
<span class="reserved">if</span> (inst) {
inst.switchSettings();
editor_id = inst.editorId;
var html = tinyMCE.getContent(editor_id);
<span class="comment">// Remove editor instance from instances array</span>
var tmpInstances = new Array();
<span class="reserved">for</span> (var instanceName in tinyMCE.instances) {
var instance = tinyMCE.instances[instanceName];
<span class="reserved">if</span> (!tinyMCE.isInstance(instance))
continue;
<span class="reserved">if</span> (instanceName != editor_id)
tmpInstances[instanceName] = instance;
}
tinyMCE.instances = tmpInstances;
tinyMCE.selectedElement = null;
tinyMCE.selectedInstance = null;
<span class="comment">// Remove element</span>
var replaceElement = document.getElementById(editor_id + <span class="literal">"_parent"</span>);
var oldTargetElement = inst.oldTargetElement;
var targetName = oldTargetElement.nodeName.toLowerCase();
<span class="reserved">if</span> (targetName == <span class="literal">"textarea"</span> || targetName == <span class="literal">"input"</span>) {
<span class="comment">// Just show the old text area</span>
replaceElement.parentNode.removeChild(replaceElement);
oldTargetElement.style.display = <span class="literal">"inline"</span>;
oldTargetElement.value = html;
} <span class="reserved">else</span> {
oldTargetElement.innerHTML = html;
oldTargetElement.style.display = <span class="literal">'block'</span>;
replaceElement.parentNode.insertBefore(oldTargetElement, replaceElement);
replaceElement.parentNode.removeChild(replaceElement);
}
}
},
<span class="comment">/**
* Moves the contents from a TinyMCE editor control instance to the hidden textarea
* that got replaced with TinyMCE. This is executed automaticly on for example form submit.
*
* <span class="attrib">@param</span> {boolean} skip_cleanup Optional Skip cleanup, simply move the contents as fast as possible.
* <span class="attrib">@param</span> {boolean} skip_callback Optional Skip callback, don't call the save_callback function.
*/</span>
triggerSave : <span class="reserved">function</span>(skip_cleanup, skip_callback) {
var inst, n;
<span class="comment">// Default to false</span>
<span class="reserved">if</span> (typeof(skip_cleanup) == <span class="literal">"undefined"</span>)
skip_cleanup = false;
<span class="comment">// Default to false</span>
<span class="reserved">if</span> (typeof(skip_callback) == <span class="literal">"undefined"</span>)
skip_callback = false;
<span class="comment">// Cleanup and set all form fields</span>
<span class="reserved">for</span> (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
<span class="reserved">if</span> (!tinyMCE.isInstance(inst))
continue;
inst.triggerSave(skip_cleanup, skip_callback);
}
},
<span class="comment">/**
* Resets a forms TinyMCE instances based on form index.
*
* <span class="attrib">@param</span> {int} form_index Form index to reset.
*/</span>
resetForm : <span class="reserved">function</span>(form_index) {
var i, inst, n, formObj = document.forms[form_index];
<span class="reserved">for</span> (n in tinyMCE.instances) {
inst = tinyMCE.instances[n];
<span class="reserved">if</span> (!tinyMCE.isInstance(inst))
continue;
inst.switchSettings();
<span class="reserved">for</span> (i=0; i<formObj.elements.length; i++) {
<span class="reserved">if</span> (inst.formTargetElementId == formObj.elements[i].name)
inst.getBody().innerHTML = inst.startContent;
}
}
},
<span class="comment">/**
* Executes a command on a specific editor instance by id.
*
* <span class="attrib">@param</span> {string} editor_id TinyMCE editor control instance id to perform comman on.
* <span class="attrib">@param</span> {string} command Command name to execute, for example mceLink or Bold.
* <span class="attrib">@param</span> {boolean} user_interface True/false state if a UI (dialog) should be presented or not.
* <span class="attrib">@param</span> {object} value Optional command value, this can be anything.
* <span class="attrib">@param</span> {boolean} focus True/false if the editor instance should be focused first.
*/</span>
execInstanceCommand : <span class="reserved">function</span>(editor_id, command, user_interface, value, focus) {
var inst = tinyMCE.getInstanceById(editor_id);
<span class="reserved">if</span> (inst) {
<span class="reserved">if</span> (typeof(focus) == <span class="literal">"undefined"</span>)
focus = true;
<span class="reserved">if</span> (focus)
inst.contentWindow.focus();
<span class="comment">// Reset design mode if lost</span>
inst.autoResetDesignMode();
<span class="reserved">this</span>.selectedElement = inst.getFocusElement();
<span class="reserved">this</span>.selectedInstance = inst;
tinyMCE.execCommand(command, user_interface, value);
<span class="comment">// Cancel event so it doesn't call onbeforeonunlaod</span>
<span class="reserved">if</span> (tinyMCE.isMSIE && window.event != null)
tinyMCE.cancelEvent(window.event);
}
},
<span class="comment">/**
* Executes a command on the selected or last selected TinyMCE editor control instance. This function also handles
* some non instance specific commands like mceAddControl, mceRemoveControl, mceHelp or mceFocus.
*
* <span class="attrib">@param</span> {string} command Command name to execute, for example mceLink or Bold.
* <span class="attrib">@param</span> {boolean} user_interface True/false state if a UI (dialog) should be presented or not.
* <span class="attrib">@param</span> {object} value Optional command value, this can be anything.
*/</span>
execCommand : <span class="reserved">function</span>(command, user_interface, value) {
<span class="comment">// Default input</span>
user_interface = user_interface ? user_interface : false;
value = value ? value : null;
<span class="reserved">if</span> (tinyMCE.selectedInstance)
tinyMCE.selectedInstance.switchSettings();
switch (command) {
case <span class="literal">'mceHelp'</span>:
tinyMCE.openWindow({
file : <span class="literal">'about.htm'</span>,
width : 480,
height : 380
}, {
tinymce_version : tinyMCE.majorVersion + <span class="literal">"."</span> + tinyMCE.minorVersion,
tinymce_releasedate : tinyMCE.releaseDate,
inline : <span class="literal">"yes"</span>
});
<span class="reserved">return</span>;
case <span class="literal">'mceFocus'</span>:
var inst = tinyMCE.getInstanceById(value);
<span class="reserved">if</span> (inst)
inst.contentWindow.focus();
<span class="reserved">return</span>;
case <span class="literal">"mceAddControl"</span>:
case <span class="literal">"mceAddEditor"</span>:
tinyMCE.addMCEControl(tinyMCE._getElementById(value), value);
<span class="reserved">return</span>;
case <span class="literal">"mceAddFrameControl"</span>:
tinyMCE.addMCEControl(tinyMCE._getElementById(value[<span class="literal">'element'</span>], value[<span class="literal">'document'</span>]), value[<span class="literal">'element'</span>], value[<span class="literal">'document'</span>]);
<span class="reserved">return</span>;
case <span class="literal">"mceRemoveControl"</span>:
case <span class="literal">"mceRemoveEditor"</span>:
tinyMCE.removeMCEControl(value);
<span class="reserved">return</span>;
case <span class="literal">"mceResetDesignMode"</span>:
<span class="comment">// Resets the designmode state of the editors in Gecko</span>
<span class="reserved">if</span> (!tinyMCE.isMSIE) {
<span class="reserved">for</span> (var n in tinyMCE.instances) {
<span class="reserved">if</span> (!tinyMCE.isInstance(tinyMCE.instances[n]))
continue;
try {
tinyMCE.instances[n].getDoc().designMode = <span class="literal">"on"</span>;
} catch (e) {
<span class="comment">// Ignore any errors</span>
}
}
}
<span class="reserved">return</span>;
}
<span class="reserved">if</span> (<span class="reserved">this</span>.selectedInstance) {
<span class="reserved">this</span>.selectedInstance.execCommand(command, user_interface, value);
} <span class="reserved">else</span> <span class="reserved">if</span> (tinyMCE.settings[<span class="literal">'focus_alert'</span>])
alert(tinyMCELang[<span class="literal">'lang_focus_alert'</span>]);
},
<span class="comment">/**
* Creates a iframe editor container for the specified element.
*
* <span class="attrib">@param</span> {HTMLElement} replace_element Element to replace with iframe element.
* <span class="attrib">@param</span> {DOMDocument} doc Optional document to use with iframe replacement.
* <span class="attrib">@param</span> {DOMWindow} win Optional window to use with iframe replacement.
* <span class="attrib">@private</span>
*/</span>
_createIFrame : <span class="reserved">function</span>(replace_element, doc, win) {
var iframe, id = replace_element.getAttribute(<span class="literal">"id"</span>);
var aw, ah;
<span class="reserved">if</span> (typeof(doc) == <span class="literal">"undefined"</span>)
doc = document;
<span class="reserved">if</span> (typeof(win) == <span class="literal">"undefined"</span>)
win = window;
iframe = doc.createElement(<span class="literal">"iframe"</span>);
aw = <span class="literal">""</span> + tinyMCE.settings[<span class="literal">'area_width'</span>];
ah = <span class="literal">""</span> + tinyMCE.settings[<span class="literal">'area_height'</span>];
<span class="reserved">if</span> (aw.indexOf(<span class="literal">'%'</span>) == -1) {
aw = parseInt(aw);
aw = aw < 0 ? 300 : aw;
aw = aw + <span class="literal">"px"</span>;
}
<span class="reserved">if</span> (ah.indexOf(<span class="literal">'%'</span>) == -1) {
ah = parseInt(ah);
ah = ah < 0 ? 240 : ah;
ah = ah + <span class="literal">"px"</span>;
}
iframe.setAttribute(<span class="literal">"id"</span>, id);
iframe.setAttribute(<span class="literal">"className"</span>, <span class="literal">"mceEditorIframe"</span>);
iframe.setAttribute(<span class="literal">"border"</span>, <span class="literal">"0"</span>);
iframe.setAttribute(<span class="literal">"frameBorder"</span>, <span class="literal">"0"</span>);
iframe.setAttribute(<span class="literal">"marginWidth"</span>, <span class="literal">"0"</span>);
iframe.setAttribute(<span class="literal">"marginHeight"</span>, <span class="literal">"0"</span>);
iframe.setAttribute(<span class="literal">"leftMargin"</span>, <span class="literal">"0"</span>);
iframe.setAttribute(<span class="literal">"topMargin"</span>, <span class="literal">"0"</span>);
iframe.setAttribute(<span class="literal">"width"</span>, aw);
iframe.setAttribute(<span class="literal">"height"</span>, ah);
iframe.setAttribute(<span class="literal">"allowtransparency"</span>, <span class="literal">"true"</span>);
<span class="reserved">if</span> (tinyMCE.settings[<span class="literal">"auto_resize"</span>])
iframe.setAttribute(<span class="literal">"scrolling"</span>, <span class="literal">"no"</span>);
<span class="comment">// Must have a src element in MSIE HTTPs breaks aswell as absoute URLs</span>
<span class="reserved">if</span> (tinyMCE.isMSIE && !tinyMCE.isOpera)
iframe.setAttribute(<span class="literal">"src"</span>, <span class="reserved">this</span>.settings[<span class="literal">'default_document'</span>]);
iframe.style.width = aw;
iframe.style.height = ah;
<span class="comment">// MSIE 5.0 issue</span>
<span class="reserved">if</span> (tinyMCE.isMSIE && !tinyMCE.isOpera)
replace_element.outerHTML = iframe.outerHTML;
<span class="reserved">else</span>
replace_element.parentNode.replaceChild(iframe, replace_element);
<span class="reserved">if</span> (tinyMCE.isMSIE && !tinyMCE.isOpera)
<span class="reserved">return</span> win.frames[id];
<span class="reserved">else</span>
<span class="reserved">return</span> iframe;
},
<span class="comment">/**
* Setups the contents of TinyMCE editor instance and fills it with contents.
*
* <span class="attrib">@param</span> {string} editor_id TinyMCE editor instance control id to fill.
*/</span>
setupContent : <span class="reserved">function</span>(editor_id) {
var inst = tinyMCE.instances[editor_id];
var doc = inst.getDoc();
var head = doc.getElementsByTagName(<span class="literal">'head'</span>).item(0);
var content = inst.startContent;
inst.switchSettings();
<span class="comment">// Not loaded correctly hit it again, Mozilla bug #997860</span>
<span class="reserved">if</span> (!tinyMCE.isMSIE && tinyMCE.getParam(<span class="literal">"setupcontent_reload"</span>, false) && doc.title != <span class="literal">"blank_page"</span>) {
<span class="comment">// This part will remove the designMode status</span>
<span class="comment">// Failes first time in Firefox 1.5b2 on Mac</span>
try {doc.location.href = tinyMCE.baseURL + <span class="literal">"/blank.htm"</span>;} catch (ex) {}
window.setTimeout(<span class="literal">"tinyMCE.setupContent('"</span> + editor_id + <span class="literal">"');"</span>, 1000);
<span class="reserved">return</span>;
}
<span class="reserved">if</span> (!head) {
window.setTimeout(<span class="literal">"tinyMCE.setupContent('"</span> + editor_id + <span class="literal">"');"</span>, 10);
<span class="reserved">return</span>;
}
<span class="comment">// Import theme specific content CSS the user specific</span>
tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + <span class="literal">"/themes/"</span> + inst.settings[<span class="literal">'theme'</span>] + <span class="literal">"/css/editor_content.css"</span>);
tinyMCE.importCSS(inst.getDoc(), inst.settings[<span class="literal">'content_css'</span>]);
tinyMCE.dispatchCallback(inst, <span class="literal">'init_instance_callback'</span>, <span class="literal">'initInstance'</span>, inst);