Wp-Insert - Version 1.7.5

Version Description

Download this release

Release Info

Developer namith.jawahar
Plugin Icon 128x128 Wp-Insert
Version 1.7.5
Comparing to
See all releases

Code changes from version 1.7.4 to 1.7.5

Files changed (180) hide show
  1. css/IE6adminStyle.css +9 -0
  2. fckeditor/_samples/_plugins/findreplace/fckplugin.js +0 -38
  3. fckeditor/_samples/_plugins/findreplace/find.gif +0 -0
  4. fckeditor/_samples/_plugins/findreplace/find.html +0 -172
  5. fckeditor/_samples/_plugins/findreplace/lang/en.js +0 -33
  6. fckeditor/_samples/_plugins/findreplace/lang/fr.js +0 -33
  7. fckeditor/_samples/_plugins/findreplace/lang/it.js +0 -33
  8. fckeditor/_samples/_plugins/findreplace/replace.gif +0 -0
  9. fckeditor/_samples/_plugins/findreplace/replace.html +0 -135
  10. fckeditor/_samples/_plugins/samples/fckplugin.js +0 -73
  11. fckeditor/_samples/default.html +0 -35
  12. fckeditor/_samples/php/sample01.php +0 -57
  13. fckeditor/_samples/php/sample02.php +0 -108
  14. fckeditor/_samples/php/sample03.php +0 -89
  15. fckeditor/_samples/php/sample04.php +0 -95
  16. fckeditor/_samples/php/sampleposteddata.php +0 -69
  17. fckeditor/_samples/sample.css +0 -74
  18. fckeditor/_samples/sampleslist.html +0 -120
  19. fckeditor/editor/_source/classes/fckcontextmenu.js +0 -223
  20. fckeditor/editor/_source/classes/fckdataprocessor.js +0 -119
  21. fckeditor/editor/_source/classes/fckdocumentfragment_gecko.js +0 -53
  22. fckeditor/editor/_source/classes/fckdocumentfragment_ie.js +0 -58
  23. fckeditor/editor/_source/classes/fckdomrange.js +0 -935
  24. fckeditor/editor/_source/classes/fckdomrange_gecko.js +0 -104
  25. fckeditor/editor/_source/classes/fckdomrange_ie.js +0 -199
  26. fckeditor/editor/_source/classes/fckdomrangeiterator.js +0 -327
  27. fckeditor/editor/_source/classes/fckeditingarea.js +0 -368
  28. fckeditor/editor/_source/classes/fckelementpath.js +0 -89
  29. fckeditor/editor/_source/classes/fckenterkey.js +0 -708
  30. fckeditor/editor/_source/classes/fckevents.js +0 -71
  31. fckeditor/editor/_source/classes/fckhtmliterator.js +0 -142
  32. fckeditor/editor/_source/classes/fckicon.js +0 -103
  33. fckeditor/editor/_source/classes/fckiecleanup.js +0 -68
  34. fckeditor/editor/_source/classes/fckimagepreloader.js +0 -64
  35. fckeditor/editor/_source/classes/fckkeystrokehandler.js +0 -141
  36. fckeditor/editor/_source/classes/fckmenublock.js +0 -153
  37. fckeditor/editor/_source/classes/fckmenublockpanel.js +0 -54
  38. fckeditor/editor/_source/classes/fckmenuitem.js +0 -161
  39. fckeditor/editor/_source/classes/fckpanel.js +0 -463
  40. fckeditor/editor/_source/classes/fckplugin.js +0 -56
  41. fckeditor/editor/_source/classes/fckspecialcombo.js +0 -376
  42. fckeditor/editor/_source/classes/fckstyle.js +0 -1500
  43. fckeditor/editor/_source/classes/fcktoolbar.js +0 -103
  44. fckeditor/editor/_source/classes/fcktoolbarbreak_gecko.js +0 -36
  45. fckeditor/editor/_source/classes/fcktoolbarbreak_ie.js +0 -38
  46. fckeditor/editor/_source/classes/fcktoolbarbutton.js +0 -81
  47. fckeditor/editor/_source/classes/fcktoolbarbuttonui.js +0 -198
  48. fckeditor/editor/_source/classes/fcktoolbarfontformatcombo.js +0 -139
  49. fckeditor/editor/_source/classes/fcktoolbarfontscombo.js +0 -98
  50. fckeditor/editor/_source/classes/fcktoolbarfontsizecombo.js +0 -76
  51. fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js +0 -103
  52. fckeditor/editor/_source/classes/fcktoolbarspecialcombo.js +0 -146
  53. fckeditor/editor/_source/classes/fcktoolbarstylecombo.js +0 -200
  54. fckeditor/editor/_source/classes/fckw3crange.js +0 -451
  55. fckeditor/editor/_source/classes/fckxml.js +0 -108
  56. fckeditor/editor/_source/classes/fckxml_gecko.js +0 -106
  57. fckeditor/editor/_source/classes/fckxml_ie.js +0 -93
  58. fckeditor/editor/_source/commandclasses/fck_othercommands.js +0 -634
  59. fckeditor/editor/_source/commandclasses/fckblockquotecommand.js +0 -281
  60. fckeditor/editor/_source/commandclasses/fckcorestylecommand.js +0 -61
  61. fckeditor/editor/_source/commandclasses/fckfitwindow.js +0 -213
  62. fckeditor/editor/_source/commandclasses/fckindentcommands.js +0 -282
  63. fckeditor/editor/_source/commandclasses/fckjustifycommands.js +0 -173
  64. fckeditor/editor/_source/commandclasses/fcklistcommands.js +0 -382
  65. fckeditor/editor/_source/commandclasses/fcknamedcommand.js +0 -39
  66. fckeditor/editor/_source/commandclasses/fckpasteplaintextcommand.js +0 -40
  67. fckeditor/editor/_source/commandclasses/fckpastewordcommand.js +0 -40
  68. fckeditor/editor/_source/commandclasses/fckremoveformatcommand.js +0 -45
  69. fckeditor/editor/_source/commandclasses/fckshowblocks.js +0 -94
  70. fckeditor/editor/_source/commandclasses/fckspellcheckcommand_gecko.js +0 -49
  71. fckeditor/editor/_source/commandclasses/fckspellcheckcommand_ie.js +0 -72
  72. fckeditor/editor/_source/commandclasses/fckstylecommand.js +0 -60
  73. fckeditor/editor/_source/commandclasses/fcktablecommand.js +0 -106
  74. fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js +0 -201
  75. fckeditor/editor/_source/fckconstants.js +0 -56
  76. fckeditor/editor/_source/fckeditorapi.js +0 -179
  77. fckeditor/editor/_source/fckjscoreextensions.js +0 -159
  78. fckeditor/editor/_source/fckscriptloader.js +0 -122
  79. fckeditor/editor/_source/internals/fck.js +0 -1256
  80. fckeditor/editor/_source/internals/fck_contextmenu.js +0 -345
  81. fckeditor/editor/_source/internals/fck_gecko.js +0 -497
  82. fckeditor/editor/_source/internals/fck_ie.js +0 -456
  83. fckeditor/editor/_source/internals/fckbrowserinfo.js +0 -61
  84. fckeditor/editor/_source/internals/fckcodeformatter.js +0 -100
  85. fckeditor/editor/_source/internals/fckcommands.js +0 -172
  86. fckeditor/editor/_source/internals/fckconfig.js +0 -237
  87. fckeditor/editor/_source/internals/fckdebug.js +0 -59
  88. fckeditor/editor/_source/internals/fckdebug_empty.js +0 -31
  89. fckeditor/editor/_source/internals/fckdialog.js +0 -239
  90. fckeditor/editor/_source/internals/fckdocumentprocessor.js +0 -270
  91. fckeditor/editor/_source/internals/fckdomtools.js +0 -1057
  92. fckeditor/editor/_source/internals/fcklanguagemanager.js +0 -165
  93. fckeditor/editor/_source/internals/fcklisthandler.js +0 -152
  94. fckeditor/editor/_source/internals/fcklistslib.js +0 -63
  95. fckeditor/editor/_source/internals/fckplugins.js +0 -46
  96. fckeditor/editor/_source/internals/fckregexlib.js +0 -100
  97. fckeditor/editor/_source/internals/fckselection.js +0 -42
  98. fckeditor/editor/_source/internals/fckselection_gecko.js +0 -228
  99. fckeditor/editor/_source/internals/fckselection_ie.js +0 -287
  100. fckeditor/editor/_source/internals/fckstyles.js +0 -381
  101. fckeditor/editor/_source/internals/fcktablehandler.js +0 -863
  102. fckeditor/editor/_source/internals/fcktablehandler_gecko.js +0 -56
  103. fckeditor/editor/_source/internals/fcktablehandler_ie.js +0 -64
  104. fckeditor/editor/_source/internals/fcktoolbaritems.js +0 -124
  105. fckeditor/editor/_source/internals/fcktoolbarset.js +0 -399
  106. fckeditor/editor/_source/internals/fcktools.js +0 -749
  107. fckeditor/editor/_source/internals/fcktools_gecko.js +0 -282
  108. fckeditor/editor/_source/internals/fcktools_ie.js +0 -234
  109. fckeditor/editor/_source/internals/fckundo.js +0 -223
  110. fckeditor/editor/_source/internals/fckurlparams.js +0 -39
  111. fckeditor/editor/_source/internals/fckxhtml.js +0 -534
  112. fckeditor/editor/_source/internals/fckxhtml_gecko.js +0 -114
  113. fckeditor/editor/_source/internals/fckxhtml_ie.js +0 -213
  114. fckeditor/editor/_source/internals/fckxhtmlentities.js +0 -357
  115. fckeditor/editor/css/behaviors/disablehandles.htc +0 -15
  116. fckeditor/editor/css/behaviors/showtableborders.htc +0 -36
  117. fckeditor/editor/css/fck_editorarea.css +0 -110
  118. fckeditor/editor/css/fck_internal.css +0 -199
  119. fckeditor/editor/css/fck_showtableborders_gecko.css +0 -49
  120. fckeditor/editor/css/images/block_address.png +0 -0
  121. fckeditor/editor/css/images/block_blockquote.png +0 -0
  122. fckeditor/editor/css/images/block_div.png +0 -0
  123. fckeditor/editor/css/images/block_h1.png +0 -0
  124. fckeditor/editor/css/images/block_h2.png +0 -0
  125. fckeditor/editor/css/images/block_h3.png +0 -0
  126. fckeditor/editor/css/images/block_h4.png +0 -0
  127. fckeditor/editor/css/images/block_h5.png +0 -0
  128. fckeditor/editor/css/images/block_h6.png +0 -0
  129. fckeditor/editor/css/images/block_p.png +0 -0
  130. fckeditor/editor/css/images/block_pre.png +0 -0
  131. fckeditor/editor/css/images/fck_anchor.gif +0 -0
  132. fckeditor/editor/css/images/fck_flashlogo.gif +0 -0
  133. fckeditor/editor/css/images/fck_hiddenfield.gif +0 -0
  134. fckeditor/editor/css/images/fck_pagebreak.gif +0 -0
  135. fckeditor/editor/css/images/fck_plugin.gif +0 -0
  136. fckeditor/editor/dialog/common/fck_dialog_common.css +0 -85
  137. fckeditor/editor/dialog/common/fck_dialog_common.js +0 -347
  138. fckeditor/editor/dialog/common/images/locked.gif +0 -0
  139. fckeditor/editor/dialog/common/images/reset.gif +0 -0
  140. fckeditor/editor/dialog/common/images/unlocked.gif +0 -0
  141. fckeditor/editor/dialog/fck_about.html +0 -161
  142. fckeditor/editor/dialog/fck_about/logo_fckeditor.gif +0 -0
  143. fckeditor/editor/dialog/fck_about/logo_fredck.gif +0 -0
  144. fckeditor/editor/dialog/fck_about/sponsors/spellchecker_net.gif +0 -0
  145. fckeditor/editor/dialog/fck_anchor.html +0 -220
  146. fckeditor/editor/dialog/fck_button.html +0 -104
  147. fckeditor/editor/dialog/fck_checkbox.html +0 -104
  148. fckeditor/editor/dialog/fck_colorselector.html +0 -172
  149. fckeditor/editor/dialog/fck_div.html +0 -396
  150. fckeditor/editor/dialog/fck_docprops.html +0 -600
  151. fckeditor/editor/dialog/fck_docprops/fck_document_preview.html +0 -113
  152. fckeditor/editor/dialog/fck_flash.html +0 -152
  153. fckeditor/editor/dialog/fck_flash/fck_flash.js +0 -300
  154. fckeditor/editor/dialog/fck_flash/fck_flash_preview.html +0 -50
  155. fckeditor/editor/dialog/fck_form.html +0 -109
  156. fckeditor/editor/dialog/fck_hiddenfield.html +0 -115
  157. fckeditor/editor/dialog/fck_image.html +0 -258
  158. fckeditor/editor/dialog/fck_image/fck_image.js +0 -512
  159. fckeditor/editor/dialog/fck_image/fck_image_preview.html +0 -72
  160. fckeditor/editor/dialog/fck_link.html +0 -295
  161. fckeditor/editor/dialog/fck_link/fck_link.js +0 -893
  162. fckeditor/editor/dialog/fck_listprop.html +0 -120
  163. fckeditor/editor/dialog/fck_paste.html +0 -347
  164. fckeditor/editor/dialog/fck_radiobutton.html +0 -104
  165. fckeditor/editor/dialog/fck_replace.html +0 -650
  166. fckeditor/editor/dialog/fck_select.html +0 -180
  167. fckeditor/editor/dialog/fck_select/fck_select.js +0 -194
  168. fckeditor/editor/dialog/fck_smiley.html +0 -111
  169. fckeditor/editor/dialog/fck_source.html +0 -68
  170. fckeditor/editor/dialog/fck_specialchar.html +0 -121
  171. fckeditor/editor/dialog/fck_spellerpages.html +0 -70
  172. fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html +0 -0
  173. fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js +0 -87
  174. fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html +0 -153
  175. fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm +0 -148
  176. fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php +0 -199
  177. fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl +0 -181
  178. fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js +0 -461
  179. fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html +0 -71
  180. fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css +0 -20
css/IE6adminStyle.css ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*Begin Make default admin menu wider*/
2
+ #adminmenu {
3
+ width:145px;
4
+ }
5
+
6
+ #wpbody {
7
+ margin-left:175px;
8
+ }
9
+ /*End Make default admin menu wider*/
fckeditor/_samples/_plugins/findreplace/fckplugin.js DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This is the sample plugin definition file.
22
- */
23
-
24
- // Register the related commands.
25
- FCKCommands.RegisterCommand( 'My_Find' , new FCKDialogCommand( FCKLang['DlgMyFindTitle'] , FCKLang['DlgMyFindTitle'] , FCKConfig.PluginsPath + 'findreplace/find.html' , 340, 170 ) ) ;
26
- FCKCommands.RegisterCommand( 'My_Replace' , new FCKDialogCommand( FCKLang['DlgMyReplaceTitle'], FCKLang['DlgMyReplaceTitle'] , FCKConfig.PluginsPath + 'findreplace/replace.html', 340, 200 ) ) ;
27
-
28
- // Create the "Find" toolbar button.
29
- var oFindItem = new FCKToolbarButton( 'My_Find', FCKLang['DlgMyFindTitle'] ) ;
30
- oFindItem.IconPath = FCKConfig.PluginsPath + 'findreplace/find.gif' ;
31
-
32
- FCKToolbarItems.RegisterItem( 'My_Find', oFindItem ) ; // 'My_Find' is the name used in the Toolbar config.
33
-
34
- // Create the "Replace" toolbar button.
35
- var oReplaceItem = new FCKToolbarButton( 'My_Replace', FCKLang['DlgMyReplaceTitle'] ) ;
36
- oReplaceItem.IconPath = FCKConfig.PluginsPath + 'findreplace/replace.gif' ;
37
-
38
- FCKToolbarItems.RegisterItem( 'My_Replace', oReplaceItem ) ; // 'My_Replace' is the name used in the Toolbar config.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/_plugins/findreplace/find.gif DELETED
Binary file
fckeditor/_samples/_plugins/findreplace/find.html DELETED
@@ -1,172 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * This is the sample "Find" plugin window.
23
- -->
24
- <html>
25
- <head>
26
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
27
- <meta content="noindex, nofollow" name="robots">
28
- <script type="text/javascript">
29
-
30
- var oEditor = window.parent.InnerDialogLoaded() ;
31
-
32
- function OnLoad()
33
- {
34
- // Whole word is available on IE only.
35
- if ( oEditor.FCKBrowserInfo.IsIE )
36
- document.getElementById('divWord').style.display = '' ;
37
-
38
- // First of all, translate the dialog box texts.
39
- oEditor.FCKLanguageManager.TranslatePage( document ) ;
40
-
41
- window.parent.SetAutoSize( true ) ;
42
- }
43
-
44
- function btnStat(frm)
45
- {
46
- document.getElementById('btnFind').disabled =
47
- ( document.getElementById('txtFind').value.length == 0 ) ;
48
- }
49
-
50
- function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll )
51
- {
52
- for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )
53
- {
54
- var oNode = parentNode.childNodes[i] ;
55
- if ( oNode.nodeType == 3 )
56
- {
57
- var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;
58
- if ( oNode.nodeValue != sReplaced )
59
- {
60
- oNode.nodeValue = sReplaced ;
61
- if ( ! replaceAll )
62
- return true ;
63
- }
64
- }
65
- else
66
- {
67
- if ( ReplaceTextNodes( oNode, regex, replaceValue ) )
68
- return true ;
69
- }
70
- }
71
- return false ;
72
- }
73
-
74
- function GetRegexExpr()
75
- {
76
- if ( document.getElementById('chkWord').checked )
77
- var sExpr = '\\b' + document.getElementById('txtFind').value + '\\b' ;
78
- else
79
- var sExpr = document.getElementById('txtFind').value ;
80
-
81
- return sExpr ;
82
- }
83
-
84
- function GetCase()
85
- {
86
- return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;
87
- }
88
-
89
- function Ok()
90
- {
91
- if ( document.getElementById('txtFind').value.length == 0 )
92
- return ;
93
-
94
- if ( oEditor.FCKBrowserInfo.IsIE )
95
- FindIE() ;
96
- else
97
- FindGecko() ;
98
- }
99
-
100
- var oRange = null ;
101
-
102
- function FindIE()
103
- {
104
- if ( oRange == null )
105
- oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
106
-
107
- var iFlags = 0 ;
108
-
109
- if ( chkCase.checked )
110
- iFlags = iFlags | 4 ;
111
-
112
- if ( chkWord.checked )
113
- iFlags = iFlags | 2 ;
114
-
115
- var bFound = oRange.findText( document.getElementById('txtFind').value, 1, iFlags ) ;
116
-
117
- if ( bFound )
118
- {
119
- oRange.scrollIntoView() ;
120
- oRange.select() ;
121
- oRange.collapse(false) ;
122
- oLastRangeFound = oRange ;
123
- }
124
- else
125
- {
126
- oRange = null ;
127
- alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
128
- }
129
- }
130
-
131
- function FindGecko()
132
- {
133
- var bCase = document.getElementById('chkCase').checked ;
134
- var bWord = document.getElementById('chkWord').checked ;
135
-
136
- // window.find( searchString, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog ) ;
137
- oEditor.FCK.EditorWindow.find( document.getElementById('txtFind').value, bCase, false, false, bWord, false, false ) ;
138
-
139
- }
140
- </script>
141
- </head>
142
- <body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
143
- <div align="center">
144
- This is my Plugin!
145
- </div>
146
- <table cellSpacing="3" cellPadding="2" width="100%" border="0">
147
- <tr>
148
- <td nowrap>
149
- <label for="txtFind" fckLang="DlgMyReplaceFindLbl">Find what:</label>&nbsp;
150
- </td>
151
- <td width="100%">
152
- <input id="txtFind" onkeyup="btnStat(this.form)" style="WIDTH: 100%" tabIndex="1" type="text">
153
- </td>
154
- <td>
155
- <input id="btnFind" style="WIDTH: 100%; PADDING-RIGHT: 5px; PADDING-LEFT: 5px" disabled
156
- onclick="Ok();" type="button" value="Find" fckLang="DlgMyFindFindBtn">
157
- </td>
158
- </tr>
159
- <tr>
160
- <td valign="bottom" colSpan="3">
161
- &nbsp;<input id="chkCase" tabIndex="3" type="checkbox"><label for="chkCase" fckLang="DlgMyReplaceCaseChk">Match
162
- case</label>
163
- <br>
164
- <div id="divWord" style="DISPLAY: none">
165
- &nbsp;<input id="chkWord" tabIndex="4" type="checkbox"><label for="chkWord" fckLang="DlgMyReplaceWordChk">Match
166
- whole word</label>
167
- </div>
168
- </td>
169
- </tr>
170
- </table>
171
- </body>
172
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/_plugins/findreplace/lang/en.js DELETED
@@ -1,33 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * English language file for the sample plugin.
22
- */
23
-
24
- FCKLang['DlgMyReplaceTitle'] = 'Plugin - Replace' ;
25
- FCKLang['DlgMyReplaceFindLbl'] = 'Find what:' ;
26
- FCKLang['DlgMyReplaceReplaceLbl'] = 'Replace with:' ;
27
- FCKLang['DlgMyReplaceCaseChk'] = 'Match case' ;
28
- FCKLang['DlgMyReplaceReplaceBtn'] = 'Replace' ;
29
- FCKLang['DlgMyReplaceReplAllBtn'] = 'Replace All' ;
30
- FCKLang['DlgMyReplaceWordChk'] = 'Match whole word' ;
31
-
32
- FCKLang['DlgMyFindTitle'] = 'Plugin - Find' ;
33
- FCKLang['DlgMyFindFindBtn'] = 'Find' ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/_plugins/findreplace/lang/fr.js DELETED
@@ -1,33 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * French language file for the sample plugin.
22
- */
23
-
24
- FCKLang['DlgMyReplaceTitle'] = 'Plugin - Remplacer' ;
25
- FCKLang['DlgMyReplaceFindLbl'] = 'Chercher:' ;
26
- FCKLang['DlgMyReplaceReplaceLbl'] = 'Remplacer par:' ;
27
- FCKLang['DlgMyReplaceCaseChk'] = 'Respecter la casse' ;
28
- FCKLang['DlgMyReplaceReplaceBtn'] = 'Remplacer' ;
29
- FCKLang['DlgMyReplaceReplAllBtn'] = 'Remplacer Tout' ;
30
- FCKLang['DlgMyReplaceWordChk'] = 'Mot entier' ;
31
-
32
- FCKLang['DlgMyFindTitle'] = 'Plugin - Chercher' ;
33
- FCKLang['DlgMyFindFindBtn'] = 'Chercher' ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/_plugins/findreplace/lang/it.js DELETED
@@ -1,33 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Italian language file for the sample plugin.
22
- */
23
-
24
- FCKLang['DlgMyReplaceTitle'] = 'Plugin - Sostituisci' ;
25
- FCKLang['DlgMyReplaceFindLbl'] = 'Trova:' ;
26
- FCKLang['DlgMyReplaceReplaceLbl'] = 'Sostituisci con:' ;
27
- FCKLang['DlgMyReplaceCaseChk'] = 'Maiuscole/minuscole' ;
28
- FCKLang['DlgMyReplaceReplaceBtn'] = 'Sostituisci' ;
29
- FCKLang['DlgMyReplaceReplAllBtn'] = 'Sostituisci tutto' ;
30
- FCKLang['DlgMyReplaceWordChk'] = 'Parola intera' ;
31
-
32
- FCKLang['DlgMyFindTitle'] = 'Plugin - Cerca' ;
33
- FCKLang['DlgMyFindFindBtn'] = 'Cerca' ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/_plugins/findreplace/replace.gif DELETED
Binary file
fckeditor/_samples/_plugins/findreplace/replace.html DELETED
@@ -1,135 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * This is the sample "Replace" plugin window.
23
- -->
24
- <html>
25
- <head>
26
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
27
- <meta content="noindex, nofollow" name="robots">
28
- <script type="text/javascript">
29
-
30
- var oEditor = window.parent.InnerDialogLoaded() ;
31
-
32
- function OnLoad()
33
- {
34
- // First of all, translate the dialog box texts
35
- oEditor.FCKLanguageManager.TranslatePage( document ) ;
36
-
37
- window.parent.SetAutoSize( true ) ;
38
- }
39
-
40
- function btnStat(frm)
41
- {
42
- document.getElementById('btnReplace').disabled =
43
- document.getElementById('btnReplaceAll').disabled =
44
- ( document.getElementById('txtFind').value.length == 0 ) ;
45
- }
46
-
47
- function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll, hasFound )
48
- {
49
- for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )
50
- {
51
- var oNode = parentNode.childNodes[i] ;
52
- if ( oNode.nodeType == 3 )
53
- {
54
- var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;
55
- if ( oNode.nodeValue != sReplaced )
56
- {
57
- oNode.nodeValue = sReplaced ;
58
- if ( ! replaceAll )
59
- return true ;
60
- hasFound = true ;
61
- }
62
- }
63
-
64
- hasFound = ReplaceTextNodes( oNode, regex, replaceValue, replaceAll, hasFound ) ;
65
- if ( ! replaceAll && hasFound )
66
- return true ;
67
- }
68
-
69
- return hasFound ;
70
- }
71
-
72
- function GetRegexExpr()
73
- {
74
- if ( document.getElementById('chkWord').checked )
75
- var sExpr = '\\b' + document.getElementById('txtFind').value + '\\b' ;
76
- else
77
- var sExpr = document.getElementById('txtFind').value ;
78
-
79
- return sExpr ;
80
- }
81
-
82
- function GetCase()
83
- {
84
- return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;
85
- }
86
-
87
- function Replace()
88
- {
89
- var oRegex = new RegExp( GetRegexExpr(), GetCase() ) ;
90
- ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, document.getElementById('txtReplace').value, false ) ;
91
- }
92
-
93
- function ReplaceAll()
94
- {
95
- var oRegex = new RegExp( GetRegexExpr(), GetCase() + 'g' ) ;
96
- ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, document.getElementById('txtReplace').value, true ) ;
97
- window.parent.Cancel() ;
98
- }
99
- </script>
100
- </head>
101
- <body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
102
- <div align="center">
103
- This is my Plugin!
104
- </div>
105
- <table cellSpacing="3" cellPadding="2" width="100%" border="0">
106
- <tr>
107
- <td noWrap><label for="txtFind" fckLang="DlgMyReplaceFindLbl">Find what:</label>
108
- </td>
109
- <td width="100%"><input id="txtFind" onkeyup="btnStat(this.form)" style="WIDTH: 100%" tabIndex="1" type="text">
110
- </td>
111
- <td><input id="btnReplace" style="WIDTH: 100%" disabled onclick="Replace();" type="button"
112
- value="Replace" fckLang="DlgMyReplaceReplaceBtn">
113
- </td>
114
- </tr>
115
- <tr>
116
- <td vAlign="top" nowrap><label for="txtReplace" fckLang="DlgMyReplaceReplaceLbl">Replace
117
- with:</label>
118
- </td>
119
- <td vAlign="top"><input id="txtReplace" style="WIDTH: 100%" tabIndex="2" type="text">
120
- </td>
121
- <td><input id="btnReplaceAll" disabled onclick="ReplaceAll()" type="button" value="Replace All"
122
- fckLang="DlgMyReplaceReplAllBtn">
123
- </td>
124
- </tr>
125
- <tr>
126
- <td vAlign="bottom" colSpan="3">&nbsp;<input id="chkCase" tabIndex="3" type="checkbox"><label for="chkCase" fckLang="DlgMyReplaceCaseChk">Match
127
- case</label>
128
- <br>
129
- &nbsp;<input id="chkWord" tabIndex="4" type="checkbox"><label for="chkWord" fckLang="DlgMyReplaceWordChk">Match
130
- whole word</label>
131
- </td>
132
- </tr>
133
- </table>
134
- </body>
135
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/_plugins/samples/fckplugin.js DELETED
@@ -1,73 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This is a sample plugin definition file.
22
- */
23
-
24
- // Here we define our custom Style combo, with custom widths.
25
- var oMyBigStyleCombo = new FCKToolbarStyleCombo() ;
26
- oMyBigStyleCombo.FieldWidth = 250 ;
27
- oMyBigStyleCombo.PanelWidth = 300 ;
28
- FCKToolbarItems.RegisterItem( 'My_BigStyle', oMyBigStyleCombo ) ;
29
-
30
-
31
- // ##### Defining a custom context menu entry.
32
-
33
- // ## 1. Define the command to be executed when selecting the context menu item.
34
- var oMyCMCommand = new Object() ;
35
- oMyCMCommand.Name = 'OpenImage' ;
36
-
37
- // This is the standard function used to execute the command (called when clicking in the context menu item).
38
- oMyCMCommand.Execute = function()
39
- {
40
- // This command is called only when an image element is selected (IMG).
41
- // Get image URL (src).
42
- var sUrl = FCKSelection.GetSelectedElement().src ;
43
-
44
- // Open the URL in a new window.
45
- window.top.open( sUrl ) ;
46
- }
47
-
48
- // This is the standard function used to retrieve the command state (it could be disabled for some reason).
49
- oMyCMCommand.GetState = function()
50
- {
51
- // Let's make it always enabled.
52
- return FCK_TRISTATE_OFF ;
53
- }
54
-
55
- // ## 2. Register our custom command.
56
- FCKCommands.RegisterCommand( 'OpenImage', oMyCMCommand ) ;
57
-
58
- // ## 3. Define the context menu "listener".
59
- var oMyContextMenuListener = new Object() ;
60
-
61
- // This is the standard function called right before sowing the context menu.
62
- oMyContextMenuListener.AddItems = function( contextMenu, tag, tagName )
63
- {
64
- // Let's show our custom option only for images.
65
- if ( tagName == 'IMG' )
66
- {
67
- contextMenu.AddSeparator() ;
68
- contextMenu.AddItem( 'OpenImage', 'Open image in a new window (Custom)' ) ;
69
- }
70
- }
71
-
72
- // ## 4. Register our context menu listener.
73
- FCK.ContextMenu.RegisterListener( oMyContextMenuListener ) ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/default.html DELETED
@@ -1,35 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
2
- "http://www.w3.org/TR/html4/frameset.dtd">
3
- <!--
4
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
5
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
6
- *
7
- * == BEGIN LICENSE ==
8
- *
9
- * Licensed under the terms of any of the following licenses at your
10
- * choice:
11
- *
12
- * - GNU General Public License Version 2 or later (the "GPL")
13
- * http://www.gnu.org/licenses/gpl.html
14
- *
15
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
16
- * http://www.gnu.org/licenses/lgpl.html
17
- *
18
- * - Mozilla Public License Version 1.1 or later (the "MPL")
19
- * http://www.mozilla.org/MPL/MPL-1.1.html
20
- *
21
- * == END LICENSE ==
22
- *
23
- * Samples Frameset page.
24
- -->
25
- <html>
26
- <head>
27
- <title>FCKeditor - Samples</title>
28
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
29
- <meta name="robots" content="noindex, nofollow">
30
- </head>
31
- <frameset rows="60,*">
32
- <frame src="sampleslist.html" noresize scrolling="no">
33
- <frame name="Sample" src="html/sample01.html" noresize>
34
- </frameset>
35
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/php/sample01.php DELETED
@@ -1,57 +0,0 @@
1
- <?php
2
- /*
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Sample page.
23
- */
24
-
25
- include("../../fckeditor.php") ;
26
- ?>
27
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
28
- <html>
29
- <head>
30
- <title>FCKeditor - Sample</title>
31
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
32
- <meta name="robots" content="noindex, nofollow">
33
- <link href="../sample.css" rel="stylesheet" type="text/css" />
34
- </head>
35
- <body>
36
- <h1>FCKeditor - PHP - Sample 1</h1>
37
- This sample displays a normal HTML form with an FCKeditor with full features
38
- enabled.
39
- <hr>
40
- <form action="sampleposteddata.php" method="post" target="_blank">
41
- <?php
42
- // Automatically calculates the editor base path based on the _samples directory.
43
- // This is usefull only for these samples. A real application should use something like this:
44
- // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
45
- $sBasePath = $_SERVER['PHP_SELF'] ;
46
- $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
47
-
48
- $oFCKeditor = new FCKeditor('FCKeditor1') ;
49
- $oFCKeditor->BasePath = $sBasePath ;
50
- $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
51
- $oFCKeditor->Create() ;
52
- ?>
53
- <br>
54
- <input type="submit" value="Submit">
55
- </form>
56
- </body>
57
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/php/sample02.php DELETED
@@ -1,108 +0,0 @@
1
- <?php
2
- /*
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Sample page.
23
- */
24
-
25
- include("../../fckeditor.php") ;
26
- ?>
27
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
28
- <html>
29
- <head>
30
- <title>FCKeditor - Sample</title>
31
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
32
- <meta name="robots" content="noindex, nofollow">
33
- <link href="../sample.css" rel="stylesheet" type="text/css" />
34
- <script type="text/javascript">
35
-
36
- function FCKeditor_OnComplete( editorInstance )
37
- {
38
- var oCombo = document.getElementById( 'cmbLanguages' ) ;
39
- for ( code in editorInstance.Language.AvailableLanguages )
40
- {
41
- AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
42
- }
43
- oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
44
- }
45
-
46
- function AddComboOption(combo, optionText, optionValue)
47
- {
48
- var oOption = document.createElement("OPTION") ;
49
-
50
- combo.options.add(oOption) ;
51
-
52
- oOption.innerHTML = optionText ;
53
- oOption.value = optionValue ;
54
-
55
- return oOption ;
56
- }
57
-
58
- function ChangeLanguage( languageCode )
59
- {
60
- window.location.href = window.location.pathname + "?Lang=" + languageCode ;
61
- }
62
- </script>
63
- </head>
64
- <body>
65
- <h1>FCKeditor - PHP - Sample 2</h1>
66
- This sample shows the editor in all its available languages.
67
- <hr>
68
- <table cellpadding="0" cellspacing="0" border="0">
69
- <tr>
70
- <td>
71
- Select a language:&nbsp;
72
- </td>
73
- <td>
74
- <select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
75
- </select>
76
- </td>
77
- </tr>
78
- </table>
79
- <br>
80
- <form action="sampleposteddata.php" method="post" target="_blank">
81
- <?php
82
- // Automatically calculates the editor base path based on the _samples directory.
83
- // This is usefull only for these samples. A real application should use something like this:
84
- // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
85
- $sBasePath = $_SERVER['PHP_SELF'] ;
86
- $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
87
-
88
- $oFCKeditor = new FCKeditor('FCKeditor1') ;
89
- $oFCKeditor->BasePath = $sBasePath ;
90
-
91
- if ( isset($_GET['Lang']) )
92
- {
93
- $oFCKeditor->Config['AutoDetectLanguage'] = false ;
94
- $oFCKeditor->Config['DefaultLanguage'] = $_GET['Lang'] ;
95
- }
96
- else
97
- {
98
- $oFCKeditor->Config['AutoDetectLanguage'] = true ;
99
- $oFCKeditor->Config['DefaultLanguage'] = 'en' ;
100
- }
101
-
102
- $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
103
- $oFCKeditor->Create() ;
104
- ?> <br>
105
- <input type="submit" value="Submit">
106
- </form>
107
- </body>
108
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/php/sample03.php DELETED
@@ -1,89 +0,0 @@
1
- <?php
2
- /*
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Sample page.
23
- */
24
-
25
- include("../../fckeditor.php") ;
26
- ?>
27
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
28
- <html>
29
- <head>
30
- <title>FCKeditor - Sample</title>
31
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
32
- <meta name="robots" content="noindex, nofollow">
33
- <link href="../sample.css" rel="stylesheet" type="text/css" />
34
- <script type="text/javascript">
35
-
36
- function FCKeditor_OnComplete( editorInstance )
37
- {
38
- var oCombo = document.getElementById( 'cmbToolbars' ) ;
39
- oCombo.value = editorInstance.ToolbarSet.Name ;
40
- oCombo.style.visibility = '' ;
41
- }
42
-
43
- function ChangeToolbar( toolbarName )
44
- {
45
- window.location.href = window.location.pathname + "?Toolbar=" + toolbarName ;
46
- }
47
-
48
- </script>
49
- </head>
50
- <body>
51
- <h1>FCKeditor - PHP - Sample 3</h1>
52
- This sample shows how to change the editor toolbar.
53
- <hr>
54
- <table cellpadding="0" cellspacing="0" border="0">
55
- <tr>
56
- <td>
57
- Select the toolbar to load:&nbsp;
58
- </td>
59
- <td>
60
- <select id="cmbToolbars" onchange="ChangeToolbar(this.value);" style="VISIBILITY: hidden">
61
- <option value="Default" selected>Default</option>
62
- <option value="Basic">Basic</option>
63
- </select>
64
- </td>
65
- </tr>
66
- </table>
67
- <br>
68
- <form action="sampleposteddata.php" method="post" target="_blank">
69
- <?php
70
- // Automatically calculates the editor base path based on the _samples directory.
71
- // This is usefull only for these samples. A real application should use something like this:
72
- // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
73
- $sBasePath = $_SERVER['PHP_SELF'] ;
74
- $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
75
-
76
- $oFCKeditor = new FCKeditor('FCKeditor1') ;
77
- $oFCKeditor->BasePath = $sBasePath ;
78
-
79
- if ( isset($_GET['Toolbar']) )
80
- $oFCKeditor->ToolbarSet = htmlspecialchars($_GET['Toolbar']);
81
-
82
- $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
83
- $oFCKeditor->Create() ;
84
- ?>
85
- <br>
86
- <input type="submit" value="Submit">
87
- </form>
88
- </body>
89
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/php/sample04.php DELETED
@@ -1,95 +0,0 @@
1
- <?php
2
- /*
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Sample page.
23
- */
24
-
25
- include("../../fckeditor.php") ;
26
- ?>
27
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
28
- <html>
29
- <head>
30
- <title>FCKeditor - Sample</title>
31
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
32
- <meta name="robots" content="noindex, nofollow">
33
- <link href="../sample.css" rel="stylesheet" type="text/css" />
34
- <script type="text/javascript">
35
-
36
- function FCKeditor_OnComplete( editorInstance )
37
- {
38
- var oCombo = document.getElementById( 'cmbSkins' ) ;
39
-
40
- // Get the active skin.
41
- var sSkin = editorInstance.Config['SkinPath'] ;
42
- sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
43
-
44
- oCombo.value = sSkin ;
45
- oCombo.style.visibility = '' ;
46
- }
47
-
48
- function ChangeSkin( skinName )
49
- {
50
- window.location.href = window.location.pathname + "?Skin=" + skinName ;
51
- }
52
-
53
- </script>
54
- </head>
55
- <body>
56
- <h1>FCKeditor - PHP - Sample 4</h1>
57
- This sample shows how to change the editor skin.
58
- <hr>
59
- <table cellpadding="0" cellspacing="0" border="0">
60
- <tr>
61
- <td>
62
- Select the skin to load:&nbsp;
63
- </td>
64
- <td>
65
- <select id="cmbSkins" onchange="ChangeSkin(this.value);" style="VISIBILITY: hidden">
66
- <option value="default" selected>Default</option>
67
- <option value="office2003">Office 2003</option>
68
- <option value="silver">Silver</option>
69
- </select>
70
- </td>
71
- </tr>
72
- </table>
73
- <br>
74
- <form action="sampleposteddata.php" method="post" target="_blank">
75
- <?php
76
- // Automatically calculates the editor base path based on the _samples directory.
77
- // This is usefull only for these samples. A real application should use something like this:
78
- // $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
79
- $sBasePath = $_SERVER['PHP_SELF'] ;
80
- $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
81
-
82
- $oFCKeditor = new FCKeditor('FCKeditor1') ;
83
- $oFCKeditor->BasePath = $sBasePath ;
84
-
85
- if ( isset($_GET['Skin']) )
86
- $oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/' . htmlspecialchars($_GET['Skin']) . '/' ;
87
-
88
- $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
89
- $oFCKeditor->Create() ;
90
- ?>
91
- <br>
92
- <input type="submit" value="Submit">
93
- </form>
94
- </body>
95
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/php/sampleposteddata.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
- /*
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * This page lists the data posted by a form.
23
- */
24
- ?>
25
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
26
- <html>
27
- <head>
28
- <title>FCKeditor - Samples - Posted Data</title>
29
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
30
- <meta name="robots" content="noindex, nofollow">
31
- <link href="../sample.css" rel="stylesheet" type="text/css" >
32
- </head>
33
- <body>
34
- <h1>FCKeditor - Samples - Posted Data</h1>
35
- This page lists all data posted by the form.
36
- <hr>
37
- <table border="1" cellspacing="0" id="outputSample">
38
- <colgroup><col width="80"><col></colgroup>
39
- <thead>
40
- <tr>
41
- <th>Field Name</th>
42
- <th>Value</th>
43
- </tr>
44
- </thead>
45
- <?php
46
-
47
- if ( isset( $_POST ) )
48
- $postArray = &$_POST ; // 4.1.0 or later, use $_POST
49
- else
50
- $postArray = &$HTTP_POST_VARS ; // prior to 4.1.0, use HTTP_POST_VARS
51
-
52
- foreach ( $postArray as $sForm => $value )
53
- {
54
- if ( get_magic_quotes_gpc() )
55
- $postedValue = htmlspecialchars( stripslashes( $value ) ) ;
56
- else
57
- $postedValue = htmlspecialchars( $value ) ;
58
-
59
- ?>
60
- <tr>
61
- <th><?php echo $sForm?></th>
62
- <td><pre><?php echo $postedValue?></pre></td>
63
- </tr>
64
- <?php
65
- }
66
- ?>
67
- </table>
68
- </body>
69
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/sample.css DELETED
@@ -1,74 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Styles used in the samples pages.
22
- */
23
-
24
- body, td, th, input, select, textarea
25
- {
26
- font-size: 12px;
27
- font-family: Arial, Verdana, Sans-Serif;
28
- }
29
-
30
- h1
31
- {
32
- font-weight: bold;
33
- font-size: 180%;
34
- margin-bottom: 10px;
35
- }
36
-
37
- form
38
- {
39
- margin: 0;
40
- padding: 0;
41
- }
42
-
43
- #outputSample
44
- {
45
- table-layout: fixed;
46
- width: 100%;
47
- }
48
-
49
- pre
50
- {
51
- margin: 0;
52
- padding: 0;
53
-
54
- white-space: pre; /* CSS2 */
55
- white-space: -moz-pre-wrap; /* Mozilla*/
56
- white-space: -o-pre-wrap; /* Opera 7 */
57
- white-space: pre-wrap; /* CSS 2.1 */
58
- white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
59
- word-wrap: break-word; /* IE */
60
- }
61
-
62
- #outputSample thead th
63
- {
64
- color: #dddddd;
65
- background-color: #999999;
66
- padding: 4px;
67
- white-space: nowrap;
68
- }
69
-
70
- #outputSample tbody th
71
- {
72
- vertical-align: top;
73
- text-align: left;
74
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/_samples/sampleslist.html DELETED
@@ -1,120 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
- "http://www.w3.org/TR/html4/strict.dtd">
3
- <!--
4
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
5
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
6
- *
7
- * == BEGIN LICENSE ==
8
- *
9
- * Licensed under the terms of any of the following licenses at your
10
- * choice:
11
- *
12
- * - GNU General Public License Version 2 or later (the "GPL")
13
- * http://www.gnu.org/licenses/gpl.html
14
- *
15
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
16
- * http://www.gnu.org/licenses/lgpl.html
17
- *
18
- * - Mozilla Public License Version 1.1 or later (the "MPL")
19
- * http://www.mozilla.org/MPL/MPL-1.1.html
20
- *
21
- * == END LICENSE ==
22
- *
23
- * Page used to select the sample to view.
24
- -->
25
- <html>
26
- <head>
27
- <title>FCKeditor - Sample Selection</title>
28
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
29
- <meta name="robots" content="noindex, nofollow">
30
- <link href="sample.css" rel="stylesheet" type="text/css">
31
- <script type="text/javascript">
32
-
33
- if ( window.top == window )
34
- document.location = 'default.html' ;
35
-
36
- function OpenSample( sample )
37
- {
38
- if ( sample.length > 0 )
39
- window.open( sample, 'Sample' ) ;
40
- }
41
-
42
- </script>
43
- </head>
44
- <body style="margin:1em;">
45
- <table border="0" cellpadding="0" cellspacing="0" style="height: 100%">
46
- <tr>
47
- <td>
48
- Please select the sample you want to view:
49
- <br />
50
- <select onchange="OpenSample(this.value);">
51
- <optgroup label="JavaScript">
52
- <option value="html/sample01.html" selected="selected">JavaScript : Sample 01 : Editor
53
- with all features</option>
54
- <option value="html/sample02.html">JavaScript : Sample 02 : Replacement of a TEXTAREA</option>
55
- <option value="html/sample03.html">JavaScript : Sample 03 : Multi-language support</option>
56
- <option value="html/sample04.html">JavaScript : Sample 04 : Toolbar selection</option>
57
- <option value="html/sample05.html">JavaScript : Sample 05 : Skins support</option>
58
- <option value="html/sample06.html">JavaScript : Sample 06 : Plugins support</option>
59
- <option value="html/sample07.html">JavaScript : Sample 07 : Full Page editing</option>
60
- <option value="html/sample08.html">JavaScript : Sample 08 : Editor API usage</option>
61
- <option value="html/sample09.html">JavaScript : Sample 09 : Complex form (multiple editors)</option>
62
- <option value="html/sample10.html">JavaScript : Sample 10 : Shared toolbar on same page</option>
63
- <option value="html/sample11.html">JavaScript : Sample 11 : Shared toolbar from IFRAME</option>
64
- <option value="html/sample12.html">JavaScript : Sample 12 : Enter key behavior</option>
65
- <option value="html/sample13.html">JavaScript : Sample 13 : Dinamically switching with a Textarea</option>
66
- <option value="html/sample14.html">JavaScript : Sample 14 : XHTML 1.1</option>
67
- <option value="html/sample15.html">JavaScript : Sample 15 : Legacy HTML 4 tags</option>
68
- <option value="html/sample16.html">JavaScript : Sample 16 : Flash content editor</option>
69
- <option value=""></option>
70
- </optgroup>
71
- <optgroup label="Active Fox Pro">
72
- <option value="afp/sample01.afp">AFP : Sample 01 : Editor with all features</option>
73
- <option value="afp/sample02.afp">AFP : Sample 02 : Multi-language support</option>
74
- <option value="afp/sample03.afp">AFP : Sample 03 : Toolbar selection</option>
75
- <option value="afp/sample04.afp">AFP : Sample 04 : Skins support</option>
76
- <option value=""></option>
77
- </optgroup>
78
- <optgroup label="ASP">
79
- <option value="asp/sample01.asp">ASP : Sample 01 : Editor with all features</option>
80
- <option value="asp/sample02.asp">ASP : Sample 02 : Multi-language support</option>
81
- <option value="asp/sample03.asp">ASP : Sample 03 : Toolbar selection</option>
82
- <option value="asp/sample04.asp">ASP : Sample 04 : Skins support</option>
83
- <option value=""></option>
84
- </optgroup>
85
- <optgroup label="ColdFusion">
86
- <option value="cfm/sample01.cfm">ColdFusion : Sample 01 : Editor with all features</option>
87
- <option value="cfm/sample02_mx.cfm">ColdFusion : Sample 02 : Advanced version for ColdFusion
88
- MX</option>
89
- <option value=""></option>
90
- </optgroup>
91
- <optgroup label="Lasso">
92
- <option value="lasso/sample01.lasso">Lasso : Sample 01 : Editor with all features</option>
93
- <option value="lasso/sample02.lasso">Lasso : Sample 02 : Multi-language support</option>
94
- <option value="lasso/sample03.lasso">Lasso : Sample 03 : Toolbar selection</option>
95
- <option value="lasso/sample04.lasso">Lasso : Sample 04 : Skins support</option>
96
- <option value=""></option>
97
- </optgroup>
98
- <optgroup label="Perl">
99
- <option value="perl/sample01.cgi">Perl : Sample 01 : Editor with all features</option>
100
- <option value="perl/sample02.cgi">Perl : Sample 02 : Multi-language support</option>
101
- <option value="perl/sample03.cgi">Perl : Sample 03 : Toolbar selection</option>
102
- <option value="perl/sample04.cgi">Perl : Sample 04 : Skins support</option>
103
- <option value=""></option>
104
- </optgroup>
105
- <optgroup label="PHP">
106
- <option value="php/sample01.php">PHP : Sample 01 : Editor with all features</option>
107
- <option value="php/sample02.php">PHP : Sample 02 : Multi-language support</option>
108
- <option value="php/sample03.php">PHP : Sample 03 : Toolbar selection</option>
109
- <option value="php/sample04.php">PHP : Sample 04 : Skins support</option>
110
- <option value=""></option>
111
- </optgroup>
112
- <optgroup label="Python">
113
- <option value="py/sample01.py">Python : Sample 01 : Editor with all features</option>
114
- </optgroup>
115
- </select>
116
- </td>
117
- </tr>
118
- </table>
119
- </body>
120
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckcontextmenu.js DELETED
@@ -1,223 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKContextMenu Class: renders an control a context menu.
22
- */
23
-
24
- var FCKContextMenu = function( parentWindow, langDir )
25
- {
26
- this.CtrlDisable = false ;
27
-
28
- var oPanel = this._Panel = new FCKPanel( parentWindow ) ;
29
- oPanel.AppendStyleSheet( FCKConfig.SkinEditorCSS ) ;
30
- oPanel.IsContextMenu = true ;
31
-
32
- // The FCKTools.DisableSelection doesn't seems to work to avoid dragging of the icons in Mozilla
33
- // so we stop the start of the dragging
34
- if ( FCKBrowserInfo.IsGecko )
35
- oPanel.Document.addEventListener( 'draggesture', function(e) {e.preventDefault(); return false;}, true ) ;
36
-
37
- var oMenuBlock = this._MenuBlock = new FCKMenuBlock() ;
38
- oMenuBlock.Panel = oPanel ;
39
- oMenuBlock.OnClick = FCKTools.CreateEventListener( FCKContextMenu_MenuBlock_OnClick, this ) ;
40
-
41
- this._Redraw = true ;
42
- }
43
-
44
-
45
- FCKContextMenu.prototype.SetMouseClickWindow = function( mouseClickWindow )
46
- {
47
- if ( !FCKBrowserInfo.IsIE )
48
- {
49
- this._Document = mouseClickWindow.document ;
50
- if ( FCKBrowserInfo.IsOpera && !( 'oncontextmenu' in document.createElement('foo') ) )
51
- {
52
- this._Document.addEventListener( 'mousedown', FCKContextMenu_Document_OnMouseDown, false ) ;
53
- this._Document.addEventListener( 'mouseup', FCKContextMenu_Document_OnMouseUp, false ) ;
54
- }
55
- this._Document.addEventListener( 'contextmenu', FCKContextMenu_Document_OnContextMenu, false ) ;
56
- }
57
- }
58
-
59
- /**
60
- The customData parameter is just a value that will be send to the command that is executed,
61
- so it's possible to reuse the same command for several items just by assigning different data for each one.
62
- */
63
- FCKContextMenu.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData )
64
- {
65
- var oItem = this._MenuBlock.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) ;
66
- this._Redraw = true ;
67
- return oItem ;
68
- }
69
-
70
- FCKContextMenu.prototype.AddSeparator = function()
71
- {
72
- this._MenuBlock.AddSeparator() ;
73
- this._Redraw = true ;
74
- }
75
-
76
- FCKContextMenu.prototype.RemoveAllItems = function()
77
- {
78
- this._MenuBlock.RemoveAllItems() ;
79
- this._Redraw = true ;
80
- }
81
-
82
- FCKContextMenu.prototype.AttachToElement = function( element )
83
- {
84
- if ( FCKBrowserInfo.IsIE )
85
- FCKTools.AddEventListenerEx( element, 'contextmenu', FCKContextMenu_AttachedElement_OnContextMenu, this ) ;
86
- else
87
- element._FCKContextMenu = this ;
88
- }
89
-
90
- function FCKContextMenu_Document_OnContextMenu( e )
91
- {
92
- if ( FCKConfig.BrowserContextMenu )
93
- return true ;
94
-
95
- var el = e.target ;
96
-
97
- while ( el )
98
- {
99
- if ( el._FCKContextMenu )
100
- {
101
- if ( el._FCKContextMenu.CtrlDisable && ( e.ctrlKey || e.metaKey ) )
102
- return true ;
103
-
104
- FCKTools.CancelEvent( e ) ;
105
- FCKContextMenu_AttachedElement_OnContextMenu( e, el._FCKContextMenu, el ) ;
106
- return false ;
107
- }
108
- el = el.parentNode ;
109
- }
110
- return true ;
111
- }
112
-
113
- var FCKContextMenu_OverrideButton ;
114
-
115
- function FCKContextMenu_Document_OnMouseDown( e )
116
- {
117
- if( !e || e.button != 2 )
118
- return false ;
119
-
120
- if ( FCKConfig.BrowserContextMenu )
121
- return true ;
122
-
123
- var el = e.target ;
124
-
125
- while ( el )
126
- {
127
- if ( el._FCKContextMenu )
128
- {
129
- if ( el._FCKContextMenu.CtrlDisable && ( e.ctrlKey || e.metaKey ) )
130
- return true ;
131
-
132
- var overrideButton = FCKContextMenu_OverrideButton ;
133
- if( !overrideButton )
134
- {
135
- var doc = FCKTools.GetElementDocument( e.target ) ;
136
- overrideButton = FCKContextMenu_OverrideButton = doc.createElement('input') ;
137
- overrideButton.type = 'button' ;
138
- var buttonHolder = doc.createElement('p') ;
139
- doc.body.appendChild( buttonHolder ) ;
140
- buttonHolder.appendChild( overrideButton ) ;
141
- }
142
-
143
- overrideButton.style.cssText = 'position:absolute;top:' + ( e.clientY - 2 ) +
144
- 'px;left:' + ( e.clientX - 2 ) +
145
- 'px;width:5px;height:5px;opacity:0.01' ;
146
- }
147
- el = el.parentNode ;
148
- }
149
- return false ;
150
- }
151
-
152
- function FCKContextMenu_Document_OnMouseUp( e )
153
- {
154
- if ( FCKConfig.BrowserContextMenu )
155
- return true ;
156
-
157
- var overrideButton = FCKContextMenu_OverrideButton ;
158
-
159
- if ( overrideButton )
160
- {
161
- var parent = overrideButton.parentNode ;
162
- parent.parentNode.removeChild( parent ) ;
163
- FCKContextMenu_OverrideButton = undefined ;
164
-
165
- if( e && e.button == 2 )
166
- {
167
- FCKContextMenu_Document_OnContextMenu( e ) ;
168
- return false ;
169
- }
170
- }
171
- return true ;
172
- }
173
-
174
- function FCKContextMenu_AttachedElement_OnContextMenu( ev, fckContextMenu, el )
175
- {
176
- if ( ( fckContextMenu.CtrlDisable && ( ev.ctrlKey || ev.metaKey ) ) || FCKConfig.BrowserContextMenu )
177
- return true ;
178
-
179
- var eTarget = el || this ;
180
-
181
- if ( fckContextMenu.OnBeforeOpen )
182
- fckContextMenu.OnBeforeOpen.call( fckContextMenu, eTarget ) ;
183
-
184
- if ( fckContextMenu._MenuBlock.Count() == 0 )
185
- return false ;
186
-
187
- if ( fckContextMenu._Redraw )
188
- {
189
- fckContextMenu._MenuBlock.Create( fckContextMenu._Panel.MainNode ) ;
190
- fckContextMenu._Redraw = false ;
191
- }
192
-
193
- // This will avoid that the content of the context menu can be dragged in IE
194
- // as the content of the panel is recreated we need to do it every time
195
- FCKTools.DisableSelection( fckContextMenu._Panel.Document.body ) ;
196
-
197
- var x = 0 ;
198
- var y = 0 ;
199
- if ( FCKBrowserInfo.IsIE )
200
- {
201
- x = ev.screenX ;
202
- y = ev.screenY ;
203
- }
204
- else if ( FCKBrowserInfo.IsSafari )
205
- {
206
- x = ev.clientX ;
207
- y = ev.clientY ;
208
- }
209
- else
210
- {
211
- x = ev.pageX ;
212
- y = ev.pageY ;
213
- }
214
- fckContextMenu._Panel.Show( x, y, ev.currentTarget || null ) ;
215
-
216
- return false ;
217
- }
218
-
219
- function FCKContextMenu_MenuBlock_OnClick( menuItem, contextMenu )
220
- {
221
- contextMenu._Panel.Hide() ;
222
- FCKTools.RunFunction( contextMenu.OnItemClick, contextMenu, menuItem ) ;
223
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckdataprocessor.js DELETED
@@ -1,119 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * The Data Processor is responsible for transforming the input and output data
22
- * in the editor. For more info:
23
- * http://dev.fckeditor.net/wiki/Components/DataProcessor
24
- *
25
- * The default implementation offers the base XHTML compatibility features of
26
- * FCKeditor. Further Data Processors may be implemented for other purposes.
27
- *
28
- */
29
-
30
- var FCKDataProcessor = function()
31
- {}
32
-
33
- FCKDataProcessor.prototype =
34
- {
35
- /*
36
- * Returns a string representing the HTML format of "data". The returned
37
- * value will be loaded in the editor.
38
- * The HTML must be from <html> to </html>, including <head>, <body> and
39
- * eventually the DOCTYPE.
40
- * Note: HTML comments may already be part of the data because of the
41
- * pre-processing made with ProtectedSource.
42
- * @param {String} data The data to be converted in the
43
- * DataProcessor specific format.
44
- */
45
- ConvertToHtml : function( data )
46
- {
47
- // The default data processor must handle two different cases depending
48
- // on the FullPage setting. Custom Data Processors will not be
49
- // compatible with FullPage, much probably.
50
- if ( FCKConfig.FullPage )
51
- {
52
- // Save the DOCTYPE.
53
- FCK.DocTypeDeclaration = data.match( FCKRegexLib.DocTypeTag ) ;
54
-
55
- // Check if the <body> tag is available.
56
- if ( !FCKRegexLib.HasBodyTag.test( data ) )
57
- data = '<body>' + data + '</body>' ;
58
-
59
- // Check if the <html> tag is available.
60
- if ( !FCKRegexLib.HtmlOpener.test( data ) )
61
- data = '<html dir="' + FCKConfig.ContentLangDirection + '">' + data + '</html>' ;
62
-
63
- // Check if the <head> tag is available.
64
- if ( !FCKRegexLib.HeadOpener.test( data ) )
65
- data = data.replace( FCKRegexLib.HtmlOpener, '$&<head><title></title></head>' ) ;
66
-
67
- return data ;
68
- }
69
- else
70
- {
71
- var html =
72
- FCKConfig.DocType +
73
- '<html dir="' + FCKConfig.ContentLangDirection + '"' ;
74
-
75
- // On IE, if you are using a DOCTYPE different of HTML 4 (like
76
- // XHTML), you must force the vertical scroll to show, otherwise
77
- // the horizontal one may appear when the page needs vertical scrolling.
78
- // TODO : Check it with IE7 and make it IE6- if it is the case.
79
- if ( FCKBrowserInfo.IsIE && FCKConfig.DocType.length > 0 && !FCKRegexLib.Html4DocType.test( FCKConfig.DocType ) )
80
- html += ' style="overflow-y: scroll"' ;
81
-
82
- html += '><head><title></title></head>' +
83
- '<body' + FCKConfig.GetBodyAttributes() + '>' +
84
- data +
85
- '</body></html>' ;
86
-
87
- return html ;
88
- }
89
- },
90
-
91
- /*
92
- * Converts a DOM (sub-)tree to a string in the data format.
93
- * @param {Object} rootNode The node that contains the DOM tree to be
94
- * converted to the data format.
95
- * @param {Boolean} excludeRoot Indicates that the root node must not
96
- * be included in the conversion, only its children.
97
- * @param {Boolean} format Indicates that the data must be formatted
98
- * for human reading. Not all Data Processors may provide it.
99
- */
100
- ConvertToDataFormat : function( rootNode, excludeRoot, ignoreIfEmptyParagraph, format )
101
- {
102
- var data = FCKXHtml.GetXHTML( rootNode, !excludeRoot, format ) ;
103
-
104
- if ( ignoreIfEmptyParagraph && FCKRegexLib.EmptyOutParagraph.test( data ) )
105
- return '' ;
106
-
107
- return data ;
108
- },
109
-
110
- /*
111
- * Makes any necessary changes to a piece of HTML for insertion in the
112
- * editor selection position.
113
- * @param {String} html The HTML to be fixed.
114
- */
115
- FixHtml : function( html )
116
- {
117
- return html ;
118
- }
119
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckdocumentfragment_gecko.js DELETED
@@ -1,53 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This is a generic Document Fragment object. It is not intended to provide
22
- * the W3C implementation, but is a way to fix the missing of a real Document
23
- * Fragment in IE (where document.createDocumentFragment() returns a normal
24
- * document instead), giving a standard interface for it.
25
- * (IE Implementation)
26
- */
27
-
28
- var FCKDocumentFragment = function( parentDocument, baseDocFrag )
29
- {
30
- this.RootNode = baseDocFrag || parentDocument.createDocumentFragment() ;
31
- }
32
-
33
- FCKDocumentFragment.prototype =
34
- {
35
-
36
- // Append the contents of this Document Fragment to another element.
37
- AppendTo : function( targetNode )
38
- {
39
- targetNode.appendChild( this.RootNode ) ;
40
- },
41
-
42
- AppendHtml : function( html )
43
- {
44
- var eTmpDiv = this.RootNode.ownerDocument.createElement( 'div' ) ;
45
- eTmpDiv.innerHTML = html ;
46
- FCKDomTools.MoveChildren( eTmpDiv, this.RootNode ) ;
47
- },
48
-
49
- InsertAfterNode : function( existingNode )
50
- {
51
- FCKDomTools.InsertAfterNode( existingNode, this.RootNode ) ;
52
- }
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckdocumentfragment_ie.js DELETED
@@ -1,58 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This is a generic Document Fragment object. It is not intended to provide
22
- * the W3C implementation, but is a way to fix the missing of a real Document
23
- * Fragment in IE (where document.createDocumentFragment() returns a normal
24
- * document instead), giving a standard interface for it.
25
- * (IE Implementation)
26
- */
27
-
28
- var FCKDocumentFragment = function( parentDocument )
29
- {
30
- this._Document = parentDocument ;
31
- this.RootNode = parentDocument.createElement( 'div' ) ;
32
- }
33
-
34
- // Append the contents of this Document Fragment to another node.
35
- FCKDocumentFragment.prototype =
36
- {
37
-
38
- AppendTo : function( targetNode )
39
- {
40
- FCKDomTools.MoveChildren( this.RootNode, targetNode ) ;
41
- },
42
-
43
- AppendHtml : function( html )
44
- {
45
- var eTmpDiv = this._Document.createElement( 'div' ) ;
46
- eTmpDiv.innerHTML = html ;
47
- FCKDomTools.MoveChildren( eTmpDiv, this.RootNode ) ;
48
- },
49
-
50
- InsertAfterNode : function( existingNode )
51
- {
52
- var eRoot = this.RootNode ;
53
- var eLast ;
54
-
55
- while( ( eLast = eRoot.lastChild ) )
56
- FCKDomTools.InsertAfterNode( existingNode, eRoot.removeChild( eLast ) ) ;
57
- }
58
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckdomrange.js DELETED
@@ -1,935 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Class for working with a selection range, much like the W3C DOM Range, but
22
- * it is not intended to be an implementation of the W3C interface.
23
- */
24
-
25
- var FCKDomRange = function( sourceWindow )
26
- {
27
- this.Window = sourceWindow ;
28
- this._Cache = {} ;
29
- }
30
-
31
- FCKDomRange.prototype =
32
- {
33
-
34
- _UpdateElementInfo : function()
35
- {
36
- var innerRange = this._Range ;
37
-
38
- if ( !innerRange )
39
- this.Release( true ) ;
40
- else
41
- {
42
- // For text nodes, the node itself is the StartNode.
43
- var eStart = innerRange.startContainer ;
44
-
45
- var oElementPath = new FCKElementPath( eStart ) ;
46
- this.StartNode = eStart.nodeType == 3 ? eStart : eStart.childNodes[ innerRange.startOffset ] ;
47
- this.StartContainer = eStart ;
48
- this.StartBlock = oElementPath.Block ;
49
- this.StartBlockLimit = oElementPath.BlockLimit ;
50
-
51
- if ( innerRange.collapsed )
52
- {
53
- this.EndNode = this.StartNode ;
54
- this.EndContainer = this.StartContainer ;
55
- this.EndBlock = this.StartBlock ;
56
- this.EndBlockLimit = this.StartBlockLimit ;
57
- }
58
- else
59
- {
60
- var eEnd = innerRange.endContainer ;
61
-
62
- if ( eStart != eEnd )
63
- oElementPath = new FCKElementPath( eEnd ) ;
64
-
65
- // The innerRange.endContainer[ innerRange.endOffset ] is not
66
- // usually part of the range, but the marker for the range end. So,
67
- // let's get the previous available node as the real end.
68
- var eEndNode = eEnd ;
69
- if ( innerRange.endOffset == 0 )
70
- {
71
- while ( eEndNode && !eEndNode.previousSibling )
72
- eEndNode = eEndNode.parentNode ;
73
-
74
- if ( eEndNode )
75
- eEndNode = eEndNode.previousSibling ;
76
- }
77
- else if ( eEndNode.nodeType == 1 )
78
- eEndNode = eEndNode.childNodes[ innerRange.endOffset - 1 ] ;
79
-
80
- this.EndNode = eEndNode ;
81
- this.EndContainer = eEnd ;
82
- this.EndBlock = oElementPath.Block ;
83
- this.EndBlockLimit = oElementPath.BlockLimit ;
84
- }
85
- }
86
-
87
- this._Cache = {} ;
88
- },
89
-
90
- CreateRange : function()
91
- {
92
- return new FCKW3CRange( this.Window.document ) ;
93
- },
94
-
95
- DeleteContents : function()
96
- {
97
- if ( this._Range )
98
- {
99
- this._Range.deleteContents() ;
100
- this._UpdateElementInfo() ;
101
- }
102
- },
103
-
104
- ExtractContents : function()
105
- {
106
- if ( this._Range )
107
- {
108
- var docFrag = this._Range.extractContents() ;
109
- this._UpdateElementInfo() ;
110
- return docFrag ;
111
- }
112
- return null ;
113
- },
114
-
115
- CheckIsCollapsed : function()
116
- {
117
- if ( this._Range )
118
- return this._Range.collapsed ;
119
-
120
- return false ;
121
- },
122
-
123
- Collapse : function( toStart )
124
- {
125
- if ( this._Range )
126
- this._Range.collapse( toStart ) ;
127
-
128
- this._UpdateElementInfo() ;
129
- },
130
-
131
- Clone : function()
132
- {
133
- var oClone = FCKTools.CloneObject( this ) ;
134
-
135
- if ( this._Range )
136
- oClone._Range = this._Range.cloneRange() ;
137
-
138
- return oClone ;
139
- },
140
-
141
- MoveToNodeContents : function( targetNode )
142
- {
143
- if ( !this._Range )
144
- this._Range = this.CreateRange() ;
145
-
146
- this._Range.selectNodeContents( targetNode ) ;
147
-
148
- this._UpdateElementInfo() ;
149
- },
150
-
151
- MoveToElementStart : function( targetElement )
152
- {
153
- this.SetStart(targetElement,1) ;
154
- this.SetEnd(targetElement,1) ;
155
- },
156
-
157
- // Moves to the first editing point inside a element. For example, in a
158
- // element tree like "<p><b><i></i></b> Text</p>", the start editing point
159
- // is "<p><b><i>^</i></b> Text</p>" (inside <i>).
160
- MoveToElementEditStart : function( targetElement )
161
- {
162
- var editableElement ;
163
-
164
- while ( targetElement && targetElement.nodeType == 1 )
165
- {
166
- if ( FCKDomTools.CheckIsEditable( targetElement ) )
167
- editableElement = targetElement ;
168
- else if ( editableElement )
169
- break ; // If we already found an editable element, stop the loop.
170
-
171
- targetElement = targetElement.firstChild ;
172
- }
173
-
174
- if ( editableElement )
175
- this.MoveToElementStart( editableElement ) ;
176
- },
177
-
178
- InsertNode : function( node )
179
- {
180
- if ( this._Range )
181
- this._Range.insertNode( node ) ;
182
- },
183
-
184
- CheckIsEmpty : function()
185
- {
186
- if ( this.CheckIsCollapsed() )
187
- return true ;
188
-
189
- // Inserts the contents of the range in a div tag.
190
- var eToolDiv = this.Window.document.createElement( 'div' ) ;
191
- this._Range.cloneContents().AppendTo( eToolDiv ) ;
192
-
193
- FCKDomTools.TrimNode( eToolDiv ) ;
194
-
195
- return ( eToolDiv.innerHTML.length == 0 ) ;
196
- },
197
-
198
- /**
199
- * Checks if the start boundary of the current range is "visually" (like a
200
- * selection caret) at the beginning of the block. It means that some
201
- * things could be brefore the range, like spaces or empty inline elements,
202
- * but it would still be considered at the beginning of the block.
203
- */
204
- CheckStartOfBlock : function()
205
- {
206
- var cache = this._Cache ;
207
- var bIsStartOfBlock = cache.IsStartOfBlock ;
208
-
209
- if ( bIsStartOfBlock != undefined )
210
- return bIsStartOfBlock ;
211
-
212
- // Take the block reference.
213
- var block = this.StartBlock || this.StartBlockLimit ;
214
-
215
- var container = this._Range.startContainer ;
216
- var offset = this._Range.startOffset ;
217
- var currentNode ;
218
-
219
- if ( offset > 0 )
220
- {
221
- // First, check the start container. If it is a text node, get the
222
- // substring of the node value before the range offset.
223
- if ( container.nodeType == 3 )
224
- {
225
- var textValue = container.nodeValue.substr( 0, offset ).Trim() ;
226
-
227
- // If we have some text left in the container, we are not at
228
- // the end for the block.
229
- if ( textValue.length != 0 )
230
- return cache.IsStartOfBlock = false ;
231
- }
232
- else
233
- currentNode = container.childNodes[ offset - 1 ] ;
234
- }
235
-
236
- // We'll not have a currentNode if the container was a text node, or
237
- // the offset is zero.
238
- if ( !currentNode )
239
- currentNode = FCKDomTools.GetPreviousSourceNode( container, true, null, block ) ;
240
-
241
- while ( currentNode )
242
- {
243
- switch ( currentNode.nodeType )
244
- {
245
- case 1 :
246
- // It's not an inline element.
247
- if ( !FCKListsLib.InlineChildReqElements[ currentNode.nodeName.toLowerCase() ] )
248
- return cache.IsStartOfBlock = false ;
249
-
250
- break ;
251
-
252
- case 3 :
253
- // It's a text node with real text.
254
- if ( currentNode.nodeValue.Trim().length > 0 )
255
- return cache.IsStartOfBlock = false ;
256
- }
257
-
258
- currentNode = FCKDomTools.GetPreviousSourceNode( currentNode, false, null, block ) ;
259
- }
260
-
261
- return cache.IsStartOfBlock = true ;
262
- },
263
-
264
- /**
265
- * Checks if the end boundary of the current range is "visually" (like a
266
- * selection caret) at the end of the block. It means that some things
267
- * could be after the range, like spaces, empty inline elements, or a
268
- * single <br>, but it would still be considered at the end of the block.
269
- */
270
- CheckEndOfBlock : function( refreshSelection )
271
- {
272
- var isEndOfBlock = this._Cache.IsEndOfBlock ;
273
-
274
- if ( isEndOfBlock != undefined )
275
- return isEndOfBlock ;
276
-
277
- // Take the block reference.
278
- var block = this.EndBlock || this.EndBlockLimit ;
279
-
280
- var container = this._Range.endContainer ;
281
- var offset = this._Range.endOffset ;
282
- var currentNode ;
283
-
284
- // First, check the end container. If it is a text node, get the
285
- // substring of the node value after the range offset.
286
- if ( container.nodeType == 3 )
287
- {
288
- var textValue = container.nodeValue ;
289
- if ( offset < textValue.length )
290
- {
291
- textValue = textValue.substr( offset ) ;
292
-
293
- // If we have some text left in the container, we are not at
294
- // the end for the block.
295
- if ( textValue.Trim().length != 0 )
296
- return this._Cache.IsEndOfBlock = false ;
297
- }
298
- }
299
- else
300
- currentNode = container.childNodes[ offset ] ;
301
-
302
- // We'll not have a currentNode if the container was a text node, of
303
- // the offset is out the container children limits (after it probably).
304
- if ( !currentNode )
305
- currentNode = FCKDomTools.GetNextSourceNode( container, true, null, block ) ;
306
-
307
- var hadBr = false ;
308
-
309
- while ( currentNode )
310
- {
311
- switch ( currentNode.nodeType )
312
- {
313
- case 1 :
314
- var nodeName = currentNode.nodeName.toLowerCase() ;
315
-
316
- // It's an inline element.
317
- if ( FCKListsLib.InlineChildReqElements[ nodeName ] )
318
- break ;
319
-
320
- // It is the first <br> found.
321
- if ( nodeName == 'br' && !hadBr )
322
- {
323
- hadBr = true ;
324
- break ;
325
- }
326
-
327
- return this._Cache.IsEndOfBlock = false ;
328
-
329
- case 3 :
330
- // It's a text node with real text.
331
- if ( currentNode.nodeValue.Trim().length > 0 )
332
- return this._Cache.IsEndOfBlock = false ;
333
- }
334
-
335
- currentNode = FCKDomTools.GetNextSourceNode( currentNode, false, null, block ) ;
336
- }
337
-
338
- if ( refreshSelection )
339
- this.Select() ;
340
-
341
- return this._Cache.IsEndOfBlock = true ;
342
- },
343
-
344
- // This is an "intrusive" way to create a bookmark. It includes <span> tags
345
- // in the range boundaries. The advantage of it is that it is possible to
346
- // handle DOM mutations when moving back to the bookmark.
347
- // Attention: the inclusion of nodes in the DOM is a design choice and
348
- // should not be changed as there are other points in the code that may be
349
- // using those nodes to perform operations. See GetBookmarkNode.
350
- // For performance, includeNodes=true if intended to SelectBookmark.
351
- CreateBookmark : function( includeNodes )
352
- {
353
- // Create the bookmark info (random IDs).
354
- var oBookmark =
355
- {
356
- StartId : (new Date()).valueOf() + Math.floor(Math.random()*1000) + 'S',
357
- EndId : (new Date()).valueOf() + Math.floor(Math.random()*1000) + 'E'
358
- } ;
359
-
360
- var oDoc = this.Window.document ;
361
- var eStartSpan ;
362
- var eEndSpan ;
363
- var oClone ;
364
-
365
- // For collapsed ranges, add just the start marker.
366
- if ( !this.CheckIsCollapsed() )
367
- {
368
- eEndSpan = oDoc.createElement( 'span' ) ;
369
- eEndSpan.style.display = 'none' ;
370
- eEndSpan.id = oBookmark.EndId ;
371
- eEndSpan.setAttribute( '_fck_bookmark', true ) ;
372
-
373
- // For IE, it must have something inside, otherwise it may be
374
- // removed during DOM operations.
375
- // if ( FCKBrowserInfo.IsIE )
376
- eEndSpan.innerHTML = '&nbsp;' ;
377
-
378
- oClone = this.Clone() ;
379
- oClone.Collapse( false ) ;
380
- oClone.InsertNode( eEndSpan ) ;
381
- }
382
-
383
- eStartSpan = oDoc.createElement( 'span' ) ;
384
- eStartSpan.style.display = 'none' ;
385
- eStartSpan.id = oBookmark.StartId ;
386
- eStartSpan.setAttribute( '_fck_bookmark', true ) ;
387
-
388
- // For IE, it must have something inside, otherwise it may be removed
389
- // during DOM operations.
390
- // if ( FCKBrowserInfo.IsIE )
391
- eStartSpan.innerHTML = '&nbsp;' ;
392
-
393
- oClone = this.Clone() ;
394
- oClone.Collapse( true ) ;
395
- oClone.InsertNode( eStartSpan ) ;
396
-
397
- if ( includeNodes )
398
- {
399
- oBookmark.StartNode = eStartSpan ;
400
- oBookmark.EndNode = eEndSpan ;
401
- }
402
-
403
- // Update the range position.
404
- if ( eEndSpan )
405
- {
406
- this.SetStart( eStartSpan, 4 ) ;
407
- this.SetEnd( eEndSpan, 3 ) ;
408
- }
409
- else
410
- this.MoveToPosition( eStartSpan, 4 ) ;
411
-
412
- return oBookmark ;
413
- },
414
-
415
- // This one should be a part of a hypothetic "bookmark" object.
416
- GetBookmarkNode : function( bookmark, start )
417
- {
418
- var doc = this.Window.document ;
419
-
420
- if ( start )
421
- return bookmark.StartNode || doc.getElementById( bookmark.StartId ) ;
422
- else
423
- return bookmark.EndNode || doc.getElementById( bookmark.EndId ) ;
424
- },
425
-
426
- MoveToBookmark : function( bookmark, preserveBookmark )
427
- {
428
- var eStartSpan = this.GetBookmarkNode( bookmark, true ) ;
429
- var eEndSpan = this.GetBookmarkNode( bookmark, false ) ;
430
-
431
- this.SetStart( eStartSpan, 3 ) ;
432
-
433
- if ( !preserveBookmark )
434
- FCKDomTools.RemoveNode( eStartSpan ) ;
435
-
436
- // If collapsed, the end span will not be available.
437
- if ( eEndSpan )
438
- {
439
- this.SetEnd( eEndSpan, 3 ) ;
440
-
441
- if ( !preserveBookmark )
442
- FCKDomTools.RemoveNode( eEndSpan ) ;
443
- }
444
- else
445
- this.Collapse( true ) ;
446
-
447
- this._UpdateElementInfo() ;
448
- },
449
-
450
- // Non-intrusive bookmark algorithm
451
- CreateBookmark2 : function()
452
- {
453
- // If there is no range then get out of here.
454
- // It happens on initial load in Safari #962 and if the editor it's hidden also in Firefox
455
- if ( ! this._Range )
456
- return { "Start" : 0, "End" : 0 } ;
457
-
458
- // First, we record down the offset values
459
- var bookmark =
460
- {
461
- "Start" : [ this._Range.startOffset ],
462
- "End" : [ this._Range.endOffset ]
463
- } ;
464
- // Since we're treating the document tree as normalized, we need to backtrack the text lengths
465
- // of previous text nodes into the offset value.
466
- var curStart = this._Range.startContainer.previousSibling ;
467
- var curEnd = this._Range.endContainer.previousSibling ;
468
-
469
- // Also note that the node that we use for "address base" would change during backtracking.
470
- var addrStart = this._Range.startContainer ;
471
- var addrEnd = this._Range.endContainer ;
472
- while ( curStart && curStart.nodeType == 3 && addrStart.nodeType == 3 )
473
- {
474
- bookmark.Start[0] += curStart.length ;
475
- addrStart = curStart ;
476
- curStart = curStart.previousSibling ;
477
- }
478
- while ( curEnd && curEnd.nodeType == 3 && addrEnd.nodeType == 3 )
479
- {
480
- bookmark.End[0] += curEnd.length ;
481
- addrEnd = curEnd ;
482
- curEnd = curEnd.previousSibling ;
483
- }
484
-
485
- // If the object pointed to by the startOffset and endOffset are text nodes, we need
486
- // to backtrack and add in the text offset to the bookmark addresses.
487
- if ( addrStart.nodeType == 1 && addrStart.childNodes[bookmark.Start[0]] && addrStart.childNodes[bookmark.Start[0]].nodeType == 3 )
488
- {
489
- var curNode = addrStart.childNodes[bookmark.Start[0]] ;
490
- var offset = 0 ;
491
- while ( curNode.previousSibling && curNode.previousSibling.nodeType == 3 )
492
- {
493
- curNode = curNode.previousSibling ;
494
- offset += curNode.length ;
495
- }
496
- addrStart = curNode ;
497
- bookmark.Start[0] = offset ;
498
- }
499
- if ( addrEnd.nodeType == 1 && addrEnd.childNodes[bookmark.End[0]] && addrEnd.childNodes[bookmark.End[0]].nodeType == 3 )
500
- {
501
- var curNode = addrEnd.childNodes[bookmark.End[0]] ;
502
- var offset = 0 ;
503
- while ( curNode.previousSibling && curNode.previousSibling.nodeType == 3 )
504
- {
505
- curNode = curNode.previousSibling ;
506
- offset += curNode.length ;
507
- }
508
- addrEnd = curNode ;
509
- bookmark.End[0] = offset ;
510
- }
511
-
512
- // Then, we record down the precise position of the container nodes
513
- // by walking up the DOM tree and counting their childNode index
514
- bookmark.Start = FCKDomTools.GetNodeAddress( addrStart, true ).concat( bookmark.Start ) ;
515
- bookmark.End = FCKDomTools.GetNodeAddress( addrEnd, true ).concat( bookmark.End ) ;
516
- return bookmark;
517
- },
518
-
519
- MoveToBookmark2 : function( bookmark )
520
- {
521
- // Reverse the childNode counting algorithm in CreateBookmark2()
522
- var curStart = FCKDomTools.GetNodeFromAddress( this.Window.document, bookmark.Start.slice( 0, -1 ), true ) ;
523
- var curEnd = FCKDomTools.GetNodeFromAddress( this.Window.document, bookmark.End.slice( 0, -1 ), true ) ;
524
-
525
- // Generate the W3C Range object and update relevant data
526
- this.Release( true ) ;
527
- this._Range = new FCKW3CRange( this.Window.document ) ;
528
- var startOffset = bookmark.Start[ bookmark.Start.length - 1 ] ;
529
- var endOffset = bookmark.End[ bookmark.End.length - 1 ] ;
530
- while ( curStart.nodeType == 3 && startOffset > curStart.length )
531
- {
532
- if ( ! curStart.nextSibling || curStart.nextSibling.nodeType != 3 )
533
- break ;
534
- startOffset -= curStart.length ;
535
- curStart = curStart.nextSibling ;
536
- }
537
- while ( curEnd.nodeType == 3 && endOffset > curEnd.length )
538
- {
539
- if ( ! curEnd.nextSibling || curEnd.nextSibling.nodeType != 3 )
540
- break ;
541
- endOffset -= curEnd.length ;
542
- curEnd = curEnd.nextSibling ;
543
- }
544
- this._Range.setStart( curStart, startOffset ) ;
545
- this._Range.setEnd( curEnd, endOffset ) ;
546
- this._UpdateElementInfo() ;
547
- },
548
-
549
- MoveToPosition : function( targetElement, position )
550
- {
551
- this.SetStart( targetElement, position ) ;
552
- this.Collapse( true ) ;
553
- },
554
-
555
- /*
556
- * Moves the position of the start boundary of the range to a specific position
557
- * relatively to a element.
558
- * @position:
559
- * 1 = After Start <target>^contents</target>
560
- * 2 = Before End <target>contents^</target>
561
- * 3 = Before Start ^<target>contents</target>
562
- * 4 = After End <target>contents</target>^
563
- */
564
- SetStart : function( targetElement, position, noInfoUpdate )
565
- {
566
- var oRange = this._Range ;
567
- if ( !oRange )
568
- oRange = this._Range = this.CreateRange() ;
569
-
570
- switch( position )
571
- {
572
- case 1 : // After Start <target>^contents</target>
573
- oRange.setStart( targetElement, 0 ) ;
574
- break ;
575
-
576
- case 2 : // Before End <target>contents^</target>
577
- oRange.setStart( targetElement, targetElement.childNodes.length ) ;
578
- break ;
579
-
580
- case 3 : // Before Start ^<target>contents</target>
581
- oRange.setStartBefore( targetElement ) ;
582
- break ;
583
-
584
- case 4 : // After End <target>contents</target>^
585
- oRange.setStartAfter( targetElement ) ;
586
- }
587
-
588
- if ( !noInfoUpdate )
589
- this._UpdateElementInfo() ;
590
- },
591
-
592
- /*
593
- * Moves the position of the start boundary of the range to a specific position
594
- * relatively to a element.
595
- * @position:
596
- * 1 = After Start <target>^contents</target>
597
- * 2 = Before End <target>contents^</target>
598
- * 3 = Before Start ^<target>contents</target>
599
- * 4 = After End <target>contents</target>^
600
- */
601
- SetEnd : function( targetElement, position, noInfoUpdate )
602
- {
603
- var oRange = this._Range ;
604
- if ( !oRange )
605
- oRange = this._Range = this.CreateRange() ;
606
-
607
- switch( position )
608
- {
609
- case 1 : // After Start <target>^contents</target>
610
- oRange.setEnd( targetElement, 0 ) ;
611
- break ;
612
-
613
- case 2 : // Before End <target>contents^</target>
614
- oRange.setEnd( targetElement, targetElement.childNodes.length ) ;
615
- break ;
616
-
617
- case 3 : // Before Start ^<target>contents</target>
618
- oRange.setEndBefore( targetElement ) ;
619
- break ;
620
-
621
- case 4 : // After End <target>contents</target>^
622
- oRange.setEndAfter( targetElement ) ;
623
- }
624
-
625
- if ( !noInfoUpdate )
626
- this._UpdateElementInfo() ;
627
- },
628
-
629
- Expand : function( unit )
630
- {
631
- var oNode, oSibling ;
632
-
633
- switch ( unit )
634
- {
635
- // Expand the range to include all inline parent elements if we are
636
- // are in their boundary limits.
637
- // For example (where [ ] are the range limits):
638
- // Before => Some <b>[<i>Some sample text]</i></b>.
639
- // After => Some [<b><i>Some sample text</i></b>].
640
- case 'inline_elements' :
641
- // Expand the start boundary.
642
- if ( this._Range.startOffset == 0 )
643
- {
644
- oNode = this._Range.startContainer ;
645
-
646
- if ( oNode.nodeType != 1 )
647
- oNode = oNode.previousSibling ? null : oNode.parentNode ;
648
-
649
- if ( oNode )
650
- {
651
- while ( FCKListsLib.InlineNonEmptyElements[ oNode.nodeName.toLowerCase() ] )
652
- {
653
- this._Range.setStartBefore( oNode ) ;
654
-
655
- if ( oNode != oNode.parentNode.firstChild )
656
- break ;
657
-
658
- oNode = oNode.parentNode ;
659
- }
660
- }
661
- }
662
-
663
- // Expand the end boundary.
664
- oNode = this._Range.endContainer ;
665
- var offset = this._Range.endOffset ;
666
-
667
- if ( ( oNode.nodeType == 3 && offset >= oNode.nodeValue.length ) || ( oNode.nodeType == 1 && offset >= oNode.childNodes.length ) || ( oNode.nodeType != 1 && oNode.nodeType != 3 ) )
668
- {
669
- if ( oNode.nodeType != 1 )
670
- oNode = oNode.nextSibling ? null : oNode.parentNode ;
671
-
672
- if ( oNode )
673
- {
674
- while ( FCKListsLib.InlineNonEmptyElements[ oNode.nodeName.toLowerCase() ] )
675
- {
676
- this._Range.setEndAfter( oNode ) ;
677
-
678
- if ( oNode != oNode.parentNode.lastChild )
679
- break ;
680
-
681
- oNode = oNode.parentNode ;
682
- }
683
- }
684
- }
685
-
686
- break ;
687
-
688
- case 'block_contents' :
689
- case 'list_contents' :
690
- var boundarySet = FCKListsLib.BlockBoundaries ;
691
- if ( unit == 'list_contents' || FCKConfig.EnterMode == 'br' )
692
- boundarySet = FCKListsLib.ListBoundaries ;
693
-
694
- if ( this.StartBlock && FCKConfig.EnterMode != 'br' && unit == 'block_contents' )
695
- this.SetStart( this.StartBlock, 1 ) ;
696
- else
697
- {
698
- // Get the start node for the current range.
699
- oNode = this._Range.startContainer ;
700
-
701
- // If it is an element, get the node right before of it (in source order).
702
- if ( oNode.nodeType == 1 )
703
- {
704
- var lastNode = oNode.childNodes[ this._Range.startOffset ] ;
705
- if ( lastNode )
706
- oNode = FCKDomTools.GetPreviousSourceNode( lastNode, true ) ;
707
- else
708
- oNode = oNode.lastChild || oNode ;
709
- }
710
-
711
- // We must look for the left boundary, relative to the range
712
- // start, which is limited by a block element.
713
- while ( oNode
714
- && ( oNode.nodeType != 1
715
- || ( oNode != this.StartBlockLimit
716
- && !boundarySet[ oNode.nodeName.toLowerCase() ] ) ) )
717
- {
718
- this._Range.setStartBefore( oNode ) ;
719
- oNode = oNode.previousSibling || oNode.parentNode ;
720
- }
721
- }
722
-
723
- if ( this.EndBlock && FCKConfig.EnterMode != 'br' && unit == 'block_contents' && this.EndBlock.nodeName.toLowerCase() != 'li' )
724
- this.SetEnd( this.EndBlock, 2 ) ;
725
- else
726
- {
727
- oNode = this._Range.endContainer ;
728
- if ( oNode.nodeType == 1 )
729
- oNode = oNode.childNodes[ this._Range.endOffset ] || oNode.lastChild ;
730
-
731
- // We must look for the right boundary, relative to the range
732
- // end, which is limited by a block element.
733
- while ( oNode
734
- && ( oNode.nodeType != 1
735
- || ( oNode != this.StartBlockLimit
736
- && !boundarySet[ oNode.nodeName.toLowerCase() ] ) ) )
737
- {
738
- this._Range.setEndAfter( oNode ) ;
739
- oNode = oNode.nextSibling || oNode.parentNode ;
740
- }
741
-
742
- // In EnterMode='br', the end <br> boundary element must
743
- // be included in the expanded range.
744
- if ( oNode && oNode.nodeName.toLowerCase() == 'br' )
745
- this._Range.setEndAfter( oNode ) ;
746
- }
747
-
748
- this._UpdateElementInfo() ;
749
- }
750
- },
751
-
752
- /**
753
- * Split the block element for the current range. It deletes the contents
754
- * of the range and splits the block in the collapsed position, resulting
755
- * in two sucessive blocks. The range is then positioned in the middle of
756
- * them.
757
- *
758
- * It returns and object with the following properties:
759
- * - PreviousBlock : a reference to the block element that preceeds
760
- * the range after the split.
761
- * - NextBlock : a reference to the block element that follows the
762
- * range after the split.
763
- * - WasStartOfBlock : a boolean indicating that the range was
764
- * originaly at the start of the block.
765
- * - WasEndOfBlock : a boolean indicating that the range was originaly
766
- * at the end of the block.
767
- *
768
- * If the range was originaly at the start of the block, no split will happen
769
- * and the PreviousBlock value will be null. The same is valid for the
770
- * NextBlock value if the range was at the end of the block.
771
- */
772
- SplitBlock : function( forceBlockTag )
773
- {
774
- var blockTag = forceBlockTag || FCKConfig.EnterMode ;
775
-
776
- if ( !this._Range )
777
- this.MoveToSelection() ;
778
-
779
- // The range boundaries must be in the same "block limit" element.
780
- if ( this.StartBlockLimit == this.EndBlockLimit )
781
- {
782
- // Get the current blocks.
783
- var eStartBlock = this.StartBlock ;
784
- var eEndBlock = this.EndBlock ;
785
- var oElementPath = null ;
786
-
787
- if ( blockTag != 'br' )
788
- {
789
- if ( !eStartBlock )
790
- {
791
- eStartBlock = this.FixBlock( true, blockTag ) ;
792
- eEndBlock = this.EndBlock ; // FixBlock may have fixed the EndBlock too.
793
- }
794
-
795
- if ( !eEndBlock )
796
- eEndBlock = this.FixBlock( false, blockTag ) ;
797
- }
798
-
799
- // Get the range position.
800
- var bIsStartOfBlock = ( eStartBlock != null && this.CheckStartOfBlock() ) ;
801
- var bIsEndOfBlock = ( eEndBlock != null && this.CheckEndOfBlock() ) ;
802
-
803
- // Delete the current contents.
804
- if ( !this.CheckIsEmpty() )
805
- this.DeleteContents() ;
806
-
807
- if ( eStartBlock && eEndBlock && eStartBlock == eEndBlock )
808
- {
809
- if ( bIsEndOfBlock )
810
- {
811
- oElementPath = new FCKElementPath( this.StartContainer ) ;
812
- this.MoveToPosition( eEndBlock, 4 ) ;
813
- eEndBlock = null ;
814
- }
815
- else if ( bIsStartOfBlock )
816
- {
817
- oElementPath = new FCKElementPath( this.StartContainer ) ;
818
- this.MoveToPosition( eStartBlock, 3 ) ;
819
- eStartBlock = null ;
820
- }
821
- else
822
- {
823
- // Extract the contents of the block from the selection point to the end of its contents.
824
- this.SetEnd( eStartBlock, 2 ) ;
825
- var eDocFrag = this.ExtractContents() ;
826
-
827
- // Duplicate the block element after it.
828
- eEndBlock = eStartBlock.cloneNode( false ) ;
829
- eEndBlock.removeAttribute( 'id', false ) ;
830
-
831
- // Place the extracted contents in the duplicated block.
832
- eDocFrag.AppendTo( eEndBlock ) ;
833
-
834
- FCKDomTools.InsertAfterNode( eStartBlock, eEndBlock ) ;
835
-
836
- this.MoveToPosition( eStartBlock, 4 ) ;
837
-
838
- // In Gecko, the last child node must be a bogus <br>.
839
- // Note: bogus <br> added under <ul> or <ol> would cause lists to be incorrectly rendered.
840
- if ( FCKBrowserInfo.IsGecko &&
841
- ! eStartBlock.nodeName.IEquals( ['ul', 'ol'] ) )
842
- FCKTools.AppendBogusBr( eStartBlock ) ;
843
- }
844
- }
845
-
846
- return {
847
- PreviousBlock : eStartBlock,
848
- NextBlock : eEndBlock,
849
- WasStartOfBlock : bIsStartOfBlock,
850
- WasEndOfBlock : bIsEndOfBlock,
851
- ElementPath : oElementPath
852
- } ;
853
- }
854
-
855
- return null ;
856
- },
857
-
858
- // Transform a block without a block tag in a valid block (orphan text in the body or td, usually).
859
- FixBlock : function( isStart, blockTag )
860
- {
861
- // Bookmark the range so we can restore it later.
862
- var oBookmark = this.CreateBookmark() ;
863
-
864
- // Collapse the range to the requested ending boundary.
865
- this.Collapse( isStart ) ;
866
-
867
- // Expands it to the block contents.
868
- this.Expand( 'block_contents' ) ;
869
-
870
- // Create the fixed block.
871
- var oFixedBlock = this.Window.document.createElement( blockTag ) ;
872
-
873
- // Move the contents of the temporary range to the fixed block.
874
- this.ExtractContents().AppendTo( oFixedBlock ) ;
875
- FCKDomTools.TrimNode( oFixedBlock ) ;
876
-
877
- // If the fixed block is empty (not counting bookmark nodes)
878
- // Add a <br /> inside to expand it.
879
- if ( FCKDomTools.CheckIsEmptyElement(oFixedBlock, function( element ) { return element.getAttribute('_fck_bookmark') != 'true' ; } )
880
- && FCKBrowserInfo.IsGeckoLike )
881
- FCKTools.AppendBogusBr( oFixedBlock ) ;
882
-
883
- // Insert the fixed block into the DOM.
884
- this.InsertNode( oFixedBlock ) ;
885
-
886
- // Move the range back to the bookmarked place.
887
- this.MoveToBookmark( oBookmark ) ;
888
-
889
- return oFixedBlock ;
890
- },
891
-
892
- Release : function( preserveWindow )
893
- {
894
- if ( !preserveWindow )
895
- this.Window = null ;
896
-
897
- this.StartNode = null ;
898
- this.StartContainer = null ;
899
- this.StartBlock = null ;
900
- this.StartBlockLimit = null ;
901
- this.EndNode = null ;
902
- this.EndContainer = null ;
903
- this.EndBlock = null ;
904
- this.EndBlockLimit = null ;
905
- this._Range = null ;
906
- this._Cache = null ;
907
- },
908
-
909
- CheckHasRange : function()
910
- {
911
- return !!this._Range ;
912
- },
913
-
914
- GetTouchedStartNode : function()
915
- {
916
- var range = this._Range ;
917
- var container = range.startContainer ;
918
-
919
- if ( range.collapsed || container.nodeType != 1 )
920
- return container ;
921
-
922
- return container.childNodes[ range.startOffset ] || container ;
923
- },
924
-
925
- GetTouchedEndNode : function()
926
- {
927
- var range = this._Range ;
928
- var container = range.endContainer ;
929
-
930
- if ( range.collapsed || container.nodeType != 1 )
931
- return container ;
932
-
933
- return container.childNodes[ range.endOffset - 1 ] || container ;
934
- }
935
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckdomrange_gecko.js DELETED
@@ -1,104 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Class for working with a selection range, much like the W3C DOM Range, but
22
- * it is not intended to be an implementation of the W3C interface.
23
- * (Gecko Implementation)
24
- */
25
-
26
- FCKDomRange.prototype.MoveToSelection = function()
27
- {
28
- this.Release( true ) ;
29
-
30
- var oSel = this.Window.getSelection() ;
31
-
32
- if ( oSel && oSel.rangeCount > 0 )
33
- {
34
- this._Range = FCKW3CRange.CreateFromRange( this.Window.document, oSel.getRangeAt(0) ) ;
35
- this._UpdateElementInfo() ;
36
- }
37
- else
38
- if ( this.Window.document )
39
- this.MoveToElementStart( this.Window.document.body ) ;
40
- }
41
-
42
- FCKDomRange.prototype.Select = function()
43
- {
44
- var oRange = this._Range ;
45
- if ( oRange )
46
- {
47
- var startContainer = oRange.startContainer ;
48
-
49
- // If we have a collapsed range, inside an empty element, we must add
50
- // something to it, otherwise the caret will not be visible.
51
- if ( oRange.collapsed && startContainer.nodeType == 1 && startContainer.childNodes.length == 0 )
52
- startContainer.appendChild( oRange._Document.createTextNode('') ) ;
53
-
54
- var oDocRange = this.Window.document.createRange() ;
55
- oDocRange.setStart( startContainer, oRange.startOffset ) ;
56
-
57
- try
58
- {
59
- oDocRange.setEnd( oRange.endContainer, oRange.endOffset ) ;
60
- }
61
- catch ( e )
62
- {
63
- // There is a bug in Firefox implementation (it would be too easy
64
- // otherwise). The new start can't be after the end (W3C says it can).
65
- // So, let's create a new range and collapse it to the desired point.
66
- if ( e.toString().Contains( 'NS_ERROR_ILLEGAL_VALUE' ) )
67
- {
68
- oRange.collapse( true ) ;
69
- oDocRange.setEnd( oRange.endContainer, oRange.endOffset ) ;
70
- }
71
- else
72
- throw( e ) ;
73
- }
74
-
75
- var oSel = this.Window.getSelection() ;
76
- oSel.removeAllRanges() ;
77
-
78
- // We must add a clone otherwise Firefox will have rendering issues.
79
- oSel.addRange( oDocRange ) ;
80
- }
81
- }
82
-
83
- // Not compatible with bookmark created with CreateBookmark2.
84
- // The bookmark nodes will be deleted from the document.
85
- FCKDomRange.prototype.SelectBookmark = function( bookmark )
86
- {
87
- var domRange = this.Window.document.createRange() ;
88
-
89
- var startNode = this.GetBookmarkNode( bookmark, true ) ;
90
- var endNode = this.GetBookmarkNode( bookmark, false ) ;
91
-
92
- domRange.setStart( startNode.parentNode, FCKDomTools.GetIndexOf( startNode ) ) ;
93
- FCKDomTools.RemoveNode( startNode ) ;
94
-
95
- if ( endNode )
96
- {
97
- domRange.setEnd( endNode.parentNode, FCKDomTools.GetIndexOf( endNode ) ) ;
98
- FCKDomTools.RemoveNode( endNode ) ;
99
- }
100
-
101
- var selection = this.Window.getSelection() ;
102
- selection.removeAllRanges() ;
103
- selection.addRange( domRange ) ;
104
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckdomrange_ie.js DELETED
@@ -1,199 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Class for working with a selection range, much like the W3C DOM Range, but
22
- * it is not intended to be an implementation of the W3C interface.
23
- * (IE Implementation)
24
- */
25
-
26
- FCKDomRange.prototype.MoveToSelection = function()
27
- {
28
- this.Release( true ) ;
29
-
30
- this._Range = new FCKW3CRange( this.Window.document ) ;
31
-
32
- var oSel = this.Window.document.selection ;
33
-
34
- if ( oSel.type != 'Control' )
35
- {
36
- var eMarkerStart = this._GetSelectionMarkerTag( true ) ;
37
- var eMarkerEnd = this._GetSelectionMarkerTag( false ) ;
38
-
39
- if ( !eMarkerStart && !eMarkerEnd )
40
- {
41
- this._Range.setStart( this.Window.document.body, 0 ) ;
42
- this._UpdateElementInfo() ;
43
- return ;
44
- }
45
-
46
- // Set the start boundary.
47
- this._Range.setStart( eMarkerStart.parentNode, FCKDomTools.GetIndexOf( eMarkerStart ) ) ;
48
- eMarkerStart.parentNode.removeChild( eMarkerStart ) ;
49
-
50
- // Set the end boundary.
51
- this._Range.setEnd( eMarkerEnd.parentNode, FCKDomTools.GetIndexOf( eMarkerEnd ) ) ;
52
- eMarkerEnd.parentNode.removeChild( eMarkerEnd ) ;
53
-
54
- this._UpdateElementInfo() ;
55
- }
56
- else
57
- {
58
- var oControl = oSel.createRange().item(0) ;
59
-
60
- if ( oControl )
61
- {
62
- this._Range.setStartBefore( oControl ) ;
63
- this._Range.setEndAfter( oControl ) ;
64
- this._UpdateElementInfo() ;
65
- }
66
- }
67
- }
68
-
69
- FCKDomRange.prototype.Select = function( forceExpand )
70
- {
71
- if ( this._Range )
72
- this.SelectBookmark( this.CreateBookmark( true ), forceExpand ) ;
73
- }
74
-
75
- // Not compatible with bookmark created with CreateBookmark2.
76
- // The bookmark nodes will be deleted from the document.
77
- FCKDomRange.prototype.SelectBookmark = function( bookmark, forceExpand )
78
- {
79
- var bIsCollapsed = this.CheckIsCollapsed() ;
80
- var bIsStartMakerAlone ;
81
- var dummySpan ;
82
-
83
- // Create marker tags for the start and end boundaries.
84
- var eStartMarker = this.GetBookmarkNode( bookmark, true ) ;
85
-
86
- if ( !eStartMarker )
87
- return ;
88
-
89
- var eEndMarker ;
90
- if ( !bIsCollapsed )
91
- eEndMarker = this.GetBookmarkNode( bookmark, false ) ;
92
-
93
- // Create the main range which will be used for the selection.
94
- var oIERange = this.Window.document.body.createTextRange() ;
95
-
96
- // Position the range at the start boundary.
97
- oIERange.moveToElementText( eStartMarker ) ;
98
- oIERange.moveStart( 'character', 1 ) ;
99
-
100
- if ( eEndMarker )
101
- {
102
- // Create a tool range for the end.
103
- var oIERangeEnd = this.Window.document.body.createTextRange() ;
104
-
105
- // Position the tool range at the end.
106
- oIERangeEnd.moveToElementText( eEndMarker ) ;
107
-
108
- // Move the end boundary of the main range to match the tool range.
109
- oIERange.setEndPoint( 'EndToEnd', oIERangeEnd ) ;
110
- oIERange.moveEnd( 'character', -1 ) ;
111
- }
112
- else
113
- {
114
- bIsStartMakerAlone = ( forceExpand || !eStartMarker.previousSibling || eStartMarker.previousSibling.nodeName.toLowerCase() == 'br' ) && !eStartMarker.nextSibing ;
115
-
116
- // Append a temporary <span>&#65279;</span> before the selection.
117
- // This is needed to avoid IE destroying selections inside empty
118
- // inline elements, like <b></b> (#253).
119
- // It is also needed when placing the selection right after an inline
120
- // element to avoid the selection moving inside of it.
121
- dummySpan = this.Window.document.createElement( 'span' ) ;
122
- dummySpan.innerHTML = '&#65279;' ; // Zero Width No-Break Space (U+FEFF). See #1359.
123
- eStartMarker.parentNode.insertBefore( dummySpan, eStartMarker ) ;
124
-
125
- if ( bIsStartMakerAlone )
126
- {
127
- // To expand empty blocks or line spaces after <br>, we need
128
- // instead to have any char, which will be later deleted using the
129
- // selection.
130
- // \ufeff = Zero Width No-Break Space (U+FEFF). See #1359.
131
- eStartMarker.parentNode.insertBefore( this.Window.document.createTextNode( '\ufeff' ), eStartMarker ) ;
132
- }
133
- }
134
-
135
- if ( !this._Range )
136
- this._Range = this.CreateRange() ;
137
-
138
- // Remove the markers (reset the position, because of the changes in the DOM tree).
139
- this._Range.setStartBefore( eStartMarker ) ;
140
- eStartMarker.parentNode.removeChild( eStartMarker ) ;
141
-
142
- if ( bIsCollapsed )
143
- {
144
- if ( bIsStartMakerAlone )
145
- {
146
- // Move the selection start to include the temporary &#65279;.
147
- oIERange.moveStart( 'character', -1 ) ;
148
-
149
- oIERange.select() ;
150
-
151
- // Remove our temporary stuff.
152
- this.Window.document.selection.clear() ;
153
- }
154
- else
155
- oIERange.select() ;
156
-
157
- FCKDomTools.RemoveNode( dummySpan ) ;
158
- }
159
- else
160
- {
161
- this._Range.setEndBefore( eEndMarker ) ;
162
- eEndMarker.parentNode.removeChild( eEndMarker ) ;
163
- oIERange.select() ;
164
- }
165
- }
166
-
167
- FCKDomRange.prototype._GetSelectionMarkerTag = function( toStart )
168
- {
169
- var doc = this.Window.document ;
170
- var selection = doc.selection ;
171
-
172
- // Get a range for the start boundary.
173
- var oRange ;
174
-
175
- // IE may throw an "unspecified error" on some cases (it happened when
176
- // loading _samples/default.html), so try/catch.
177
- try
178
- {
179
- oRange = selection.createRange() ;
180
- }
181
- catch (e)
182
- {
183
- return null ;
184
- }
185
-
186
- // IE might take the range object to the main window instead of inside the editor iframe window.
187
- // This is known to happen when the editor window has not been selected before (See #933).
188
- // We need to avoid that.
189
- if ( oRange.parentElement().document != doc )
190
- return null ;
191
-
192
- oRange.collapse( toStart === true ) ;
193
-
194
- // Paste a marker element at the collapsed range and get it from the DOM.
195
- var sMarkerId = 'fck_dom_range_temp_' + (new Date()).valueOf() + '_' + Math.floor(Math.random()*1000) ;
196
- oRange.pasteHTML( '<span id="' + sMarkerId + '"></span>' ) ;
197
-
198
- return doc.getElementById( sMarkerId ) ;
199
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckdomrangeiterator.js DELETED
@@ -1,327 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This class can be used to interate through nodes inside a range.
22
- *
23
- * During interation, the provided range can become invalid, due to document
24
- * mutations, so CreateBookmark() used to restore it after processing, if
25
- * needed.
26
- */
27
-
28
- var FCKDomRangeIterator = function( range )
29
- {
30
- /**
31
- * The FCKDomRange object that marks the interation boundaries.
32
- */
33
- this.Range = range ;
34
-
35
- /**
36
- * Indicates that <br> elements must be used as paragraph boundaries.
37
- */
38
- this.ForceBrBreak = false ;
39
-
40
- /**
41
- * Guarantees that the iterator will always return "real" block elements.
42
- * If "false", elements like <li>, <th> and <td> are returned. If "true", a
43
- * dedicated block element block element will be created inside those
44
- * elements to hold the selected content.
45
- */
46
- this.EnforceRealBlocks = false ;
47
- }
48
-
49
- FCKDomRangeIterator.CreateFromSelection = function( targetWindow )
50
- {
51
- var range = new FCKDomRange( targetWindow ) ;
52
- range.MoveToSelection() ;
53
- return new FCKDomRangeIterator( range ) ;
54
- }
55
-
56
- FCKDomRangeIterator.prototype =
57
- {
58
- /**
59
- * Get the next paragraph element. It automatically breaks the document
60
- * when necessary to generate block elements for the paragraphs.
61
- */
62
- GetNextParagraph : function()
63
- {
64
- // The block element to be returned.
65
- var block ;
66
-
67
- // The range object used to identify the paragraph contents.
68
- var range ;
69
-
70
- // Indicated that the current element in the loop is the last one.
71
- var isLast ;
72
-
73
- // Instructs to cleanup remaining BRs.
74
- var removePreviousBr ;
75
- var removeLastBr ;
76
-
77
- var boundarySet = this.ForceBrBreak ? FCKListsLib.ListBoundaries : FCKListsLib.BlockBoundaries ;
78
-
79
- // This is the first iteration. Let's initialize it.
80
- if ( !this._LastNode )
81
- {
82
- var range = this.Range.Clone() ;
83
- range.Expand( this.ForceBrBreak ? 'list_contents' : 'block_contents' ) ;
84
-
85
- this._NextNode = range.GetTouchedStartNode() ;
86
- this._LastNode = range.GetTouchedEndNode() ;
87
-
88
- // Let's reuse this variable.
89
- range = null ;
90
- }
91
-
92
- var currentNode = this._NextNode ;
93
- var lastNode = this._LastNode ;
94
-
95
- this._NextNode = null ;
96
-
97
- while ( currentNode )
98
- {
99
- // closeRange indicates that a paragraph boundary has been found,
100
- // so the range can be closed.
101
- var closeRange = false ;
102
-
103
- // includeNode indicates that the current node is good to be part
104
- // of the range. By default, any non-element node is ok for it.
105
- var includeNode = ( currentNode.nodeType != 1 ) ;
106
-
107
- var continueFromSibling = false ;
108
-
109
- // If it is an element node, let's check if it can be part of the
110
- // range.
111
- if ( !includeNode )
112
- {
113
- var nodeName = currentNode.nodeName.toLowerCase() ;
114
-
115
- if ( boundarySet[ nodeName ] && ( !FCKBrowserInfo.IsIE || currentNode.scopeName == 'HTML' ) )
116
- {
117
- // <br> boundaries must be part of the range. It will
118
- // happen only if ForceBrBreak.
119
- if ( nodeName == 'br' )
120
- includeNode = true ;
121
- else if ( !range && currentNode.childNodes.length == 0 && nodeName != 'hr' )
122
- {
123
- // If we have found an empty block, and haven't started
124
- // the range yet, it means we must return this block.
125
- block = currentNode ;
126
- isLast = currentNode == lastNode ;
127
- break ;
128
- }
129
-
130
- // The range must finish right before the boundary,
131
- // including possibly skipped empty spaces. (#1603)
132
- if ( range )
133
- {
134
- range.SetEnd( currentNode, 3, true ) ;
135
-
136
- // The found boundary must be set as the next one at this
137
- // point. (#1717)
138
- if ( nodeName != 'br' )
139
- this._NextNode = FCKDomTools.GetNextSourceNode( currentNode, true, null, lastNode ) || currentNode ;
140
- }
141
-
142
- closeRange = true ;
143
- }
144
- else
145
- {
146
- // If we have child nodes, let's check them.
147
- if ( currentNode.firstChild )
148
- {
149
- // If we don't have a range yet, let's start it.
150
- if ( !range )
151
- {
152
- range = new FCKDomRange( this.Range.Window ) ;
153
- range.SetStart( currentNode, 3, true ) ;
154
- }
155
-
156
- currentNode = currentNode.firstChild ;
157
- continue ;
158
- }
159
- includeNode = true ;
160
- }
161
- }
162
- else if ( currentNode.nodeType == 3 )
163
- {
164
- // Ignore normal whitespaces (i.e. not including &nbsp; or
165
- // other unicode whitespaces) before/after a block node.
166
- if ( /^[\r\n\t ]+$/.test( currentNode.nodeValue ) )
167
- includeNode = false ;
168
- }
169
-
170
- // The current node is good to be part of the range and we are
171
- // starting a new range, initialize it first.
172
- if ( includeNode && !range )
173
- {
174
- range = new FCKDomRange( this.Range.Window ) ;
175
- range.SetStart( currentNode, 3, true ) ;
176
- }
177
-
178
- // The last node has been found.
179
- isLast = ( ( !closeRange || includeNode ) && currentNode == lastNode ) ;
180
- // isLast = ( currentNode == lastNode && ( currentNode.nodeType != 1 || currentNode.childNodes.length == 0 ) ) ;
181
-
182
- // If we are in an element boundary, let's check if it is time
183
- // to close the range, otherwise we include the parent within it.
184
- if ( range && !closeRange )
185
- {
186
- while ( !currentNode.nextSibling && !isLast )
187
- {
188
- var parentNode = currentNode.parentNode ;
189
-
190
- if ( boundarySet[ parentNode.nodeName.toLowerCase() ] )
191
- {
192
- closeRange = true ;
193
- isLast = isLast || ( parentNode == lastNode ) ;
194
- break ;
195
- }
196
-
197
- currentNode = parentNode ;
198
- includeNode = true ;
199
- isLast = ( currentNode == lastNode ) ;
200
- continueFromSibling = true ;
201
- }
202
- }
203
-
204
- // Now finally include the node.
205
- if ( includeNode )
206
- range.SetEnd( currentNode, 4, true ) ;
207
-
208
- // We have found a block boundary. Let's close the range and move out of the
209
- // loop.
210
- if ( ( closeRange || isLast ) && range )
211
- {
212
- range._UpdateElementInfo() ;
213
-
214
- if ( range.StartNode == range.EndNode
215
- && range.StartNode.parentNode == range.StartBlockLimit
216
- && range.StartNode.getAttribute && range.StartNode.getAttribute( '_fck_bookmark' ) )
217
- range = null ;
218
- else
219
- break ;
220
- }
221
-
222
- if ( isLast )
223
- break ;
224
-
225
- currentNode = FCKDomTools.GetNextSourceNode( currentNode, continueFromSibling, null, lastNode ) ;
226
- }
227
-
228
- // Now, based on the processed range, look for (or create) the block to be returned.
229
- if ( !block )
230
- {
231
- // If no range has been found, this is the end.
232
- if ( !range )
233
- {
234
- this._NextNode = null ;
235
- return null ;
236
- }
237
-
238
- block = range.StartBlock ;
239
-
240
- if ( !block
241
- && !this.EnforceRealBlocks
242
- && range.StartBlockLimit.nodeName.IEquals( 'DIV', 'TH', 'TD' )
243
- && range.CheckStartOfBlock()
244
- && range.CheckEndOfBlock() )
245
- {
246
- block = range.StartBlockLimit ;
247
- }
248
- else if ( !block || ( this.EnforceRealBlocks && block.nodeName.toLowerCase() == 'li' ) )
249
- {
250
- // Create the fixed block.
251
- block = this.Range.Window.document.createElement( FCKConfig.EnterMode == 'p' ? 'p' : 'div' ) ;
252
-
253
- // Move the contents of the temporary range to the fixed block.
254
- range.ExtractContents().AppendTo( block ) ;
255
- FCKDomTools.TrimNode( block ) ;
256
-
257
- // Insert the fixed block into the DOM.
258
- range.InsertNode( block ) ;
259
-
260
- removePreviousBr = true ;
261
- removeLastBr = true ;
262
- }
263
- else if ( block.nodeName.toLowerCase() != 'li' )
264
- {
265
- // If the range doesn't includes the entire contents of the
266
- // block, we must split it, isolating the range in a dedicated
267
- // block.
268
- if ( !range.CheckStartOfBlock() || !range.CheckEndOfBlock() )
269
- {
270
- // The resulting block will be a clone of the current one.
271
- block = block.cloneNode( false ) ;
272
-
273
- // Extract the range contents, moving it to the new block.
274
- range.ExtractContents().AppendTo( block ) ;
275
- FCKDomTools.TrimNode( block ) ;
276
-
277
- // Split the block. At this point, the range will be in the
278
- // right position for our intents.
279
- var splitInfo = range.SplitBlock() ;
280
-
281
- removePreviousBr = !splitInfo.WasStartOfBlock ;
282
- removeLastBr = !splitInfo.WasEndOfBlock ;
283
-
284
- // Insert the new block into the DOM.
285
- range.InsertNode( block ) ;
286
- }
287
- }
288
- else if ( !isLast )
289
- {
290
- // LIs are returned as is, with all their children (due to the
291
- // nested lists). But, the next node is the node right after
292
- // the current range, which could be an <li> child (nested
293
- // lists) or the next sibling <li>.
294
-
295
- this._NextNode = block == lastNode ? null : FCKDomTools.GetNextSourceNode( range.EndNode, true, null, lastNode ) ;
296
- return block ;
297
- }
298
- }
299
-
300
- if ( removePreviousBr )
301
- {
302
- var previousSibling = block.previousSibling ;
303
- if ( previousSibling && previousSibling.nodeType == 1 )
304
- {
305
- if ( previousSibling.nodeName.toLowerCase() == 'br' )
306
- previousSibling.parentNode.removeChild( previousSibling ) ;
307
- else if ( previousSibling.lastChild && previousSibling.lastChild.nodeName.IEquals( 'br' ) )
308
- previousSibling.removeChild( previousSibling.lastChild ) ;
309
- }
310
- }
311
-
312
- if ( removeLastBr )
313
- {
314
- var lastChild = block.lastChild ;
315
- if ( lastChild && lastChild.nodeType == 1 && lastChild.nodeName.toLowerCase() == 'br' )
316
- block.removeChild( lastChild ) ;
317
- }
318
-
319
- // Get a reference for the next element. This is important because the
320
- // above block can be removed or changed, so we can rely on it for the
321
- // next interation.
322
- if ( !this._NextNode )
323
- this._NextNode = ( isLast || block == lastNode ) ? null : FCKDomTools.GetNextSourceNode( block, true, null, lastNode ) ;
324
-
325
- return block ;
326
- }
327
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckeditingarea.js DELETED
@@ -1,368 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKEditingArea Class: renders an editable area.
22
- */
23
-
24
- /**
25
- * @constructor
26
- * @param {String} targetElement The element that will hold the editing area. Any child element present in the target will be deleted.
27
- */
28
- var FCKEditingArea = function( targetElement )
29
- {
30
- this.TargetElement = targetElement ;
31
- this.Mode = FCK_EDITMODE_WYSIWYG ;
32
-
33
- if ( FCK.IECleanup )
34
- FCK.IECleanup.AddItem( this, FCKEditingArea_Cleanup ) ;
35
- }
36
-
37
-
38
- /**
39
- * @param {String} html The complete HTML for the page, including DOCTYPE and the <html> tag.
40
- */
41
- FCKEditingArea.prototype.Start = function( html, secondCall )
42
- {
43
- var eTargetElement = this.TargetElement ;
44
- var oTargetDocument = FCKTools.GetElementDocument( eTargetElement ) ;
45
-
46
- // Remove all child nodes from the target.
47
- while( eTargetElement.firstChild )
48
- eTargetElement.removeChild( eTargetElement.firstChild ) ;
49
-
50
- if ( this.Mode == FCK_EDITMODE_WYSIWYG )
51
- {
52
- // For FF, document.domain must be set only when different, otherwhise
53
- // we'll strangely have "Permission denied" issues.
54
- if ( FCK_IS_CUSTOM_DOMAIN )
55
- html = '<script>document.domain="' + FCK_RUNTIME_DOMAIN + '";</script>' + html ;
56
-
57
- // IE has a bug with the <base> tag... it must have a </base> closer,
58
- // otherwise the all successive tags will be set as children nodes of the <base>.
59
- if ( FCKBrowserInfo.IsIE )
60
- html = html.replace( /(<base[^>]*?)\s*\/?>(?!\s*<\/base>)/gi, '$1></base>' ) ;
61
- else if ( !secondCall )
62
- {
63
- // Gecko moves some tags out of the body to the head, so we must use
64
- // innerHTML to set the body contents (SF BUG 1526154).
65
-
66
- // Extract the BODY contents from the html.
67
- var oMatchBefore = html.match( FCKRegexLib.BeforeBody ) ;
68
- var oMatchAfter = html.match( FCKRegexLib.AfterBody ) ;
69
-
70
- if ( oMatchBefore && oMatchAfter )
71
- {
72
- var sBody = html.substr( oMatchBefore[1].length,
73
- html.length - oMatchBefore[1].length - oMatchAfter[1].length ) ; // This is the BODY tag contents.
74
-
75
- html =
76
- oMatchBefore[1] + // This is the HTML until the <body...> tag, inclusive.
77
- '&nbsp;' +
78
- oMatchAfter[1] ; // This is the HTML from the </body> tag, inclusive.
79
-
80
- // If nothing in the body, place a BOGUS tag so the cursor will appear.
81
- if ( FCKBrowserInfo.IsGecko && ( sBody.length == 0 || FCKRegexLib.EmptyParagraph.test( sBody ) ) )
82
- sBody = '<br type="_moz">' ;
83
-
84
- this._BodyHTML = sBody ;
85
-
86
- }
87
- else
88
- this._BodyHTML = html ; // Invalid HTML input.
89
- }
90
-
91
- // Create the editing area IFRAME.
92
- var oIFrame = this.IFrame = oTargetDocument.createElement( 'iframe' ) ;
93
-
94
- // IE: Avoid JavaScript errors thrown by the editing are source (like tags events).
95
- // See #1055.
96
- var sOverrideError = '<script type="text/javascript" _fcktemp="true">window.onerror=function(){return true;};</script>' ;
97
-
98
- oIFrame.frameBorder = 0 ;
99
- oIFrame.style.width = oIFrame.style.height = '100%' ;
100
-
101
- if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE )
102
- {
103
- window._FCKHtmlToLoad = html.replace( /<head>/i, '<head>' + sOverrideError ) ;
104
- oIFrame.src = 'javascript:void( (function(){' +
105
- 'document.open() ;' +
106
- 'document.domain="' + document.domain + '" ;' +
107
- 'document.write( window.parent._FCKHtmlToLoad );' +
108
- 'document.close() ;' +
109
- 'window.parent._FCKHtmlToLoad = null ;' +
110
- '})() )' ;
111
- }
112
- else if ( !FCKBrowserInfo.IsGecko )
113
- {
114
- // Firefox will render the tables inside the body in Quirks mode if the
115
- // source of the iframe is set to javascript. see #515
116
- oIFrame.src = 'javascript:void(0)' ;
117
- }
118
-
119
- // Append the new IFRAME to the target. For IE, it must be done after
120
- // setting the "src", to avoid the "secure/unsecure" message under HTTPS.
121
- eTargetElement.appendChild( oIFrame ) ;
122
-
123
- // Get the window and document objects used to interact with the newly created IFRAME.
124
- this.Window = oIFrame.contentWindow ;
125
-
126
- // IE: Avoid JavaScript errors thrown by the editing are source (like tags events).
127
- // TODO: This error handler is not being fired.
128
- // this.Window.onerror = function() { alert( 'Error!' ) ; return true ; }
129
-
130
- if ( !FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE )
131
- {
132
- var oDoc = this.Window.document ;
133
-
134
- oDoc.open() ;
135
- oDoc.write( html.replace( /<head>/i, '<head>' + sOverrideError ) ) ;
136
- oDoc.close() ;
137
- }
138
-
139
- if ( FCKBrowserInfo.IsAIR )
140
- FCKAdobeAIR.EditingArea_Start( oDoc, html ) ;
141
-
142
- // Firefox 1.0.x is buggy... ohh yes... so let's do it two times and it
143
- // will magically work.
144
- if ( FCKBrowserInfo.IsGecko10 && !secondCall )
145
- {
146
- this.Start( html, true ) ;
147
- return ;
148
- }
149
-
150
- if ( oIFrame.readyState && oIFrame.readyState != 'completed' )
151
- {
152
- var editArea = this ;
153
-
154
- // Using a IE alternative for DOMContentLoaded, similar to the
155
- // solution proposed at http://javascript.nwbox.com/IEContentLoaded/
156
- setTimeout( function()
157
- {
158
- try
159
- {
160
- editArea.Window.document.documentElement.doScroll("left") ;
161
- }
162
- catch(e)
163
- {
164
- setTimeout( arguments.callee, 0 ) ;
165
- return ;
166
- }
167
- editArea.Window._FCKEditingArea = editArea ;
168
- FCKEditingArea_CompleteStart.call( editArea.Window ) ;
169
- }, 0 ) ;
170
- }
171
- else
172
- {
173
- this.Window._FCKEditingArea = this ;
174
-
175
- // FF 1.0.x is buggy... we must wait a lot to enable editing because
176
- // sometimes the content simply disappears, for example when pasting
177
- // "bla1!<img src='some_url'>!bla2" in the source and then switching
178
- // back to design.
179
- if ( FCKBrowserInfo.IsGecko10 )
180
- this.Window.setTimeout( FCKEditingArea_CompleteStart, 500 ) ;
181
- else
182
- FCKEditingArea_CompleteStart.call( this.Window ) ;
183
- }
184
- }
185
- else
186
- {
187
- var eTextarea = this.Textarea = oTargetDocument.createElement( 'textarea' ) ;
188
- eTextarea.className = 'SourceField' ;
189
- eTextarea.dir = 'ltr' ;
190
- FCKDomTools.SetElementStyles( eTextarea,
191
- {
192
- width : '100%',
193
- height : '100%',
194
- border : 'none',
195
- resize : 'none',
196
- outline : 'none'
197
- } ) ;
198
- eTargetElement.appendChild( eTextarea ) ;
199
-
200
- eTextarea.value = html ;
201
-
202
- // Fire the "OnLoad" event.
203
- FCKTools.RunFunction( this.OnLoad ) ;
204
- }
205
- }
206
-
207
- // "this" here is FCKEditingArea.Window
208
- function FCKEditingArea_CompleteStart()
209
- {
210
- // On Firefox, the DOM takes a little to become available. So we must wait for it in a loop.
211
- if ( !this.document.body )
212
- {
213
- this.setTimeout( FCKEditingArea_CompleteStart, 50 ) ;
214
- return ;
215
- }
216
-
217
- var oEditorArea = this._FCKEditingArea ;
218
-
219
- // Save this reference to be re-used later.
220
- oEditorArea.Document = oEditorArea.Window.document ;
221
-
222
- oEditorArea.MakeEditable() ;
223
-
224
- // Fire the "OnLoad" event.
225
- FCKTools.RunFunction( oEditorArea.OnLoad ) ;
226
- }
227
-
228
- FCKEditingArea.prototype.MakeEditable = function()
229
- {
230
- var oDoc = this.Document ;
231
-
232
- if ( FCKBrowserInfo.IsIE )
233
- {
234
- // Kludge for #141 and #523
235
- oDoc.body.disabled = true ;
236
- oDoc.body.contentEditable = true ;
237
- oDoc.body.removeAttribute( "disabled" ) ;
238
-
239
- /* The following commands don't throw errors, but have no effect.
240
- oDoc.execCommand( 'AutoDetect', false, false ) ;
241
- oDoc.execCommand( 'KeepSelection', false, true ) ;
242
- */
243
- }
244
- else
245
- {
246
- try
247
- {
248
- // Disable Firefox 2 Spell Checker.
249
- oDoc.body.spellcheck = ( this.FFSpellChecker !== false ) ;
250
-
251
- if ( this._BodyHTML )
252
- {
253
- oDoc.body.innerHTML = this._BodyHTML ;
254
- oDoc.body.offsetLeft ; // Don't remove, this is a hack to fix Opera 9.50, see #2264.
255
- this._BodyHTML = null ;
256
- }
257
-
258
- oDoc.designMode = 'on' ;
259
-
260
- // Tell Gecko (Firefox 1.5+) to enable or not live resizing of objects (by Alfonso Martinez)
261
- oDoc.execCommand( 'enableObjectResizing', false, !FCKConfig.DisableObjectResizing ) ;
262
-
263
- // Disable the standard table editing features of Firefox.
264
- oDoc.execCommand( 'enableInlineTableEditing', false, !FCKConfig.DisableFFTableHandles ) ;
265
- }
266
- catch (e)
267
- {
268
- // In Firefox if the iframe is initially hidden it can't be set to designMode and it raises an exception
269
- // So we set up a DOM Mutation event Listener on the HTML, as it will raise several events when the document is visible again
270
- FCKTools.AddEventListener( this.Window.frameElement, 'DOMAttrModified', FCKEditingArea_Document_AttributeNodeModified ) ;
271
- }
272
-
273
- }
274
- }
275
-
276
- // This function processes the notifications of the DOM Mutation event on the document
277
- // We use it to know that the document will be ready to be editable again (or we hope so)
278
- function FCKEditingArea_Document_AttributeNodeModified( evt )
279
- {
280
- var editingArea = evt.currentTarget.contentWindow._FCKEditingArea ;
281
-
282
- // We want to run our function after the events no longer fire, so we can know that it's a stable situation
283
- if ( editingArea._timer )
284
- window.clearTimeout( editingArea._timer ) ;
285
-
286
- editingArea._timer = FCKTools.SetTimeout( FCKEditingArea_MakeEditableByMutation, 1000, editingArea ) ;
287
- }
288
-
289
- // This function ideally should be called after the document is visible, it does clean up of the
290
- // mutation tracking and tries again to make the area editable.
291
- function FCKEditingArea_MakeEditableByMutation()
292
- {
293
- // Clean up
294
- delete this._timer ;
295
- // Now we don't want to keep on getting this event
296
- FCKTools.RemoveEventListener( this.Window.frameElement, 'DOMAttrModified', FCKEditingArea_Document_AttributeNodeModified ) ;
297
- // Let's try now to set the editing area editable
298
- // If it fails it will set up the Mutation Listener again automatically
299
- this.MakeEditable() ;
300
- }
301
-
302
- FCKEditingArea.prototype.Focus = function()
303
- {
304
- try
305
- {
306
- if ( this.Mode == FCK_EDITMODE_WYSIWYG )
307
- {
308
- if ( FCKBrowserInfo.IsIE )
309
- this._FocusIE() ;
310
- else
311
- this.Window.focus() ;
312
- }
313
- else
314
- {
315
- var oDoc = FCKTools.GetElementDocument( this.Textarea ) ;
316
- if ( (!oDoc.hasFocus || oDoc.hasFocus() ) && oDoc.activeElement == this.Textarea )
317
- return ;
318
-
319
- this.Textarea.focus() ;
320
- }
321
- }
322
- catch(e) {}
323
- }
324
-
325
- FCKEditingArea.prototype._FocusIE = function()
326
- {
327
- // In IE it can happen that the document is in theory focused but the
328
- // active element is outside of it.
329
- this.Document.body.setActive() ;
330
-
331
- this.Window.focus() ;
332
-
333
- // Kludge for #141... yet more code to workaround IE bugs
334
- var range = this.Document.selection.createRange() ;
335
-
336
- var parentNode = range.parentElement() ;
337
- var parentTag = parentNode.nodeName.toLowerCase() ;
338
-
339
- // Only apply the fix when in a block, and the block is empty.
340
- if ( parentNode.childNodes.length > 0 ||
341
- !( FCKListsLib.BlockElements[parentTag] ||
342
- FCKListsLib.NonEmptyBlockElements[parentTag] ) )
343
- {
344
- return ;
345
- }
346
-
347
- // Force the selection to happen, in this way we guarantee the focus will
348
- // be there.
349
- range = new FCKDomRange( this.Window ) ;
350
- range.MoveToElementEditStart( parentNode ) ;
351
- range.Select() ;
352
- }
353
-
354
- function FCKEditingArea_Cleanup()
355
- {
356
- if ( this.Document )
357
- this.Document.body.innerHTML = "" ;
358
- this.TargetElement = null ;
359
- this.IFrame = null ;
360
- this.Document = null ;
361
- this.Textarea = null ;
362
-
363
- if ( this.Window )
364
- {
365
- this.Window._FCKEditingArea = null ;
366
- this.Window = null ;
367
- }
368
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckelementpath.js DELETED
@@ -1,89 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Manages the DOM ascensors element list of a specific DOM node
22
- * (limited to body, inclusive).
23
- */
24
-
25
- var FCKElementPath = function( lastNode )
26
- {
27
- var eBlock = null ;
28
- var eBlockLimit = null ;
29
-
30
- var aElements = new Array() ;
31
-
32
- var e = lastNode ;
33
- while ( e )
34
- {
35
- if ( e.nodeType == 1 )
36
- {
37
- if ( !this.LastElement )
38
- this.LastElement = e ;
39
-
40
- var sElementName = e.nodeName.toLowerCase() ;
41
- if ( FCKBrowserInfo.IsIE && e.scopeName != 'HTML' )
42
- sElementName = e.scopeName.toLowerCase() + ':' + sElementName ;
43
-
44
- if ( !eBlockLimit )
45
- {
46
- if ( !eBlock && FCKListsLib.PathBlockElements[ sElementName ] != null )
47
- eBlock = e ;
48
-
49
- if ( FCKListsLib.PathBlockLimitElements[ sElementName ] != null )
50
- {
51
- // DIV is considered the Block, if no block is available (#525)
52
- // and if it doesn't contain other blocks.
53
- if ( !eBlock && sElementName == 'div' && !FCKElementPath._CheckHasBlock( e ) )
54
- eBlock = e ;
55
- else
56
- eBlockLimit = e ;
57
- }
58
- }
59
-
60
- aElements.push( e ) ;
61
-
62
- if ( sElementName == 'body' )
63
- break ;
64
- }
65
- e = e.parentNode ;
66
- }
67
-
68
- this.Block = eBlock ;
69
- this.BlockLimit = eBlockLimit ;
70
- this.Elements = aElements ;
71
- }
72
-
73
- /**
74
- * Check if an element contains any block element.
75
- */
76
- FCKElementPath._CheckHasBlock = function( element )
77
- {
78
- var childNodes = element.childNodes ;
79
-
80
- for ( var i = 0, count = childNodes.length ; i < count ; i++ )
81
- {
82
- var child = childNodes[i] ;
83
-
84
- if ( child.nodeType == 1 && FCKListsLib.BlockElements[ child.nodeName.toLowerCase() ] )
85
- return true ;
86
- }
87
-
88
- return false ;
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckenterkey.js DELETED
@@ -1,708 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Controls the [Enter] keystroke behavior in a document.
22
- */
23
-
24
- /*
25
- * Constructor.
26
- * @targetDocument : the target document.
27
- * @enterMode : the behavior for the <Enter> keystroke.
28
- * May be "p", "div", "br". Default is "p".
29
- * @shiftEnterMode : the behavior for the <Shift>+<Enter> keystroke.
30
- * May be "p", "div", "br". Defaults to "br".
31
- */
32
- var FCKEnterKey = function( targetWindow, enterMode, shiftEnterMode, tabSpaces )
33
- {
34
- this.Window = targetWindow ;
35
- this.EnterMode = enterMode || 'p' ;
36
- this.ShiftEnterMode = shiftEnterMode || 'br' ;
37
-
38
- // Setup the Keystroke Handler.
39
- var oKeystrokeHandler = new FCKKeystrokeHandler( false ) ;
40
- oKeystrokeHandler._EnterKey = this ;
41
- oKeystrokeHandler.OnKeystroke = FCKEnterKey_OnKeystroke ;
42
-
43
- oKeystrokeHandler.SetKeystrokes( [
44
- [ 13 , 'Enter' ],
45
- [ SHIFT + 13, 'ShiftEnter' ],
46
- [ 8 , 'Backspace' ],
47
- [ CTRL + 8 , 'CtrlBackspace' ],
48
- [ 46 , 'Delete' ]
49
- ] ) ;
50
-
51
- this.TabText = '' ;
52
-
53
- // Safari by default inserts 4 spaces on TAB, while others make the editor
54
- // loose focus. So, we need to handle it here to not include those spaces.
55
- if ( tabSpaces > 0 || FCKBrowserInfo.IsSafari )
56
- {
57
- while ( tabSpaces-- )
58
- this.TabText += '\xa0' ;
59
-
60
- oKeystrokeHandler.SetKeystrokes( [ 9, 'Tab' ] );
61
- }
62
-
63
- oKeystrokeHandler.AttachToElement( targetWindow.document ) ;
64
- }
65
-
66
-
67
- function FCKEnterKey_OnKeystroke( keyCombination, keystrokeValue )
68
- {
69
- var oEnterKey = this._EnterKey ;
70
-
71
- try
72
- {
73
- switch ( keystrokeValue )
74
- {
75
- case 'Enter' :
76
- return oEnterKey.DoEnter() ;
77
- break ;
78
- case 'ShiftEnter' :
79
- return oEnterKey.DoShiftEnter() ;
80
- break ;
81
- case 'Backspace' :
82
- return oEnterKey.DoBackspace() ;
83
- break ;
84
- case 'Delete' :
85
- return oEnterKey.DoDelete() ;
86
- break ;
87
- case 'Tab' :
88
- return oEnterKey.DoTab() ;
89
- break ;
90
- case 'CtrlBackspace' :
91
- return oEnterKey.DoCtrlBackspace() ;
92
- break ;
93
- }
94
- }
95
- catch (e)
96
- {
97
- // If for any reason we are not able to handle it, go
98
- // ahead with the browser default behavior.
99
- }
100
-
101
- return false ;
102
- }
103
-
104
- /*
105
- * Executes the <Enter> key behavior.
106
- */
107
- FCKEnterKey.prototype.DoEnter = function( mode, hasShift )
108
- {
109
- // Save an undo snapshot before doing anything
110
- FCKUndo.SaveUndoStep() ;
111
-
112
- this._HasShift = ( hasShift === true ) ;
113
-
114
- var parentElement = FCKSelection.GetParentElement() ;
115
- var parentPath = new FCKElementPath( parentElement ) ;
116
- var sMode = mode || this.EnterMode ;
117
-
118
- if ( sMode == 'br' || parentPath.Block && parentPath.Block.tagName.toLowerCase() == 'pre' )
119
- return this._ExecuteEnterBr() ;
120
- else
121
- return this._ExecuteEnterBlock( sMode ) ;
122
- }
123
-
124
- /*
125
- * Executes the <Shift>+<Enter> key behavior.
126
- */
127
- FCKEnterKey.prototype.DoShiftEnter = function()
128
- {
129
- return this.DoEnter( this.ShiftEnterMode, true ) ;
130
- }
131
-
132
- /*
133
- * Executes the <Backspace> key behavior.
134
- */
135
- FCKEnterKey.prototype.DoBackspace = function()
136
- {
137
- var bCustom = false ;
138
-
139
- // Get the current selection.
140
- var oRange = new FCKDomRange( this.Window ) ;
141
- oRange.MoveToSelection() ;
142
-
143
- // Kludge for #247
144
- if ( FCKBrowserInfo.IsIE && this._CheckIsAllContentsIncluded( oRange, this.Window.document.body ) )
145
- {
146
- this._FixIESelectAllBug( oRange ) ;
147
- return true ;
148
- }
149
-
150
- var isCollapsed = oRange.CheckIsCollapsed() ;
151
-
152
- if ( !isCollapsed )
153
- {
154
- // Bug #327, Backspace with an img selection would activate the default action in IE.
155
- // Let's override that with our logic here.
156
- if ( FCKBrowserInfo.IsIE && this.Window.document.selection.type.toLowerCase() == "control" )
157
- {
158
- var controls = this.Window.document.selection.createRange() ;
159
- for ( var i = controls.length - 1 ; i >= 0 ; i-- )
160
- {
161
- var el = controls.item( i ) ;
162
- el.parentNode.removeChild( el ) ;
163
- }
164
- return true ;
165
- }
166
-
167
- return false ;
168
- }
169
-
170
- // On IE, it is better for us handle the deletion if the caret is preceeded
171
- // by a <br> (#1383).
172
- if ( FCKBrowserInfo.IsIE )
173
- {
174
- var previousElement = FCKDomTools.GetPreviousSourceElement( oRange.StartNode, true ) ;
175
-
176
- if ( previousElement && previousElement.nodeName.toLowerCase() == 'br' )
177
- {
178
- // Create a range that starts after the <br> and ends at the
179
- // current range position.
180
- var testRange = oRange.Clone() ;
181
- testRange.SetStart( previousElement, 4 ) ;
182
-
183
- // If that range is empty, we can proceed cleaning that <br> manually.
184
- if ( testRange.CheckIsEmpty() )
185
- {
186
- previousElement.parentNode.removeChild( previousElement ) ;
187
- return true ;
188
- }
189
- }
190
- }
191
-
192
- var oStartBlock = oRange.StartBlock ;
193
- var oEndBlock = oRange.EndBlock ;
194
-
195
- // The selection boundaries must be in the same "block limit" element
196
- if ( oRange.StartBlockLimit == oRange.EndBlockLimit && oStartBlock && oEndBlock )
197
- {
198
- if ( !isCollapsed )
199
- {
200
- var bEndOfBlock = oRange.CheckEndOfBlock() ;
201
-
202
- oRange.DeleteContents() ;
203
-
204
- if ( oStartBlock != oEndBlock )
205
- {
206
- oRange.SetStart(oEndBlock,1) ;
207
- oRange.SetEnd(oEndBlock,1) ;
208
-
209
- // if ( bEndOfBlock )
210
- // oEndBlock.parentNode.removeChild( oEndBlock ) ;
211
- }
212
-
213
- oRange.Select() ;
214
-
215
- bCustom = ( oStartBlock == oEndBlock ) ;
216
- }
217
-
218
- if ( oRange.CheckStartOfBlock() )
219
- {
220
- var oCurrentBlock = oRange.StartBlock ;
221
-
222
- var ePrevious = FCKDomTools.GetPreviousSourceElement( oCurrentBlock, true, [ 'BODY', oRange.StartBlockLimit.nodeName ], ['UL','OL'] ) ;
223
-
224
- bCustom = this._ExecuteBackspace( oRange, ePrevious, oCurrentBlock ) ;
225
- }
226
- else if ( FCKBrowserInfo.IsGeckoLike )
227
- {
228
- // Firefox and Opera (#1095) loose the selection when executing
229
- // CheckStartOfBlock, so we must reselect.
230
- oRange.Select() ;
231
- }
232
- }
233
-
234
- oRange.Release() ;
235
- return bCustom ;
236
- }
237
-
238
- FCKEnterKey.prototype.DoCtrlBackspace = function()
239
- {
240
- FCKUndo.SaveUndoStep() ;
241
- var oRange = new FCKDomRange( this.Window ) ;
242
- oRange.MoveToSelection() ;
243
- if ( FCKBrowserInfo.IsIE && this._CheckIsAllContentsIncluded( oRange, this.Window.document.body ) )
244
- {
245
- this._FixIESelectAllBug( oRange ) ;
246
- return true ;
247
- }
248
- return false ;
249
- }
250
-
251
- FCKEnterKey.prototype._ExecuteBackspace = function( range, previous, currentBlock )
252
- {
253
- var bCustom = false ;
254
-
255
- // We could be in a nested LI.
256
- if ( !previous && currentBlock && currentBlock.nodeName.IEquals( 'LI' ) && currentBlock.parentNode.parentNode.nodeName.IEquals( 'LI' ) )
257
- {
258
- this._OutdentWithSelection( currentBlock, range ) ;
259
- return true ;
260
- }
261
-
262
- if ( previous && previous.nodeName.IEquals( 'LI' ) )
263
- {
264
- var oNestedList = FCKDomTools.GetLastChild( previous, ['UL','OL'] ) ;
265
-
266
- while ( oNestedList )
267
- {
268
- previous = FCKDomTools.GetLastChild( oNestedList, 'LI' ) ;
269
- oNestedList = FCKDomTools.GetLastChild( previous, ['UL','OL'] ) ;
270
- }
271
- }
272
-
273
- if ( previous && currentBlock )
274
- {
275
- // If we are in a LI, and the previous block is not an LI, we must outdent it.
276
- if ( currentBlock.nodeName.IEquals( 'LI' ) && !previous.nodeName.IEquals( 'LI' ) )
277
- {
278
- this._OutdentWithSelection( currentBlock, range ) ;
279
- return true ;
280
- }
281
-
282
- // Take a reference to the parent for post processing cleanup.
283
- var oCurrentParent = currentBlock.parentNode ;
284
-
285
- var sPreviousName = previous.nodeName.toLowerCase() ;
286
- if ( FCKListsLib.EmptyElements[ sPreviousName ] != null || sPreviousName == 'table' )
287
- {
288
- FCKDomTools.RemoveNode( previous ) ;
289
- bCustom = true ;
290
- }
291
- else
292
- {
293
- // Remove the current block.
294
- FCKDomTools.RemoveNode( currentBlock ) ;
295
-
296
- // Remove any empty tag left by the block removal.
297
- while ( oCurrentParent.innerHTML.Trim().length == 0 )
298
- {
299
- var oParent = oCurrentParent.parentNode ;
300
- oParent.removeChild( oCurrentParent ) ;
301
- oCurrentParent = oParent ;
302
- }
303
-
304
- // Cleanup the previous and the current elements.
305
- FCKDomTools.LTrimNode( currentBlock ) ;
306
- FCKDomTools.RTrimNode( previous ) ;
307
-
308
- // Append a space to the previous.
309
- // Maybe it is not always desirable...
310
- // previous.appendChild( this.Window.document.createTextNode( ' ' ) ) ;
311
-
312
- // Set the range to the end of the previous element and bookmark it.
313
- range.SetStart( previous, 2, true ) ;
314
- range.Collapse( true ) ;
315
- var oBookmark = range.CreateBookmark( true ) ;
316
-
317
- // Move the contents of the block to the previous element and delete it.
318
- // But for some block types (e.g. table), moving the children to the previous block makes no sense.
319
- // So a check is needed. (See #1081)
320
- if ( ! currentBlock.tagName.IEquals( [ 'TABLE' ] ) )
321
- FCKDomTools.MoveChildren( currentBlock, previous ) ;
322
-
323
- // Place the selection at the bookmark.
324
- range.SelectBookmark( oBookmark ) ;
325
-
326
- bCustom = true ;
327
- }
328
- }
329
-
330
- return bCustom ;
331
- }
332
-
333
- /*
334
- * Executes the <Delete> key behavior.
335
- */
336
- FCKEnterKey.prototype.DoDelete = function()
337
- {
338
- // Save an undo snapshot before doing anything
339
- // This is to conform with the behavior seen in MS Word
340
- FCKUndo.SaveUndoStep() ;
341
-
342
- // The <Delete> has the same effect as the <Backspace>, so we have the same
343
- // results if we just move to the next block and apply the same <Backspace> logic.
344
-
345
- var bCustom = false ;
346
-
347
- // Get the current selection.
348
- var oRange = new FCKDomRange( this.Window ) ;
349
- oRange.MoveToSelection() ;
350
-
351
- // Kludge for #247
352
- if ( FCKBrowserInfo.IsIE && this._CheckIsAllContentsIncluded( oRange, this.Window.document.body ) )
353
- {
354
- this._FixIESelectAllBug( oRange ) ;
355
- return true ;
356
- }
357
-
358
- // There is just one special case for collapsed selections at the end of a block.
359
- if ( oRange.CheckIsCollapsed() && oRange.CheckEndOfBlock( FCKBrowserInfo.IsGeckoLike ) )
360
- {
361
- var oCurrentBlock = oRange.StartBlock ;
362
- var eCurrentCell = FCKTools.GetElementAscensor( oCurrentBlock, 'td' );
363
-
364
- var eNext = FCKDomTools.GetNextSourceElement( oCurrentBlock, true, [ oRange.StartBlockLimit.nodeName ],
365
- ['UL','OL','TR'], true ) ;
366
-
367
- // Bug #1323 : if we're in a table cell, and the next node belongs to a different cell, then don't
368
- // delete anything.
369
- if ( eCurrentCell )
370
- {
371
- var eNextCell = FCKTools.GetElementAscensor( eNext, 'td' );
372
- if ( eNextCell != eCurrentCell )
373
- return true ;
374
- }
375
-
376
- bCustom = this._ExecuteBackspace( oRange, oCurrentBlock, eNext ) ;
377
- }
378
-
379
- oRange.Release() ;
380
- return bCustom ;
381
- }
382
-
383
- /*
384
- * Executes the <Tab> key behavior.
385
- */
386
- FCKEnterKey.prototype.DoTab = function()
387
- {
388
- var oRange = new FCKDomRange( this.Window );
389
- oRange.MoveToSelection() ;
390
-
391
- // If the user pressed <tab> inside a table, we should give him the default behavior ( moving between cells )
392
- // instead of giving him more non-breaking spaces. (Bug #973)
393
- var node = oRange._Range.startContainer ;
394
- while ( node )
395
- {
396
- if ( node.nodeType == 1 )
397
- {
398
- var tagName = node.tagName.toLowerCase() ;
399
- if ( tagName == "tr" || tagName == "td" || tagName == "th" || tagName == "tbody" || tagName == "table" )
400
- return false ;
401
- else
402
- break ;
403
- }
404
- node = node.parentNode ;
405
- }
406
-
407
- if ( this.TabText )
408
- {
409
- oRange.DeleteContents() ;
410
- oRange.InsertNode( this.Window.document.createTextNode( this.TabText ) ) ;
411
- oRange.Collapse( false ) ;
412
- oRange.Select() ;
413
- }
414
- return true ;
415
- }
416
-
417
- FCKEnterKey.prototype._ExecuteEnterBlock = function( blockTag, range )
418
- {
419
- // Get the current selection.
420
- var oRange = range || new FCKDomRange( this.Window ) ;
421
-
422
- var oSplitInfo = oRange.SplitBlock( blockTag ) ;
423
-
424
- if ( oSplitInfo )
425
- {
426
- // Get the current blocks.
427
- var ePreviousBlock = oSplitInfo.PreviousBlock ;
428
- var eNextBlock = oSplitInfo.NextBlock ;
429
-
430
- var bIsStartOfBlock = oSplitInfo.WasStartOfBlock ;
431
- var bIsEndOfBlock = oSplitInfo.WasEndOfBlock ;
432
-
433
- // If there is one block under a list item, modify the split so that the list item gets split as well. (Bug #1647)
434
- if ( eNextBlock )
435
- {
436
- if ( eNextBlock.parentNode.nodeName.IEquals( 'li' ) )
437
- {
438
- FCKDomTools.BreakParent( eNextBlock, eNextBlock.parentNode ) ;
439
- FCKDomTools.MoveNode( eNextBlock, eNextBlock.nextSibling, true ) ;
440
- }
441
- }
442
- else if ( ePreviousBlock && ePreviousBlock.parentNode.nodeName.IEquals( 'li' ) )
443
- {
444
- FCKDomTools.BreakParent( ePreviousBlock, ePreviousBlock.parentNode ) ;
445
- oRange.MoveToElementEditStart( ePreviousBlock.nextSibling );
446
- FCKDomTools.MoveNode( ePreviousBlock, ePreviousBlock.previousSibling ) ;
447
- }
448
-
449
- // If we have both the previous and next blocks, it means that the
450
- // boundaries were on separated blocks, or none of them where on the
451
- // block limits (start/end).
452
- if ( !bIsStartOfBlock && !bIsEndOfBlock )
453
- {
454
- // If the next block is an <li> with another list tree as the first child
455
- // We'll need to append a placeholder or the list item wouldn't be editable. (Bug #1420)
456
- if ( eNextBlock.nodeName.IEquals( 'li' ) && eNextBlock.firstChild
457
- && eNextBlock.firstChild.nodeName.IEquals( ['ul', 'ol'] ) )
458
- eNextBlock.insertBefore( FCKTools.GetElementDocument( eNextBlock ).createTextNode( '\xa0' ), eNextBlock.firstChild ) ;
459
- // Move the selection to the end block.
460
- if ( eNextBlock )
461
- oRange.MoveToElementEditStart( eNextBlock ) ;
462
- }
463
- else
464
- {
465
- if ( bIsStartOfBlock && bIsEndOfBlock && ePreviousBlock.tagName.toUpperCase() == 'LI' )
466
- {
467
- oRange.MoveToElementStart( ePreviousBlock ) ;
468
- this._OutdentWithSelection( ePreviousBlock, oRange ) ;
469
- oRange.Release() ;
470
- return true ;
471
- }
472
-
473
- var eNewBlock ;
474
-
475
- if ( ePreviousBlock )
476
- {
477
- var sPreviousBlockTag = ePreviousBlock.tagName.toUpperCase() ;
478
-
479
- // If is a header tag, or we are in a Shift+Enter (#77),
480
- // create a new block element (later in the code).
481
- if ( !this._HasShift && !(/^H[1-6]$/).test( sPreviousBlockTag ) )
482
- {
483
- // Otherwise, duplicate the previous block.
484
- eNewBlock = FCKDomTools.CloneElement( ePreviousBlock ) ;
485
- }
486
- }
487
- else if ( eNextBlock )
488
- eNewBlock = FCKDomTools.CloneElement( eNextBlock ) ;
489
-
490
- if ( !eNewBlock )
491
- eNewBlock = this.Window.document.createElement( blockTag ) ;
492
-
493
- // Recreate the inline elements tree, which was available
494
- // before the hitting enter, so the same styles will be
495
- // available in the new block.
496
- var elementPath = oSplitInfo.ElementPath ;
497
- if ( elementPath )
498
- {
499
- for ( var i = 0, len = elementPath.Elements.length ; i < len ; i++ )
500
- {
501
- var element = elementPath.Elements[i] ;
502
-
503
- if ( element == elementPath.Block || element == elementPath.BlockLimit )
504
- break ;
505
-
506
- if ( FCKListsLib.InlineChildReqElements[ element.nodeName.toLowerCase() ] )
507
- {
508
- element = FCKDomTools.CloneElement( element ) ;
509
- FCKDomTools.MoveChildren( eNewBlock, element ) ;
510
- eNewBlock.appendChild( element ) ;
511
- }
512
- }
513
- }
514
-
515
- if ( FCKBrowserInfo.IsGeckoLike )
516
- FCKTools.AppendBogusBr( eNewBlock ) ;
517
-
518
- oRange.InsertNode( eNewBlock ) ;
519
-
520
- // This is tricky, but to make the new block visible correctly
521
- // we must select it.
522
- if ( FCKBrowserInfo.IsIE )
523
- {
524
- // Move the selection to the new block.
525
- oRange.MoveToElementEditStart( eNewBlock ) ;
526
- oRange.Select() ;
527
- }
528
-
529
- // Move the selection to the new block.
530
- oRange.MoveToElementEditStart( bIsStartOfBlock && !bIsEndOfBlock ? eNextBlock : eNewBlock ) ;
531
- }
532
-
533
- if ( FCKBrowserInfo.IsGeckoLike )
534
- {
535
- if ( eNextBlock )
536
- {
537
- // If we have split the block, adds a temporary span at the
538
- // range position and scroll relatively to it.
539
- var tmpNode = this.Window.document.createElement( 'span' ) ;
540
-
541
- // We need some content for Safari.
542
- tmpNode.innerHTML = '&nbsp;';
543
-
544
- oRange.InsertNode( tmpNode ) ;
545
- FCKDomTools.ScrollIntoView( tmpNode, false ) ;
546
- oRange.DeleteContents() ;
547
- }
548
- else
549
- {
550
- // We may use the above scroll logic for the new block case
551
- // too, but it gives some weird result with Opera.
552
- FCKDomTools.ScrollIntoView( eNextBlock || eNewBlock, false ) ;
553
- }
554
- }
555
-
556
- oRange.Select() ;
557
- }
558
-
559
- // Release the resources used by the range.
560
- oRange.Release() ;
561
-
562
- return true ;
563
- }
564
-
565
- FCKEnterKey.prototype._ExecuteEnterBr = function( blockTag )
566
- {
567
- // Get the current selection.
568
- var oRange = new FCKDomRange( this.Window ) ;
569
- oRange.MoveToSelection() ;
570
-
571
- // The selection boundaries must be in the same "block limit" element.
572
- if ( oRange.StartBlockLimit == oRange.EndBlockLimit )
573
- {
574
- oRange.DeleteContents() ;
575
-
576
- // Get the new selection (it is collapsed at this point).
577
- oRange.MoveToSelection() ;
578
-
579
- var bIsStartOfBlock = oRange.CheckStartOfBlock() ;
580
- var bIsEndOfBlock = oRange.CheckEndOfBlock() ;
581
-
582
- var sStartBlockTag = oRange.StartBlock ? oRange.StartBlock.tagName.toUpperCase() : '' ;
583
-
584
- var bHasShift = this._HasShift ;
585
- var bIsPre = false ;
586
-
587
- if ( !bHasShift && sStartBlockTag == 'LI' )
588
- return this._ExecuteEnterBlock( null, oRange ) ;
589
-
590
- // If we are at the end of a header block.
591
- if ( !bHasShift && bIsEndOfBlock && (/^H[1-6]$/).test( sStartBlockTag ) )
592
- {
593
- // Insert a BR after the current paragraph.
594
- FCKDomTools.InsertAfterNode( oRange.StartBlock, this.Window.document.createElement( 'br' ) ) ;
595
-
596
- // The space is required by Gecko only to make the cursor blink.
597
- if ( FCKBrowserInfo.IsGecko )
598
- FCKDomTools.InsertAfterNode( oRange.StartBlock, this.Window.document.createTextNode( '' ) ) ;
599
-
600
- // IE and Gecko have different behaviors regarding the position.
601
- oRange.SetStart( oRange.StartBlock.nextSibling, FCKBrowserInfo.IsIE ? 3 : 1 ) ;
602
- }
603
- else
604
- {
605
- var eLineBreak ;
606
- bIsPre = sStartBlockTag.IEquals( 'pre' ) ;
607
- if ( bIsPre )
608
- eLineBreak = this.Window.document.createTextNode( FCKBrowserInfo.IsIE ? '\r' : '\n' ) ;
609
- else
610
- eLineBreak = this.Window.document.createElement( 'br' ) ;
611
-
612
- oRange.InsertNode( eLineBreak ) ;
613
-
614
- // The space is required by Gecko only to make the cursor blink.
615
- if ( FCKBrowserInfo.IsGecko )
616
- FCKDomTools.InsertAfterNode( eLineBreak, this.Window.document.createTextNode( '' ) ) ;
617
-
618
- // If we are at the end of a block, we must be sure the bogus node is available in that block.
619
- if ( bIsEndOfBlock && FCKBrowserInfo.IsGeckoLike )
620
- FCKTools.AppendBogusBr( eLineBreak.parentNode ) ;
621
-
622
- if ( FCKBrowserInfo.IsIE )
623
- oRange.SetStart( eLineBreak, 4 ) ;
624
- else
625
- oRange.SetStart( eLineBreak.nextSibling, 1 ) ;
626
-
627
- if ( ! FCKBrowserInfo.IsIE )
628
- {
629
- var dummy = null ;
630
- if ( FCKBrowserInfo.IsOpera )
631
- dummy = this.Window.document.createElement( 'span' ) ;
632
- else
633
- dummy = this.Window.document.createElement( 'br' ) ;
634
-
635
- eLineBreak.parentNode.insertBefore( dummy, eLineBreak.nextSibling ) ;
636
-
637
- FCKDomTools.ScrollIntoView( dummy, false ) ;
638
-
639
- dummy.parentNode.removeChild( dummy ) ;
640
- }
641
- }
642
-
643
- // This collapse guarantees the cursor will be blinking.
644
- oRange.Collapse( true ) ;
645
-
646
- oRange.Select( bIsPre ) ;
647
- }
648
-
649
- // Release the resources used by the range.
650
- oRange.Release() ;
651
-
652
- return true ;
653
- }
654
-
655
- // Outdents a LI, maintaining the selection defined on a range.
656
- FCKEnterKey.prototype._OutdentWithSelection = function( li, range )
657
- {
658
- var oBookmark = range.CreateBookmark() ;
659
-
660
- FCKListHandler.OutdentListItem( li ) ;
661
-
662
- range.MoveToBookmark( oBookmark ) ;
663
- range.Select() ;
664
- }
665
-
666
- // Is all the contents under a node included by a range?
667
- FCKEnterKey.prototype._CheckIsAllContentsIncluded = function( range, node )
668
- {
669
- var startOk = false ;
670
- var endOk = false ;
671
-
672
- /*
673
- FCKDebug.Output( 'sc='+range.StartContainer.nodeName+
674
- ',so='+range._Range.startOffset+
675
- ',ec='+range.EndContainer.nodeName+
676
- ',eo='+range._Range.endOffset ) ;
677
- */
678
- if ( range.StartContainer == node || range.StartContainer == node.firstChild )
679
- startOk = ( range._Range.startOffset == 0 ) ;
680
-
681
- if ( range.EndContainer == node || range.EndContainer == node.lastChild )
682
- {
683
- var nodeLength = range.EndContainer.nodeType == 3 ? range.EndContainer.length : range.EndContainer.childNodes.length ;
684
- endOk = ( range._Range.endOffset == nodeLength ) ;
685
- }
686
-
687
- return startOk && endOk ;
688
- }
689
-
690
- // Kludge for #247
691
- FCKEnterKey.prototype._FixIESelectAllBug = function( range )
692
- {
693
- var doc = this.Window.document ;
694
- doc.body.innerHTML = '' ;
695
- var editBlock ;
696
- if ( FCKConfig.EnterMode.IEquals( ['div', 'p'] ) )
697
- {
698
- editBlock = doc.createElement( FCKConfig.EnterMode ) ;
699
- doc.body.appendChild( editBlock ) ;
700
- }
701
- else
702
- editBlock = doc.body ;
703
-
704
- range.MoveToNodeContents( editBlock ) ;
705
- range.Collapse( true ) ;
706
- range.Select() ;
707
- range.Release() ;
708
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckevents.js DELETED
@@ -1,71 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKEvents Class: used to handle events is a advanced way.
22
- */
23
-
24
- var FCKEvents = function( eventsOwner )
25
- {
26
- this.Owner = eventsOwner ;
27
- this._RegisteredEvents = new Object() ;
28
- }
29
-
30
- FCKEvents.prototype.AttachEvent = function( eventName, functionPointer )
31
- {
32
- var aTargets ;
33
-
34
- if ( !( aTargets = this._RegisteredEvents[ eventName ] ) )
35
- this._RegisteredEvents[ eventName ] = [ functionPointer ] ;
36
- else
37
- {
38
- // Check that the event handler isn't already registered with the same listener
39
- // It doesn't detect function pointers belonging to an object (at least in Gecko)
40
- if ( aTargets.IndexOf( functionPointer ) == -1 )
41
- aTargets.push( functionPointer ) ;
42
- }
43
- }
44
-
45
- FCKEvents.prototype.FireEvent = function( eventName, params )
46
- {
47
- var bReturnValue = true ;
48
-
49
- var oCalls = this._RegisteredEvents[ eventName ] ;
50
-
51
- if ( oCalls )
52
- {
53
- for ( var i = 0 ; i < oCalls.length ; i++ )
54
- {
55
- try
56
- {
57
- bReturnValue = ( oCalls[ i ]( this.Owner, params ) && bReturnValue ) ;
58
- }
59
- catch(e)
60
- {
61
- // Ignore the following error. It may happen if pointing to a
62
- // script not anymore available (#934):
63
- // -2146823277 = Can't execute code from a freed script
64
- if ( e.number != -2146823277 )
65
- throw e ;
66
- }
67
- }
68
- }
69
-
70
- return bReturnValue ;
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckhtmliterator.js DELETED
@@ -1,142 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This class can be used to interate through nodes inside a range.
22
- *
23
- * During interation, the provided range can become invalid, due to document
24
- * mutations, so CreateBookmark() used to restore it after processing, if
25
- * needed.
26
- */
27
-
28
- var FCKHtmlIterator = function( source )
29
- {
30
- this._sourceHtml = source ;
31
- }
32
- FCKHtmlIterator.prototype =
33
- {
34
- Next : function()
35
- {
36
- var sourceHtml = this._sourceHtml ;
37
- if ( sourceHtml == null )
38
- return null ;
39
-
40
- var match = FCKRegexLib.HtmlTag.exec( sourceHtml ) ;
41
- var isTag = false ;
42
- var value = "" ;
43
- if ( match )
44
- {
45
- if ( match.index > 0 )
46
- {
47
- value = sourceHtml.substr( 0, match.index ) ;
48
- this._sourceHtml = sourceHtml.substr( match.index ) ;
49
- }
50
- else
51
- {
52
- isTag = true ;
53
- value = match[0] ;
54
- this._sourceHtml = sourceHtml.substr( match[0].length ) ;
55
- }
56
- }
57
- else
58
- {
59
- value = sourceHtml ;
60
- this._sourceHtml = null ;
61
- }
62
- return { 'isTag' : isTag, 'value' : value } ;
63
- },
64
-
65
- Each : function( func )
66
- {
67
- var chunk ;
68
- while ( ( chunk = this.Next() ) )
69
- func( chunk.isTag, chunk.value ) ;
70
- }
71
- } ;
72
- /*
73
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
74
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
75
- *
76
- * == BEGIN LICENSE ==
77
- *
78
- * Licensed under the terms of any of the following licenses at your
79
- * choice:
80
- *
81
- * - GNU General Public License Version 2 or later (the "GPL")
82
- * http://www.gnu.org/licenses/gpl.html
83
- *
84
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
85
- * http://www.gnu.org/licenses/lgpl.html
86
- *
87
- * - Mozilla Public License Version 1.1 or later (the "MPL")
88
- * http://www.mozilla.org/MPL/MPL-1.1.html
89
- *
90
- * == END LICENSE ==
91
- *
92
- * This class can be used to interate through nodes inside a range.
93
- *
94
- * During interation, the provided range can become invalid, due to document
95
- * mutations, so CreateBookmark() used to restore it after processing, if
96
- * needed.
97
- */
98
-
99
- var FCKHtmlIterator = function( source )
100
- {
101
- this._sourceHtml = source ;
102
- }
103
- FCKHtmlIterator.prototype =
104
- {
105
- Next : function()
106
- {
107
- var sourceHtml = this._sourceHtml ;
108
- if ( sourceHtml == null )
109
- return null ;
110
-
111
- var match = FCKRegexLib.HtmlTag.exec( sourceHtml ) ;
112
- var isTag = false ;
113
- var value = "" ;
114
- if ( match )
115
- {
116
- if ( match.index > 0 )
117
- {
118
- value = sourceHtml.substr( 0, match.index ) ;
119
- this._sourceHtml = sourceHtml.substr( match.index ) ;
120
- }
121
- else
122
- {
123
- isTag = true ;
124
- value = match[0] ;
125
- this._sourceHtml = sourceHtml.substr( match[0].length ) ;
126
- }
127
- }
128
- else
129
- {
130
- value = sourceHtml ;
131
- this._sourceHtml = null ;
132
- }
133
- return { 'isTag' : isTag, 'value' : value } ;
134
- },
135
-
136
- Each : function( func )
137
- {
138
- var chunk ;
139
- while ( ( chunk = this.Next() ) )
140
- func( chunk.isTag, chunk.value ) ;
141
- }
142
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckicon.js DELETED
@@ -1,103 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKIcon Class: renders an icon from a single image, a strip or even a
22
- * spacer.
23
- */
24
-
25
- var FCKIcon = function( iconPathOrStripInfoArray )
26
- {
27
- var sTypeOf = iconPathOrStripInfoArray ? typeof( iconPathOrStripInfoArray ) : 'undefined' ;
28
- switch ( sTypeOf )
29
- {
30
- case 'number' :
31
- this.Path = FCKConfig.SkinPath + 'fck_strip.gif' ;
32
- this.Size = 16 ;
33
- this.Position = iconPathOrStripInfoArray ;
34
- break ;
35
-
36
- case 'undefined' :
37
- this.Path = FCK_SPACER_PATH ;
38
- break ;
39
-
40
- case 'string' :
41
- this.Path = iconPathOrStripInfoArray ;
42
- break ;
43
-
44
- default :
45
- // It is an array in the format [ StripFilePath, IconSize, IconPosition ]
46
- this.Path = iconPathOrStripInfoArray[0] ;
47
- this.Size = iconPathOrStripInfoArray[1] ;
48
- this.Position = iconPathOrStripInfoArray[2] ;
49
- }
50
- }
51
-
52
- FCKIcon.prototype.CreateIconElement = function( document )
53
- {
54
- var eIcon, eIconImage ;
55
-
56
- if ( this.Position ) // It is using an icons strip image.
57
- {
58
- var sPos = '-' + ( ( this.Position - 1 ) * this.Size ) + 'px' ;
59
-
60
- if ( FCKBrowserInfo.IsIE )
61
- {
62
- // <div class="TB_Button_Image"><img src="strip.gif" style="top:-16px"></div>
63
-
64
- eIcon = document.createElement( 'DIV' ) ;
65
-
66
- eIconImage = eIcon.appendChild( document.createElement( 'IMG' ) ) ;
67
- eIconImage.src = this.Path ;
68
- eIconImage.style.top = sPos ;
69
- }
70
- else
71
- {
72
- // <img class="TB_Button_Image" src="spacer.gif" style="background-position: 0px -16px;background-image: url(strip.gif);">
73
-
74
- eIcon = document.createElement( 'IMG' ) ;
75
- eIcon.src = FCK_SPACER_PATH ;
76
- eIcon.style.backgroundPosition = '0px ' + sPos ;
77
- eIcon.style.backgroundImage = 'url("' + this.Path + '")' ;
78
- }
79
- }
80
- else // It is using a single icon image.
81
- {
82
- if ( FCKBrowserInfo.IsIE )
83
- {
84
- // IE makes the button 1px higher if using the <img> directly, so we
85
- // are changing to the <div> system to clip the image correctly.
86
- eIcon = document.createElement( 'DIV' ) ;
87
-
88
- eIconImage = eIcon.appendChild( document.createElement( 'IMG' ) ) ;
89
- eIconImage.src = this.Path ? this.Path : FCK_SPACER_PATH ;
90
- }
91
- else
92
- {
93
- // This is not working well with IE. See notes above.
94
- // <img class="TB_Button_Image" src="smiley.gif">
95
- eIcon = document.createElement( 'IMG' ) ;
96
- eIcon.src = this.Path ? this.Path : FCK_SPACER_PATH ;
97
- }
98
- }
99
-
100
- eIcon.className = 'TB_Button_Image' ;
101
-
102
- return eIcon ;
103
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckiecleanup.js DELETED
@@ -1,68 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKIECleanup Class: a generic class used as a tool to remove IE leaks.
22
- */
23
-
24
- var FCKIECleanup = function( attachWindow )
25
- {
26
- // If the attachWindow already have a cleanup object, just use that one.
27
- if ( attachWindow._FCKCleanupObj )
28
- this.Items = attachWindow._FCKCleanupObj.Items ;
29
- else
30
- {
31
- this.Items = new Array() ;
32
-
33
- attachWindow._FCKCleanupObj = this ;
34
- FCKTools.AddEventListenerEx( attachWindow, 'unload', FCKIECleanup_Cleanup ) ;
35
- // attachWindow.attachEvent( 'onunload', FCKIECleanup_Cleanup ) ;
36
- }
37
- }
38
-
39
- FCKIECleanup.prototype.AddItem = function( dirtyItem, cleanupFunction )
40
- {
41
- this.Items.push( [ dirtyItem, cleanupFunction ] ) ;
42
- }
43
-
44
- function FCKIECleanup_Cleanup()
45
- {
46
- if ( !this._FCKCleanupObj || ( FCKConfig.MsWebBrowserControlCompat && !window.FCKUnloadFlag ) )
47
- return ;
48
-
49
- var aItems = this._FCKCleanupObj.Items ;
50
-
51
- while ( aItems.length > 0 )
52
- {
53
-
54
- // It is important to remove from the end to the beginning (pop()),
55
- // because of the order things get created in the editor. In the code,
56
- // elements in deeper position in the DOM are placed at the end of the
57
- // cleanup function, so we must cleanup then first, otherwise IE could
58
- // throw some crazy memory errors (IE bug).
59
- var oItem = aItems.pop() ;
60
- if ( oItem )
61
- oItem[1].call( oItem[0] ) ;
62
- }
63
-
64
- this._FCKCleanupObj = null ;
65
-
66
- if ( CollectGarbage )
67
- CollectGarbage() ;
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckimagepreloader.js DELETED
@@ -1,64 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Preload a list of images, firing an event when complete.
22
- */
23
-
24
- var FCKImagePreloader = function()
25
- {
26
- this._Images = new Array() ;
27
- }
28
-
29
- FCKImagePreloader.prototype =
30
- {
31
- AddImages : function( images )
32
- {
33
- if ( typeof( images ) == 'string' )
34
- images = images.split( ';' ) ;
35
-
36
- this._Images = this._Images.concat( images ) ;
37
- },
38
-
39
- Start : function()
40
- {
41
- var aImages = this._Images ;
42
- this._PreloadCount = aImages.length ;
43
-
44
- for ( var i = 0 ; i < aImages.length ; i++ )
45
- {
46
- var eImg = document.createElement( 'img' ) ;
47
- FCKTools.AddEventListenerEx( eImg, 'load', _FCKImagePreloader_OnImage, this ) ;
48
- FCKTools.AddEventListenerEx( eImg, 'error', _FCKImagePreloader_OnImage, this ) ;
49
- eImg.src = aImages[i] ;
50
-
51
- _FCKImagePreloader_ImageCache.push( eImg ) ;
52
- }
53
- }
54
- };
55
-
56
- // All preloaded images must be placed in a global array, otherwise the preload
57
- // magic will not happen.
58
- var _FCKImagePreloader_ImageCache = new Array() ;
59
-
60
- function _FCKImagePreloader_OnImage( ev, imagePreloader )
61
- {
62
- if ( (--imagePreloader._PreloadCount) == 0 && imagePreloader.OnComplete )
63
- imagePreloader.OnComplete() ;
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckkeystrokehandler.js DELETED
@@ -1,141 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Control keyboard keystroke combinations.
22
- */
23
-
24
- var FCKKeystrokeHandler = function( cancelCtrlDefaults )
25
- {
26
- this.Keystrokes = new Object() ;
27
- this.CancelCtrlDefaults = ( cancelCtrlDefaults !== false ) ;
28
- }
29
-
30
- /*
31
- * Listen to keystroke events in an element or DOM document object.
32
- * @target: The element or document to listen to keystroke events.
33
- */
34
- FCKKeystrokeHandler.prototype.AttachToElement = function( target )
35
- {
36
- // For newer browsers, it is enough to listen to the keydown event only.
37
- // Some browsers instead, don't cancel key events in the keydown, but in the
38
- // keypress. So we must do a longer trip in those cases.
39
- FCKTools.AddEventListenerEx( target, 'keydown', _FCKKeystrokeHandler_OnKeyDown, this ) ;
40
- if ( FCKBrowserInfo.IsGecko10 || FCKBrowserInfo.IsOpera || ( FCKBrowserInfo.IsGecko && FCKBrowserInfo.IsMac ) )
41
- FCKTools.AddEventListenerEx( target, 'keypress', _FCKKeystrokeHandler_OnKeyPress, this ) ;
42
- }
43
-
44
- /*
45
- * Sets a list of keystrokes. It can receive either a single array or "n"
46
- * arguments, each one being an array of 1 or 2 elemenst. The first element
47
- * is the keystroke combination, and the second is the value to assign to it.
48
- * If the second element is missing, the keystroke definition is removed.
49
- */
50
- FCKKeystrokeHandler.prototype.SetKeystrokes = function()
51
- {
52
- // Look through the arguments.
53
- for ( var i = 0 ; i < arguments.length ; i++ )
54
- {
55
- var keyDef = arguments[i] ;
56
-
57
- // If the configuration for the keystrokes is missing some element or has any extra comma
58
- // this item won't be valid, so skip it and keep on processing.
59
- if ( !keyDef )
60
- continue ;
61
-
62
- if ( typeof( keyDef[0] ) == 'object' ) // It is an array with arrays defining the keystrokes.
63
- this.SetKeystrokes.apply( this, keyDef ) ;
64
- else
65
- {
66
- if ( keyDef.length == 1 ) // If it has only one element, remove the keystroke.
67
- delete this.Keystrokes[ keyDef[0] ] ;
68
- else // Otherwise add it.
69
- this.Keystrokes[ keyDef[0] ] = keyDef[1] === true ? true : keyDef ;
70
- }
71
- }
72
- }
73
-
74
- function _FCKKeystrokeHandler_OnKeyDown( ev, keystrokeHandler )
75
- {
76
- // Get the key code.
77
- var keystroke = ev.keyCode || ev.which ;
78
-
79
- // Combine it with the CTRL, SHIFT and ALT states.
80
- var keyModifiers = 0 ;
81
-
82
- if ( ev.ctrlKey || ev.metaKey )
83
- keyModifiers += CTRL ;
84
-
85
- if ( ev.shiftKey )
86
- keyModifiers += SHIFT ;
87
-
88
- if ( ev.altKey )
89
- keyModifiers += ALT ;
90
-
91
- var keyCombination = keystroke + keyModifiers ;
92
-
93
- var cancelIt = keystrokeHandler._CancelIt = false ;
94
-
95
- // Look for its definition availability.
96
- var keystrokeValue = keystrokeHandler.Keystrokes[ keyCombination ] ;
97
-
98
- // FCKDebug.Output( 'KeyDown: ' + keyCombination + ' - Value: ' + keystrokeValue ) ;
99
-
100
- // If the keystroke is defined
101
- if ( keystrokeValue )
102
- {
103
- // If the keystroke has been explicitly set to "true" OR calling the
104
- // "OnKeystroke" event, it doesn't return "true", the default behavior
105
- // must be preserved.
106
- if ( keystrokeValue === true || !( keystrokeHandler.OnKeystroke && keystrokeHandler.OnKeystroke.apply( keystrokeHandler, keystrokeValue ) ) )
107
- return true ;
108
-
109
- cancelIt = true ;
110
- }
111
-
112
- // By default, it will cancel all combinations with the CTRL key only (except positioning keys).
113
- if ( cancelIt || ( keystrokeHandler.CancelCtrlDefaults && keyModifiers == CTRL && ( keystroke < 33 || keystroke > 40 ) ) )
114
- {
115
- keystrokeHandler._CancelIt = true ;
116
-
117
- if ( ev.preventDefault )
118
- return ev.preventDefault() ;
119
-
120
- ev.returnValue = false ;
121
- ev.cancelBubble = true ;
122
- return false ;
123
- }
124
-
125
- return true ;
126
- }
127
-
128
- function _FCKKeystrokeHandler_OnKeyPress( ev, keystrokeHandler )
129
- {
130
- if ( keystrokeHandler._CancelIt )
131
- {
132
- // FCKDebug.Output( 'KeyPress Cancel', 'Red') ;
133
-
134
- if ( ev.preventDefault )
135
- return ev.preventDefault() ;
136
-
137
- return false ;
138
- }
139
-
140
- return true ;
141
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckmenublock.js DELETED
@@ -1,153 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Renders a list of menu items.
22
- */
23
-
24
- var FCKMenuBlock = function()
25
- {
26
- this._Items = new Array() ;
27
- }
28
-
29
-
30
- FCKMenuBlock.prototype.Count = function()
31
- {
32
- return this._Items.length ;
33
- }
34
-
35
- FCKMenuBlock.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData )
36
- {
37
- var oItem = new FCKMenuItem( this, name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) ;
38
-
39
- oItem.OnClick = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnClick, this ) ;
40
- oItem.OnActivate = FCKTools.CreateEventListener( FCKMenuBlock_Item_OnActivate, this ) ;
41
-
42
- this._Items.push( oItem ) ;
43
-
44
- return oItem ;
45
- }
46
-
47
- FCKMenuBlock.prototype.AddSeparator = function()
48
- {
49
- this._Items.push( new FCKMenuSeparator() ) ;
50
- }
51
-
52
- FCKMenuBlock.prototype.RemoveAllItems = function()
53
- {
54
- this._Items = new Array() ;
55
-
56
- var eItemsTable = this._ItemsTable ;
57
- if ( eItemsTable )
58
- {
59
- while ( eItemsTable.rows.length > 0 )
60
- eItemsTable.deleteRow( 0 ) ;
61
- }
62
- }
63
-
64
- FCKMenuBlock.prototype.Create = function( parentElement )
65
- {
66
- if ( !this._ItemsTable )
67
- {
68
- if ( FCK.IECleanup )
69
- FCK.IECleanup.AddItem( this, FCKMenuBlock_Cleanup ) ;
70
-
71
- this._Window = FCKTools.GetElementWindow( parentElement ) ;
72
-
73
- var oDoc = FCKTools.GetElementDocument( parentElement ) ;
74
-
75
- var eTable = parentElement.appendChild( oDoc.createElement( 'table' ) ) ;
76
- eTable.cellPadding = 0 ;
77
- eTable.cellSpacing = 0 ;
78
-
79
- FCKTools.DisableSelection( eTable ) ;
80
-
81
- var oMainElement = eTable.insertRow(-1).insertCell(-1) ;
82
- oMainElement.className = 'MN_Menu' ;
83
-
84
- var eItemsTable = this._ItemsTable = oMainElement.appendChild( oDoc.createElement( 'table' ) ) ;
85
- eItemsTable.cellPadding = 0 ;
86
- eItemsTable.cellSpacing = 0 ;
87
- }
88
-
89
- for ( var i = 0 ; i < this._Items.length ; i++ )
90
- this._Items[i].Create( this._ItemsTable ) ;
91
- }
92
-
93
- /* Events */
94
-
95
- function FCKMenuBlock_Item_OnClick( clickedItem, menuBlock )
96
- {
97
- if ( menuBlock.Hide )
98
- menuBlock.Hide() ;
99
-
100
- FCKTools.RunFunction( menuBlock.OnClick, menuBlock, [ clickedItem ] ) ;
101
- }
102
-
103
- function FCKMenuBlock_Item_OnActivate( menuBlock )
104
- {
105
- var oActiveItem = menuBlock._ActiveItem ;
106
-
107
- if ( oActiveItem && oActiveItem != this )
108
- {
109
- // Set the focus to this menu block window (to fire OnBlur on opened panels).
110
- if ( !FCKBrowserInfo.IsIE && oActiveItem.HasSubMenu && !this.HasSubMenu )
111
- {
112
- menuBlock._Window.focus() ;
113
-
114
- // Due to the event model provided by Opera, we need to set
115
- // HasFocus here as the above focus() call will not fire the focus
116
- // event in the panel immediately (#1200).
117
- menuBlock.Panel.HasFocus = true ;
118
- }
119
-
120
- oActiveItem.Deactivate() ;
121
- }
122
-
123
- menuBlock._ActiveItem = this ;
124
- }
125
-
126
- function FCKMenuBlock_Cleanup()
127
- {
128
- this._Window = null ;
129
- this._ItemsTable = null ;
130
- }
131
-
132
- // ################# //
133
-
134
- var FCKMenuSeparator = function()
135
- {}
136
-
137
- FCKMenuSeparator.prototype.Create = function( parentTable )
138
- {
139
- var oDoc = FCKTools.GetElementDocument( parentTable ) ;
140
-
141
- var r = parentTable.insertRow(-1) ;
142
-
143
- var eCell = r.insertCell(-1) ;
144
- eCell.className = 'MN_Separator MN_Icon' ;
145
-
146
- eCell = r.insertCell(-1) ;
147
- eCell.className = 'MN_Separator' ;
148
- eCell.appendChild( oDoc.createElement( 'DIV' ) ).className = 'MN_Separator_Line' ;
149
-
150
- eCell = r.insertCell(-1) ;
151
- eCell.className = 'MN_Separator' ;
152
- eCell.appendChild( oDoc.createElement( 'DIV' ) ).className = 'MN_Separator_Line' ;
153
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckmenublockpanel.js DELETED
@@ -1,54 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This class is a menu block that behaves like a panel. It's a mix of the
22
- * FCKMenuBlock and FCKPanel classes.
23
- */
24
-
25
- var FCKMenuBlockPanel = function()
26
- {
27
- // Call the "base" constructor.
28
- FCKMenuBlock.call( this ) ;
29
- }
30
-
31
- FCKMenuBlockPanel.prototype = new FCKMenuBlock() ;
32
-
33
-
34
- // Override the create method.
35
- FCKMenuBlockPanel.prototype.Create = function()
36
- {
37
- var oPanel = this.Panel = ( this.Parent && this.Parent.Panel ? this.Parent.Panel.CreateChildPanel() : new FCKPanel() ) ;
38
- oPanel.AppendStyleSheet( FCKConfig.SkinEditorCSS ) ;
39
-
40
- // Call the "base" implementation.
41
- FCKMenuBlock.prototype.Create.call( this, oPanel.MainNode ) ;
42
- }
43
-
44
- FCKMenuBlockPanel.prototype.Show = function( x, y, relElement )
45
- {
46
- if ( !this.Panel.CheckIsOpened() )
47
- this.Panel.Show( x, y, relElement ) ;
48
- }
49
-
50
- FCKMenuBlockPanel.prototype.Hide = function()
51
- {
52
- if ( this.Panel.CheckIsOpened() )
53
- this.Panel.Hide() ;
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckmenuitem.js DELETED
@@ -1,161 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Defines and renders a menu items in a menu block.
22
- */
23
-
24
- var FCKMenuItem = function( parentMenuBlock, name, label, iconPathOrStripInfoArray, isDisabled, customData )
25
- {
26
- this.Name = name ;
27
- this.Label = label || name ;
28
- this.IsDisabled = isDisabled ;
29
-
30
- this.Icon = new FCKIcon( iconPathOrStripInfoArray ) ;
31
-
32
- this.SubMenu = new FCKMenuBlockPanel() ;
33
- this.SubMenu.Parent = parentMenuBlock ;
34
- this.SubMenu.OnClick = FCKTools.CreateEventListener( FCKMenuItem_SubMenu_OnClick, this ) ;
35
- this.CustomData = customData ;
36
-
37
- if ( FCK.IECleanup )
38
- FCK.IECleanup.AddItem( this, FCKMenuItem_Cleanup ) ;
39
- }
40
-
41
-
42
- FCKMenuItem.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData )
43
- {
44
- this.HasSubMenu = true ;
45
- return this.SubMenu.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) ;
46
- }
47
-
48
- FCKMenuItem.prototype.AddSeparator = function()
49
- {
50
- this.SubMenu.AddSeparator() ;
51
- }
52
-
53
- FCKMenuItem.prototype.Create = function( parentTable )
54
- {
55
- var bHasSubMenu = this.HasSubMenu ;
56
-
57
- var oDoc = FCKTools.GetElementDocument( parentTable ) ;
58
-
59
- // Add a row in the table to hold the menu item.
60
- var r = this.MainElement = parentTable.insertRow(-1) ;
61
- r.className = this.IsDisabled ? 'MN_Item_Disabled' : 'MN_Item' ;
62
-
63
- // Set the row behavior.
64
- if ( !this.IsDisabled )
65
- {
66
- FCKTools.AddEventListenerEx( r, 'mouseover', FCKMenuItem_OnMouseOver, [ this ] ) ;
67
- FCKTools.AddEventListenerEx( r, 'click', FCKMenuItem_OnClick, [ this ] ) ;
68
-
69
- if ( !bHasSubMenu )
70
- FCKTools.AddEventListenerEx( r, 'mouseout', FCKMenuItem_OnMouseOut, [ this ] ) ;
71
- }
72
-
73
- // Create the icon cell.
74
- var eCell = r.insertCell(-1) ;
75
- eCell.className = 'MN_Icon' ;
76
- eCell.appendChild( this.Icon.CreateIconElement( oDoc ) ) ;
77
-
78
- // Create the label cell.
79
- eCell = r.insertCell(-1) ;
80
- eCell.className = 'MN_Label' ;
81
- eCell.noWrap = true ;
82
- eCell.appendChild( oDoc.createTextNode( this.Label ) ) ;
83
-
84
- // Create the arrow cell and setup the sub menu panel (if needed).
85
- eCell = r.insertCell(-1) ;
86
- if ( bHasSubMenu )
87
- {
88
- eCell.className = 'MN_Arrow' ;
89
-
90
- // The arrow is a fixed size image.
91
- var eArrowImg = eCell.appendChild( oDoc.createElement( 'IMG' ) ) ;
92
- eArrowImg.src = FCK_IMAGES_PATH + 'arrow_' + FCKLang.Dir + '.gif' ;
93
- eArrowImg.width = 4 ;
94
- eArrowImg.height = 7 ;
95
-
96
- this.SubMenu.Create() ;
97
- this.SubMenu.Panel.OnHide = FCKTools.CreateEventListener( FCKMenuItem_SubMenu_OnHide, this ) ;
98
- }
99
- }
100
-
101
- FCKMenuItem.prototype.Activate = function()
102
- {
103
- this.MainElement.className = 'MN_Item_Over' ;
104
-
105
- if ( this.HasSubMenu )
106
- {
107
- // Show the child menu block. The ( +2, -2 ) correction is done because
108
- // of the padding in the skin. It is not a good solution because one
109
- // could change the skin and so the final result would not be accurate.
110
- // For now it is ok because we are controlling the skin.
111
- this.SubMenu.Show( this.MainElement.offsetWidth + 2, -2, this.MainElement ) ;
112
- }
113
-
114
- FCKTools.RunFunction( this.OnActivate, this ) ;
115
- }
116
-
117
- FCKMenuItem.prototype.Deactivate = function()
118
- {
119
- this.MainElement.className = 'MN_Item' ;
120
-
121
- if ( this.HasSubMenu )
122
- this.SubMenu.Hide() ;
123
- }
124
-
125
- /* Events */
126
-
127
- function FCKMenuItem_SubMenu_OnClick( clickedItem, listeningItem )
128
- {
129
- FCKTools.RunFunction( listeningItem.OnClick, listeningItem, [ clickedItem ] ) ;
130
- }
131
-
132
- function FCKMenuItem_SubMenu_OnHide( menuItem )
133
- {
134
- menuItem.Deactivate() ;
135
- }
136
-
137
- function FCKMenuItem_OnClick( ev, menuItem )
138
- {
139
- if ( menuItem.HasSubMenu )
140
- menuItem.Activate() ;
141
- else
142
- {
143
- menuItem.Deactivate() ;
144
- FCKTools.RunFunction( menuItem.OnClick, menuItem, [ menuItem ] ) ;
145
- }
146
- }
147
-
148
- function FCKMenuItem_OnMouseOver( ev, menuItem )
149
- {
150
- menuItem.Activate() ;
151
- }
152
-
153
- function FCKMenuItem_OnMouseOut( ev, menuItem )
154
- {
155
- menuItem.Deactivate() ;
156
- }
157
-
158
- function FCKMenuItem_Cleanup()
159
- {
160
- this.MainElement = null ;
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckpanel.js DELETED
@@ -1,463 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Component that creates floating panels. It is used by many
22
- * other components, like the toolbar items, context menu, etc...
23
- */
24
-
25
- var FCKPanel = function( parentWindow )
26
- {
27
- this.IsRTL = ( FCKLang.Dir == 'rtl' ) ;
28
- this.IsContextMenu = false ;
29
- this._LockCounter = 0 ;
30
-
31
- this._Window = parentWindow || window ;
32
-
33
- var oDocument ;
34
-
35
- if ( FCKBrowserInfo.IsIE )
36
- {
37
- // Create the Popup that will hold the panel.
38
- // The popup has to be created before playing with domain hacks, see #1666.
39
- this._Popup = this._Window.createPopup() ;
40
-
41
- // this._Window cannot be accessed while playing with domain hacks, but local variable is ok.
42
- // See #1666.
43
- var pDoc = this._Window.document ;
44
-
45
- // This is a trick to IE6 (not IE7). The original domain must be set
46
- // before creating the popup, so we are able to take a refence to the
47
- // document inside of it, and the set the proper domain for it. (#123)
48
- if ( FCK_IS_CUSTOM_DOMAIN && !FCKBrowserInfo.IsIE7 )
49
- {
50
- pDoc.domain = FCK_ORIGINAL_DOMAIN ;
51
- document.domain = FCK_ORIGINAL_DOMAIN ;
52
- }
53
-
54
- oDocument = this.Document = this._Popup.document ;
55
-
56
- // Set the proper domain inside the popup.
57
- if ( FCK_IS_CUSTOM_DOMAIN )
58
- {
59
- oDocument.domain = FCK_RUNTIME_DOMAIN ;
60
- pDoc.domain = FCK_RUNTIME_DOMAIN ;
61
- document.domain = FCK_RUNTIME_DOMAIN ;
62
- }
63
-
64
- FCK.IECleanup.AddItem( this, FCKPanel_Cleanup ) ;
65
- }
66
- else
67
- {
68
- var oIFrame = this._IFrame = this._Window.document.createElement('iframe') ;
69
- FCKTools.ResetStyles( oIFrame );
70
- oIFrame.src = 'javascript:void(0)' ;
71
- oIFrame.allowTransparency = true ;
72
- oIFrame.frameBorder = '0' ;
73
- oIFrame.scrolling = 'no' ;
74
- oIFrame.style.width = oIFrame.style.height = '0px' ;
75
- FCKDomTools.SetElementStyles( oIFrame,
76
- {
77
- position : 'absolute',
78
- zIndex : FCKConfig.FloatingPanelsZIndex
79
- } ) ;
80
-
81
- this._Window.document.body.appendChild( oIFrame ) ;
82
-
83
- var oIFrameWindow = oIFrame.contentWindow ;
84
-
85
- oDocument = this.Document = oIFrameWindow.document ;
86
-
87
- // Workaround for Safari 12256. Ticket #63
88
- var sBase = '' ;
89
- if ( FCKBrowserInfo.IsSafari )
90
- sBase = '<base href="' + window.document.location + '">' ;
91
-
92
- // Initialize the IFRAME document body.
93
- oDocument.open() ;
94
- oDocument.write( '<html><head>' + sBase + '<\/head><body style="margin:0px;padding:0px;"><\/body><\/html>' ) ;
95
- oDocument.close() ;
96
-
97
- if( FCKBrowserInfo.IsAIR )
98
- FCKAdobeAIR.Panel_Contructor( oDocument, window.document.location ) ;
99
-
100
- FCKTools.AddEventListenerEx( oIFrameWindow, 'focus', FCKPanel_Window_OnFocus, this ) ;
101
- FCKTools.AddEventListenerEx( oIFrameWindow, 'blur', FCKPanel_Window_OnBlur, this ) ;
102
- }
103
-
104
- oDocument.dir = FCKLang.Dir ;
105
-
106
- FCKTools.AddEventListener( oDocument, 'contextmenu', FCKTools.CancelEvent ) ;
107
-
108
-
109
- // Create the main DIV that is used as the panel base.
110
- this.MainNode = oDocument.body.appendChild( oDocument.createElement('DIV') ) ;
111
-
112
- // The "float" property must be set so Firefox calculates the size correctly.
113
- this.MainNode.style.cssFloat = this.IsRTL ? 'right' : 'left' ;
114
- }
115
-
116
-
117
- FCKPanel.prototype.AppendStyleSheet = function( styleSheet )
118
- {
119
- FCKTools.AppendStyleSheet( this.Document, styleSheet ) ;
120
- }
121
-
122
- FCKPanel.prototype.Preload = function( x, y, relElement )
123
- {
124
- // The offsetWidth and offsetHeight properties are not available if the
125
- // element is not visible. So we must "show" the popup with no size to
126
- // be able to use that values in the second call (IE only).
127
- if ( this._Popup )
128
- this._Popup.show( x, y, 0, 0, relElement ) ;
129
- }
130
-
131
- // Workaround for IE7 problem. See #1982
132
- // Submenus are restricted to the size of its parent, so we increase it as needed.
133
- // Returns true if the panel has been repositioned
134
- FCKPanel.prototype.ResizeForSubpanel = function( panel, width, height )
135
- {
136
- if ( !FCKBrowserInfo.IsIE7 )
137
- return false ;
138
-
139
- if ( !this._Popup.isOpen )
140
- {
141
- this.Subpanel = null ;
142
- return false ;
143
- }
144
-
145
- // If we are resetting the extra space
146
- if ( width == 0 && height == 0 )
147
- {
148
- // Another subpanel is being shown, so we must not shrink back
149
- if (this.Subpanel !== panel)
150
- return false ;
151
-
152
- // Reset values.
153
- // We leave the IncreasedY untouched to avoid vertical movement of the
154
- // menu if the submenu is higher than the main menu.
155
- this.Subpanel = null ;
156
- this.IncreasedX = 0 ;
157
- }
158
- else
159
- {
160
- this.Subpanel = panel ;
161
- // If the panel has already been increased enough, get out
162
- if ( ( this.IncreasedX >= width ) && ( this.IncreasedY >= height ) )
163
- return false ;
164
-
165
- this.IncreasedX = Math.max( this.IncreasedX, width ) ;
166
- this.IncreasedY = Math.max( this.IncreasedY, height ) ;
167
- }
168
-
169
- var x = this.ShowRect.x ;
170
- var w = this.IncreasedX ;
171
- if ( this.IsRTL )
172
- x = x - w ;
173
-
174
- // Horizontally increase as needed (sum of widths).
175
- // Vertically, use only the maximum of this menu or the submenu
176
- var finalWidth = this.ShowRect.w + w ;
177
- var finalHeight = Math.max( this.ShowRect.h, this.IncreasedY ) ;
178
- if ( this.ParentPanel )
179
- this.ParentPanel.ResizeForSubpanel( this, finalWidth, finalHeight ) ;
180
- this._Popup.show( x, this.ShowRect.y, finalWidth, finalHeight, this.RelativeElement ) ;
181
-
182
- return this.IsRTL ;
183
- }
184
-
185
- FCKPanel.prototype.Show = function( x, y, relElement, width, height )
186
- {
187
- var iMainWidth ;
188
- var eMainNode = this.MainNode ;
189
-
190
- if ( this._Popup )
191
- {
192
- // The offsetWidth and offsetHeight properties are not available if the
193
- // element is not visible. So we must "show" the popup with no size to
194
- // be able to use that values in the second call.
195
- this._Popup.show( x, y, 0, 0, relElement ) ;
196
-
197
- // The following lines must be place after the above "show", otherwise it
198
- // doesn't has the desired effect.
199
- FCKDomTools.SetElementStyles( eMainNode,
200
- {
201
- width : width ? width + 'px' : '',
202
- height : height ? height + 'px' : ''
203
- } ) ;
204
-
205
- iMainWidth = eMainNode.offsetWidth ;
206
-
207
- if ( FCKBrowserInfo.IsIE7 )
208
- {
209
- if (this.ParentPanel && this.ParentPanel.ResizeForSubpanel(this, iMainWidth, eMainNode.offsetHeight) )
210
- {
211
- // As the parent has moved, allow the browser to update its internal data, so the new position is correct.
212
- FCKTools.RunFunction( this.Show, this, [x, y, relElement] ) ;
213
- return ;
214
- }
215
- }
216
-
217
- if ( this.IsRTL )
218
- {
219
- if ( this.IsContextMenu )
220
- x = x - iMainWidth + 1 ;
221
- else if ( relElement )
222
- x = ( x * -1 ) + relElement.offsetWidth - iMainWidth ;
223
- }
224
-
225
- if ( FCKBrowserInfo.IsIE7 )
226
- {
227
- // Store the values that will be used by the ResizeForSubpanel function
228
- this.ShowRect = {x:x, y:y, w:iMainWidth, h:eMainNode.offsetHeight} ;
229
- this.IncreasedX = 0 ;
230
- this.IncreasedY = 0 ;
231
- this.RelativeElement = relElement ;
232
- }
233
-
234
- // Second call: Show the Popup at the specified location, with the correct size.
235
- this._Popup.show( x, y, iMainWidth, eMainNode.offsetHeight, relElement ) ;
236
-
237
- if ( this.OnHide )
238
- {
239
- if ( this._Timer )
240
- CheckPopupOnHide.call( this, true ) ;
241
-
242
- this._Timer = FCKTools.SetInterval( CheckPopupOnHide, 100, this ) ;
243
- }
244
- }
245
- else
246
- {
247
- // Do not fire OnBlur while the panel is opened.
248
- if ( typeof( FCK.ToolbarSet.CurrentInstance.FocusManager ) != 'undefined' )
249
- FCK.ToolbarSet.CurrentInstance.FocusManager.Lock() ;
250
-
251
- if ( this.ParentPanel )
252
- {
253
- this.ParentPanel.Lock() ;
254
-
255
- // Due to a bug on FF3, we must ensure that the parent panel will
256
- // blur (#1584).
257
- FCKPanel_Window_OnBlur( null, this.ParentPanel ) ;
258
- }
259
-
260
- // Toggle the iframe scrolling attribute to prevent the panel
261
- // scrollbars from disappearing in FF Mac. (#191)
262
- if ( FCKBrowserInfo.IsGecko && FCKBrowserInfo.IsMac )
263
- {
264
- this._IFrame.scrolling = '' ;
265
- FCKTools.RunFunction( function(){ this._IFrame.scrolling = 'no'; }, this ) ;
266
- }
267
-
268
- // Be sure we'll not have more than one Panel opened at the same time.
269
- // Do not unlock focus manager here because we're displaying another floating panel
270
- // instead of returning the editor to a "no panel" state (Bug #1514).
271
- if ( FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel &&
272
- FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel != this )
273
- FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel.Hide( false, true ) ;
274
-
275
- FCKDomTools.SetElementStyles( eMainNode,
276
- {
277
- width : width ? width + 'px' : '',
278
- height : height ? height + 'px' : ''
279
- } ) ;
280
-
281
- iMainWidth = eMainNode.offsetWidth ;
282
-
283
- if ( !width ) this._IFrame.width = 1 ;
284
- if ( !height ) this._IFrame.height = 1 ;
285
-
286
- // This is weird... but with Firefox, we must get the offsetWidth before
287
- // setting the _IFrame size (which returns "0"), and then after that,
288
- // to return the correct width. Remove the first step and it will not
289
- // work when the editor is in RTL.
290
- //
291
- // The "|| eMainNode.firstChild.offsetWidth" part has been added
292
- // for Opera compatibility (see #570).
293
- iMainWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ;
294
-
295
- // Base the popup coordinates upon the coordinates of relElement.
296
- var oPos = FCKTools.GetDocumentPosition( this._Window,
297
- relElement.nodeType == 9 ?
298
- ( FCKTools.IsStrictMode( relElement ) ? relElement.documentElement : relElement.body ) :
299
- relElement ) ;
300
-
301
- // Minus the offsets provided by any positioned parent element of the panel iframe.
302
- var positionedAncestor = FCKDomTools.GetPositionedAncestor( this._IFrame.parentNode ) ;
303
- if ( positionedAncestor )
304
- {
305
- var nPos = FCKTools.GetDocumentPosition( FCKTools.GetElementWindow( positionedAncestor ), positionedAncestor ) ;
306
- oPos.x -= nPos.x ;
307
- oPos.y -= nPos.y ;
308
- }
309
-
310
- if ( this.IsRTL && !this.IsContextMenu )
311
- x = ( x * -1 ) ;
312
-
313
- x += oPos.x ;
314
- y += oPos.y ;
315
-
316
- if ( this.IsRTL )
317
- {
318
- if ( this.IsContextMenu )
319
- x = x - iMainWidth + 1 ;
320
- else if ( relElement )
321
- x = x + relElement.offsetWidth - iMainWidth ;
322
- }
323
- else
324
- {
325
- var oViewPaneSize = FCKTools.GetViewPaneSize( this._Window ) ;
326
- var oScrollPosition = FCKTools.GetScrollPosition( this._Window ) ;
327
-
328
- var iViewPaneHeight = oViewPaneSize.Height + oScrollPosition.Y ;
329
- var iViewPaneWidth = oViewPaneSize.Width + oScrollPosition.X ;
330
-
331
- if ( ( x + iMainWidth ) > iViewPaneWidth )
332
- x -= x + iMainWidth - iViewPaneWidth ;
333
-
334
- if ( ( y + eMainNode.offsetHeight ) > iViewPaneHeight )
335
- y -= y + eMainNode.offsetHeight - iViewPaneHeight ;
336
- }
337
-
338
- // Set the context menu DIV in the specified location.
339
- FCKDomTools.SetElementStyles( this._IFrame,
340
- {
341
- left : x + 'px',
342
- top : y + 'px'
343
- } ) ;
344
-
345
- // Move the focus to the IFRAME so we catch the "onblur".
346
- this._IFrame.contentWindow.focus() ;
347
- this._IsOpened = true ;
348
-
349
- var me = this ;
350
- this._resizeTimer = setTimeout( function()
351
- {
352
- var iWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ;
353
- var iHeight = eMainNode.offsetHeight ;
354
- me._IFrame.style.width = iWidth + 'px' ;
355
- me._IFrame.style.height = iHeight + 'px' ;
356
-
357
- }, 0 ) ;
358
-
359
- FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel = this ;
360
- }
361
-
362
- FCKTools.RunFunction( this.OnShow, this ) ;
363
- }
364
-
365
- FCKPanel.prototype.Hide = function( ignoreOnHide, ignoreFocusManagerUnlock )
366
- {
367
- if ( this._Popup )
368
- this._Popup.hide() ;
369
- else
370
- {
371
- if ( !this._IsOpened || this._LockCounter > 0 )
372
- return ;
373
-
374
- // Enable the editor to fire the "OnBlur".
375
- if ( typeof( FCKFocusManager ) != 'undefined' && !ignoreFocusManagerUnlock )
376
- FCKFocusManager.Unlock() ;
377
-
378
- // It is better to set the sizes to 0, otherwise Firefox would have
379
- // rendering problems.
380
- this._IFrame.style.width = this._IFrame.style.height = '0px' ;
381
-
382
- this._IsOpened = false ;
383
-
384
- if ( this._resizeTimer )
385
- {
386
- clearTimeout( this._resizeTimer ) ;
387
- this._resizeTimer = null ;
388
- }
389
-
390
- if ( this.ParentPanel )
391
- this.ParentPanel.Unlock() ;
392
-
393
- if ( !ignoreOnHide )
394
- FCKTools.RunFunction( this.OnHide, this ) ;
395
- }
396
- }
397
-
398
- FCKPanel.prototype.CheckIsOpened = function()
399
- {
400
- if ( this._Popup )
401
- return this._Popup.isOpen ;
402
- else
403
- return this._IsOpened ;
404
- }
405
-
406
- FCKPanel.prototype.CreateChildPanel = function()
407
- {
408
- var oWindow = this._Popup ? FCKTools.GetDocumentWindow( this.Document ) : this._Window ;
409
-
410
- var oChildPanel = new FCKPanel( oWindow ) ;
411
- oChildPanel.ParentPanel = this ;
412
-
413
- return oChildPanel ;
414
- }
415
-
416
- FCKPanel.prototype.Lock = function()
417
- {
418
- this._LockCounter++ ;
419
- }
420
-
421
- FCKPanel.prototype.Unlock = function()
422
- {
423
- if ( --this._LockCounter == 0 && !this.HasFocus )
424
- this.Hide() ;
425
- }
426
-
427
- /* Events */
428
-
429
- function FCKPanel_Window_OnFocus( e, panel )
430
- {
431
- panel.HasFocus = true ;
432
- }
433
-
434
- function FCKPanel_Window_OnBlur( e, panel )
435
- {
436
- panel.HasFocus = false ;
437
-
438
- if ( panel._LockCounter == 0 )
439
- FCKTools.RunFunction( panel.Hide, panel ) ;
440
- }
441
-
442
- function CheckPopupOnHide( forceHide )
443
- {
444
- if ( forceHide || !this._Popup.isOpen )
445
- {
446
- window.clearInterval( this._Timer ) ;
447
- this._Timer = null ;
448
-
449
- if (this._Popup && this.ParentPanel && !forceHide)
450
- this.ParentPanel.ResizeForSubpanel(this, 0, 0) ;
451
-
452
- FCKTools.RunFunction( this.OnHide, this ) ;
453
- }
454
- }
455
-
456
- function FCKPanel_Cleanup()
457
- {
458
- this._Popup = null ;
459
- this._Window = null ;
460
- this.Document = null ;
461
- this.MainNode = null ;
462
- this.RelativeElement = null ;
463
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckplugin.js DELETED
@@ -1,56 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKPlugin Class: Represents a single plugin.
22
- */
23
-
24
- var FCKPlugin = function( name, availableLangs, basePath )
25
- {
26
- this.Name = name ;
27
- this.BasePath = basePath ? basePath : FCKConfig.PluginsPath ;
28
- this.Path = this.BasePath + name + '/' ;
29
-
30
- if ( !availableLangs || availableLangs.length == 0 )
31
- this.AvailableLangs = new Array() ;
32
- else
33
- this.AvailableLangs = availableLangs.split(',') ;
34
- }
35
-
36
- FCKPlugin.prototype.Load = function()
37
- {
38
- // Load the language file, if defined.
39
- if ( this.AvailableLangs.length > 0 )
40
- {
41
- var sLang ;
42
-
43
- // Check if the plugin has the language file for the active language.
44
- if ( this.AvailableLangs.IndexOf( FCKLanguageManager.ActiveLanguage.Code ) >= 0 )
45
- sLang = FCKLanguageManager.ActiveLanguage.Code ;
46
- else
47
- // Load the default language file (first one) if the current one is not available.
48
- sLang = this.AvailableLangs[0] ;
49
-
50
- // Add the main plugin script.
51
- LoadScript( this.Path + 'lang/' + sLang + '.js' ) ;
52
- }
53
-
54
- // Add the main plugin script.
55
- LoadScript( this.Path + 'fckplugin.js' ) ;
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckspecialcombo.js DELETED
@@ -1,376 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKSpecialCombo Class: represents a special combo.
22
- */
23
-
24
- var FCKSpecialCombo = function( caption, fieldWidth, panelWidth, panelMaxHeight, parentWindow )
25
- {
26
- // Default properties values.
27
- this.FieldWidth = fieldWidth || 100 ;
28
- this.PanelWidth = panelWidth || 150 ;
29
- this.PanelMaxHeight = panelMaxHeight || 150 ;
30
- this.Label = '&nbsp;' ;
31
- this.Caption = caption ;
32
- this.Tooltip = caption ;
33
- this.Style = FCK_TOOLBARITEM_ICONTEXT ;
34
-
35
- this.Enabled = true ;
36
-
37
- this.Items = new Object() ;
38
-
39
- this._Panel = new FCKPanel( parentWindow || window ) ;
40
- this._Panel.AppendStyleSheet( FCKConfig.SkinEditorCSS ) ;
41
- this._PanelBox = this._Panel.MainNode.appendChild( this._Panel.Document.createElement( 'DIV' ) ) ;
42
- this._PanelBox.className = 'SC_Panel' ;
43
- this._PanelBox.style.width = this.PanelWidth + 'px' ;
44
-
45
- this._PanelBox.innerHTML = '<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed"><tr><td nowrap></td></tr></table>' ;
46
-
47
- this._ItemsHolderEl = this._PanelBox.getElementsByTagName('TD')[0] ;
48
-
49
- if ( FCK.IECleanup )
50
- FCK.IECleanup.AddItem( this, FCKSpecialCombo_Cleanup ) ;
51
-
52
- // this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ;
53
- // this._Panel.Create() ;
54
- // this._Panel.PanelDiv.className += ' SC_Panel' ;
55
- // this._Panel.PanelDiv.innerHTML = '<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed"><tr><td nowrap></td></tr></table>' ;
56
- // this._ItemsHolderEl = this._Panel.PanelDiv.getElementsByTagName('TD')[0] ;
57
- }
58
-
59
- function FCKSpecialCombo_ItemOnMouseOver()
60
- {
61
- this.className += ' SC_ItemOver' ;
62
- }
63
-
64
- function FCKSpecialCombo_ItemOnMouseOut()
65
- {
66
- this.className = this.originalClass ;
67
- }
68
-
69
- function FCKSpecialCombo_ItemOnClick( ev, specialCombo, itemId )
70
- {
71
- this.className = this.originalClass ;
72
-
73
- specialCombo._Panel.Hide() ;
74
-
75
- specialCombo.SetLabel( this.FCKItemLabel ) ;
76
-
77
- if ( typeof( specialCombo.OnSelect ) == 'function' )
78
- specialCombo.OnSelect( itemId, this ) ;
79
- }
80
-
81
- FCKSpecialCombo.prototype.ClearItems = function ()
82
- {
83
- if ( this.Items )
84
- this.Items = {} ;
85
-
86
- var itemsholder = this._ItemsHolderEl ;
87
- while ( itemsholder.firstChild )
88
- itemsholder.removeChild( itemsholder.firstChild ) ;
89
- }
90
-
91
- FCKSpecialCombo.prototype.AddItem = function( id, html, label, bgColor )
92
- {
93
- // <div class="SC_Item" onmouseover="this.className='SC_Item SC_ItemOver';" onmouseout="this.className='SC_Item';"><b>Bold 1</b></div>
94
- var oDiv = this._ItemsHolderEl.appendChild( this._Panel.Document.createElement( 'DIV' ) ) ;
95
- oDiv.className = oDiv.originalClass = 'SC_Item' ;
96
- oDiv.innerHTML = html ;
97
- oDiv.FCKItemLabel = label || id ;
98
- oDiv.Selected = false ;
99
-
100
- // In IE, the width must be set so the borders are shown correctly when the content overflows.
101
- if ( FCKBrowserInfo.IsIE )
102
- oDiv.style.width = '100%' ;
103
-
104
- if ( bgColor )
105
- oDiv.style.backgroundColor = bgColor ;
106
-
107
- FCKTools.AddEventListenerEx( oDiv, 'mouseover', FCKSpecialCombo_ItemOnMouseOver ) ;
108
- FCKTools.AddEventListenerEx( oDiv, 'mouseout', FCKSpecialCombo_ItemOnMouseOut ) ;
109
- FCKTools.AddEventListenerEx( oDiv, 'click', FCKSpecialCombo_ItemOnClick, [ this, id ] ) ;
110
-
111
- this.Items[ id.toString().toLowerCase() ] = oDiv ;
112
-
113
- return oDiv ;
114
- }
115
-
116
- FCKSpecialCombo.prototype.SelectItem = function( item )
117
- {
118
- if ( typeof item == 'string' )
119
- item = this.Items[ item.toString().toLowerCase() ] ;
120
-
121
- if ( item )
122
- {
123
- item.className = item.originalClass = 'SC_ItemSelected' ;
124
- item.Selected = true ;
125
- }
126
- }
127
-
128
- FCKSpecialCombo.prototype.SelectItemByLabel = function( itemLabel, setLabel )
129
- {
130
- for ( var id in this.Items )
131
- {
132
- var oDiv = this.Items[id] ;
133
-
134
- if ( oDiv.FCKItemLabel == itemLabel )
135
- {
136
- oDiv.className = oDiv.originalClass = 'SC_ItemSelected' ;
137
- oDiv.Selected = true ;
138
-
139
- if ( setLabel )
140
- this.SetLabel( itemLabel ) ;
141
- }
142
- }
143
- }
144
-
145
- FCKSpecialCombo.prototype.DeselectAll = function( clearLabel )
146
- {
147
- for ( var i in this.Items )
148
- {
149
- if ( !this.Items[i] ) continue;
150
- this.Items[i].className = this.Items[i].originalClass = 'SC_Item' ;
151
- this.Items[i].Selected = false ;
152
- }
153
-
154
- if ( clearLabel )
155
- this.SetLabel( '' ) ;
156
- }
157
-
158
- FCKSpecialCombo.prototype.SetLabelById = function( id )
159
- {
160
- id = id ? id.toString().toLowerCase() : '' ;
161
-
162
- var oDiv = this.Items[ id ] ;
163
- this.SetLabel( oDiv ? oDiv.FCKItemLabel : '' ) ;
164
- }
165
-
166
- FCKSpecialCombo.prototype.SetLabel = function( text )
167
- {
168
- text = ( !text || text.length == 0 ) ? '&nbsp;' : text ;
169
-
170
- if ( text == this.Label )
171
- return ;
172
-
173
- this.Label = text ;
174
-
175
- var labelEl = this._LabelEl ;
176
- if ( labelEl )
177
- {
178
- labelEl.innerHTML = text ;
179
-
180
- // It may happen that the label is some HTML, including tags. This
181
- // would be a problem because when the user click on those tags, the
182
- // combo will get the selection from the editing area. So we must
183
- // disable any kind of selection here.
184
- FCKTools.DisableSelection( labelEl ) ;
185
- }
186
- }
187
-
188
- FCKSpecialCombo.prototype.SetEnabled = function( isEnabled )
189
- {
190
- this.Enabled = isEnabled ;
191
-
192
- // In IE it can happen when the page is reloaded that _OuterTable is null, so check its existence
193
- if ( this._OuterTable )
194
- this._OuterTable.className = isEnabled ? '' : 'SC_FieldDisabled' ;
195
- }
196
-
197
- FCKSpecialCombo.prototype.Create = function( targetElement )
198
- {
199
- var oDoc = FCKTools.GetElementDocument( targetElement ) ;
200
- var eOuterTable = this._OuterTable = targetElement.appendChild( oDoc.createElement( 'TABLE' ) ) ;
201
- eOuterTable.cellPadding = 0 ;
202
- eOuterTable.cellSpacing = 0 ;
203
-
204
- eOuterTable.insertRow(-1) ;
205
-
206
- var sClass ;
207
- var bShowLabel ;
208
-
209
- switch ( this.Style )
210
- {
211
- case FCK_TOOLBARITEM_ONLYICON :
212
- sClass = 'TB_ButtonType_Icon' ;
213
- bShowLabel = false;
214
- break ;
215
- case FCK_TOOLBARITEM_ONLYTEXT :
216
- sClass = 'TB_ButtonType_Text' ;
217
- bShowLabel = false;
218
- break ;
219
- case FCK_TOOLBARITEM_ICONTEXT :
220
- bShowLabel = true;
221
- break ;
222
- }
223
-
224
- if ( this.Caption && this.Caption.length > 0 && bShowLabel )
225
- {
226
- var oCaptionCell = eOuterTable.rows[0].insertCell(-1) ;
227
- oCaptionCell.innerHTML = this.Caption ;
228
- oCaptionCell.className = 'SC_FieldCaption' ;
229
- }
230
-
231
- // Create the main DIV element.
232
- var oField = FCKTools.AppendElement( eOuterTable.rows[0].insertCell(-1), 'div' ) ;
233
- if ( bShowLabel )
234
- {
235
- oField.className = 'SC_Field' ;
236
- oField.style.width = this.FieldWidth + 'px' ;
237
- oField.innerHTML = '<table width="100%" cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldLabel"><label>&nbsp;</label></td><td class="SC_FieldButton">&nbsp;</td></tr></tbody></table>' ;
238
-
239
- this._LabelEl = oField.getElementsByTagName('label')[0] ; // Memory Leak
240
- this._LabelEl.innerHTML = this.Label ;
241
- }
242
- else
243
- {
244
- oField.className = 'TB_Button_Off' ;
245
- //oField.innerHTML = '<span className="SC_FieldCaption">' + this.Caption + '<table cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldButton" style="border-left: none;">&nbsp;</td></tr></tbody></table>' ;
246
- //oField.innerHTML = '<table cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldButton" style="border-left: none;">&nbsp;</td></tr></tbody></table>' ;
247
-
248
- // Gets the correct CSS class to use for the specified style (param).
249
- oField.innerHTML = '<table title="' + this.Tooltip + '" class="' + sClass + '" cellspacing="0" cellpadding="0" border="0">' +
250
- '<tr>' +
251
- //'<td class="TB_Icon"><img src="' + FCKConfig.SkinPath + 'toolbar/' + this.Command.Name.toLowerCase() + '.gif" width="21" height="21"></td>' +
252
- '<td><img class="TB_Button_Padding" src="' + FCK_SPACER_PATH + '" /></td>' +
253
- '<td class="TB_Text">' + this.Caption + '</td>' +
254
- '<td><img class="TB_Button_Padding" src="' + FCK_SPACER_PATH + '" /></td>' +
255
- '<td class="TB_ButtonArrow"><img src="' + FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif" width="5" height="3"></td>' +
256
- '<td><img class="TB_Button_Padding" src="' + FCK_SPACER_PATH + '" /></td>' +
257
- '</tr>' +
258
- '</table>' ;
259
- }
260
-
261
-
262
- // Events Handlers
263
-
264
- FCKTools.AddEventListenerEx( oField, 'mouseover', FCKSpecialCombo_OnMouseOver, this ) ;
265
- FCKTools.AddEventListenerEx( oField, 'mouseout', FCKSpecialCombo_OnMouseOut, this ) ;
266
- FCKTools.AddEventListenerEx( oField, 'click', FCKSpecialCombo_OnClick, this ) ;
267
-
268
- FCKTools.DisableSelection( this._Panel.Document.body ) ;
269
- }
270
-
271
- function FCKSpecialCombo_Cleanup()
272
- {
273
- this._LabelEl = null ;
274
- this._OuterTable = null ;
275
- this._ItemsHolderEl = null ;
276
- this._PanelBox = null ;
277
-
278
- if ( this.Items )
279
- {
280
- for ( var key in this.Items )
281
- this.Items[key] = null ;
282
- }
283
- }
284
-
285
- function FCKSpecialCombo_OnMouseOver( ev, specialCombo )
286
- {
287
- if ( specialCombo.Enabled )
288
- {
289
- switch ( specialCombo.Style )
290
- {
291
- case FCK_TOOLBARITEM_ONLYICON :
292
- this.className = 'TB_Button_On_Over';
293
- break ;
294
- case FCK_TOOLBARITEM_ONLYTEXT :
295
- this.className = 'TB_Button_On_Over';
296
- break ;
297
- case FCK_TOOLBARITEM_ICONTEXT :
298
- this.className = 'SC_Field SC_FieldOver' ;
299
- break ;
300
- }
301
- }
302
- }
303
-
304
- function FCKSpecialCombo_OnMouseOut( ev, specialCombo )
305
- {
306
- switch ( specialCombo.Style )
307
- {
308
- case FCK_TOOLBARITEM_ONLYICON :
309
- this.className = 'TB_Button_Off';
310
- break ;
311
- case FCK_TOOLBARITEM_ONLYTEXT :
312
- this.className = 'TB_Button_Off';
313
- break ;
314
- case FCK_TOOLBARITEM_ICONTEXT :
315
- this.className='SC_Field' ;
316
- break ;
317
- }
318
- }
319
-
320
- function FCKSpecialCombo_OnClick( e, specialCombo )
321
- {
322
- // For Mozilla we must stop the event propagation to avoid it hiding
323
- // the panel because of a click outside of it.
324
- // if ( e )
325
- // {
326
- // e.stopPropagation() ;
327
- // FCKPanelEventHandlers.OnDocumentClick( e ) ;
328
- // }
329
-
330
- if ( specialCombo.Enabled )
331
- {
332
- var oPanel = specialCombo._Panel ;
333
- var oPanelBox = specialCombo._PanelBox ;
334
- var oItemsHolder = specialCombo._ItemsHolderEl ;
335
- var iMaxHeight = specialCombo.PanelMaxHeight ;
336
-
337
- if ( specialCombo.OnBeforeClick )
338
- specialCombo.OnBeforeClick( specialCombo ) ;
339
-
340
- // This is a tricky thing. We must call the "Load" function, otherwise
341
- // it will not be possible to retrieve "oItemsHolder.offsetHeight" (IE only).
342
- if ( FCKBrowserInfo.IsIE )
343
- oPanel.Preload( 0, this.offsetHeight, this ) ;
344
-
345
- if ( oItemsHolder.offsetHeight > iMaxHeight )
346
- // {
347
- oPanelBox.style.height = iMaxHeight + 'px' ;
348
-
349
- // if ( FCKBrowserInfo.IsGecko )
350
- // oPanelBox.style.overflow = '-moz-scrollbars-vertical' ;
351
- // }
352
- else
353
- oPanelBox.style.height = '' ;
354
-
355
- // oPanel.PanelDiv.style.width = specialCombo.PanelWidth + 'px' ;
356
-
357
- oPanel.Show( 0, this.offsetHeight, this ) ;
358
- }
359
-
360
- // return false ;
361
- }
362
-
363
- /*
364
- Sample Combo Field HTML output:
365
-
366
- <div class="SC_Field" style="width: 80px;">
367
- <table width="100%" cellpadding="0" cellspacing="0" style="table-layout: fixed;">
368
- <tbody>
369
- <tr>
370
- <td class="SC_FieldLabel"><label>&nbsp;</label></td>
371
- <td class="SC_FieldButton">&nbsp;</td>
372
- </tr>
373
- </tbody>
374
- </table>
375
- </div>
376
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckstyle.js DELETED
@@ -1,1500 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKStyle Class: contains a style definition, and all methods to work with
22
- * the style in a document.
23
- */
24
-
25
- /**
26
- * @param {Object} styleDesc A "style descriptor" object, containing the raw
27
- * style definition in the following format:
28
- * '<style name>' : {
29
- * Element : '<element name>',
30
- * Attributes : {
31
- * '<att name>' : '<att value>',
32
- * ...
33
- * },
34
- * Styles : {
35
- * '<style name>' : '<style value>',
36
- * ...
37
- * },
38
- * Overrides : '<element name>'|{
39
- * Element : '<element name>',
40
- * Attributes : {
41
- * '<att name>' : '<att value>'|/<att regex>/
42
- * },
43
- * Styles : {
44
- * '<style name>' : '<style value>'|/<style regex>/
45
- * },
46
- * }
47
- * }
48
- */
49
- var FCKStyle = function( styleDesc )
50
- {
51
- this.Element = ( styleDesc.Element || 'span' ).toLowerCase() ;
52
- this._StyleDesc = styleDesc ;
53
- }
54
-
55
- FCKStyle.prototype =
56
- {
57
- /**
58
- * Get the style type, based on its element name:
59
- * - FCK_STYLE_BLOCK (0): Block Style
60
- * - FCK_STYLE_INLINE (1): Inline Style
61
- * - FCK_STYLE_OBJECT (2): Object Style
62
- */
63
- GetType : function()
64
- {
65
- var type = this.GetType_$ ;
66
-
67
- if ( type != undefined )
68
- return type ;
69
-
70
- var elementName = this.Element ;
71
-
72
- if ( elementName == '#' || FCKListsLib.StyleBlockElements[ elementName ] )
73
- type = FCK_STYLE_BLOCK ;
74
- else if ( FCKListsLib.StyleObjectElements[ elementName ] )
75
- type = FCK_STYLE_OBJECT ;
76
- else
77
- type = FCK_STYLE_INLINE ;
78
-
79
- return ( this.GetType_$ = type ) ;
80
- },
81
-
82
- /**
83
- * Apply the style to the current selection.
84
- */
85
- ApplyToSelection : function( targetWindow )
86
- {
87
- // Create a range for the current selection.
88
- var range = new FCKDomRange( targetWindow ) ;
89
- range.MoveToSelection() ;
90
-
91
- this.ApplyToRange( range, true ) ;
92
- },
93
-
94
- /**
95
- * Apply the style to a FCKDomRange.
96
- */
97
- ApplyToRange : function( range, selectIt, updateRange )
98
- {
99
- // ApplyToRange is not valid for FCK_STYLE_OBJECT types.
100
- // Use ApplyToObject instead.
101
-
102
- switch ( this.GetType() )
103
- {
104
- case FCK_STYLE_BLOCK :
105
- this.ApplyToRange = this._ApplyBlockStyle ;
106
- break ;
107
- case FCK_STYLE_INLINE :
108
- this.ApplyToRange = this._ApplyInlineStyle ;
109
- break ;
110
- default :
111
- return ;
112
- }
113
-
114
- this.ApplyToRange( range, selectIt, updateRange ) ;
115
- },
116
-
117
- /**
118
- * Apply the style to an object. Valid for FCK_STYLE_BLOCK types only.
119
- */
120
- ApplyToObject : function( objectElement )
121
- {
122
- if ( !objectElement )
123
- return ;
124
-
125
- this.BuildElement( null, objectElement ) ;
126
- },
127
-
128
- /**
129
- * Remove the style from the current selection.
130
- */
131
- RemoveFromSelection : function( targetWindow )
132
- {
133
- // Create a range for the current selection.
134
- var range = new FCKDomRange( targetWindow ) ;
135
- range.MoveToSelection() ;
136
-
137
- this.RemoveFromRange( range, true ) ;
138
- },
139
-
140
- /**
141
- * Remove the style from a FCKDomRange. Block type styles will have no
142
- * effect.
143
- */
144
- RemoveFromRange : function( range, selectIt, updateRange )
145
- {
146
- var bookmark ;
147
-
148
- // Create the attribute list to be used later for element comparisons.
149
- var styleAttribs = this._GetAttribsForComparison() ;
150
- var styleOverrides = this._GetOverridesForComparison() ;
151
-
152
- // If collapsed, we are removing all conflicting styles from the range
153
- // parent tree.
154
- if ( range.CheckIsCollapsed() )
155
- {
156
- // Bookmark the range so we can re-select it after processing.
157
- var bookmark = range.CreateBookmark( true ) ;
158
-
159
- // Let's start from the bookmark <span> parent.
160
- var bookmarkStart = range.GetBookmarkNode( bookmark, true ) ;
161
-
162
- var path = new FCKElementPath( bookmarkStart.parentNode ) ;
163
-
164
- // While looping through the path, we'll be saving references to
165
- // parent elements if the range is in one of their boundaries. In
166
- // this way, we are able to create a copy of those elements when
167
- // removing a style if the range is in a boundary limit (see #1270).
168
- var boundaryElements = [] ;
169
-
170
- // Check if the range is in the boundary limits of an element
171
- // (related to #1270).
172
- var isBoundaryRight = !FCKDomTools.GetNextSibling( bookmarkStart ) ;
173
- var isBoundary = isBoundaryRight || !FCKDomTools.GetPreviousSibling( bookmarkStart ) ;
174
-
175
- // This is the last element to be removed in the boundary situation
176
- // described at #1270.
177
- var lastBoundaryElement ;
178
- var boundaryLimitIndex = -1 ;
179
-
180
- for ( var i = 0 ; i < path.Elements.length ; i++ )
181
- {
182
- var pathElement = path.Elements[i] ;
183
- if ( this.CheckElementRemovable( pathElement ) )
184
- {
185
- if ( isBoundary
186
- && !FCKDomTools.CheckIsEmptyElement( pathElement,
187
- function( el )
188
- {
189
- return ( el != bookmarkStart ) ;
190
- } )
191
- )
192
- {
193
- lastBoundaryElement = pathElement ;
194
-
195
- // We'll be continuously including elements in the
196
- // boundaryElements array, but only those added before
197
- // setting lastBoundaryElement must be used later, so
198
- // let's mark the current index here.
199
- boundaryLimitIndex = boundaryElements.length - 1 ;
200
- }
201
- else
202
- {
203
- var pathElementName = pathElement.nodeName.toLowerCase() ;
204
-
205
- if ( pathElementName == this.Element )
206
- {
207
- // Remove any attribute that conflict with this style, no
208
- // matter their values.
209
- for ( var att in styleAttribs )
210
- {
211
- if ( FCKDomTools.HasAttribute( pathElement, att ) )
212
- {
213
- switch ( att )
214
- {
215
- case 'style' :
216
- this._RemoveStylesFromElement( pathElement ) ;
217
- break ;
218
-
219
- case 'class' :
220
- // The 'class' element value must match (#1318).
221
- if ( FCKDomTools.GetAttributeValue( pathElement, att ) != this.GetFinalAttributeValue( att ) )
222
- continue ;
223
-
224
- /*jsl:fallthru*/
225
-
226
- default :
227
- FCKDomTools.RemoveAttribute( pathElement, att ) ;
228
- }
229
- }
230
- }
231
- }
232
-
233
- // Remove overrides defined to the same element name.
234
- this._RemoveOverrides( pathElement, styleOverrides[ pathElementName ] ) ;
235
-
236
- // Remove the element if no more attributes are available and it's an inline style element
237
- if ( this.GetType() == FCK_STYLE_INLINE)
238
- this._RemoveNoAttribElement( pathElement ) ;
239
- }
240
- }
241
- else if ( isBoundary )
242
- boundaryElements.push( pathElement ) ;
243
-
244
- // Check if we are still in a boundary (at the same side).
245
- isBoundary = isBoundary && ( ( isBoundaryRight && !FCKDomTools.GetNextSibling( pathElement ) ) || ( !isBoundaryRight && !FCKDomTools.GetPreviousSibling( pathElement ) ) ) ;
246
-
247
- // If we are in an element that is not anymore a boundary, or
248
- // we are at the last element, let's move things outside the
249
- // boundary (if available).
250
- if ( lastBoundaryElement && ( !isBoundary || ( i == path.Elements.length - 1 ) ) )
251
- {
252
- // Remove the bookmark node from the DOM.
253
- var currentElement = FCKDomTools.RemoveNode( bookmarkStart ) ;
254
-
255
- // Build the collapsed group of elements that are not
256
- // removed by this style, but share the boundary.
257
- // (see comment 1 and 2 at #1270)
258
- for ( var j = 0 ; j <= boundaryLimitIndex ; j++ )
259
- {
260
- var newElement = FCKDomTools.CloneElement( boundaryElements[j] ) ;
261
- newElement.appendChild( currentElement ) ;
262
- currentElement = newElement ;
263
- }
264
-
265
- // Re-insert the bookmark node (and the collapsed elements)
266
- // in the DOM, in the new position next to the styled element.
267
- if ( isBoundaryRight )
268
- FCKDomTools.InsertAfterNode( lastBoundaryElement, currentElement ) ;
269
- else
270
- lastBoundaryElement.parentNode.insertBefore( currentElement, lastBoundaryElement ) ;
271
-
272
- isBoundary = false ;
273
- lastBoundaryElement = null ;
274
- }
275
- }
276
-
277
- // Re-select the original range.
278
- if ( selectIt )
279
- range.SelectBookmark( bookmark ) ;
280
-
281
- if ( updateRange )
282
- range.MoveToBookmark( bookmark ) ;
283
-
284
- return ;
285
- }
286
-
287
- // Expand the range, if inside inline element boundaries.
288
- range.Expand( 'inline_elements' ) ;
289
-
290
- // Bookmark the range so we can re-select it after processing.
291
- bookmark = range.CreateBookmark( true ) ;
292
-
293
- // The style will be applied within the bookmark boundaries.
294
- var startNode = range.GetBookmarkNode( bookmark, true ) ;
295
- var endNode = range.GetBookmarkNode( bookmark, false ) ;
296
-
297
- range.Release( true ) ;
298
-
299
- // We need to check the selection boundaries (bookmark spans) to break
300
- // the code in a way that we can properly remove partially selected nodes.
301
- // For example, removing a <b> style from
302
- // <b>This is [some text</b> to show <b>the] problem</b>
303
- // ... where [ and ] represent the selection, must result:
304
- // <b>This is </b>[some text to show the]<b> problem</b>
305
- // The strategy is simple, we just break the partial nodes before the
306
- // removal logic, having something that could be represented this way:
307
- // <b>This is </b>[<b>some text</b> to show <b>the</b>]<b> problem</b>
308
-
309
- // Let's start checking the start boundary.
310
- var path = new FCKElementPath( startNode ) ;
311
- var pathElements = path.Elements ;
312
- var pathElement ;
313
-
314
- for ( var i = 1 ; i < pathElements.length ; i++ )
315
- {
316
- pathElement = pathElements[i] ;
317
-
318
- if ( pathElement == path.Block || pathElement == path.BlockLimit )
319
- break ;
320
-
321
- // If this element can be removed (even partially).
322
- if ( this.CheckElementRemovable( pathElement ) )
323
- FCKDomTools.BreakParent( startNode, pathElement, range ) ;
324
- }
325
-
326
- // Now the end boundary.
327
- path = new FCKElementPath( endNode ) ;
328
- pathElements = path.Elements ;
329
-
330
- for ( var i = 1 ; i < pathElements.length ; i++ )
331
- {
332
- pathElement = pathElements[i] ;
333
-
334
- if ( pathElement == path.Block || pathElement == path.BlockLimit )
335
- break ;
336
-
337
- elementName = pathElement.nodeName.toLowerCase() ;
338
-
339
- // If this element can be removed (even partially).
340
- if ( this.CheckElementRemovable( pathElement ) )
341
- FCKDomTools.BreakParent( endNode, pathElement, range ) ;
342
- }
343
-
344
- // Navigate through all nodes between the bookmarks.
345
- var currentNode = FCKDomTools.GetNextSourceNode( startNode, true ) ;
346
-
347
- while ( currentNode )
348
- {
349
- // Cache the next node to be processed. Do it now, because
350
- // currentNode may be removed.
351
- var nextNode = FCKDomTools.GetNextSourceNode( currentNode ) ;
352
-
353
- // Remove elements nodes that match with this style rules.
354
- if ( currentNode.nodeType == 1 )
355
- {
356
- var elementName = currentNode.nodeName.toLowerCase() ;
357
-
358
- var mayRemove = ( elementName == this.Element ) ;
359
- if ( mayRemove )
360
- {
361
- // Remove any attribute that conflict with this style, no matter
362
- // their values.
363
- for ( var att in styleAttribs )
364
- {
365
- if ( FCKDomTools.HasAttribute( currentNode, att ) )
366
- {
367
- switch ( att )
368
- {
369
- case 'style' :
370
- this._RemoveStylesFromElement( currentNode ) ;
371
- break ;
372
-
373
- case 'class' :
374
- // The 'class' element value must match (#1318).
375
- if ( FCKDomTools.GetAttributeValue( currentNode, att ) != this.GetFinalAttributeValue( att ) )
376
- continue ;
377
-
378
- /*jsl:fallthru*/
379
-
380
- default :
381
- FCKDomTools.RemoveAttribute( currentNode, att ) ;
382
- }
383
- }
384
- }
385
- }
386
- else
387
- mayRemove = !!styleOverrides[ elementName ] ;
388
-
389
- if ( mayRemove )
390
- {
391
- // Remove overrides defined to the same element name.
392
- this._RemoveOverrides( currentNode, styleOverrides[ elementName ] ) ;
393
-
394
- // Remove the element if no more attributes are available.
395
- this._RemoveNoAttribElement( currentNode ) ;
396
- }
397
- }
398
-
399
- // If we have reached the end of the selection, stop looping.
400
- if ( nextNode == endNode )
401
- break ;
402
-
403
- currentNode = nextNode ;
404
- }
405
-
406
- this._FixBookmarkStart( startNode ) ;
407
-
408
- // Re-select the original range.
409
- if ( selectIt )
410
- range.SelectBookmark( bookmark ) ;
411
-
412
- if ( updateRange )
413
- range.MoveToBookmark( bookmark ) ;
414
- },
415
-
416
- /**
417
- * Checks if an element, or any of its attributes, is removable by the
418
- * current style definition.
419
- */
420
- CheckElementRemovable : function( element, fullMatch )
421
- {
422
- if ( !element )
423
- return false ;
424
-
425
- var elementName = element.nodeName.toLowerCase() ;
426
-
427
- // If the element name is the same as the style name.
428
- if ( elementName == this.Element )
429
- {
430
- // If no attributes are defined in the element.
431
- if ( !fullMatch && !FCKDomTools.HasAttributes( element ) )
432
- return true ;
433
-
434
- // If any attribute conflicts with the style attributes.
435
- var attribs = this._GetAttribsForComparison() ;
436
- var allMatched = ( attribs._length == 0 ) ;
437
- for ( var att in attribs )
438
- {
439
- if ( att == '_length' )
440
- continue ;
441
-
442
- if ( this._CompareAttributeValues( att, FCKDomTools.GetAttributeValue( element, att ), ( this.GetFinalAttributeValue( att ) || '' ) ) )
443
- {
444
- allMatched = true ;
445
- if ( !fullMatch )
446
- break ;
447
- }
448
- else
449
- {
450
- allMatched = false ;
451
- if ( fullMatch )
452
- return false ;
453
- }
454
- }
455
- if ( allMatched )
456
- return true ;
457
- }
458
-
459
- // Check if the element can be somehow overriden.
460
- var override = this._GetOverridesForComparison()[ elementName ] ;
461
- if ( override )
462
- {
463
- // If no attributes have been defined, remove the element.
464
- if ( !( attribs = override.Attributes ) ) // Only one "="
465
- return true ;
466
-
467
- for ( var i = 0 ; i < attribs.length ; i++ )
468
- {
469
- var attName = attribs[i][0] ;
470
- if ( FCKDomTools.HasAttribute( element, attName ) )
471
- {
472
- var attValue = attribs[i][1] ;
473
-
474
- // Remove the attribute if:
475
- // - The override definition value is null ;
476
- // - The override definition valie is a string that
477
- // matches the attribute value exactly.
478
- // - The override definition value is a regex that
479
- // has matches in the attribute value.
480
- if ( attValue == null ||
481
- ( typeof attValue == 'string' && FCKDomTools.GetAttributeValue( element, attName ) == attValue ) ||
482
- attValue.test( FCKDomTools.GetAttributeValue( element, attName ) ) )
483
- return true ;
484
- }
485
- }
486
- }
487
-
488
- return false ;
489
- },
490
-
491
- /**
492
- * Get the style state for an element path. Returns "true" if the element
493
- * is active in the path.
494
- */
495
- CheckActive : function( elementPath )
496
- {
497
- switch ( this.GetType() )
498
- {
499
- case FCK_STYLE_BLOCK :
500
- return this.CheckElementRemovable( elementPath.Block || elementPath.BlockLimit, true ) ;
501
-
502
- case FCK_STYLE_INLINE :
503
-
504
- var elements = elementPath.Elements ;
505
-
506
- for ( var i = 0 ; i < elements.length ; i++ )
507
- {
508
- var element = elements[i] ;
509
-
510
- if ( element == elementPath.Block || element == elementPath.BlockLimit )
511
- continue ;
512
-
513
- if ( this.CheckElementRemovable( element, true ) )
514
- return true ;
515
- }
516
- }
517
- return false ;
518
- },
519
-
520
- /**
521
- * Removes an inline style from inside an element tree. The element node
522
- * itself is not checked or removed, only the child tree inside of it.
523
- */
524
- RemoveFromElement : function( element )
525
- {
526
- var attribs = this._GetAttribsForComparison() ;
527
- var overrides = this._GetOverridesForComparison() ;
528
-
529
- // Get all elements with the same name.
530
- var innerElements = element.getElementsByTagName( this.Element ) ;
531
-
532
- for ( var i = innerElements.length - 1 ; i >= 0 ; i-- )
533
- {
534
- var innerElement = innerElements[i] ;
535
-
536
- // Remove any attribute that conflict with this style, no matter
537
- // their values.
538
- for ( var att in attribs )
539
- {
540
- if ( FCKDomTools.HasAttribute( innerElement, att ) )
541
- {
542
- switch ( att )
543
- {
544
- case 'style' :
545
- this._RemoveStylesFromElement( innerElement ) ;
546
- break ;
547
-
548
- case 'class' :
549
- // The 'class' element value must match (#1318).
550
- if ( FCKDomTools.GetAttributeValue( innerElement, att ) != this.GetFinalAttributeValue( att ) )
551
- continue ;
552
-
553
- /*jsl:fallthru*/
554
-
555
- default :
556
- FCKDomTools.RemoveAttribute( innerElement, att ) ;
557
- }
558
- }
559
- }
560
-
561
- // Remove overrides defined to the same element name.
562
- this._RemoveOverrides( innerElement, overrides[ this.Element ] ) ;
563
-
564
- // Remove the element if no more attributes are available.
565
- this._RemoveNoAttribElement( innerElement ) ;
566
- }
567
-
568
- // Now remove any other element with different name that is
569
- // defined to be overriden.
570
- for ( var overrideElement in overrides )
571
- {
572
- if ( overrideElement != this.Element )
573
- {
574
- // Get all elements.
575
- innerElements = element.getElementsByTagName( overrideElement ) ;
576
-
577
- for ( var i = innerElements.length - 1 ; i >= 0 ; i-- )
578
- {
579
- var innerElement = innerElements[i] ;
580
- this._RemoveOverrides( innerElement, overrides[ overrideElement ] ) ;
581
- this._RemoveNoAttribElement( innerElement ) ;
582
- }
583
- }
584
- }
585
- },
586
-
587
- _RemoveStylesFromElement : function( element )
588
- {
589
- var elementStyle = element.style.cssText ;
590
- var pattern = this.GetFinalStyleValue() ;
591
-
592
- if ( elementStyle.length > 0 && pattern.length == 0 )
593
- return ;
594
-
595
- pattern = '(^|;)\\s*(' +
596
- pattern.replace( /\s*([^ ]+):.*?(;|$)/g, '$1|' ).replace( /\|$/, '' ) +
597
- '):[^;]+' ;
598
-
599
- var regex = new RegExp( pattern, 'gi' ) ;
600
-
601
- elementStyle = elementStyle.replace( regex, '' ).Trim() ;
602
-
603
- if ( elementStyle.length == 0 || elementStyle == ';' )
604
- FCKDomTools.RemoveAttribute( element, 'style' ) ;
605
- else
606
- element.style.cssText = elementStyle.replace( regex, '' ) ;
607
- },
608
-
609
- /**
610
- * Remove all attributes that are defined to be overriden,
611
- */
612
- _RemoveOverrides : function( element, override )
613
- {
614
- var attributes = override && override.Attributes ;
615
-
616
- if ( attributes )
617
- {
618
- for ( var i = 0 ; i < attributes.length ; i++ )
619
- {
620
- var attName = attributes[i][0] ;
621
-
622
- if ( FCKDomTools.HasAttribute( element, attName ) )
623
- {
624
- var attValue = attributes[i][1] ;
625
-
626
- // Remove the attribute if:
627
- // - The override definition value is null ;
628
- // - The override definition valie is a string that
629
- // matches the attribute value exactly.
630
- // - The override definition value is a regex that
631
- // has matches in the attribute value.
632
- if ( attValue == null ||
633
- ( attValue.test && attValue.test( FCKDomTools.GetAttributeValue( element, attName ) ) ) ||
634
- ( typeof attValue == 'string' && FCKDomTools.GetAttributeValue( element, attName ) == attValue ) )
635
- FCKDomTools.RemoveAttribute( element, attName ) ;
636
- }
637
- }
638
- }
639
- },
640
-
641
- /**
642
- * If the element has no more attributes, remove it.
643
- */
644
- _RemoveNoAttribElement : function( element )
645
- {
646
- // If no more attributes remained in the element, remove it,
647
- // leaving its children.
648
- if ( !FCKDomTools.HasAttributes( element ) )
649
- {
650
- // Removing elements may open points where merging is possible,
651
- // so let's cache the first and last nodes for later checking.
652
- var firstChild = element.firstChild ;
653
- var lastChild = element.lastChild ;
654
-
655
- FCKDomTools.RemoveNode( element, true ) ;
656
-
657
- // Check the cached nodes for merging.
658
- this._MergeSiblings( firstChild ) ;
659
-
660
- if ( firstChild != lastChild )
661
- this._MergeSiblings( lastChild ) ;
662
- }
663
- },
664
-
665
- /**
666
- * Creates a DOM element for this style object.
667
- */
668
- BuildElement : function( targetDoc, element )
669
- {
670
- // Create the element.
671
- var el = element || targetDoc.createElement( this.Element ) ;
672
-
673
- // Assign all defined attributes.
674
- var attribs = this._StyleDesc.Attributes ;
675
- var attValue ;
676
- if ( attribs )
677
- {
678
- for ( var att in attribs )
679
- {
680
- attValue = this.GetFinalAttributeValue( att ) ;
681
-
682
- if ( att.toLowerCase() == 'class' )
683
- el.className = attValue ;
684
- else
685
- el.setAttribute( att, attValue ) ;
686
- }
687
- }
688
-
689
- // Assign the style attribute.
690
- if ( this._GetStyleText().length > 0 )
691
- el.style.cssText = this.GetFinalStyleValue() ;
692
-
693
- return el ;
694
- },
695
-
696
- _CompareAttributeValues : function( attName, valueA, valueB )
697
- {
698
- if ( attName == 'style' && valueA && valueB )
699
- {
700
- valueA = valueA.replace( /;$/, '' ).toLowerCase() ;
701
- valueB = valueB.replace( /;$/, '' ).toLowerCase() ;
702
- }
703
-
704
- // Return true if they match or if valueA is null and valueB is an empty string
705
- return ( valueA == valueB || ( ( valueA === null || valueA === '' ) && ( valueB === null || valueB === '' ) ) )
706
- },
707
-
708
- GetFinalAttributeValue : function( attName )
709
- {
710
- var attValue = this._StyleDesc.Attributes ;
711
- var attValue = attValue ? attValue[ attName ] : null ;
712
-
713
- if ( !attValue && attName == 'style' )
714
- return this.GetFinalStyleValue() ;
715
-
716
- if ( attValue && this._Variables )
717
- // Using custom Replace() to guarantee the correct scope.
718
- attValue = attValue.Replace( FCKRegexLib.StyleVariableAttName, this._GetVariableReplace, this ) ;
719
-
720
- return attValue ;
721
- },
722
-
723
- GetFinalStyleValue : function()
724
- {
725
- var attValue = this._GetStyleText() ;
726
-
727
- if ( attValue.length > 0 && this._Variables )
728
- {
729
- // Using custom Replace() to guarantee the correct scope.
730
- attValue = attValue.Replace( FCKRegexLib.StyleVariableAttName, this._GetVariableReplace, this ) ;
731
- attValue = FCKTools.NormalizeCssText( attValue ) ;
732
- }
733
-
734
- return attValue ;
735
- },
736
-
737
- _GetVariableReplace : function()
738
- {
739
- // The second group in the regex is the variable name.
740
- return this._Variables[ arguments[2] ] || arguments[0] ;
741
- },
742
-
743
- /**
744
- * Set the value of a variable attribute or style, to be used when
745
- * appliying the style.
746
- */
747
- SetVariable : function( name, value )
748
- {
749
- var variables = this._Variables ;
750
-
751
- if ( !variables )
752
- variables = this._Variables = {} ;
753
-
754
- this._Variables[ name ] = value ;
755
- },
756
-
757
- /**
758
- * Converting from a PRE block to a non-PRE block in formatting operations.
759
- */
760
- _FromPre : function( doc, block, newBlock )
761
- {
762
- var innerHTML = block.innerHTML ;
763
-
764
- // Trim the first and last linebreaks immediately after and before <pre>, </pre>,
765
- // if they exist.
766
- // This is done because the linebreaks are not rendered.
767
- innerHTML = innerHTML.replace( /(\r\n|\r)/g, '\n' ) ;
768
- innerHTML = innerHTML.replace( /^[ \t]*\n/, '' ) ;
769
- innerHTML = innerHTML.replace( /\n$/, '' ) ;
770
-
771
- // 1. Convert spaces or tabs at the beginning or at the end to &nbsp;
772
- innerHTML = innerHTML.replace( /^[ \t]+|[ \t]+$/g, function( match, offset, s )
773
- {
774
- if ( match.length == 1 ) // one space, preserve it
775
- return '&nbsp;' ;
776
- else if ( offset == 0 ) // beginning of block
777
- return new Array( match.length ).join( '&nbsp;' ) + ' ' ;
778
- else // end of block
779
- return ' ' + new Array( match.length ).join( '&nbsp;' ) ;
780
- } ) ;
781
-
782
- // 2. Convert \n to <BR>.
783
- // 3. Convert contiguous (i.e. non-singular) spaces or tabs to &nbsp;
784
- var htmlIterator = new FCKHtmlIterator( innerHTML ) ;
785
- var results = [] ;
786
- htmlIterator.Each( function( isTag, value )
787
- {
788
- if ( !isTag )
789
- {
790
- value = value.replace( /\n/g, '<br>' ) ;
791
- value = value.replace( /[ \t]{2,}/g,
792
- function ( match )
793
- {
794
- return new Array( match.length ).join( '&nbsp;' ) + ' ' ;
795
- } ) ;
796
- }
797
- results.push( value ) ;
798
- } ) ;
799
- newBlock.innerHTML = results.join( '' ) ;
800
- return newBlock ;
801
- },
802
-
803
- /**
804
- * Converting from a non-PRE block to a PRE block in formatting operations.
805
- */
806
- _ToPre : function( doc, block, newBlock )
807
- {
808
- // Handle converting from a regular block to a <pre> block.
809
- var innerHTML = block.innerHTML.Trim() ;
810
-
811
- // 1. Delete ANSI whitespaces immediately before and after <BR> because
812
- // they are not visible.
813
- // 2. Mark down any <BR /> nodes here so they can be turned into \n in
814
- // the next step and avoid being compressed.
815
- innerHTML = innerHTML.replace( /[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, '<br />' ) ;
816
-
817
- // 3. Compress other ANSI whitespaces since they're only visible as one
818
- // single space previously.
819
- // 4. Convert &nbsp; to spaces since &nbsp; is no longer needed in <PRE>.
820
- // 5. Convert any <BR /> to \n. This must not be done earlier because
821
- // the \n would then get compressed.
822
- var htmlIterator = new FCKHtmlIterator( innerHTML ) ;
823
- var results = [] ;
824
- htmlIterator.Each( function( isTag, value )
825
- {
826
- if ( !isTag )
827
- value = value.replace( /([ \t\n\r]+|&nbsp;)/g, ' ' ) ;
828
- else if ( isTag && value == '<br />' )
829
- value = '\n' ;
830
- results.push( value ) ;
831
- } ) ;
832
-
833
- // Assigning innerHTML to <PRE> in IE causes all linebreaks to be
834
- // reduced to spaces.
835
- // Assigning outerHTML to <PRE> in IE doesn't work if the <PRE> isn't
836
- // contained in another node since the node reference is changed after
837
- // outerHTML assignment.
838
- // So, we need some hacks to workaround IE bugs here.
839
- if ( FCKBrowserInfo.IsIE )
840
- {
841
- var temp = doc.createElement( 'div' ) ;
842
- temp.appendChild( newBlock ) ;
843
- newBlock.outerHTML = '<pre>\n' + results.join( '' ) + '</pre>' ;
844
- newBlock = temp.removeChild( temp.firstChild ) ;
845
- }
846
- else
847
- newBlock.innerHTML = results.join( '' ) ;
848
-
849
- return newBlock ;
850
- },
851
-
852
- /**
853
- * Merge a <pre> block with a previous <pre> block, if available.
854
- */
855
- _CheckAndMergePre : function( previousBlock, preBlock )
856
- {
857
- // Check if the previous block and the current block are next
858
- // to each other.
859
- if ( previousBlock != FCKDomTools.GetPreviousSourceElement( preBlock, true ) )
860
- return ;
861
-
862
- // Merge the previous <pre> block contents into the current <pre>
863
- // block.
864
- //
865
- // Another thing to be careful here is that currentBlock might contain
866
- // a '\n' at the beginning, and previousBlock might contain a '\n'
867
- // towards the end. These new lines are not normally displayed but they
868
- // become visible after merging.
869
- var innerHTML = previousBlock.innerHTML.replace( /\n$/, '' ) + '\n\n' +
870
- preBlock.innerHTML.replace( /^\n/, '' ) ;
871
-
872
- // Buggy IE normalizes innerHTML from <pre>, breaking whitespaces.
873
- if ( FCKBrowserInfo.IsIE )
874
- preBlock.outerHTML = '<pre>' + innerHTML + '</pre>' ;
875
- else
876
- preBlock.innerHTML = innerHTML ;
877
-
878
- // Remove the previous <pre> block.
879
- //
880
- // The preBlock must not be moved or deleted from the DOM tree. This
881
- // guarantees the FCKDomRangeIterator in _ApplyBlockStyle would not
882
- // get lost at the next iteration.
883
- FCKDomTools.RemoveNode( previousBlock ) ;
884
- },
885
-
886
- _CheckAndSplitPre : function( newBlock )
887
- {
888
- var lastNewBlock ;
889
-
890
- var cursor = newBlock.firstChild ;
891
-
892
- // We are not splitting <br><br> at the beginning of the block, so
893
- // we'll start from the second child.
894
- cursor = cursor && cursor.nextSibling ;
895
-
896
- while ( cursor )
897
- {
898
- var next = cursor.nextSibling ;
899
-
900
- // If we have two <BR>s, and they're not at the beginning or the end,
901
- // then we'll split up the contents following them into another block.
902
- // Stop processing if we are at the last child couple.
903
- if ( next && next.nextSibling && cursor.nodeName.IEquals( 'br' ) && next.nodeName.IEquals( 'br' ) )
904
- {
905
- // Remove the first <br>.
906
- FCKDomTools.RemoveNode( cursor ) ;
907
-
908
- // Move to the node after the second <br>.
909
- cursor = next.nextSibling ;
910
-
911
- // Remove the second <br>.
912
- FCKDomTools.RemoveNode( next ) ;
913
-
914
- // Create the block that will hold the child nodes from now on.
915
- lastNewBlock = FCKDomTools.InsertAfterNode( lastNewBlock || newBlock, FCKDomTools.CloneElement( newBlock ) ) ;
916
-
917
- continue ;
918
- }
919
-
920
- // If we split it, then start moving the nodes to the new block.
921
- if ( lastNewBlock )
922
- {
923
- cursor = cursor.previousSibling ;
924
- FCKDomTools.MoveNode(cursor.nextSibling, lastNewBlock ) ;
925
- }
926
-
927
- cursor = cursor.nextSibling ;
928
- }
929
- },
930
-
931
- /**
932
- * Apply an inline style to a FCKDomRange.
933
- *
934
- * TODO
935
- * - Implement the "#" style handling.
936
- * - Properly handle block containers like <div> and <blockquote>.
937
- */
938
- _ApplyBlockStyle : function( range, selectIt, updateRange )
939
- {
940
- // Bookmark the range so we can re-select it after processing.
941
- var bookmark ;
942
-
943
- if ( selectIt )
944
- bookmark = range.CreateBookmark() ;
945
-
946
- var iterator = new FCKDomRangeIterator( range ) ;
947
- iterator.EnforceRealBlocks = true ;
948
-
949
- var block ;
950
- var doc = range.Window.document ;
951
- var previousPreBlock ;
952
-
953
- while( ( block = iterator.GetNextParagraph() ) ) // Only one =
954
- {
955
- // Create the new node right before the current one.
956
- var newBlock = this.BuildElement( doc ) ;
957
-
958
- // Check if we are changing from/to <pre>.
959
- var newBlockIsPre = newBlock.nodeName.IEquals( 'pre' ) ;
960
- var blockIsPre = block.nodeName.IEquals( 'pre' ) ;
961
-
962
- var toPre = newBlockIsPre && !blockIsPre ;
963
- var fromPre = !newBlockIsPre && blockIsPre ;
964
-
965
- // Move everything from the current node to the new one.
966
- if ( toPre )
967
- newBlock = this._ToPre( doc, block, newBlock ) ;
968
- else if ( fromPre )
969
- newBlock = this._FromPre( doc, block, newBlock ) ;
970
- else // Convering from a regular block to another regular block.
971
- FCKDomTools.MoveChildren( block, newBlock ) ;
972
-
973
- // Replace the current block.
974
- block.parentNode.insertBefore( newBlock, block ) ;
975
- FCKDomTools.RemoveNode( block ) ;
976
-
977
- // Complete other tasks after inserting the node in the DOM.
978
- if ( newBlockIsPre )
979
- {
980
- if ( previousPreBlock )
981
- this._CheckAndMergePre( previousPreBlock, newBlock ) ; // Merge successive <pre> blocks.
982
- previousPreBlock = newBlock ;
983
- }
984
- else if ( fromPre )
985
- this._CheckAndSplitPre( newBlock ) ; // Split <br><br> in successive <pre>s.
986
- }
987
-
988
- // Re-select the original range.
989
- if ( selectIt )
990
- range.SelectBookmark( bookmark ) ;
991
-
992
- if ( updateRange )
993
- range.MoveToBookmark( bookmark ) ;
994
- },
995
-
996
- /**
997
- * Apply an inline style to a FCKDomRange.
998
- *
999
- * TODO
1000
- * - Merge elements, when applying styles to similar elements that enclose
1001
- * the entire selection, outputing:
1002
- * <span style="color: #ff0000; background-color: #ffffff">XYZ</span>
1003
- * instead of:
1004
- * <span style="color: #ff0000;"><span style="background-color: #ffffff">XYZ</span></span>
1005
- */
1006
- _ApplyInlineStyle : function( range, selectIt, updateRange )
1007
- {
1008
- var doc = range.Window.document ;
1009
-
1010
- if ( range.CheckIsCollapsed() )
1011
- {
1012
- // Create the element to be inserted in the DOM.
1013
- var collapsedElement = this.BuildElement( doc ) ;
1014
- range.InsertNode( collapsedElement ) ;
1015
- range.MoveToPosition( collapsedElement, 2 ) ;
1016
- range.Select() ;
1017
-
1018
- return ;
1019
- }
1020
-
1021
- // The general idea here is navigating through all nodes inside the
1022
- // current selection, working on distinct range blocks, defined by the
1023
- // DTD compatibility between the style element and the nodes inside the
1024
- // ranges.
1025
- //
1026
- // For example, suppose we have the following selection (where [ and ]
1027
- // are the boundaries), and we apply a <b> style there:
1028
- //
1029
- // <p>Here we [have <b>some</b> text.<p>
1030
- // <p>And some here] here.</p>
1031
- //
1032
- // Two different ranges will be detected:
1033
- //
1034
- // "have <b>some</b> text."
1035
- // "And some here"
1036
- //
1037
- // Both ranges will be extracted, moved to a <b> element, and
1038
- // re-inserted, resulting in the following output:
1039
- //
1040
- // <p>Here we [<b>have some text.</b><p>
1041
- // <p><b>And some here</b>] here.</p>
1042
- //
1043
- // Note that the <b> element at <b>some</b> is also removed because it
1044
- // is not needed anymore.
1045
-
1046
- var elementName = this.Element ;
1047
-
1048
- // Get the DTD definition for the element. Defaults to "span".
1049
- var elementDTD = FCK.DTD[ elementName ] || FCK.DTD.span ;
1050
-
1051
- // Create the attribute list to be used later for element comparisons.
1052
- var styleAttribs = this._GetAttribsForComparison() ;
1053
- var styleNode ;
1054
-
1055
- // Expand the range, if inside inline element boundaries.
1056
- range.Expand( 'inline_elements' ) ;
1057
-
1058
- // Bookmark the range so we can re-select it after processing.
1059
- var bookmark = range.CreateBookmark( true ) ;
1060
-
1061
- // The style will be applied within the bookmark boundaries.
1062
- var startNode = range.GetBookmarkNode( bookmark, true ) ;
1063
- var endNode = range.GetBookmarkNode( bookmark, false ) ;
1064
-
1065
- // We'll be reusing the range to apply the styles. So, release it here
1066
- // to indicate that it has not been initialized.
1067
- range.Release( true ) ;
1068
-
1069
- // Let's start the nodes lookup from the node right after the bookmark
1070
- // span.
1071
- var currentNode = FCKDomTools.GetNextSourceNode( startNode, true ) ;
1072
-
1073
- while ( currentNode )
1074
- {
1075
- var applyStyle = false ;
1076
-
1077
- var nodeType = currentNode.nodeType ;
1078
- var nodeName = nodeType == 1 ? currentNode.nodeName.toLowerCase() : null ;
1079
-
1080
- // Check if the current node can be a child of the style element.
1081
- if ( !nodeName || elementDTD[ nodeName ] )
1082
- {
1083
- // Check if the style element can be a child of the current
1084
- // node parent or if the element is not defined in the DTD.
1085
- if ( ( FCK.DTD[ currentNode.parentNode.nodeName.toLowerCase() ] || FCK.DTD.span )[ elementName ] || !FCK.DTD[ elementName ] )
1086
- {
1087
- // This node will be part of our range, so if it has not
1088
- // been started, place its start right before the node.
1089
- if ( !range.CheckHasRange() )
1090
- range.SetStart( currentNode, 3 ) ;
1091
-
1092
- // Non element nodes, or empty elements can be added
1093
- // completely to the range.
1094
- if ( nodeType != 1 || currentNode.childNodes.length == 0 )
1095
- {
1096
- var includedNode = currentNode ;
1097
- var parentNode = includedNode.parentNode ;
1098
-
1099
- // This node is about to be included completelly, but,
1100
- // if this is the last node in its parent, we must also
1101
- // check if the parent itself can be added completelly
1102
- // to the range.
1103
- while ( includedNode == parentNode.lastChild
1104
- && elementDTD[ parentNode.nodeName.toLowerCase() ] )
1105
- {
1106
- includedNode = parentNode ;
1107
- }
1108
-
1109
- range.SetEnd( includedNode, 4 ) ;
1110
-
1111
- // If the included node is the last node in its parent
1112
- // and its parent can't be inside the style node, apply
1113
- // the style immediately.
1114
- if ( includedNode == includedNode.parentNode.lastChild && !elementDTD[ includedNode.parentNode.nodeName.toLowerCase() ] )
1115
- applyStyle = true ;
1116
- }
1117
- else
1118
- {
1119
- // Element nodes will not be added directly. We need to
1120
- // check their children because the selection could end
1121
- // inside the node, so let's place the range end right
1122
- // before the element.
1123
- range.SetEnd( currentNode, 3 ) ;
1124
- }
1125
- }
1126
- else
1127
- applyStyle = true ;
1128
- }
1129
- else
1130
- applyStyle = true ;
1131
-
1132
- // Get the next node to be processed.
1133
- currentNode = FCKDomTools.GetNextSourceNode( currentNode ) ;
1134
-
1135
- // If we have reached the end of the selection, just apply the
1136
- // style ot the range, and stop looping.
1137
- if ( currentNode == endNode )
1138
- {
1139
- currentNode = null ;
1140
- applyStyle = true ;
1141
- }
1142
-
1143
- // Apply the style if we have something to which apply it.
1144
- if ( applyStyle && range.CheckHasRange() && !range.CheckIsCollapsed() )
1145
- {
1146
- // Build the style element, based on the style object definition.
1147
- styleNode = this.BuildElement( doc ) ;
1148
-
1149
- // Move the contents of the range to the style element.
1150
- range.ExtractContents().AppendTo( styleNode ) ;
1151
-
1152
- // If it is not empty.
1153
- if ( styleNode.innerHTML.RTrim().length > 0 )
1154
- {
1155
- // Insert it in the range position (it is collapsed after
1156
- // ExtractContents.
1157
- range.InsertNode( styleNode ) ;
1158
-
1159
- // Here we do some cleanup, removing all duplicated
1160
- // elements from the style element.
1161
- this.RemoveFromElement( styleNode ) ;
1162
-
1163
- // Let's merge our new style with its neighbors, if possible.
1164
- this._MergeSiblings( styleNode, this._GetAttribsForComparison() ) ;
1165
-
1166
- // As the style system breaks text nodes constantly, let's normalize
1167
- // things for performance.
1168
- // With IE, some paragraphs get broken when calling normalize()
1169
- // repeatedly. Also, for IE, we must normalize body, not documentElement.
1170
- // IE is also known for having a "crash effect" with normalize().
1171
- // We should try to normalize with IE too in some way, somewhere.
1172
- if ( !FCKBrowserInfo.IsIE )
1173
- styleNode.normalize() ;
1174
- }
1175
-
1176
- // Style applied, let's release the range, so it gets marked to
1177
- // re-initialization in the next loop.
1178
- range.Release( true ) ;
1179
- }
1180
- }
1181
-
1182
- this._FixBookmarkStart( startNode ) ;
1183
-
1184
- // Re-select the original range.
1185
- if ( selectIt )
1186
- range.SelectBookmark( bookmark ) ;
1187
-
1188
- if ( updateRange )
1189
- range.MoveToBookmark( bookmark ) ;
1190
- },
1191
-
1192
- _FixBookmarkStart : function( startNode )
1193
- {
1194
- // After appliying or removing an inline style, the start boundary of
1195
- // the selection must be placed inside all inline elements it is
1196
- // bordering.
1197
- var startSibling ;
1198
- while ( ( startSibling = startNode.nextSibling ) ) // Only one "=".
1199
- {
1200
- if ( startSibling.nodeType == 1
1201
- && FCKListsLib.InlineNonEmptyElements[ startSibling.nodeName.toLowerCase() ] )
1202
- {
1203
- // If it is an empty inline element, we can safely remove it.
1204
- if ( !startSibling.firstChild )
1205
- FCKDomTools.RemoveNode( startSibling ) ;
1206
- else
1207
- FCKDomTools.MoveNode( startNode, startSibling, true ) ;
1208
- continue ;
1209
- }
1210
-
1211
- // Empty text nodes can be safely removed to not disturb.
1212
- if ( startSibling.nodeType == 3 && startSibling.length == 0 )
1213
- {
1214
- FCKDomTools.RemoveNode( startSibling ) ;
1215
- continue ;
1216
- }
1217
-
1218
- break ;
1219
- }
1220
- },
1221
-
1222
- /**
1223
- * Merge an element with its similar siblings.
1224
- * "attribs" is and object computed with _CreateAttribsForComparison.
1225
- */
1226
- _MergeSiblings : function( element, attribs )
1227
- {
1228
- if ( !element || element.nodeType != 1 || !FCKListsLib.InlineNonEmptyElements[ element.nodeName.toLowerCase() ] )
1229
- return ;
1230
-
1231
- this._MergeNextSibling( element, attribs ) ;
1232
- this._MergePreviousSibling( element, attribs ) ;
1233
- },
1234
-
1235
- /**
1236
- * Merge an element with its similar siblings after it.
1237
- * "attribs" is and object computed with _CreateAttribsForComparison.
1238
- */
1239
- _MergeNextSibling : function( element, attribs )
1240
- {
1241
- // Check the next sibling.
1242
- var sibling = element.nextSibling ;
1243
-
1244
- // Check if the next sibling is a bookmark element. In this case, jump it.
1245
- var hasBookmark = ( sibling && sibling.nodeType == 1 && sibling.getAttribute( '_fck_bookmark' ) ) ;
1246
- if ( hasBookmark )
1247
- sibling = sibling.nextSibling ;
1248
-
1249
- if ( sibling && sibling.nodeType == 1 && sibling.nodeName == element.nodeName )
1250
- {
1251
- if ( !attribs )
1252
- attribs = this._CreateElementAttribsForComparison( element ) ;
1253
-
1254
- if ( this._CheckAttributesMatch( sibling, attribs ) )
1255
- {
1256
- // Save the last child to be checked too (to merge things like <b><i></i></b><b><i></i></b>).
1257
- var innerSibling = element.lastChild ;
1258
-
1259
- if ( hasBookmark )
1260
- FCKDomTools.MoveNode( element.nextSibling, element ) ;
1261
-
1262
- // Move contents from the sibling.
1263
- FCKDomTools.MoveChildren( sibling, element ) ;
1264
- FCKDomTools.RemoveNode( sibling ) ;
1265
-
1266
- // Now check the last inner child (see two comments above).
1267
- if ( innerSibling )
1268
- this._MergeNextSibling( innerSibling ) ;
1269
- }
1270
- }
1271
- },
1272
-
1273
- /**
1274
- * Merge an element with its similar siblings before it.
1275
- * "attribs" is and object computed with _CreateAttribsForComparison.
1276
- */
1277
- _MergePreviousSibling : function( element, attribs )
1278
- {
1279
- // Check the previous sibling.
1280
- var sibling = element.previousSibling ;
1281
-
1282
- // Check if the previous sibling is a bookmark element. In this case, jump it.
1283
- var hasBookmark = ( sibling && sibling.nodeType == 1 && sibling.getAttribute( '_fck_bookmark' ) ) ;
1284
- if ( hasBookmark )
1285
- sibling = sibling.previousSibling ;
1286
-
1287
- if ( sibling && sibling.nodeType == 1 && sibling.nodeName == element.nodeName )
1288
- {
1289
- if ( !attribs )
1290
- attribs = this._CreateElementAttribsForComparison( element ) ;
1291
-
1292
- if ( this._CheckAttributesMatch( sibling, attribs ) )
1293
- {
1294
- // Save the first child to be checked too (to merge things like <b><i></i></b><b><i></i></b>).
1295
- var innerSibling = element.firstChild ;
1296
-
1297
- if ( hasBookmark )
1298
- FCKDomTools.MoveNode( element.previousSibling, element, true ) ;
1299
-
1300
- // Move contents to the sibling.
1301
- FCKDomTools.MoveChildren( sibling, element, true ) ;
1302
- FCKDomTools.RemoveNode( sibling ) ;
1303
-
1304
- // Now check the first inner child (see two comments above).
1305
- if ( innerSibling )
1306
- this._MergePreviousSibling( innerSibling ) ;
1307
- }
1308
- }
1309
- },
1310
-
1311
- /**
1312
- * Build the cssText based on the styles definition.
1313
- */
1314
- _GetStyleText : function()
1315
- {
1316
- var stylesDef = this._StyleDesc.Styles ;
1317
-
1318
- // Builds the StyleText.
1319
- var stylesText = ( this._StyleDesc.Attributes ? this._StyleDesc.Attributes['style'] || '' : '' ) ;
1320
-
1321
- if ( stylesText.length > 0 )
1322
- stylesText += ';' ;
1323
-
1324
- for ( var style in stylesDef )
1325
- stylesText += style + ':' + stylesDef[style] + ';' ;
1326
-
1327
- // Browsers make some changes to the style when applying them. So, here
1328
- // we normalize it to the browser format. We'll not do that if there
1329
- // are variables inside the style.
1330
- if ( stylesText.length > 0 && !( /#\(/.test( stylesText ) ) )
1331
- {
1332
- stylesText = FCKTools.NormalizeCssText( stylesText ) ;
1333
- }
1334
-
1335
- return (this._GetStyleText = function() { return stylesText ; })() ;
1336
- },
1337
-
1338
- /**
1339
- * Get the the collection used to compare the attributes defined in this
1340
- * style with attributes in an element. All information in it is lowercased.
1341
- */
1342
- _GetAttribsForComparison : function()
1343
- {
1344
- // If we have already computed it, just return it.
1345
- var attribs = this._GetAttribsForComparison_$ ;
1346
- if ( attribs )
1347
- return attribs ;
1348
-
1349
- attribs = new Object() ;
1350
-
1351
- // Loop through all defined attributes.
1352
- var styleAttribs = this._StyleDesc.Attributes ;
1353
- if ( styleAttribs )
1354
- {
1355
- for ( var styleAtt in styleAttribs )
1356
- {
1357
- attribs[ styleAtt.toLowerCase() ] = styleAttribs[ styleAtt ].toLowerCase() ;
1358
- }
1359
- }
1360
-
1361
- // Includes the style definitions.
1362
- if ( this._GetStyleText().length > 0 )
1363
- {
1364
- attribs['style'] = this._GetStyleText().toLowerCase() ;
1365
- }
1366
-
1367
- // Appends the "length" information to the object.
1368
- FCKTools.AppendLengthProperty( attribs, '_length' ) ;
1369
-
1370
- // Return it, saving it to the next request.
1371
- return ( this._GetAttribsForComparison_$ = attribs ) ;
1372
- },
1373
-
1374
- /**
1375
- * Get the the collection used to compare the elements and attributes,
1376
- * defined in this style overrides, with other element. All information in
1377
- * it is lowercased.
1378
- */
1379
- _GetOverridesForComparison : function()
1380
- {
1381
- // If we have already computed it, just return it.
1382
- var overrides = this._GetOverridesForComparison_$ ;
1383
- if ( overrides )
1384
- return overrides ;
1385
-
1386
- overrides = new Object() ;
1387
-
1388
- var overridesDesc = this._StyleDesc.Overrides ;
1389
-
1390
- if ( overridesDesc )
1391
- {
1392
- // The override description can be a string, object or array.
1393
- // Internally, well handle arrays only, so transform it if needed.
1394
- if ( !FCKTools.IsArray( overridesDesc ) )
1395
- overridesDesc = [ overridesDesc ] ;
1396
-
1397
- // Loop through all override definitions.
1398
- for ( var i = 0 ; i < overridesDesc.length ; i++ )
1399
- {
1400
- var override = overridesDesc[i] ;
1401
- var elementName ;
1402
- var overrideEl ;
1403
- var attrs ;
1404
-
1405
- // If can be a string with the element name.
1406
- if ( typeof override == 'string' )
1407
- elementName = override.toLowerCase() ;
1408
- // Or an object.
1409
- else
1410
- {
1411
- elementName = override.Element ? override.Element.toLowerCase() : this.Element ;
1412
- attrs = override.Attributes ;
1413
- }
1414
-
1415
- // We can have more than one override definition for the same
1416
- // element name, so we attempt to simply append information to
1417
- // it if it already exists.
1418
- overrideEl = overrides[ elementName ] || ( overrides[ elementName ] = {} ) ;
1419
-
1420
- if ( attrs )
1421
- {
1422
- // The returning attributes list is an array, because we
1423
- // could have different override definitions for the same
1424
- // attribute name.
1425
- var overrideAttrs = ( overrideEl.Attributes = overrideEl.Attributes || new Array() ) ;
1426
- for ( var attName in attrs )
1427
- {
1428
- // Each item in the attributes array is also an array,
1429
- // where [0] is the attribute name and [1] is the
1430
- // override value.
1431
- overrideAttrs.push( [ attName.toLowerCase(), attrs[ attName ] ] ) ;
1432
- }
1433
- }
1434
- }
1435
- }
1436
-
1437
- return ( this._GetOverridesForComparison_$ = overrides ) ;
1438
- },
1439
-
1440
- /*
1441
- * Create and object containing all attributes specified in an element,
1442
- * added by a "_length" property. All values are lowercased.
1443
- */
1444
- _CreateElementAttribsForComparison : function( element )
1445
- {
1446
- var attribs = new Object() ;
1447
- var attribsCount = 0 ;
1448
-
1449
- for ( var i = 0 ; i < element.attributes.length ; i++ )
1450
- {
1451
- var att = element.attributes[i] ;
1452
-
1453
- if ( att.specified )
1454
- {
1455
- attribs[ att.nodeName.toLowerCase() ] = FCKDomTools.GetAttributeValue( element, att ).toLowerCase() ;
1456
- attribsCount++ ;
1457
- }
1458
- }
1459
-
1460
- attribs._length = attribsCount ;
1461
-
1462
- return attribs ;
1463
- },
1464
-
1465
- /**
1466
- * Checks is the element attributes have a perfect match with the style
1467
- * attributes.
1468
- */
1469
- _CheckAttributesMatch : function( element, styleAttribs )
1470
- {
1471
- // Loop through all specified attributes. The same number of
1472
- // attributes must be found and their values must match to
1473
- // declare them as equal.
1474
-
1475
- var elementAttrbs = element.attributes ;
1476
- var matchCount = 0 ;
1477
-
1478
- for ( var i = 0 ; i < elementAttrbs.length ; i++ )
1479
- {
1480
- var att = elementAttrbs[i] ;
1481
- if ( att.specified )
1482
- {
1483
- var attName = att.nodeName.toLowerCase() ;
1484
- var styleAtt = styleAttribs[ attName ] ;
1485
-
1486
- // The attribute is not defined in the style.
1487
- if ( !styleAtt )
1488
- break ;
1489
-
1490
- // The values are different.
1491
- if ( styleAtt != FCKDomTools.GetAttributeValue( element, att ).toLowerCase() )
1492
- break ;
1493
-
1494
- matchCount++ ;
1495
- }
1496
- }
1497
-
1498
- return ( matchCount == styleAttribs._length ) ;
1499
- }
1500
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbar.js DELETED
@@ -1,103 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbar Class: represents a toolbar in the toolbarset. It is a group of
22
- * toolbar items.
23
- */
24
-
25
- var FCKToolbar = function()
26
- {
27
- this.Items = new Array() ;
28
- }
29
-
30
- FCKToolbar.prototype.AddItem = function( item )
31
- {
32
- return this.Items[ this.Items.length ] = item ;
33
- }
34
-
35
- FCKToolbar.prototype.AddButton = function( name, label, tooltip, iconPathOrStripInfoArrayOrIndex, style, state )
36
- {
37
- if ( typeof( iconPathOrStripInfoArrayOrIndex ) == 'number' )
38
- iconPathOrStripInfoArrayOrIndex = [ this.DefaultIconsStrip, this.DefaultIconSize, iconPathOrStripInfoArrayOrIndex ] ;
39
-
40
- var oButton = new FCKToolbarButtonUI( name, label, tooltip, iconPathOrStripInfoArrayOrIndex, style, state ) ;
41
- oButton._FCKToolbar = this ;
42
- oButton.OnClick = FCKToolbar_OnItemClick ;
43
-
44
- return this.AddItem( oButton ) ;
45
- }
46
-
47
- function FCKToolbar_OnItemClick( item )
48
- {
49
- var oToolbar = item._FCKToolbar ;
50
-
51
- if ( oToolbar.OnItemClick )
52
- oToolbar.OnItemClick( oToolbar, item ) ;
53
- }
54
-
55
- FCKToolbar.prototype.AddSeparator = function()
56
- {
57
- this.AddItem( new FCKToolbarSeparator() ) ;
58
- }
59
-
60
- FCKToolbar.prototype.Create = function( parentElement )
61
- {
62
- var oDoc = FCKTools.GetElementDocument( parentElement ) ;
63
-
64
- var e = oDoc.createElement( 'table' ) ;
65
- e.className = 'TB_Toolbar' ;
66
- e.style.styleFloat = e.style.cssFloat = ( FCKLang.Dir == 'ltr' ? 'left' : 'right' ) ;
67
- e.dir = FCKLang.Dir ;
68
- e.cellPadding = 0 ;
69
- e.cellSpacing = 0 ;
70
-
71
- var targetRow = e.insertRow(-1) ;
72
-
73
- // Insert the start cell.
74
- var eCell ;
75
-
76
- if ( !this.HideStart )
77
- {
78
- eCell = targetRow.insertCell(-1) ;
79
- eCell.appendChild( oDoc.createElement( 'div' ) ).className = 'TB_Start' ;
80
- }
81
-
82
- for ( var i = 0 ; i < this.Items.length ; i++ )
83
- {
84
- this.Items[i].Create( targetRow.insertCell(-1) ) ;
85
- }
86
-
87
- // Insert the ending cell.
88
- if ( !this.HideEnd )
89
- {
90
- eCell = targetRow.insertCell(-1) ;
91
- eCell.appendChild( oDoc.createElement( 'div' ) ).className = 'TB_End' ;
92
- }
93
-
94
- parentElement.appendChild( e ) ;
95
- }
96
-
97
- var FCKToolbarSeparator = function()
98
- {}
99
-
100
- FCKToolbarSeparator.prototype.Create = function( parentElement )
101
- {
102
- FCKTools.AppendElement( parentElement, 'div' ).className = 'TB_Separator' ;
103
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbarbreak_gecko.js DELETED
@@ -1,36 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbarBreak Class: breaks the toolbars.
22
- * It makes it possible to force the toolbar to break to a new line.
23
- * This is the Gecko specific implementation.
24
- */
25
-
26
- var FCKToolbarBreak = function()
27
- {}
28
-
29
- FCKToolbarBreak.prototype.Create = function( targetElement )
30
- {
31
- var oBreakDiv = targetElement.ownerDocument.createElement( 'div' ) ;
32
-
33
- oBreakDiv.style.clear = oBreakDiv.style.cssFloat = FCKLang.Dir == 'rtl' ? 'right' : 'left' ;
34
-
35
- targetElement.appendChild( oBreakDiv ) ;
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbarbreak_ie.js DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbarBreak Class: breaks the toolbars.
22
- * It makes it possible to force the toolbar to break to a new line.
23
- * This is the IE specific implementation.
24
- */
25
-
26
- var FCKToolbarBreak = function()
27
- {}
28
-
29
- FCKToolbarBreak.prototype.Create = function( targetElement )
30
- {
31
- var oBreakDiv = FCKTools.GetElementDocument( targetElement ).createElement( 'div' ) ;
32
-
33
- oBreakDiv.className = 'TB_Break' ;
34
-
35
- oBreakDiv.style.clear = FCKLang.Dir == 'rtl' ? 'left' : 'right' ;
36
-
37
- targetElement.appendChild( oBreakDiv ) ;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbarbutton.js DELETED
@@ -1,81 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbarButton Class: represents a button in the toolbar.
22
- */
23
-
24
- var FCKToolbarButton = function( commandName, label, tooltip, style, sourceView, contextSensitive, icon )
25
- {
26
- this.CommandName = commandName ;
27
- this.Label = label ;
28
- this.Tooltip = tooltip ;
29
- this.Style = style ;
30
- this.SourceView = sourceView ? true : false ;
31
- this.ContextSensitive = contextSensitive ? true : false ;
32
-
33
- if ( icon == null )
34
- this.IconPath = FCKConfig.SkinPath + 'toolbar/' + commandName.toLowerCase() + '.gif' ;
35
- else if ( typeof( icon ) == 'number' )
36
- this.IconPath = [ FCKConfig.SkinPath + 'fck_strip.gif', 16, icon ] ;
37
- else
38
- this.IconPath = icon ;
39
- }
40
-
41
- FCKToolbarButton.prototype.Create = function( targetElement )
42
- {
43
- this._UIButton = new FCKToolbarButtonUI( this.CommandName, this.Label, this.Tooltip, this.IconPath, this.Style ) ;
44
- this._UIButton.OnClick = this.Click ;
45
- this._UIButton._ToolbarButton = this ;
46
- this._UIButton.Create( targetElement ) ;
47
- }
48
-
49
- FCKToolbarButton.prototype.RefreshState = function()
50
- {
51
- var uiButton = this._UIButton ;
52
-
53
- if ( !uiButton )
54
- return ;
55
-
56
- // Gets the actual state.
57
- var eState = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).GetState() ;
58
-
59
- // If there are no state changes than do nothing and return.
60
- if ( eState == uiButton.State ) return ;
61
-
62
- // Sets the actual state.
63
- uiButton.ChangeState( eState ) ;
64
- }
65
-
66
- FCKToolbarButton.prototype.Click = function()
67
- {
68
- var oToolbarButton = this._ToolbarButton || this ;
69
- FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( oToolbarButton.CommandName ).Execute() ;
70
- }
71
-
72
- FCKToolbarButton.prototype.Enable = function()
73
- {
74
- this.RefreshState() ;
75
- }
76
-
77
- FCKToolbarButton.prototype.Disable = function()
78
- {
79
- // Sets the actual state.
80
- this._UIButton.ChangeState( FCK_TRISTATE_DISABLED ) ;
81
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbarbuttonui.js DELETED
@@ -1,198 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbarButtonUI Class: interface representation of a toolbar button.
22
- */
23
-
24
- var FCKToolbarButtonUI = function( name, label, tooltip, iconPathOrStripInfoArray, style, state )
25
- {
26
- this.Name = name ;
27
- this.Label = label || name ;
28
- this.Tooltip = tooltip || this.Label ;
29
- this.Style = style || FCK_TOOLBARITEM_ONLYICON ;
30
- this.State = state || FCK_TRISTATE_OFF ;
31
-
32
- this.Icon = new FCKIcon( iconPathOrStripInfoArray ) ;
33
-
34
- if ( FCK.IECleanup )
35
- FCK.IECleanup.AddItem( this, FCKToolbarButtonUI_Cleanup ) ;
36
- }
37
-
38
-
39
- FCKToolbarButtonUI.prototype._CreatePaddingElement = function( document )
40
- {
41
- var oImg = document.createElement( 'IMG' ) ;
42
- oImg.className = 'TB_Button_Padding' ;
43
- oImg.src = FCK_SPACER_PATH ;
44
- return oImg ;
45
- }
46
-
47
- FCKToolbarButtonUI.prototype.Create = function( parentElement )
48
- {
49
- var oDoc = FCKTools.GetElementDocument( parentElement ) ;
50
-
51
- // Create the Main Element.
52
- var oMainElement = this.MainElement = oDoc.createElement( 'DIV' ) ;
53
- oMainElement.title = this.Tooltip ;
54
-
55
- // The following will prevent the button from catching the focus.
56
- if ( FCKBrowserInfo.IsGecko )
57
- oMainElement.onmousedown = FCKTools.CancelEvent ;
58
-
59
- FCKTools.AddEventListenerEx( oMainElement, 'mouseover', FCKToolbarButtonUI_OnMouseOver, this ) ;
60
- FCKTools.AddEventListenerEx( oMainElement, 'mouseout', FCKToolbarButtonUI_OnMouseOut, this ) ;
61
- FCKTools.AddEventListenerEx( oMainElement, 'click', FCKToolbarButtonUI_OnClick, this ) ;
62
-
63
- this.ChangeState( this.State, true ) ;
64
-
65
- if ( this.Style == FCK_TOOLBARITEM_ONLYICON && !this.ShowArrow )
66
- {
67
- // <td><div class="TB_Button_On" title="Smiley">{Image}</div></td>
68
-
69
- oMainElement.appendChild( this.Icon.CreateIconElement( oDoc ) ) ;
70
- }
71
- else
72
- {
73
- // <td><div class="TB_Button_On" title="Smiley"><table cellpadding="0" cellspacing="0"><tr><td>{Image}</td><td nowrap>Toolbar Button</td><td><img class="TB_Button_Padding"></td></tr></table></div></td>
74
- // <td><div class="TB_Button_On" title="Smiley"><table cellpadding="0" cellspacing="0"><tr><td><img class="TB_Button_Padding"></td><td nowrap>Toolbar Button</td><td><img class="TB_Button_Padding"></td></tr></table></div></td>
75
-
76
- var oTable = oMainElement.appendChild( oDoc.createElement( 'TABLE' ) ) ;
77
- oTable.cellPadding = 0 ;
78
- oTable.cellSpacing = 0 ;
79
-
80
- var oRow = oTable.insertRow(-1) ;
81
-
82
- // The Image cell (icon or padding).
83
- var oCell = oRow.insertCell(-1) ;
84
-
85
- if ( this.Style == FCK_TOOLBARITEM_ONLYICON || this.Style == FCK_TOOLBARITEM_ICONTEXT )
86
- oCell.appendChild( this.Icon.CreateIconElement( oDoc ) ) ;
87
- else
88
- oCell.appendChild( this._CreatePaddingElement( oDoc ) ) ;
89
-
90
- if ( this.Style == FCK_TOOLBARITEM_ONLYTEXT || this.Style == FCK_TOOLBARITEM_ICONTEXT )
91
- {
92
- // The Text cell.
93
- oCell = oRow.insertCell(-1) ;
94
- oCell.className = 'TB_Button_Text' ;
95
- oCell.noWrap = true ;
96
- oCell.appendChild( oDoc.createTextNode( this.Label ) ) ;
97
- }
98
-
99
- if ( this.ShowArrow )
100
- {
101
- if ( this.Style != FCK_TOOLBARITEM_ONLYICON )
102
- {
103
- // A padding cell.
104
- oRow.insertCell(-1).appendChild( this._CreatePaddingElement( oDoc ) ) ;
105
- }
106
-
107
- oCell = oRow.insertCell(-1) ;
108
- var eImg = oCell.appendChild( oDoc.createElement( 'IMG' ) ) ;
109
- eImg.src = FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif' ;
110
- eImg.width = 5 ;
111
- eImg.height = 3 ;
112
- }
113
-
114
- // The last padding cell.
115
- oCell = oRow.insertCell(-1) ;
116
- oCell.appendChild( this._CreatePaddingElement( oDoc ) ) ;
117
- }
118
-
119
- parentElement.appendChild( oMainElement ) ;
120
- }
121
-
122
- FCKToolbarButtonUI.prototype.ChangeState = function( newState, force )
123
- {
124
- if ( !force && this.State == newState )
125
- return ;
126
-
127
- var e = this.MainElement ;
128
-
129
- // In IE it can happen when the page is reloaded that MainElement is null, so exit here
130
- if ( !e )
131
- return ;
132
-
133
- switch ( parseInt( newState, 10 ) )
134
- {
135
- case FCK_TRISTATE_OFF :
136
- e.className = 'TB_Button_Off' ;
137
- break ;
138
-
139
- case FCK_TRISTATE_ON :
140
- e.className = 'TB_Button_On' ;
141
- break ;
142
-
143
- case FCK_TRISTATE_DISABLED :
144
- e.className = 'TB_Button_Disabled' ;
145
- break ;
146
- }
147
-
148
- this.State = newState ;
149
- }
150
-
151
- function FCKToolbarButtonUI_OnMouseOver( ev, button )
152
- {
153
- if ( button.State == FCK_TRISTATE_OFF )
154
- this.className = 'TB_Button_Off_Over' ;
155
- else if ( button.State == FCK_TRISTATE_ON )
156
- this.className = 'TB_Button_On_Over' ;
157
- }
158
-
159
- function FCKToolbarButtonUI_OnMouseOut( ev, button )
160
- {
161
- if ( button.State == FCK_TRISTATE_OFF )
162
- this.className = 'TB_Button_Off' ;
163
- else if ( button.State == FCK_TRISTATE_ON )
164
- this.className = 'TB_Button_On' ;
165
- }
166
-
167
- function FCKToolbarButtonUI_OnClick( ev, button )
168
- {
169
- if ( button.OnClick && button.State != FCK_TRISTATE_DISABLED )
170
- button.OnClick( button ) ;
171
- }
172
-
173
- function FCKToolbarButtonUI_Cleanup()
174
- {
175
- // This one should not cause memory leak, but just for safety, let's clean
176
- // it up.
177
- this.MainElement = null ;
178
- }
179
-
180
- /*
181
- Sample outputs:
182
-
183
- This is the base structure. The variation is the image that is marked as {Image}:
184
- <td><div class="TB_Button_On" title="Smiley">{Image}</div></td>
185
- <td><div class="TB_Button_On" title="Smiley"><table cellpadding="0" cellspacing="0"><tr><td>{Image}</td><td nowrap>Toolbar Button</td><td><img class="TB_Button_Padding"></td></tr></table></div></td>
186
- <td><div class="TB_Button_On" title="Smiley"><table cellpadding="0" cellspacing="0"><tr><td><img class="TB_Button_Padding"></td><td nowrap>Toolbar Button</td><td><img class="TB_Button_Padding"></td></tr></table></div></td>
187
-
188
- These are samples of possible {Image} values:
189
-
190
- Strip - IE version:
191
- <div class="TB_Button_Image"><img src="strip.gif" style="top:-16px"></div>
192
-
193
- Strip : Firefox, Safari and Opera version
194
- <img class="TB_Button_Image" style="background-position: 0px -16px;background-image: url(strip.gif);">
195
-
196
- No-Strip : Browser independent:
197
- <img class="TB_Button_Image" src="smiley.gif">
198
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbarfontformatcombo.js DELETED
@@ -1,139 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbarPanelButton Class: Handles the Fonts combo selector.
22
- */
23
-
24
- var FCKToolbarFontFormatCombo = function( tooltip, style )
25
- {
26
- if ( tooltip === false )
27
- return ;
28
-
29
- this.CommandName = 'FontFormat' ;
30
- this.Label = this.GetLabel() ;
31
- this.Tooltip = tooltip ? tooltip : this.Label ;
32
- this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
33
-
34
- this.NormalLabel = 'Normal' ;
35
-
36
- this.PanelWidth = 190 ;
37
-
38
- this.DefaultLabel = FCKConfig.DefaultFontFormatLabel || '' ;
39
- }
40
-
41
- // Inherit from FCKToolbarSpecialCombo.
42
- FCKToolbarFontFormatCombo.prototype = new FCKToolbarStyleCombo( false ) ;
43
-
44
- FCKToolbarFontFormatCombo.prototype.GetLabel = function()
45
- {
46
- return FCKLang.FontFormat ;
47
- }
48
-
49
- FCKToolbarFontFormatCombo.prototype.GetStyles = function()
50
- {
51
- var styles = {} ;
52
-
53
- // Get the format names from the language file.
54
- var aNames = FCKLang['FontFormats'].split(';') ;
55
- var oNames = {
56
- p : aNames[0],
57
- pre : aNames[1],
58
- address : aNames[2],
59
- h1 : aNames[3],
60
- h2 : aNames[4],
61
- h3 : aNames[5],
62
- h4 : aNames[6],
63
- h5 : aNames[7],
64
- h6 : aNames[8],
65
- div : aNames[9] || ( aNames[0] + ' (DIV)')
66
- } ;
67
-
68
- // Get the available formats from the configuration file.
69
- var elements = FCKConfig.FontFormats.split(';') ;
70
-
71
- for ( var i = 0 ; i < elements.length ; i++ )
72
- {
73
- var elementName = elements[ i ] ;
74
- var style = FCKStyles.GetStyle( '_FCK_' + elementName ) ;
75
- if ( style )
76
- {
77
- style.Label = oNames[ elementName ] ;
78
- styles[ '_FCK_' + elementName ] = style ;
79
- }
80
- else
81
- alert( "The FCKConfig.CoreStyles['" + elementName + "'] setting was not found. Please check the fckconfig.js file" ) ;
82
- }
83
-
84
- return styles ;
85
- }
86
-
87
- FCKToolbarFontFormatCombo.prototype.RefreshActiveItems = function( targetSpecialCombo )
88
- {
89
- var startElement = FCK.ToolbarSet.CurrentInstance.Selection.GetBoundaryParentElement( true ) ;
90
-
91
- if ( startElement )
92
- {
93
- var path = new FCKElementPath( startElement ) ;
94
- var blockElement = path.Block ;
95
-
96
- if ( blockElement )
97
- {
98
- for ( var i in targetSpecialCombo.Items )
99
- {
100
- var item = targetSpecialCombo.Items[i] ;
101
- var style = item.Style ;
102
-
103
- if ( style.CheckElementRemovable( blockElement ) )
104
- {
105
- targetSpecialCombo.SetLabel( style.Label ) ;
106
- return ;
107
- }
108
- }
109
- }
110
- }
111
-
112
- targetSpecialCombo.SetLabel( this.DefaultLabel ) ;
113
- }
114
-
115
- FCKToolbarFontFormatCombo.prototype.StyleCombo_OnBeforeClick = function( targetSpecialCombo )
116
- {
117
- // Clear the current selection.
118
- targetSpecialCombo.DeselectAll() ;
119
-
120
- var startElement = FCK.ToolbarSet.CurrentInstance.Selection.GetBoundaryParentElement( true ) ;
121
-
122
- if ( startElement )
123
- {
124
- var path = new FCKElementPath( startElement ) ;
125
- var blockElement = path.Block ;
126
-
127
- for ( var i in targetSpecialCombo.Items )
128
- {
129
- var item = targetSpecialCombo.Items[i] ;
130
- var style = item.Style ;
131
-
132
- if ( style.CheckElementRemovable( blockElement ) )
133
- {
134
- targetSpecialCombo.SelectItem( item ) ;
135
- return ;
136
- }
137
- }
138
- }
139
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbarfontscombo.js DELETED
@@ -1,98 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbarPanelButton Class: Handles the Fonts combo selector.
22
- */
23
-
24
- var FCKToolbarFontsCombo = function( tooltip, style )
25
- {
26
- this.CommandName = 'FontName' ;
27
- this.Label = this.GetLabel() ;
28
- this.Tooltip = tooltip ? tooltip : this.Label ;
29
- this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
30
-
31
- this.DefaultLabel = FCKConfig.DefaultFontLabel || '' ;
32
- }
33
-
34
- // Inherit from FCKToolbarSpecialCombo.
35
- FCKToolbarFontsCombo.prototype = new FCKToolbarFontFormatCombo( false ) ;
36
-
37
- FCKToolbarFontsCombo.prototype.GetLabel = function()
38
- {
39
- return FCKLang.Font ;
40
- }
41
-
42
- FCKToolbarFontsCombo.prototype.GetStyles = function()
43
- {
44
- var baseStyle = FCKStyles.GetStyle( '_FCK_FontFace' ) ;
45
-
46
- if ( !baseStyle )
47
- {
48
- alert( "The FCKConfig.CoreStyles['Size'] setting was not found. Please check the fckconfig.js file" ) ;
49
- return {} ;
50
- }
51
-
52
- var styles = {} ;
53
-
54
- var fonts = FCKConfig.FontNames.split(';') ;
55
-
56
- for ( var i = 0 ; i < fonts.length ; i++ )
57
- {
58
- var fontParts = fonts[i].split('/') ;
59
- var font = fontParts[0] ;
60
- var caption = fontParts[1] || font ;
61
-
62
- var style = FCKTools.CloneObject( baseStyle ) ;
63
-
64
- style.SetVariable( 'Font', font ) ;
65
- style.Label = caption ;
66
-
67
- styles[ caption ] = style ;
68
- }
69
-
70
- return styles ;
71
- }
72
-
73
- FCKToolbarFontsCombo.prototype.RefreshActiveItems = FCKToolbarStyleCombo.prototype.RefreshActiveItems ;
74
-
75
- FCKToolbarFontsCombo.prototype.StyleCombo_OnBeforeClick = function( targetSpecialCombo )
76
- {
77
- // Clear the current selection.
78
- targetSpecialCombo.DeselectAll() ;
79
-
80
- var startElement = FCKSelection.GetBoundaryParentElement( true ) ;
81
-
82
- if ( startElement )
83
- {
84
- var path = new FCKElementPath( startElement ) ;
85
-
86
- for ( var i in targetSpecialCombo.Items )
87
- {
88
- var item = targetSpecialCombo.Items[i] ;
89
- var style = item.Style ;
90
-
91
- if ( style.CheckActive( path ) )
92
- {
93
- targetSpecialCombo.SelectItem( item ) ;
94
- return ;
95
- }
96
- }
97
- }
98
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbarfontsizecombo.js DELETED
@@ -1,76 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbarPanelButton Class: Handles the Fonts combo selector.
22
- */
23
-
24
- var FCKToolbarFontSizeCombo = function( tooltip, style )
25
- {
26
- this.CommandName = 'FontSize' ;
27
- this.Label = this.GetLabel() ;
28
- this.Tooltip = tooltip ? tooltip : this.Label ;
29
- this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
30
-
31
- this.DefaultLabel = FCKConfig.DefaultFontSizeLabel || '' ;
32
-
33
- this.FieldWidth = 70 ;
34
- }
35
-
36
- // Inherit from FCKToolbarSpecialCombo.
37
- FCKToolbarFontSizeCombo.prototype = new FCKToolbarFontFormatCombo( false ) ;
38
-
39
- FCKToolbarFontSizeCombo.prototype.GetLabel = function()
40
- {
41
- return FCKLang.FontSize ;
42
- }
43
-
44
- FCKToolbarFontSizeCombo.prototype.GetStyles = function()
45
- {
46
- var baseStyle = FCKStyles.GetStyle( '_FCK_Size' ) ;
47
-
48
- if ( !baseStyle )
49
- {
50
- alert( "The FCKConfig.CoreStyles['FontFace'] setting was not found. Please check the fckconfig.js file" ) ;
51
- return {} ;
52
- }
53
-
54
- var styles = {} ;
55
-
56
- var fonts = FCKConfig.FontSizes.split(';') ;
57
-
58
- for ( var i = 0 ; i < fonts.length ; i++ )
59
- {
60
- var fontParts = fonts[i].split('/') ;
61
- var font = fontParts[0] ;
62
- var caption = fontParts[1] || font ;
63
-
64
- var style = FCKTools.CloneObject( baseStyle ) ;
65
- style.SetVariable( 'Size', font ) ;
66
- style.Label = caption ;
67
-
68
- styles[ caption ] = style ;
69
- }
70
-
71
- return styles ;
72
- }
73
-
74
- FCKToolbarFontSizeCombo.prototype.RefreshActiveItems = FCKToolbarStyleCombo.prototype.RefreshActiveItems ;
75
-
76
- FCKToolbarFontSizeCombo.prototype.StyleCombo_OnBeforeClick = FCKToolbarFontsCombo.prototype.StyleCombo_OnBeforeClick ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js DELETED
@@ -1,103 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbarPanelButton Class: represents a special button in the toolbar
22
- * that shows a panel when pressed.
23
- */
24
-
25
- var FCKToolbarPanelButton = function( commandName, label, tooltip, style, icon )
26
- {
27
- this.CommandName = commandName ;
28
-
29
- var oIcon ;
30
-
31
- if ( icon == null )
32
- oIcon = FCKConfig.SkinPath + 'toolbar/' + commandName.toLowerCase() + '.gif' ;
33
- else if ( typeof( icon ) == 'number' )
34
- oIcon = [ FCKConfig.SkinPath + 'fck_strip.gif', 16, icon ] ;
35
-
36
- var oUIButton = this._UIButton = new FCKToolbarButtonUI( commandName, label, tooltip, oIcon, style ) ;
37
- oUIButton._FCKToolbarPanelButton = this ;
38
- oUIButton.ShowArrow = true ;
39
- oUIButton.OnClick = FCKToolbarPanelButton_OnButtonClick ;
40
- }
41
-
42
- FCKToolbarPanelButton.prototype.TypeName = 'FCKToolbarPanelButton' ;
43
-
44
- FCKToolbarPanelButton.prototype.Create = function( parentElement )
45
- {
46
- parentElement.className += 'Menu' ;
47
-
48
- this._UIButton.Create( parentElement ) ;
49
-
50
- var oPanel = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName )._Panel ;
51
- this.RegisterPanel( oPanel ) ;
52
- }
53
-
54
- FCKToolbarPanelButton.prototype.RegisterPanel = function( oPanel )
55
- {
56
- if ( oPanel._FCKToolbarPanelButton )
57
- return ;
58
-
59
- oPanel._FCKToolbarPanelButton = this ;
60
-
61
- var eLineDiv = oPanel.Document.body.appendChild( oPanel.Document.createElement( 'div' ) ) ;
62
- eLineDiv.style.position = 'absolute' ;
63
- eLineDiv.style.top = '0px' ;
64
-
65
- var eLine = oPanel._FCKToolbarPanelButtonLineDiv = eLineDiv.appendChild( oPanel.Document.createElement( 'IMG' ) ) ;
66
- eLine.className = 'TB_ConnectionLine' ;
67
- eLine.style.position = 'absolute' ;
68
- // eLine.style.backgroundColor = 'Red' ;
69
- eLine.src = FCK_SPACER_PATH ;
70
-
71
- oPanel.OnHide = FCKToolbarPanelButton_OnPanelHide ;
72
- }
73
-
74
- /*
75
- Events
76
- */
77
-
78
- function FCKToolbarPanelButton_OnButtonClick( toolbarButton )
79
- {
80
- var oButton = this._FCKToolbarPanelButton ;
81
- var e = oButton._UIButton.MainElement ;
82
-
83
- oButton._UIButton.ChangeState( FCK_TRISTATE_ON ) ;
84
-
85
- // oButton.LineImg.style.width = ( e.offsetWidth - 2 ) + 'px' ;
86
-
87
- var oCommand = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( oButton.CommandName ) ;
88
- var oPanel = oCommand._Panel ;
89
- oPanel._FCKToolbarPanelButtonLineDiv.style.width = ( e.offsetWidth - 2 ) + 'px' ;
90
- oCommand.Execute( 0, e.offsetHeight - 1, e ) ; // -1 to be over the border
91
- }
92
-
93
- function FCKToolbarPanelButton_OnPanelHide()
94
- {
95
- var oMenuButton = this._FCKToolbarPanelButton ;
96
- oMenuButton._UIButton.ChangeState( FCK_TRISTATE_OFF ) ;
97
- }
98
-
99
- // The Panel Button works like a normal button so the refresh state functions
100
- // defined for the normal button can be reused here.
101
- FCKToolbarPanelButton.prototype.RefreshState = FCKToolbarButton.prototype.RefreshState ;
102
- FCKToolbarPanelButton.prototype.Enable = FCKToolbarButton.prototype.Enable ;
103
- FCKToolbarPanelButton.prototype.Disable = FCKToolbarButton.prototype.Disable ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbarspecialcombo.js DELETED
@@ -1,146 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbarSpecialCombo Class: This is a "abstract" base class to be used
22
- * by the special combo toolbar elements like font name, font size, paragraph format, etc...
23
- *
24
- * The following properties and methods must be implemented when inheriting from
25
- * this class:
26
- * - Property: CommandName [ The command name to be executed ]
27
- * - Method: GetLabel() [ Returns the label ]
28
- * - CreateItems( targetSpecialCombo ) [ Add all items in the special combo ]
29
- */
30
-
31
- var FCKToolbarSpecialCombo = function()
32
- {
33
- this.SourceView = false ;
34
- this.ContextSensitive = true ;
35
- this.FieldWidth = null ;
36
- this.PanelWidth = null ;
37
- this.PanelMaxHeight = null ;
38
- //this._LastValue = null ;
39
- }
40
-
41
-
42
- FCKToolbarSpecialCombo.prototype.DefaultLabel = '' ;
43
-
44
- function FCKToolbarSpecialCombo_OnSelect( itemId, item )
45
- {
46
- FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).Execute( itemId, item ) ;
47
- }
48
-
49
- FCKToolbarSpecialCombo.prototype.Create = function( targetElement )
50
- {
51
- this._Combo = new FCKSpecialCombo( this.GetLabel(), this.FieldWidth, this.PanelWidth, this.PanelMaxHeight, FCKBrowserInfo.IsIE ? window : FCKTools.GetElementWindow( targetElement ).parent ) ;
52
-
53
- /*
54
- this._Combo.FieldWidth = this.FieldWidth != null ? this.FieldWidth : 100 ;
55
- this._Combo.PanelWidth = this.PanelWidth != null ? this.PanelWidth : 150 ;
56
- this._Combo.PanelMaxHeight = this.PanelMaxHeight != null ? this.PanelMaxHeight : 150 ;
57
- */
58
-
59
- //this._Combo.Command.Name = this.Command.Name;
60
- // this._Combo.Label = this.Label ;
61
- this._Combo.Tooltip = this.Tooltip ;
62
- this._Combo.Style = this.Style ;
63
-
64
- this.CreateItems( this._Combo ) ;
65
-
66
- this._Combo.Create( targetElement ) ;
67
-
68
- this._Combo.CommandName = this.CommandName ;
69
-
70
- this._Combo.OnSelect = FCKToolbarSpecialCombo_OnSelect ;
71
- }
72
-
73
- function FCKToolbarSpecialCombo_RefreshActiveItems( combo, value )
74
- {
75
- combo.DeselectAll() ;
76
- combo.SelectItem( value ) ;
77
- combo.SetLabelById( value ) ;
78
- }
79
-
80
- FCKToolbarSpecialCombo.prototype.RefreshState = function()
81
- {
82
- // Gets the actual state.
83
- var eState ;
84
-
85
- // if ( FCK.EditMode == FCK_EDITMODE_SOURCE && ! this.SourceView )
86
- // eState = FCK_TRISTATE_DISABLED ;
87
- // else
88
- // {
89
- var sValue = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).GetState() ;
90
-
91
- // FCKDebug.Output( 'RefreshState of Special Combo "' + this.TypeOf + '" - State: ' + sValue ) ;
92
-
93
- if ( sValue != FCK_TRISTATE_DISABLED )
94
- {
95
- eState = FCK_TRISTATE_ON ;
96
-
97
- if ( this.RefreshActiveItems )
98
- this.RefreshActiveItems( this._Combo, sValue ) ;
99
- else
100
- {
101
- if ( this._LastValue !== sValue)
102
- {
103
- this._LastValue = sValue ;
104
-
105
- if ( !sValue || sValue.length == 0 )
106
- {
107
- this._Combo.DeselectAll() ;
108
- this._Combo.SetLabel( this.DefaultLabel ) ;
109
- }
110
- else
111
- FCKToolbarSpecialCombo_RefreshActiveItems( this._Combo, sValue ) ;
112
- }
113
- }
114
- }
115
- else
116
- eState = FCK_TRISTATE_DISABLED ;
117
- // }
118
-
119
- // If there are no state changes then do nothing and return.
120
- if ( eState == this.State ) return ;
121
-
122
- if ( eState == FCK_TRISTATE_DISABLED )
123
- {
124
- this._Combo.DeselectAll() ;
125
- this._Combo.SetLabel( '' ) ;
126
- }
127
-
128
- // Sets the actual state.
129
- this.State = eState ;
130
-
131
- // Updates the graphical state.
132
- this._Combo.SetEnabled( eState != FCK_TRISTATE_DISABLED ) ;
133
- }
134
-
135
- FCKToolbarSpecialCombo.prototype.Enable = function()
136
- {
137
- this.RefreshState() ;
138
- }
139
-
140
- FCKToolbarSpecialCombo.prototype.Disable = function()
141
- {
142
- this.State = FCK_TRISTATE_DISABLED ;
143
- this._Combo.DeselectAll() ;
144
- this._Combo.SetLabel( '' ) ;
145
- this._Combo.SetEnabled( false ) ;
146
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fcktoolbarstylecombo.js DELETED
@@ -1,200 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKToolbarPanelButton Class: Handles the Fonts combo selector.
22
- */
23
-
24
- var FCKToolbarStyleCombo = function( tooltip, style )
25
- {
26
- if ( tooltip === false )
27
- return ;
28
-
29
- this.CommandName = 'Style' ;
30
- this.Label = this.GetLabel() ;
31
- this.Tooltip = tooltip ? tooltip : this.Label ;
32
- this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
33
-
34
- this.DefaultLabel = FCKConfig.DefaultStyleLabel || '' ;
35
- }
36
-
37
- // Inherit from FCKToolbarSpecialCombo.
38
- FCKToolbarStyleCombo.prototype = new FCKToolbarSpecialCombo ;
39
-
40
- FCKToolbarStyleCombo.prototype.GetLabel = function()
41
- {
42
- return FCKLang.Style ;
43
- }
44
-
45
- FCKToolbarStyleCombo.prototype.GetStyles = function()
46
- {
47
- var styles = {} ;
48
- var allStyles = FCK.ToolbarSet.CurrentInstance.Styles.GetStyles() ;
49
-
50
- for ( var styleName in allStyles )
51
- {
52
- var style = allStyles[ styleName ] ;
53
- if ( !style.IsCore )
54
- styles[ styleName ] = style ;
55
- }
56
- return styles ;
57
- }
58
-
59
- FCKToolbarStyleCombo.prototype.CreateItems = function( targetSpecialCombo )
60
- {
61
- var targetDoc = targetSpecialCombo._Panel.Document ;
62
-
63
- // Add the Editor Area CSS to the panel so the style classes are previewed correctly.
64
- FCKTools.AppendStyleSheet( targetDoc, FCKConfig.ToolbarComboPreviewCSS ) ;
65
- FCKTools.AppendStyleString( targetDoc, FCKConfig.EditorAreaStyles ) ;
66
- targetDoc.body.className += ' ForceBaseFont' ;
67
-
68
- // Add ID and Class to the body.
69
- FCKConfig.ApplyBodyAttributes( targetDoc.body ) ;
70
-
71
- // Get the styles list.
72
- var styles = this.GetStyles() ;
73
-
74
- for ( var styleName in styles )
75
- {
76
- var style = styles[ styleName ] ;
77
-
78
- // Object type styles have no preview.
79
- var caption = style.GetType() == FCK_STYLE_OBJECT ?
80
- styleName :
81
- FCKToolbarStyleCombo_BuildPreview( style, style.Label || styleName ) ;
82
-
83
- var item = targetSpecialCombo.AddItem( styleName, caption ) ;
84
-
85
- item.Style = style ;
86
- }
87
-
88
- // We must prepare the list before showing it.
89
- targetSpecialCombo.OnBeforeClick = this.StyleCombo_OnBeforeClick ;
90
- }
91
-
92
- FCKToolbarStyleCombo.prototype.RefreshActiveItems = function( targetSpecialCombo )
93
- {
94
- var startElement = FCK.ToolbarSet.CurrentInstance.Selection.GetBoundaryParentElement( true ) ;
95
-
96
- if ( startElement )
97
- {
98
- var path = new FCKElementPath( startElement ) ;
99
- var elements = path.Elements ;
100
-
101
- for ( var e = 0 ; e < elements.length ; e++ )
102
- {
103
- for ( var i in targetSpecialCombo.Items )
104
- {
105
- var item = targetSpecialCombo.Items[i] ;
106
- var style = item.Style ;
107
-
108
- if ( style.CheckElementRemovable( elements[ e ], true ) )
109
- {
110
- targetSpecialCombo.SetLabel( style.Label || style.Name ) ;
111
- return ;
112
- }
113
- }
114
- }
115
- }
116
-
117
- targetSpecialCombo.SetLabel( this.DefaultLabel ) ;
118
- }
119
-
120
- FCKToolbarStyleCombo.prototype.StyleCombo_OnBeforeClick = function( targetSpecialCombo )
121
- {
122
- // Two things are done here:
123
- // - In a control selection, get the element name, so we'll display styles
124
- // for that element only.
125
- // - Select the styles that are active for the current selection.
126
-
127
- // Clear the current selection.
128
- targetSpecialCombo.DeselectAll() ;
129
-
130
- var startElement ;
131
- var path ;
132
- var tagName ;
133
-
134
- var selection = FCK.ToolbarSet.CurrentInstance.Selection ;
135
-
136
- if ( selection.GetType() == 'Control' )
137
- {
138
- startElement = selection.GetSelectedElement() ;
139
- tagName = startElement.nodeName.toLowerCase() ;
140
- }
141
- else
142
- {
143
- startElement = selection.GetBoundaryParentElement( true ) ;
144
- path = new FCKElementPath( startElement ) ;
145
- }
146
-
147
- for ( var i in targetSpecialCombo.Items )
148
- {
149
- var item = targetSpecialCombo.Items[i] ;
150
- var style = item.Style ;
151
-
152
- if ( ( tagName && style.Element == tagName ) || ( !tagName && style.GetType() != FCK_STYLE_OBJECT ) )
153
- {
154
- item.style.display = '' ;
155
-
156
- if ( ( path && style.CheckActive( path ) ) || ( !path && style.CheckElementRemovable( startElement, true ) ) )
157
- targetSpecialCombo.SelectItem( style.Name ) ;
158
- }
159
- else
160
- item.style.display = 'none' ;
161
- }
162
- }
163
-
164
- function FCKToolbarStyleCombo_BuildPreview( style, caption )
165
- {
166
- var styleType = style.GetType() ;
167
- var html = [] ;
168
-
169
- if ( styleType == FCK_STYLE_BLOCK )
170
- html.push( '<div class="BaseFont">' ) ;
171
-
172
- var elementName = style.Element ;
173
-
174
- // Avoid <bdo> in the preview.
175
- if ( elementName == 'bdo' )
176
- elementName = 'span' ;
177
-
178
- html = [ '<', elementName ] ;
179
-
180
- // Assign all defined attributes.
181
- var attribs = style._StyleDesc.Attributes ;
182
- if ( attribs )
183
- {
184
- for ( var att in attribs )
185
- {
186
- html.push( ' ', att, '="', style.GetFinalAttributeValue( att ), '"' ) ;
187
- }
188
- }
189
-
190
- // Assign the style attribute.
191
- if ( style._GetStyleText().length > 0 )
192
- html.push( ' style="', style.GetFinalStyleValue(), '"' ) ;
193
-
194
- html.push( '>', caption, '</', elementName, '>' ) ;
195
-
196
- if ( styleType == FCK_STYLE_BLOCK )
197
- html.push( '</div>' ) ;
198
-
199
- return html.join( '' ) ;
200
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckw3crange.js DELETED
@@ -1,451 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This class partially implements the W3C DOM Range for browser that don't
22
- * support the standards (like IE):
23
- * http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html
24
- */
25
-
26
- var FCKW3CRange = function( parentDocument )
27
- {
28
- this._Document = parentDocument ;
29
-
30
- this.startContainer = null ;
31
- this.startOffset = null ;
32
- this.endContainer = null ;
33
- this.endOffset = null ;
34
- this.collapsed = true ;
35
- }
36
-
37
- FCKW3CRange.CreateRange = function( parentDocument )
38
- {
39
- // We could opt to use the Range implementation of the browsers. The problem
40
- // is that every browser have different bugs on their implementations,
41
- // mostly related to different interpretations of the W3C specifications.
42
- // So, for now, let's use our implementation and pray for browsers fixings
43
- // soon. Otherwise will go crazy on trying to find out workarounds.
44
- /*
45
- // Get the browser implementation of the range, if available.
46
- if ( parentDocument.createRange )
47
- {
48
- var range = parentDocument.createRange() ;
49
- if ( typeof( range.startContainer ) != 'undefined' )
50
- return range ;
51
- }
52
- */
53
- return new FCKW3CRange( parentDocument ) ;
54
- }
55
-
56
- FCKW3CRange.CreateFromRange = function( parentDocument, sourceRange )
57
- {
58
- var range = FCKW3CRange.CreateRange( parentDocument ) ;
59
- range.setStart( sourceRange.startContainer, sourceRange.startOffset ) ;
60
- range.setEnd( sourceRange.endContainer, sourceRange.endOffset ) ;
61
- return range ;
62
- }
63
-
64
- FCKW3CRange.prototype =
65
- {
66
-
67
- _UpdateCollapsed : function()
68
- {
69
- this.collapsed = ( this.startContainer == this.endContainer && this.startOffset == this.endOffset ) ;
70
- },
71
-
72
- // W3C requires a check for the new position. If it is after the end
73
- // boundary, the range should be collapsed to the new start. It seams we
74
- // will not need this check for our use of this class so we can ignore it for now.
75
- setStart : function( refNode, offset )
76
- {
77
- this.startContainer = refNode ;
78
- this.startOffset = offset ;
79
-
80
- if ( !this.endContainer )
81
- {
82
- this.endContainer = refNode ;
83
- this.endOffset = offset ;
84
- }
85
-
86
- this._UpdateCollapsed() ;
87
- },
88
-
89
- // W3C requires a check for the new position. If it is before the start
90
- // boundary, the range should be collapsed to the new end. It seams we
91
- // will not need this check for our use of this class so we can ignore it for now.
92
- setEnd : function( refNode, offset )
93
- {
94
- this.endContainer = refNode ;
95
- this.endOffset = offset ;
96
-
97
- if ( !this.startContainer )
98
- {
99
- this.startContainer = refNode ;
100
- this.startOffset = offset ;
101
- }
102
-
103
- this._UpdateCollapsed() ;
104
- },
105
-
106
- setStartAfter : function( refNode )
107
- {
108
- this.setStart( refNode.parentNode, FCKDomTools.GetIndexOf( refNode ) + 1 ) ;
109
- },
110
-
111
- setStartBefore : function( refNode )
112
- {
113
- this.setStart( refNode.parentNode, FCKDomTools.GetIndexOf( refNode ) ) ;
114
- },
115
-
116
- setEndAfter : function( refNode )
117
- {
118
- this.setEnd( refNode.parentNode, FCKDomTools.GetIndexOf( refNode ) + 1 ) ;
119
- },
120
-
121
- setEndBefore : function( refNode )
122
- {
123
- this.setEnd( refNode.parentNode, FCKDomTools.GetIndexOf( refNode ) ) ;
124
- },
125
-
126
- collapse : function( toStart )
127
- {
128
- if ( toStart )
129
- {
130
- this.endContainer = this.startContainer ;
131
- this.endOffset = this.startOffset ;
132
- }
133
- else
134
- {
135
- this.startContainer = this.endContainer ;
136
- this.startOffset = this.endOffset ;
137
- }
138
-
139
- this.collapsed = true ;
140
- },
141
-
142
- selectNodeContents : function( refNode )
143
- {
144
- this.setStart( refNode, 0 ) ;
145
- this.setEnd( refNode, refNode.nodeType == 3 ? refNode.data.length : refNode.childNodes.length ) ;
146
- },
147
-
148
- insertNode : function( newNode )
149
- {
150
- var startContainer = this.startContainer ;
151
- var startOffset = this.startOffset ;
152
-
153
- // If we are in a text node.
154
- if ( startContainer.nodeType == 3 )
155
- {
156
- startContainer.splitText( startOffset ) ;
157
-
158
- // Check if it is necessary to update the end boundary.
159
- if ( startContainer == this.endContainer )
160
- this.setEnd( startContainer.nextSibling, this.endOffset - this.startOffset ) ;
161
-
162
- // Insert the new node it after the text node.
163
- FCKDomTools.InsertAfterNode( startContainer, newNode ) ;
164
-
165
- return ;
166
- }
167
- else
168
- {
169
- // Simply insert the new node before the current start node.
170
- startContainer.insertBefore( newNode, startContainer.childNodes[ startOffset ] || null ) ;
171
-
172
- // Check if it is necessary to update the end boundary.
173
- if ( startContainer == this.endContainer )
174
- {
175
- this.endOffset++ ;
176
- this.collapsed = false ;
177
- }
178
- }
179
- },
180
-
181
- deleteContents : function()
182
- {
183
- if ( this.collapsed )
184
- return ;
185
-
186
- this._ExecContentsAction( 0 ) ;
187
- },
188
-
189
- extractContents : function()
190
- {
191
- var docFrag = new FCKDocumentFragment( this._Document ) ;
192
-
193
- if ( !this.collapsed )
194
- this._ExecContentsAction( 1, docFrag ) ;
195
-
196
- return docFrag ;
197
- },
198
-
199
- // The selection may be lost when cloning (due to the splitText() call).
200
- cloneContents : function()
201
- {
202
- var docFrag = new FCKDocumentFragment( this._Document ) ;
203
-
204
- if ( !this.collapsed )
205
- this._ExecContentsAction( 2, docFrag ) ;
206
-
207
- return docFrag ;
208
- },
209
-
210
- _ExecContentsAction : function( action, docFrag )
211
- {
212
- var startNode = this.startContainer ;
213
- var endNode = this.endContainer ;
214
-
215
- var startOffset = this.startOffset ;
216
- var endOffset = this.endOffset ;
217
-
218
- var removeStartNode = false ;
219
- var removeEndNode = false ;
220
-
221
- // Check the start and end nodes and make the necessary removals or changes.
222
-
223
- // Start from the end, otherwise DOM mutations (splitText) made in the
224
- // start boundary may interfere on the results here.
225
-
226
- // For text containers, we must simply split the node and point to the
227
- // second part. The removal will be handled by the rest of the code .
228
- if ( endNode.nodeType == 3 )
229
- endNode = endNode.splitText( endOffset ) ;
230
- else
231
- {
232
- // If the end container has children and the offset is pointing
233
- // to a child, then we should start from it.
234
- if ( endNode.childNodes.length > 0 )
235
- {
236
- // If the offset points after the last node.
237
- if ( endOffset > endNode.childNodes.length - 1 )
238
- {
239
- // Let's create a temporary node and mark it for removal.
240
- endNode = FCKDomTools.InsertAfterNode( endNode.lastChild, this._Document.createTextNode('') ) ;
241
- removeEndNode = true ;
242
- }
243
- else
244
- endNode = endNode.childNodes[ endOffset ] ;
245
- }
246
- }
247
-
248
- // For text containers, we must simply split the node. The removal will
249
- // be handled by the rest of the code .
250
- if ( startNode.nodeType == 3 )
251
- {
252
- startNode.splitText( startOffset ) ;
253
-
254
- // In cases the end node is the same as the start node, the above
255
- // splitting will also split the end, so me must move the end to
256
- // the second part of the split.
257
- if ( startNode == endNode )
258
- endNode = startNode.nextSibling ;
259
- }
260
- else
261
- {
262
- // If the start container has children and the offset is pointing
263
- // to a child, then we should start from its previous sibling.
264
-
265
- // If the offset points to the first node, we don't have a
266
- // sibling, so let's use the first one, but mark it for removal.
267
- if ( startOffset == 0 )
268
- {
269
- // Let's create a temporary node and mark it for removal.
270
- startNode = startNode.insertBefore( this._Document.createTextNode(''), startNode.firstChild ) ;
271
- removeStartNode = true ;
272
- }
273
- else if ( startOffset > startNode.childNodes.length - 1 )
274
- {
275
- // Let's create a temporary node and mark it for removal.
276
- startNode = startNode.appendChild( this._Document.createTextNode('') ) ;
277
- removeStartNode = true ;
278
- }
279
- else
280
- startNode = startNode.childNodes[ startOffset ].previousSibling ;
281
- }
282
-
283
- // Get the parent nodes tree for the start and end boundaries.
284
- var startParents = FCKDomTools.GetParents( startNode ) ;
285
- var endParents = FCKDomTools.GetParents( endNode ) ;
286
-
287
- // Compare them, to find the top most siblings.
288
- var i, topStart, topEnd ;
289
-
290
- for ( i = 0 ; i < startParents.length ; i++ )
291
- {
292
- topStart = startParents[i] ;
293
- topEnd = endParents[i] ;
294
-
295
- // The compared nodes will match until we find the top most
296
- // siblings (different nodes that have the same parent).
297
- // "i" will hold the index in the parents array for the top
298
- // most element.
299
- if ( topStart != topEnd )
300
- break ;
301
- }
302
-
303
- var clone, levelStartNode, levelClone, currentNode, currentSibling ;
304
-
305
- if ( docFrag )
306
- clone = docFrag.RootNode ;
307
-
308
- // Remove all successive sibling nodes for every node in the
309
- // startParents tree.
310
- for ( var j = i ; j < startParents.length ; j++ )
311
- {
312
- levelStartNode = startParents[j] ;
313
-
314
- // For Extract and Clone, we must clone this level.
315
- if ( clone && levelStartNode != startNode ) // action = 0 = Delete
316
- levelClone = clone.appendChild( levelStartNode.cloneNode( levelStartNode == startNode ) ) ;
317
-
318
- currentNode = levelStartNode.nextSibling ;
319
-
320
- while( currentNode )
321
- {
322
- // Stop processing when the current node matches a node in the
323
- // endParents tree or if it is the endNode.
324
- if ( currentNode == endParents[j] || currentNode == endNode )
325
- break ;
326
-
327
- // Cache the next sibling.
328
- currentSibling = currentNode.nextSibling ;
329
-
330
- // If cloning, just clone it.
331
- if ( action == 2 ) // 2 = Clone
332
- clone.appendChild( currentNode.cloneNode( true ) ) ;
333
- else
334
- {
335
- // Both Delete and Extract will remove the node.
336
- currentNode.parentNode.removeChild( currentNode ) ;
337
-
338
- // When Extracting, move the removed node to the docFrag.
339
- if ( action == 1 ) // 1 = Extract
340
- clone.appendChild( currentNode ) ;
341
- }
342
-
343
- currentNode = currentSibling ;
344
- }
345
-
346
- if ( clone )
347
- clone = levelClone ;
348
- }
349
-
350
- if ( docFrag )
351
- clone = docFrag.RootNode ;
352
-
353
- // Remove all previous sibling nodes for every node in the
354
- // endParents tree.
355
- for ( var k = i ; k < endParents.length ; k++ )
356
- {
357
- levelStartNode = endParents[k] ;
358
-
359
- // For Extract and Clone, we must clone this level.
360
- if ( action > 0 && levelStartNode != endNode ) // action = 0 = Delete
361
- levelClone = clone.appendChild( levelStartNode.cloneNode( levelStartNode == endNode ) ) ;
362
-
363
- // The processing of siblings may have already been done by the parent.
364
- if ( !startParents[k] || levelStartNode.parentNode != startParents[k].parentNode )
365
- {
366
- currentNode = levelStartNode.previousSibling ;
367
-
368
- while( currentNode )
369
- {
370
- // Stop processing when the current node matches a node in the
371
- // startParents tree or if it is the startNode.
372
- if ( currentNode == startParents[k] || currentNode == startNode )
373
- break ;
374
-
375
- // Cache the next sibling.
376
- currentSibling = currentNode.previousSibling ;
377
-
378
- // If cloning, just clone it.
379
- if ( action == 2 ) // 2 = Clone
380
- clone.insertBefore( currentNode.cloneNode( true ), clone.firstChild ) ;
381
- else
382
- {
383
- // Both Delete and Extract will remove the node.
384
- currentNode.parentNode.removeChild( currentNode ) ;
385
-
386
- // When Extracting, mode the removed node to the docFrag.
387
- if ( action == 1 ) // 1 = Extract
388
- clone.insertBefore( currentNode, clone.firstChild ) ;
389
- }
390
-
391
- currentNode = currentSibling ;
392
- }
393
- }
394
-
395
- if ( clone )
396
- clone = levelClone ;
397
- }
398
-
399
- if ( action == 2 ) // 2 = Clone.
400
- {
401
- // No changes in the DOM should be done, so fix the split text (if any).
402
-
403
- var startTextNode = this.startContainer ;
404
- if ( startTextNode.nodeType == 3 )
405
- {
406
- startTextNode.data += startTextNode.nextSibling.data ;
407
- startTextNode.parentNode.removeChild( startTextNode.nextSibling ) ;
408
- }
409
-
410
- var endTextNode = this.endContainer ;
411
- if ( endTextNode.nodeType == 3 && endTextNode.nextSibling )
412
- {
413
- endTextNode.data += endTextNode.nextSibling.data ;
414
- endTextNode.parentNode.removeChild( endTextNode.nextSibling ) ;
415
- }
416
- }
417
- else
418
- {
419
- // Collapse the range.
420
-
421
- // If a node has been partially selected, collapse the range between
422
- // topStart and topEnd. Otherwise, simply collapse it to the start. (W3C specs).
423
- if ( topStart && topEnd && ( startNode.parentNode != topStart.parentNode || endNode.parentNode != topEnd.parentNode ) )
424
- {
425
- var endIndex = FCKDomTools.GetIndexOf( topEnd ) ;
426
-
427
- // If the start node is to be removed, we must correct the
428
- // index to reflect the removal.
429
- if ( removeStartNode && topEnd.parentNode == startNode.parentNode )
430
- endIndex-- ;
431
-
432
- this.setStart( topEnd.parentNode, endIndex ) ;
433
- }
434
-
435
- // Collapse it to the start.
436
- this.collapse( true ) ;
437
- }
438
-
439
- // Cleanup any marked node.
440
- if( removeStartNode )
441
- startNode.parentNode.removeChild( startNode ) ;
442
-
443
- if( removeEndNode && endNode.parentNode )
444
- endNode.parentNode.removeChild( endNode ) ;
445
- },
446
-
447
- cloneRange : function()
448
- {
449
- return FCKW3CRange.CreateFromRange( this._Document, this ) ;
450
- }
451
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckxml.js DELETED
@@ -1,108 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKXml Class: class to load and manipulate XML files.
22
- * (IE specific implementation)
23
- */
24
-
25
- var FCKXml = function()
26
- {
27
- this.Error = false ;
28
- }
29
-
30
- FCKXml.GetAttribute = function( node, attName, defaultValue )
31
- {
32
- var attNode = node.attributes.getNamedItem( attName ) ;
33
- return attNode ? attNode.value : defaultValue ;
34
- }
35
-
36
- /**
37
- * Transforms a XML element node in a JavaScript object. Attributes defined for
38
- * the element will be available as properties, as long as child element
39
- * nodes, but the later will generate arrays with property names prefixed with "$".
40
- *
41
- * For example, the following XML element:
42
- *
43
- * <SomeNode name="Test" key="2">
44
- * <MyChild id="10">
45
- * <OtherLevel name="Level 3" />
46
- * </MyChild>
47
- * <MyChild id="25" />
48
- * <AnotherChild price="499" />
49
- * </SomeNode>
50
- *
51
- * ... results in the following object:
52
- *
53
- * {
54
- * name : "Test",
55
- * key : "2",
56
- * $MyChild :
57
- * [
58
- * {
59
- * id : "10",
60
- * $OtherLevel :
61
- * {
62
- * name : "Level 3"
63
- * }
64
- * },
65
- * {
66
- * id : "25"
67
- * }
68
- * ],
69
- * $AnotherChild :
70
- * [
71
- * {
72
- * price : "499"
73
- * }
74
- * ]
75
- * }
76
- */
77
- FCKXml.TransformToObject = function( element )
78
- {
79
- if ( !element )
80
- return null ;
81
-
82
- var obj = {} ;
83
-
84
- var attributes = element.attributes ;
85
- for ( var i = 0 ; i < attributes.length ; i++ )
86
- {
87
- var att = attributes[i] ;
88
- obj[ att.name ] = att.value ;
89
- }
90
-
91
- var childNodes = element.childNodes ;
92
- for ( i = 0 ; i < childNodes.length ; i++ )
93
- {
94
- var child = childNodes[i] ;
95
-
96
- if ( child.nodeType == 1 )
97
- {
98
- var childName = '$' + child.nodeName ;
99
- var childList = obj[ childName ] ;
100
- if ( !childList )
101
- childList = obj[ childName ] = [] ;
102
-
103
- childList.push( this.TransformToObject( child ) ) ;
104
- }
105
- }
106
-
107
- return obj ;
108
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckxml_gecko.js DELETED
@@ -1,106 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKXml Class: class to load and manipulate XML files.
22
- */
23
-
24
- FCKXml.prototype =
25
- {
26
- LoadUrl : function( urlToCall )
27
- {
28
- this.Error = false ;
29
-
30
- var oXml ;
31
- var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;
32
- oXmlHttp.open( 'GET', urlToCall, false ) ;
33
- oXmlHttp.send( null ) ;
34
-
35
- if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 || ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) )
36
- {
37
- oXml = oXmlHttp.responseXML ;
38
- // #1426: Fallback if responseXML isn't set for some
39
- // reason (e.g. improperly configured web server)
40
- if ( !oXml )
41
- oXml = (new DOMParser()).parseFromString( oXmlHttp.responseText, 'text/xml' ) ;
42
- }
43
- else
44
- oXml = null ;
45
-
46
- if ( oXml )
47
- {
48
- // Try to access something on it.
49
- try
50
- {
51
- var test = oXml.firstChild ;
52
- }
53
- catch (e)
54
- {
55
- // If document.domain has been changed (#123), we'll have a security
56
- // error at this point. The workaround here is parsing the responseText:
57
- // http://alexander.kirk.at/2006/07/27/firefox-15-xmlhttprequest-reqresponsexml-and-documentdomain/
58
- oXml = (new DOMParser()).parseFromString( oXmlHttp.responseText, 'text/xml' ) ;
59
- }
60
- }
61
-
62
- if ( !oXml || !oXml.firstChild )
63
- {
64
- this.Error = true ;
65
- if ( window.confirm( 'Error loading "' + urlToCall + '" (HTTP Status: ' + oXmlHttp.status + ').\r\nDo you want to see the server response dump?' ) )
66
- alert( oXmlHttp.responseText ) ;
67
- }
68
-
69
- this.DOMDocument = oXml ;
70
- },
71
-
72
- SelectNodes : function( xpath, contextNode )
73
- {
74
- if ( this.Error )
75
- return new Array() ;
76
-
77
- var aNodeArray = new Array();
78
-
79
- var xPathResult = this.DOMDocument.evaluate( xpath, contextNode ? contextNode : this.DOMDocument,
80
- this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) ;
81
- if ( xPathResult )
82
- {
83
- var oNode = xPathResult.iterateNext() ;
84
- while( oNode )
85
- {
86
- aNodeArray[aNodeArray.length] = oNode ;
87
- oNode = xPathResult.iterateNext();
88
- }
89
- }
90
- return aNodeArray ;
91
- },
92
-
93
- SelectSingleNode : function( xpath, contextNode )
94
- {
95
- if ( this.Error )
96
- return null ;
97
-
98
- var xPathResult = this.DOMDocument.evaluate( xpath, contextNode ? contextNode : this.DOMDocument,
99
- this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null);
100
-
101
- if ( xPathResult && xPathResult.singleNodeValue )
102
- return xPathResult.singleNodeValue ;
103
- else
104
- return null ;
105
- }
106
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/classes/fckxml_ie.js DELETED
@@ -1,93 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKXml Class: class to load and manipulate XML files.
22
- * (IE specific implementation)
23
- */
24
-
25
- FCKXml.prototype =
26
- {
27
- LoadUrl : function( urlToCall )
28
- {
29
- this.Error = false ;
30
-
31
- var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;
32
-
33
- if ( !oXmlHttp )
34
- {
35
- this.Error = true ;
36
- return ;
37
- }
38
-
39
- oXmlHttp.open( "GET", urlToCall, false ) ;
40
-
41
- oXmlHttp.send( null ) ;
42
-
43
- if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 || ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) )
44
- {
45
- this.DOMDocument = oXmlHttp.responseXML ;
46
-
47
- // #1426: Fallback if responseXML isn't set for some
48
- // reason (e.g. improperly configured web server)
49
- if ( !this.DOMDocument || this.DOMDocument.firstChild == null )
50
- {
51
- this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
52
- this.DOMDocument.async = false ;
53
- this.DOMDocument.resolveExternals = false ;
54
- this.DOMDocument.loadXML( oXmlHttp.responseText ) ;
55
- }
56
- }
57
- else
58
- {
59
- this.DOMDocument = null ;
60
- }
61
-
62
- if ( this.DOMDocument == null || this.DOMDocument.firstChild == null )
63
- {
64
- this.Error = true ;
65
- if (window.confirm( 'Error loading "' + urlToCall + '"\r\nDo you want to see more info?' ) )
66
- alert( 'URL requested: "' + urlToCall + '"\r\n' +
67
- 'Server response:\r\nStatus: ' + oXmlHttp.status + '\r\n' +
68
- 'Response text:\r\n' + oXmlHttp.responseText ) ;
69
- }
70
- },
71
-
72
- SelectNodes : function( xpath, contextNode )
73
- {
74
- if ( this.Error )
75
- return new Array() ;
76
-
77
- if ( contextNode )
78
- return contextNode.selectNodes( xpath ) ;
79
- else
80
- return this.DOMDocument.selectNodes( xpath ) ;
81
- },
82
-
83
- SelectSingleNode : function( xpath, contextNode )
84
- {
85
- if ( this.Error )
86
- return null ;
87
-
88
- if ( contextNode )
89
- return contextNode.selectSingleNode( xpath ) ;
90
- else
91
- return this.DOMDocument.selectSingleNode( xpath ) ;
92
- }
93
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fck_othercommands.js DELETED
@@ -1,634 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Definition of other commands that are not available internaly in the
22
- * browser (see FCKNamedCommand).
23
- */
24
-
25
- // ### General Dialog Box Commands.
26
- var FCKDialogCommand = function( name, title, url, width, height, getStateFunction, getStateParam, customValue )
27
- {
28
- this.Name = name ;
29
- this.Title = title ;
30
- this.Url = url ;
31
- this.Width = width ;
32
- this.Height = height ;
33
- this.CustomValue = customValue ;
34
-
35
- this.GetStateFunction = getStateFunction ;
36
- this.GetStateParam = getStateParam ;
37
-
38
- this.Resizable = false ;
39
- }
40
-
41
- FCKDialogCommand.prototype.Execute = function()
42
- {
43
- FCKDialog.OpenDialog( 'FCKDialog_' + this.Name , this.Title, this.Url, this.Width, this.Height, this.CustomValue, null, this.Resizable ) ;
44
- }
45
-
46
- FCKDialogCommand.prototype.GetState = function()
47
- {
48
- if ( this.GetStateFunction )
49
- return this.GetStateFunction( this.GetStateParam ) ;
50
- else
51
- return FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
52
- }
53
-
54
- // Generic Undefined command (usually used when a command is under development).
55
- var FCKUndefinedCommand = function()
56
- {
57
- this.Name = 'Undefined' ;
58
- }
59
-
60
- FCKUndefinedCommand.prototype.Execute = function()
61
- {
62
- alert( FCKLang.NotImplemented ) ;
63
- }
64
-
65
- FCKUndefinedCommand.prototype.GetState = function()
66
- {
67
- return FCK_TRISTATE_OFF ;
68
- }
69
-
70
-
71
- // ### FormatBlock
72
- var FCKFormatBlockCommand = function()
73
- {}
74
-
75
- FCKFormatBlockCommand.prototype =
76
- {
77
- Name : 'FormatBlock',
78
-
79
- Execute : FCKStyleCommand.prototype.Execute,
80
-
81
- GetState : function()
82
- {
83
- return FCK.EditorDocument ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
84
- }
85
- };
86
-
87
- // ### FontName
88
-
89
- var FCKFontNameCommand = function()
90
- {}
91
-
92
- FCKFontNameCommand.prototype =
93
- {
94
- Name : 'FontName',
95
- Execute : FCKStyleCommand.prototype.Execute,
96
- GetState : FCKFormatBlockCommand.prototype.GetState
97
- };
98
-
99
- // ### FontSize
100
- var FCKFontSizeCommand = function()
101
- {}
102
-
103
- FCKFontSizeCommand.prototype =
104
- {
105
- Name : 'FontSize',
106
- Execute : FCKStyleCommand.prototype.Execute,
107
- GetState : FCKFormatBlockCommand.prototype.GetState
108
- };
109
-
110
- // ### Preview
111
- var FCKPreviewCommand = function()
112
- {
113
- this.Name = 'Preview' ;
114
- }
115
-
116
- FCKPreviewCommand.prototype.Execute = function()
117
- {
118
- FCK.Preview() ;
119
- }
120
-
121
- FCKPreviewCommand.prototype.GetState = function()
122
- {
123
- return FCK_TRISTATE_OFF ;
124
- }
125
-
126
- // ### Save
127
- var FCKSaveCommand = function()
128
- {
129
- this.Name = 'Save' ;
130
- }
131
-
132
- FCKSaveCommand.prototype.Execute = function()
133
- {
134
- // Get the linked field form.
135
- var oForm = FCK.GetParentForm() ;
136
-
137
- if ( typeof( oForm.onsubmit ) == 'function' )
138
- {
139
- var bRet = oForm.onsubmit() ;
140
- if ( bRet != null && bRet === false )
141
- return ;
142
- }
143
-
144
- // Submit the form.
145
- // If there's a button named "submit" then the form.submit() function is masked and
146
- // can't be called in Mozilla, so we call the click() method of that button.
147
- if ( typeof( oForm.submit ) == 'function' )
148
- oForm.submit() ;
149
- else
150
- oForm.submit.click() ;
151
- }
152
-
153
- FCKSaveCommand.prototype.GetState = function()
154
- {
155
- return FCK_TRISTATE_OFF ;
156
- }
157
-
158
- // ### NewPage
159
- var FCKNewPageCommand = function()
160
- {
161
- this.Name = 'NewPage' ;
162
- }
163
-
164
- FCKNewPageCommand.prototype.Execute = function()
165
- {
166
- FCKUndo.SaveUndoStep() ;
167
- FCK.SetData( '' ) ;
168
- FCKUndo.Typing = true ;
169
- FCK.Focus() ;
170
- }
171
-
172
- FCKNewPageCommand.prototype.GetState = function()
173
- {
174
- return FCK_TRISTATE_OFF ;
175
- }
176
-
177
- // ### Source button
178
- var FCKSourceCommand = function()
179
- {
180
- this.Name = 'Source' ;
181
- }
182
-
183
- FCKSourceCommand.prototype.Execute = function()
184
- {
185
- if ( FCKConfig.SourcePopup ) // Until v2.2, it was mandatory for FCKBrowserInfo.IsGecko.
186
- {
187
- var iWidth = FCKConfig.ScreenWidth * 0.65 ;
188
- var iHeight = FCKConfig.ScreenHeight * 0.65 ;
189
- FCKDialog.OpenDialog( 'FCKDialog_Source', FCKLang.Source, 'dialog/fck_source.html', iWidth, iHeight, null, null, true ) ;
190
- }
191
- else
192
- FCK.SwitchEditMode() ;
193
- }
194
-
195
- FCKSourceCommand.prototype.GetState = function()
196
- {
197
- return ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_ON ) ;
198
- }
199
-
200
- // ### Undo
201
- var FCKUndoCommand = function()
202
- {
203
- this.Name = 'Undo' ;
204
- }
205
-
206
- FCKUndoCommand.prototype.Execute = function()
207
- {
208
- FCKUndo.Undo() ;
209
- }
210
-
211
- FCKUndoCommand.prototype.GetState = function()
212
- {
213
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
214
- return FCK_TRISTATE_DISABLED ;
215
- return ( FCKUndo.CheckUndoState() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ) ;
216
- }
217
-
218
- // ### Redo
219
- var FCKRedoCommand = function()
220
- {
221
- this.Name = 'Redo' ;
222
- }
223
-
224
- FCKRedoCommand.prototype.Execute = function()
225
- {
226
- FCKUndo.Redo() ;
227
- }
228
-
229
- FCKRedoCommand.prototype.GetState = function()
230
- {
231
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
232
- return FCK_TRISTATE_DISABLED ;
233
- return ( FCKUndo.CheckRedoState() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ) ;
234
- }
235
-
236
- // ### Page Break
237
- var FCKPageBreakCommand = function()
238
- {
239
- this.Name = 'PageBreak' ;
240
- }
241
-
242
- FCKPageBreakCommand.prototype.Execute = function()
243
- {
244
- // Take an undo snapshot before changing the document
245
- FCKUndo.SaveUndoStep() ;
246
-
247
- // var e = FCK.EditorDocument.createElement( 'CENTER' ) ;
248
- // e.style.pageBreakAfter = 'always' ;
249
-
250
- // Tidy was removing the empty CENTER tags, so the following solution has
251
- // been found. It also validates correctly as XHTML 1.0 Strict.
252
- var e = FCK.EditorDocument.createElement( 'DIV' ) ;
253
- e.style.pageBreakAfter = 'always' ;
254
- e.innerHTML = '<span style="DISPLAY:none">&nbsp;</span>' ;
255
-
256
- var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__PageBreak', e ) ;
257
- var oRange = new FCKDomRange( FCK.EditorWindow ) ;
258
- oRange.MoveToSelection() ;
259
- var oSplitInfo = oRange.SplitBlock() ;
260
- oRange.InsertNode( oFakeImage ) ;
261
-
262
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
263
- }
264
-
265
- FCKPageBreakCommand.prototype.GetState = function()
266
- {
267
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
268
- return FCK_TRISTATE_DISABLED ;
269
- return 0 ; // FCK_TRISTATE_OFF
270
- }
271
-
272
- // FCKUnlinkCommand - by Johnny Egeland (johnny@coretrek.com)
273
- var FCKUnlinkCommand = function()
274
- {
275
- this.Name = 'Unlink' ;
276
- }
277
-
278
- FCKUnlinkCommand.prototype.Execute = function()
279
- {
280
- // Take an undo snapshot before changing the document
281
- FCKUndo.SaveUndoStep() ;
282
-
283
- if ( FCKBrowserInfo.IsGeckoLike )
284
- {
285
- var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
286
- // The unlink command can generate a span in Firefox, so let's do it our way. See #430
287
- if ( oLink )
288
- FCKTools.RemoveOuterTags( oLink ) ;
289
-
290
- return ;
291
- }
292
-
293
- FCK.ExecuteNamedCommand( this.Name ) ;
294
- }
295
-
296
- FCKUnlinkCommand.prototype.GetState = function()
297
- {
298
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
299
- return FCK_TRISTATE_DISABLED ;
300
- var state = FCK.GetNamedCommandState( this.Name ) ;
301
-
302
- // Check that it isn't an anchor
303
- if ( state == FCK_TRISTATE_OFF && FCK.EditMode == FCK_EDITMODE_WYSIWYG )
304
- {
305
- var oLink = FCKSelection.MoveToAncestorNode( 'A' ) ;
306
- var bIsAnchor = ( oLink && oLink.name.length > 0 && oLink.href.length == 0 ) ;
307
- if ( bIsAnchor )
308
- state = FCK_TRISTATE_DISABLED ;
309
- }
310
-
311
- return state ;
312
- }
313
-
314
- var FCKVisitLinkCommand = function()
315
- {
316
- this.Name = 'VisitLink';
317
- }
318
- FCKVisitLinkCommand.prototype =
319
- {
320
- GetState : function()
321
- {
322
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
323
- return FCK_TRISTATE_DISABLED ;
324
- var state = FCK.GetNamedCommandState( 'Unlink' ) ;
325
-
326
- if ( state == FCK_TRISTATE_OFF )
327
- {
328
- var el = FCKSelection.MoveToAncestorNode( 'A' ) ;
329
- if ( !el.href )
330
- state = FCK_TRISTATE_DISABLED ;
331
- }
332
-
333
- return state ;
334
- },
335
-
336
- Execute : function()
337
- {
338
- var el = FCKSelection.MoveToAncestorNode( 'A' ) ;
339
- var url = el.getAttribute( '_fcksavedurl' ) || el.getAttribute( 'href', 2 ) ;
340
-
341
- // Check if it's a full URL.
342
- // If not full URL, we'll need to apply the BaseHref setting.
343
- if ( ! /:\/\//.test( url ) )
344
- {
345
- var baseHref = FCKConfig.BaseHref ;
346
- var parentWindow = FCK.GetInstanceObject( 'parent' ) ;
347
- if ( !baseHref )
348
- {
349
- baseHref = parentWindow.document.location.href ;
350
- baseHref = baseHref.substring( 0, baseHref.lastIndexOf( '/' ) + 1 ) ;
351
- }
352
-
353
- if ( /^\//.test( url ) )
354
- {
355
- try
356
- {
357
- baseHref = baseHref.match( /^.*:\/\/+[^\/]+/ )[0] ;
358
- }
359
- catch ( e )
360
- {
361
- baseHref = parentWindow.document.location.protocol + '://' + parentWindow.parent.document.location.host ;
362
- }
363
- }
364
-
365
- url = baseHref + url ;
366
- }
367
-
368
- if ( !window.open( url, '_blank' ) )
369
- alert( FCKLang.VisitLinkBlocked ) ;
370
- }
371
- } ;
372
-
373
- // FCKSelectAllCommand
374
- var FCKSelectAllCommand = function()
375
- {
376
- this.Name = 'SelectAll' ;
377
- }
378
-
379
- FCKSelectAllCommand.prototype.Execute = function()
380
- {
381
- if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
382
- {
383
- FCK.ExecuteNamedCommand( 'SelectAll' ) ;
384
- }
385
- else
386
- {
387
- // Select the contents of the textarea
388
- var textarea = FCK.EditingArea.Textarea ;
389
- if ( FCKBrowserInfo.IsIE )
390
- {
391
- textarea.createTextRange().execCommand( 'SelectAll' ) ;
392
- }
393
- else
394
- {
395
- textarea.selectionStart = 0 ;
396
- textarea.selectionEnd = textarea.value.length ;
397
- }
398
- textarea.focus() ;
399
- }
400
- }
401
-
402
- FCKSelectAllCommand.prototype.GetState = function()
403
- {
404
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
405
- return FCK_TRISTATE_DISABLED ;
406
- return FCK_TRISTATE_OFF ;
407
- }
408
-
409
- // FCKPasteCommand
410
- var FCKPasteCommand = function()
411
- {
412
- this.Name = 'Paste' ;
413
- }
414
-
415
- FCKPasteCommand.prototype =
416
- {
417
- Execute : function()
418
- {
419
- if ( FCKBrowserInfo.IsIE )
420
- FCK.Paste() ;
421
- else
422
- FCK.ExecuteNamedCommand( 'Paste' ) ;
423
- },
424
-
425
- GetState : function()
426
- {
427
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
428
- return FCK_TRISTATE_DISABLED ;
429
- return FCK.GetNamedCommandState( 'Paste' ) ;
430
- }
431
- } ;
432
-
433
- // FCKRuleCommand
434
- var FCKRuleCommand = function()
435
- {
436
- this.Name = 'Rule' ;
437
- }
438
-
439
- FCKRuleCommand.prototype =
440
- {
441
- Execute : function()
442
- {
443
- FCKUndo.SaveUndoStep() ;
444
- FCK.InsertElement( 'hr' ) ;
445
- },
446
-
447
- GetState : function()
448
- {
449
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
450
- return FCK_TRISTATE_DISABLED ;
451
- return FCK.GetNamedCommandState( 'InsertHorizontalRule' ) ;
452
- }
453
- } ;
454
-
455
- // FCKCutCopyCommand
456
- var FCKCutCopyCommand = function( isCut )
457
- {
458
- this.Name = isCut ? 'Cut' : 'Copy' ;
459
- }
460
-
461
- FCKCutCopyCommand.prototype =
462
- {
463
- Execute : function()
464
- {
465
- var enabled = false ;
466
-
467
- if ( FCKBrowserInfo.IsIE )
468
- {
469
- // The following seems to be the only reliable way to detect that
470
- // cut/copy is enabled in IE. It will fire the oncut/oncopy event
471
- // only if the security settings enabled the command to execute.
472
-
473
- var onEvent = function()
474
- {
475
- enabled = true ;
476
- } ;
477
-
478
- var eventName = 'on' + this.Name.toLowerCase() ;
479
-
480
- FCK.EditorDocument.body.attachEvent( eventName, onEvent ) ;
481
- FCK.ExecuteNamedCommand( this.Name ) ;
482
- FCK.EditorDocument.body.detachEvent( eventName, onEvent ) ;
483
- }
484
- else
485
- {
486
- try
487
- {
488
- // Other browsers throw an error if the command is disabled.
489
- FCK.ExecuteNamedCommand( this.Name ) ;
490
- enabled = true ;
491
- }
492
- catch(e){}
493
- }
494
-
495
- if ( !enabled )
496
- alert( FCKLang[ 'PasteError' + this.Name ] ) ;
497
- },
498
-
499
- GetState : function()
500
- {
501
- // Strangely, the Cut command happens to have the correct states for
502
- // both Copy and Cut in all browsers.
503
- return FCK.EditMode != FCK_EDITMODE_WYSIWYG ?
504
- FCK_TRISTATE_DISABLED :
505
- FCK.GetNamedCommandState( 'Cut' ) ;
506
- }
507
- };
508
-
509
- var FCKAnchorDeleteCommand = function()
510
- {
511
- this.Name = 'AnchorDelete' ;
512
- }
513
-
514
- FCKAnchorDeleteCommand.prototype =
515
- {
516
- Execute : function()
517
- {
518
- if (FCK.Selection.GetType() == 'Control')
519
- {
520
- FCK.Selection.Delete();
521
- }
522
- else
523
- {
524
- var oFakeImage = FCK.Selection.GetSelectedElement() ;
525
- if ( oFakeImage )
526
- {
527
- if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckanchor') )
528
- oAnchor = FCK.GetRealElement( oFakeImage ) ;
529
- else
530
- oFakeImage = null ;
531
- }
532
-
533
- //Search for a real anchor
534
- if ( !oFakeImage )
535
- {
536
- oAnchor = FCK.Selection.MoveToAncestorNode( 'A' ) ;
537
- if ( oAnchor )
538
- FCK.Selection.SelectNode( oAnchor ) ;
539
- }
540
-
541
- // If it's also a link, then just remove the name and exit
542
- if ( oAnchor.href.length != 0 )
543
- {
544
- oAnchor.removeAttribute( 'name' ) ;
545
- // Remove temporary class for IE
546
- if ( FCKBrowserInfo.IsIE )
547
- oAnchor.className = oAnchor.className.replace( FCKRegexLib.FCK_Class, '' ) ;
548
- return ;
549
- }
550
-
551
- // We need to remove the anchor
552
- // If we got a fake image, then just remove it and we're done
553
- if ( oFakeImage )
554
- {
555
- oFakeImage.parentNode.removeChild( oFakeImage ) ;
556
- return ;
557
- }
558
- // Empty anchor, so just remove it
559
- if ( oAnchor.innerHTML.length == 0 )
560
- {
561
- oAnchor.parentNode.removeChild( oAnchor ) ;
562
- return ;
563
- }
564
- // Anchor with content, leave the content
565
- FCKTools.RemoveOuterTags( oAnchor ) ;
566
- }
567
- if ( FCKBrowserInfo.IsGecko )
568
- FCK.Selection.Collapse( true ) ;
569
- },
570
-
571
- GetState : function()
572
- {
573
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
574
- return FCK_TRISTATE_DISABLED ;
575
- return FCK.GetNamedCommandState( 'Unlink') ;
576
- }
577
- };
578
-
579
- var FCKDeleteDivCommand = function()
580
- {
581
- }
582
- FCKDeleteDivCommand.prototype =
583
- {
584
- GetState : function()
585
- {
586
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
587
- return FCK_TRISTATE_DISABLED ;
588
-
589
- var node = FCKSelection.GetParentElement() ;
590
- var path = new FCKElementPath( node ) ;
591
- return path.BlockLimit && path.BlockLimit.nodeName.IEquals( 'div' ) ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
592
- },
593
-
594
- Execute : function()
595
- {
596
- // Create an undo snapshot before doing anything.
597
- FCKUndo.SaveUndoStep() ;
598
-
599
- // Find out the nodes to delete.
600
- var nodes = FCKDomTools.GetSelectedDivContainers() ;
601
-
602
- // Remember the current selection position.
603
- var range = new FCKDomRange( FCK.EditorWindow ) ;
604
- range.MoveToSelection() ;
605
- var bookmark = range.CreateBookmark() ;
606
-
607
- // Delete the container DIV node.
608
- for ( var i = 0 ; i < nodes.length ; i++)
609
- FCKDomTools.RemoveNode( nodes[i], true ) ;
610
-
611
- // Restore selection.
612
- range.MoveToBookmark( bookmark ) ;
613
- range.Select() ;
614
- }
615
- } ;
616
-
617
- // FCKRuleCommand
618
- var FCKNbsp = function()
619
- {
620
- this.Name = 'Non Breaking Space' ;
621
- }
622
-
623
- FCKNbsp.prototype =
624
- {
625
- Execute : function()
626
- {
627
- FCK.InsertHtml( '&nbsp;' ) ;
628
- },
629
-
630
- GetState : function()
631
- {
632
- return ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_DISABLED : FCK_TRISTATE_OFF ) ;
633
- }
634
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckblockquotecommand.js DELETED
@@ -1,281 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKBlockQuoteCommand Class: adds or removes blockquote tags.
22
- */
23
-
24
- var FCKBlockQuoteCommand = function()
25
- {
26
- }
27
-
28
- FCKBlockQuoteCommand.prototype =
29
- {
30
- Execute : function()
31
- {
32
- FCKUndo.SaveUndoStep() ;
33
-
34
- var state = this.GetState() ;
35
-
36
- var range = new FCKDomRange( FCK.EditorWindow ) ;
37
- range.MoveToSelection() ;
38
-
39
- var bookmark = range.CreateBookmark() ;
40
-
41
- // Kludge for #1592: if the bookmark nodes are in the beginning of
42
- // blockquote, then move them to the nearest block element in the
43
- // blockquote.
44
- if ( FCKBrowserInfo.IsIE )
45
- {
46
- var bStart = range.GetBookmarkNode( bookmark, true ) ;
47
- var bEnd = range.GetBookmarkNode( bookmark, false ) ;
48
-
49
- var cursor ;
50
-
51
- if ( bStart
52
- && bStart.parentNode.nodeName.IEquals( 'blockquote' )
53
- && !bStart.previousSibling )
54
- {
55
- cursor = bStart ;
56
- while ( ( cursor = cursor.nextSibling ) )
57
- {
58
- if ( FCKListsLib.BlockElements[ cursor.nodeName.toLowerCase() ] )
59
- FCKDomTools.MoveNode( bStart, cursor, true ) ;
60
- }
61
- }
62
-
63
- if ( bEnd
64
- && bEnd.parentNode.nodeName.IEquals( 'blockquote' )
65
- && !bEnd.previousSibling )
66
- {
67
- cursor = bEnd ;
68
- while ( ( cursor = cursor.nextSibling ) )
69
- {
70
- if ( FCKListsLib.BlockElements[ cursor.nodeName.toLowerCase() ] )
71
- {
72
- if ( cursor.firstChild == bStart )
73
- FCKDomTools.InsertAfterNode( bStart, bEnd ) ;
74
- else
75
- FCKDomTools.MoveNode( bEnd, cursor, true ) ;
76
- }
77
- }
78
- }
79
- }
80
-
81
- var iterator = new FCKDomRangeIterator( range ) ;
82
- var block ;
83
-
84
- if ( state == FCK_TRISTATE_OFF )
85
- {
86
- var paragraphs = [] ;
87
- while ( ( block = iterator.GetNextParagraph() ) )
88
- paragraphs.push( block ) ;
89
-
90
- // If no paragraphs, create one from the current selection position.
91
- if ( paragraphs.length < 1 )
92
- {
93
- para = range.Window.document.createElement( FCKConfig.EnterMode.IEquals( 'p' ) ? 'p' : 'div' ) ;
94
- range.InsertNode( para ) ;
95
- para.appendChild( range.Window.document.createTextNode( '\ufeff' ) ) ;
96
- range.MoveToBookmark( bookmark ) ;
97
- range.MoveToNodeContents( para ) ;
98
- range.Collapse( true ) ;
99
- bookmark = range.CreateBookmark() ;
100
- paragraphs.push( para ) ;
101
- }
102
-
103
- // Make sure all paragraphs have the same parent.
104
- var commonParent = paragraphs[0].parentNode ;
105
- var tmp = [] ;
106
- for ( var i = 0 ; i < paragraphs.length ; i++ )
107
- {
108
- block = paragraphs[i] ;
109
- commonParent = FCKDomTools.GetCommonParents( block.parentNode, commonParent ).pop() ;
110
- }
111
-
112
- // The common parent must not be the following tags: table, tbody, tr, ol, ul.
113
- while ( commonParent.nodeName.IEquals( 'table', 'tbody', 'tr', 'ol', 'ul' ) )
114
- commonParent = commonParent.parentNode ;
115
-
116
- // Reconstruct the block list to be processed such that all resulting blocks
117
- // satisfy parentNode == commonParent.
118
- var lastBlock = null ;
119
- while ( paragraphs.length > 0 )
120
- {
121
- block = paragraphs.shift() ;
122
- while ( block.parentNode != commonParent )
123
- block = block.parentNode ;
124
- if ( block != lastBlock )
125
- tmp.push( block ) ;
126
- lastBlock = block ;
127
- }
128
-
129
- // If any of the selected blocks is a blockquote, remove it to prevent nested blockquotes.
130
- while ( tmp.length > 0 )
131
- {
132
- block = tmp.shift() ;
133
- if ( block.nodeName.IEquals( 'blockquote' ) )
134
- {
135
- var docFrag = FCKTools.GetElementDocument( block ).createDocumentFragment() ;
136
- while ( block.firstChild )
137
- {
138
- docFrag.appendChild( block.removeChild( block.firstChild ) ) ;
139
- paragraphs.push( docFrag.lastChild ) ;
140
- }
141
- block.parentNode.replaceChild( docFrag, block ) ;
142
- }
143
- else
144
- paragraphs.push( block ) ;
145
- }
146
-
147
- // Now we have all the blocks to be included in a new blockquote node.
148
- var bqBlock = range.Window.document.createElement( 'blockquote' ) ;
149
- commonParent.insertBefore( bqBlock, paragraphs[0] ) ;
150
- while ( paragraphs.length > 0 )
151
- {
152
- block = paragraphs.shift() ;
153
- bqBlock.appendChild( block ) ;
154
- }
155
- }
156
- else if ( state == FCK_TRISTATE_ON )
157
- {
158
- var moveOutNodes = [] ;
159
- var elementMarkers = {} ;
160
- while ( ( block = iterator.GetNextParagraph() ) )
161
- {
162
- var bqParent = null ;
163
- var bqChild = null ;
164
- while ( block.parentNode )
165
- {
166
- if ( block.parentNode.nodeName.IEquals( 'blockquote' ) )
167
- {
168
- bqParent = block.parentNode ;
169
- bqChild = block ;
170
- break ;
171
- }
172
- block = block.parentNode ;
173
- }
174
-
175
- // Remember the blocks that were recorded down in the moveOutNodes array
176
- // to prevent duplicates.
177
- if ( bqParent && bqChild && !bqChild._fckblockquotemoveout )
178
- {
179
- moveOutNodes.push( bqChild ) ;
180
- FCKDomTools.SetElementMarker( elementMarkers, bqChild, '_fckblockquotemoveout', true ) ;
181
- }
182
- }
183
- FCKDomTools.ClearAllMarkers( elementMarkers ) ;
184
-
185
- var movedNodes = [] ;
186
- var processedBlockquoteBlocks = [], elementMarkers = {} ;
187
- var noBlockLeft = function( bqBlock )
188
- {
189
- for ( var i = 0 ; i < bqBlock.childNodes.length ; i++ )
190
- {
191
- if ( FCKListsLib.BlockElements[ bqBlock.childNodes[i].nodeName.toLowerCase() ] )
192
- return false ;
193
- }
194
- return true ;
195
- } ;
196
- while ( moveOutNodes.length > 0 )
197
- {
198
- var node = moveOutNodes.shift() ;
199
- var bqBlock = node.parentNode ;
200
-
201
- // If the node is located at the beginning or the end, just take it out without splitting.
202
- // Otherwise, split the blockquote node and move the paragraph in between the two blockquote nodes.
203
- if ( node == node.parentNode.firstChild )
204
- bqBlock.parentNode.insertBefore( bqBlock.removeChild( node ), bqBlock ) ;
205
- else if ( node == node.parentNode.lastChild )
206
- bqBlock.parentNode.insertBefore( bqBlock.removeChild( node ), bqBlock.nextSibling ) ;
207
- else
208
- FCKDomTools.BreakParent( node, node.parentNode, range ) ;
209
-
210
- // Remember the blockquote node so we can clear it later (if it becomes empty).
211
- if ( !bqBlock._fckbqprocessed )
212
- {
213
- processedBlockquoteBlocks.push( bqBlock ) ;
214
- FCKDomTools.SetElementMarker( elementMarkers, bqBlock, '_fckbqprocessed', true );
215
- }
216
-
217
- movedNodes.push( node ) ;
218
- }
219
-
220
- // Clear blockquote nodes that have become empty.
221
- for ( var i = processedBlockquoteBlocks.length - 1 ; i >= 0 ; i-- )
222
- {
223
- var bqBlock = processedBlockquoteBlocks[i] ;
224
- if ( noBlockLeft( bqBlock ) )
225
- FCKDomTools.RemoveNode( bqBlock ) ;
226
- }
227
- FCKDomTools.ClearAllMarkers( elementMarkers ) ;
228
-
229
- if ( FCKConfig.EnterMode.IEquals( 'br' ) )
230
- {
231
- while ( movedNodes.length )
232
- {
233
- var node = movedNodes.shift() ;
234
- var firstTime = true ;
235
- if ( node.nodeName.IEquals( 'div' ) )
236
- {
237
- var docFrag = FCKTools.GetElementDocument( node ).createDocumentFragment() ;
238
- var needBeginBr = firstTime && node.previousSibling &&
239
- !FCKListsLib.BlockBoundaries[node.previousSibling.nodeName.toLowerCase()] ;
240
- if ( firstTime && needBeginBr )
241
- docFrag.appendChild( FCKTools.GetElementDocument( node ).createElement( 'br' ) ) ;
242
- var needEndBr = node.nextSibling &&
243
- !FCKListsLib.BlockBoundaries[node.nextSibling.nodeName.toLowerCase()] ;
244
- while ( node.firstChild )
245
- docFrag.appendChild( node.removeChild( node.firstChild ) ) ;
246
- if ( needEndBr )
247
- docFrag.appendChild( FCKTools.GetElementDocument( node ).createElement( 'br' ) ) ;
248
- node.parentNode.replaceChild( docFrag, node ) ;
249
- firstTime = false ;
250
- }
251
- }
252
- }
253
- }
254
- range.MoveToBookmark( bookmark ) ;
255
- range.Select() ;
256
-
257
- FCK.Focus() ;
258
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
259
- },
260
-
261
- GetState : function()
262
- {
263
- // Disabled if not WYSIWYG.
264
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || ! FCK.EditorWindow )
265
- return FCK_TRISTATE_DISABLED ;
266
-
267
- var path = new FCKElementPath( FCKSelection.GetBoundaryParentElement( true ) ) ;
268
- var firstBlock = path.Block || path.BlockLimit ;
269
-
270
- if ( !firstBlock || firstBlock.nodeName.toLowerCase() == 'body' )
271
- return FCK_TRISTATE_OFF ;
272
-
273
- // See if the first block has a blockquote parent.
274
- for ( var i = 0 ; i < path.Elements.length ; i++ )
275
- {
276
- if ( path.Elements[i].nodeName.IEquals( 'blockquote' ) )
277
- return FCK_TRISTATE_ON ;
278
- }
279
- return FCK_TRISTATE_OFF ;
280
- }
281
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckcorestylecommand.js DELETED
@@ -1,61 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKCoreStyleCommand Class: controls the execution of a core style. Core
22
- * styles are usually represented as buttons in the toolbar., like Bold and
23
- * Italic.
24
- */
25
-
26
- var FCKCoreStyleCommand = function( coreStyleName )
27
- {
28
- this.Name = 'CoreStyle' ;
29
- this.StyleName = '_FCK_' + coreStyleName ;
30
- this.IsActive = false ;
31
-
32
- FCKStyles.AttachStyleStateChange( this.StyleName, this._OnStyleStateChange, this ) ;
33
- }
34
-
35
- FCKCoreStyleCommand.prototype =
36
- {
37
- Execute : function()
38
- {
39
- FCKUndo.SaveUndoStep() ;
40
-
41
- if ( this.IsActive )
42
- FCKStyles.RemoveStyle( this.StyleName ) ;
43
- else
44
- FCKStyles.ApplyStyle( this.StyleName ) ;
45
-
46
- FCK.Focus() ;
47
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
48
- },
49
-
50
- GetState : function()
51
- {
52
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
53
- return FCK_TRISTATE_DISABLED ;
54
- return this.IsActive ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ;
55
- },
56
-
57
- _OnStyleStateChange : function( styleName, isActive )
58
- {
59
- this.IsActive = isActive ;
60
- }
61
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckfitwindow.js DELETED
@@ -1,213 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Stretch the editor to full window size and back.
22
- */
23
-
24
- var FCKFitWindow = function()
25
- {
26
- this.Name = 'FitWindow' ;
27
- }
28
-
29
- FCKFitWindow.prototype.Execute = function()
30
- {
31
- var eEditorFrame = window.frameElement ;
32
- var eEditorFrameStyle = eEditorFrame.style ;
33
-
34
- var eMainWindow = parent ;
35
- var eDocEl = eMainWindow.document.documentElement ;
36
- var eBody = eMainWindow.document.body ;
37
- var eBodyStyle = eBody.style ;
38
- var eParent ;
39
-
40
- // Save the current selection and scroll position.
41
- var oRange, oEditorScrollPos ;
42
- if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
43
- {
44
- oRange = new FCKDomRange( FCK.EditorWindow ) ;
45
- oRange.MoveToSelection() ;
46
- oEditorScrollPos = FCKTools.GetScrollPosition( FCK.EditorWindow ) ;
47
- }
48
- else
49
- {
50
- var eTextarea = FCK.EditingArea.Textarea ;
51
- oRange = !FCKBrowserInfo.IsIE && [ eTextarea.selectionStart, eTextarea.selectionEnd ] ;
52
- oEditorScrollPos = [ eTextarea.scrollLeft, eTextarea.scrollTop ] ;
53
- }
54
-
55
- // No original style properties known? Go fullscreen.
56
- if ( !this.IsMaximized )
57
- {
58
- // Registering an event handler when the window gets resized.
59
- if( FCKBrowserInfo.IsIE )
60
- eMainWindow.attachEvent( 'onresize', FCKFitWindow_Resize ) ;
61
- else
62
- eMainWindow.addEventListener( 'resize', FCKFitWindow_Resize, true ) ;
63
-
64
- // Save the scrollbars position.
65
- this._ScrollPos = FCKTools.GetScrollPosition( eMainWindow ) ;
66
-
67
- // Save and reset the styles for the entire node tree. They could interfere in the result.
68
- eParent = eEditorFrame ;
69
- // The extra () is to avoid a warning with strict error checking. This is ok.
70
- while( (eParent = eParent.parentNode) )
71
- {
72
- if ( eParent.nodeType == 1 )
73
- {
74
- eParent._fckSavedStyles = FCKTools.SaveStyles( eParent ) ;
75
- eParent.style.zIndex = FCKConfig.FloatingPanelsZIndex - 1 ;
76
- }
77
- }
78
-
79
- // Hide IE scrollbars (in strict mode).
80
- if ( FCKBrowserInfo.IsIE )
81
- {
82
- this.documentElementOverflow = eDocEl.style.overflow ;
83
- eDocEl.style.overflow = 'hidden' ;
84
- eBodyStyle.overflow = 'hidden' ;
85
- }
86
- else
87
- {
88
- // Hide the scroolbars in Firefox.
89
- eBodyStyle.overflow = 'hidden' ;
90
- eBodyStyle.width = '0px' ;
91
- eBodyStyle.height = '0px' ;
92
- }
93
-
94
- // Save the IFRAME styles.
95
- this._EditorFrameStyles = FCKTools.SaveStyles( eEditorFrame ) ;
96
-
97
- // Resize.
98
- var oViewPaneSize = FCKTools.GetViewPaneSize( eMainWindow ) ;
99
-
100
- eEditorFrameStyle.position = "absolute";
101
- eEditorFrame.offsetLeft ; // Kludge for Safari 3.1 browser bug, do not remove. See #2066.
102
- eEditorFrameStyle.zIndex = FCKConfig.FloatingPanelsZIndex - 1;
103
- eEditorFrameStyle.left = "0px";
104
- eEditorFrameStyle.top = "0px";
105
- eEditorFrameStyle.width = oViewPaneSize.Width + "px";
106
- eEditorFrameStyle.height = oViewPaneSize.Height + "px";
107
-
108
- // Giving the frame some (huge) borders on his right and bottom
109
- // side to hide the background that would otherwise show when the
110
- // editor is in fullsize mode and the window is increased in size
111
- // not for IE, because IE immediately adapts the editor on resize,
112
- // without showing any of the background oddly in firefox, the
113
- // editor seems not to fill the whole frame, so just setting the
114
- // background of it to white to cover the page laying behind it anyway.
115
- if ( !FCKBrowserInfo.IsIE )
116
- {
117
- eEditorFrameStyle.borderRight = eEditorFrameStyle.borderBottom = "9999px solid white" ;
118
- eEditorFrameStyle.backgroundColor = "white";
119
- }
120
-
121
- // Scroll to top left.
122
- eMainWindow.scrollTo(0, 0);
123
-
124
- // Is the editor still not on the top left? Let's find out and fix that as well. (Bug #174)
125
- var editorPos = FCKTools.GetWindowPosition( eMainWindow, eEditorFrame ) ;
126
- if ( editorPos.x != 0 )
127
- eEditorFrameStyle.left = ( -1 * editorPos.x ) + "px" ;
128
- if ( editorPos.y != 0 )
129
- eEditorFrameStyle.top = ( -1 * editorPos.y ) + "px" ;
130
-
131
- this.IsMaximized = true ;
132
- }
133
- else // Resize to original size.
134
- {
135
- // Remove the event handler of window resizing.
136
- if( FCKBrowserInfo.IsIE )
137
- eMainWindow.detachEvent( "onresize", FCKFitWindow_Resize ) ;
138
- else
139
- eMainWindow.removeEventListener( "resize", FCKFitWindow_Resize, true ) ;
140
-
141
- // Restore the CSS position for the entire node tree.
142
- eParent = eEditorFrame ;
143
- // The extra () is to avoid a warning with strict error checking. This is ok.
144
- while( (eParent = eParent.parentNode) )
145
- {
146
- if ( eParent._fckSavedStyles )
147
- {
148
- FCKTools.RestoreStyles( eParent, eParent._fckSavedStyles ) ;
149
- eParent._fckSavedStyles = null ;
150
- }
151
- }
152
-
153
- // Restore IE scrollbars
154
- if ( FCKBrowserInfo.IsIE )
155
- eDocEl.style.overflow = this.documentElementOverflow ;
156
-
157
- // Restore original size
158
- FCKTools.RestoreStyles( eEditorFrame, this._EditorFrameStyles ) ;
159
-
160
- // Restore the window scroll position.
161
- eMainWindow.scrollTo( this._ScrollPos.X, this._ScrollPos.Y ) ;
162
-
163
- this.IsMaximized = false ;
164
- }
165
-
166
- FCKToolbarItems.GetItem('FitWindow').RefreshState() ;
167
-
168
- // It seams that Firefox restarts the editing area when making this changes.
169
- // On FF 1.0.x, the area is not anymore editable. On FF 1.5+, the special
170
- //configuration, like DisableFFTableHandles and DisableObjectResizing get
171
- //lost, so we must reset it. Also, the cursor position and selection are
172
- //also lost, even if you comment the following line (MakeEditable).
173
- // if ( FCKBrowserInfo.IsGecko10 ) // Initially I thought it was a FF 1.0 only problem.
174
- if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
175
- FCK.EditingArea.MakeEditable() ;
176
-
177
- FCK.Focus() ;
178
-
179
- // Restore the selection and scroll position of inside the document.
180
- if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
181
- {
182
- oRange.Select() ;
183
- FCK.EditorWindow.scrollTo( oEditorScrollPos.X, oEditorScrollPos.Y ) ;
184
- }
185
- else
186
- {
187
- if ( !FCKBrowserInfo.IsIE )
188
- {
189
- eTextarea.selectionStart = oRange[0] ;
190
- eTextarea.selectionEnd = oRange[1] ;
191
- }
192
- eTextarea.scrollLeft = oEditorScrollPos[0] ;
193
- eTextarea.scrollTop = oEditorScrollPos[1] ;
194
- }
195
- }
196
-
197
- FCKFitWindow.prototype.GetState = function()
198
- {
199
- if ( FCKConfig.ToolbarLocation != 'In' )
200
- return FCK_TRISTATE_DISABLED ;
201
- else
202
- return ( this.IsMaximized ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF );
203
- }
204
-
205
- function FCKFitWindow_Resize()
206
- {
207
- var oViewPaneSize = FCKTools.GetViewPaneSize( parent ) ;
208
-
209
- var eEditorFrameStyle = window.frameElement.style ;
210
-
211
- eEditorFrameStyle.width = oViewPaneSize.Width + 'px' ;
212
- eEditorFrameStyle.height = oViewPaneSize.Height + 'px' ;
213
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckindentcommands.js DELETED
@@ -1,282 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKIndentCommand Class: controls block indentation.
22
- */
23
-
24
- var FCKIndentCommand = function( name, offset )
25
- {
26
- this.Name = name ;
27
- this.Offset = offset ;
28
- this.IndentCSSProperty = FCKConfig.ContentLangDirection.IEquals( 'ltr' ) ? 'marginLeft' : 'marginRight' ;
29
- }
30
-
31
- FCKIndentCommand._InitIndentModeParameters = function()
32
- {
33
- if ( FCKConfig.IndentClasses && FCKConfig.IndentClasses.length > 0 )
34
- {
35
- this._UseIndentClasses = true ;
36
- this._IndentClassMap = {} ;
37
- for ( var i = 0 ; i < FCKConfig.IndentClasses.length ;i++ )
38
- this._IndentClassMap[FCKConfig.IndentClasses[i]] = i + 1 ;
39
- this._ClassNameRegex = new RegExp( '(?:^|\\s+)(' + FCKConfig.IndentClasses.join( '|' ) + ')(?=$|\\s)' ) ;
40
- }
41
- else
42
- this._UseIndentClasses = false ;
43
- }
44
-
45
-
46
- FCKIndentCommand.prototype =
47
- {
48
- Execute : function()
49
- {
50
- // Save an undo snapshot before doing anything.
51
- FCKUndo.SaveUndoStep() ;
52
-
53
- var range = new FCKDomRange( FCK.EditorWindow ) ;
54
- range.MoveToSelection() ;
55
- var bookmark = range.CreateBookmark() ;
56
-
57
- // Two cases to handle here: either we're in a list, or not.
58
- // If we're in a list, then the indent/outdent operations would be done on the list nodes.
59
- // Otherwise, apply the operation on the nearest block nodes.
60
- var nearestListBlock = FCKDomTools.GetCommonParentNode( range.StartNode || range.StartContainer ,
61
- range.EndNode || range.EndContainer,
62
- ['ul', 'ol'] ) ;
63
- if ( nearestListBlock )
64
- this._IndentList( range, nearestListBlock ) ;
65
- else
66
- this._IndentBlock( range ) ;
67
-
68
- range.MoveToBookmark( bookmark ) ;
69
- range.Select() ;
70
-
71
- FCK.Focus() ;
72
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
73
- },
74
-
75
- GetState : function()
76
- {
77
- // Disabled if not WYSIWYG.
78
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || ! FCK.EditorWindow )
79
- return FCK_TRISTATE_DISABLED ;
80
-
81
- // Initialize parameters if not already initialzed.
82
- if ( FCKIndentCommand._UseIndentClasses == undefined )
83
- FCKIndentCommand._InitIndentModeParameters() ;
84
-
85
- // If we're not in a list, and the starting block's indentation is zero, and the current
86
- // command is the outdent command, then we should return FCK_TRISTATE_DISABLED.
87
- var startContainer = FCKSelection.GetBoundaryParentElement( true ) ;
88
- var endContainer = FCKSelection.GetBoundaryParentElement( false ) ;
89
- var listNode = FCKDomTools.GetCommonParentNode( startContainer, endContainer, ['ul','ol'] ) ;
90
-
91
- if ( listNode )
92
- {
93
- if ( this.Name.IEquals( 'outdent' ) )
94
- return FCK_TRISTATE_OFF ;
95
- var firstItem = FCKTools.GetElementAscensor( startContainer, 'li' ) ;
96
- if ( !firstItem || !firstItem.previousSibling )
97
- return FCK_TRISTATE_DISABLED ;
98
- return FCK_TRISTATE_OFF ;
99
- }
100
- if ( ! FCKIndentCommand._UseIndentClasses && this.Name.IEquals( 'indent' ) )
101
- return FCK_TRISTATE_OFF;
102
-
103
- var path = new FCKElementPath( startContainer ) ;
104
- var firstBlock = path.Block || path.BlockLimit ;
105
- if ( !firstBlock )
106
- return FCK_TRISTATE_DISABLED ;
107
-
108
- if ( FCKIndentCommand._UseIndentClasses )
109
- {
110
- var indentClass = firstBlock.className.match( FCKIndentCommand._ClassNameRegex ) ;
111
- var indentStep = 0 ;
112
- if ( indentClass != null )
113
- {
114
- indentClass = indentClass[1] ;
115
- indentStep = FCKIndentCommand._IndentClassMap[indentClass] ;
116
- }
117
- if ( ( this.Name == 'outdent' && indentStep == 0 ) ||
118
- ( this.Name == 'indent' && indentStep == FCKConfig.IndentClasses.length ) )
119
- return FCK_TRISTATE_DISABLED ;
120
- return FCK_TRISTATE_OFF ;
121
- }
122
- else
123
- {
124
- var indent = parseInt( firstBlock.style[this.IndentCSSProperty], 10 ) ;
125
- if ( isNaN( indent ) )
126
- indent = 0 ;
127
- if ( indent <= 0 )
128
- return FCK_TRISTATE_DISABLED ;
129
- return FCK_TRISTATE_OFF ;
130
- }
131
- },
132
-
133
- _IndentBlock : function( range )
134
- {
135
- var iterator = new FCKDomRangeIterator( range ) ;
136
- iterator.EnforceRealBlocks = true ;
137
-
138
- range.Expand( 'block_contents' ) ;
139
- var commonParents = FCKDomTools.GetCommonParents( range.StartContainer, range.EndContainer ) ;
140
- var nearestParent = commonParents[commonParents.length - 1] ;
141
- var block ;
142
-
143
- while ( ( block = iterator.GetNextParagraph() ) )
144
- {
145
- // We don't want to indent subtrees recursively, so only perform the indent operation
146
- // if the block itself is the nearestParent, or the block's parent is the nearestParent.
147
- if ( ! ( block == nearestParent || block.parentNode == nearestParent ) )
148
- continue ;
149
-
150
- if ( FCKIndentCommand._UseIndentClasses )
151
- {
152
- // Transform current class name to indent step index.
153
- var indentClass = block.className.match( FCKIndentCommand._ClassNameRegex ) ;
154
- var indentStep = 0 ;
155
- if ( indentClass != null )
156
- {
157
- indentClass = indentClass[1] ;
158
- indentStep = FCKIndentCommand._IndentClassMap[indentClass] ;
159
- }
160
-
161
- // Operate on indent step index, transform indent step index back to class name.
162
- if ( this.Name.IEquals( 'outdent' ) )
163
- indentStep-- ;
164
- else if ( this.Name.IEquals( 'indent' ) )
165
- indentStep++ ;
166
- indentStep = Math.min( indentStep, FCKConfig.IndentClasses.length ) ;
167
- indentStep = Math.max( indentStep, 0 ) ;
168
- var className = block.className.replace( FCKIndentCommand._ClassNameRegex, '' ) ;
169
- if ( indentStep < 1 )
170
- block.className = className ;
171
- else
172
- block.className = ( className.length > 0 ? className + ' ' : '' ) +
173
- FCKConfig.IndentClasses[indentStep - 1] ;
174
- }
175
- else
176
- {
177
- // Offset distance is assumed to be in pixels for now.
178
- var currentOffset = parseInt( block.style[this.IndentCSSProperty], 10 ) ;
179
- if ( isNaN( currentOffset ) )
180
- currentOffset = 0 ;
181
- currentOffset += this.Offset ;
182
- currentOffset = Math.max( currentOffset, 0 ) ;
183
- currentOffset = Math.ceil( currentOffset / this.Offset ) * this.Offset ;
184
- block.style[this.IndentCSSProperty] = currentOffset ? currentOffset + FCKConfig.IndentUnit : '' ;
185
- if ( block.getAttribute( 'style' ) == '' )
186
- block.removeAttribute( 'style' ) ;
187
- }
188
- }
189
- },
190
-
191
- _IndentList : function( range, listNode )
192
- {
193
- // Our starting and ending points of the range might be inside some blocks under a list item...
194
- // So before playing with the iterator, we need to expand the block to include the list items.
195
- var startContainer = range.StartContainer ;
196
- var endContainer = range.EndContainer ;
197
- while ( startContainer && startContainer.parentNode != listNode )
198
- startContainer = startContainer.parentNode ;
199
- while ( endContainer && endContainer.parentNode != listNode )
200
- endContainer = endContainer.parentNode ;
201
-
202
- if ( ! startContainer || ! endContainer )
203
- return ;
204
-
205
- // Now we can iterate over the individual items on the same tree depth.
206
- var block = startContainer ;
207
- var itemsToMove = [] ;
208
- var stopFlag = false ;
209
- while ( stopFlag == false )
210
- {
211
- if ( block == endContainer )
212
- stopFlag = true ;
213
- itemsToMove.push( block ) ;
214
- block = block.nextSibling ;
215
- }
216
- if ( itemsToMove.length < 1 )
217
- return ;
218
-
219
- // Do indent or outdent operations on the array model of the list, not the list's DOM tree itself.
220
- // The array model demands that it knows as much as possible about the surrounding lists, we need
221
- // to feed it the further ancestor node that is still a list.
222
- var listParents = FCKDomTools.GetParents( listNode ) ;
223
- for ( var i = 0 ; i < listParents.length ; i++ )
224
- {
225
- if ( listParents[i].nodeName.IEquals( ['ul', 'ol'] ) )
226
- {
227
- listNode = listParents[i] ;
228
- break ;
229
- }
230
- }
231
- var indentOffset = this.Name.IEquals( 'indent' ) ? 1 : -1 ;
232
- var startItem = itemsToMove[0] ;
233
- var lastItem = itemsToMove[ itemsToMove.length - 1 ] ;
234
- var markerObj = {} ;
235
-
236
- // Convert the list DOM tree into a one dimensional array.
237
- var listArray = FCKDomTools.ListToArray( listNode, markerObj ) ;
238
-
239
- // Apply indenting or outdenting on the array.
240
- var baseIndent = listArray[lastItem._FCK_ListArray_Index].indent ;
241
- for ( var i = startItem._FCK_ListArray_Index ; i <= lastItem._FCK_ListArray_Index ; i++ )
242
- listArray[i].indent += indentOffset ;
243
- for ( var i = lastItem._FCK_ListArray_Index + 1 ; i < listArray.length && listArray[i].indent > baseIndent ; i++ )
244
- listArray[i].indent += indentOffset ;
245
-
246
- /* For debug use only
247
- var PrintArray = function( listArray, doc )
248
- {
249
- var s = [] ;
250
- for ( var i = 0 ; i < listArray.length ; i++ )
251
- {
252
- for ( var j in listArray[i] )
253
- {
254
- if ( j != 'contents' )
255
- s.push( j + ":" + listArray[i][j] + "; " ) ;
256
- else
257
- {
258
- var docFrag = doc.createDocumentFragment() ;
259
- var tmpNode = doc.createElement( 'span' ) ;
260
- for ( var k = 0 ; k < listArray[i][j].length ; k++ )
261
- docFrag.appendChild( listArray[i][j][k].cloneNode( true ) ) ;
262
- tmpNode.appendChild( docFrag ) ;
263
- s.push( j + ":" + tmpNode.innerHTML + "; ") ;
264
- }
265
- }
266
- s.push( '\n' ) ;
267
- }
268
- alert( s.join('') ) ;
269
- }
270
- PrintArray( listArray, FCK.EditorDocument ) ;
271
- */
272
-
273
- // Convert the array back to a DOM forest (yes we might have a few subtrees now).
274
- // And replace the old list with the new forest.
275
- var newList = FCKDomTools.ArrayToList( listArray ) ;
276
- if ( newList )
277
- listNode.parentNode.replaceChild( newList.listNode, listNode ) ;
278
-
279
- // Clean up the markers.
280
- FCKDomTools.ClearAllMarkers( markerObj ) ;
281
- }
282
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckjustifycommands.js DELETED
@@ -1,173 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKJustifyCommand Class: controls block justification.
22
- */
23
-
24
- var FCKJustifyCommand = function( alignValue )
25
- {
26
- this.AlignValue = alignValue ;
27
-
28
- // Detect whether this is the instance for the default alignment.
29
- var contentDir = FCKConfig.ContentLangDirection.toLowerCase() ;
30
- this.IsDefaultAlign = ( alignValue == 'left' && contentDir == 'ltr' ) ||
31
- ( alignValue == 'right' && contentDir == 'rtl' ) ;
32
-
33
- // Get the class name to be used by this instance.
34
- var cssClassName = this._CssClassName = ( function()
35
- {
36
- var classes = FCKConfig.JustifyClasses ;
37
- if ( classes )
38
- {
39
- switch ( alignValue )
40
- {
41
- case 'left' :
42
- return classes[0] || null ;
43
- case 'center' :
44
- return classes[1] || null ;
45
- case 'right' :
46
- return classes[2] || null ;
47
- case 'justify' :
48
- return classes[3] || null ;
49
- }
50
- }
51
- return null ;
52
- } )() ;
53
-
54
- if ( cssClassName && cssClassName.length > 0 )
55
- this._CssClassRegex = new RegExp( '(?:^|\\s+)' + cssClassName + '(?=$|\\s)' ) ;
56
- }
57
-
58
- FCKJustifyCommand._GetClassNameRegex = function()
59
- {
60
- var regex = FCKJustifyCommand._ClassRegex ;
61
- if ( regex != undefined )
62
- return regex ;
63
-
64
- var names = [] ;
65
-
66
- var classes = FCKConfig.JustifyClasses ;
67
- if ( classes )
68
- {
69
- for ( var i = 0 ; i < 4 ; i++ )
70
- {
71
- var className = classes[i] ;
72
- if ( className && className.length > 0 )
73
- names.push( className ) ;
74
- }
75
- }
76
-
77
- if ( names.length > 0 )
78
- regex = new RegExp( '(?:^|\\s+)(?:' + names.join( '|' ) + ')(?=$|\\s)' ) ;
79
- else
80
- regex = null ;
81
-
82
- return FCKJustifyCommand._ClassRegex = regex ;
83
- }
84
-
85
- FCKJustifyCommand.prototype =
86
- {
87
- Execute : function()
88
- {
89
- // Save an undo snapshot before doing anything.
90
- FCKUndo.SaveUndoStep() ;
91
-
92
- var range = new FCKDomRange( FCK.EditorWindow ) ;
93
- range.MoveToSelection() ;
94
-
95
- var currentState = this.GetState() ;
96
- if ( currentState == FCK_TRISTATE_DISABLED )
97
- return ;
98
-
99
- // Store a bookmark of the selection since the paragraph iterator might
100
- // change the DOM tree and break selections.
101
- var bookmark = range.CreateBookmark() ;
102
-
103
- var cssClassName = this._CssClassName ;
104
-
105
- // Apply alignment setting for each paragraph.
106
- var iterator = new FCKDomRangeIterator( range ) ;
107
- var block ;
108
- while ( ( block = iterator.GetNextParagraph() ) )
109
- {
110
- block.removeAttribute( 'align' ) ;
111
-
112
- if ( cssClassName )
113
- {
114
- // Remove the any of the alignment classes from the className.
115
- var className = block.className.replace( FCKJustifyCommand._GetClassNameRegex(), '' ) ;
116
-
117
- // Append the desired class name.
118
- if ( currentState == FCK_TRISTATE_OFF )
119
- {
120
- if ( className.length > 0 )
121
- className += ' ' ;
122
- block.className = className + cssClassName ;
123
- }
124
- else if ( className.length == 0 )
125
- FCKDomTools.RemoveAttribute( block, 'class' ) ;
126
- }
127
- else
128
- {
129
- var style = block.style ;
130
- if ( currentState == FCK_TRISTATE_OFF )
131
- style.textAlign = this.AlignValue ;
132
- else
133
- {
134
- style.textAlign = '' ;
135
- if ( style.cssText.length == 0 )
136
- block.removeAttribute( 'style' ) ;
137
- }
138
- }
139
- }
140
-
141
- // Restore previous selection.
142
- range.MoveToBookmark( bookmark ) ;
143
- range.Select() ;
144
-
145
- FCK.Focus() ;
146
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
147
- },
148
-
149
- GetState : function()
150
- {
151
- // Disabled if not WYSIWYG.
152
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || ! FCK.EditorWindow )
153
- return FCK_TRISTATE_DISABLED ;
154
-
155
- // Retrieve the first selected block.
156
- var path = new FCKElementPath( FCKSelection.GetBoundaryParentElement( true ) ) ;
157
- var firstBlock = path.Block || path.BlockLimit ;
158
-
159
- if ( !firstBlock || firstBlock.nodeName.toLowerCase() == 'body' )
160
- return FCK_TRISTATE_OFF ;
161
-
162
- // Check if the desired style is already applied to the block.
163
- var currentAlign ;
164
- if ( FCKBrowserInfo.IsIE )
165
- currentAlign = firstBlock.currentStyle.textAlign ;
166
- else
167
- currentAlign = FCK.EditorWindow.getComputedStyle( firstBlock, '' ).getPropertyValue( 'text-align' );
168
- currentAlign = currentAlign.replace( /(-moz-|-webkit-|start|auto)/i, '' );
169
- if ( ( !currentAlign && this.IsDefaultAlign ) || currentAlign == this.AlignValue )
170
- return FCK_TRISTATE_ON ;
171
- return FCK_TRISTATE_OFF ;
172
- }
173
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fcklistcommands.js DELETED
@@ -1,382 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Implementation for the "Insert/Remove Ordered/Unordered List" commands.
22
- */
23
-
24
- var FCKListCommand = function( name, tagName )
25
- {
26
- this.Name = name ;
27
- this.TagName = tagName ;
28
- }
29
-
30
- FCKListCommand.prototype =
31
- {
32
- GetState : function()
33
- {
34
- // Disabled if not WYSIWYG.
35
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || ! FCK.EditorWindow )
36
- return FCK_TRISTATE_DISABLED ;
37
-
38
- // We'll use the style system's convention to determine list state here...
39
- // If the starting block is a descendant of an <ol> or <ul> node, then we're in a list.
40
- var startContainer = FCKSelection.GetBoundaryParentElement( true ) ;
41
- var listNode = startContainer ;
42
- while ( listNode )
43
- {
44
- if ( listNode.nodeName.IEquals( [ 'ul', 'ol' ] ) )
45
- break ;
46
- listNode = listNode.parentNode ;
47
- }
48
- if ( listNode && listNode.nodeName.IEquals( this.TagName ) )
49
- return FCK_TRISTATE_ON ;
50
- else
51
- return FCK_TRISTATE_OFF ;
52
- },
53
-
54
- Execute : function()
55
- {
56
- FCKUndo.SaveUndoStep() ;
57
-
58
- var doc = FCK.EditorDocument ;
59
- var range = new FCKDomRange( FCK.EditorWindow ) ;
60
- range.MoveToSelection() ;
61
- var state = this.GetState() ;
62
-
63
- // Midas lists rule #1 says we can create a list even in an empty document.
64
- // But FCKDomRangeIterator wouldn't run if the document is really empty.
65
- // So create a paragraph if the document is empty and we're going to create a list.
66
- if ( state == FCK_TRISTATE_OFF )
67
- {
68
- FCKDomTools.TrimNode( doc.body ) ;
69
- if ( ! doc.body.firstChild )
70
- {
71
- var paragraph = doc.createElement( 'p' ) ;
72
- doc.body.appendChild( paragraph ) ;
73
- range.MoveToNodeContents( paragraph ) ;
74
- }
75
- }
76
-
77
- var bookmark = range.CreateBookmark() ;
78
-
79
- // Group the blocks up because there are many cases where multiple lists have to be created,
80
- // or multiple lists have to be cancelled.
81
- var listGroups = [] ;
82
- var markerObj = {} ;
83
- var iterator = new FCKDomRangeIterator( range ) ;
84
- var block ;
85
-
86
- iterator.ForceBrBreak = ( state == FCK_TRISTATE_OFF ) ;
87
- var nextRangeExists = true ;
88
- var rangeQueue = null ;
89
- while ( nextRangeExists )
90
- {
91
- while ( ( block = iterator.GetNextParagraph() ) )
92
- {
93
- var path = new FCKElementPath( block ) ;
94
- var listNode = null ;
95
- var processedFlag = false ;
96
- var blockLimit = path.BlockLimit ;
97
-
98
- // First, try to group by a list ancestor.
99
- for ( var i = path.Elements.length - 1 ; i >= 0 ; i-- )
100
- {
101
- var el = path.Elements[i] ;
102
- if ( el.nodeName.IEquals( ['ol', 'ul'] ) )
103
- {
104
- // If we've encountered a list inside a block limit
105
- // The last group object of the block limit element should
106
- // no longer be valid. Since paragraphs after the list
107
- // should belong to a different group of paragraphs before
108
- // the list. (Bug #1309)
109
- if ( blockLimit._FCK_ListGroupObject )
110
- blockLimit._FCK_ListGroupObject = null ;
111
-
112
- var groupObj = el._FCK_ListGroupObject ;
113
- if ( groupObj )
114
- groupObj.contents.push( block ) ;
115
- else
116
- {
117
- groupObj = { 'root' : el, 'contents' : [ block ] } ;
118
- listGroups.push( groupObj ) ;
119
- FCKDomTools.SetElementMarker( markerObj, el, '_FCK_ListGroupObject', groupObj ) ;
120
- }
121
- processedFlag = true ;
122
- break ;
123
- }
124
- }
125
-
126
- if ( processedFlag )
127
- continue ;
128
-
129
- // No list ancestor? Group by block limit.
130
- var root = blockLimit ;
131
- if ( root._FCK_ListGroupObject )
132
- root._FCK_ListGroupObject.contents.push( block ) ;
133
- else
134
- {
135
- var groupObj = { 'root' : root, 'contents' : [ block ] } ;
136
- FCKDomTools.SetElementMarker( markerObj, root, '_FCK_ListGroupObject', groupObj ) ;
137
- listGroups.push( groupObj ) ;
138
- }
139
- }
140
-
141
- if ( FCKBrowserInfo.IsIE )
142
- nextRangeExists = false ;
143
- else
144
- {
145
- if ( rangeQueue == null )
146
- {
147
- rangeQueue = [] ;
148
- var selectionObject = FCKSelection.GetSelection() ;
149
- if ( selectionObject && listGroups.length == 0 )
150
- rangeQueue.push( selectionObject.getRangeAt( 0 ) ) ;
151
- for ( var i = 1 ; selectionObject && i < selectionObject.rangeCount ; i++ )
152
- rangeQueue.push( selectionObject.getRangeAt( i ) ) ;
153
- }
154
- if ( rangeQueue.length < 1 )
155
- nextRangeExists = false ;
156
- else
157
- {
158
- var internalRange = FCKW3CRange.CreateFromRange( doc, rangeQueue.shift() ) ;
159
- range._Range = internalRange ;
160
- range._UpdateElementInfo() ;
161
- if ( range.StartNode.nodeName.IEquals( 'td' ) )
162
- range.SetStart( range.StartNode, 1 ) ;
163
- if ( range.EndNode.nodeName.IEquals( 'td' ) )
164
- range.SetEnd( range.EndNode, 2 ) ;
165
- iterator = new FCKDomRangeIterator( range ) ;
166
- iterator.ForceBrBreak = ( state == FCK_TRISTATE_OFF ) ;
167
- }
168
- }
169
- }
170
-
171
- // Now we have two kinds of list groups, groups rooted at a list, and groups rooted at a block limit element.
172
- // We either have to build lists or remove lists, for removing a list does not makes sense when we are looking
173
- // at the group that's not rooted at lists. So we have three cases to handle.
174
- var listsCreated = [] ;
175
- while ( listGroups.length > 0 )
176
- {
177
- var groupObj = listGroups.shift() ;
178
- if ( state == FCK_TRISTATE_OFF )
179
- {
180
- if ( groupObj.root.nodeName.IEquals( ['ul', 'ol'] ) )
181
- this._ChangeListType( groupObj, markerObj, listsCreated ) ;
182
- else
183
- this._CreateList( groupObj, listsCreated ) ;
184
- }
185
- else if ( state == FCK_TRISTATE_ON && groupObj.root.nodeName.IEquals( ['ul', 'ol'] ) )
186
- this._RemoveList( groupObj, markerObj ) ;
187
- }
188
-
189
- // For all new lists created, merge adjacent, same type lists.
190
- for ( var i = 0 ; i < listsCreated.length ; i++ )
191
- {
192
- var listNode = listsCreated[i] ;
193
- var stopFlag = false ;
194
- var currentNode = listNode ;
195
- while ( ! stopFlag )
196
- {
197
- currentNode = currentNode.nextSibling ;
198
- if ( currentNode && currentNode.nodeType == 3 && currentNode.nodeValue.search( /^[\n\r\t ]*$/ ) == 0 )
199
- continue ;
200
- stopFlag = true ;
201
- }
202
-
203
- if ( currentNode && currentNode.nodeName.IEquals( this.TagName ) )
204
- {
205
- currentNode.parentNode.removeChild( currentNode ) ;
206
- while ( currentNode.firstChild )
207
- listNode.appendChild( currentNode.removeChild( currentNode.firstChild ) ) ;
208
- }
209
-
210
- stopFlag = false ;
211
- currentNode = listNode ;
212
- while ( ! stopFlag )
213
- {
214
- currentNode = currentNode.previousSibling ;
215
- if ( currentNode && currentNode.nodeType == 3 && currentNode.nodeValue.search( /^[\n\r\t ]*$/ ) == 0 )
216
- continue ;
217
- stopFlag = true ;
218
- }
219
- if ( currentNode && currentNode.nodeName.IEquals( this.TagName ) )
220
- {
221
- currentNode.parentNode.removeChild( currentNode ) ;
222
- while ( currentNode.lastChild )
223
- listNode.insertBefore( currentNode.removeChild( currentNode.lastChild ),
224
- listNode.firstChild ) ;
225
- }
226
- }
227
-
228
- // Clean up, restore selection and update toolbar button states.
229
- FCKDomTools.ClearAllMarkers( markerObj ) ;
230
- range.MoveToBookmark( bookmark ) ;
231
- range.Select() ;
232
-
233
- FCK.Focus() ;
234
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
235
- },
236
-
237
- _ChangeListType : function( groupObj, markerObj, listsCreated )
238
- {
239
- // This case is easy...
240
- // 1. Convert the whole list into a one-dimensional array.
241
- // 2. Change the list type by modifying the array.
242
- // 3. Recreate the whole list by converting the array to a list.
243
- // 4. Replace the original list with the recreated list.
244
- var listArray = FCKDomTools.ListToArray( groupObj.root, markerObj ) ;
245
- var selectedListItems = [] ;
246
- for ( var i = 0 ; i < groupObj.contents.length ; i++ )
247
- {
248
- var itemNode = groupObj.contents[i] ;
249
- itemNode = FCKTools.GetElementAscensor( itemNode, 'li' ) ;
250
- if ( ! itemNode || itemNode._FCK_ListItem_Processed )
251
- continue ;
252
- selectedListItems.push( itemNode ) ;
253
- FCKDomTools.SetElementMarker( markerObj, itemNode, '_FCK_ListItem_Processed', true ) ;
254
- }
255
- var fakeParent = FCKTools.GetElementDocument( groupObj.root ).createElement( this.TagName ) ;
256
- for ( var i = 0 ; i < selectedListItems.length ; i++ )
257
- {
258
- var listIndex = selectedListItems[i]._FCK_ListArray_Index ;
259
- listArray[listIndex].parent = fakeParent ;
260
- }
261
- var newList = FCKDomTools.ArrayToList( listArray, markerObj ) ;
262
- for ( var i = 0 ; i < newList.listNode.childNodes.length ; i++ )
263
- {
264
- if ( newList.listNode.childNodes[i].nodeName.IEquals( this.TagName ) )
265
- listsCreated.push( newList.listNode.childNodes[i] ) ;
266
- }
267
- groupObj.root.parentNode.replaceChild( newList.listNode, groupObj.root ) ;
268
- },
269
-
270
- _CreateList : function( groupObj, listsCreated )
271
- {
272
- var contents = groupObj.contents ;
273
- var doc = FCKTools.GetElementDocument( groupObj.root ) ;
274
- var listContents = [] ;
275
-
276
- // It is possible to have the contents returned by DomRangeIterator to be the same as the root.
277
- // e.g. when we're running into table cells.
278
- // In such a case, enclose the childNodes of contents[0] into a <div>.
279
- if ( contents.length == 1 && contents[0] == groupObj.root )
280
- {
281
- var divBlock = doc.createElement( 'div' );
282
- while ( contents[0].firstChild )
283
- divBlock.appendChild( contents[0].removeChild( contents[0].firstChild ) ) ;
284
- contents[0].appendChild( divBlock ) ;
285
- contents[0] = divBlock ;
286
- }
287
-
288
- // Calculate the common parent node of all content blocks.
289
- var commonParent = groupObj.contents[0].parentNode ;
290
- for ( var i = 0 ; i < contents.length ; i++ )
291
- commonParent = FCKDomTools.GetCommonParents( commonParent, contents[i].parentNode ).pop() ;
292
-
293
- // We want to insert things that are in the same tree level only, so calculate the contents again
294
- // by expanding the selected blocks to the same tree level.
295
- for ( var i = 0 ; i < contents.length ; i++ )
296
- {
297
- var contentNode = contents[i] ;
298
- while ( contentNode.parentNode )
299
- {
300
- if ( contentNode.parentNode == commonParent )
301
- {
302
- listContents.push( contentNode ) ;
303
- break ;
304
- }
305
- contentNode = contentNode.parentNode ;
306
- }
307
- }
308
-
309
- if ( listContents.length < 1 )
310
- return ;
311
-
312
- // Insert the list to the DOM tree.
313
- var insertAnchor = listContents[listContents.length - 1].nextSibling ;
314
- var listNode = doc.createElement( this.TagName ) ;
315
- listsCreated.push( listNode ) ;
316
- while ( listContents.length )
317
- {
318
- var contentBlock = listContents.shift() ;
319
- var docFrag = doc.createDocumentFragment() ;
320
- while ( contentBlock.firstChild )
321
- docFrag.appendChild( contentBlock.removeChild( contentBlock.firstChild ) ) ;
322
- contentBlock.parentNode.removeChild( contentBlock ) ;
323
- var listItem = doc.createElement( 'li' ) ;
324
- listItem.appendChild( docFrag ) ;
325
- listNode.appendChild( listItem ) ;
326
- }
327
- commonParent.insertBefore( listNode, insertAnchor ) ;
328
- },
329
-
330
- _RemoveList : function( groupObj, markerObj )
331
- {
332
- // This is very much like the change list type operation.
333
- // Except that we're changing the selected items' indent to -1 in the list array.
334
- var listArray = FCKDomTools.ListToArray( groupObj.root, markerObj ) ;
335
- var selectedListItems = [] ;
336
- for ( var i = 0 ; i < groupObj.contents.length ; i++ )
337
- {
338
- var itemNode = groupObj.contents[i] ;
339
- itemNode = FCKTools.GetElementAscensor( itemNode, 'li' ) ;
340
- if ( ! itemNode || itemNode._FCK_ListItem_Processed )
341
- continue ;
342
- selectedListItems.push( itemNode ) ;
343
- FCKDomTools.SetElementMarker( markerObj, itemNode, '_FCK_ListItem_Processed', true ) ;
344
- }
345
-
346
- var lastListIndex = null ;
347
- for ( var i = 0 ; i < selectedListItems.length ; i++ )
348
- {
349
- var listIndex = selectedListItems[i]._FCK_ListArray_Index ;
350
- listArray[listIndex].indent = -1 ;
351
- lastListIndex = listIndex ;
352
- }
353
-
354
- // After cutting parts of the list out with indent=-1, we still have to maintain the array list
355
- // model's nextItem.indent <= currentItem.indent + 1 invariant. Otherwise the array model of the
356
- // list cannot be converted back to a real DOM list.
357
- for ( var i = lastListIndex + 1; i < listArray.length ; i++ )
358
- {
359
- if ( listArray[i].indent > listArray[i-1].indent + 1 )
360
- {
361
- var indentOffset = listArray[i-1].indent + 1 - listArray[i].indent ;
362
- var oldIndent = listArray[i].indent ;
363
- while ( listArray[i] && listArray[i].indent >= oldIndent)
364
- {
365
- listArray[i].indent += indentOffset ;
366
- i++ ;
367
- }
368
- i-- ;
369
- }
370
- }
371
-
372
- var newList = FCKDomTools.ArrayToList( listArray, markerObj ) ;
373
- // If groupObj.root is the last element in its parent, or its nextSibling is a <br>, then we should
374
- // not add a <br> after the final item. So, check for the cases and trim the <br>.
375
- if ( groupObj.root.nextSibling == null || groupObj.root.nextSibling.nodeName.IEquals( 'br' ) )
376
- {
377
- if ( newList.listNode.lastChild.nodeName.IEquals( 'br' ) )
378
- newList.listNode.removeChild( newList.listNode.lastChild ) ;
379
- }
380
- groupObj.root.parentNode.replaceChild( newList.listNode, groupObj.root ) ;
381
- }
382
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fcknamedcommand.js DELETED
@@ -1,39 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKNamedCommand Class: represents an internal browser command.
22
- */
23
-
24
- var FCKNamedCommand = function( commandName )
25
- {
26
- this.Name = commandName ;
27
- }
28
-
29
- FCKNamedCommand.prototype.Execute = function()
30
- {
31
- FCK.ExecuteNamedCommand( this.Name ) ;
32
- }
33
-
34
- FCKNamedCommand.prototype.GetState = function()
35
- {
36
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
37
- return FCK_TRISTATE_DISABLED ;
38
- return FCK.GetNamedCommandState( this.Name ) ;
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckpasteplaintextcommand.js DELETED
@@ -1,40 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKPastePlainTextCommand Class: represents the
22
- * "Paste as Plain Text" command.
23
- */
24
-
25
- var FCKPastePlainTextCommand = function()
26
- {
27
- this.Name = 'PasteText' ;
28
- }
29
-
30
- FCKPastePlainTextCommand.prototype.Execute = function()
31
- {
32
- FCK.PasteAsPlainText() ;
33
- }
34
-
35
- FCKPastePlainTextCommand.prototype.GetState = function()
36
- {
37
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
38
- return FCK_TRISTATE_DISABLED ;
39
- return FCK.GetNamedCommandState( 'Paste' ) ;
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckpastewordcommand.js DELETED
@@ -1,40 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKPasteWordCommand Class: represents the "Paste from Word" command.
22
- */
23
-
24
- var FCKPasteWordCommand = function()
25
- {
26
- this.Name = 'PasteWord' ;
27
- }
28
-
29
- FCKPasteWordCommand.prototype.Execute = function()
30
- {
31
- FCK.PasteFromWord() ;
32
- }
33
-
34
- FCKPasteWordCommand.prototype.GetState = function()
35
- {
36
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || FCKConfig.ForcePasteAsPlainText )
37
- return FCK_TRISTATE_DISABLED ;
38
- else
39
- return FCK.GetNamedCommandState( 'Paste' ) ;
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckremoveformatcommand.js DELETED
@@ -1,45 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKRemoveFormatCommand Class: controls the execution of a core style. Core
22
- * styles are usually represented as buttons in the toolbar., like Bold and
23
- * Italic.
24
- */
25
-
26
- var FCKRemoveFormatCommand = function()
27
- {
28
- this.Name = 'RemoveFormat' ;
29
- }
30
-
31
- FCKRemoveFormatCommand.prototype =
32
- {
33
- Execute : function()
34
- {
35
- FCKStyles.RemoveAll() ;
36
-
37
- FCK.Focus() ;
38
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
39
- },
40
-
41
- GetState : function()
42
- {
43
- return FCK.EditorWindow ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
44
- }
45
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckshowblocks.js DELETED
@@ -1,94 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKShowBlockCommand Class: the "Show Blocks" command.
22
- */
23
-
24
- var FCKShowBlockCommand = function( name, defaultState )
25
- {
26
- this.Name = name ;
27
- if ( defaultState != undefined )
28
- this._SavedState = defaultState ;
29
- else
30
- this._SavedState = null ;
31
- }
32
-
33
- FCKShowBlockCommand.prototype.Execute = function()
34
- {
35
- var state = this.GetState() ;
36
-
37
- if ( state == FCK_TRISTATE_DISABLED )
38
- return ;
39
-
40
- var body = FCK.EditorDocument.body ;
41
-
42
- if ( state == FCK_TRISTATE_ON )
43
- body.className = body.className.replace( /(^| )FCK__ShowBlocks/g, '' ) ;
44
- else
45
- body.className += ' FCK__ShowBlocks' ;
46
-
47
- if ( FCKBrowserInfo.IsIE )
48
- {
49
- try
50
- {
51
- FCK.EditorDocument.selection.createRange().select() ;
52
- }
53
- catch ( e )
54
- {}
55
- }
56
- else
57
- {
58
- var focus = FCK.EditorWindow.getSelection().focusNode ;
59
- if ( focus )
60
- {
61
- if ( focus.nodeType != 1 )
62
- focus = focus.parentNode ;
63
- FCKDomTools.ScrollIntoView( focus, false ) ;
64
- }
65
- }
66
-
67
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
68
- }
69
-
70
- FCKShowBlockCommand.prototype.GetState = function()
71
- {
72
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
73
- return FCK_TRISTATE_DISABLED ;
74
-
75
- // On some cases FCK.EditorDocument.body is not yet available
76
- if ( !FCK.EditorDocument )
77
- return FCK_TRISTATE_OFF ;
78
-
79
- if ( /FCK__ShowBlocks(?:\s|$)/.test( FCK.EditorDocument.body.className ) )
80
- return FCK_TRISTATE_ON ;
81
-
82
- return FCK_TRISTATE_OFF ;
83
- }
84
-
85
- FCKShowBlockCommand.prototype.SaveState = function()
86
- {
87
- this._SavedState = this.GetState() ;
88
- }
89
-
90
- FCKShowBlockCommand.prototype.RestoreState = function()
91
- {
92
- if ( this._SavedState != null && this.GetState() != this._SavedState )
93
- this.Execute() ;
94
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckspellcheckcommand_gecko.js DELETED
@@ -1,49 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKStyleCommand Class: represents the "Spell Check" command.
22
- * (Gecko specific implementation)
23
- */
24
-
25
- var FCKSpellCheckCommand = function()
26
- {
27
- this.Name = 'SpellCheck' ;
28
- this.IsEnabled = ( FCKConfig.SpellChecker != 'ieSpell' ) ;
29
- }
30
-
31
- FCKSpellCheckCommand.prototype.Execute = function()
32
- {
33
- switch ( FCKConfig.SpellChecker )
34
- {
35
- case 'SpellerPages' :
36
- FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ;
37
- break;
38
-
39
- case 'WSC' :
40
- FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'wsc/w.html', 530, 480 ) ;
41
- }
42
- }
43
-
44
- FCKSpellCheckCommand.prototype.GetState = function()
45
- {
46
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
47
- return FCK_TRISTATE_DISABLED ;
48
- return this.IsEnabled ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckspellcheckcommand_ie.js DELETED
@@ -1,72 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKStyleCommand Class: represents the "Spell Check" command.
22
- * (IE specific implementation)
23
- */
24
-
25
- var FCKSpellCheckCommand = function()
26
- {
27
- this.Name = 'SpellCheck' ;
28
- this.IsEnabled = true ;
29
- }
30
-
31
- FCKSpellCheckCommand.prototype.Execute = function()
32
- {
33
- switch ( FCKConfig.SpellChecker )
34
- {
35
- case 'ieSpell' :
36
- this._RunIeSpell() ;
37
- break ;
38
-
39
- case 'SpellerPages' :
40
- FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ;
41
- break ;
42
-
43
- case 'WSC' :
44
- FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'wsc/w.html', 530, 480 ) ;
45
- }
46
- }
47
-
48
- FCKSpellCheckCommand.prototype._RunIeSpell = function()
49
- {
50
- try
51
- {
52
- var oIeSpell = new ActiveXObject( "ieSpell.ieSpellExtension" ) ;
53
- oIeSpell.CheckAllLinkedDocuments( FCK.EditorDocument ) ;
54
- }
55
- catch( e )
56
- {
57
- if( e.number == -2146827859 )
58
- {
59
- if ( confirm( FCKLang.IeSpellDownload ) )
60
- window.open( FCKConfig.IeSpellDownloadUrl , 'IeSpellDownload' ) ;
61
- }
62
- else
63
- alert( 'Error Loading ieSpell: ' + e.message + ' (' + e.number + ')' ) ;
64
- }
65
- }
66
-
67
- FCKSpellCheckCommand.prototype.GetState = function()
68
- {
69
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
70
- return FCK_TRISTATE_DISABLED ;
71
- return this.IsEnabled ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
72
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fckstylecommand.js DELETED
@@ -1,60 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKStyleCommand Class: represents the "Style" command.
22
- */
23
-
24
- var FCKStyleCommand = function()
25
- {}
26
-
27
- FCKStyleCommand.prototype =
28
- {
29
- Name : 'Style',
30
-
31
- Execute : function( styleName, styleComboItem )
32
- {
33
- FCKUndo.SaveUndoStep() ;
34
-
35
- if ( styleComboItem.Selected )
36
- FCK.Styles.RemoveStyle( styleComboItem.Style ) ;
37
- else
38
- FCK.Styles.ApplyStyle( styleComboItem.Style ) ;
39
-
40
- FCKUndo.SaveUndoStep() ;
41
-
42
- FCK.Focus() ;
43
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
44
- },
45
-
46
- GetState : function()
47
- {
48
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || !FCK.EditorDocument )
49
- return FCK_TRISTATE_DISABLED ;
50
-
51
- if ( FCKSelection.GetType() == 'Control' )
52
- {
53
- var el = FCKSelection.GetSelectedElement() ;
54
- if ( !el || !FCKStyles.CheckHasObjectStyle( el.nodeName.toLowerCase() ) )
55
- return FCK_TRISTATE_DISABLED ;
56
- }
57
-
58
- return FCK_TRISTATE_OFF ;
59
- }
60
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fcktablecommand.js DELETED
@@ -1,106 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKPastePlainTextCommand Class: represents the
22
- * "Paste as Plain Text" command.
23
- */
24
-
25
- var FCKTableCommand = function( command )
26
- {
27
- this.Name = command ;
28
- }
29
-
30
- FCKTableCommand.prototype.Execute = function()
31
- {
32
- FCKUndo.SaveUndoStep() ;
33
-
34
- if ( ! FCKBrowserInfo.IsGecko )
35
- {
36
- switch ( this.Name )
37
- {
38
- case 'TableMergeRight' :
39
- return FCKTableHandler.MergeRight() ;
40
- case 'TableMergeDown' :
41
- return FCKTableHandler.MergeDown() ;
42
- }
43
- }
44
-
45
- switch ( this.Name )
46
- {
47
- case 'TableInsertRowAfter' :
48
- return FCKTableHandler.InsertRow( false ) ;
49
- case 'TableInsertRowBefore' :
50
- return FCKTableHandler.InsertRow( true ) ;
51
- case 'TableDeleteRows' :
52
- return FCKTableHandler.DeleteRows() ;
53
- case 'TableInsertColumnAfter' :
54
- return FCKTableHandler.InsertColumn( false ) ;
55
- case 'TableInsertColumnBefore' :
56
- return FCKTableHandler.InsertColumn( true ) ;
57
- case 'TableDeleteColumns' :
58
- return FCKTableHandler.DeleteColumns() ;
59
- case 'TableInsertCellAfter' :
60
- return FCKTableHandler.InsertCell( null, false ) ;
61
- case 'TableInsertCellBefore' :
62
- return FCKTableHandler.InsertCell( null, true ) ;
63
- case 'TableDeleteCells' :
64
- return FCKTableHandler.DeleteCells() ;
65
- case 'TableMergeCells' :
66
- return FCKTableHandler.MergeCells() ;
67
- case 'TableHorizontalSplitCell' :
68
- return FCKTableHandler.HorizontalSplitCell() ;
69
- case 'TableVerticalSplitCell' :
70
- return FCKTableHandler.VerticalSplitCell() ;
71
- case 'TableDelete' :
72
- return FCKTableHandler.DeleteTable() ;
73
- default :
74
- return alert( FCKLang.UnknownCommand.replace( /%1/g, this.Name ) ) ;
75
- }
76
- }
77
-
78
- FCKTableCommand.prototype.GetState = function()
79
- {
80
- if ( FCK.EditorDocument != null && FCKSelection.HasAncestorNode( 'TABLE' ) )
81
- {
82
- switch ( this.Name )
83
- {
84
- case 'TableHorizontalSplitCell' :
85
- case 'TableVerticalSplitCell' :
86
- if ( FCKTableHandler.GetSelectedCells().length == 1 )
87
- return FCK_TRISTATE_OFF ;
88
- else
89
- return FCK_TRISTATE_DISABLED ;
90
- case 'TableMergeCells' :
91
- if ( FCKTableHandler.CheckIsSelectionRectangular()
92
- && FCKTableHandler.GetSelectedCells().length > 1 )
93
- return FCK_TRISTATE_OFF ;
94
- else
95
- return FCK_TRISTATE_DISABLED ;
96
- case 'TableMergeRight' :
97
- return FCKTableHandler.GetMergeRightTarget() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
98
- case 'TableMergeDown' :
99
- return FCKTableHandler.GetMergeDownTarget() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
100
- default :
101
- return FCK_TRISTATE_OFF ;
102
- }
103
- }
104
- else
105
- return FCK_TRISTATE_DISABLED;
106
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js DELETED
@@ -1,201 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * FCKTextColorCommand Class: represents the text color comand. It shows the
22
- * color selection panel.
23
- */
24
-
25
- // FCKTextColorCommand Constructor
26
- // type: can be 'ForeColor' or 'BackColor'.
27
- var FCKTextColorCommand = function( type )
28
- {
29
- this.Name = type == 'ForeColor' ? 'TextColor' : 'BGColor' ;
30
- this.Type = type ;
31
-
32
- var oWindow ;
33
-
34
- if ( FCKBrowserInfo.IsIE )
35
- oWindow = window ;
36
- else if ( FCK.ToolbarSet._IFrame )
37
- oWindow = FCKTools.GetElementWindow( FCK.ToolbarSet._IFrame ) ;
38
- else
39
- oWindow = window.parent ;
40
-
41
- this._Panel = new FCKPanel( oWindow ) ;
42
- this._Panel.AppendStyleSheet( FCKConfig.SkinEditorCSS ) ;
43
- this._Panel.MainNode.className = 'FCK_Panel' ;
44
- this._CreatePanelBody( this._Panel.Document, this._Panel.MainNode ) ;
45
- FCK.ToolbarSet.ToolbarItems.GetItem( this.Name ).RegisterPanel( this._Panel ) ;
46
-
47
- FCKTools.DisableSelection( this._Panel.Document.body ) ;
48
- }
49
-
50
- FCKTextColorCommand.prototype.Execute = function( panelX, panelY, relElement )
51
- {
52
- // Show the Color Panel at the desired position.
53
- this._Panel.Show( panelX, panelY, relElement ) ;
54
- }
55
-
56
- FCKTextColorCommand.prototype.SetColor = function( color )
57
- {
58
- FCKUndo.SaveUndoStep() ;
59
-
60
- var style = FCKStyles.GetStyle( '_FCK_' +
61
- ( this.Type == 'ForeColor' ? 'Color' : 'BackColor' ) ) ;
62
-
63
- if ( !color || color.length == 0 )
64
- FCK.Styles.RemoveStyle( style ) ;
65
- else
66
- {
67
- style.SetVariable( 'Color', color ) ;
68
- FCKStyles.ApplyStyle( style ) ;
69
- }
70
-
71
- FCKUndo.SaveUndoStep() ;
72
-
73
- FCK.Focus() ;
74
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
75
- }
76
-
77
- FCKTextColorCommand.prototype.GetState = function()
78
- {
79
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
80
- return FCK_TRISTATE_DISABLED ;
81
- return FCK_TRISTATE_OFF ;
82
- }
83
-
84
- function FCKTextColorCommand_OnMouseOver()
85
- {
86
- this.className = 'ColorSelected' ;
87
- }
88
-
89
- function FCKTextColorCommand_OnMouseOut()
90
- {
91
- this.className = 'ColorDeselected' ;
92
- }
93
-
94
- function FCKTextColorCommand_OnClick( ev, command, color )
95
- {
96
- this.className = 'ColorDeselected' ;
97
- command.SetColor( color ) ;
98
- command._Panel.Hide() ;
99
- }
100
-
101
- function FCKTextColorCommand_AutoOnClick( ev, command )
102
- {
103
- this.className = 'ColorDeselected' ;
104
- command.SetColor( '' ) ;
105
- command._Panel.Hide() ;
106
- }
107
-
108
- function FCKTextColorCommand_MoreOnClick( ev, command )
109
- {
110
- this.className = 'ColorDeselected' ;
111
- command._Panel.Hide() ;
112
- FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320,
113
- FCKTools.Bind( command, command.SetColor ) ) ;
114
- }
115
-
116
- FCKTextColorCommand.prototype._CreatePanelBody = function( targetDocument, targetDiv )
117
- {
118
- function CreateSelectionDiv()
119
- {
120
- var oDiv = targetDocument.createElement( "DIV" ) ;
121
- oDiv.className = 'ColorDeselected' ;
122
- FCKTools.AddEventListenerEx( oDiv, 'mouseover', FCKTextColorCommand_OnMouseOver ) ;
123
- FCKTools.AddEventListenerEx( oDiv, 'mouseout', FCKTextColorCommand_OnMouseOut ) ;
124
-
125
- return oDiv ;
126
- }
127
-
128
- // Create the Table that will hold all colors.
129
- var oTable = targetDiv.appendChild( targetDocument.createElement( "TABLE" ) ) ;
130
- oTable.className = 'ForceBaseFont' ; // Firefox 1.5 Bug.
131
- oTable.style.tableLayout = 'fixed' ;
132
- oTable.cellPadding = 0 ;
133
- oTable.cellSpacing = 0 ;
134
- oTable.border = 0 ;
135
- oTable.width = 150 ;
136
-
137
- var oCell = oTable.insertRow(-1).insertCell(-1) ;
138
- oCell.colSpan = 8 ;
139
-
140
- // Create the Button for the "Automatic" color selection.
141
- var oDiv = oCell.appendChild( CreateSelectionDiv() ) ;
142
- oDiv.innerHTML =
143
- '<table cellspacing="0" cellpadding="0" width="100%" border="0">\
144
- <tr>\
145
- <td><div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #000000"></div></div></td>\
146
- <td nowrap width="100%" align="center">' + FCKLang.ColorAutomatic + '</td>\
147
- </tr>\
148
- </table>' ;
149
-
150
- FCKTools.AddEventListenerEx( oDiv, 'click', FCKTextColorCommand_AutoOnClick, this ) ;
151
-
152
- // Dirty hack for Opera, Safari and Firefox 3.
153
- if ( !FCKBrowserInfo.IsIE )
154
- oDiv.style.width = '96%' ;
155
-
156
- // Create an array of colors based on the configuration file.
157
- var aColors = FCKConfig.FontColors.toString().split(',') ;
158
-
159
- // Create the colors table based on the array.
160
- var iCounter = 0 ;
161
- while ( iCounter < aColors.length )
162
- {
163
- var oRow = oTable.insertRow(-1) ;
164
-
165
- for ( var i = 0 ; i < 8 ; i++, iCounter++ )
166
- {
167
- // The div will be created even if no more colors are available.
168
- // Extra divs will be hidden later in the code. (#1597)
169
- if ( iCounter < aColors.length )
170
- {
171
- var colorParts = aColors[iCounter].split('/') ;
172
- var colorValue = '#' + colorParts[0] ;
173
- var colorName = colorParts[1] || colorValue ;
174
- }
175
-
176
- oDiv = oRow.insertCell(-1).appendChild( CreateSelectionDiv() ) ;
177
- oDiv.innerHTML = '<div class="ColorBoxBorder"><div class="ColorBox" style="background-color: ' + colorValue + '"></div></div>' ;
178
-
179
- if ( iCounter >= aColors.length )
180
- oDiv.style.visibility = 'hidden' ;
181
- else
182
- FCKTools.AddEventListenerEx( oDiv, 'click', FCKTextColorCommand_OnClick, [ this, colorName ] ) ;
183
- }
184
- }
185
-
186
- // Create the Row and the Cell for the "More Colors..." button.
187
- if ( FCKConfig.EnableMoreFontColors )
188
- {
189
- oCell = oTable.insertRow(-1).insertCell(-1) ;
190
- oCell.colSpan = 8 ;
191
-
192
- oDiv = oCell.appendChild( CreateSelectionDiv() ) ;
193
- oDiv.innerHTML = '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td nowrap align="center">' + FCKLang.ColorMoreColors + '</td></tr></table>' ;
194
-
195
- FCKTools.AddEventListenerEx( oDiv, 'click', FCKTextColorCommand_MoreOnClick, this ) ;
196
- }
197
-
198
- // Dirty hack for Opera, Safari and Firefox 3.
199
- if ( !FCKBrowserInfo.IsIE )
200
- oDiv.style.width = '96%' ;
201
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/fckconstants.js DELETED
@@ -1,56 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Defines some constants used by the editor. These constants are also
22
- * globally available in the page where the editor is placed.
23
- */
24
-
25
- // Editor Instance Status.
26
- var FCK_STATUS_NOTLOADED = window.parent.FCK_STATUS_NOTLOADED = 0 ;
27
- var FCK_STATUS_ACTIVE = window.parent.FCK_STATUS_ACTIVE = 1 ;
28
- var FCK_STATUS_COMPLETE = window.parent.FCK_STATUS_COMPLETE = 2 ;
29
-
30
- // Tristate Operations.
31
- var FCK_TRISTATE_OFF = window.parent.FCK_TRISTATE_OFF = 0 ;
32
- var FCK_TRISTATE_ON = window.parent.FCK_TRISTATE_ON = 1 ;
33
- var FCK_TRISTATE_DISABLED = window.parent.FCK_TRISTATE_DISABLED = -1 ;
34
-
35
- // For unknown values.
36
- var FCK_UNKNOWN = window.parent.FCK_UNKNOWN = -9 ;
37
-
38
- // Toolbar Items Style.
39
- var FCK_TOOLBARITEM_ONLYICON = window.parent.FCK_TOOLBARITEM_ONLYICON = 0 ;
40
- var FCK_TOOLBARITEM_ONLYTEXT = window.parent.FCK_TOOLBARITEM_ONLYTEXT = 1 ;
41
- var FCK_TOOLBARITEM_ICONTEXT = window.parent.FCK_TOOLBARITEM_ICONTEXT = 2 ;
42
-
43
- // Edit Mode
44
- var FCK_EDITMODE_WYSIWYG = window.parent.FCK_EDITMODE_WYSIWYG = 0 ;
45
- var FCK_EDITMODE_SOURCE = window.parent.FCK_EDITMODE_SOURCE = 1 ;
46
-
47
- var FCK_IMAGES_PATH = 'images/' ; // Check usage.
48
- var FCK_SPACER_PATH = 'images/spacer.gif' ;
49
-
50
- var CTRL = 1000 ;
51
- var SHIFT = 2000 ;
52
- var ALT = 4000 ;
53
-
54
- var FCK_STYLE_BLOCK = 0 ;
55
- var FCK_STYLE_INLINE = 1 ;
56
- var FCK_STYLE_OBJECT = 2 ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/fckeditorapi.js DELETED
@@ -1,179 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Create the FCKeditorAPI object that is available as a global object in
22
- * the page where the editor is placed in.
23
- */
24
-
25
- var FCKeditorAPI ;
26
-
27
- function InitializeAPI()
28
- {
29
- var oParentWindow = window.parent ;
30
-
31
- if ( !( FCKeditorAPI = oParentWindow.FCKeditorAPI ) )
32
- {
33
- // Make the FCKeditorAPI object available in the parent window. Use
34
- // eval so this core runs in the parent's scope and so it will still be
35
- // available if the editor instance is removed ("Can't execute code
36
- // from a freed script" error).
37
-
38
- // Note: we check the existence of oEditor.GetParentForm because some external
39
- // code (like JSON) can extend the Object prototype and we get then extra oEditor
40
- // objects that aren't really FCKeditor instances.
41
- var sScript =
42
- 'window.FCKeditorAPI = {' +
43
- 'Version : "2.6.4",' +
44
- 'VersionBuild : "21629",' +
45
- 'Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},' +
46
-
47
- 'GetInstance : function( name )' +
48
- '{' +
49
- 'return this.Instances[ name ];' +
50
- '},' +
51
-
52
- '_FormSubmit : function()' +
53
- '{' +
54
- 'for ( var name in FCKeditorAPI.Instances )' +
55
- '{' +
56
- 'var oEditor = FCKeditorAPI.Instances[ name ] ;' +
57
- 'if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )' +
58
- 'oEditor.UpdateLinkedField() ;' +
59
- '}' +
60
- 'this._FCKOriginalSubmit() ;' +
61
- '},' +
62
-
63
- '_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {' +
64
- 'Functions : new Array(),' +
65
- 'IsRunning : false,' +
66
-
67
- 'Add : function( f )' +
68
- '{' +
69
- 'this.Functions.push( f );' +
70
- 'if ( !this.IsRunning )' +
71
- 'this.StartNext();' +
72
- '},' +
73
-
74
- 'StartNext : function()' +
75
- '{' +
76
- 'var aQueue = this.Functions ;' +
77
- 'if ( aQueue.length > 0 )' +
78
- '{' +
79
- 'this.IsRunning = true;' +
80
- 'aQueue[0].call();' +
81
- '}' +
82
- 'else ' +
83
- 'this.IsRunning = false;' +
84
- '},' +
85
-
86
- 'Remove : function( f )' +
87
- '{' +
88
- 'var aQueue = this.Functions;' +
89
- 'var i = 0, fFunc;' +
90
- 'while( (fFunc = aQueue[ i ]) )' +
91
- '{' +
92
- 'if ( fFunc == f )' +
93
- 'aQueue.splice( i,1 );' +
94
- 'i++ ;' +
95
- '}' +
96
- 'this.StartNext();' +
97
- '}' +
98
- '}' +
99
- '}' ;
100
-
101
- // In IE, the "eval" function is not always available (it works with
102
- // the JavaScript samples, but not with the ASP ones, for example).
103
- // So, let's use the execScript instead.
104
- if ( oParentWindow.execScript )
105
- oParentWindow.execScript( sScript, 'JavaScript' ) ;
106
- else
107
- {
108
- if ( FCKBrowserInfo.IsGecko10 )
109
- {
110
- // FF 1.0.4 gives an error with the request bellow. The
111
- // following seams to work well.
112
- eval.call( oParentWindow, sScript ) ;
113
- }
114
- else if( FCKBrowserInfo.IsAIR )
115
- {
116
- FCKAdobeAIR.FCKeditorAPI_Evaluate( oParentWindow, sScript ) ;
117
- }
118
- else if ( FCKBrowserInfo.IsSafari )
119
- {
120
- // oParentWindow.eval in Safari executes in the calling window
121
- // environment, instead of the parent one. The following should
122
- // make it work.
123
- var oParentDocument = oParentWindow.document ;
124
- var eScript = oParentDocument.createElement('script') ;
125
- eScript.appendChild( oParentDocument.createTextNode( sScript ) ) ;
126
- oParentDocument.documentElement.appendChild( eScript ) ;
127
- }
128
- else
129
- oParentWindow.eval( sScript ) ;
130
- }
131
-
132
- FCKeditorAPI = oParentWindow.FCKeditorAPI ;
133
-
134
- // The __Instances properly has been changed to the public Instances,
135
- // but we should still have the "deprecated" version of it.
136
- FCKeditorAPI.__Instances = FCKeditorAPI.Instances ;
137
- }
138
-
139
- // Add the current instance to the FCKeditorAPI's instances collection.
140
- FCKeditorAPI.Instances[ FCK.Name ] = FCK ;
141
- }
142
-
143
- // Attach to the form onsubmit event and to the form.submit().
144
- function _AttachFormSubmitToAPI()
145
- {
146
- // Get the linked field form.
147
- var oForm = FCK.GetParentForm() ;
148
-
149
- if ( oForm )
150
- {
151
- // Attach to the onsubmit event.
152
- FCKTools.AddEventListener( oForm, 'submit', FCK.UpdateLinkedField ) ;
153
-
154
- // IE sees oForm.submit function as an 'object'.
155
- if ( !oForm._FCKOriginalSubmit && ( typeof( oForm.submit ) == 'function' || ( !oForm.submit.tagName && !oForm.submit.length ) ) )
156
- {
157
- // Save the original submit.
158
- oForm._FCKOriginalSubmit = oForm.submit ;
159
-
160
- // Create our replacement for the submit.
161
- oForm.submit = FCKeditorAPI._FormSubmit ;
162
- }
163
- }
164
- }
165
-
166
- function FCKeditorAPI_Cleanup()
167
- {
168
- if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat
169
- && !window.FCKUnloadFlag )
170
- return ;
171
- delete FCKeditorAPI.Instances[ FCK.Name ] ;
172
- }
173
- function FCKeditorAPI_ConfirmCleanup()
174
- {
175
- if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat )
176
- window.FCKUnloadFlag = true ;
177
- }
178
- FCKTools.AddEventListener( window, 'unload', FCKeditorAPI_Cleanup ) ;
179
- FCKTools.AddEventListener( window, 'beforeunload', FCKeditorAPI_ConfirmCleanup) ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/fckjscoreextensions.js DELETED
@@ -1,159 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Extensions to the JavaScript Core.
22
- *
23
- * All custom extensions functions are PascalCased to differ from the standard
24
- * camelCased ones.
25
- */
26
-
27
- String.prototype.Contains = function( textToCheck )
28
- {
29
- return ( this.indexOf( textToCheck ) > -1 ) ;
30
- }
31
-
32
- String.prototype.Equals = function()
33
- {
34
- var aArgs = arguments ;
35
-
36
- // The arguments could also be a single array.
37
- if ( aArgs.length == 1 && aArgs[0].pop )
38
- aArgs = aArgs[0] ;
39
-
40
- for ( var i = 0 ; i < aArgs.length ; i++ )
41
- {
42
- if ( this == aArgs[i] )
43
- return true ;
44
- }
45
- return false ;
46
- }
47
-
48
- String.prototype.IEquals = function()
49
- {
50
- var thisUpper = this.toUpperCase() ;
51
-
52
- var aArgs = arguments ;
53
-
54
- // The arguments could also be a single array.
55
- if ( aArgs.length == 1 && aArgs[0].pop )
56
- aArgs = aArgs[0] ;
57
-
58
- for ( var i = 0 ; i < aArgs.length ; i++ )
59
- {
60
- if ( thisUpper == aArgs[i].toUpperCase() )
61
- return true ;
62
- }
63
- return false ;
64
- }
65
-
66
- String.prototype.ReplaceAll = function( searchArray, replaceArray )
67
- {
68
- var replaced = this ;
69
-
70
- for ( var i = 0 ; i < searchArray.length ; i++ )
71
- {
72
- replaced = replaced.replace( searchArray[i], replaceArray[i] ) ;
73
- }
74
-
75
- return replaced ;
76
- }
77
-
78
- String.prototype.StartsWith = function( value )
79
- {
80
- return ( this.substr( 0, value.length ) == value ) ;
81
- }
82
-
83
- // Extends the String object, creating a "EndsWith" method on it.
84
- String.prototype.EndsWith = function( value, ignoreCase )
85
- {
86
- var L1 = this.length ;
87
- var L2 = value.length ;
88
-
89
- if ( L2 > L1 )
90
- return false ;
91
-
92
- if ( ignoreCase )
93
- {
94
- var oRegex = new RegExp( value + '$' , 'i' ) ;
95
- return oRegex.test( this ) ;
96
- }
97
- else
98
- return ( L2 == 0 || this.substr( L1 - L2, L2 ) == value ) ;
99
- }
100
-
101
- String.prototype.Remove = function( start, length )
102
- {
103
- var s = '' ;
104
-
105
- if ( start > 0 )
106
- s = this.substring( 0, start ) ;
107
-
108
- if ( start + length < this.length )
109
- s += this.substring( start + length , this.length ) ;
110
-
111
- return s ;
112
- }
113
-
114
- String.prototype.Trim = function()
115
- {
116
- // We are not using \s because we don't want "non-breaking spaces to be caught".
117
- return this.replace( /(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '' ) ;
118
- }
119
-
120
- String.prototype.LTrim = function()
121
- {
122
- // We are not using \s because we don't want "non-breaking spaces to be caught".
123
- return this.replace( /^[ \t\n\r]*/g, '' ) ;
124
- }
125
-
126
- String.prototype.RTrim = function()
127
- {
128
- // We are not using \s because we don't want "non-breaking spaces to be caught".
129
- return this.replace( /[ \t\n\r]*$/g, '' ) ;
130
- }
131
-
132
- String.prototype.ReplaceNewLineChars = function( replacement )
133
- {
134
- return this.replace( /\n/g, replacement ) ;
135
- }
136
-
137
- String.prototype.Replace = function( regExp, replacement, thisObj )
138
- {
139
- if ( typeof replacement == 'function' )
140
- {
141
- return this.replace( regExp,
142
- function()
143
- {
144
- return replacement.apply( thisObj || this, arguments ) ;
145
- } ) ;
146
- }
147
- else
148
- return this.replace( regExp, replacement ) ;
149
- }
150
-
151
- Array.prototype.IndexOf = function( value )
152
- {
153
- for ( var i = 0 ; i < this.length ; i++ )
154
- {
155
- if ( this[i] == value )
156
- return i ;
157
- }
158
- return -1 ;
159
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/fckscriptloader.js DELETED
@@ -1,122 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This is a utility object which can be used to load specific components of
22
- * FCKeditor, including all dependencies.
23
- */
24
-
25
- var FCK_GENERIC = 1 ;
26
- var FCK_GENERIC_SPECIFIC = 2 ;
27
- var FCK_SPECIFIC = 3 ;
28
-
29
- var FCKScriptLoader = new Object() ;
30
- FCKScriptLoader.FCKeditorPath = '/fckeditor/' ;
31
-
32
- FCKScriptLoader._Scripts = new Object() ;
33
- FCKScriptLoader._LoadedScripts = new Object() ;
34
-
35
- FCKScriptLoader._IsIE = (/msie/).test( navigator.userAgent.toLowerCase() ) ;
36
-
37
- FCKScriptLoader.Load = function( scriptName )
38
- {
39
- // Check if the script has already been loaded.
40
- if ( scriptName in FCKScriptLoader._LoadedScripts )
41
- return ;
42
-
43
- FCKScriptLoader._LoadedScripts[ scriptName ] = true ;
44
-
45
- var oScriptInfo = this._Scripts[ scriptName ] ;
46
-
47
- if ( !oScriptInfo )
48
- {
49
- alert( 'FCKScriptLoader: The script "' + scriptName + '" could not be loaded' ) ;
50
- return ;
51
- }
52
-
53
- for ( var i = 0 ; i < oScriptInfo.Dependency.length ; i++ )
54
- {
55
- this.Load( oScriptInfo.Dependency[i] ) ;
56
- }
57
-
58
- var sBaseScriptName = oScriptInfo.BasePath + scriptName.toLowerCase() ;
59
-
60
- if ( oScriptInfo.Compatibility == FCK_GENERIC || oScriptInfo.Compatibility == FCK_GENERIC_SPECIFIC )
61
- this._LoadScript( sBaseScriptName + '.js' ) ;
62
-
63
- if ( oScriptInfo.Compatibility == FCK_SPECIFIC || oScriptInfo.Compatibility == FCK_GENERIC_SPECIFIC )
64
- {
65
- if ( this._IsIE )
66
- this._LoadScript( sBaseScriptName + '_ie.js' ) ;
67
- else
68
- this._LoadScript( sBaseScriptName + '_gecko.js' ) ;
69
- }
70
- }
71
-
72
- FCKScriptLoader._LoadScript = function( scriptPathFromSource )
73
- {
74
- document.write( '<script type="text/javascript" src="' + this.FCKeditorPath + 'editor/_source/' + scriptPathFromSource + '"><\/script>' ) ;
75
- }
76
-
77
- FCKScriptLoader.AddScript = function( scriptName, scriptBasePath, dependency, compatibility )
78
- {
79
- this._Scripts[ scriptName ] =
80
- {
81
- BasePath : scriptBasePath || '',
82
- Dependency : dependency || [],
83
- Compatibility : compatibility || FCK_GENERIC
84
- } ;
85
- }
86
-
87
- /*
88
- * ####################################
89
- * ### Scripts Definition List
90
- */
91
-
92
- FCKScriptLoader.AddScript( 'FCKConstants' ) ;
93
- FCKScriptLoader.AddScript( 'FCKJSCoreExtensions' ) ;
94
-
95
- FCKScriptLoader.AddScript( 'FCK_Xhtml10Transitional', '../dtd/' ) ;
96
-
97
- FCKScriptLoader.AddScript( 'FCKDataProcessor' , 'classes/' , ['FCKConfig','FCKBrowserInfo','FCKRegexLib','FCKXHtml'] ) ;
98
- FCKScriptLoader.AddScript( 'FCKDocumentFragment', 'classes/' , ['FCKDomTools'], FCK_SPECIFIC ) ;
99
- FCKScriptLoader.AddScript( 'FCKDomRange' , 'classes/' , ['FCKBrowserInfo','FCKJSCoreExtensions','FCKW3CRange','FCKElementPath','FCKDomTools','FCKTools','FCKDocumentFragment'], FCK_GENERIC_SPECIFIC ) ;
100
- FCKScriptLoader.AddScript( 'FCKDomRangeIterator', 'classes/' , ['FCKDomRange','FCKListsLib'], FCK_GENERIC ) ;
101
- FCKScriptLoader.AddScript( 'FCKElementPath' , 'classes/' , ['FCKListsLib'], FCK_GENERIC ) ;
102
- FCKScriptLoader.AddScript( 'FCKEnterKey' , 'classes/' , ['FCKDomRange','FCKDomTools','FCKTools','FCKKeystrokeHandler','FCKListHandler'], FCK_GENERIC ) ;
103
- FCKScriptLoader.AddScript( 'FCKPanel' , 'classes/' , ['FCKBrowserInfo','FCKConfig','FCKTools'], FCK_GENERIC ) ;
104
- FCKScriptLoader.AddScript( 'FCKImagePreloader' , 'classes/' ) ;
105
- FCKScriptLoader.AddScript( 'FCKKeystrokeHandler', 'classes/' , ['FCKConstants','FCKBrowserInfo','FCKTools'], FCK_GENERIC ) ;
106
- FCKScriptLoader.AddScript( 'FCKStyle' , 'classes/' , ['FCKConstants','FCKDomRange','FCKDomRangeIterator','FCKDomTools','FCKListsLib','FCK_Xhtml10Transitional'], FCK_GENERIC ) ;
107
- FCKScriptLoader.AddScript( 'FCKW3CRange' , 'classes/' , ['FCKDomTools','FCKTools','FCKDocumentFragment'], FCK_GENERIC ) ;
108
-
109
- FCKScriptLoader.AddScript( 'FCKBrowserInfo' , 'internals/' , ['FCKJSCoreExtensions'] ) ;
110
- FCKScriptLoader.AddScript( 'FCKCodeFormatter' , 'internals/' ) ;
111
- FCKScriptLoader.AddScript( 'FCKConfig' , 'internals/' , ['FCKBrowserInfo','FCKConstants'] ) ;
112
- FCKScriptLoader.AddScript( 'FCKDebug' , 'internals/' , ['FCKConfig'] ) ;
113
- FCKScriptLoader.AddScript( 'FCKDomTools' , 'internals/' , ['FCKJSCoreExtensions','FCKBrowserInfo','FCKTools','FCKDomRange'], FCK_GENERIC ) ;
114
- FCKScriptLoader.AddScript( 'FCKListsLib' , 'internals/' ) ;
115
- FCKScriptLoader.AddScript( 'FCKListHandler' , 'internals/' , ['FCKConfig', 'FCKDocumentFragment', 'FCKJSCoreExtensions','FCKDomTools'], FCK_GENERIC ) ;
116
- FCKScriptLoader.AddScript( 'FCKRegexLib' , 'internals/' ) ;
117
- FCKScriptLoader.AddScript( 'FCKStyles' , 'internals/' , ['FCKConfig', 'FCKDocumentFragment', 'FCKDomRange','FCKDomTools','FCKElementPath','FCKTools'], FCK_GENERIC ) ;
118
- FCKScriptLoader.AddScript( 'FCKTools' , 'internals/' , ['FCKJSCoreExtensions','FCKBrowserInfo'], FCK_GENERIC_SPECIFIC ) ;
119
- FCKScriptLoader.AddScript( 'FCKXHtml' , 'internals/' , ['FCKBrowserInfo','FCKCodeFormatter','FCKConfig','FCKDomTools','FCKListsLib','FCKRegexLib','FCKTools','FCKXHtmlEntities'], FCK_GENERIC_SPECIFIC ) ;
120
- FCKScriptLoader.AddScript( 'FCKXHtmlEntities' , 'internals/' , ['FCKConfig'] ) ;
121
-
122
- // ####################################
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fck.js DELETED
@@ -1,1256 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Creation and initialization of the "FCK" object. This is the main object
22
- * that represents an editor instance.
23
- */
24
-
25
- // FCK represents the active editor instance.
26
- var FCK =
27
- {
28
- Name : FCKURLParams[ 'InstanceName' ],
29
- Status : FCK_STATUS_NOTLOADED,
30
- EditMode : FCK_EDITMODE_WYSIWYG,
31
- Toolbar : null,
32
- HasFocus : false,
33
- DataProcessor : new FCKDataProcessor(),
34
-
35
- GetInstanceObject : (function()
36
- {
37
- var w = window ;
38
- return function( name )
39
- {
40
- return w[name] ;
41
- }
42
- })(),
43
-
44
- AttachToOnSelectionChange : function( functionPointer )
45
- {
46
- this.Events.AttachEvent( 'OnSelectionChange', functionPointer ) ;
47
- },
48
-
49
- GetLinkedFieldValue : function()
50
- {
51
- return this.LinkedField.value ;
52
- },
53
-
54
- GetParentForm : function()
55
- {
56
- return this.LinkedField.form ;
57
- } ,
58
-
59
- // # START : IsDirty implementation
60
-
61
- StartupValue : '',
62
-
63
- IsDirty : function()
64
- {
65
- if ( this.EditMode == FCK_EDITMODE_SOURCE )
66
- return ( this.StartupValue != this.EditingArea.Textarea.value ) ;
67
- else
68
- {
69
- // It can happen switching between design and source mode in Gecko
70
- if ( ! this.EditorDocument )
71
- return false ;
72
-
73
- return ( this.StartupValue != this.EditorDocument.body.innerHTML ) ;
74
- }
75
- },
76
-
77
- ResetIsDirty : function()
78
- {
79
- if ( this.EditMode == FCK_EDITMODE_SOURCE )
80
- this.StartupValue = this.EditingArea.Textarea.value ;
81
- else if ( this.EditorDocument.body )
82
- this.StartupValue = this.EditorDocument.body.innerHTML ;
83
- },
84
-
85
- // # END : IsDirty implementation
86
-
87
- StartEditor : function()
88
- {
89
- this.TempBaseTag = FCKConfig.BaseHref.length > 0 ? '<base href="' + FCKConfig.BaseHref + '" _fcktemp="true"></base>' : '' ;
90
-
91
- // Setup the keystroke handler.
92
- var oKeystrokeHandler = FCK.KeystrokeHandler = new FCKKeystrokeHandler() ;
93
- oKeystrokeHandler.OnKeystroke = _FCK_KeystrokeHandler_OnKeystroke ;
94
-
95
- // Set the config keystrokes.
96
- oKeystrokeHandler.SetKeystrokes( FCKConfig.Keystrokes ) ;
97
-
98
- // In IE7, if the editor tries to access the clipboard by code, a dialog is
99
- // shown to the user asking if the application is allowed to access or not.
100
- // Due to the IE implementation of it, the KeystrokeHandler will not work
101
- //well in this case, so we must leave the pasting keys to have their default behavior.
102
- if ( FCKBrowserInfo.IsIE7 )
103
- {
104
- if ( ( CTRL + 86 /*V*/ ) in oKeystrokeHandler.Keystrokes )
105
- oKeystrokeHandler.SetKeystrokes( [ CTRL + 86, true ] ) ;
106
-
107
- if ( ( SHIFT + 45 /*INS*/ ) in oKeystrokeHandler.Keystrokes )
108
- oKeystrokeHandler.SetKeystrokes( [ SHIFT + 45, true ] ) ;
109
- }
110
-
111
- // Retain default behavior for Ctrl-Backspace. (Bug #362)
112
- oKeystrokeHandler.SetKeystrokes( [ CTRL + 8, true ] ) ;
113
-
114
- this.EditingArea = new FCKEditingArea( document.getElementById( 'xEditingArea' ) ) ;
115
- this.EditingArea.FFSpellChecker = FCKConfig.FirefoxSpellChecker ;
116
-
117
- // Set the editor's startup contents.
118
- this.SetData( this.GetLinkedFieldValue(), true ) ;
119
-
120
- // Tab key handling for source mode.
121
- FCKTools.AddEventListener( document, "keydown", this._TabKeyHandler ) ;
122
-
123
- // Add selection change listeners. They must be attached only once.
124
- this.AttachToOnSelectionChange( _FCK_PaddingNodeListener ) ;
125
- if ( FCKBrowserInfo.IsGecko )
126
- this.AttachToOnSelectionChange( this._ExecCheckEmptyBlock ) ;
127
-
128
- },
129
-
130
- Focus : function()
131
- {
132
- FCK.EditingArea.Focus() ;
133
- },
134
-
135
- SetStatus : function( newStatus )
136
- {
137
- this.Status = newStatus ;
138
-
139
- if ( newStatus == FCK_STATUS_ACTIVE )
140
- {
141
- FCKFocusManager.AddWindow( window, true ) ;
142
-
143
- if ( FCKBrowserInfo.IsIE )
144
- FCKFocusManager.AddWindow( window.frameElement, true ) ;
145
-
146
- // Force the focus in the editor.
147
- if ( FCKConfig.StartupFocus )
148
- FCK.Focus() ;
149
- }
150
-
151
- this.Events.FireEvent( 'OnStatusChange', newStatus ) ;
152
-
153
- },
154
-
155
- // Fixes the body by moving all inline and text nodes to appropriate block
156
- // elements.
157
- FixBody : function()
158
- {
159
- var sBlockTag = FCKConfig.EnterMode ;
160
-
161
- // In 'br' mode, no fix must be done.
162
- if ( sBlockTag != 'p' && sBlockTag != 'div' )
163
- return ;
164
-
165
- var oDocument = this.EditorDocument ;
166
-
167
- if ( !oDocument )
168
- return ;
169
-
170
- var oBody = oDocument.body ;
171
-
172
- if ( !oBody )
173
- return ;
174
-
175
- FCKDomTools.TrimNode( oBody ) ;
176
-
177
- var oNode = oBody.firstChild ;
178
- var oNewBlock ;
179
-
180
- while ( oNode )
181
- {
182
- var bMoveNode = false ;
183
-
184
- switch ( oNode.nodeType )
185
- {
186
- // Element Node.
187
- case 1 :
188
- var nodeName = oNode.nodeName.toLowerCase() ;
189
- if ( !FCKListsLib.BlockElements[ nodeName ] &&
190
- nodeName != 'li' &&
191
- !oNode.getAttribute('_fckfakelement') &&
192
- oNode.getAttribute('_moz_dirty') == null )
193
- bMoveNode = true ;
194
- break ;
195
-
196
- // Text Node.
197
- case 3 :
198
- // Ignore space only or empty text.
199
- if ( oNewBlock || oNode.nodeValue.Trim().length > 0 )
200
- bMoveNode = true ;
201
- break;
202
-
203
- // Comment Node
204
- case 8 :
205
- if ( oNewBlock )
206
- bMoveNode = true ;
207
- break;
208
- }
209
-
210
- if ( bMoveNode )
211
- {
212
- var oParent = oNode.parentNode ;
213
-
214
- if ( !oNewBlock )
215
- oNewBlock = oParent.insertBefore( oDocument.createElement( sBlockTag ), oNode ) ;
216
-
217
- oNewBlock.appendChild( oParent.removeChild( oNode ) ) ;
218
-
219
- oNode = oNewBlock.nextSibling ;
220
- }
221
- else
222
- {
223
- if ( oNewBlock )
224
- {
225
- FCKDomTools.TrimNode( oNewBlock ) ;
226
- oNewBlock = null ;
227
- }
228
- oNode = oNode.nextSibling ;
229
- }
230
- }
231
-
232
- if ( oNewBlock )
233
- FCKDomTools.TrimNode( oNewBlock ) ;
234
- },
235
-
236
- GetData : function( format )
237
- {
238
- // We assume that if the user is in source editing, the editor value must
239
- // represent the exact contents of the source, as the user wanted it to be.
240
- if ( FCK.EditMode == FCK_EDITMODE_SOURCE )
241
- return FCK.EditingArea.Textarea.value ;
242
-
243
- this.FixBody() ;
244
-
245
- var oDoc = FCK.EditorDocument ;
246
- if ( !oDoc )
247
- return null ;
248
-
249
- var isFullPage = FCKConfig.FullPage ;
250
-
251
- // Call the Data Processor to generate the output data.
252
- var data = FCK.DataProcessor.ConvertToDataFormat(
253
- isFullPage ? oDoc.documentElement : oDoc.body,
254
- !isFullPage,
255
- FCKConfig.IgnoreEmptyParagraphValue,
256
- format ) ;
257
-
258
- // Restore protected attributes.
259
- data = FCK.ProtectEventsRestore( data ) ;
260
-
261
- if ( FCKBrowserInfo.IsIE )
262
- data = data.replace( FCKRegexLib.ToReplace, '$1' ) ;
263
-
264
- if ( isFullPage )
265
- {
266
- if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 )
267
- data = FCK.DocTypeDeclaration + '\n' + data ;
268
-
269
- if ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 )
270
- data = FCK.XmlDeclaration + '\n' + data ;
271
- }
272
-
273
- return FCKConfig.ProtectedSource.Revert( data ) ;
274
- },
275
-
276
- UpdateLinkedField : function()
277
- {
278
- var value = FCK.GetXHTML( FCKConfig.FormatOutput ) ;
279
-
280
- if ( FCKConfig.HtmlEncodeOutput )
281
- value = FCKTools.HTMLEncode( value ) ;
282
-
283
- FCK.LinkedField.value = value ;
284
- FCK.Events.FireEvent( 'OnAfterLinkedFieldUpdate' ) ;
285
- },
286
-
287
- RegisteredDoubleClickHandlers : new Object(),
288
-
289
- OnDoubleClick : function( element )
290
- {
291
- var oCalls = FCK.RegisteredDoubleClickHandlers[ element.tagName.toUpperCase() ] ;
292
-
293
- if ( oCalls )
294
- {
295
- for ( var i = 0 ; i < oCalls.length ; i++ )
296
- oCalls[ i ]( element ) ;
297
- }
298
-
299
- // Generic handler for any element
300
- oCalls = FCK.RegisteredDoubleClickHandlers[ '*' ] ;
301
-
302
- if ( oCalls )
303
- {
304
- for ( var i = 0 ; i < oCalls.length ; i++ )
305
- oCalls[ i ]( element ) ;
306
- }
307
-
308
- },
309
-
310
- // Register objects that can handle double click operations.
311
- RegisterDoubleClickHandler : function( handlerFunction, tag )
312
- {
313
- var nodeName = tag || '*' ;
314
- nodeName = nodeName.toUpperCase() ;
315
-
316
- var aTargets ;
317
-
318
- if ( !( aTargets = FCK.RegisteredDoubleClickHandlers[ nodeName ] ) )
319
- FCK.RegisteredDoubleClickHandlers[ nodeName ] = [ handlerFunction ] ;
320
- else
321
- {
322
- // Check that the event handler isn't already registered with the same listener
323
- // It doesn't detect function pointers belonging to an object (at least in Gecko)
324
- if ( aTargets.IndexOf( handlerFunction ) == -1 )
325
- aTargets.push( handlerFunction ) ;
326
- }
327
-
328
- },
329
-
330
- OnAfterSetHTML : function()
331
- {
332
- FCKDocumentProcessor.Process( FCK.EditorDocument ) ;
333
- FCKUndo.SaveUndoStep() ;
334
-
335
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
336
- FCK.Events.FireEvent( 'OnAfterSetHTML' ) ;
337
- },
338
-
339
- // Saves URLs on links and images on special attributes, so they don't change when
340
- // moving around.
341
- ProtectUrls : function( html )
342
- {
343
- // <A> href
344
- html = html.replace( FCKRegexLib.ProtectUrlsA , '$& _fcksavedurl=$1' ) ;
345
-
346
- // <IMG> src
347
- html = html.replace( FCKRegexLib.ProtectUrlsImg , '$& _fcksavedurl=$1' ) ;
348
-
349
- // <AREA> href
350
- html = html.replace( FCKRegexLib.ProtectUrlsArea , '$& _fcksavedurl=$1' ) ;
351
-
352
- return html ;
353
- },
354
-
355
- // Saves event attributes (like onclick) so they don't get executed while
356
- // editing.
357
- ProtectEvents : function( html )
358
- {
359
- return html.replace( FCKRegexLib.TagsWithEvent, _FCK_ProtectEvents_ReplaceTags ) ;
360
- },
361
-
362
- ProtectEventsRestore : function( html )
363
- {
364
- return html.replace( FCKRegexLib.ProtectedEvents, _FCK_ProtectEvents_RestoreEvents ) ;
365
- },
366
-
367
- ProtectTags : function( html )
368
- {
369
- var sTags = FCKConfig.ProtectedTags ;
370
-
371
- // IE doesn't support <abbr> and it breaks it. Let's protect it.
372
- if ( FCKBrowserInfo.IsIE )
373
- sTags += sTags.length > 0 ? '|ABBR|XML|EMBED|OBJECT' : 'ABBR|XML|EMBED|OBJECT' ;
374
-
375
- var oRegex ;
376
- if ( sTags.length > 0 )
377
- {
378
- oRegex = new RegExp( '<(' + sTags + ')(?!\w|:)', 'gi' ) ;
379
- html = html.replace( oRegex, '<FCK:$1' ) ;
380
-
381
- oRegex = new RegExp( '<\/(' + sTags + ')>', 'gi' ) ;
382
- html = html.replace( oRegex, '<\/FCK:$1>' ) ;
383
- }
384
-
385
- // Protect some empty elements. We must do it separately because the
386
- // original tag may not contain the closing slash, like <hr>:
387
- // - <meta> tags get executed, so if you have a redirect meta, the
388
- // content will move to the target page.
389
- // - <hr> may destroy the document structure if not well
390
- // positioned. The trick is protect it here and restore them in
391
- // the FCKDocumentProcessor.
392
- sTags = 'META' ;
393
- if ( FCKBrowserInfo.IsIE )
394
- sTags += '|HR' ;
395
-
396
- oRegex = new RegExp( '<((' + sTags + ')(?=\\s|>|/)[\\s\\S]*?)/?>', 'gi' ) ;
397
- html = html.replace( oRegex, '<FCK:$1 />' ) ;
398
-
399
- return html ;
400
- },
401
-
402
- SetData : function( data, resetIsDirty )
403
- {
404
- this.EditingArea.Mode = FCK.EditMode ;
405
-
406
- // If there was an onSelectionChange listener in IE we must remove it to avoid crashes #1498
407
- if ( FCKBrowserInfo.IsIE && FCK.EditorDocument )
408
- {
409
- FCK.EditorDocument.detachEvent("onselectionchange", Doc_OnSelectionChange ) ;
410
- }
411
-
412
- FCKTempBin.Reset() ;
413
-
414
- // Bug #2469: SelectionData.createRange becomes undefined after the editor
415
- // iframe is changed by FCK.SetData().
416
- FCK.Selection.Release() ;
417
-
418
- if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
419
- {
420
- // Save the resetIsDirty for later use (async)
421
- this._ForceResetIsDirty = ( resetIsDirty === true ) ;
422
-
423
- // Protect parts of the code that must remain untouched (and invisible)
424
- // during editing.
425
- data = FCKConfig.ProtectedSource.Protect( data ) ;
426
-
427
- // Call the Data Processor to transform the data.
428
- data = FCK.DataProcessor.ConvertToHtml( data ) ;
429
-
430
- // Fix for invalid self-closing tags (see #152).
431
- data = data.replace( FCKRegexLib.InvalidSelfCloseTags, '$1></$2>' ) ;
432
-
433
- // Protect event attributes (they could get fired in the editing area).
434
- data = FCK.ProtectEvents( data ) ;
435
-
436
- // Protect some things from the browser itself.
437
- data = FCK.ProtectUrls( data ) ;
438
- data = FCK.ProtectTags( data ) ;
439
-
440
- // Insert the base tag (FCKConfig.BaseHref), if not exists in the source.
441
- // The base must be the first tag in the HEAD, to get relative
442
- // links on styles, for example.
443
- if ( FCK.TempBaseTag.length > 0 && !FCKRegexLib.HasBaseTag.test( data ) )
444
- data = data.replace( FCKRegexLib.HeadOpener, '$&' + FCK.TempBaseTag ) ;
445
-
446
- // Build the HTML for the additional things we need on <head>.
447
- var sHeadExtra = '' ;
448
-
449
- if ( !FCKConfig.FullPage )
450
- sHeadExtra += _FCK_GetEditorAreaStyleTags() ;
451
-
452
- if ( FCKBrowserInfo.IsIE )
453
- sHeadExtra += FCK._GetBehaviorsStyle() ;
454
- else if ( FCKConfig.ShowBorders )
455
- sHeadExtra += FCKTools.GetStyleHtml( FCK_ShowTableBordersCSS, true ) ;
456
-
457
- sHeadExtra += FCKTools.GetStyleHtml( FCK_InternalCSS, true ) ;
458
-
459
- // Attention: do not change it before testing it well (sample07)!
460
- // This is tricky... if the head ends with <meta ... content type>,
461
- // Firefox will break. But, it works if we place our extra stuff as
462
- // the last elements in the HEAD.
463
- data = data.replace( FCKRegexLib.HeadCloser, sHeadExtra + '$&' ) ;
464
-
465
- // Load the HTML in the editing area.
466
- this.EditingArea.OnLoad = _FCK_EditingArea_OnLoad ;
467
- this.EditingArea.Start( data ) ;
468
- }
469
- else
470
- {
471
- // Remove the references to the following elements, as the editing area
472
- // IFRAME will be removed.
473
- FCK.EditorWindow = null ;
474
- FCK.EditorDocument = null ;
475
- FCKDomTools.PaddingNode = null ;
476
-
477
- this.EditingArea.OnLoad = null ;
478
- this.EditingArea.Start( data ) ;
479
-
480
- // Enables the context menu in the textarea.
481
- this.EditingArea.Textarea._FCKShowContextMenu = true ;
482
-
483
- // Removes the enter key handler.
484
- FCK.EnterKeyHandler = null ;
485
-
486
- if ( resetIsDirty )
487
- this.ResetIsDirty() ;
488
-
489
- // Listen for keystroke events.
490
- FCK.KeystrokeHandler.AttachToElement( this.EditingArea.Textarea ) ;
491
-
492
- this.EditingArea.Textarea.focus() ;
493
-
494
- FCK.Events.FireEvent( 'OnAfterSetHTML' ) ;
495
- }
496
-
497
- if ( FCKBrowserInfo.IsGecko )
498
- window.onresize() ;
499
- },
500
-
501
- // This collection is used by the browser specific implementations to tell
502
- // which named commands must be handled separately.
503
- RedirectNamedCommands : new Object(),
504
-
505
- ExecuteNamedCommand : function( commandName, commandParameter, noRedirect, noSaveUndo )
506
- {
507
- if ( !noSaveUndo )
508
- FCKUndo.SaveUndoStep() ;
509
-
510
- if ( !noRedirect && FCK.RedirectNamedCommands[ commandName ] != null )
511
- FCK.ExecuteRedirectedNamedCommand( commandName, commandParameter ) ;
512
- else
513
- {
514
- FCK.Focus() ;
515
- FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ;
516
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
517
- }
518
-
519
- if ( !noSaveUndo )
520
- FCKUndo.SaveUndoStep() ;
521
- },
522
-
523
- GetNamedCommandState : function( commandName )
524
- {
525
- try
526
- {
527
-
528
- // Bug #50 : Safari never returns positive state for the Paste command, override that.
529
- if ( FCKBrowserInfo.IsSafari && FCK.EditorWindow && commandName.IEquals( 'Paste' ) )
530
- return FCK_TRISTATE_OFF ;
531
-
532
- if ( !FCK.EditorDocument.queryCommandEnabled( commandName ) )
533
- return FCK_TRISTATE_DISABLED ;
534
- else
535
- {
536
- return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ;
537
- }
538
- }
539
- catch ( e )
540
- {
541
- return FCK_TRISTATE_OFF ;
542
- }
543
- },
544
-
545
- GetNamedCommandValue : function( commandName )
546
- {
547
- var sValue = '' ;
548
- var eState = FCK.GetNamedCommandState( commandName ) ;
549
-
550
- if ( eState == FCK_TRISTATE_DISABLED )
551
- return null ;
552
-
553
- try
554
- {
555
- sValue = this.EditorDocument.queryCommandValue( commandName ) ;
556
- }
557
- catch(e) {}
558
-
559
- return sValue ? sValue : '' ;
560
- },
561
-
562
- Paste : function( _callListenersOnly )
563
- {
564
- // First call 'OnPaste' listeners.
565
- if ( FCK.Status != FCK_STATUS_COMPLETE || !FCK.Events.FireEvent( 'OnPaste' ) )
566
- return false ;
567
-
568
- // Then call the default implementation.
569
- return _callListenersOnly || FCK._ExecPaste() ;
570
- },
571
-
572
- PasteFromWord : function()
573
- {
574
- FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteFromWord, 'dialog/fck_paste.html', 400, 330, 'Word' ) ;
575
- },
576
-
577
- Preview : function()
578
- {
579
- var sHTML ;
580
-
581
- if ( FCKConfig.FullPage )
582
- {
583
- if ( FCK.TempBaseTag.length > 0 )
584
- sHTML = FCK.TempBaseTag + FCK.GetXHTML() ;
585
- else
586
- sHTML = FCK.GetXHTML() ;
587
- }
588
- else
589
- {
590
- sHTML =
591
- FCKConfig.DocType +
592
- '<html dir="' + FCKConfig.ContentLangDirection + '">' +
593
- '<head>' +
594
- FCK.TempBaseTag +
595
- '<title>' + FCKLang.Preview + '</title>' +
596
- _FCK_GetEditorAreaStyleTags() +
597
- '</head><body' + FCKConfig.GetBodyAttributes() + '>' +
598
- FCK.GetXHTML() +
599
- '</body></html>' ;
600
- }
601
-
602
- var iWidth = FCKConfig.ScreenWidth * 0.8 ;
603
- var iHeight = FCKConfig.ScreenHeight * 0.7 ;
604
- var iLeft = ( FCKConfig.ScreenWidth - iWidth ) / 2 ;
605
-
606
- var sOpenUrl = '' ;
607
- if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE)
608
- {
609
- window._FCKHtmlToLoad = sHTML ;
610
- sOpenUrl = 'javascript:void( (function(){' +
611
- 'document.open() ;' +
612
- 'document.domain="' + document.domain + '" ;' +
613
- 'document.write( window.opener._FCKHtmlToLoad );' +
614
- 'document.close() ;' +
615
- 'window.opener._FCKHtmlToLoad = null ;' +
616
- '})() )' ;
617
- }
618
-
619
- var oWindow = window.open( sOpenUrl, null, 'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + iWidth + ',height=' + iHeight + ',left=' + iLeft ) ;
620
-
621
- if ( !FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE)
622
- {
623
- oWindow.document.write( sHTML );
624
- oWindow.document.close();
625
- }
626
-
627
- },
628
-
629
- SwitchEditMode : function( noUndo )
630
- {
631
- var bIsWysiwyg = ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) ;
632
-
633
- // Save the current IsDirty state, so we may restore it after the switch.
634
- var bIsDirty = FCK.IsDirty() ;
635
-
636
- var sHtml ;
637
-
638
- // Update the HTML in the view output to show, also update
639
- // FCKTempBin for IE to avoid #2263.
640
- if ( bIsWysiwyg )
641
- {
642
- FCKCommands.GetCommand( 'ShowBlocks' ).SaveState() ;
643
- if ( !noUndo && FCKBrowserInfo.IsIE )
644
- FCKUndo.SaveUndoStep() ;
645
-
646
- sHtml = FCK.GetXHTML( FCKConfig.FormatSource ) ;
647
-
648
- if ( FCKBrowserInfo.IsIE )
649
- FCKTempBin.ToHtml() ;
650
-
651
- if ( sHtml == null )
652
- return false ;
653
- }
654
- else
655
- sHtml = this.EditingArea.Textarea.value ;
656
-
657
- FCK.EditMode = bIsWysiwyg ? FCK_EDITMODE_SOURCE : FCK_EDITMODE_WYSIWYG ;
658
-
659
- FCK.SetData( sHtml, !bIsDirty ) ;
660
-
661
- // Set the Focus.
662
- FCK.Focus() ;
663
-
664
- // Update the toolbar (Running it directly causes IE to fail).
665
- FCKTools.RunFunction( FCK.ToolbarSet.RefreshModeState, FCK.ToolbarSet ) ;
666
-
667
- return true ;
668
- },
669
-
670
- InsertElement : function( element )
671
- {
672
- // The parameter may be a string (element name), so transform it in an element.
673
- if ( typeof element == 'string' )
674
- element = this.EditorDocument.createElement( element ) ;
675
-
676
- var elementName = element.nodeName.toLowerCase() ;
677
-
678
- FCKSelection.Restore() ;
679
-
680
- // Create a range for the selection. V3 will have a new selection
681
- // object that may internally supply this feature.
682
- var range = new FCKDomRange( this.EditorWindow ) ;
683
-
684
- // Move to the selection and delete it.
685
- range.MoveToSelection() ;
686
- range.DeleteContents() ;
687
-
688
- if ( FCKListsLib.BlockElements[ elementName ] != null )
689
- {
690
- if ( range.StartBlock )
691
- {
692
- if ( range.CheckStartOfBlock() )
693
- range.MoveToPosition( range.StartBlock, 3 ) ;
694
- else if ( range.CheckEndOfBlock() )
695
- range.MoveToPosition( range.StartBlock, 4 ) ;
696
- else
697
- range.SplitBlock() ;
698
- }
699
-
700
- range.InsertNode( element ) ;
701
-
702
- var next = FCKDomTools.GetNextSourceElement( element, false, null, [ 'hr','br','param','img','area','input' ], true ) ;
703
-
704
- // Be sure that we have something after the new element, so we can move the cursor there.
705
- if ( !next && FCKConfig.EnterMode != 'br')
706
- {
707
- next = this.EditorDocument.body.appendChild( this.EditorDocument.createElement( FCKConfig.EnterMode ) ) ;
708
-
709
- if ( FCKBrowserInfo.IsGeckoLike )
710
- FCKTools.AppendBogusBr( next ) ;
711
- }
712
-
713
- if ( FCKListsLib.EmptyElements[ elementName ] == null )
714
- range.MoveToElementEditStart( element ) ;
715
- else if ( next )
716
- range.MoveToElementEditStart( next ) ;
717
- else
718
- range.MoveToPosition( element, 4 ) ;
719
-
720
- if ( FCKBrowserInfo.IsGeckoLike )
721
- {
722
- if ( next )
723
- FCKDomTools.ScrollIntoView( next, false );
724
- FCKDomTools.ScrollIntoView( element, false );
725
- }
726
- }
727
- else
728
- {
729
- // Insert the node.
730
- range.InsertNode( element ) ;
731
-
732
- // Move the selection right after the new element.
733
- // DISCUSSION: Should we select the element instead?
734
- range.SetStart( element, 4 ) ;
735
- range.SetEnd( element, 4 ) ;
736
- }
737
-
738
- range.Select() ;
739
- range.Release() ;
740
-
741
- // REMOVE IT: The focus should not really be set here. It is up to the
742
- // calling code to reset the focus if needed.
743
- this.Focus() ;
744
-
745
- return element ;
746
- },
747
-
748
- _InsertBlockElement : function( blockElement )
749
- {
750
- },
751
-
752
- _IsFunctionKey : function( keyCode )
753
- {
754
- // keys that are captured but do not change editor contents
755
- if ( keyCode >= 16 && keyCode <= 20 )
756
- // shift, ctrl, alt, pause, capslock
757
- return true ;
758
- if ( keyCode == 27 || ( keyCode >= 33 && keyCode <= 40 ) )
759
- // esc, page up, page down, end, home, left, up, right, down
760
- return true ;
761
- if ( keyCode == 45 )
762
- // insert, no effect on FCKeditor, yet
763
- return true ;
764
- return false ;
765
- },
766
-
767
- _KeyDownListener : function( evt )
768
- {
769
- if (! evt)
770
- evt = FCK.EditorWindow.event ;
771
- if ( FCK.EditorWindow )
772
- {
773
- if ( !FCK._IsFunctionKey(evt.keyCode) // do not capture function key presses, like arrow keys or shift/alt/ctrl
774
- && !(evt.ctrlKey || evt.metaKey) // do not capture Ctrl hotkeys, as they have their snapshot capture logic
775
- && !(evt.keyCode == 46) ) // do not capture Del, it has its own capture logic in fckenterkey.js
776
- FCK._KeyDownUndo() ;
777
- }
778
- return true ;
779
- },
780
-
781
- _KeyDownUndo : function()
782
- {
783
- if ( !FCKUndo.Typing )
784
- {
785
- FCKUndo.SaveUndoStep() ;
786
- FCKUndo.Typing = true ;
787
- FCK.Events.FireEvent( "OnSelectionChange" ) ;
788
- }
789
-
790
- FCKUndo.TypesCount++ ;
791
- FCKUndo.Changed = 1 ;
792
-
793
- if ( FCKUndo.TypesCount > FCKUndo.MaxTypes )
794
- {
795
- FCKUndo.TypesCount = 0 ;
796
- FCKUndo.SaveUndoStep() ;
797
- }
798
- },
799
-
800
- _TabKeyHandler : function( evt )
801
- {
802
- if ( ! evt )
803
- evt = window.event ;
804
-
805
- var keystrokeValue = evt.keyCode ;
806
-
807
- // Pressing <Tab> in source mode should produce a tab space in the text area, not
808
- // changing the focus to something else.
809
- if ( keystrokeValue == 9 && FCK.EditMode != FCK_EDITMODE_WYSIWYG )
810
- {
811
- if ( FCKBrowserInfo.IsIE )
812
- {
813
- var range = document.selection.createRange() ;
814
- if ( range.parentElement() != FCK.EditingArea.Textarea )
815
- return true ;
816
- range.text = '\t' ;
817
- range.select() ;
818
- }
819
- else
820
- {
821
- var a = [] ;
822
- var el = FCK.EditingArea.Textarea ;
823
- var selStart = el.selectionStart ;
824
- var selEnd = el.selectionEnd ;
825
- a.push( el.value.substr(0, selStart ) ) ;
826
- a.push( '\t' ) ;
827
- a.push( el.value.substr( selEnd ) ) ;
828
- el.value = a.join( '' ) ;
829
- el.setSelectionRange( selStart + 1, selStart + 1 ) ;
830
- }
831
-
832
- if ( evt.preventDefault )
833
- return evt.preventDefault() ;
834
-
835
- return evt.returnValue = false ;
836
- }
837
-
838
- return true ;
839
- }
840
- } ;
841
-
842
- FCK.Events = new FCKEvents( FCK ) ;
843
-
844
- // DEPRECATED in favor or "GetData".
845
- FCK.GetHTML = FCK.GetXHTML = FCK.GetData ;
846
-
847
- // DEPRECATED in favor of "SetData".
848
- FCK.SetHTML = FCK.SetData ;
849
-
850
- // InsertElementAndGetIt and CreateElement are Deprecated : returns the same value as InsertElement.
851
- FCK.InsertElementAndGetIt = FCK.CreateElement = FCK.InsertElement ;
852
-
853
- // Replace all events attributes (like onclick).
854
- function _FCK_ProtectEvents_ReplaceTags( tagMatch )
855
- {
856
- return tagMatch.replace( FCKRegexLib.EventAttributes, _FCK_ProtectEvents_ReplaceEvents ) ;
857
- }
858
-
859
- // Replace an event attribute with its respective __fckprotectedatt attribute.
860
- // The original event markup will be encoded and saved as the value of the new
861
- // attribute.
862
- function _FCK_ProtectEvents_ReplaceEvents( eventMatch, attName )
863
- {
864
- return ' ' + attName + '_fckprotectedatt="' + encodeURIComponent( eventMatch ) + '"' ;
865
- }
866
-
867
- function _FCK_ProtectEvents_RestoreEvents( match, encodedOriginal )
868
- {
869
- return decodeURIComponent( encodedOriginal ) ;
870
- }
871
-
872
- function _FCK_MouseEventsListener( evt )
873
- {
874
- if ( ! evt )
875
- evt = window.event ;
876
- if ( evt.type == 'mousedown' )
877
- FCK.MouseDownFlag = true ;
878
- else if ( evt.type == 'mouseup' )
879
- FCK.MouseDownFlag = false ;
880
- else if ( evt.type == 'mousemove' )
881
- FCK.Events.FireEvent( 'OnMouseMove', evt ) ;
882
- }
883
-
884
- function _FCK_PaddingNodeListener()
885
- {
886
- if ( FCKConfig.EnterMode.IEquals( 'br' ) )
887
- return ;
888
- FCKDomTools.EnforcePaddingNode( FCK.EditorDocument, FCKConfig.EnterMode ) ;
889
-
890
- if ( ! FCKBrowserInfo.IsIE && FCKDomTools.PaddingNode )
891
- {
892
- // Prevent the caret from going between the body and the padding node in Firefox.
893
- // i.e. <body>|<p></p></body>
894
- var sel = FCKSelection.GetSelection() ;
895
- if ( sel && sel.rangeCount == 1 )
896
- {
897
- var range = sel.getRangeAt( 0 ) ;
898
- if ( range.collapsed && range.startContainer == FCK.EditorDocument.body && range.startOffset == 0 )
899
- {
900
- range.selectNodeContents( FCKDomTools.PaddingNode ) ;
901
- range.collapse( true ) ;
902
- sel.removeAllRanges() ;
903
- sel.addRange( range ) ;
904
- }
905
- }
906
- }
907
- else if ( FCKDomTools.PaddingNode )
908
- {
909
- // Prevent the caret from going into an empty body but not into the padding node in IE.
910
- // i.e. <body><p></p>|</body>
911
- var parentElement = FCKSelection.GetParentElement() ;
912
- var paddingNode = FCKDomTools.PaddingNode ;
913
- if ( parentElement && parentElement.nodeName.IEquals( 'body' ) )
914
- {
915
- if ( FCK.EditorDocument.body.childNodes.length == 1
916
- && FCK.EditorDocument.body.firstChild == paddingNode )
917
- {
918
- /*
919
- * Bug #1764: Don't move the selection if the
920
- * current selection isn't in the editor
921
- * document.
922
- */
923
- if ( FCKSelection._GetSelectionDocument( FCK.EditorDocument.selection ) != FCK.EditorDocument )
924
- return ;
925
-
926
- var range = FCK.EditorDocument.body.createTextRange() ;
927
- var clearContents = false ;
928
- if ( !paddingNode.childNodes.firstChild )
929
- {
930
- paddingNode.appendChild( FCKTools.GetElementDocument( paddingNode ).createTextNode( '\ufeff' ) ) ;
931
- clearContents = true ;
932
- }
933
- range.moveToElementText( paddingNode ) ;
934
- range.select() ;
935
- if ( clearContents )
936
- range.pasteHTML( '' ) ;
937
- }
938
- }
939
- }
940
- }
941
-
942
- function _FCK_EditingArea_OnLoad()
943
- {
944
- // Get the editor's window and document (DOM)
945
- FCK.EditorWindow = FCK.EditingArea.Window ;
946
- FCK.EditorDocument = FCK.EditingArea.Document ;
947
-
948
- if ( FCKBrowserInfo.IsIE )
949
- FCKTempBin.ToElements() ;
950
-
951
- FCK.InitializeBehaviors() ;
952
-
953
- // Listen for mousedown and mouseup events for tracking drag and drops.
954
- FCK.MouseDownFlag = false ;
955
- FCKTools.AddEventListener( FCK.EditorDocument, 'mousemove', _FCK_MouseEventsListener ) ;
956
- FCKTools.AddEventListener( FCK.EditorDocument, 'mousedown', _FCK_MouseEventsListener ) ;
957
- FCKTools.AddEventListener( FCK.EditorDocument, 'mouseup', _FCK_MouseEventsListener ) ;
958
-
959
- // Most of the CTRL key combos do not work under Safari for onkeydown and onkeypress (See #1119)
960
- // But we can use the keyup event to override some of these...
961
- if ( FCKBrowserInfo.IsSafari )
962
- {
963
- var undoFunc = function( evt )
964
- {
965
- if ( ! ( evt.ctrlKey || evt.metaKey ) )
966
- return ;
967
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
968
- return ;
969
- switch ( evt.keyCode )
970
- {
971
- case 89:
972
- FCKUndo.Redo() ;
973
- break ;
974
- case 90:
975
- FCKUndo.Undo() ;
976
- break ;
977
- }
978
- }
979
-
980
- FCKTools.AddEventListener( FCK.EditorDocument, 'keyup', undoFunc ) ;
981
- }
982
-
983
- // Create the enter key handler
984
- FCK.EnterKeyHandler = new FCKEnterKey( FCK.EditorWindow, FCKConfig.EnterMode, FCKConfig.ShiftEnterMode, FCKConfig.TabSpaces ) ;
985
-
986
- // Listen for keystroke events.
987
- FCK.KeystrokeHandler.AttachToElement( FCK.EditorDocument ) ;
988
-
989
- if ( FCK._ForceResetIsDirty )
990
- FCK.ResetIsDirty() ;
991
-
992
- // This is a tricky thing for IE. In some cases, even if the cursor is
993
- // blinking in the editing, the keystroke handler doesn't catch keyboard
994
- // events. We must activate the editing area to make it work. (#142).
995
- if ( FCKBrowserInfo.IsIE && FCK.HasFocus )
996
- FCK.EditorDocument.body.setActive() ;
997
-
998
- FCK.OnAfterSetHTML() ;
999
-
1000
- // Restore show blocks status.
1001
- FCKCommands.GetCommand( 'ShowBlocks' ).RestoreState() ;
1002
-
1003
- // Check if it is not a startup call, otherwise complete the startup.
1004
- if ( FCK.Status != FCK_STATUS_NOTLOADED )
1005
- return ;
1006
-
1007
- FCK.SetStatus( FCK_STATUS_ACTIVE ) ;
1008
- }
1009
-
1010
- function _FCK_GetEditorAreaStyleTags()
1011
- {
1012
- return FCKTools.GetStyleHtml( FCKConfig.EditorAreaCSS ) +
1013
- FCKTools.GetStyleHtml( FCKConfig.EditorAreaStyles ) ;
1014
- }
1015
-
1016
- function _FCK_KeystrokeHandler_OnKeystroke( keystroke, keystrokeValue )
1017
- {
1018
- if ( FCK.Status != FCK_STATUS_COMPLETE )
1019
- return false ;
1020
-
1021
- if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
1022
- {
1023
- switch ( keystrokeValue )
1024
- {
1025
- case 'Paste' :
1026
- return !FCK.Paste() ;
1027
-
1028
- case 'Cut' :
1029
- FCKUndo.SaveUndoStep() ;
1030
- return false ;
1031
- }
1032
- }
1033
- else
1034
- {
1035
- // In source mode, some actions must have their default behavior.
1036
- if ( keystrokeValue.Equals( 'Paste', 'Undo', 'Redo', 'SelectAll', 'Cut' ) )
1037
- return false ;
1038
- }
1039
-
1040
- // The return value indicates if the default behavior of the keystroke must
1041
- // be cancelled. Let's do that only if the Execute() call explicitly returns "false".
1042
- var oCommand = FCK.Commands.GetCommand( keystrokeValue ) ;
1043
-
1044
- // If the command is disabled then ignore the keystroke
1045
- if ( oCommand.GetState() == FCK_TRISTATE_DISABLED )
1046
- return false ;
1047
-
1048
- return ( oCommand.Execute.apply( oCommand, FCKTools.ArgumentsToArray( arguments, 2 ) ) !== false ) ;
1049
- }
1050
-
1051
- // Set the FCK.LinkedField reference to the field that will be used to post the
1052
- // editor data.
1053
- (function()
1054
- {
1055
- // There is a bug on IE... getElementById returns any META tag that has the
1056
- // name set to the ID you are looking for. So the best way in to get the array
1057
- // by names and look for the correct one.
1058
- // As ASP.Net generates a ID that is different from the Name, we must also
1059
- // look for the field based on the ID (the first one is the ID).
1060
-
1061
- var oDocument = window.parent.document ;
1062
-
1063
- // Try to get the field using the ID.
1064
- var eLinkedField = oDocument.getElementById( FCK.Name ) ;
1065
-
1066
- var i = 0;
1067
- while ( eLinkedField || i == 0 )
1068
- {
1069
- if ( eLinkedField && eLinkedField.tagName.toLowerCase().Equals( 'input', 'textarea' ) )
1070
- {
1071
- FCK.LinkedField = eLinkedField ;
1072
- break ;
1073
- }
1074
-
1075
- eLinkedField = oDocument.getElementsByName( FCK.Name )[i++] ;
1076
- }
1077
- })() ;
1078
-
1079
- var FCKTempBin =
1080
- {
1081
- Elements : new Array(),
1082
-
1083
- AddElement : function( element )
1084
- {
1085
- var iIndex = this.Elements.length ;
1086
- this.Elements[ iIndex ] = element ;
1087
- return iIndex ;
1088
- },
1089
-
1090
- RemoveElement : function( index )
1091
- {
1092
- var e = this.Elements[ index ] ;
1093
- this.Elements[ index ] = null ;
1094
- return e ;
1095
- },
1096
-
1097
- Reset : function()
1098
- {
1099
- var i = 0 ;
1100
- while ( i < this.Elements.length )
1101
- this.Elements[ i++ ] = null ;
1102
- this.Elements.length = 0 ;
1103
- },
1104
-
1105
- ToHtml : function()
1106
- {
1107
- for ( var i = 0 ; i < this.Elements.length ; i++ )
1108
- {
1109
- this.Elements[i] = '<div>&nbsp;' + this.Elements[i].outerHTML + '</div>' ;
1110
- this.Elements[i].isHtml = true ;
1111
- }
1112
- },
1113
-
1114
- ToElements : function()
1115
- {
1116
- var node = FCK.EditorDocument.createElement( 'div' ) ;
1117
- for ( var i = 0 ; i < this.Elements.length ; i++ )
1118
- {
1119
- if ( this.Elements[i].isHtml )
1120
- {
1121
- node.innerHTML = this.Elements[i] ;
1122
- this.Elements[i] = node.firstChild.removeChild( node.firstChild.lastChild ) ;
1123
- }
1124
- }
1125
- }
1126
- } ;
1127
-
1128
-
1129
-
1130
- // # Focus Manager: Manages the focus in the editor.
1131
- var FCKFocusManager = FCK.FocusManager =
1132
- {
1133
- IsLocked : false,
1134
-
1135
- AddWindow : function( win, sendToEditingArea )
1136
- {
1137
- var oTarget ;
1138
-
1139
- if ( FCKBrowserInfo.IsIE )
1140
- oTarget = win.nodeType == 1 ? win : win.frameElement ? win.frameElement : win.document ;
1141
- else if ( FCKBrowserInfo.IsSafari )
1142
- oTarget = win ;
1143
- else
1144
- oTarget = win.document ;
1145
-
1146
- FCKTools.AddEventListener( oTarget, 'blur', FCKFocusManager_Win_OnBlur ) ;
1147
- FCKTools.AddEventListener( oTarget, 'focus', sendToEditingArea ? FCKFocusManager_Win_OnFocus_Area : FCKFocusManager_Win_OnFocus ) ;
1148
- },
1149
-
1150
- RemoveWindow : function( win )
1151
- {
1152
- if ( FCKBrowserInfo.IsIE )
1153
- oTarget = win.nodeType == 1 ? win : win.frameElement ? win.frameElement : win.document ;
1154
- else
1155
- oTarget = win.document ;
1156
-
1157
- FCKTools.RemoveEventListener( oTarget, 'blur', FCKFocusManager_Win_OnBlur ) ;
1158
- FCKTools.RemoveEventListener( oTarget, 'focus', FCKFocusManager_Win_OnFocus_Area ) ;
1159
- FCKTools.RemoveEventListener( oTarget, 'focus', FCKFocusManager_Win_OnFocus ) ;
1160
- },
1161
-
1162
- Lock : function()
1163
- {
1164
- this.IsLocked = true ;
1165
- },
1166
-
1167
- Unlock : function()
1168
- {
1169
- if ( this._HasPendingBlur )
1170
- FCKFocusManager._Timer = window.setTimeout( FCKFocusManager_FireOnBlur, 100 ) ;
1171
-
1172
- this.IsLocked = false ;
1173
- },
1174
-
1175
- _ResetTimer : function()
1176
- {
1177
- this._HasPendingBlur = false ;
1178
-
1179
- if ( this._Timer )
1180
- {
1181
- window.clearTimeout( this._Timer ) ;
1182
- delete this._Timer ;
1183
- }
1184
- }
1185
- } ;
1186
-
1187
- function FCKFocusManager_Win_OnBlur()
1188
- {
1189
- if ( typeof(FCK) != 'undefined' && FCK.HasFocus )
1190
- {
1191
- FCKFocusManager._ResetTimer() ;
1192
- FCKFocusManager._Timer = window.setTimeout( FCKFocusManager_FireOnBlur, 100 ) ;
1193
- }
1194
- }
1195
-
1196
- function FCKFocusManager_FireOnBlur()
1197
- {
1198
- if ( FCKFocusManager.IsLocked )
1199
- FCKFocusManager._HasPendingBlur = true ;
1200
- else
1201
- {
1202
- FCK.HasFocus = false ;
1203
- FCK.Events.FireEvent( "OnBlur" ) ;
1204
- }
1205
- }
1206
-
1207
- function FCKFocusManager_Win_OnFocus_Area()
1208
- {
1209
- // Check if we are already focusing the editor (to avoid loops).
1210
- if ( FCKFocusManager._IsFocusing )
1211
- return ;
1212
-
1213
- FCKFocusManager._IsFocusing = true ;
1214
-
1215
- FCK.Focus() ;
1216
- FCKFocusManager_Win_OnFocus() ;
1217
-
1218
- // The above FCK.Focus() call may trigger other focus related functions.
1219
- // So, to avoid a loop, we delay the focusing mark removal, so it get
1220
- // executed after all othre functions have been run.
1221
- FCKTools.RunFunction( function()
1222
- {
1223
- delete FCKFocusManager._IsFocusing ;
1224
- } ) ;
1225
- }
1226
-
1227
- function FCKFocusManager_Win_OnFocus()
1228
- {
1229
- FCKFocusManager._ResetTimer() ;
1230
-
1231
- if ( !FCK.HasFocus && !FCKFocusManager.IsLocked )
1232
- {
1233
- FCK.HasFocus = true ;
1234
- FCK.Events.FireEvent( "OnFocus" ) ;
1235
- }
1236
- }
1237
-
1238
- /*
1239
- * #1633 : Protect the editor iframe from external styles.
1240
- * Notice that we can't use FCKTools.ResetStyles here since FCKTools isn't
1241
- * loaded yet.
1242
- */
1243
- (function()
1244
- {
1245
- var el = window.frameElement ;
1246
- var width = el.width ;
1247
- var height = el.height ;
1248
- if ( /^\d+$/.test( width ) ) width += 'px' ;
1249
- if ( /^\d+$/.test( height ) ) height += 'px' ;
1250
- var style = el.style ;
1251
- style.border = style.padding = style.margin = 0 ;
1252
- style.backgroundColor = 'transparent';
1253
- style.backgroundImage = 'none';
1254
- style.width = width ;
1255
- style.height = height ;
1256
- })() ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fck_contextmenu.js DELETED
@@ -1,345 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Defines the FCK.ContextMenu object that is responsible for all
22
- * Context Menu operations in the editing area.
23
- */
24
-
25
- FCK.ContextMenu = new Object() ;
26
- FCK.ContextMenu.Listeners = new Array() ;
27
-
28
- FCK.ContextMenu.RegisterListener = function( listener )
29
- {
30
- if ( listener )
31
- this.Listeners.push( listener ) ;
32
- }
33
-
34
- function FCK_ContextMenu_Init()
35
- {
36
- var oInnerContextMenu = FCK.ContextMenu._InnerContextMenu = new FCKContextMenu( FCKBrowserInfo.IsIE ? window : window.parent, FCKLang.Dir ) ;
37
- oInnerContextMenu.CtrlDisable = FCKConfig.BrowserContextMenuOnCtrl ;
38
- oInnerContextMenu.OnBeforeOpen = FCK_ContextMenu_OnBeforeOpen ;
39
- oInnerContextMenu.OnItemClick = FCK_ContextMenu_OnItemClick ;
40
-
41
- // Get the registering function.
42
- var oMenu = FCK.ContextMenu ;
43
-
44
- // Register all configured context menu listeners.
45
- for ( var i = 0 ; i < FCKConfig.ContextMenu.length ; i++ )
46
- oMenu.RegisterListener( FCK_ContextMenu_GetListener( FCKConfig.ContextMenu[i] ) ) ;
47
- }
48
-
49
- function FCK_ContextMenu_GetListener( listenerName )
50
- {
51
- switch ( listenerName )
52
- {
53
- case 'Generic' :
54
- return {
55
- AddItems : function( menu, tag, tagName )
56
- {
57
- menu.AddItem( 'Cut' , FCKLang.Cut , 7, FCKCommands.GetCommand( 'Cut' ).GetState() == FCK_TRISTATE_DISABLED ) ;
58
- menu.AddItem( 'Copy' , FCKLang.Copy , 8, FCKCommands.GetCommand( 'Copy' ).GetState() == FCK_TRISTATE_DISABLED ) ;
59
- menu.AddItem( 'Paste' , FCKLang.Paste , 9, FCKCommands.GetCommand( 'Paste' ).GetState() == FCK_TRISTATE_DISABLED ) ;
60
- }} ;
61
-
62
- case 'Table' :
63
- return {
64
- AddItems : function( menu, tag, tagName )
65
- {
66
- var bIsTable = ( tagName == 'TABLE' ) ;
67
- var bIsCell = ( !bIsTable && FCKSelection.HasAncestorNode( 'TABLE' ) ) ;
68
-
69
- if ( bIsCell )
70
- {
71
- menu.AddSeparator() ;
72
- var oItem = menu.AddItem( 'Cell' , FCKLang.CellCM ) ;
73
- oItem.AddItem( 'TableInsertCellBefore' , FCKLang.InsertCellBefore, 69 ) ;
74
- oItem.AddItem( 'TableInsertCellAfter' , FCKLang.InsertCellAfter, 58 ) ;
75
- oItem.AddItem( 'TableDeleteCells' , FCKLang.DeleteCells, 59 ) ;
76
- if ( FCKBrowserInfo.IsGecko )
77
- oItem.AddItem( 'TableMergeCells' , FCKLang.MergeCells, 60,
78
- FCKCommands.GetCommand( 'TableMergeCells' ).GetState() == FCK_TRISTATE_DISABLED ) ;
79
- else
80
- {
81
- oItem.AddItem( 'TableMergeRight' , FCKLang.MergeRight, 60,
82
- FCKCommands.GetCommand( 'TableMergeRight' ).GetState() == FCK_TRISTATE_DISABLED ) ;
83
- oItem.AddItem( 'TableMergeDown' , FCKLang.MergeDown, 60,
84
- FCKCommands.GetCommand( 'TableMergeDown' ).GetState() == FCK_TRISTATE_DISABLED ) ;
85
- }
86
- oItem.AddItem( 'TableHorizontalSplitCell' , FCKLang.HorizontalSplitCell, 61,
87
- FCKCommands.GetCommand( 'TableHorizontalSplitCell' ).GetState() == FCK_TRISTATE_DISABLED ) ;
88
- oItem.AddItem( 'TableVerticalSplitCell' , FCKLang.VerticalSplitCell, 61,
89
- FCKCommands.GetCommand( 'TableVerticalSplitCell' ).GetState() == FCK_TRISTATE_DISABLED ) ;
90
- oItem.AddSeparator() ;
91
- oItem.AddItem( 'TableCellProp' , FCKLang.CellProperties, 57,
92
- FCKCommands.GetCommand( 'TableCellProp' ).GetState() == FCK_TRISTATE_DISABLED ) ;
93
-
94
- menu.AddSeparator() ;
95
- oItem = menu.AddItem( 'Row' , FCKLang.RowCM ) ;
96
- oItem.AddItem( 'TableInsertRowBefore' , FCKLang.InsertRowBefore, 70 ) ;
97
- oItem.AddItem( 'TableInsertRowAfter' , FCKLang.InsertRowAfter, 62 ) ;
98
- oItem.AddItem( 'TableDeleteRows' , FCKLang.DeleteRows, 63 ) ;
99
-
100
- menu.AddSeparator() ;
101
- oItem = menu.AddItem( 'Column' , FCKLang.ColumnCM ) ;
102
- oItem.AddItem( 'TableInsertColumnBefore', FCKLang.InsertColumnBefore, 71 ) ;
103
- oItem.AddItem( 'TableInsertColumnAfter' , FCKLang.InsertColumnAfter, 64 ) ;
104
- oItem.AddItem( 'TableDeleteColumns' , FCKLang.DeleteColumns, 65 ) ;
105
- }
106
-
107
- if ( bIsTable || bIsCell )
108
- {
109
- menu.AddSeparator() ;
110
- menu.AddItem( 'TableDelete' , FCKLang.TableDelete ) ;
111
- menu.AddItem( 'TableProp' , FCKLang.TableProperties, 39 ) ;
112
- }
113
- }} ;
114
-
115
- case 'Link' :
116
- return {
117
- AddItems : function( menu, tag, tagName )
118
- {
119
- var bInsideLink = ( tagName == 'A' || FCKSelection.HasAncestorNode( 'A' ) ) ;
120
-
121
- if ( bInsideLink || FCK.GetNamedCommandState( 'Unlink' ) != FCK_TRISTATE_DISABLED )
122
- {
123
- // Go up to the anchor to test its properties
124
- var oLink = FCKSelection.MoveToAncestorNode( 'A' ) ;
125
- var bIsAnchor = ( oLink && oLink.name.length > 0 && oLink.href.length == 0 ) ;
126
- // If it isn't a link then don't add the Link context menu
127
- if ( bIsAnchor )
128
- return ;
129
-
130
- menu.AddSeparator() ;
131
- menu.AddItem( 'VisitLink', FCKLang.VisitLink ) ;
132
- menu.AddSeparator() ;
133
- if ( bInsideLink )
134
- menu.AddItem( 'Link', FCKLang.EditLink , 34 ) ;
135
- menu.AddItem( 'Unlink' , FCKLang.RemoveLink , 35 ) ;
136
- }
137
- }} ;
138
-
139
- case 'Image' :
140
- return {
141
- AddItems : function( menu, tag, tagName )
142
- {
143
- if ( tagName == 'IMG' && !tag.getAttribute( '_fckfakelement' ) )
144
- {
145
- menu.AddSeparator() ;
146
- menu.AddItem( 'Image', FCKLang.ImageProperties, 37 ) ;
147
- }
148
- }} ;
149
-
150
- case 'Anchor' :
151
- return {
152
- AddItems : function( menu, tag, tagName )
153
- {
154
- // Go up to the anchor to test its properties
155
- var oLink = FCKSelection.MoveToAncestorNode( 'A' ) ;
156
- var bIsAnchor = ( oLink && oLink.name.length > 0 ) ;
157
-
158
- if ( bIsAnchor || ( tagName == 'IMG' && tag.getAttribute( '_fckanchor' ) ) )
159
- {
160
- menu.AddSeparator() ;
161
- menu.AddItem( 'Anchor', FCKLang.AnchorProp, 36 ) ;
162
- menu.AddItem( 'AnchorDelete', FCKLang.AnchorDelete ) ;
163
- }
164
- }} ;
165
-
166
- case 'Flash' :
167
- return {
168
- AddItems : function( menu, tag, tagName )
169
- {
170
- if ( tagName == 'IMG' && tag.getAttribute( '_fckflash' ) )
171
- {
172
- menu.AddSeparator() ;
173
- menu.AddItem( 'Flash', FCKLang.FlashProperties, 38 ) ;
174
- }
175
- }} ;
176
-
177
- case 'Form' :
178
- return {
179
- AddItems : function( menu, tag, tagName )
180
- {
181
- if ( FCKSelection.HasAncestorNode('FORM') )
182
- {
183
- menu.AddSeparator() ;
184
- menu.AddItem( 'Form', FCKLang.FormProp, 48 ) ;
185
- }
186
- }} ;
187
-
188
- case 'Checkbox' :
189
- return {
190
- AddItems : function( menu, tag, tagName )
191
- {
192
- if ( tagName == 'INPUT' && tag.type == 'checkbox' )
193
- {
194
- menu.AddSeparator() ;
195
- menu.AddItem( 'Checkbox', FCKLang.CheckboxProp, 49 ) ;
196
- }
197
- }} ;
198
-
199
- case 'Radio' :
200
- return {
201
- AddItems : function( menu, tag, tagName )
202
- {
203
- if ( tagName == 'INPUT' && tag.type == 'radio' )
204
- {
205
- menu.AddSeparator() ;
206
- menu.AddItem( 'Radio', FCKLang.RadioButtonProp, 50 ) ;
207
- }
208
- }} ;
209
-
210
- case 'TextField' :
211
- return {
212
- AddItems : function( menu, tag, tagName )
213
- {
214
- if ( tagName == 'INPUT' && ( tag.type == 'text' || tag.type == 'password' ) )
215
- {
216
- menu.AddSeparator() ;
217
- menu.AddItem( 'TextField', FCKLang.TextFieldProp, 51 ) ;
218
- }
219
- }} ;
220
-
221
- case 'HiddenField' :
222
- return {
223
- AddItems : function( menu, tag, tagName )
224
- {
225
- if ( tagName == 'IMG' && tag.getAttribute( '_fckinputhidden' ) )
226
- {
227
- menu.AddSeparator() ;
228
- menu.AddItem( 'HiddenField', FCKLang.HiddenFieldProp, 56 ) ;
229
- }
230
- }} ;
231
-
232
- case 'ImageButton' :
233
- return {
234
- AddItems : function( menu, tag, tagName )
235
- {
236
- if ( tagName == 'INPUT' && tag.type == 'image' )
237
- {
238
- menu.AddSeparator() ;
239
- menu.AddItem( 'ImageButton', FCKLang.ImageButtonProp, 55 ) ;
240
- }
241
- }} ;
242
-
243
- case 'Button' :
244
- return {
245
- AddItems : function( menu, tag, tagName )
246
- {
247
- if ( tagName == 'INPUT' && ( tag.type == 'button' || tag.type == 'submit' || tag.type == 'reset' ) )
248
- {
249
- menu.AddSeparator() ;
250
- menu.AddItem( 'Button', FCKLang.ButtonProp, 54 ) ;
251
- }
252
- }} ;
253
-
254
- case 'Select' :
255
- return {
256
- AddItems : function( menu, tag, tagName )
257
- {
258
- if ( tagName == 'SELECT' )
259
- {
260
- menu.AddSeparator() ;
261
- menu.AddItem( 'Select', FCKLang.SelectionFieldProp, 53 ) ;
262
- }
263
- }} ;
264
-
265
- case 'Textarea' :
266
- return {
267
- AddItems : function( menu, tag, tagName )
268
- {
269
- if ( tagName == 'TEXTAREA' )
270
- {
271
- menu.AddSeparator() ;
272
- menu.AddItem( 'Textarea', FCKLang.TextareaProp, 52 ) ;
273
- }
274
- }} ;
275
-
276
- case 'BulletedList' :
277
- return {
278
- AddItems : function( menu, tag, tagName )
279
- {
280
- if ( FCKSelection.HasAncestorNode('UL') )
281
- {
282
- menu.AddSeparator() ;
283
- menu.AddItem( 'BulletedList', FCKLang.BulletedListProp, 27 ) ;
284
- }
285
- }} ;
286
-
287
- case 'NumberedList' :
288
- return {
289
- AddItems : function( menu, tag, tagName )
290
- {
291
- if ( FCKSelection.HasAncestorNode('OL') )
292
- {
293
- menu.AddSeparator() ;
294
- menu.AddItem( 'NumberedList', FCKLang.NumberedListProp, 26 ) ;
295
- }
296
- }} ;
297
-
298
- case 'DivContainer':
299
- return {
300
- AddItems : function( menu, tag, tagName )
301
- {
302
- var currentBlocks = FCKDomTools.GetSelectedDivContainers() ;
303
-
304
- if ( currentBlocks.length > 0 )
305
- {
306
- menu.AddSeparator() ;
307
- menu.AddItem( 'EditDiv', FCKLang.EditDiv, 75 ) ;
308
- menu.AddItem( 'DeleteDiv', FCKLang.DeleteDiv, 76 ) ;
309
- }
310
- }} ;
311
-
312
- }
313
- return null ;
314
- }
315
-
316
- function FCK_ContextMenu_OnBeforeOpen()
317
- {
318
- // Update the UI.
319
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
320
-
321
- // Get the actual selected tag (if any).
322
- var oTag, sTagName ;
323
-
324
- // The extra () is to avoid a warning with strict error checking. This is ok.
325
- if ( (oTag = FCKSelection.GetSelectedElement()) )
326
- sTagName = oTag.tagName ;
327
-
328
- // Cleanup the current menu items.
329
- var oMenu = FCK.ContextMenu._InnerContextMenu ;
330
- oMenu.RemoveAllItems() ;
331
-
332
- // Loop through the listeners.
333
- var aListeners = FCK.ContextMenu.Listeners ;
334
- for ( var i = 0 ; i < aListeners.length ; i++ )
335
- aListeners[i].AddItems( oMenu, oTag, sTagName ) ;
336
- }
337
-
338
- function FCK_ContextMenu_OnItemClick( item )
339
- {
340
- // IE might work incorrectly if we refocus the editor #798
341
- if ( !FCKBrowserInfo.IsIE )
342
- FCK.Focus() ;
343
-
344
- FCKCommands.GetCommand( item.Name ).Execute( item.CustomData ) ;
345
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fck_gecko.js DELETED
@@ -1,497 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Creation and initialization of the "FCK" object. This is the main
22
- * object that represents an editor instance.
23
- * (Gecko specific implementations)
24
- */
25
-
26
- FCK.Description = "FCKeditor for Gecko Browsers" ;
27
-
28
- FCK.InitializeBehaviors = function()
29
- {
30
- // When calling "SetData", the editing area IFRAME gets a fixed height. So we must recalculate it.
31
- if ( window.onresize ) // Not for Safari/Opera.
32
- window.onresize() ;
33
-
34
- FCKFocusManager.AddWindow( this.EditorWindow ) ;
35
-
36
- this.ExecOnSelectionChange = function()
37
- {
38
- FCK.Events.FireEvent( "OnSelectionChange" ) ;
39
- }
40
-
41
- this._ExecDrop = function( evt )
42
- {
43
- if ( FCK.MouseDownFlag )
44
- {
45
- FCK.MouseDownFlag = false ;
46
- return ;
47
- }
48
-
49
- if ( FCKConfig.ForcePasteAsPlainText )
50
- {
51
- if ( evt.dataTransfer )
52
- {
53
- var text = evt.dataTransfer.getData( 'Text' ) ;
54
- text = FCKTools.HTMLEncode( text ) ;
55
- text = FCKTools.ProcessLineBreaks( window, FCKConfig, text ) ;
56
- FCK.InsertHtml( text ) ;
57
- }
58
- else if ( FCKConfig.ShowDropDialog )
59
- FCK.PasteAsPlainText() ;
60
-
61
- evt.preventDefault() ;
62
- evt.stopPropagation() ;
63
- }
64
- }
65
-
66
- this._ExecCheckCaret = function( evt )
67
- {
68
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
69
- return ;
70
-
71
- if ( evt.type == 'keypress' )
72
- {
73
- var keyCode = evt.keyCode ;
74
- // ignore if positioning key is not pressed.
75
- // left or up arrow keys need to be processed as well, since <a> links can be expanded in Gecko's editor
76
- // when the caret moved left or up from another block element below.
77
- if ( keyCode < 33 || keyCode > 40 )
78
- return ;
79
- }
80
-
81
- var blockEmptyStop = function( node )
82
- {
83
- if ( node.nodeType != 1 )
84
- return false ;
85
- var tag = node.tagName.toLowerCase() ;
86
- return ( FCKListsLib.BlockElements[tag] || FCKListsLib.EmptyElements[tag] ) ;
87
- }
88
-
89
- var moveCursor = function()
90
- {
91
- var selection = FCKSelection.GetSelection() ;
92
- var range = selection.getRangeAt(0) ;
93
- if ( ! range || ! range.collapsed )
94
- return ;
95
-
96
- var node = range.endContainer ;
97
-
98
- // only perform the patched behavior if we're at the end of a text node.
99
- if ( node.nodeType != 3 )
100
- return ;
101
-
102
- if ( node.nodeValue.length != range.endOffset )
103
- return ;
104
-
105
- // only perform the patched behavior if we're in an <a> tag, or the End key is pressed.
106
- var parentTag = node.parentNode.tagName.toLowerCase() ;
107
- if ( ! ( parentTag == 'a' || ( !FCKBrowserInfo.IsOpera && String(node.parentNode.contentEditable) == 'false' ) ||
108
- ( ! ( FCKListsLib.BlockElements[parentTag] || FCKListsLib.NonEmptyBlockElements[parentTag] )
109
- && keyCode == 35 ) ) )
110
- return ;
111
-
112
- // our caret has moved to just after the last character of a text node under an unknown tag, how to proceed?
113
- // first, see if there are other text nodes by DFS walking from this text node.
114
- // - if the DFS has scanned all nodes under my parent, then go the next step.
115
- // - if there is a text node after me but still under my parent, then do nothing and return.
116
- var nextTextNode = FCKTools.GetNextTextNode( node, node.parentNode, blockEmptyStop ) ;
117
- if ( nextTextNode )
118
- return ;
119
-
120
- // we're pretty sure we need to move the caret forcefully from here.
121
- range = FCK.EditorDocument.createRange() ;
122
-
123
- nextTextNode = FCKTools.GetNextTextNode( node, node.parentNode.parentNode, blockEmptyStop ) ;
124
- if ( nextTextNode )
125
- {
126
- // Opera thinks the dummy empty text node we append beyond the end of <a> nodes occupies a caret
127
- // position. So if the user presses the left key and we reset the caret position here, the user
128
- // wouldn't be able to go back.
129
- if ( FCKBrowserInfo.IsOpera && keyCode == 37 )
130
- return ;
131
-
132
- // now we want to get out of our current parent node, adopt the next parent, and move the caret to
133
- // the appropriate text node under our new parent.
134
- // our new parent might be our current parent's siblings if we are lucky.
135
- range.setStart( nextTextNode, 0 ) ;
136
- range.setEnd( nextTextNode, 0 ) ;
137
- }
138
- else
139
- {
140
- // no suitable next siblings under our grandparent! what to do next?
141
- while ( node.parentNode
142
- && node.parentNode != FCK.EditorDocument.body
143
- && node.parentNode != FCK.EditorDocument.documentElement
144
- && node == node.parentNode.lastChild
145
- && ( ! FCKListsLib.BlockElements[node.parentNode.tagName.toLowerCase()]
146
- && ! FCKListsLib.NonEmptyBlockElements[node.parentNode.tagName.toLowerCase()] ) )
147
- node = node.parentNode ;
148
-
149
-
150
- if ( FCKListsLib.BlockElements[ parentTag ]
151
- || FCKListsLib.EmptyElements[ parentTag ]
152
- || node == FCK.EditorDocument.body )
153
- {
154
- // if our parent is a block node, move to the end of our parent.
155
- range.setStart( node, node.childNodes.length ) ;
156
- range.setEnd( node, node.childNodes.length ) ;
157
- }
158
- else
159
- {
160
- // things are a little bit more interesting if our parent is not a block node
161
- // due to the weired ways how Gecko's caret acts...
162
- var stopNode = node.nextSibling ;
163
-
164
- // find out the next block/empty element at our grandparent, we'll
165
- // move the caret just before it.
166
- while ( stopNode )
167
- {
168
- if ( stopNode.nodeType != 1 )
169
- {
170
- stopNode = stopNode.nextSibling ;
171
- continue ;
172
- }
173
-
174
- var stopTag = stopNode.tagName.toLowerCase() ;
175
- if ( FCKListsLib.BlockElements[stopTag] || FCKListsLib.EmptyElements[stopTag]
176
- || FCKListsLib.NonEmptyBlockElements[stopTag] )
177
- break ;
178
- stopNode = stopNode.nextSibling ;
179
- }
180
-
181
- // note that the dummy marker below is NEEDED, otherwise the caret's behavior will
182
- // be broken in Gecko.
183
- var marker = FCK.EditorDocument.createTextNode( '' ) ;
184
- if ( stopNode )
185
- node.parentNode.insertBefore( marker, stopNode ) ;
186
- else
187
- node.parentNode.appendChild( marker ) ;
188
- range.setStart( marker, 0 ) ;
189
- range.setEnd( marker, 0 ) ;
190
- }
191
- }
192
-
193
- selection.removeAllRanges() ;
194
- selection.addRange( range ) ;
195
- FCK.Events.FireEvent( "OnSelectionChange" ) ;
196
- }
197
-
198
- setTimeout( moveCursor, 1 ) ;
199
- }
200
-
201
- this.ExecOnSelectionChangeTimer = function()
202
- {
203
- if ( FCK.LastOnChangeTimer )
204
- window.clearTimeout( FCK.LastOnChangeTimer ) ;
205
-
206
- FCK.LastOnChangeTimer = window.setTimeout( FCK.ExecOnSelectionChange, 100 ) ;
207
- }
208
-
209
- this.EditorDocument.addEventListener( 'mouseup', this.ExecOnSelectionChange, false ) ;
210
-
211
- // On Gecko, firing the "OnSelectionChange" event on every key press started to be too much
212
- // slow. So, a timer has been implemented to solve performance issues when typing to quickly.
213
- this.EditorDocument.addEventListener( 'keyup', this.ExecOnSelectionChangeTimer, false ) ;
214
-
215
- this._DblClickListener = function( e )
216
- {
217
- FCK.OnDoubleClick( e.target ) ;
218
- e.stopPropagation() ;
219
- }
220
- this.EditorDocument.addEventListener( 'dblclick', this._DblClickListener, true ) ;
221
-
222
- // Record changes for the undo system when there are key down events.
223
- this.EditorDocument.addEventListener( 'keydown', this._KeyDownListener, false ) ;
224
-
225
- // Hooks for data object drops
226
- if ( FCKBrowserInfo.IsGecko )
227
- {
228
- this.EditorWindow.addEventListener( 'dragdrop', this._ExecDrop, true ) ;
229
- }
230
- else if ( FCKBrowserInfo.IsSafari )
231
- {
232
- this.EditorDocument.addEventListener( 'dragover', function ( evt )
233
- { if ( !FCK.MouseDownFlag && FCK.Config.ForcePasteAsPlainText ) evt.returnValue = false ; }, true ) ;
234
- this.EditorDocument.addEventListener( 'drop', this._ExecDrop, true ) ;
235
- this.EditorDocument.addEventListener( 'mousedown',
236
- function( ev )
237
- {
238
- var element = ev.srcElement ;
239
-
240
- if ( element.nodeName.IEquals( 'IMG', 'HR', 'INPUT', 'TEXTAREA', 'SELECT' ) )
241
- {
242
- FCKSelection.SelectNode( element ) ;
243
- }
244
- }, true ) ;
245
-
246
- this.EditorDocument.addEventListener( 'mouseup',
247
- function( ev )
248
- {
249
- if ( ev.srcElement.nodeName.IEquals( 'INPUT', 'TEXTAREA', 'SELECT' ) )
250
- ev.preventDefault()
251
- }, true ) ;
252
-
253
- this.EditorDocument.addEventListener( 'click',
254
- function( ev )
255
- {
256
- if ( ev.srcElement.nodeName.IEquals( 'INPUT', 'TEXTAREA', 'SELECT' ) )
257
- ev.preventDefault()
258
- }, true ) ;
259
- }
260
-
261
- // Kludge for buggy Gecko caret positioning logic (Bug #393 and #1056)
262
- if ( FCKBrowserInfo.IsGecko || FCKBrowserInfo.IsOpera )
263
- {
264
- this.EditorDocument.addEventListener( 'keypress', this._ExecCheckCaret, false ) ;
265
- this.EditorDocument.addEventListener( 'click', this._ExecCheckCaret, false ) ;
266
- }
267
-
268
- // Reset the context menu.
269
- FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow( FCK.EditorWindow ) ;
270
- FCK.ContextMenu._InnerContextMenu.AttachToElement( FCK.EditorDocument ) ;
271
- }
272
-
273
- FCK.MakeEditable = function()
274
- {
275
- this.EditingArea.MakeEditable() ;
276
- }
277
-
278
- // Disable the context menu in the editor (outside the editing area).
279
- function Document_OnContextMenu( e )
280
- {
281
- if ( !e.target._FCKShowContextMenu )
282
- e.preventDefault() ;
283
- }
284
- document.oncontextmenu = Document_OnContextMenu ;
285
-
286
- // GetNamedCommandState overload for Gecko.
287
- FCK._BaseGetNamedCommandState = FCK.GetNamedCommandState ;
288
- FCK.GetNamedCommandState = function( commandName )
289
- {
290
- switch ( commandName )
291
- {
292
- case 'Unlink' :
293
- return FCKSelection.HasAncestorNode('A') ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
294
- default :
295
- return FCK._BaseGetNamedCommandState( commandName ) ;
296
- }
297
- }
298
-
299
- // Named commands to be handled by this browsers specific implementation.
300
- FCK.RedirectNamedCommands =
301
- {
302
- Print : true,
303
- Paste : true
304
- } ;
305
-
306
- // ExecuteNamedCommand overload for Gecko.
307
- FCK.ExecuteRedirectedNamedCommand = function( commandName, commandParameter )
308
- {
309
- switch ( commandName )
310
- {
311
- case 'Print' :
312
- FCK.EditorWindow.print() ;
313
- break ;
314
- case 'Paste' :
315
- try
316
- {
317
- // Force the paste dialog for Safari (#50).
318
- if ( FCKBrowserInfo.IsSafari )
319
- throw '' ;
320
-
321
- if ( FCK.Paste() )
322
- FCK.ExecuteNamedCommand( 'Paste', null, true ) ;
323
- }
324
- catch (e) {
325
- if ( FCKConfig.ForcePasteAsPlainText )
326
- FCK.PasteAsPlainText() ;
327
- else
328
- FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.Paste, 'dialog/fck_paste.html', 400, 330, 'Security' ) ;
329
- }
330
- break ;
331
- default :
332
- FCK.ExecuteNamedCommand( commandName, commandParameter ) ;
333
- }
334
- }
335
-
336
- FCK._ExecPaste = function()
337
- {
338
- // Save a snapshot for undo before actually paste the text
339
- FCKUndo.SaveUndoStep() ;
340
-
341
- if ( FCKConfig.ForcePasteAsPlainText )
342
- {
343
- FCK.PasteAsPlainText() ;
344
- return false ;
345
- }
346
-
347
- /* For now, the AutoDetectPasteFromWord feature is IE only. */
348
- return true ;
349
- }
350
-
351
- //**
352
- // FCK.InsertHtml: Inserts HTML at the current cursor location. Deletes the
353
- // selected content if any.
354
- FCK.InsertHtml = function( html )
355
- {
356
- var doc = FCK.EditorDocument,
357
- range;
358
-
359
- html = FCKConfig.ProtectedSource.Protect( html ) ;
360
- html = FCK.ProtectEvents( html ) ;
361
- html = FCK.ProtectUrls( html ) ;
362
- html = FCK.ProtectTags( html ) ;
363
-
364
- // Save an undo snapshot first.
365
- FCKUndo.SaveUndoStep() ;
366
-
367
- if ( FCKBrowserInfo.IsGecko )
368
- {
369
- html = html.replace( /&nbsp;$/, '$&<span _fcktemp="1"/>' ) ;
370
-
371
- var docFrag = new FCKDocumentFragment( this.EditorDocument ) ;
372
- docFrag.AppendHtml( html ) ;
373
-
374
- var lastNode = docFrag.RootNode.lastChild ;
375
-
376
- range = new FCKDomRange( this.EditorWindow ) ;
377
- range.MoveToSelection() ;
378
- range.DeleteContents() ;
379
- range.InsertNode( docFrag.RootNode ) ;
380
-
381
- range.MoveToPosition( lastNode, 4 ) ;
382
- }
383
- else
384
- doc.execCommand( 'inserthtml', false, html ) ;
385
-
386
- this.Focus() ;
387
-
388
- // Save the caret position before calling document processor.
389
- if ( !range )
390
- {
391
- range = new FCKDomRange( this.EditorWindow ) ;
392
- range.MoveToSelection() ;
393
- }
394
- var bookmark = range.CreateBookmark() ;
395
-
396
- FCKDocumentProcessor.Process( doc ) ;
397
-
398
- // Restore caret position, ignore any errors in case the document
399
- // processor removed the bookmark <span>s for some reason.
400
- try
401
- {
402
- range.MoveToBookmark( bookmark ) ;
403
- range.Select() ;
404
- }
405
- catch ( e ) {}
406
-
407
- // For some strange reason the SaveUndoStep() call doesn't activate the undo button at the first InsertHtml() call.
408
- this.Events.FireEvent( "OnSelectionChange" ) ;
409
- }
410
-
411
- FCK.PasteAsPlainText = function()
412
- {
413
- // TODO: Implement the "Paste as Plain Text" code.
414
-
415
- // If the function is called immediately Firefox 2 does automatically paste the contents as soon as the new dialog is created
416
- // so we run it in a Timeout and the paste event can be cancelled
417
- FCKTools.RunFunction( FCKDialog.OpenDialog, FCKDialog, ['FCKDialog_Paste', FCKLang.PasteAsText, 'dialog/fck_paste.html', 400, 330, 'PlainText'] ) ;
418
-
419
- /*
420
- var sText = FCKTools.HTMLEncode( clipboardData.getData("Text") ) ;
421
- sText = sText.replace( /\n/g, '<BR>' ) ;
422
- this.InsertHtml( sText ) ;
423
- */
424
- }
425
- /*
426
- FCK.PasteFromWord = function()
427
- {
428
- // TODO: Implement the "Paste as Plain Text" code.
429
-
430
- FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteFromWord, 'dialog/fck_paste.html', 400, 330, 'Word' ) ;
431
-
432
- // FCK.CleanAndPaste( FCK.GetClipboardHTML() ) ;
433
- }
434
- */
435
- FCK.GetClipboardHTML = function()
436
- {
437
- return '' ;
438
- }
439
-
440
- FCK.CreateLink = function( url, noUndo )
441
- {
442
- // Creates the array that will be returned. It contains one or more created links (see #220).
443
- var aCreatedLinks = new Array() ;
444
-
445
- // Only for Safari, a collapsed selection may create a link. All other
446
- // browser will have no links created. So, we check it here and return
447
- // immediatelly, having the same cross browser behavior.
448
- if ( FCKSelection.GetSelection().isCollapsed )
449
- return aCreatedLinks ;
450
-
451
- FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ;
452
-
453
- if ( url.length > 0 )
454
- {
455
- // Generate a temporary name for the link.
456
- var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ;
457
-
458
- // Use the internal "CreateLink" command to create the link.
459
- FCK.ExecuteNamedCommand( 'CreateLink', sTempUrl, false, !!noUndo ) ;
460
-
461
- // Retrieve the just created links using XPath.
462
- var oLinksInteractor = this.EditorDocument.evaluate("//a[@href='" + sTempUrl + "']", this.EditorDocument.body, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null) ;
463
-
464
- // Add all links to the returning array.
465
- for ( var i = 0 ; i < oLinksInteractor.snapshotLength ; i++ )
466
- {
467
- var oLink = oLinksInteractor.snapshotItem( i ) ;
468
- oLink.href = url ;
469
-
470
- aCreatedLinks.push( oLink ) ;
471
- }
472
- }
473
-
474
- return aCreatedLinks ;
475
- }
476
-
477
- FCK._FillEmptyBlock = function( emptyBlockNode )
478
- {
479
- if ( ! emptyBlockNode || emptyBlockNode.nodeType != 1 )
480
- return ;
481
- var nodeTag = emptyBlockNode.tagName.toLowerCase() ;
482
- if ( nodeTag != 'p' && nodeTag != 'div' )
483
- return ;
484
- if ( emptyBlockNode.firstChild )
485
- return ;
486
- FCKTools.AppendBogusBr( emptyBlockNode ) ;
487
- }
488
-
489
- FCK._ExecCheckEmptyBlock = function()
490
- {
491
- FCK._FillEmptyBlock( FCK.EditorDocument.body.firstChild ) ;
492
- var sel = FCKSelection.GetSelection() ;
493
- if ( !sel || sel.rangeCount < 1 )
494
- return ;
495
- var range = sel.getRangeAt( 0 );
496
- FCK._FillEmptyBlock( range.startContainer ) ;
497
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fck_ie.js DELETED
@@ -1,456 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Creation and initialization of the "FCK" object. This is the main
22
- * object that represents an editor instance.
23
- * (IE specific implementations)
24
- */
25
-
26
- FCK.Description = "FCKeditor for Internet Explorer 5.5+" ;
27
-
28
- FCK._GetBehaviorsStyle = function()
29
- {
30
- if ( !FCK._BehaviorsStyle )
31
- {
32
- var sBasePath = FCKConfig.BasePath ;
33
- var sTableBehavior = '' ;
34
- var sStyle ;
35
-
36
- // The behaviors should be pointed using the BasePath to avoid security
37
- // errors when using a different BaseHref.
38
- sStyle = '<style type="text/css" _fcktemp="true">' ;
39
-
40
- if ( FCKConfig.ShowBorders )
41
- sTableBehavior = 'url(' + sBasePath + 'css/behaviors/showtableborders.htc)' ;
42
-
43
- // Disable resize handlers.
44
- sStyle += 'INPUT,TEXTAREA,SELECT,.FCK__Anchor,.FCK__PageBreak,.FCK__InputHidden' ;
45
-
46
- if ( FCKConfig.DisableObjectResizing )
47
- {
48
- sStyle += ',IMG' ;
49
- sTableBehavior += ' url(' + sBasePath + 'css/behaviors/disablehandles.htc)' ;
50
- }
51
-
52
- sStyle += ' { behavior: url(' + sBasePath + 'css/behaviors/disablehandles.htc) ; }' ;
53
-
54
- if ( sTableBehavior.length > 0 )
55
- sStyle += 'TABLE { behavior: ' + sTableBehavior + ' ; }' ;
56
-
57
- sStyle += '</style>' ;
58
- FCK._BehaviorsStyle = sStyle ;
59
- }
60
-
61
- return FCK._BehaviorsStyle ;
62
- }
63
-
64
- function Doc_OnMouseUp()
65
- {
66
- if ( FCK.EditorWindow.event.srcElement.tagName == 'HTML' )
67
- {
68
- FCK.Focus() ;
69
- FCK.EditorWindow.event.cancelBubble = true ;
70
- FCK.EditorWindow.event.returnValue = false ;
71
- }
72
- }
73
-
74
- function Doc_OnPaste()
75
- {
76
- var body = FCK.EditorDocument.body ;
77
-
78
- body.detachEvent( 'onpaste', Doc_OnPaste ) ;
79
-
80
- var ret = FCK.Paste( !FCKConfig.ForcePasteAsPlainText && !FCKConfig.AutoDetectPasteFromWord ) ;
81
-
82
- body.attachEvent( 'onpaste', Doc_OnPaste ) ;
83
-
84
- return ret ;
85
- }
86
-
87
- function Doc_OnDblClick()
88
- {
89
- FCK.OnDoubleClick( FCK.EditorWindow.event.srcElement ) ;
90
- FCK.EditorWindow.event.cancelBubble = true ;
91
- }
92
-
93
- function Doc_OnSelectionChange()
94
- {
95
- // Don't fire the event if no document is loaded.
96
- if ( !FCK.IsSelectionChangeLocked && FCK.EditorDocument )
97
- FCK.Events.FireEvent( "OnSelectionChange" ) ;
98
- }
99
-
100
- function Doc_OnDrop()
101
- {
102
- if ( FCK.MouseDownFlag )
103
- {
104
- FCK.MouseDownFlag = false ;
105
- return ;
106
- }
107
-
108
- if ( FCKConfig.ForcePasteAsPlainText )
109
- {
110
- var evt = FCK.EditorWindow.event ;
111
-
112
- if ( FCK._CheckIsPastingEnabled() || FCKConfig.ShowDropDialog )
113
- FCK.PasteAsPlainText( evt.dataTransfer.getData( 'Text' ) ) ;
114
-
115
- evt.returnValue = false ;
116
- evt.cancelBubble = true ;
117
- }
118
- }
119
-
120
- FCK.InitializeBehaviors = function( dontReturn )
121
- {
122
- // Set the focus to the editable area when clicking in the document area.
123
- // TODO: The cursor must be positioned at the end.
124
- this.EditorDocument.attachEvent( 'onmouseup', Doc_OnMouseUp ) ;
125
-
126
- // Intercept pasting operations
127
- this.EditorDocument.body.attachEvent( 'onpaste', Doc_OnPaste ) ;
128
-
129
- // Intercept drop operations
130
- this.EditorDocument.body.attachEvent( 'ondrop', Doc_OnDrop ) ;
131
-
132
- // Reset the context menu.
133
- FCK.ContextMenu._InnerContextMenu.AttachToElement( FCK.EditorDocument.body ) ;
134
-
135
- this.EditorDocument.attachEvent("onkeydown", FCK._KeyDownListener ) ;
136
-
137
- this.EditorDocument.attachEvent("ondblclick", Doc_OnDblClick ) ;
138
-
139
- this.EditorDocument.attachEvent("onbeforedeactivate", function(){ FCKSelection.Save() ; } ) ;
140
-
141
- // Catch cursor selection changes.
142
- this.EditorDocument.attachEvent("onselectionchange", Doc_OnSelectionChange ) ;
143
-
144
- FCKTools.AddEventListener( FCK.EditorDocument, 'mousedown', Doc_OnMouseDown ) ;
145
- }
146
-
147
- FCK.InsertHtml = function( html )
148
- {
149
- html = FCKConfig.ProtectedSource.Protect( html ) ;
150
- html = FCK.ProtectEvents( html ) ;
151
- html = FCK.ProtectUrls( html ) ;
152
- html = FCK.ProtectTags( html ) ;
153
-
154
- // FCK.Focus() ;
155
- FCKSelection.Restore() ;
156
- FCK.EditorWindow.focus() ;
157
-
158
- FCKUndo.SaveUndoStep() ;
159
-
160
- // Gets the actual selection.
161
- var oSel = FCKSelection.GetSelection() ;
162
-
163
- // Deletes the actual selection contents.
164
- if ( oSel.type.toLowerCase() == 'control' )
165
- oSel.clear() ;
166
-
167
- // Using the following trick, any comment in the beginning of the HTML will
168
- // be preserved.
169
- html = '<span id="__fakeFCKRemove__" style="display:none;">fakeFCKRemove</span>' + html ;
170
-
171
- // Insert the HTML.
172
- oSel.createRange().pasteHTML( html ) ;
173
-
174
- // Remove the fake node
175
- FCK.EditorDocument.getElementById('__fakeFCKRemove__').removeNode( true ) ;
176
-
177
- FCKDocumentProcessor.Process( FCK.EditorDocument ) ;
178
-
179
- // For some strange reason the SaveUndoStep() call doesn't activate the undo button at the first InsertHtml() call.
180
- this.Events.FireEvent( "OnSelectionChange" ) ;
181
- }
182
-
183
- FCK.SetInnerHtml = function( html ) // IE Only
184
- {
185
- var oDoc = FCK.EditorDocument ;
186
- // Using the following trick, any comment in the beginning of the HTML will
187
- // be preserved.
188
- oDoc.body.innerHTML = '<div id="__fakeFCKRemove__">&nbsp;</div>' + html ;
189
- oDoc.getElementById('__fakeFCKRemove__').removeNode( true ) ;
190
- }
191
-
192
- function FCK_PreloadImages()
193
- {
194
- var oPreloader = new FCKImagePreloader() ;
195
-
196
- // Add the configured images.
197
- oPreloader.AddImages( FCKConfig.PreloadImages ) ;
198
-
199
- // Add the skin icons strip.
200
- oPreloader.AddImages( FCKConfig.SkinPath + 'fck_strip.gif' ) ;
201
-
202
- oPreloader.OnComplete = LoadToolbarSetup ;
203
- oPreloader.Start() ;
204
- }
205
-
206
- // Disable the context menu in the editor (outside the editing area).
207
- function Document_OnContextMenu()
208
- {
209
- return ( event.srcElement._FCKShowContextMenu == true ) ;
210
- }
211
- document.oncontextmenu = Document_OnContextMenu ;
212
-
213
- function FCK_Cleanup()
214
- {
215
- this.LinkedField = null ;
216
- this.EditorWindow = null ;
217
- this.EditorDocument = null ;
218
- }
219
-
220
- FCK._ExecPaste = function()
221
- {
222
- // As we call ExecuteNamedCommand('Paste'), it would enter in a loop. So, let's use a semaphore.
223
- if ( FCK._PasteIsRunning )
224
- return true ;
225
-
226
- if ( FCKConfig.ForcePasteAsPlainText )
227
- {
228
- FCK.PasteAsPlainText() ;
229
- return false ;
230
- }
231
-
232
- var sHTML = FCK._CheckIsPastingEnabled( true ) ;
233
-
234
- if ( sHTML === false )
235
- FCKTools.RunFunction( FCKDialog.OpenDialog, FCKDialog, ['FCKDialog_Paste', FCKLang.Paste, 'dialog/fck_paste.html', 400, 330, 'Security'] ) ;
236
- else
237
- {
238
- if ( FCKConfig.AutoDetectPasteFromWord && sHTML.length > 0 )
239
- {
240
- var re = /<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi ;
241
- if ( re.test( sHTML ) )
242
- {
243
- if ( confirm( FCKLang.PasteWordConfirm ) )
244
- {
245
- FCK.PasteFromWord() ;
246
- return false ;
247
- }
248
- }
249
- }
250
-
251
- // Instead of inserting the retrieved HTML, let's leave the OS work for us,
252
- // by calling FCK.ExecuteNamedCommand( 'Paste' ). It could give better results.
253
-
254
- // Enable the semaphore to avoid a loop.
255
- FCK._PasteIsRunning = true ;
256
-
257
- FCK.ExecuteNamedCommand( 'Paste' ) ;
258
-
259
- // Removes the semaphore.
260
- delete FCK._PasteIsRunning ;
261
- }
262
-
263
- // Let's always make a custom implementation (return false), otherwise
264
- // the new Keyboard Handler may conflict with this code, and the CTRL+V code
265
- // could result in a simple "V" being pasted.
266
- return false ;
267
- }
268
-
269
- FCK.PasteAsPlainText = function( forceText )
270
- {
271
- if ( !FCK._CheckIsPastingEnabled() )
272
- {
273
- FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteAsText, 'dialog/fck_paste.html', 400, 330, 'PlainText' ) ;
274
- return ;
275
- }
276
-
277
- // Get the data available in the clipboard in text format.
278
- var sText = null ;
279
- if ( ! forceText )
280
- sText = clipboardData.getData("Text") ;
281
- else
282
- sText = forceText ;
283
-
284
- if ( sText && sText.length > 0 )
285
- {
286
- // Replace the carriage returns with <BR>
287
- sText = FCKTools.HTMLEncode( sText ) ;
288
- sText = FCKTools.ProcessLineBreaks( window, FCKConfig, sText ) ;
289
-
290
- var closeTagIndex = sText.search( '</p>' ) ;
291
- var startTagIndex = sText.search( '<p>' ) ;
292
-
293
- if ( ( closeTagIndex != -1 && startTagIndex != -1 && closeTagIndex < startTagIndex )
294
- || ( closeTagIndex != -1 && startTagIndex == -1 ) )
295
- {
296
- var prefix = sText.substr( 0, closeTagIndex ) ;
297
- sText = sText.substr( closeTagIndex + 4 ) ;
298
- this.InsertHtml( prefix ) ;
299
- }
300
-
301
- // Insert the resulting data in the editor.
302
- FCKUndo.SaveLocked = true ;
303
- this.InsertHtml( sText ) ;
304
- FCKUndo.SaveLocked = false ;
305
- }
306
- }
307
-
308
- FCK._CheckIsPastingEnabled = function( returnContents )
309
- {
310
- // The following seams to be the only reliable way to check is script
311
- // pasting operations are enabled in the security settings of IE6 and IE7.
312
- // It adds a little bit of overhead to the check, but so far that's the
313
- // only way, mainly because of IE7.
314
-
315
- FCK._PasteIsEnabled = false ;
316
-
317
- document.body.attachEvent( 'onpaste', FCK_CheckPasting_Listener ) ;
318
-
319
- // The execCommand in GetClipboardHTML will fire the "onpaste", only if the
320
- // security settings are enabled.
321
- var oReturn = FCK.GetClipboardHTML() ;
322
-
323
- document.body.detachEvent( 'onpaste', FCK_CheckPasting_Listener ) ;
324
-
325
- if ( FCK._PasteIsEnabled )
326
- {
327
- if ( !returnContents )
328
- oReturn = true ;
329
- }
330
- else
331
- oReturn = false ;
332
-
333
- delete FCK._PasteIsEnabled ;
334
-
335
- return oReturn ;
336
- }
337
-
338
- function FCK_CheckPasting_Listener()
339
- {
340
- FCK._PasteIsEnabled = true ;
341
- }
342
-
343
- FCK.GetClipboardHTML = function()
344
- {
345
- var oDiv = document.getElementById( '___FCKHiddenDiv' ) ;
346
-
347
- if ( !oDiv )
348
- {
349
- oDiv = document.createElement( 'DIV' ) ;
350
- oDiv.id = '___FCKHiddenDiv' ;
351
-
352
- var oDivStyle = oDiv.style ;
353
- oDivStyle.position = 'absolute' ;
354
- oDivStyle.visibility = oDivStyle.overflow = 'hidden' ;
355
- oDivStyle.width = oDivStyle.height = 1 ;
356
-
357
- document.body.appendChild( oDiv ) ;
358
- }
359
-
360
- oDiv.innerHTML = '' ;
361
-
362
- var oTextRange = document.body.createTextRange() ;
363
- oTextRange.moveToElementText( oDiv ) ;
364
- oTextRange.execCommand( 'Paste' ) ;
365
-
366
- var sData = oDiv.innerHTML ;
367
- oDiv.innerHTML = '' ;
368
-
369
- return sData ;
370
- }
371
-
372
- FCK.CreateLink = function( url, noUndo )
373
- {
374
- // Creates the array that will be returned. It contains one or more created links (see #220).
375
- var aCreatedLinks = new Array() ;
376
-
377
- // Remove any existing link in the selection.
378
- FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ;
379
-
380
- if ( url.length > 0 )
381
- {
382
- // If there are several images, and you try to link each one, all the images get inside the link:
383
- // <img><img> -> <a><img></a><img> -> <a><img><img></a> due to the call to 'CreateLink' (bug in IE)
384
- if (FCKSelection.GetType() == 'Control')
385
- {
386
- // Create a link
387
- var oLink = this.EditorDocument.createElement( 'A' ) ;
388
- oLink.href = url ;
389
-
390
- // Get the selected object
391
- var oControl = FCKSelection.GetSelectedElement() ;
392
- // Put the link just before the object
393
- oControl.parentNode.insertBefore(oLink, oControl) ;
394
- // Move the object inside the link
395
- oControl.parentNode.removeChild( oControl ) ;
396
- oLink.appendChild( oControl ) ;
397
-
398
- return [ oLink ] ;
399
- }
400
-
401
- // Generate a temporary name for the link.
402
- var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ;
403
-
404
- // Use the internal "CreateLink" command to create the link.
405
- FCK.ExecuteNamedCommand( 'CreateLink', sTempUrl, false, !!noUndo ) ;
406
-
407
- // Look for the just create link.
408
- var oLinks = this.EditorDocument.links ;
409
-
410
- for ( i = 0 ; i < oLinks.length ; i++ )
411
- {
412
- var oLink = oLinks[i] ;
413
-
414
- // Check it this a newly created link.
415
- // getAttribute must be used. oLink.url may cause problems with IE7 (#555).
416
- if ( oLink.getAttribute( 'href', 2 ) == sTempUrl )
417
- {
418
- var sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like an URL).
419
- oLink.href = url ;
420
- oLink.innerHTML = sInnerHtml ; // Restore the innerHTML.
421
-
422
- // If the last child is a <br> move it outside the link or it
423
- // will be too easy to select this link again #388.
424
- var oLastChild = oLink.lastChild ;
425
- if ( oLastChild && oLastChild.nodeName == 'BR' )
426
- {
427
- // Move the BR after the link.
428
- FCKDomTools.InsertAfterNode( oLink, oLink.removeChild( oLastChild ) ) ;
429
- }
430
-
431
- aCreatedLinks.push( oLink ) ;
432
- }
433
- }
434
- }
435
-
436
- return aCreatedLinks ;
437
- }
438
-
439
- function _FCK_RemoveDisabledAtt()
440
- {
441
- this.removeAttribute( 'disabled' ) ;
442
- }
443
-
444
- function Doc_OnMouseDown( evt )
445
- {
446
- var e = evt.srcElement ;
447
-
448
- // Radio buttons and checkboxes should not be allowed to be triggered in IE
449
- // in editable mode. Otherwise the whole browser window may be locked by
450
- // the buttons. (#1782)
451
- if ( e.nodeName.IEquals( 'input' ) && e.type.IEquals( ['radio', 'checkbox'] ) && !e.disabled )
452
- {
453
- e.disabled = true ;
454
- FCKTools.SetTimeout( _FCK_RemoveDisabledAtt, 1, e ) ;
455
- }
456
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckbrowserinfo.js DELETED
@@ -1,61 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Contains browser detection information.
22
- */
23
-
24
- var s = navigator.userAgent.toLowerCase() ;
25
-
26
- var FCKBrowserInfo =
27
- {
28
- IsIE : /*@cc_on!@*/false,
29
- IsIE7 : /*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/ )[1], 10 ) >= 7 ),
30
- IsIE6 : /*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/ )[1], 10 ) >= 6 ),
31
- IsSafari : s.Contains(' applewebkit/'), // Read "IsWebKit"
32
- IsOpera : !!window.opera,
33
- IsAIR : s.Contains(' adobeair/'),
34
- IsMac : s.Contains('macintosh')
35
- } ;
36
-
37
- // Completes the browser info with further Gecko information.
38
- (function( browserInfo )
39
- {
40
- browserInfo.IsGecko = ( navigator.product == 'Gecko' ) && !browserInfo.IsSafari && !browserInfo.IsOpera ;
41
- browserInfo.IsGeckoLike = ( browserInfo.IsGecko || browserInfo.IsSafari || browserInfo.IsOpera ) ;
42
-
43
- if ( browserInfo.IsGecko )
44
- {
45
- var geckoMatch = s.match( /rv:(\d+\.\d+)/ ) ;
46
- var geckoVersion = geckoMatch && parseFloat( geckoMatch[1] ) ;
47
-
48
- // Actually "10" refers to Gecko versions before Firefox 1.5, when
49
- // Gecko 1.8 (build 20051111) has been released.
50
-
51
- // Some browser (like Mozilla 1.7.13) may have a Gecko build greater
52
- // than 20051111, so we must also check for the revision number not to
53
- // be 1.7 (we are assuming that rv < 1.7 will not have build > 20051111).
54
-
55
- if ( geckoVersion )
56
- {
57
- browserInfo.IsGecko10 = ( geckoVersion < 1.8 ) ;
58
- browserInfo.IsGecko19 = ( geckoVersion > 1.8 ) ;
59
- }
60
- }
61
- })(FCKBrowserInfo) ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckcodeformatter.js DELETED
@@ -1,100 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Format the HTML.
22
- */
23
-
24
- var FCKCodeFormatter = new Object() ;
25
-
26
- FCKCodeFormatter.Init = function()
27
- {
28
- var oRegex = this.Regex = new Object() ;
29
-
30
- // Regex for line breaks.
31
- oRegex.BlocksOpener = /\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DL|DT|DD|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ;
32
- oRegex.BlocksCloser = /\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DL|DT|DD|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ;
33
-
34
- oRegex.NewLineTags = /\<(BR|HR)[^\>]*\>/gi ;
35
-
36
- oRegex.MainTags = /\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi ;
37
-
38
- oRegex.LineSplitter = /\s*\n+\s*/g ;
39
-
40
- // Regex for indentation.
41
- oRegex.IncreaseIndent = /^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL|DL)[ \/\>]/i ;
42
- oRegex.DecreaseIndent = /^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL|DL)[ \>]/i ;
43
- oRegex.FormatIndentatorRemove = new RegExp( '^' + FCKConfig.FormatIndentator ) ;
44
-
45
- oRegex.ProtectedTags = /(<PRE[^>]*>)([\s\S]*?)(<\/PRE>)/gi ;
46
- }
47
-
48
- FCKCodeFormatter._ProtectData = function( outer, opener, data, closer )
49
- {
50
- return opener + '___FCKpd___' + ( FCKCodeFormatter.ProtectedData.push( data ) - 1 ) + closer ;
51
- }
52
-
53
- FCKCodeFormatter.Format = function( html )
54
- {
55
- if ( !this.Regex )
56
- this.Init() ;
57
-
58
- // Protected content that remain untouched during the
59
- // process go in the following array.
60
- FCKCodeFormatter.ProtectedData = new Array() ;
61
-
62
- var sFormatted = html.replace( this.Regex.ProtectedTags, FCKCodeFormatter._ProtectData ) ;
63
-
64
- // Line breaks.
65
- sFormatted = sFormatted.replace( this.Regex.BlocksOpener, '\n$&' ) ;
66
- sFormatted = sFormatted.replace( this.Regex.BlocksCloser, '$&\n' ) ;
67
- sFormatted = sFormatted.replace( this.Regex.NewLineTags, '$&\n' ) ;
68
- sFormatted = sFormatted.replace( this.Regex.MainTags, '\n$&\n' ) ;
69
-
70
- // Indentation.
71
- var sIndentation = '' ;
72
-
73
- var asLines = sFormatted.split( this.Regex.LineSplitter ) ;
74
- sFormatted = '' ;
75
-
76
- for ( var i = 0 ; i < asLines.length ; i++ )
77
- {
78
- var sLine = asLines[i] ;
79
-
80
- if ( sLine.length == 0 )
81
- continue ;
82
-
83
- if ( this.Regex.DecreaseIndent.test( sLine ) )
84
- sIndentation = sIndentation.replace( this.Regex.FormatIndentatorRemove, '' ) ;
85
-
86
- sFormatted += sIndentation + sLine + '\n' ;
87
-
88
- if ( this.Regex.IncreaseIndent.test( sLine ) )
89
- sIndentation += FCKConfig.FormatIndentator ;
90
- }
91
-
92
- // Now we put back the protected data.
93
- for ( var j = 0 ; j < FCKCodeFormatter.ProtectedData.length ; j++ )
94
- {
95
- var oRegex = new RegExp( '___FCKpd___' + j ) ;
96
- sFormatted = sFormatted.replace( oRegex, FCKCodeFormatter.ProtectedData[j].replace( /\$/g, '$$$$' ) ) ;
97
- }
98
-
99
- return sFormatted.Trim() ;
100
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckcommands.js DELETED
@@ -1,172 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Define all commands available in the editor.
22
- */
23
-
24
- var FCKCommands = FCK.Commands = new Object() ;
25
- FCKCommands.LoadedCommands = new Object() ;
26
-
27
- FCKCommands.RegisterCommand = function( commandName, command )
28
- {
29
- this.LoadedCommands[ commandName ] = command ;
30
- }
31
-
32
- FCKCommands.GetCommand = function( commandName )
33
- {
34
- var oCommand = FCKCommands.LoadedCommands[ commandName ] ;
35
-
36
- if ( oCommand )
37
- return oCommand ;
38
-
39
- switch ( commandName )
40
- {
41
- case 'Bold' :
42
- case 'Italic' :
43
- case 'Underline' :
44
- case 'StrikeThrough':
45
- case 'Subscript' :
46
- case 'Superscript' : oCommand = new FCKCoreStyleCommand( commandName ) ; break ;
47
-
48
- case 'RemoveFormat' : oCommand = new FCKRemoveFormatCommand() ; break ;
49
-
50
- case 'DocProps' : oCommand = new FCKDialogCommand( 'DocProps' , FCKLang.DocProps , 'dialog/fck_docprops.html' , 400, 380, FCKCommands.GetFullPageState ) ; break ;
51
- case 'Templates' : oCommand = new FCKDialogCommand( 'Templates' , FCKLang.DlgTemplatesTitle , 'dialog/fck_template.html' , 380, 450 ) ; break ;
52
- case 'Link' : oCommand = new FCKDialogCommand( 'Link' , FCKLang.DlgLnkWindowTitle , 'dialog/fck_link.html' , 400, 300 ) ; break ;
53
- case 'Unlink' : oCommand = new FCKUnlinkCommand() ; break ;
54
- case 'VisitLink' : oCommand = new FCKVisitLinkCommand() ; break ;
55
- case 'Anchor' : oCommand = new FCKDialogCommand( 'Anchor' , FCKLang.DlgAnchorTitle , 'dialog/fck_anchor.html' , 370, 160 ) ; break ;
56
- case 'AnchorDelete' : oCommand = new FCKAnchorDeleteCommand() ; break ;
57
- case 'BulletedList' : oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp , 'dialog/fck_listprop.html?UL' , 370, 160 ) ; break ;
58
- case 'NumberedList' : oCommand = new FCKDialogCommand( 'NumberedList', FCKLang.NumberedListProp , 'dialog/fck_listprop.html?OL' , 370, 160 ) ; break ;
59
- case 'About' : oCommand = new FCKDialogCommand( 'About' , FCKLang.About , 'dialog/fck_about.html' , 420, 330, function(){ return FCK_TRISTATE_OFF ; } ) ; break ;
60
- case 'Find' : oCommand = new FCKDialogCommand( 'Find' , FCKLang.DlgFindAndReplaceTitle, 'dialog/fck_replace.html' , 340, 230, null, null, 'Find' ) ; break ;
61
- case 'Replace' : oCommand = new FCKDialogCommand( 'Replace' , FCKLang.DlgFindAndReplaceTitle, 'dialog/fck_replace.html' , 340, 230, null, null, 'Replace' ) ; break ;
62
-
63
- case 'Image' : oCommand = new FCKDialogCommand( 'Image' , FCKLang.DlgImgTitle , 'dialog/fck_image.html' , 450, 390 ) ; break ;
64
- case 'Flash' : oCommand = new FCKDialogCommand( 'Flash' , FCKLang.DlgFlashTitle , 'dialog/fck_flash.html' , 450, 390 ) ; break ;
65
- case 'SpecialChar' : oCommand = new FCKDialogCommand( 'SpecialChar', FCKLang.DlgSpecialCharTitle , 'dialog/fck_specialchar.html' , 400, 290 ) ; break ;
66
- case 'Smiley' : oCommand = new FCKDialogCommand( 'Smiley' , FCKLang.DlgSmileyTitle , 'dialog/fck_smiley.html' , FCKConfig.SmileyWindowWidth, FCKConfig.SmileyWindowHeight ) ; break ;
67
- case 'Table' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html' , 480, 250 ) ; break ;
68
- case 'TableProp' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html?Parent', 480, 250 ) ; break ;
69
- case 'TableCellProp': oCommand = new FCKDialogCommand( 'TableCell' , FCKLang.DlgCellTitle , 'dialog/fck_tablecell.html' , 550, 240 ) ; break ;
70
-
71
- case 'Style' : oCommand = new FCKStyleCommand() ; break ;
72
-
73
- case 'FontName' : oCommand = new FCKFontNameCommand() ; break ;
74
- case 'FontSize' : oCommand = new FCKFontSizeCommand() ; break ;
75
- case 'FontFormat' : oCommand = new FCKFormatBlockCommand() ; break ;
76
-
77
- case 'Source' : oCommand = new FCKSourceCommand() ; break ;
78
- case 'Preview' : oCommand = new FCKPreviewCommand() ; break ;
79
- case 'Save' : oCommand = new FCKSaveCommand() ; break ;
80
- case 'NewPage' : oCommand = new FCKNewPageCommand() ; break ;
81
- case 'PageBreak' : oCommand = new FCKPageBreakCommand() ; break ;
82
- case 'Rule' : oCommand = new FCKRuleCommand() ; break ;
83
- case 'Nbsp' : oCommand = new FCKNbsp() ; break ;
84
-
85
- case 'TextColor' : oCommand = new FCKTextColorCommand('ForeColor') ; break ;
86
- case 'BGColor' : oCommand = new FCKTextColorCommand('BackColor') ; break ;
87
-
88
- case 'Paste' : oCommand = new FCKPasteCommand() ; break ;
89
- case 'PasteText' : oCommand = new FCKPastePlainTextCommand() ; break ;
90
- case 'PasteWord' : oCommand = new FCKPasteWordCommand() ; break ;
91
-
92
- case 'JustifyLeft' : oCommand = new FCKJustifyCommand( 'left' ) ; break ;
93
- case 'JustifyCenter' : oCommand = new FCKJustifyCommand( 'center' ) ; break ;
94
- case 'JustifyRight' : oCommand = new FCKJustifyCommand( 'right' ) ; break ;
95
- case 'JustifyFull' : oCommand = new FCKJustifyCommand( 'justify' ) ; break ;
96
- case 'Indent' : oCommand = new FCKIndentCommand( 'indent', FCKConfig.IndentLength ) ; break ;
97
- case 'Outdent' : oCommand = new FCKIndentCommand( 'outdent', FCKConfig.IndentLength * -1 ) ; break ;
98
- case 'Blockquote' : oCommand = new FCKBlockQuoteCommand() ; break ;
99
- case 'CreateDiv' : oCommand = new FCKDialogCommand( 'CreateDiv', FCKLang.CreateDiv, 'dialog/fck_div.html', 380, 210, null, null, true ) ; break ;
100
- case 'EditDiv' : oCommand = new FCKDialogCommand( 'EditDiv', FCKLang.EditDiv, 'dialog/fck_div.html', 380, 210, null, null, false ) ; break ;
101
- case 'DeleteDiv' : oCommand = new FCKDeleteDivCommand() ; break ;
102
-
103
- case 'TableInsertRowAfter' : oCommand = new FCKTableCommand('TableInsertRowAfter') ; break ;
104
- case 'TableInsertRowBefore' : oCommand = new FCKTableCommand('TableInsertRowBefore') ; break ;
105
- case 'TableDeleteRows' : oCommand = new FCKTableCommand('TableDeleteRows') ; break ;
106
- case 'TableInsertColumnAfter' : oCommand = new FCKTableCommand('TableInsertColumnAfter') ; break ;
107
- case 'TableInsertColumnBefore' : oCommand = new FCKTableCommand('TableInsertColumnBefore') ; break ;
108
- case 'TableDeleteColumns' : oCommand = new FCKTableCommand('TableDeleteColumns') ; break ;
109
- case 'TableInsertCellAfter' : oCommand = new FCKTableCommand('TableInsertCellAfter') ; break ;
110
- case 'TableInsertCellBefore' : oCommand = new FCKTableCommand('TableInsertCellBefore') ; break ;
111
- case 'TableDeleteCells' : oCommand = new FCKTableCommand('TableDeleteCells') ; break ;
112
- case 'TableMergeCells' : oCommand = new FCKTableCommand('TableMergeCells') ; break ;
113
- case 'TableMergeRight' : oCommand = new FCKTableCommand('TableMergeRight') ; break ;
114
- case 'TableMergeDown' : oCommand = new FCKTableCommand('TableMergeDown') ; break ;
115
- case 'TableHorizontalSplitCell' : oCommand = new FCKTableCommand('TableHorizontalSplitCell') ; break ;
116
- case 'TableVerticalSplitCell' : oCommand = new FCKTableCommand('TableVerticalSplitCell') ; break ;
117
- case 'TableDelete' : oCommand = new FCKTableCommand('TableDelete') ; break ;
118
-
119
- case 'Form' : oCommand = new FCKDialogCommand( 'Form' , FCKLang.Form , 'dialog/fck_form.html' , 380, 210 ) ; break ;
120
- case 'Checkbox' : oCommand = new FCKDialogCommand( 'Checkbox' , FCKLang.Checkbox , 'dialog/fck_checkbox.html' , 380, 200 ) ; break ;
121
- case 'Radio' : oCommand = new FCKDialogCommand( 'Radio' , FCKLang.RadioButton , 'dialog/fck_radiobutton.html' , 380, 200 ) ; break ;
122
- case 'TextField' : oCommand = new FCKDialogCommand( 'TextField' , FCKLang.TextField , 'dialog/fck_textfield.html' , 380, 210 ) ; break ;
123
- case 'Textarea' : oCommand = new FCKDialogCommand( 'Textarea' , FCKLang.Textarea , 'dialog/fck_textarea.html' , 380, 210 ) ; break ;
124
- case 'HiddenField' : oCommand = new FCKDialogCommand( 'HiddenField', FCKLang.HiddenField , 'dialog/fck_hiddenfield.html' , 380, 190 ) ; break ;
125
- case 'Button' : oCommand = new FCKDialogCommand( 'Button' , FCKLang.Button , 'dialog/fck_button.html' , 380, 210 ) ; break ;
126
- case 'Select' : oCommand = new FCKDialogCommand( 'Select' , FCKLang.SelectionField, 'dialog/fck_select.html' , 400, 340 ) ; break ;
127
- case 'ImageButton' : oCommand = new FCKDialogCommand( 'ImageButton', FCKLang.ImageButton , 'dialog/fck_image.html?ImageButton', 450, 390 ) ; break ;
128
-
129
- case 'SpellCheck' : oCommand = new FCKSpellCheckCommand() ; break ;
130
- case 'FitWindow' : oCommand = new FCKFitWindow() ; break ;
131
-
132
- case 'Undo' : oCommand = new FCKUndoCommand() ; break ;
133
- case 'Redo' : oCommand = new FCKRedoCommand() ; break ;
134
- case 'Copy' : oCommand = new FCKCutCopyCommand( false ) ; break ;
135
- case 'Cut' : oCommand = new FCKCutCopyCommand( true ) ; break ;
136
-
137
- case 'SelectAll' : oCommand = new FCKSelectAllCommand() ; break ;
138
- case 'InsertOrderedList' : oCommand = new FCKListCommand( 'insertorderedlist', 'ol' ) ; break ;
139
- case 'InsertUnorderedList' : oCommand = new FCKListCommand( 'insertunorderedlist', 'ul' ) ; break ;
140
- case 'ShowBlocks' : oCommand = new FCKShowBlockCommand( 'ShowBlocks', FCKConfig.StartupShowBlocks ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ) ; break ;
141
-
142
- // Generic Undefined command (usually used when a command is under development).
143
- case 'Undefined' : oCommand = new FCKUndefinedCommand() ; break ;
144
-
145
- // By default we assume that it is a named command.
146
- default:
147
- if ( FCKRegexLib.NamedCommands.test( commandName ) )
148
- oCommand = new FCKNamedCommand( commandName ) ;
149
- else
150
- {
151
- alert( FCKLang.UnknownCommand.replace( /%1/g, commandName ) ) ;
152
- return null ;
153
- }
154
- }
155
-
156
- FCKCommands.LoadedCommands[ commandName ] = oCommand ;
157
-
158
- return oCommand ;
159
- }
160
-
161
- // Gets the state of the "Document Properties" button. It must be enabled only
162
- // when "Full Page" editing is available.
163
- FCKCommands.GetFullPageState = function()
164
- {
165
- return FCKConfig.FullPage ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
166
- }
167
-
168
-
169
- FCKCommands.GetBooleanState = function( isDisabled )
170
- {
171
- return isDisabled ? FCK_TRISTATE_DISABLED : FCK_TRISTATE_OFF ;
172
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckconfig.js DELETED
@@ -1,237 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Creates and initializes the FCKConfig object.
22
- */
23
-
24
- var FCKConfig = FCK.Config = new Object() ;
25
-
26
- /*
27
- For the next major version (probably 3.0) we should move all this stuff to
28
- another dedicated object and leave FCKConfig as a holder object for settings only).
29
- */
30
-
31
- // Editor Base Path
32
- if ( document.location.protocol == 'file:' )
33
- {
34
- FCKConfig.BasePath = decodeURIComponent( document.location.pathname.substr(1) ) ;
35
- FCKConfig.BasePath = FCKConfig.BasePath.replace( /\\/gi, '/' ) ;
36
-
37
- // The way to address local files is different according to the OS.
38
- // In Windows it is file:// but in MacOs it is file:/// so let's get it automatically
39
- var sFullProtocol = document.location.href.match( /^(file\:\/{2,3})/ )[1] ;
40
- // #945 Opera does strange things with files loaded from the disk, and it fails in Mac to load xml files
41
- if ( FCKBrowserInfo.IsOpera )
42
- sFullProtocol += 'localhost/' ;
43
-
44
- FCKConfig.BasePath = sFullProtocol + FCKConfig.BasePath.substring( 0, FCKConfig.BasePath.lastIndexOf( '/' ) + 1) ;
45
- }
46
- else
47
- FCKConfig.BasePath = document.location.protocol + '//' + document.location.host +
48
- document.location.pathname.substring( 0, document.location.pathname.lastIndexOf( '/' ) + 1) ;
49
-
50
- FCKConfig.FullBasePath = FCKConfig.BasePath ;
51
-
52
- FCKConfig.EditorPath = FCKConfig.BasePath.replace( /editor\/$/, '' ) ;
53
-
54
- // There is a bug in Gecko. If the editor is hidden on startup, an error is
55
- // thrown when trying to get the screen dimensions.
56
- try
57
- {
58
- FCKConfig.ScreenWidth = screen.width ;
59
- FCKConfig.ScreenHeight = screen.height ;
60
- }
61
- catch (e)
62
- {
63
- FCKConfig.ScreenWidth = 800 ;
64
- FCKConfig.ScreenHeight = 600 ;
65
- }
66
-
67
- // Override the actual configuration values with the values passed throw the
68
- // hidden field "<InstanceName>___Config".
69
- FCKConfig.ProcessHiddenField = function()
70
- {
71
- this.PageConfig = new Object() ;
72
-
73
- // Get the hidden field.
74
- var oConfigField = window.parent.document.getElementById( FCK.Name + '___Config' ) ;
75
-
76
- // Do nothing if the config field was not defined.
77
- if ( ! oConfigField ) return ;
78
-
79
- var aCouples = oConfigField.value.split('&') ;
80
-
81
- for ( var i = 0 ; i < aCouples.length ; i++ )
82
- {
83
- if ( aCouples[i].length == 0 )
84
- continue ;
85
-
86
- var aConfig = aCouples[i].split( '=' ) ;
87
- var sKey = decodeURIComponent( aConfig[0] ) ;
88
- var sVal = decodeURIComponent( aConfig[1] ) ;
89
-
90
- if ( sKey == 'CustomConfigurationsPath' ) // The Custom Config File path must be loaded immediately.
91
- FCKConfig[ sKey ] = sVal ;
92
-
93
- else if ( sVal.toLowerCase() == "true" ) // If it is a boolean TRUE.
94
- this.PageConfig[ sKey ] = true ;
95
-
96
- else if ( sVal.toLowerCase() == "false" ) // If it is a boolean FALSE.
97
- this.PageConfig[ sKey ] = false ;
98
-
99
- else if ( sVal.length > 0 && !isNaN( sVal ) ) // If it is a number.
100
- this.PageConfig[ sKey ] = parseInt( sVal, 10 ) ;
101
-
102
- else // In any other case it is a string.
103
- this.PageConfig[ sKey ] = sVal ;
104
- }
105
- }
106
-
107
- function FCKConfig_LoadPageConfig()
108
- {
109
- var oPageConfig = FCKConfig.PageConfig ;
110
- for ( var sKey in oPageConfig )
111
- FCKConfig[ sKey ] = oPageConfig[ sKey ] ;
112
- }
113
-
114
- function FCKConfig_PreProcess()
115
- {
116
- var oConfig = FCKConfig ;
117
-
118
- // Force debug mode if fckdebug=true in the QueryString (main page).
119
- if ( oConfig.AllowQueryStringDebug )
120
- {
121
- try
122
- {
123
- if ( (/fckdebug=true/i).test( window.top.location.search ) )
124
- oConfig.Debug = true ;
125
- }
126
- catch (e) { /* Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error). */ }
127
- }
128
-
129
- // Certifies that the "PluginsPath" configuration ends with a slash.
130
- if ( !oConfig.PluginsPath.EndsWith('/') )
131
- oConfig.PluginsPath += '/' ;
132
-
133
- // If no ToolbarComboPreviewCSS, point it to EditorAreaCSS.
134
- var sComboPreviewCSS = oConfig.ToolbarComboPreviewCSS ;
135
- if ( !sComboPreviewCSS || sComboPreviewCSS.length == 0 )
136
- oConfig.ToolbarComboPreviewCSS = oConfig.EditorAreaCSS ;
137
-
138
- // Turn the attributes that will be removed in the RemoveFormat from a string to an array
139
- oConfig.RemoveAttributesArray = (oConfig.RemoveAttributes || '').split( ',' );
140
-
141
- if ( !FCKConfig.SkinEditorCSS || FCKConfig.SkinEditorCSS.length == 0 )
142
- FCKConfig.SkinEditorCSS = FCKConfig.SkinPath + 'fck_editor.css' ;
143
-
144
- if ( !FCKConfig.SkinDialogCSS || FCKConfig.SkinDialogCSS.length == 0 )
145
- FCKConfig.SkinDialogCSS = FCKConfig.SkinPath + 'fck_dialog.css' ;
146
- }
147
-
148
- // Define toolbar sets collection.
149
- FCKConfig.ToolbarSets = new Object() ;
150
-
151
- // Defines the plugins collection.
152
- FCKConfig.Plugins = new Object() ;
153
- FCKConfig.Plugins.Items = new Array() ;
154
-
155
- FCKConfig.Plugins.Add = function( name, langs, path )
156
- {
157
- FCKConfig.Plugins.Items.push( [name, langs, path] ) ;
158
- }
159
-
160
- // FCKConfig.ProtectedSource: object that holds a collection of Regular
161
- // Expressions that defined parts of the raw HTML that must remain untouched
162
- // like custom tags, scripts, server side code, etc...
163
- FCKConfig.ProtectedSource = new Object() ;
164
-
165
- // Generates a string used to identify and locate the Protected Tags comments.
166
- FCKConfig.ProtectedSource._CodeTag = (new Date()).valueOf() ;
167
-
168
- // Initialize the regex array with the default ones.
169
- FCKConfig.ProtectedSource.RegexEntries = [
170
- // First of any other protection, we must protect all comments to avoid
171
- // loosing them (of course, IE related).
172
- /<!--[\s\S]*?-->/g ,
173
-
174
- // Script tags will also be forced to be protected, otherwise IE will execute them.
175
- /<script[\s\S]*?<\/script>/gi,
176
-
177
- // <noscript> tags (get lost in IE and messed up in FF).
178
- /<noscript[\s\S]*?<\/noscript>/gi
179
- ] ;
180
-
181
- FCKConfig.ProtectedSource.Add = function( regexPattern )
182
- {
183
- this.RegexEntries.push( regexPattern ) ;
184
- }
185
-
186
- FCKConfig.ProtectedSource.Protect = function( html )
187
- {
188
- var codeTag = this._CodeTag ;
189
- function _Replace( protectedSource )
190
- {
191
- var index = FCKTempBin.AddElement( protectedSource ) ;
192
- return '<!--{' + codeTag + index + '}-->' ;
193
- }
194
-
195
- for ( var i = 0 ; i < this.RegexEntries.length ; i++ )
196
- {
197
- html = html.replace( this.RegexEntries[i], _Replace ) ;
198
- }
199
-
200
- return html ;
201
- }
202
-
203
- FCKConfig.ProtectedSource.Revert = function( html, clearBin )
204
- {
205
- function _Replace( m, opener, index )
206
- {
207
- var protectedValue = clearBin ? FCKTempBin.RemoveElement( index ) : FCKTempBin.Elements[ index ] ;
208
- // There could be protected source inside another one.
209
- return FCKConfig.ProtectedSource.Revert( protectedValue, clearBin ) ;
210
- }
211
-
212
- var regex = new RegExp( "(<|&lt;)!--\\{" + this._CodeTag + "(\\d+)\\}--(>|&gt;)", "g" ) ;
213
- return html.replace( regex, _Replace ) ;
214
- }
215
-
216
- // Returns a string with the attributes that must be appended to the body
217
- FCKConfig.GetBodyAttributes = function()
218
- {
219
- var bodyAttributes = '' ;
220
- // Add id and class to the body.
221
- if ( this.BodyId && this.BodyId.length > 0 )
222
- bodyAttributes += ' id="' + this.BodyId + '"' ;
223
- if ( this.BodyClass && this.BodyClass.length > 0 )
224
- bodyAttributes += ' class="' + this.BodyClass + '"' ;
225
-
226
- return bodyAttributes ;
227
- }
228
-
229
- // Sets the body attributes directly on the node
230
- FCKConfig.ApplyBodyAttributes = function( oBody )
231
- {
232
- // Add ID and Class to the body
233
- if ( this.BodyId && this.BodyId.length > 0 )
234
- oBody.id = FCKConfig.BodyId ;
235
- if ( this.BodyClass && this.BodyClass.length > 0 )
236
- oBody.className += ' ' + FCKConfig.BodyClass ;
237
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckdebug.js DELETED
@@ -1,59 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Debug window control and operations.
22
- */
23
-
24
- // Public function defined here must be declared in fckdebug_empty.js.
25
-
26
- var FCKDebug =
27
- {
28
- Output : function( message, color, noParse )
29
- {
30
- if ( ! FCKConfig.Debug )
31
- return ;
32
-
33
- try
34
- {
35
- this._GetWindow().Output( message, color, noParse ) ;
36
- }
37
- catch ( e ) {} // Ignore errors
38
- },
39
-
40
- OutputObject : function( anyObject, color )
41
- {
42
- if ( ! FCKConfig.Debug )
43
- return ;
44
-
45
- try
46
- {
47
- this._GetWindow().OutputObject( anyObject, color ) ;
48
- }
49
- catch ( e ) {} // Ignore errors
50
- },
51
-
52
- _GetWindow : function()
53
- {
54
- if ( !this.DebugWindow || this.DebugWindow.closed )
55
- this.DebugWindow = window.open( FCKConfig.BasePath + 'fckdebug.html', 'FCKeditorDebug', 'menubar=no,scrollbars=yes,resizable=yes,location=no,toolbar=no,width=600,height=500', true ) ;
56
-
57
- return this.DebugWindow ;
58
- }
59
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckdebug_empty.js DELETED
@@ -1,31 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Debug window control and operations (empty for the compressed files - #2043).
22
- */
23
-
24
- var FCKDebug =
25
- {
26
- Output : function()
27
- {},
28
-
29
- OutputObject : function()
30
- {}
31
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckdialog.js DELETED
@@ -1,239 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Dialog windows operations.
22
- */
23
-
24
- var FCKDialog = ( function()
25
- {
26
- var topDialog ;
27
- var baseZIndex ;
28
- var cover ;
29
-
30
- // The document that holds the dialog.
31
- var topWindow = window.parent ;
32
-
33
- while ( topWindow.parent && topWindow.parent != topWindow )
34
- {
35
- try
36
- {
37
- if ( topWindow.parent.document.domain != document.domain )
38
- break ;
39
- if ( topWindow.parent.document.getElementsByTagName( 'frameset' ).length > 0 )
40
- break ;
41
- }
42
- catch ( e )
43
- {
44
- break ;
45
- }
46
- topWindow = topWindow.parent ;
47
- }
48
-
49
- var topDocument = topWindow.document ;
50
-
51
- var getZIndex = function()
52
- {
53
- if ( !baseZIndex )
54
- baseZIndex = FCKConfig.FloatingPanelsZIndex + 999 ;
55
- return ++baseZIndex ;
56
- }
57
-
58
- // TODO : This logic is not actually working when reducing the window, only
59
- // when enlarging it.
60
- var resizeHandler = function()
61
- {
62
- if ( !cover )
63
- return ;
64
-
65
- var relElement = FCKTools.IsStrictMode( topDocument ) ? topDocument.documentElement : topDocument.body ;
66
-
67
- FCKDomTools.SetElementStyles( cover,
68
- {
69
- 'width' : Math.max( relElement.scrollWidth,
70
- relElement.clientWidth,
71
- topDocument.scrollWidth || 0 ) - 1 + 'px',
72
- 'height' : Math.max( relElement.scrollHeight,
73
- relElement.clientHeight,
74
- topDocument.scrollHeight || 0 ) - 1 + 'px'
75
- } ) ;
76
- }
77
-
78
- return {
79
- /**
80
- * Opens a dialog window using the standard dialog template.
81
- */
82
- OpenDialog : function( dialogName, dialogTitle, dialogPage, width, height, customValue, parentWindow, resizable )
83
- {
84
- if ( !topDialog )
85
- this.DisplayMainCover() ;
86
-
87
- // Setup the dialog info to be passed to the dialog.
88
- var dialogInfo =
89
- {
90
- Title : dialogTitle,
91
- Page : dialogPage,
92
- Editor : window,
93
- CustomValue : customValue, // Optional
94
- TopWindow : topWindow
95
- }
96
-
97
- FCK.ToolbarSet.CurrentInstance.Selection.Save( true ) ;
98
-
99
- // Calculate the dialog position, centering it on the screen.
100
- var viewSize = FCKTools.GetViewPaneSize( topWindow ) ;
101
- var scrollPosition = { 'X' : 0, 'Y' : 0 } ;
102
- var useAbsolutePosition = FCKBrowserInfo.IsIE && ( !FCKBrowserInfo.IsIE7 || !FCKTools.IsStrictMode( topWindow.document ) ) ;
103
- if ( useAbsolutePosition )
104
- scrollPosition = FCKTools.GetScrollPosition( topWindow ) ;
105
- var iTop = Math.max( scrollPosition.Y + ( viewSize.Height - height - 20 ) / 2, 0 ) ;
106
- var iLeft = Math.max( scrollPosition.X + ( viewSize.Width - width - 20 ) / 2, 0 ) ;
107
-
108
- // Setup the IFRAME that will hold the dialog.
109
- var dialog = topDocument.createElement( 'iframe' ) ;
110
- FCKTools.ResetStyles( dialog ) ;
111
- dialog.src = FCKConfig.BasePath + 'fckdialog.html' ;
112
-
113
- // Dummy URL for testing whether the code in fckdialog.js alone leaks memory.
114
- // dialog.src = 'about:blank';
115
-
116
- dialog.frameBorder = 0 ;
117
- dialog.allowTransparency = true ;
118
- FCKDomTools.SetElementStyles( dialog,
119
- {
120
- 'position' : ( useAbsolutePosition ) ? 'absolute' : 'fixed',
121
- 'top' : iTop + 'px',
122
- 'left' : iLeft + 'px',
123
- 'width' : width + 'px',
124
- 'height' : height + 'px',
125
- 'zIndex' : getZIndex()
126
- } ) ;
127
-
128
- // Save the dialog info to be used by the dialog page once loaded.
129
- dialog._DialogArguments = dialogInfo ;
130
-
131
- // Append the IFRAME to the target document.
132
- topDocument.body.appendChild( dialog ) ;
133
-
134
- // Keep record of the dialog's parent/child relationships.
135
- dialog._ParentDialog = topDialog ;
136
- topDialog = dialog ;
137
- },
138
-
139
- /**
140
- * (For internal use)
141
- * Called when the top dialog is closed.
142
- */
143
- OnDialogClose : function( dialogWindow )
144
- {
145
- var dialog = dialogWindow.frameElement ;
146
- FCKDomTools.RemoveNode( dialog ) ;
147
-
148
- if ( dialog._ParentDialog ) // Nested Dialog.
149
- {
150
- topDialog = dialog._ParentDialog ;
151
- dialog._ParentDialog.contentWindow.SetEnabled( true ) ;
152
- }
153
- else // First Dialog.
154
- {
155
- // Set the Focus in the browser, so the "OnBlur" event is not
156
- // fired. In IE, there is no need to do that because the dialog
157
- // already moved the selection to the editing area before
158
- // closing (EnsureSelection). Also, the Focus() call here
159
- // causes memory leak on IE7 (weird).
160
- if ( !FCKBrowserInfo.IsIE )
161
- FCK.Focus() ;
162
-
163
- this.HideMainCover() ;
164
- // Bug #1918: Assigning topDialog = null directly causes IE6 to crash.
165
- setTimeout( function(){ topDialog = null ; }, 0 ) ;
166
-
167
- // Release the previously saved selection.
168
- FCK.ToolbarSet.CurrentInstance.Selection.Release() ;
169
- }
170
- },
171
-
172
- DisplayMainCover : function()
173
- {
174
- // Setup the DIV that will be used to cover.
175
- cover = topDocument.createElement( 'div' ) ;
176
- FCKTools.ResetStyles( cover ) ;
177
- FCKDomTools.SetElementStyles( cover,
178
- {
179
- 'position' : 'absolute',
180
- 'zIndex' : getZIndex(),
181
- 'top' : '0px',
182
- 'left' : '0px',
183
- 'backgroundColor' : FCKConfig.BackgroundBlockerColor
184
- } ) ;
185
- FCKDomTools.SetOpacity( cover, FCKConfig.BackgroundBlockerOpacity ) ;
186
-
187
- // For IE6-, we need to fill the cover with a transparent IFRAME,
188
- // to properly block <select> fields.
189
- if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
190
- {
191
- var iframe = topDocument.createElement( 'iframe' ) ;
192
- FCKTools.ResetStyles( iframe ) ;
193
- iframe.hideFocus = true ;
194
- iframe.frameBorder = 0 ;
195
- iframe.src = FCKTools.GetVoidUrl() ;
196
- FCKDomTools.SetElementStyles( iframe,
197
- {
198
- 'width' : '100%',
199
- 'height' : '100%',
200
- 'position' : 'absolute',
201
- 'left' : '0px',
202
- 'top' : '0px',
203
- 'filter' : 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'
204
- } ) ;
205
- cover.appendChild( iframe ) ;
206
- }
207
-
208
- // We need to manually adjust the cover size on resize.
209
- FCKTools.AddEventListener( topWindow, 'resize', resizeHandler ) ;
210
- resizeHandler() ;
211
-
212
- topDocument.body.appendChild( cover ) ;
213
-
214
- FCKFocusManager.Lock() ;
215
-
216
- // Prevent the user from refocusing the disabled
217
- // editing window by pressing Tab. (Bug #2065)
218
- var el = FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'frameElement' ) ;
219
- el._fck_originalTabIndex = el.tabIndex ;
220
- el.tabIndex = -1 ;
221
- },
222
-
223
- HideMainCover : function()
224
- {
225
- FCKDomTools.RemoveNode( cover ) ;
226
- FCKFocusManager.Unlock() ;
227
-
228
- // Revert the tab index hack. (Bug #2065)
229
- var el = FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'frameElement' ) ;
230
- el.tabIndex = el._fck_originalTabIndex ;
231
- FCKDomTools.ClearElementJSProperty( el, '_fck_originalTabIndex' ) ;
232
- },
233
-
234
- GetCover : function()
235
- {
236
- return cover ;
237
- }
238
- } ;
239
- } )() ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckdocumentprocessor.js DELETED
@@ -1,270 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Advanced document processors.
22
- */
23
-
24
- var FCKDocumentProcessor = new Object() ;
25
- FCKDocumentProcessor._Items = new Array() ;
26
-
27
- FCKDocumentProcessor.AppendNew = function()
28
- {
29
- var oNewItem = new Object() ;
30
- this._Items.push( oNewItem ) ;
31
- return oNewItem ;
32
- }
33
-
34
- FCKDocumentProcessor.Process = function( document )
35
- {
36
- var bIsDirty = FCK.IsDirty() ;
37
- var oProcessor, i = 0 ;
38
- while( ( oProcessor = this._Items[i++] ) )
39
- oProcessor.ProcessDocument( document ) ;
40
- if ( !bIsDirty )
41
- FCK.ResetIsDirty() ;
42
- }
43
-
44
- var FCKDocumentProcessor_CreateFakeImage = function( fakeClass, realElement )
45
- {
46
- var oImg = FCKTools.GetElementDocument( realElement ).createElement( 'IMG' ) ;
47
- oImg.className = fakeClass ;
48
- oImg.src = FCKConfig.BasePath + 'images/spacer.gif' ;
49
- oImg.setAttribute( '_fckfakelement', 'true', 0 ) ;
50
- oImg.setAttribute( '_fckrealelement', FCKTempBin.AddElement( realElement ), 0 ) ;
51
- return oImg ;
52
- }
53
-
54
- // Link Anchors
55
- if ( FCKBrowserInfo.IsIE || FCKBrowserInfo.IsOpera )
56
- {
57
- var FCKAnchorsProcessor = FCKDocumentProcessor.AppendNew() ;
58
- FCKAnchorsProcessor.ProcessDocument = function( document )
59
- {
60
- var aLinks = document.getElementsByTagName( 'A' ) ;
61
-
62
- var oLink ;
63
- var i = aLinks.length - 1 ;
64
- while ( i >= 0 && ( oLink = aLinks[i--] ) )
65
- {
66
- // If it is anchor. Doesn't matter if it's also a link (even better: we show that it's both a link and an anchor)
67
- if ( oLink.name.length > 0 )
68
- {
69
- //if the anchor has some content then we just add a temporary class
70
- if ( oLink.innerHTML !== '' )
71
- {
72
- if ( FCKBrowserInfo.IsIE )
73
- oLink.className += ' FCK__AnchorC' ;
74
- }
75
- else
76
- {
77
- var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oLink.cloneNode(true) ) ;
78
- oImg.setAttribute( '_fckanchor', 'true', 0 ) ;
79
-
80
- oLink.parentNode.insertBefore( oImg, oLink ) ;
81
- oLink.parentNode.removeChild( oLink ) ;
82
- }
83
- }
84
- }
85
- }
86
- }
87
-
88
- // Page Breaks
89
- var FCKPageBreaksProcessor = FCKDocumentProcessor.AppendNew() ;
90
- FCKPageBreaksProcessor.ProcessDocument = function( document )
91
- {
92
- var aDIVs = document.getElementsByTagName( 'DIV' ) ;
93
-
94
- var eDIV ;
95
- var i = aDIVs.length - 1 ;
96
- while ( i >= 0 && ( eDIV = aDIVs[i--] ) )
97
- {
98
- if ( eDIV.style.pageBreakAfter == 'always' && eDIV.childNodes.length == 1 && eDIV.childNodes[0].style && eDIV.childNodes[0].style.display == 'none' )
99
- {
100
- var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__PageBreak', eDIV.cloneNode(true) ) ;
101
-
102
- eDIV.parentNode.insertBefore( oFakeImage, eDIV ) ;
103
- eDIV.parentNode.removeChild( eDIV ) ;
104
- }
105
- }
106
- /*
107
- var aCenters = document.getElementsByTagName( 'CENTER' ) ;
108
-
109
- var oCenter ;
110
- var i = aCenters.length - 1 ;
111
- while ( i >= 0 && ( oCenter = aCenters[i--] ) )
112
- {
113
- if ( oCenter.style.pageBreakAfter == 'always' && oCenter.innerHTML.Trim().length == 0 )
114
- {
115
- var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__PageBreak', oCenter.cloneNode(true) ) ;
116
-
117
- oCenter.parentNode.insertBefore( oFakeImage, oCenter ) ;
118
- oCenter.parentNode.removeChild( oCenter ) ;
119
- }
120
- }
121
- */
122
- }
123
-
124
- // EMBED and OBJECT tags.
125
- var FCKEmbedAndObjectProcessor = (function()
126
- {
127
- var customProcessors = [] ;
128
-
129
- var processElement = function( el )
130
- {
131
- var clone = el.cloneNode( true ) ;
132
- var replaceElement ;
133
- var fakeImg = replaceElement = FCKDocumentProcessor_CreateFakeImage( 'FCK__UnknownObject', clone ) ;
134
- FCKEmbedAndObjectProcessor.RefreshView( fakeImg, el ) ;
135
-
136
- for ( var i = 0 ; i < customProcessors.length ; i++ )
137
- replaceElement = customProcessors[i]( el, replaceElement ) || replaceElement ;
138
-
139
- if ( replaceElement != fakeImg )
140
- FCKTempBin.RemoveElement( fakeImg.getAttribute( '_fckrealelement' ) ) ;
141
-
142
- el.parentNode.replaceChild( replaceElement, el ) ;
143
- }
144
-
145
- var processElementsByName = function( elementName, doc )
146
- {
147
- var aObjects = doc.getElementsByTagName( elementName );
148
- for ( var i = aObjects.length - 1 ; i >= 0 ; i-- )
149
- processElement( aObjects[i] ) ;
150
- }
151
-
152
- var processObjectAndEmbed = function( doc )
153
- {
154
- processElementsByName( 'object', doc );
155
- processElementsByName( 'embed', doc );
156
- }
157
-
158
- return FCKTools.Merge( FCKDocumentProcessor.AppendNew(),
159
- {
160
- ProcessDocument : function( doc )
161
- {
162
- // Firefox 3 would sometimes throw an unknown exception while accessing EMBEDs and OBJECTs
163
- // without the setTimeout().
164
- if ( FCKBrowserInfo.IsGecko )
165
- FCKTools.RunFunction( processObjectAndEmbed, this, [ doc ] ) ;
166
- else
167
- processObjectAndEmbed( doc ) ;
168
- },
169
-
170
- RefreshView : function( placeHolder, original )
171
- {
172
- if ( original.getAttribute( 'width' ) > 0 )
173
- placeHolder.style.width = FCKTools.ConvertHtmlSizeToStyle( original.getAttribute( 'width' ) ) ;
174
-
175
- if ( original.getAttribute( 'height' ) > 0 )
176
- placeHolder.style.height = FCKTools.ConvertHtmlSizeToStyle( original.getAttribute( 'height' ) ) ;
177
- },
178
-
179
- AddCustomHandler : function( func )
180
- {
181
- customProcessors.push( func ) ;
182
- }
183
- } ) ;
184
- } )() ;
185
-
186
- FCK.GetRealElement = function( fakeElement )
187
- {
188
- var e = FCKTempBin.Elements[ fakeElement.getAttribute('_fckrealelement') ] ;
189
-
190
- if ( fakeElement.getAttribute('_fckflash') )
191
- {
192
- if ( fakeElement.style.width.length > 0 )
193
- e.width = FCKTools.ConvertStyleSizeToHtml( fakeElement.style.width ) ;
194
-
195
- if ( fakeElement.style.height.length > 0 )
196
- e.height = FCKTools.ConvertStyleSizeToHtml( fakeElement.style.height ) ;
197
- }
198
-
199
- return e ;
200
- }
201
-
202
- // HR Processor.
203
- // This is a IE only (tricky) thing. We protect all HR tags before loading them
204
- // (see FCK.ProtectTags). Here we put the HRs back.
205
- if ( FCKBrowserInfo.IsIE )
206
- {
207
- FCKDocumentProcessor.AppendNew().ProcessDocument = function( document )
208
- {
209
- var aHRs = document.getElementsByTagName( 'HR' ) ;
210
-
211
- var eHR ;
212
- var i = aHRs.length - 1 ;
213
- while ( i >= 0 && ( eHR = aHRs[i--] ) )
214
- {
215
- // Create the replacement HR.
216
- var newHR = document.createElement( 'hr' ) ;
217
- newHR.mergeAttributes( eHR, true ) ;
218
-
219
- // We must insert the new one after it. insertBefore will not work in all cases.
220
- FCKDomTools.InsertAfterNode( eHR, newHR ) ;
221
-
222
- eHR.parentNode.removeChild( eHR ) ;
223
- }
224
- }
225
- }
226
-
227
- // INPUT:hidden Processor.
228
- FCKDocumentProcessor.AppendNew().ProcessDocument = function( document )
229
- {
230
- var aInputs = document.getElementsByTagName( 'INPUT' ) ;
231
-
232
- var oInput ;
233
- var i = aInputs.length - 1 ;
234
- while ( i >= 0 && ( oInput = aInputs[i--] ) )
235
- {
236
- if ( oInput.type == 'hidden' )
237
- {
238
- var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__InputHidden', oInput.cloneNode(true) ) ;
239
- oImg.setAttribute( '_fckinputhidden', 'true', 0 ) ;
240
-
241
- oInput.parentNode.insertBefore( oImg, oInput ) ;
242
- oInput.parentNode.removeChild( oInput ) ;
243
- }
244
- }
245
- }
246
-
247
- // Flash handler.
248
- FCKEmbedAndObjectProcessor.AddCustomHandler( function( el, fakeImg )
249
- {
250
- if ( ! ( el.nodeName.IEquals( 'embed' ) && ( el.type == 'application/x-shockwave-flash' || /\.swf($|#|\?)/i.test( el.src ) ) ) )
251
- return ;
252
- fakeImg.className = 'FCK__Flash' ;
253
- fakeImg.setAttribute( '_fckflash', 'true', 0 );
254
- } ) ;
255
-
256
- // Buggy <span class="Apple-style-span"> tags added by Safari.
257
- if ( FCKBrowserInfo.IsSafari )
258
- {
259
- FCKDocumentProcessor.AppendNew().ProcessDocument = function( doc )
260
- {
261
- var spans = doc.getElementsByClassName ?
262
- doc.getElementsByClassName( 'Apple-style-span' ) :
263
- Array.prototype.filter.call(
264
- doc.getElementsByTagName( 'span' ),
265
- function( item ){ return item.className == 'Apple-style-span' ; }
266
- ) ;
267
- for ( var i = spans.length - 1 ; i >= 0 ; i-- )
268
- FCKDomTools.RemoveNode( spans[i], true ) ;
269
- }
270
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckdomtools.js DELETED
@@ -1,1057 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Utility functions to work with the DOM.
22
- */
23
-
24
- var FCKDomTools =
25
- {
26
- /**
27
- * Move all child nodes from one node to another.
28
- */
29
- MoveChildren : function( source, target, toTargetStart )
30
- {
31
- if ( source == target )
32
- return ;
33
-
34
- var eChild ;
35
-
36
- if ( toTargetStart )
37
- {
38
- while ( (eChild = source.lastChild) )
39
- target.insertBefore( source.removeChild( eChild ), target.firstChild ) ;
40
- }
41
- else
42
- {
43
- while ( (eChild = source.firstChild) )
44
- target.appendChild( source.removeChild( eChild ) ) ;
45
- }
46
- },
47
-
48
- MoveNode : function( source, target, toTargetStart )
49
- {
50
- if ( toTargetStart )
51
- target.insertBefore( FCKDomTools.RemoveNode( source ), target.firstChild ) ;
52
- else
53
- target.appendChild( FCKDomTools.RemoveNode( source ) ) ;
54
- },
55
-
56
- // Remove blank spaces from the beginning and the end of the contents of a node.
57
- TrimNode : function( node )
58
- {
59
- this.LTrimNode( node ) ;
60
- this.RTrimNode( node ) ;
61
- },
62
-
63
- LTrimNode : function( node )
64
- {
65
- var eChildNode ;
66
-
67
- while ( (eChildNode = node.firstChild) )
68
- {
69
- if ( eChildNode.nodeType == 3 )
70
- {
71
- var sTrimmed = eChildNode.nodeValue.LTrim() ;
72
- var iOriginalLength = eChildNode.nodeValue.length ;
73
-
74
- if ( sTrimmed.length == 0 )
75
- {
76
- node.removeChild( eChildNode ) ;
77
- continue ;
78
- }
79
- else if ( sTrimmed.length < iOriginalLength )
80
- {
81
- eChildNode.splitText( iOriginalLength - sTrimmed.length ) ;
82
- node.removeChild( node.firstChild ) ;
83
- }
84
- }
85
- break ;
86
- }
87
- },
88
-
89
- RTrimNode : function( node )
90
- {
91
- var eChildNode ;
92
-
93
- while ( (eChildNode = node.lastChild) )
94
- {
95
- if ( eChildNode.nodeType == 3 )
96
- {
97
- var sTrimmed = eChildNode.nodeValue.RTrim() ;
98
- var iOriginalLength = eChildNode.nodeValue.length ;
99
-
100
- if ( sTrimmed.length == 0 )
101
- {
102
- // If the trimmed text node is empty, just remove it.
103
-
104
- // Use "eChildNode.parentNode" instead of "node" to avoid IE bug (#81).
105
- eChildNode.parentNode.removeChild( eChildNode ) ;
106
- continue ;
107
- }
108
- else if ( sTrimmed.length < iOriginalLength )
109
- {
110
- // If the trimmed text length is less than the original
111
- // length, strip all spaces from the end by splitting
112
- // the text and removing the resulting useless node.
113
-
114
- eChildNode.splitText( sTrimmed.length ) ;
115
- // Use "node.lastChild.parentNode" instead of "node" to avoid IE bug (#81).
116
- node.lastChild.parentNode.removeChild( node.lastChild ) ;
117
- }
118
- }
119
- break ;
120
- }
121
-
122
- if ( !FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsOpera )
123
- {
124
- eChildNode = node.lastChild ;
125
-
126
- if ( eChildNode && eChildNode.nodeType == 1 && eChildNode.nodeName.toLowerCase() == 'br' )
127
- {
128
- // Use "eChildNode.parentNode" instead of "node" to avoid IE bug (#324).
129
- eChildNode.parentNode.removeChild( eChildNode ) ;
130
- }
131
- }
132
- },
133
-
134
- RemoveNode : function( node, excludeChildren )
135
- {
136
- if ( excludeChildren )
137
- {
138
- // Move all children before the node.
139
- var eChild ;
140
- while ( (eChild = node.firstChild) )
141
- node.parentNode.insertBefore( node.removeChild( eChild ), node ) ;
142
- }
143
-
144
- return node.parentNode.removeChild( node ) ;
145
- },
146
-
147
- GetFirstChild : function( node, childNames )
148
- {
149
- // If childNames is a string, transform it in a Array.
150
- if ( typeof ( childNames ) == 'string' )
151
- childNames = [ childNames ] ;
152
-
153
- var eChild = node.firstChild ;
154
- while( eChild )
155
- {
156
- if ( eChild.nodeType == 1 && eChild.tagName.Equals.apply( eChild.tagName, childNames ) )
157
- return eChild ;
158
-
159
- eChild = eChild.nextSibling ;
160
- }
161
-
162
- return null ;
163
- },
164
-
165
- GetLastChild : function( node, childNames )
166
- {
167
- // If childNames is a string, transform it in a Array.
168
- if ( typeof ( childNames ) == 'string' )
169
- childNames = [ childNames ] ;
170
-
171
- var eChild = node.lastChild ;
172
- while( eChild )
173
- {
174
- if ( eChild.nodeType == 1 && ( !childNames || eChild.tagName.Equals( childNames ) ) )
175
- return eChild ;
176
-
177
- eChild = eChild.previousSibling ;
178
- }
179
-
180
- return null ;
181
- },
182
-
183
- /*
184
- * Gets the previous element (nodeType=1) in the source order. Returns
185
- * "null" If no element is found.
186
- * @param {Object} currentNode The node to start searching from.
187
- * @param {Boolean} ignoreSpaceTextOnly Sets how text nodes will be
188
- * handled. If set to "true", only white spaces text nodes
189
- * will be ignored, while non white space text nodes will stop
190
- * the search, returning null. If "false" or omitted, all
191
- * text nodes are ignored.
192
- * @param {string[]} stopSearchElements An array of element names that
193
- * will cause the search to stop when found, returning null.
194
- * May be omitted (or null).
195
- * @param {string[]} ignoreElements An array of element names that
196
- * must be ignored during the search.
197
- */
198
- GetPreviousSourceElement : function( currentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements )
199
- {
200
- if ( !currentNode )
201
- return null ;
202
-
203
- if ( stopSearchElements && currentNode.nodeType == 1 && currentNode.nodeName.IEquals( stopSearchElements ) )
204
- return null ;
205
-
206
- if ( currentNode.previousSibling )
207
- currentNode = currentNode.previousSibling ;
208
- else
209
- return this.GetPreviousSourceElement( currentNode.parentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements ) ;
210
-
211
- while ( currentNode )
212
- {
213
- if ( currentNode.nodeType == 1 )
214
- {
215
- if ( stopSearchElements && currentNode.nodeName.IEquals( stopSearchElements ) )
216
- break ;
217
-
218
- if ( !ignoreElements || !currentNode.nodeName.IEquals( ignoreElements ) )
219
- return currentNode ;
220
- }
221
- else if ( ignoreSpaceTextOnly && currentNode.nodeType == 3 && currentNode.nodeValue.RTrim().length > 0 )
222
- break ;
223
-
224
- if ( currentNode.lastChild )
225
- currentNode = currentNode.lastChild ;
226
- else
227
- return this.GetPreviousSourceElement( currentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements ) ;
228
- }
229
-
230
- return null ;
231
- },
232
-
233
- /*
234
- * Gets the next element (nodeType=1) in the source order. Returns
235
- * "null" If no element is found.
236
- * @param {Object} currentNode The node to start searching from.
237
- * @param {Boolean} ignoreSpaceTextOnly Sets how text nodes will be
238
- * handled. If set to "true", only white spaces text nodes
239
- * will be ignored, while non white space text nodes will stop
240
- * the search, returning null. If "false" or omitted, all
241
- * text nodes are ignored.
242
- * @param {string[]} stopSearchElements An array of element names that
243
- * will cause the search to stop when found, returning null.
244
- * May be omitted (or null).
245
- * @param {string[]} ignoreElements An array of element names that
246
- * must be ignored during the search.
247
- */
248
- GetNextSourceElement : function( currentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements, startFromSibling )
249
- {
250
- while( ( currentNode = this.GetNextSourceNode( currentNode, startFromSibling ) ) ) // Only one "=".
251
- {
252
- if ( currentNode.nodeType == 1 )
253
- {
254
- if ( stopSearchElements && currentNode.nodeName.IEquals( stopSearchElements ) )
255
- break ;
256
-
257
- if ( ignoreElements && currentNode.nodeName.IEquals( ignoreElements ) )
258
- return this.GetNextSourceElement( currentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements ) ;
259
-
260
- return currentNode ;
261
- }
262
- else if ( ignoreSpaceTextOnly && currentNode.nodeType == 3 && currentNode.nodeValue.RTrim().length > 0 )
263
- break ;
264
- }
265
-
266
- return null ;
267
- },
268
-
269
- /*
270
- * Get the next DOM node available in source order.
271
- */
272
- GetNextSourceNode : function( currentNode, startFromSibling, nodeType, stopSearchNode )
273
- {
274
- if ( !currentNode )
275
- return null ;
276
-
277
- var node ;
278
-
279
- if ( !startFromSibling && currentNode.firstChild )
280
- node = currentNode.firstChild ;
281
- else
282
- {
283
- if ( stopSearchNode && currentNode == stopSearchNode )
284
- return null ;
285
-
286
- node = currentNode.nextSibling ;
287
-
288
- if ( !node && ( !stopSearchNode || stopSearchNode != currentNode.parentNode ) )
289
- return this.GetNextSourceNode( currentNode.parentNode, true, nodeType, stopSearchNode ) ;
290
- }
291
-
292
- if ( nodeType && node && node.nodeType != nodeType )
293
- return this.GetNextSourceNode( node, false, nodeType, stopSearchNode ) ;
294
-
295
- return node ;
296
- },
297
-
298
- /*
299
- * Get the next DOM node available in source order.
300
- */
301
- GetPreviousSourceNode : function( currentNode, startFromSibling, nodeType, stopSearchNode )
302
- {
303
- if ( !currentNode )
304
- return null ;
305
-
306
- var node ;
307
-
308
- if ( !startFromSibling && currentNode.lastChild )
309
- node = currentNode.lastChild ;
310
- else
311
- {
312
- if ( stopSearchNode && currentNode == stopSearchNode )
313
- return null ;
314
-
315
- node = currentNode.previousSibling ;
316
-
317
- if ( !node && ( !stopSearchNode || stopSearchNode != currentNode.parentNode ) )
318
- return this.GetPreviousSourceNode( currentNode.parentNode, true, nodeType, stopSearchNode ) ;
319
- }
320
-
321
- if ( nodeType && node && node.nodeType != nodeType )
322
- return this.GetPreviousSourceNode( node, false, nodeType, stopSearchNode ) ;
323
-
324
- return node ;
325
- },
326
-
327
- // Inserts a element after a existing one.
328
- InsertAfterNode : function( existingNode, newNode )
329
- {
330
- return existingNode.parentNode.insertBefore( newNode, existingNode.nextSibling ) ;
331
- },
332
-
333
- GetParents : function( node )
334
- {
335
- var parents = new Array() ;
336
-
337
- while ( node )
338
- {
339
- parents.unshift( node ) ;
340
- node = node.parentNode ;
341
- }
342
-
343
- return parents ;
344
- },
345
-
346
- GetCommonParents : function( node1, node2 )
347
- {
348
- var p1 = this.GetParents( node1 ) ;
349
- var p2 = this.GetParents( node2 ) ;
350
- var retval = [] ;
351
- for ( var i = 0 ; i < p1.length ; i++ )
352
- {
353
- if ( p1[i] == p2[i] )
354
- retval.push( p1[i] ) ;
355
- }
356
- return retval ;
357
- },
358
-
359
- GetCommonParentNode : function( node1, node2, tagList )
360
- {
361
- var tagMap = {} ;
362
- if ( ! tagList.pop )
363
- tagList = [ tagList ] ;
364
- while ( tagList.length > 0 )
365
- tagMap[tagList.pop().toLowerCase()] = 1 ;
366
-
367
- var commonParents = this.GetCommonParents( node1, node2 ) ;
368
- var currentParent = null ;
369
- while ( ( currentParent = commonParents.pop() ) )
370
- {
371
- if ( tagMap[currentParent.nodeName.toLowerCase()] )
372
- return currentParent ;
373
- }
374
- return null ;
375
- },
376
-
377
- GetIndexOf : function( node )
378
- {
379
- var currentNode = node.parentNode ? node.parentNode.firstChild : null ;
380
- var currentIndex = -1 ;
381
-
382
- while ( currentNode )
383
- {
384
- currentIndex++ ;
385
-
386
- if ( currentNode == node )
387
- return currentIndex ;
388
-
389
- currentNode = currentNode.nextSibling ;
390
- }
391
-
392
- return -1 ;
393
- },
394
-
395
- PaddingNode : null,
396
-
397
- EnforcePaddingNode : function( doc, tagName )
398
- {
399
- // In IE it can happen when the page is reloaded that doc or doc.body is null, so exit here
400
- try
401
- {
402
- if ( !doc || !doc.body )
403
- return ;
404
- }
405
- catch (e)
406
- {
407
- return ;
408
- }
409
-
410
- this.CheckAndRemovePaddingNode( doc, tagName, true ) ;
411
- try
412
- {
413
- if ( doc.body.lastChild && ( doc.body.lastChild.nodeType != 1
414
- || doc.body.lastChild.tagName.toLowerCase() == tagName.toLowerCase() ) )
415
- return ;
416
- }
417
- catch (e)
418
- {
419
- return ;
420
- }
421
-
422
- var node = doc.createElement( tagName ) ;
423
- if ( FCKBrowserInfo.IsGecko && FCKListsLib.NonEmptyBlockElements[ tagName ] )
424
- FCKTools.AppendBogusBr( node ) ;
425
- this.PaddingNode = node ;
426
- if ( doc.body.childNodes.length == 1
427
- && doc.body.firstChild.nodeType == 1
428
- && doc.body.firstChild.tagName.toLowerCase() == 'br'
429
- && ( doc.body.firstChild.getAttribute( '_moz_dirty' ) != null
430
- || doc.body.firstChild.getAttribute( 'type' ) == '_moz' ) )
431
- doc.body.replaceChild( node, doc.body.firstChild ) ;
432
- else
433
- doc.body.appendChild( node ) ;
434
- },
435
-
436
- CheckAndRemovePaddingNode : function( doc, tagName, dontRemove )
437
- {
438
- var paddingNode = this.PaddingNode ;
439
- if ( ! paddingNode )
440
- return ;
441
-
442
- // If the padding node is changed, remove its status as a padding node.
443
- try
444
- {
445
- if ( paddingNode.parentNode != doc.body
446
- || paddingNode.tagName.toLowerCase() != tagName
447
- || ( paddingNode.childNodes.length > 1 )
448
- || ( paddingNode.firstChild && paddingNode.firstChild.nodeValue != '\xa0'
449
- && String(paddingNode.firstChild.tagName).toLowerCase() != 'br' ) )
450
- {
451
- this.PaddingNode = null ;
452
- return ;
453
- }
454
- }
455
- catch (e)
456
- {
457
- this.PaddingNode = null ;
458
- return ;
459
- }
460
-
461
- // Now we're sure the padding node exists, and it is unchanged, and it
462
- // isn't the only node in doc.body, remove it.
463
- if ( !dontRemove )
464
- {
465
- if ( paddingNode.parentNode.childNodes.length > 1 )
466
- paddingNode.parentNode.removeChild( paddingNode ) ;
467
- this.PaddingNode = null ;
468
- }
469
- },
470
-
471
- HasAttribute : function( element, attributeName )
472
- {
473
- if ( element.hasAttribute )
474
- return element.hasAttribute( attributeName ) ;
475
- else
476
- {
477
- var att = element.attributes[ attributeName ] ;
478
- return ( att != undefined && att.specified ) ;
479
- }
480
- },
481
-
482
- /**
483
- * Checks if an element has "specified" attributes.
484
- */
485
- HasAttributes : function( element )
486
- {
487
- var attributes = element.attributes ;
488
-
489
- for ( var i = 0 ; i < attributes.length ; i++ )
490
- {
491
- if ( FCKBrowserInfo.IsIE && attributes[i].nodeName == 'class' )
492
- {
493
- // IE has a strange bug. If calling removeAttribute('className'),
494
- // the attributes collection will still contain the "class"
495
- // attribute, which will be marked as "specified", even if the
496
- // outerHTML of the element is not displaying the class attribute.
497
- // Note : I was not able to reproduce it outside the editor,
498
- // but I've faced it while working on the TC of #1391.
499
- if ( element.className.length > 0 )
500
- return true ;
501
- }
502
- else if ( attributes[i].specified )
503
- return true ;
504
- }
505
-
506
- return false ;
507
- },
508
-
509
- /**
510
- * Remove an attribute from an element.
511
- */
512
- RemoveAttribute : function( element, attributeName )
513
- {
514
- if ( FCKBrowserInfo.IsIE && attributeName.toLowerCase() == 'class' )
515
- attributeName = 'className' ;
516
-
517
- return element.removeAttribute( attributeName, 0 ) ;
518
- },
519
-
520
- /**
521
- * Removes an array of attributes from an element
522
- */
523
- RemoveAttributes : function (element, aAttributes )
524
- {
525
- for ( var i = 0 ; i < aAttributes.length ; i++ )
526
- this.RemoveAttribute( element, aAttributes[i] );
527
- },
528
-
529
- GetAttributeValue : function( element, att )
530
- {
531
- var attName = att ;
532
-
533
- if ( typeof att == 'string' )
534
- att = element.attributes[ att ] ;
535
- else
536
- attName = att.nodeName ;
537
-
538
- if ( att && att.specified )
539
- {
540
- // IE returns "null" for the nodeValue of a "style" attribute.
541
- if ( attName == 'style' )
542
- return element.style.cssText ;
543
- // There are two cases when the nodeValue must be used:
544
- // - for the "class" attribute (all browsers).
545
- // - for events attributes (IE only).
546
- else if ( attName == 'class' || attName.indexOf('on') == 0 )
547
- return att.nodeValue ;
548
- else
549
- {
550
- // Use getAttribute to get its value exactly as it is
551
- // defined.
552
- return element.getAttribute( attName, 2 ) ;
553
- }
554
- }
555
- return null ;
556
- },
557
-
558
- /**
559
- * Checks whether one element contains the other.
560
- */
561
- Contains : function( mainElement, otherElement )
562
- {
563
- // IE supports contains, but only for element nodes.
564
- if ( mainElement.contains && otherElement.nodeType == 1 )
565
- return mainElement.contains( otherElement ) ;
566
-
567
- while ( ( otherElement = otherElement.parentNode ) ) // Only one "="
568
- {
569
- if ( otherElement == mainElement )
570
- return true ;
571
- }
572
- return false ;
573
- },
574
-
575
- /**
576
- * Breaks a parent element in the position of one of its contained elements.
577
- * For example, in the following case:
578
- * <b>This <i>is some<span /> sample</i> test text</b>
579
- * If element = <span />, we have these results:
580
- * <b>This <i>is some</i><span /><i> sample</i> test text</b> (If parent = <i>)
581
- * <b>This <i>is some</i></b><span /><b><i> sample</i> test text</b> (If parent = <b>)
582
- */
583
- BreakParent : function( element, parent, reusableRange )
584
- {
585
- var range = reusableRange || new FCKDomRange( FCKTools.GetElementWindow( element ) ) ;
586
-
587
- // We'll be extracting part of this element, so let's use our
588
- // range to get the correct piece.
589
- range.SetStart( element, 4 ) ;
590
- range.SetEnd( parent, 4 ) ;
591
-
592
- // Extract it.
593
- var docFrag = range.ExtractContents() ;
594
-
595
- // Move the element outside the broken element.
596
- range.InsertNode( element.parentNode.removeChild( element ) ) ;
597
-
598
- // Re-insert the extracted piece after the element.
599
- docFrag.InsertAfterNode( element ) ;
600
-
601
- range.Release( !!reusableRange ) ;
602
- },
603
-
604
- /**
605
- * Retrieves a uniquely identifiable tree address of a DOM tree node.
606
- * The tree address returns is an array of integers, with each integer
607
- * indicating a child index from a DOM tree node, starting from
608
- * document.documentElement.
609
- *
610
- * For example, assuming <body> is the second child from <html> (<head>
611
- * being the first), and we'd like to address the third child under the
612
- * fourth child of body, the tree address returned would be:
613
- * [1, 3, 2]
614
- *
615
- * The tree address cannot be used for finding back the DOM tree node once
616
- * the DOM tree structure has been modified.
617
- */
618
- GetNodeAddress : function( node, normalized )
619
- {
620
- var retval = [] ;
621
- while ( node && node != FCKTools.GetElementDocument( node ).documentElement )
622
- {
623
- var parentNode = node.parentNode ;
624
- var currentIndex = -1 ;
625
- for( var i = 0 ; i < parentNode.childNodes.length ; i++ )
626
- {
627
- var candidate = parentNode.childNodes[i] ;
628
- if ( normalized === true &&
629
- candidate.nodeType == 3 &&
630
- candidate.previousSibling &&
631
- candidate.previousSibling.nodeType == 3 )
632
- continue;
633
- currentIndex++ ;
634
- if ( parentNode.childNodes[i] == node )
635
- break ;
636
- }
637
- retval.unshift( currentIndex ) ;
638
- node = node.parentNode ;
639
- }
640
- return retval ;
641
- },
642
-
643
- /**
644
- * The reverse transformation of FCKDomTools.GetNodeAddress(). This
645
- * function returns the DOM node pointed to by its index address.
646
- */
647
- GetNodeFromAddress : function( doc, addr, normalized )
648
- {
649
- var cursor = doc.documentElement ;
650
- for ( var i = 0 ; i < addr.length ; i++ )
651
- {
652
- var target = addr[i] ;
653
- if ( ! normalized )
654
- {
655
- cursor = cursor.childNodes[target] ;
656
- continue ;
657
- }
658
-
659
- var currentIndex = -1 ;
660
- for (var j = 0 ; j < cursor.childNodes.length ; j++ )
661
- {
662
- var candidate = cursor.childNodes[j] ;
663
- if ( normalized === true &&
664
- candidate.nodeType == 3 &&
665
- candidate.previousSibling &&
666
- candidate.previousSibling.nodeType == 3 )
667
- continue ;
668
- currentIndex++ ;
669
- if ( currentIndex == target )
670
- {
671
- cursor = candidate ;
672
- break ;
673
- }
674
- }
675
- }
676
- return cursor ;
677
- },
678
-
679
- CloneElement : function( element )
680
- {
681
- element = element.cloneNode( false ) ;
682
-
683
- // The "id" attribute should never be cloned to avoid duplication.
684
- element.removeAttribute( 'id', false ) ;
685
-
686
- return element ;
687
- },
688
-
689
- ClearElementJSProperty : function( element, attrName )
690
- {
691
- if ( FCKBrowserInfo.IsIE )
692
- element.removeAttribute( attrName ) ;
693
- else
694
- delete element[attrName] ;
695
- },
696
-
697
- SetElementMarker : function ( markerObj, element, attrName, value)
698
- {
699
- var id = String( parseInt( Math.random() * 0xffffffff, 10 ) ) ;
700
- element._FCKMarkerId = id ;
701
- element[attrName] = value ;
702
- if ( ! markerObj[id] )
703
- markerObj[id] = { 'element' : element, 'markers' : {} } ;
704
- markerObj[id]['markers'][attrName] = value ;
705
- },
706
-
707
- ClearElementMarkers : function( markerObj, element, clearMarkerObj )
708
- {
709
- var id = element._FCKMarkerId ;
710
- if ( ! id )
711
- return ;
712
- this.ClearElementJSProperty( element, '_FCKMarkerId' ) ;
713
- for ( var j in markerObj[id]['markers'] )
714
- this.ClearElementJSProperty( element, j ) ;
715
- if ( clearMarkerObj )
716
- delete markerObj[id] ;
717
- },
718
-
719
- ClearAllMarkers : function( markerObj )
720
- {
721
- for ( var i in markerObj )
722
- this.ClearElementMarkers( markerObj, markerObj[i]['element'], true ) ;
723
- },
724
-
725
- /**
726
- * Convert a DOM list tree into a data structure that is easier to
727
- * manipulate. This operation should be non-intrusive in the sense that it
728
- * does not change the DOM tree, with the exception that it may add some
729
- * markers to the list item nodes when markerObj is specified.
730
- */
731
- ListToArray : function( listNode, markerObj, baseArray, baseIndentLevel, grandparentNode )
732
- {
733
- if ( ! listNode.nodeName.IEquals( ['ul', 'ol'] ) )
734
- return [] ;
735
-
736
- if ( ! baseIndentLevel )
737
- baseIndentLevel = 0 ;
738
- if ( ! baseArray )
739
- baseArray = [] ;
740
- // Iterate over all list items to get their contents and look for inner lists.
741
- for ( var i = 0 ; i < listNode.childNodes.length ; i++ )
742
- {
743
- var listItem = listNode.childNodes[i] ;
744
- if ( ! listItem.nodeName.IEquals( 'li' ) )
745
- continue ;
746
- var itemObj = { 'parent' : listNode, 'indent' : baseIndentLevel, 'contents' : [] } ;
747
- if ( ! grandparentNode )
748
- {
749
- itemObj.grandparent = listNode.parentNode ;
750
- if ( itemObj.grandparent && itemObj.grandparent.nodeName.IEquals( 'li' ) )
751
- itemObj.grandparent = itemObj.grandparent.parentNode ;
752
- }
753
- else
754
- itemObj.grandparent = grandparentNode ;
755
- if ( markerObj )
756
- this.SetElementMarker( markerObj, listItem, '_FCK_ListArray_Index', baseArray.length ) ;
757
- baseArray.push( itemObj ) ;
758
- for ( var j = 0 ; j < listItem.childNodes.length ; j++ )
759
- {
760
- var child = listItem.childNodes[j] ;
761
- if ( child.nodeName.IEquals( ['ul', 'ol'] ) )
762
- // Note the recursion here, it pushes inner list items with
763
- // +1 indentation in the correct order.
764
- this.ListToArray( child, markerObj, baseArray, baseIndentLevel + 1, itemObj.grandparent ) ;
765
- else
766
- itemObj.contents.push( child ) ;
767
- }
768
- }
769
- return baseArray ;
770
- },
771
-
772
- // Convert our internal representation of a list back to a DOM forest.
773
- ArrayToList : function( listArray, markerObj, baseIndex )
774
- {
775
- if ( baseIndex == undefined )
776
- baseIndex = 0 ;
777
- if ( ! listArray || listArray.length < baseIndex + 1 )
778
- return null ;
779
- var doc = FCKTools.GetElementDocument( listArray[baseIndex].parent ) ;
780
- var retval = doc.createDocumentFragment() ;
781
- var rootNode = null ;
782
- var currentIndex = baseIndex ;
783
- var indentLevel = Math.max( listArray[baseIndex].indent, 0 ) ;
784
- var currentListItem = null ;
785
- while ( true )
786
- {
787
- var item = listArray[currentIndex] ;
788
- if ( item.indent == indentLevel )
789
- {
790
- if ( ! rootNode || listArray[currentIndex].parent.nodeName != rootNode.nodeName )
791
- {
792
- rootNode = listArray[currentIndex].parent.cloneNode( false ) ;
793
- retval.appendChild( rootNode ) ;
794
- }
795
- currentListItem = doc.createElement( 'li' ) ;
796
- rootNode.appendChild( currentListItem ) ;
797
- for ( var i = 0 ; i < item.contents.length ; i++ )
798
- currentListItem.appendChild( item.contents[i].cloneNode( true ) ) ;
799
- currentIndex++ ;
800
- }
801
- else if ( item.indent == Math.max( indentLevel, 0 ) + 1 )
802
- {
803
- var listData = this.ArrayToList( listArray, null, currentIndex ) ;
804
- currentListItem.appendChild( listData.listNode ) ;
805
- currentIndex = listData.nextIndex ;
806
- }
807
- else if ( item.indent == -1 && baseIndex == 0 && item.grandparent )
808
- {
809
- var currentListItem ;
810
- if ( item.grandparent.nodeName.IEquals( ['ul', 'ol'] ) )
811
- currentListItem = doc.createElement( 'li' ) ;
812
- else
813
- {
814
- if ( FCKConfig.EnterMode.IEquals( ['div', 'p'] ) && ! item.grandparent.nodeName.IEquals( 'td' ) )
815
- currentListItem = doc.createElement( FCKConfig.EnterMode ) ;
816
- else
817
- currentListItem = doc.createDocumentFragment() ;
818
- }
819
- for ( var i = 0 ; i < item.contents.length ; i++ )
820
- currentListItem.appendChild( item.contents[i].cloneNode( true ) ) ;
821
- if ( currentListItem.nodeType == 11 )
822
- {
823
- if ( currentListItem.lastChild &&
824
- currentListItem.lastChild.getAttribute &&
825
- currentListItem.lastChild.getAttribute( 'type' ) == '_moz' )
826
- currentListItem.removeChild( currentListItem.lastChild );
827
- currentListItem.appendChild( doc.createElement( 'br' ) ) ;
828
- }
829
- if ( currentListItem.nodeName.IEquals( FCKConfig.EnterMode ) && currentListItem.firstChild )
830
- {
831
- this.TrimNode( currentListItem ) ;
832
- if ( FCKListsLib.BlockBoundaries[currentListItem.firstChild.nodeName.toLowerCase()] )
833
- {
834
- var tmp = doc.createDocumentFragment() ;
835
- while ( currentListItem.firstChild )
836
- tmp.appendChild( currentListItem.removeChild( currentListItem.firstChild ) ) ;
837
- currentListItem = tmp ;
838
- }
839
- }
840
- if ( FCKBrowserInfo.IsGeckoLike && currentListItem.nodeName.IEquals( ['div', 'p'] ) )
841
- FCKTools.AppendBogusBr( currentListItem ) ;
842
- retval.appendChild( currentListItem ) ;
843
- rootNode = null ;
844
- currentIndex++ ;
845
- }
846
- else
847
- return null ;
848
-
849
- if ( listArray.length <= currentIndex || Math.max( listArray[currentIndex].indent, 0 ) < indentLevel )
850
- {
851
- break ;
852
- }
853
- }
854
-
855
- // Clear marker attributes for the new list tree made of cloned nodes, if any.
856
- if ( markerObj )
857
- {
858
- var currentNode = retval.firstChild ;
859
- while ( currentNode )
860
- {
861
- if ( currentNode.nodeType == 1 )
862
- this.ClearElementMarkers( markerObj, currentNode ) ;
863
- currentNode = this.GetNextSourceNode( currentNode ) ;
864
- }
865
- }
866
-
867
- return { 'listNode' : retval, 'nextIndex' : currentIndex } ;
868
- },
869
-
870
- /**
871
- * Get the next sibling node for a node. If "includeEmpties" is false,
872
- * only element or non empty text nodes are returned.
873
- */
874
- GetNextSibling : function( node, includeEmpties )
875
- {
876
- node = node.nextSibling ;
877
-
878
- while ( node && !includeEmpties && node.nodeType != 1 && ( node.nodeType != 3 || node.nodeValue.length == 0 ) )
879
- node = node.nextSibling ;
880
-
881
- return node ;
882
- },
883
-
884
- /**
885
- * Get the previous sibling node for a node. If "includeEmpties" is false,
886
- * only element or non empty text nodes are returned.
887
- */
888
- GetPreviousSibling : function( node, includeEmpties )
889
- {
890
- node = node.previousSibling ;
891
-
892
- while ( node && !includeEmpties && node.nodeType != 1 && ( node.nodeType != 3 || node.nodeValue.length == 0 ) )
893
- node = node.previousSibling ;
894
-
895
- return node ;
896
- },
897
-
898
- /**
899
- * Checks if an element has no "useful" content inside of it
900
- * node tree. No "useful" content means empty text node or a signle empty
901
- * inline node.
902
- * elementCheckCallback may point to a function that returns a boolean
903
- * indicating that a child element must be considered in the element check.
904
- */
905
- CheckIsEmptyElement : function( element, elementCheckCallback )
906
- {
907
- var child = element.firstChild ;
908
- var elementChild ;
909
-
910
- while ( child )
911
- {
912
- if ( child.nodeType == 1 )
913
- {
914
- if ( elementChild || !FCKListsLib.InlineNonEmptyElements[ child.nodeName.toLowerCase() ] )
915
- return false ;
916
-
917
- if ( !elementCheckCallback || elementCheckCallback( child ) === true )
918
- elementChild = child ;
919
- }
920
- else if ( child.nodeType == 3 && child.nodeValue.length > 0 )
921
- return false ;
922
-
923
- child = child.nextSibling ;
924
- }
925
-
926
- return elementChild ? this.CheckIsEmptyElement( elementChild, elementCheckCallback ) : true ;
927
- },
928
-
929
- SetElementStyles : function( element, styleDict )
930
- {
931
- var style = element.style ;
932
- for ( var styleName in styleDict )
933
- style[ styleName ] = styleDict[ styleName ] ;
934
- },
935
-
936
- SetOpacity : function( element, opacity )
937
- {
938
- if ( FCKBrowserInfo.IsIE )
939
- {
940
- opacity = Math.round( opacity * 100 ) ;
941
- element.style.filter = ( opacity > 100 ? '' : 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + opacity + ')' ) ;
942
- }
943
- else
944
- element.style.opacity = opacity ;
945
- },
946
-
947
- GetCurrentElementStyle : function( element, propertyName )
948
- {
949
- if ( FCKBrowserInfo.IsIE )
950
- return element.currentStyle[ propertyName ] ;
951
- else
952
- return element.ownerDocument.defaultView.getComputedStyle( element, '' ).getPropertyValue( propertyName ) ;
953
- },
954
-
955
- GetPositionedAncestor : function( element )
956
- {
957
- var currentElement = element ;
958
-
959
- while ( currentElement != FCKTools.GetElementDocument( currentElement ).documentElement )
960
- {
961
- if ( this.GetCurrentElementStyle( currentElement, 'position' ) != 'static' )
962
- return currentElement ;
963
-
964
- if ( currentElement == FCKTools.GetElementDocument( currentElement ).documentElement
965
- && currentWindow != w )
966
- currentElement = currentWindow.frameElement ;
967
- else
968
- currentElement = currentElement.parentNode ;
969
- }
970
-
971
- return null ;
972
- },
973
-
974
- /**
975
- * Current implementation for ScrollIntoView (due to #1462 and #2279). We
976
- * don't have a complete implementation here, just the things that fit our
977
- * needs.
978
- */
979
- ScrollIntoView : function( element, alignTop )
980
- {
981
- // Get the element window.
982
- var window = FCKTools.GetElementWindow( element ) ;
983
- var windowHeight = FCKTools.GetViewPaneSize( window ).Height ;
984
-
985
- // Starts the offset that will be scrolled with the negative value of
986
- // the visible window height.
987
- var offset = windowHeight * -1 ;
988
-
989
- // Appends the height it we are about to align the bottoms.
990
- if ( alignTop === false )
991
- {
992
- offset += element.offsetHeight || 0 ;
993
-
994
- // Consider the margin in the scroll, which is ok for our current
995
- // needs, but needs investigation if we will be using this function
996
- // in other places.
997
- offset += parseInt( this.GetCurrentElementStyle( element, 'marginBottom' ) || 0, 10 ) || 0 ;
998
- }
999
-
1000
- // Appends the offsets for the entire element hierarchy.
1001
- var elementPosition = FCKTools.GetDocumentPosition( window, element ) ;
1002
- offset += elementPosition.y ;
1003
-
1004
- // Scroll the window to the desired position, if not already visible.
1005
- var currentScroll = FCKTools.GetScrollPosition( window ).Y ;
1006
- if ( offset > 0 && ( offset > currentScroll || offset < currentScroll - windowHeight ) )
1007
- window.scrollTo( 0, offset ) ;
1008
- },
1009
-
1010
- /**
1011
- * Check if the element can be edited inside the browser.
1012
- */
1013
- CheckIsEditable : function( element )
1014
- {
1015
- // Get the element name.
1016
- var nodeName = element.nodeName.toLowerCase() ;
1017
-
1018
- // Get the element DTD (defaults to span for unknown elements).
1019
- var childDTD = FCK.DTD[ nodeName ] || FCK.DTD.span ;
1020
-
1021
- // In the DTD # == text node.
1022
- return ( childDTD['#'] && !FCKListsLib.NonEditableElements[ nodeName ] ) ;
1023
- },
1024
-
1025
- GetSelectedDivContainers : function()
1026
- {
1027
- var currentBlocks = [] ;
1028
- var range = new FCKDomRange( FCK.EditorWindow ) ;
1029
- range.MoveToSelection() ;
1030
-
1031
- var startNode = range.GetTouchedStartNode() ;
1032
- var endNode = range.GetTouchedEndNode() ;
1033
- var currentNode = startNode ;
1034
-
1035
- if ( startNode == endNode )
1036
- {
1037
- while ( endNode.nodeType == 1 && endNode.lastChild )
1038
- endNode = endNode.lastChild ;
1039
- endNode = FCKDomTools.GetNextSourceNode( endNode ) ;
1040
- }
1041
-
1042
- while ( currentNode && currentNode != endNode )
1043
- {
1044
- if ( currentNode.nodeType != 3 || !/^[ \t\n]*$/.test( currentNode.nodeValue ) )
1045
- {
1046
- var path = new FCKElementPath( currentNode ) ;
1047
- var blockLimit = path.BlockLimit ;
1048
- if ( blockLimit && blockLimit.nodeName.IEquals( 'div' ) && currentBlocks.IndexOf( blockLimit ) == -1 )
1049
- currentBlocks.push( blockLimit ) ;
1050
- }
1051
-
1052
- currentNode = FCKDomTools.GetNextSourceNode( currentNode ) ;
1053
- }
1054
-
1055
- return currentBlocks ;
1056
- }
1057
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcklanguagemanager.js DELETED
@@ -1,165 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Defines the FCKLanguageManager object that is used for language
22
- * operations.
23
- */
24
-
25
- var FCKLanguageManager = FCK.Language =
26
- {
27
- AvailableLanguages :
28
- {
29
- af : 'Afrikaans',
30
- ar : 'Arabic',
31
- bg : 'Bulgarian',
32
- bn : 'Bengali/Bangla',
33
- bs : 'Bosnian',
34
- ca : 'Catalan',
35
- cs : 'Czech',
36
- da : 'Danish',
37
- de : 'German',
38
- el : 'Greek',
39
- en : 'English',
40
- 'en-au' : 'English (Australia)',
41
- 'en-ca' : 'English (Canadian)',
42
- 'en-uk' : 'English (United Kingdom)',
43
- eo : 'Esperanto',
44
- es : 'Spanish',
45
- et : 'Estonian',
46
- eu : 'Basque',
47
- fa : 'Persian',
48
- fi : 'Finnish',
49
- fo : 'Faroese',
50
- fr : 'French',
51
- 'fr-ca' : 'French (Canada)',
52
- gl : 'Galician',
53
- gu : 'Gujarati',
54
- he : 'Hebrew',
55
- hi : 'Hindi',
56
- hr : 'Croatian',
57
- hu : 'Hungarian',
58
- is : 'Icelandic',
59
- it : 'Italian',
60
- ja : 'Japanese',
61
- km : 'Khmer',
62
- ko : 'Korean',
63
- lt : 'Lithuanian',
64
- lv : 'Latvian',
65
- mn : 'Mongolian',
66
- ms : 'Malay',
67
- nb : 'Norwegian Bokmal',
68
- nl : 'Dutch',
69
- no : 'Norwegian',
70
- pl : 'Polish',
71
- pt : 'Portuguese (Portugal)',
72
- 'pt-br' : 'Portuguese (Brazil)',
73
- ro : 'Romanian',
74
- ru : 'Russian',
75
- sk : 'Slovak',
76
- sl : 'Slovenian',
77
- sr : 'Serbian (Cyrillic)',
78
- 'sr-latn' : 'Serbian (Latin)',
79
- sv : 'Swedish',
80
- th : 'Thai',
81
- tr : 'Turkish',
82
- uk : 'Ukrainian',
83
- vi : 'Vietnamese',
84
- zh : 'Chinese Traditional',
85
- 'zh-cn' : 'Chinese Simplified'
86
- },
87
-
88
- GetActiveLanguage : function()
89
- {
90
- if ( FCKConfig.AutoDetectLanguage )
91
- {
92
- var sUserLang ;
93
-
94
- // IE accepts "navigator.userLanguage" while Gecko "navigator.language".
95
- if ( navigator.userLanguage )
96
- sUserLang = navigator.userLanguage.toLowerCase() ;
97
- else if ( navigator.language )
98
- sUserLang = navigator.language.toLowerCase() ;
99
- else
100
- {
101
- // Firefox 1.0 PR has a bug: it doens't support the "language" property.
102
- return FCKConfig.DefaultLanguage ;
103
- }
104
-
105
- // Some language codes are set in 5 characters,
106
- // like "pt-br" for Brazilian Portuguese.
107
- if ( sUserLang.length >= 5 )
108
- {
109
- sUserLang = sUserLang.substr(0,5) ;
110
- if ( this.AvailableLanguages[sUserLang] ) return sUserLang ;
111
- }
112
-
113
- // If the user's browser is set to, for example, "pt-br" but only the
114
- // "pt" language file is available then get that file.
115
- if ( sUserLang.length >= 2 )
116
- {
117
- sUserLang = sUserLang.substr(0,2) ;
118
- if ( this.AvailableLanguages[sUserLang] ) return sUserLang ;
119
- }
120
- }
121
-
122
- return this.DefaultLanguage ;
123
- },
124
-
125
- TranslateElements : function( targetDocument, tag, propertyToSet, encode )
126
- {
127
- var e = targetDocument.getElementsByTagName(tag) ;
128
- var sKey, s ;
129
- for ( var i = 0 ; i < e.length ; i++ )
130
- {
131
- // The extra () is to avoid a warning with strict error checking. This is ok.
132
- if ( (sKey = e[i].getAttribute( 'fckLang' )) )
133
- {
134
- // The extra () is to avoid a warning with strict error checking. This is ok.
135
- if ( (s = FCKLang[ sKey ]) )
136
- {
137
- if ( encode )
138
- s = FCKTools.HTMLEncode( s ) ;
139
- e[i][ propertyToSet ] = s ;
140
- }
141
- }
142
- }
143
- },
144
-
145
- TranslatePage : function( targetDocument )
146
- {
147
- this.TranslateElements( targetDocument, 'INPUT', 'value' ) ;
148
- this.TranslateElements( targetDocument, 'SPAN', 'innerHTML' ) ;
149
- this.TranslateElements( targetDocument, 'LABEL', 'innerHTML' ) ;
150
- this.TranslateElements( targetDocument, 'OPTION', 'innerHTML', true ) ;
151
- this.TranslateElements( targetDocument, 'LEGEND', 'innerHTML' ) ;
152
- },
153
-
154
- Initialize : function()
155
- {
156
- if ( this.AvailableLanguages[ FCKConfig.DefaultLanguage ] )
157
- this.DefaultLanguage = FCKConfig.DefaultLanguage ;
158
- else
159
- this.DefaultLanguage = 'en' ;
160
-
161
- this.ActiveLanguage = new Object() ;
162
- this.ActiveLanguage.Code = this.GetActiveLanguage() ;
163
- this.ActiveLanguage.Name = this.AvailableLanguages[ this.ActiveLanguage.Code ] ;
164
- }
165
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcklisthandler.js DELETED
@@ -1,152 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Tool object to manage HTML lists items (UL, OL and LI).
22
- */
23
-
24
- var FCKListHandler =
25
- {
26
- OutdentListItem : function( listItem )
27
- {
28
- var eParent = listItem.parentNode ;
29
-
30
- // It may happen that a LI is not in a UL or OL (Orphan).
31
- if ( eParent.tagName.toUpperCase().Equals( 'UL','OL' ) )
32
- {
33
- var oDocument = FCKTools.GetElementDocument( listItem ) ;
34
- var oDogFrag = new FCKDocumentFragment( oDocument ) ;
35
-
36
- // All children and successive siblings will be moved to a a DocFrag.
37
- var eNextSiblings = oDogFrag.RootNode ;
38
- var eHasLiSibling = false ;
39
-
40
- // If we have nested lists inside it, let's move it to the list of siblings.
41
- var eChildList = FCKDomTools.GetFirstChild( listItem, ['UL','OL'] ) ;
42
- if ( eChildList )
43
- {
44
- eHasLiSibling = true ;
45
-
46
- var eChild ;
47
- // The extra () is to avoid a warning with strict error checking. This is ok.
48
- while ( (eChild = eChildList.firstChild) )
49
- eNextSiblings.appendChild( eChildList.removeChild( eChild ) ) ;
50
-
51
- FCKDomTools.RemoveNode( eChildList ) ;
52
- }
53
-
54
- // Move all successive siblings.
55
- var eSibling ;
56
- var eHasSuccessiveLiSibling = false ;
57
- // The extra () is to avoid a warning with strict error checking. This is ok.
58
- while ( (eSibling = listItem.nextSibling) )
59
- {
60
- if ( !eHasLiSibling && eSibling.nodeType == 1 && eSibling.nodeName.toUpperCase() == 'LI' )
61
- eHasSuccessiveLiSibling = eHasLiSibling = true ;
62
-
63
- eNextSiblings.appendChild( eSibling.parentNode.removeChild( eSibling ) ) ;
64
-
65
- // If a sibling is a incorrectly nested UL or OL, consider only its children.
66
- if ( !eHasSuccessiveLiSibling && eSibling.nodeType == 1 && eSibling.nodeName.toUpperCase().Equals( 'UL','OL' ) )
67
- FCKDomTools.RemoveNode( eSibling, true ) ;
68
- }
69
-
70
- // If we are in a list chain.
71
- var sParentParentTag = eParent.parentNode.tagName.toUpperCase() ;
72
- var bWellNested = ( sParentParentTag == 'LI' ) ;
73
- if ( bWellNested || sParentParentTag.Equals( 'UL','OL' ) )
74
- {
75
- if ( eHasLiSibling )
76
- {
77
- var eChildList = eParent.cloneNode( false ) ;
78
- oDogFrag.AppendTo( eChildList ) ;
79
- listItem.appendChild( eChildList ) ;
80
- }
81
- else if ( bWellNested )
82
- oDogFrag.InsertAfterNode( eParent.parentNode ) ;
83
- else
84
- oDogFrag.InsertAfterNode( eParent ) ;
85
-
86
- // Move the LI after its parent.parentNode (the upper LI in the hierarchy).
87
- if ( bWellNested )
88
- FCKDomTools.InsertAfterNode( eParent.parentNode, eParent.removeChild( listItem ) ) ;
89
- else
90
- FCKDomTools.InsertAfterNode( eParent, eParent.removeChild( listItem ) ) ;
91
- }
92
- else
93
- {
94
- if ( eHasLiSibling )
95
- {
96
- var eNextList = eParent.cloneNode( false ) ;
97
- oDogFrag.AppendTo( eNextList ) ;
98
- FCKDomTools.InsertAfterNode( eParent, eNextList ) ;
99
- }
100
-
101
- var eBlock = oDocument.createElement( FCKConfig.EnterMode == 'p' ? 'p' : 'div' ) ;
102
- FCKDomTools.MoveChildren( eParent.removeChild( listItem ), eBlock ) ;
103
- FCKDomTools.InsertAfterNode( eParent, eBlock ) ;
104
-
105
- if ( FCKConfig.EnterMode == 'br' )
106
- {
107
- // We need the bogus to make it work properly. In Gecko, we
108
- // need it before the new block, on IE, after it.
109
- if ( FCKBrowserInfo.IsGecko )
110
- eBlock.parentNode.insertBefore( FCKTools.CreateBogusBR( oDocument ), eBlock ) ;
111
- else
112
- FCKDomTools.InsertAfterNode( eBlock, FCKTools.CreateBogusBR( oDocument ) ) ;
113
-
114
- FCKDomTools.RemoveNode( eBlock, true ) ;
115
- }
116
- }
117
-
118
- if ( this.CheckEmptyList( eParent ) )
119
- FCKDomTools.RemoveNode( eParent, true ) ;
120
- }
121
- },
122
-
123
- CheckEmptyList : function( listElement )
124
- {
125
- return ( FCKDomTools.GetFirstChild( listElement, 'LI' ) == null ) ;
126
- },
127
-
128
- // Check if the list has contents (excluding nested lists).
129
- CheckListHasContents : function( listElement )
130
- {
131
- var eChildNode = listElement.firstChild ;
132
-
133
- while ( eChildNode )
134
- {
135
- switch ( eChildNode.nodeType )
136
- {
137
- case 1 :
138
- if ( !eChildNode.nodeName.IEquals( 'UL','LI' ) )
139
- return true ;
140
- break ;
141
-
142
- case 3 :
143
- if ( eChildNode.nodeValue.Trim().length > 0 )
144
- return true ;
145
- }
146
-
147
- eChildNode = eChildNode.nextSibling ;
148
- }
149
-
150
- return false ;
151
- }
152
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcklistslib.js DELETED
@@ -1,63 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Library of keys collections.
22
- *
23
- * Test have shown that check for the existence of a key in an object is the
24
- * most efficient list entry check (10x faster that regex). Example:
25
- * if ( FCKListsLib.<ListName>[key] != null )
26
- */
27
-
28
- var FCKListsLib =
29
- {
30
- // We are not handling <ins> and <del> as block elements, for now.
31
- BlockElements : { address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,marquee:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },
32
-
33
- // Block elements that may be filled with &nbsp; if empty.
34
- NonEmptyBlockElements : { p:1,div:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },
35
-
36
- // Inline elements which MUST have child nodes.
37
- InlineChildReqElements : { abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },
38
-
39
- // Inline elements which are not marked as empty "Empty" in the XHTML DTD.
40
- InlineNonEmptyElements : { a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },
41
-
42
- // Elements marked as empty "Empty" in the XHTML DTD.
43
- EmptyElements : { base:1,col:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },
44
-
45
- // Elements that may be considered the "Block boundary" in an element path.
46
- PathBlockElements : { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },
47
-
48
- // Elements that may be considered the "Block limit" in an element path.
49
- PathBlockLimitElements : { body:1,div:1,td:1,th:1,caption:1,form:1 },
50
-
51
- // Block elements for the Styles System.
52
- StyleBlockElements : { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },
53
-
54
- // Object elements for the Styles System.
55
- StyleObjectElements : { img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },
56
-
57
- // Elements that accept text nodes, but are not possible to edit in the browser.
58
- NonEditableElements : { button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },
59
-
60
- // Elements used to separate block contents.
61
- BlockBoundaries : { p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },
62
- ListBoundaries : { p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 }
63
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckplugins.js DELETED
@@ -1,46 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Defines the FCKPlugins object that is responsible for loading the Plugins.
22
- */
23
-
24
- var FCKPlugins = FCK.Plugins = new Object() ;
25
- FCKPlugins.ItemsCount = 0 ;
26
- FCKPlugins.Items = new Object() ;
27
-
28
- FCKPlugins.Load = function()
29
- {
30
- var oItems = FCKPlugins.Items ;
31
-
32
- // build the plugins collection.
33
- for ( var i = 0 ; i < FCKConfig.Plugins.Items.length ; i++ )
34
- {
35
- var oItem = FCKConfig.Plugins.Items[i] ;
36
- var oPlugin = oItems[ oItem[0] ] = new FCKPlugin( oItem[0], oItem[1], oItem[2] ) ;
37
- FCKPlugins.ItemsCount++ ;
38
- }
39
-
40
- // Load all items in the plugins collection.
41
- for ( var s in oItems )
42
- oItems[s].Load() ;
43
-
44
- // This is a self destroyable function (must be called once).
45
- FCKPlugins.Load = null ;
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckregexlib.js DELETED
@@ -1,100 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * These are some Regular Expressions used by the editor.
22
- */
23
-
24
- var FCKRegexLib =
25
- {
26
- // This is the Regular expression used by the SetData method for the "&apos;" entity.
27
- AposEntity : /&apos;/gi ,
28
-
29
- // Used by the Styles combo to identify styles that can't be applied to text.
30
- ObjectElements : /^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT|A|UL|OL|LI)$/i ,
31
-
32
- // List all named commands (commands that can be interpreted by the browser "execCommand" method.
33
- NamedCommands : /^(?:Cut|Copy|Paste|Print|SelectAll|RemoveFormat|Unlink|Undo|Redo|Bold|Italic|Underline|StrikeThrough|Subscript|Superscript|JustifyLeft|JustifyCenter|JustifyRight|JustifyFull|Outdent|Indent|InsertOrderedList|InsertUnorderedList|InsertHorizontalRule)$/i ,
34
-
35
- BeforeBody : /(^[\s\S]*\<body[^\>]*\>)/i,
36
- AfterBody : /(\<\/body\>[\s\S]*$)/i,
37
-
38
- // Temporary text used to solve some browser specific limitations.
39
- ToReplace : /___fcktoreplace:([\w]+)/ig ,
40
-
41
- // Get the META http-equiv attribute from the tag.
42
- MetaHttpEquiv : /http-equiv\s*=\s*["']?([^"' ]+)/i ,
43
-
44
- HasBaseTag : /<base /i ,
45
- HasBodyTag : /<body[\s|>]/i ,
46
-
47
- HtmlOpener : /<html\s?[^>]*>/i ,
48
- HeadOpener : /<head\s?[^>]*>/i ,
49
- HeadCloser : /<\/head\s*>/i ,
50
-
51
- // Temporary classes (Tables without border, Anchors with content) used in IE
52
- FCK_Class : /\s*FCK__[^ ]*(?=\s+|$)/ ,
53
-
54
- // Validate element names (it must be in lowercase).
55
- ElementName : /(^[a-z_:][\w.\-:]*\w$)|(^[a-z_]$)/ ,
56
-
57
- // Used in conjunction with the FCKConfig.ForceSimpleAmpersand configuration option.
58
- ForceSimpleAmpersand : /___FCKAmp___/g ,
59
-
60
- // Get the closing parts of the tags with no closing tags, like <br/>... gets the "/>" part.
61
- SpaceNoClose : /\/>/g ,
62
-
63
- // Empty elements may be <p></p> or even a simple opening <p> (see #211).
64
- EmptyParagraph : /^<(p|div|address|h\d|center)(?=[ >])[^>]*>\s*(<\/\1>)?$/ ,
65
-
66
- EmptyOutParagraph : /^<(p|div|address|h\d|center)(?=[ >])[^>]*>(?:\s*|&nbsp;)(<\/\1>)?$/ ,
67
-
68
- TagBody : /></ ,
69
-
70
- GeckoEntitiesMarker : /#\?-\:/g ,
71
-
72
- // We look for the "src" and href attribute with the " or ' or without one of
73
- // them. We have to do all in one, otherwise we will have problems with URLs
74
- // like "thumbnail.php?src=someimage.jpg" (SF-BUG 1554141).
75
- ProtectUrlsImg : /<img(?=\s).*?\ssrc=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi ,
76
- ProtectUrlsA : /<a(?=\s).*?\shref=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi ,
77
- ProtectUrlsArea : /<area(?=\s).*?\shref=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/gi ,
78
-
79
- Html4DocType : /HTML 4\.0 Transitional/i ,
80
- DocTypeTag : /<!DOCTYPE[^>]*>/i ,
81
- HtmlDocType : /DTD HTML/ ,
82
-
83
- // These regex are used to save the original event attributes in the HTML.
84
- TagsWithEvent : /<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g ,
85
- EventAttributes : /\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,
86
- ProtectedEvents : /\s\w+_fckprotectedatt="([^"]+)"/g,
87
-
88
- StyleProperties : /\S+\s*:/g,
89
-
90
- // [a-zA-Z0-9:]+ seams to be more efficient than [\w:]+
91
- InvalidSelfCloseTags : /(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi,
92
-
93
- // All variables defined in a style attribute or style definition. The variable
94
- // name is returned with $2.
95
- StyleVariableAttName : /#\(\s*("|')(.+?)\1[^\)]*\s*\)/g,
96
-
97
- RegExp : /^\/(.*)\/([gim]*)$/,
98
-
99
- HtmlTag : /<[^\s<>](?:"[^"]*"|'[^']*'|[^<])*>/
100
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckselection.js DELETED
@@ -1,42 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Active selection functions.
22
- */
23
-
24
- var FCKSelection = FCK.Selection =
25
- {
26
- GetParentBlock : function()
27
- {
28
- var retval = this.GetParentElement() ;
29
- while ( retval )
30
- {
31
- if ( FCKListsLib.BlockBoundaries[retval.nodeName.toLowerCase()] )
32
- break ;
33
- retval = retval.parentNode ;
34
- }
35
- return retval ;
36
- },
37
-
38
- ApplyStyle : function( styleDefinition )
39
- {
40
- FCKStyles.ApplyStyle( new FCKStyle( styleDefinition ) ) ;
41
- }
42
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckselection_gecko.js DELETED
@@ -1,228 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Active selection functions. (Gecko specific implementation)
22
- */
23
-
24
- // Get the selection type (like document.select.type in IE).
25
- FCKSelection.GetType = function()
26
- {
27
- // By default set the type to "Text".
28
- var type = 'Text' ;
29
-
30
- // Check if the actual selection is a Control (IMG, TABLE, HR, etc...).
31
-
32
- var sel ;
33
- try { sel = this.GetSelection() ; } catch (e) {}
34
-
35
- if ( sel && sel.rangeCount == 1 )
36
- {
37
- var range = sel.getRangeAt(0) ;
38
- if ( range.startContainer == range.endContainer
39
- && ( range.endOffset - range.startOffset ) == 1
40
- && range.startContainer.nodeType == 1
41
- && FCKListsLib.StyleObjectElements[ range.startContainer.childNodes[ range.startOffset ].nodeName.toLowerCase() ] )
42
- {
43
- type = 'Control' ;
44
- }
45
- }
46
-
47
- return type ;
48
- }
49
-
50
- // Retrieves the selected element (if any), just in the case that a single
51
- // element (object like and image or a table) is selected.
52
- FCKSelection.GetSelectedElement = function()
53
- {
54
- var selection = !!FCK.EditorWindow && this.GetSelection() ;
55
- if ( !selection || selection.rangeCount < 1 )
56
- return null ;
57
-
58
- var range = selection.getRangeAt( 0 ) ;
59
- if ( range.startContainer != range.endContainer || range.startContainer.nodeType != 1 || range.startOffset != range.endOffset - 1 )
60
- return null ;
61
-
62
- var node = range.startContainer.childNodes[ range.startOffset ] ;
63
- if ( node.nodeType != 1 )
64
- return null ;
65
-
66
- return node ;
67
- }
68
-
69
- FCKSelection.GetParentElement = function()
70
- {
71
- if ( this.GetType() == 'Control' )
72
- return FCKSelection.GetSelectedElement().parentNode ;
73
- else
74
- {
75
- var oSel = this.GetSelection() ;
76
- if ( oSel )
77
- {
78
- // if anchorNode == focusNode, see if the selection is text only or including nodes.
79
- // if text only, return the parent node.
80
- // if the selection includes DOM nodes, then the anchorNode is the nearest container.
81
- if ( oSel.anchorNode && oSel.anchorNode == oSel.focusNode )
82
- {
83
- var oRange = oSel.getRangeAt( 0 ) ;
84
- if ( oRange.collapsed || oRange.startContainer.nodeType == 3 )
85
- return oSel.anchorNode.parentNode ;
86
- else
87
- return oSel.anchorNode ;
88
- }
89
-
90
- // looks like we're having a large selection here. To make the behavior same as IE's TextRange.parentElement(),
91
- // we need to find the nearest ancestor node which encapsulates both the beginning and the end of the selection.
92
- // TODO: A simpler logic can be found.
93
- var anchorPath = new FCKElementPath( oSel.anchorNode ) ;
94
- var focusPath = new FCKElementPath( oSel.focusNode ) ;
95
- var deepPath = null ;
96
- var shallowPath = null ;
97
- if ( anchorPath.Elements.length > focusPath.Elements.length )
98
- {
99
- deepPath = anchorPath.Elements ;
100
- shallowPath = focusPath.Elements ;
101
- }
102
- else
103
- {
104
- deepPath = focusPath.Elements ;
105
- shallowPath = anchorPath.Elements ;
106
- }
107
-
108
- var deepPathBase = deepPath.length - shallowPath.length ;
109
- for( var i = 0 ; i < shallowPath.length ; i++)
110
- {
111
- if ( deepPath[deepPathBase + i] == shallowPath[i])
112
- return shallowPath[i];
113
- }
114
- return null ;
115
- }
116
- }
117
- return null ;
118
- }
119
-
120
- FCKSelection.GetBoundaryParentElement = function( startBoundary )
121
- {
122
- if ( ! FCK.EditorWindow )
123
- return null ;
124
- if ( this.GetType() == 'Control' )
125
- return FCKSelection.GetSelectedElement().parentNode ;
126
- else
127
- {
128
- var oSel = this.GetSelection() ;
129
- if ( oSel && oSel.rangeCount > 0 )
130
- {
131
- var range = oSel.getRangeAt( startBoundary ? 0 : ( oSel.rangeCount - 1 ) ) ;
132
-
133
- var element = startBoundary ? range.startContainer : range.endContainer ;
134
-
135
- return ( element.nodeType == 1 ? element : element.parentNode ) ;
136
- }
137
- }
138
- return null ;
139
- }
140
-
141
- FCKSelection.SelectNode = function( element )
142
- {
143
- var oRange = FCK.EditorDocument.createRange() ;
144
- oRange.selectNode( element ) ;
145
-
146
- var oSel = this.GetSelection() ;
147
- oSel.removeAllRanges() ;
148
- oSel.addRange( oRange ) ;
149
- }
150
-
151
- FCKSelection.Collapse = function( toStart )
152
- {
153
- var oSel = this.GetSelection() ;
154
-
155
- if ( toStart == null || toStart === true )
156
- oSel.collapseToStart() ;
157
- else
158
- oSel.collapseToEnd() ;
159
- }
160
-
161
- // The "nodeTagName" parameter must be Upper Case.
162
- FCKSelection.HasAncestorNode = function( nodeTagName )
163
- {
164
- var oContainer = this.GetSelectedElement() ;
165
- if ( ! oContainer && FCK.EditorWindow )
166
- {
167
- try { oContainer = this.GetSelection().getRangeAt(0).startContainer ; }
168
- catch(e){}
169
- }
170
-
171
- while ( oContainer )
172
- {
173
- if ( oContainer.nodeType == 1 && oContainer.nodeName.IEquals( nodeTagName ) ) return true ;
174
- oContainer = oContainer.parentNode ;
175
- }
176
-
177
- return false ;
178
- }
179
-
180
- // The "nodeTagName" parameter must be Upper Case.
181
- FCKSelection.MoveToAncestorNode = function( nodeTagName )
182
- {
183
- var oNode ;
184
-
185
- var oContainer = this.GetSelectedElement() ;
186
- if ( ! oContainer )
187
- oContainer = this.GetSelection().getRangeAt(0).startContainer ;
188
-
189
- while ( oContainer )
190
- {
191
- if ( oContainer.nodeName.IEquals( nodeTagName ) )
192
- return oContainer ;
193
-
194
- oContainer = oContainer.parentNode ;
195
- }
196
- return null ;
197
- }
198
-
199
- FCKSelection.Delete = function()
200
- {
201
- // Gets the actual selection.
202
- var oSel = this.GetSelection() ;
203
-
204
- // Deletes the actual selection contents.
205
- for ( var i = 0 ; i < oSel.rangeCount ; i++ )
206
- {
207
- oSel.getRangeAt(i).deleteContents() ;
208
- }
209
-
210
- return oSel ;
211
- }
212
-
213
- /**
214
- * Returns the native selection object.
215
- */
216
- FCKSelection.GetSelection = function()
217
- {
218
- return FCK.EditorWindow.getSelection() ;
219
- }
220
-
221
- // The following are IE only features (we don't need then in other browsers
222
- // currently).
223
- FCKSelection.Save = function()
224
- {}
225
- FCKSelection.Restore = function()
226
- {}
227
- FCKSelection.Release = function()
228
- {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckselection_ie.js DELETED
@@ -1,287 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Active selection functions. (IE specific implementation)
22
- */
23
-
24
- // Get the selection type.
25
- FCKSelection.GetType = function()
26
- {
27
- // It is possible that we can still get a text range object even when type=='None' is returned by IE.
28
- // So we'd better check the object returned by createRange() rather than by looking at the type.
29
- try
30
- {
31
- var ieType = FCKSelection.GetSelection().type ;
32
- if ( ieType == 'Control' || ieType == 'Text' )
33
- return ieType ;
34
-
35
- if ( this.GetSelection().createRange().parentElement )
36
- return 'Text' ;
37
- }
38
- catch(e)
39
- {
40
- // Nothing to do, it will return None properly.
41
- }
42
-
43
- return 'None' ;
44
- } ;
45
-
46
- // Retrieves the selected element (if any), just in the case that a single
47
- // element (object like and image or a table) is selected.
48
- FCKSelection.GetSelectedElement = function()
49
- {
50
- if ( this.GetType() == 'Control' )
51
- {
52
- var oRange = this.GetSelection().createRange() ;
53
-
54
- if ( oRange && oRange.item )
55
- return this.GetSelection().createRange().item(0) ;
56
- }
57
- return null ;
58
- } ;
59
-
60
- FCKSelection.GetParentElement = function()
61
- {
62
- switch ( this.GetType() )
63
- {
64
- case 'Control' :
65
- var el = FCKSelection.GetSelectedElement() ;
66
- return el ? el.parentElement : null ;
67
-
68
- case 'None' :
69
- return null ;
70
-
71
- default :
72
- return this.GetSelection().createRange().parentElement() ;
73
- }
74
- } ;
75
-
76
- FCKSelection.GetBoundaryParentElement = function( startBoundary )
77
- {
78
- switch ( this.GetType() )
79
- {
80
- case 'Control' :
81
- var el = FCKSelection.GetSelectedElement() ;
82
- return el ? el.parentElement : null ;
83
-
84
- case 'None' :
85
- return null ;
86
-
87
- default :
88
- var doc = FCK.EditorDocument ;
89
-
90
- var range = doc.selection.createRange() ;
91
- range.collapse( startBoundary !== false ) ;
92
-
93
- var el = range.parentElement() ;
94
-
95
- // It may happen that range is comming from outside "doc", so we
96
- // must check it (#1204).
97
- return FCKTools.GetElementDocument( el ) == doc ? el : null ;
98
- }
99
- } ;
100
-
101
- FCKSelection.SelectNode = function( node )
102
- {
103
- FCK.Focus() ;
104
- this.GetSelection().empty() ;
105
- var oRange ;
106
- try
107
- {
108
- // Try to select the node as a control.
109
- oRange = FCK.EditorDocument.body.createControlRange() ;
110
- oRange.addElement( node ) ;
111
- }
112
- catch(e)
113
- {
114
- // If failed, select it as a text range.
115
- oRange = FCK.EditorDocument.body.createTextRange() ;
116
- oRange.moveToElementText( node ) ;
117
- }
118
-
119
- oRange.select() ;
120
- } ;
121
-
122
- FCKSelection.Collapse = function( toStart )
123
- {
124
- FCK.Focus() ;
125
- if ( this.GetType() == 'Text' )
126
- {
127
- var oRange = this.GetSelection().createRange() ;
128
- oRange.collapse( toStart == null || toStart === true ) ;
129
- oRange.select() ;
130
- }
131
- } ;
132
-
133
- // The "nodeTagName" parameter must be Upper Case.
134
- FCKSelection.HasAncestorNode = function( nodeTagName )
135
- {
136
- var oContainer ;
137
-
138
- if ( this.GetSelection().type == "Control" )
139
- {
140
- oContainer = this.GetSelectedElement() ;
141
- }
142
- else
143
- {
144
- var oRange = this.GetSelection().createRange() ;
145
- oContainer = oRange.parentElement() ;
146
- }
147
-
148
- while ( oContainer )
149
- {
150
- if ( oContainer.nodeName.IEquals( nodeTagName ) ) return true ;
151
- oContainer = oContainer.parentNode ;
152
- }
153
-
154
- return false ;
155
- } ;
156
-
157
- // The "nodeTagName" parameter must be UPPER CASE.
158
- // It can be also an array of names
159
- FCKSelection.MoveToAncestorNode = function( nodeTagName )
160
- {
161
- var oNode, oRange ;
162
-
163
- if ( ! FCK.EditorDocument )
164
- return null ;
165
-
166
- if ( this.GetSelection().type == "Control" )
167
- {
168
- oRange = this.GetSelection().createRange() ;
169
- for ( i = 0 ; i < oRange.length ; i++ )
170
- {
171
- if (oRange(i).parentNode)
172
- {
173
- oNode = oRange(i).parentNode ;
174
- break ;
175
- }
176
- }
177
- }
178
- else
179
- {
180
- oRange = this.GetSelection().createRange() ;
181
- oNode = oRange.parentElement() ;
182
- }
183
-
184
- while ( oNode && !oNode.nodeName.Equals( nodeTagName ) )
185
- oNode = oNode.parentNode ;
186
-
187
- return oNode ;
188
- } ;
189
-
190
- FCKSelection.Delete = function()
191
- {
192
- // Gets the actual selection.
193
- var oSel = this.GetSelection() ;
194
-
195
- // Deletes the actual selection contents.
196
- if ( oSel.type.toLowerCase() != "none" )
197
- {
198
- oSel.clear() ;
199
- }
200
-
201
- return oSel ;
202
- } ;
203
-
204
- /**
205
- * Returns the native selection object.
206
- */
207
- FCKSelection.GetSelection = function()
208
- {
209
- this.Restore() ;
210
- return FCK.EditorDocument.selection ;
211
- }
212
-
213
- FCKSelection.Save = function( lock )
214
- {
215
- var editorDocument = FCK.EditorDocument ;
216
-
217
- if ( !editorDocument )
218
- return ;
219
-
220
- // Avoid saving again a selection while a dialog is open #2616
221
- if ( this.locked )
222
- return ;
223
- this.locked = !!lock ;
224
-
225
- var selection = editorDocument.selection ;
226
- var range ;
227
-
228
- if ( selection )
229
- {
230
- // The call might fail if the document doesn't have the focus (#1801),
231
- // but we don't want to modify the current selection (#2495) with a call to FCK.Focus() ;
232
- try {
233
- range = selection.createRange() ;
234
- }
235
- catch(e) {}
236
-
237
- // Ensure that the range comes from the editor document.
238
- if ( range )
239
- {
240
- if ( range.parentElement && FCKTools.GetElementDocument( range.parentElement() ) != editorDocument )
241
- range = null ;
242
- else if ( range.item && FCKTools.GetElementDocument( range.item(0) )!= editorDocument )
243
- range = null ;
244
- }
245
- }
246
-
247
- this.SelectionData = range ;
248
- }
249
-
250
- FCKSelection._GetSelectionDocument = function( selection )
251
- {
252
- var range = selection.createRange() ;
253
- if ( !range )
254
- return null;
255
- else if ( range.item )
256
- return FCKTools.GetElementDocument( range.item( 0 ) ) ;
257
- else
258
- return FCKTools.GetElementDocument( range.parentElement() ) ;
259
- }
260
-
261
- FCKSelection.Restore = function()
262
- {
263
- if ( this.SelectionData )
264
- {
265
- FCK.IsSelectionChangeLocked = true ;
266
-
267
- try
268
- {
269
- // Don't repeat the restore process if the editor document is already selected.
270
- if ( String( this._GetSelectionDocument( FCK.EditorDocument.selection ).body.contentEditable ) == 'true' )
271
- {
272
- FCK.IsSelectionChangeLocked = false ;
273
- return ;
274
- }
275
- this.SelectionData.select() ;
276
- }
277
- catch ( e ) {}
278
-
279
- FCK.IsSelectionChangeLocked = false ;
280
- }
281
- }
282
-
283
- FCKSelection.Release = function()
284
- {
285
- this.locked = false ;
286
- delete this.SelectionData ;
287
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckstyles.js DELETED
@@ -1,381 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Handles styles in a give document.
22
- */
23
-
24
- var FCKStyles = FCK.Styles =
25
- {
26
- _Callbacks : {},
27
- _ObjectStyles : {},
28
-
29
- ApplyStyle : function( style )
30
- {
31
- if ( typeof style == 'string' )
32
- style = this.GetStyles()[ style ] ;
33
-
34
- if ( style )
35
- {
36
- if ( style.GetType() == FCK_STYLE_OBJECT )
37
- style.ApplyToObject( FCKSelection.GetSelectedElement() ) ;
38
- else
39
- style.ApplyToSelection( FCK.EditorWindow ) ;
40
-
41
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
42
- }
43
- },
44
-
45
- RemoveStyle : function( style )
46
- {
47
- if ( typeof style == 'string' )
48
- style = this.GetStyles()[ style ] ;
49
-
50
- if ( style )
51
- {
52
- style.RemoveFromSelection( FCK.EditorWindow ) ;
53
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
54
- }
55
- },
56
-
57
- /**
58
- * Defines a callback function to be called when the current state of a
59
- * specific style changes.
60
- */
61
- AttachStyleStateChange : function( styleName, callback, callbackOwner )
62
- {
63
- var callbacks = this._Callbacks[ styleName ] ;
64
-
65
- if ( !callbacks )
66
- callbacks = this._Callbacks[ styleName ] = [] ;
67
-
68
- callbacks.push( [ callback, callbackOwner ] ) ;
69
- },
70
-
71
- CheckSelectionChanges : function()
72
- {
73
- var startElement = FCKSelection.GetBoundaryParentElement( true ) ;
74
-
75
- if ( !startElement )
76
- return ;
77
-
78
- // Walks the start node parents path, checking all styles that are being listened.
79
- var path = new FCKElementPath( startElement ) ;
80
- var styles = this.GetStyles() ;
81
-
82
- for ( var styleName in styles )
83
- {
84
- var callbacks = this._Callbacks[ styleName ] ;
85
-
86
- if ( callbacks )
87
- {
88
- var style = styles[ styleName ] ;
89
- var state = style.CheckActive( path ) ;
90
-
91
- if ( state != ( style._LastState || null ) )
92
- {
93
- style._LastState = state ;
94
-
95
- for ( var i = 0 ; i < callbacks.length ; i++ )
96
- {
97
- var callback = callbacks[i][0] ;
98
- var callbackOwner = callbacks[i][1] ;
99
-
100
- callback.call( callbackOwner || window, styleName, state ) ;
101
- }
102
- }
103
- }
104
- }
105
- },
106
-
107
- CheckStyleInSelection : function( styleName )
108
- {
109
- return false ;
110
- },
111
-
112
- _GetRemoveFormatTagsRegex : function ()
113
- {
114
- var regex = new RegExp( '^(?:' + FCKConfig.RemoveFormatTags.replace( /,/g,'|' ) + ')$', 'i' ) ;
115
-
116
- return (this._GetRemoveFormatTagsRegex = function()
117
- {
118
- return regex ;
119
- })
120
- && regex ;
121
- },
122
-
123
- /**
124
- * Remove all styles from the current selection.
125
- * TODO:
126
- * - This is almost a duplication of FCKStyle.RemoveFromRange. We should
127
- * try to merge things.
128
- */
129
- RemoveAll : function()
130
- {
131
- var range = new FCKDomRange( FCK.EditorWindow ) ;
132
- range.MoveToSelection() ;
133
-
134
- if ( range.CheckIsCollapsed() )
135
- return ;
136
-
137
- // Expand the range, if inside inline element boundaries.
138
- range.Expand( 'inline_elements' ) ;
139
-
140
- // Get the bookmark nodes.
141
- // Bookmark the range so we can re-select it after processing.
142
- var bookmark = range.CreateBookmark( true ) ;
143
-
144
- // The style will be applied within the bookmark boundaries.
145
- var startNode = range.GetBookmarkNode( bookmark, true ) ;
146
- var endNode = range.GetBookmarkNode( bookmark, false ) ;
147
-
148
- range.Release( true ) ;
149
-
150
- var tagsRegex = this._GetRemoveFormatTagsRegex() ;
151
-
152
- // We need to check the selection boundaries (bookmark spans) to break
153
- // the code in a way that we can properly remove partially selected nodes.
154
- // For example, removing a <b> style from
155
- // <b>This is [some text</b> to show <b>the] problem</b>
156
- // ... where [ and ] represent the selection, must result:
157
- // <b>This is </b>[some text to show the]<b> problem</b>
158
- // The strategy is simple, we just break the partial nodes before the
159
- // removal logic, having something that could be represented this way:
160
- // <b>This is </b>[<b>some text</b> to show <b>the</b>]<b> problem</b>
161
-
162
- // Let's start checking the start boundary.
163
- var path = new FCKElementPath( startNode ) ;
164
- var pathElements = path.Elements ;
165
- var pathElement ;
166
-
167
- for ( var i = 1 ; i < pathElements.length ; i++ )
168
- {
169
- pathElement = pathElements[i] ;
170
-
171
- if ( pathElement == path.Block || pathElement == path.BlockLimit )
172
- break ;
173
-
174
- // If this element can be removed (even partially).
175
- if ( tagsRegex.test( pathElement.nodeName ) )
176
- FCKDomTools.BreakParent( startNode, pathElement, range ) ;
177
- }
178
-
179
- // Now the end boundary.
180
- path = new FCKElementPath( endNode ) ;
181
- pathElements = path.Elements ;
182
-
183
- for ( var i = 1 ; i < pathElements.length ; i++ )
184
- {
185
- pathElement = pathElements[i] ;
186
-
187
- if ( pathElement == path.Block || pathElement == path.BlockLimit )
188
- break ;
189
-
190
- elementName = pathElement.nodeName.toLowerCase() ;
191
-
192
- // If this element can be removed (even partially).
193
- if ( tagsRegex.test( pathElement.nodeName ) )
194
- FCKDomTools.BreakParent( endNode, pathElement, range ) ;
195
- }
196
-
197
- // Navigate through all nodes between the bookmarks.
198
- var currentNode = FCKDomTools.GetNextSourceNode( startNode, true, 1 ) ;
199
-
200
- while ( currentNode )
201
- {
202
- // If we have reached the end of the selection, stop looping.
203
- if ( currentNode == endNode )
204
- break ;
205
-
206
- // Cache the next node to be processed. Do it now, because
207
- // currentNode may be removed.
208
- var nextNode = FCKDomTools.GetNextSourceNode( currentNode, false, 1 ) ;
209
-
210
- // Remove elements nodes that match with this style rules.
211
- if ( tagsRegex.test( currentNode.nodeName ) )
212
- FCKDomTools.RemoveNode( currentNode, true ) ;
213
- else
214
- FCKDomTools.RemoveAttributes( currentNode, FCKConfig.RemoveAttributesArray );
215
-
216
- currentNode = nextNode ;
217
- }
218
-
219
- range.SelectBookmark( bookmark ) ;
220
-
221
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
222
- },
223
-
224
- GetStyle : function( styleName )
225
- {
226
- return this.GetStyles()[ styleName ] ;
227
- },
228
-
229
- GetStyles : function()
230
- {
231
- var styles = this._GetStyles ;
232
- if ( !styles )
233
- {
234
- styles = this._GetStyles = FCKTools.Merge(
235
- this._LoadStylesCore(),
236
- this._LoadStylesCustom(),
237
- this._LoadStylesXml() ) ;
238
- }
239
- return styles ;
240
- },
241
-
242
- CheckHasObjectStyle : function( elementName )
243
- {
244
- return !!this._ObjectStyles[ elementName ] ;
245
- },
246
-
247
- _LoadStylesCore : function()
248
- {
249
- var styles = {};
250
- var styleDefs = FCKConfig.CoreStyles ;
251
-
252
- for ( var styleName in styleDefs )
253
- {
254
- // Core styles are prefixed with _FCK_.
255
- var style = styles[ '_FCK_' + styleName ] = new FCKStyle( styleDefs[ styleName ] ) ;
256
- style.IsCore = true ;
257
- }
258
- return styles ;
259
- },
260
-
261
- _LoadStylesCustom : function()
262
- {
263
- var styles = {};
264
- var styleDefs = FCKConfig.CustomStyles ;
265
-
266
- if ( styleDefs )
267
- {
268
- for ( var styleName in styleDefs )
269
- {
270
- var style = styles[ styleName ] = new FCKStyle( styleDefs[ styleName ] ) ;
271
- style.Name = styleName ;
272
- }
273
- }
274
-
275
- return styles ;
276
- },
277
-
278
- _LoadStylesXml : function()
279
- {
280
- var styles = {};
281
-
282
- var stylesXmlPath = FCKConfig.StylesXmlPath ;
283
-
284
- if ( !stylesXmlPath || stylesXmlPath.length == 0 )
285
- return styles ;
286
-
287
- // Load the XML file into a FCKXml object.
288
- var xml = new FCKXml() ;
289
- xml.LoadUrl( stylesXmlPath ) ;
290
-
291
- var stylesXmlObj = FCKXml.TransformToObject( xml.SelectSingleNode( 'Styles' ) ) ;
292
-
293
- // Get the "Style" nodes defined in the XML file.
294
- var styleNodes = stylesXmlObj.$Style ;
295
-
296
- // Check that it did contain some valid nodes
297
- if ( !styleNodes )
298
- return styles ;
299
-
300
- // Add each style to our "Styles" collection.
301
- for ( var i = 0 ; i < styleNodes.length ; i++ )
302
- {
303
- var styleNode = styleNodes[i] ;
304
-
305
- var element = ( styleNode.element || '' ).toLowerCase() ;
306
-
307
- if ( element.length == 0 )
308
- throw( 'The element name is required. Error loading "' + stylesXmlPath + '"' ) ;
309
-
310
- var styleDef = {
311
- Element : element,
312
- Attributes : {},
313
- Styles : {},
314
- Overrides : []
315
- } ;
316
-
317
- // Get the attributes defined for the style (if any).
318
- var attNodes = styleNode.$Attribute || [] ;
319
-
320
- // Add the attributes to the style definition object.
321
- for ( var j = 0 ; j < attNodes.length ; j++ )
322
- {
323
- styleDef.Attributes[ attNodes[j].name ] = attNodes[j].value ;
324
- }
325
-
326
- // Get the styles defined for the style (if any).
327
- var cssStyleNodes = styleNode.$Style || [] ;
328
-
329
- // Add the attributes to the style definition object.
330
- for ( j = 0 ; j < cssStyleNodes.length ; j++ )
331
- {
332
- styleDef.Styles[ cssStyleNodes[j].name ] = cssStyleNodes[j].value ;
333
- }
334
-
335
- // Load override definitions.
336
- var cssStyleOverrideNodes = styleNode.$Override ;
337
- if ( cssStyleOverrideNodes )
338
- {
339
- for ( j = 0 ; j < cssStyleOverrideNodes.length ; j++ )
340
- {
341
- var overrideNode = cssStyleOverrideNodes[j] ;
342
- var overrideDef =
343
- {
344
- Element : overrideNode.element
345
- } ;
346
-
347
- var overrideAttNode = overrideNode.$Attribute ;
348
- if ( overrideAttNode )
349
- {
350
- overrideDef.Attributes = {} ;
351
- for ( var k = 0 ; k < overrideAttNode.length ; k++ )
352
- {
353
- var overrideAttValue = overrideAttNode[k].value || null ;
354
- if ( overrideAttValue )
355
- {
356
- // Check if the override attribute value is a regular expression.
357
- var regexMatch = overrideAttValue && FCKRegexLib.RegExp.exec( overrideAttValue ) ;
358
- if ( regexMatch )
359
- overrideAttValue = new RegExp( regexMatch[1], regexMatch[2] || '' ) ;
360
- }
361
- overrideDef.Attributes[ overrideAttNode[k].name ] = overrideAttValue ;
362
- }
363
- }
364
-
365
- styleDef.Overrides.push( overrideDef ) ;
366
- }
367
- }
368
-
369
- var style = new FCKStyle( styleDef ) ;
370
- style.Name = styleNode.name || element ;
371
-
372
- if ( style.GetType() == FCK_STYLE_OBJECT )
373
- this._ObjectStyles[ element ] = true ;
374
-
375
- // Add the style to the "Styles" collection using it's name as the key.
376
- styles[ style.Name ] = style ;
377
- }
378
-
379
- return styles ;
380
- }
381
- } ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcktablehandler.js DELETED
@@ -1,863 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Manage table operations.
22
- */
23
-
24
- var FCKTableHandler = new Object() ;
25
-
26
- FCKTableHandler.InsertRow = function( insertBefore )
27
- {
28
- // Get the row where the selection is placed in.
29
- var oRow = FCKSelection.MoveToAncestorNode( 'TR' ) ;
30
- if ( !oRow ) return ;
31
-
32
- // Create a clone of the row.
33
- var oNewRow = oRow.cloneNode( true ) ;
34
-
35
- // Insert the new row (copy) before of it.
36
- oRow.parentNode.insertBefore( oNewRow, oRow ) ;
37
-
38
- // Clean one of the rows to produce the illusion of inserting an empty row before or after.
39
- FCKTableHandler.ClearRow( insertBefore ? oNewRow : oRow ) ;
40
- }
41
-
42
- FCKTableHandler.DeleteRows = function( row )
43
- {
44
- // If no row has been passed as a parameter,
45
- // then get the row( s ) containing the cells where the selection is placed in.
46
- // If user selected multiple rows ( by selecting multiple cells ), walk
47
- // the selected cell list and delete the rows containing the selected cells
48
- if ( ! row )
49
- {
50
- var aCells = FCKTableHandler.GetSelectedCells() ;
51
- var aRowsToDelete = new Array() ;
52
- //queue up the rows -- it's possible ( and likely ) that we may get duplicates
53
- for ( var i = 0; i < aCells.length; i++ )
54
- {
55
- var oRow = aCells[i].parentNode ;
56
- aRowsToDelete[oRow.rowIndex] = oRow ;
57
- }
58
- for ( var i = aRowsToDelete.length; i >= 0; i-- )
59
- {
60
- if ( aRowsToDelete[i] )
61
- FCKTableHandler.DeleteRows( aRowsToDelete[i] );
62
- }
63
- return ;
64
- }
65
-
66
- // Get the row's table.
67
- var oTable = FCKTools.GetElementAscensor( row, 'TABLE' ) ;
68
-
69
- // If just one row is available then delete the entire table.
70
- if ( oTable.rows.length == 1 )
71
- {
72
- FCKTableHandler.DeleteTable( oTable ) ;
73
- return ;
74
- }
75
-
76
- // Delete the row.
77
- row.parentNode.removeChild( row ) ;
78
- }
79
-
80
- FCKTableHandler.DeleteTable = function( table )
81
- {
82
- // If no table has been passed as a parameter,
83
- // then get the table where the selection is placed in.
84
- if ( !table )
85
- {
86
- table = FCKSelection.GetSelectedElement() ;
87
- if ( !table || table.tagName != 'TABLE' )
88
- table = FCKSelection.MoveToAncestorNode( 'TABLE' ) ;
89
- }
90
- if ( !table ) return ;
91
-
92
- // Delete the table.
93
- FCKSelection.SelectNode( table ) ;
94
- FCKSelection.Collapse();
95
-
96
- // if the table is wrapped with a singleton <p> ( or something similar ), remove
97
- // the surrounding tag -- which likely won't show after deletion anyway
98
- if ( table.parentNode.childNodes.length == 1 )
99
- table.parentNode.parentNode.removeChild( table.parentNode );
100
- else
101
- table.parentNode.removeChild( table ) ;
102
- }
103
-
104
- FCKTableHandler.InsertColumn = function( insertBefore )
105
- {
106
- // Get the cell where the selection is placed in.
107
- var oCell = null ;
108
- var nodes = this.GetSelectedCells() ;
109
-
110
- if ( nodes && nodes.length )
111
- oCell = nodes[ insertBefore ? 0 : ( nodes.length - 1 ) ] ;
112
-
113
- if ( ! oCell )
114
- return ;
115
-
116
- // Get the cell's table.
117
- var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
118
-
119
- var iIndex = oCell.cellIndex ;
120
-
121
- // Loop through all rows available in the table.
122
- for ( var i = 0 ; i < oTable.rows.length ; i++ )
123
- {
124
- // Get the row.
125
- var oRow = oTable.rows[i] ;
126
-
127
- // If the row doesn't have enough cells, ignore it.
128
- if ( oRow.cells.length < ( iIndex + 1 ) )
129
- continue ;
130
-
131
- oCell = oRow.cells[iIndex].cloneNode(false) ;
132
-
133
- if ( FCKBrowserInfo.IsGeckoLike )
134
- FCKTools.AppendBogusBr( oCell ) ;
135
-
136
- // Get back the currently selected cell.
137
- var oBaseCell = oRow.cells[iIndex] ;
138
-
139
- oRow.insertBefore( oCell, ( insertBefore ? oBaseCell : oBaseCell.nextSibling ) ) ;
140
- }
141
- }
142
-
143
- FCKTableHandler.DeleteColumns = function( oCell )
144
- {
145
- // if user selected multiple cols ( by selecting multiple cells ), walk
146
- // the selected cell list and delete the rows containing the selected cells
147
- if ( !oCell )
148
- {
149
- var aColsToDelete = FCKTableHandler.GetSelectedCells();
150
- for ( var i = aColsToDelete.length; i >= 0; i-- )
151
- {
152
- if ( aColsToDelete[i] )
153
- FCKTableHandler.DeleteColumns( aColsToDelete[i] );
154
- }
155
- return;
156
- }
157
-
158
- if ( !oCell ) return ;
159
-
160
- // Get the cell's table.
161
- var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
162
-
163
- // Get the cell index.
164
- var iIndex = oCell.cellIndex ;
165
-
166
- // Loop throw all rows (from down to up, because it's possible that some
167
- // rows will be deleted).
168
- for ( var i = oTable.rows.length - 1 ; i >= 0 ; i-- )
169
- {
170
- // Get the row.
171
- var oRow = oTable.rows[i] ;
172
-
173
- // If the cell to be removed is the first one and the row has just one cell.
174
- if ( iIndex == 0 && oRow.cells.length == 1 )
175
- {
176
- // Remove the entire row.
177
- FCKTableHandler.DeleteRows( oRow ) ;
178
- continue ;
179
- }
180
-
181
- // If the cell to be removed exists the delete it.
182
- if ( oRow.cells[iIndex] )
183
- oRow.removeChild( oRow.cells[iIndex] ) ;
184
- }
185
- }
186
-
187
- FCKTableHandler.InsertCell = function( cell, insertBefore )
188
- {
189
- // Get the cell where the selection is placed in.
190
- var oCell = null ;
191
- var nodes = this.GetSelectedCells() ;
192
- if ( nodes && nodes.length )
193
- oCell = nodes[ insertBefore ? 0 : ( nodes.length - 1 ) ] ;
194
- if ( ! oCell )
195
- return null ;
196
-
197
- // Create the new cell element to be added.
198
- var oNewCell = FCK.EditorDocument.createElement( 'TD' ) ;
199
- if ( FCKBrowserInfo.IsGeckoLike )
200
- FCKTools.AppendBogusBr( oNewCell ) ;
201
-
202
- if ( !insertBefore && oCell.cellIndex == oCell.parentNode.cells.length - 1 )
203
- oCell.parentNode.appendChild( oNewCell ) ;
204
- else
205
- oCell.parentNode.insertBefore( oNewCell, insertBefore ? oCell : oCell.nextSibling ) ;
206
-
207
- return oNewCell ;
208
- }
209
-
210
- FCKTableHandler.DeleteCell = function( cell )
211
- {
212
- // If this is the last cell in the row.
213
- if ( cell.parentNode.cells.length == 1 )
214
- {
215
- // Delete the entire row.
216
- FCKTableHandler.DeleteRows( cell.parentNode ) ;
217
- return ;
218
- }
219
-
220
- // Delete the cell from the row.
221
- cell.parentNode.removeChild( cell ) ;
222
- }
223
-
224
- FCKTableHandler.DeleteCells = function()
225
- {
226
- var aCells = FCKTableHandler.GetSelectedCells() ;
227
-
228
- for ( var i = aCells.length - 1 ; i >= 0 ; i-- )
229
- {
230
- FCKTableHandler.DeleteCell( aCells[i] ) ;
231
- }
232
- }
233
-
234
- FCKTableHandler._MarkCells = function( cells, label )
235
- {
236
- for ( var i = 0 ; i < cells.length ; i++ )
237
- cells[i][label] = true ;
238
- }
239
-
240
- FCKTableHandler._UnmarkCells = function( cells, label )
241
- {
242
- for ( var i = 0 ; i < cells.length ; i++ )
243
- {
244
- FCKDomTools.ClearElementJSProperty(cells[i], label ) ;
245
- }
246
- }
247
-
248
- FCKTableHandler._ReplaceCellsByMarker = function( tableMap, marker, substitute )
249
- {
250
- for ( var i = 0 ; i < tableMap.length ; i++ )
251
- {
252
- for ( var j = 0 ; j < tableMap[i].length ; j++ )
253
- {
254
- if ( tableMap[i][j][marker] )
255
- tableMap[i][j] = substitute ;
256
- }
257
- }
258
- }
259
-
260
- FCKTableHandler._GetMarkerGeometry = function( tableMap, rowIdx, colIdx, markerName )
261
- {
262
- var selectionWidth = 0 ;
263
- var selectionHeight = 0 ;
264
- var cellsLeft = 0 ;
265
- var cellsUp = 0 ;
266
- for ( var i = colIdx ; tableMap[rowIdx][i] && tableMap[rowIdx][i][markerName] ; i++ )
267
- selectionWidth++ ;
268
- for ( var i = colIdx - 1 ; tableMap[rowIdx][i] && tableMap[rowIdx][i][markerName] ; i-- )
269
- {
270
- selectionWidth++ ;
271
- cellsLeft++ ;
272
- }
273
- for ( var i = rowIdx ; tableMap[i] && tableMap[i][colIdx] && tableMap[i][colIdx][markerName] ; i++ )
274
- selectionHeight++ ;
275
- for ( var i = rowIdx - 1 ; tableMap[i] && tableMap[i][colIdx] && tableMap[i][colIdx][markerName] ; i-- )
276
- {
277
- selectionHeight++ ;
278
- cellsUp++ ;
279
- }
280
- return { 'width' : selectionWidth, 'height' : selectionHeight, 'x' : cellsLeft, 'y' : cellsUp } ;
281
- }
282
-
283
- FCKTableHandler.CheckIsSelectionRectangular = function()
284
- {
285
- // If every row and column in an area on a plane are of the same width and height,
286
- // Then the area is a rectangle.
287
- var cells = FCKTableHandler.GetSelectedCells() ;
288
- if ( cells.length < 1 )
289
- return false ;
290
-
291
- // Check if the selected cells are all in the same table section (thead, tfoot or tbody)
292
- for (var i = 0; i < cells.length; i++)
293
- {
294
- if ( cells[i].parentNode.parentNode != cells[0].parentNode.parentNode )
295
- return false ;
296
- }
297
-
298
- this._MarkCells( cells, '_CellSelected' ) ;
299
-
300
- var tableMap = this._CreateTableMap( cells[0] ) ;
301
- var rowIdx = cells[0].parentNode.rowIndex ;
302
- var colIdx = this._GetCellIndexSpan( tableMap, rowIdx, cells[0] ) ;
303
-
304
- var geometry = this._GetMarkerGeometry( tableMap, rowIdx, colIdx, '_CellSelected' ) ;
305
- var baseColIdx = colIdx - geometry.x ;
306
- var baseRowIdx = rowIdx - geometry.y ;
307
-
308
- if ( geometry.width >= geometry.height )
309
- {
310
- for ( colIdx = baseColIdx ; colIdx < baseColIdx + geometry.width ; colIdx++ )
311
- {
312
- rowIdx = baseRowIdx + ( colIdx - baseColIdx ) % geometry.height ;
313
- if ( ! tableMap[rowIdx] || ! tableMap[rowIdx][colIdx] )
314
- {
315
- this._UnmarkCells( cells, '_CellSelected' ) ;
316
- return false ;
317
- }
318
- var g = this._GetMarkerGeometry( tableMap, rowIdx, colIdx, '_CellSelected' ) ;
319
- if ( g.width != geometry.width || g.height != geometry.height )
320
- {
321
- this._UnmarkCells( cells, '_CellSelected' ) ;
322
- return false ;
323
- }
324
- }
325
- }
326
- else
327
- {
328
- for ( rowIdx = baseRowIdx ; rowIdx < baseRowIdx + geometry.height ; rowIdx++ )
329
- {
330
- colIdx = baseColIdx + ( rowIdx - baseRowIdx ) % geometry.width ;
331
- if ( ! tableMap[rowIdx] || ! tableMap[rowIdx][colIdx] )
332
- {
333
- this._UnmarkCells( cells, '_CellSelected' ) ;
334
- return false ;
335
- }
336
- var g = this._GetMarkerGeometry( tableMap, rowIdx, colIdx, '_CellSelected' ) ;
337
- if ( g.width != geometry.width || g.height != geometry.height )
338
- {
339
- this._UnmarkCells( cells, '_CellSelected' ) ;
340
- return false ;
341
- }
342
- }
343
- }
344
-
345
- this._UnmarkCells( cells, '_CellSelected' ) ;
346
- return true ;
347
- }
348
-
349
- FCKTableHandler.MergeCells = function()
350
- {
351
- // Get all selected cells.
352
- var cells = this.GetSelectedCells() ;
353
- if ( cells.length < 2 )
354
- return ;
355
-
356
- // Assume the selected cells are already in a rectangular geometry.
357
- // Because the checking is already done by FCKTableCommand.
358
- var refCell = cells[0] ;
359
- var tableMap = this._CreateTableMap( refCell ) ;
360
- var rowIdx = refCell.parentNode.rowIndex ;
361
- var colIdx = this._GetCellIndexSpan( tableMap, rowIdx, refCell ) ;
362
-
363
- this._MarkCells( cells, '_SelectedCells' ) ;
364
- var selectionGeometry = this._GetMarkerGeometry( tableMap, rowIdx, colIdx, '_SelectedCells' ) ;
365
-
366
- var baseColIdx = colIdx - selectionGeometry.x ;
367
- var baseRowIdx = rowIdx - selectionGeometry.y ;
368
- var cellContents = FCKTools.GetElementDocument( refCell ).createDocumentFragment() ;
369
- for ( var i = 0 ; i < selectionGeometry.height ; i++ )
370
- {
371
- var rowChildNodesCount = 0 ;
372
- for ( var j = 0 ; j < selectionGeometry.width ; j++ )
373
- {
374
- var currentCell = tableMap[baseRowIdx + i][baseColIdx + j] ;
375
- while ( currentCell.childNodes.length > 0 )
376
- {
377
- var node = currentCell.removeChild( currentCell.firstChild ) ;
378
- if ( node.nodeType != 1
379
- || ( node.getAttribute( 'type', 2 ) != '_moz' && node.getAttribute( '_moz_dirty' ) != null ) )
380
- {
381
- cellContents.appendChild( node ) ;
382
- rowChildNodesCount++ ;
383
- }
384
- }
385
- }
386
- if ( rowChildNodesCount > 0 )
387
- cellContents.appendChild( FCK.EditorDocument.createElement( 'br' ) ) ;
388
- }
389
-
390
- this._ReplaceCellsByMarker( tableMap, '_SelectedCells', refCell ) ;
391
- this._UnmarkCells( cells, '_SelectedCells' ) ;
392
- this._InstallTableMap( tableMap, refCell.parentNode.parentNode.parentNode ) ;
393
- refCell.appendChild( cellContents ) ;
394
-
395
- if ( FCKBrowserInfo.IsGeckoLike && ( ! refCell.firstChild ) )
396
- FCKTools.AppendBogusBr( refCell ) ;
397
-
398
- this._MoveCaretToCell( refCell, false ) ;
399
- }
400
-
401
- FCKTableHandler.MergeRight = function()
402
- {
403
- var target = this.GetMergeRightTarget() ;
404
- if ( target == null )
405
- return ;
406
- var refCell = target.refCell ;
407
- var tableMap = target.tableMap ;
408
- var nextCell = target.nextCell ;
409
-
410
- var cellContents = FCK.EditorDocument.createDocumentFragment() ;
411
- while ( nextCell && nextCell.childNodes && nextCell.childNodes.length > 0 )
412
- cellContents.appendChild( nextCell.removeChild( nextCell.firstChild ) ) ;
413
-
414
- nextCell.parentNode.removeChild( nextCell ) ;
415
- refCell.appendChild( cellContents ) ;
416
- this._MarkCells( [nextCell], '_Replace' ) ;
417
- this._ReplaceCellsByMarker( tableMap, '_Replace', refCell ) ;
418
- this._InstallTableMap( tableMap, refCell.parentNode.parentNode.parentNode ) ;
419
-
420
- this._MoveCaretToCell( refCell, false ) ;
421
- }
422
-
423
- FCKTableHandler.MergeDown = function()
424
- {
425
- var target = this.GetMergeDownTarget() ;
426
- if ( target == null )
427
- return ;
428
- var refCell = target.refCell ;
429
- var tableMap = target.tableMap ;
430
- var nextCell = target.nextCell ;
431
-
432
- var cellContents = FCKTools.GetElementDocument( refCell ).createDocumentFragment() ;
433
- while ( nextCell && nextCell.childNodes && nextCell.childNodes.length > 0 )
434
- cellContents.appendChild( nextCell.removeChild( nextCell.firstChild ) ) ;
435
- if ( cellContents.firstChild )
436
- cellContents.insertBefore( FCK.EditorDocument.createElement( 'br' ), cellContents.firstChild ) ;
437
- refCell.appendChild( cellContents ) ;
438
- this._MarkCells( [nextCell], '_Replace' ) ;
439
- this._ReplaceCellsByMarker( tableMap, '_Replace', refCell ) ;
440
- this._InstallTableMap( tableMap, refCell.parentNode.parentNode.parentNode ) ;
441
-
442
- this._MoveCaretToCell( refCell, false ) ;
443
- }
444
-
445
- FCKTableHandler.HorizontalSplitCell = function()
446
- {
447
- var cells = FCKTableHandler.GetSelectedCells() ;
448
- if ( cells.length != 1 )
449
- return ;
450
-
451
- var refCell = cells[0] ;
452
- var tableMap = this._CreateTableMap( refCell ) ;
453
- var rowIdx = refCell.parentNode.rowIndex ;
454
- var colIdx = FCKTableHandler._GetCellIndexSpan( tableMap, rowIdx, refCell ) ;
455
- var cellSpan = isNaN( refCell.colSpan ) ? 1 : refCell.colSpan ;
456
-
457
- if ( cellSpan > 1 )
458
- {
459
- // Splitting a multi-column cell - original cell gets ceil(colSpan/2) columns,
460
- // new cell gets floor(colSpan/2).
461
- var newCellSpan = Math.ceil( cellSpan / 2 ) ;
462
- var newCell = FCK.EditorDocument.createElement( refCell.nodeName ) ;
463
- if ( FCKBrowserInfo.IsGeckoLike )
464
- FCKTools.AppendBogusBr( newCell ) ;
465
- var startIdx = colIdx + newCellSpan ;
466
- var endIdx = colIdx + cellSpan ;
467
- var rowSpan = isNaN( refCell.rowSpan ) ? 1 : refCell.rowSpan ;
468
- for ( var r = rowIdx ; r < rowIdx + rowSpan ; r++ )
469
- {
470
- for ( var i = startIdx ; i < endIdx ; i++ )
471
- tableMap[r][i] = newCell ;
472
- }
473
- }
474
- else
475
- {
476
- // Splitting a single-column cell - add a new cell, and expand
477
- // cells crossing the same column.
478
- var newTableMap = [] ;
479
- for ( var i = 0 ; i < tableMap.length ; i++ )
480
- {
481
- var newRow = tableMap[i].slice( 0, colIdx ) ;
482
- if ( tableMap[i].length <= colIdx )
483
- {
484
- newTableMap.push( newRow ) ;
485
- continue ;
486
- }
487
- if ( tableMap[i][colIdx] == refCell )
488
- {
489
- newRow.push( refCell ) ;
490
- newRow.push( FCK.EditorDocument.createElement( refCell.nodeName ) ) ;
491
- if ( FCKBrowserInfo.IsGeckoLike )
492
- FCKTools.AppendBogusBr( newRow[newRow.length - 1] ) ;
493
- }
494
- else
495
- {
496
- newRow.push( tableMap[i][colIdx] ) ;
497
- newRow.push( tableMap[i][colIdx] ) ;
498
- }
499
- for ( var j = colIdx + 1 ; j < tableMap[i].length ; j++ )
500
- newRow.push( tableMap[i][j] ) ;
501
- newTableMap.push( newRow ) ;
502
- }
503
- tableMap = newTableMap ;
504
- }
505
-
506
- this._InstallTableMap( tableMap, refCell.parentNode.parentNode.parentNode ) ;
507
- }
508
-
509
- FCKTableHandler.VerticalSplitCell = function()
510
- {
511
- var cells = FCKTableHandler.GetSelectedCells() ;
512
- if ( cells.length != 1 )
513
- return ;
514
-
515
- var currentCell = cells[0] ;
516
- var tableMap = this._CreateTableMap( currentCell ) ;
517
- var currentRowIndex = currentCell.parentNode.rowIndex ;
518
- var cellIndex = FCKTableHandler._GetCellIndexSpan( tableMap, currentRowIndex, currentCell ) ;
519
- // Save current cell colSpan
520
- var currentColSpan = isNaN( currentCell.colSpan ) ? 1 : currentCell.colSpan ;
521
- var currentRowSpan = currentCell.rowSpan ;
522
- if ( isNaN( currentRowSpan ) )
523
- currentRowSpan = 1 ;
524
-
525
- if ( currentRowSpan > 1 )
526
- {
527
- // 1. Set the current cell's rowSpan to 1.
528
- currentCell.rowSpan = Math.ceil( currentRowSpan / 2 ) ;
529
-
530
- // 2. Find the appropriate place to insert a new cell at the next row.
531
- var newCellRowIndex = currentRowIndex + Math.ceil( currentRowSpan / 2 ) ;
532
- var oRow = tableMap[newCellRowIndex] ;
533
- var insertMarker = null ;
534
- for ( var i = cellIndex+1 ; i < oRow.length ; i++ )
535
- {
536
- if ( oRow[i].parentNode.rowIndex == newCellRowIndex )
537
- {
538
- insertMarker = oRow[i] ;
539
- break ;
540
- }
541
- }
542
-
543
- // 3. Insert the new cell to the indicated place, with the appropriate rowSpan and colSpan, next row.
544
- var newCell = FCK.EditorDocument.createElement( currentCell.nodeName ) ;
545
- newCell.rowSpan = Math.floor( currentRowSpan / 2 ) ;
546
- if ( currentColSpan > 1 )
547
- newCell.colSpan = currentColSpan ;
548
- if ( FCKBrowserInfo.IsGeckoLike )
549
- FCKTools.AppendBogusBr( newCell ) ;
550
- currentCell.parentNode.parentNode.parentNode.rows[newCellRowIndex].insertBefore( newCell, insertMarker ) ;
551
- }
552
- else
553
- {
554
- // 1. Insert a new row.
555
- var newSectionRowIdx = currentCell.parentNode.sectionRowIndex + 1 ;
556
- var newRow = FCK.EditorDocument.createElement( 'tr' ) ;
557
- var tSection = currentCell.parentNode.parentNode ;
558
- if ( tSection.rows.length > newSectionRowIdx )
559
- tSection.insertBefore( newRow, tSection.rows[newSectionRowIdx] ) ;
560
- else
561
- tSection.appendChild( newRow ) ;
562
-
563
- // 2. +1 to rowSpan for all cells crossing currentCell's row.
564
- for ( var i = 0 ; i < tableMap[currentRowIndex].length ; )
565
- {
566
- var colSpan = tableMap[currentRowIndex][i].colSpan ;
567
- if ( isNaN( colSpan ) || colSpan < 1 )
568
- colSpan = 1 ;
569
- if ( i == cellIndex )
570
- {
571
- i += colSpan ;
572
- continue ;
573
- }
574
- var rowSpan = tableMap[currentRowIndex][i].rowSpan ;
575
- if ( isNaN( rowSpan ) )
576
- rowSpan = 1 ;
577
- tableMap[currentRowIndex][i].rowSpan = rowSpan + 1 ;
578
- i += colSpan ;
579
- }
580
-
581
- // 3. Insert a new cell to new row. Set colSpan on the new cell.
582
- var newCell = FCK.EditorDocument.createElement( currentCell.nodeName ) ;
583
- if ( currentColSpan > 1 )
584
- newCell.colSpan = currentColSpan ;
585
- if ( FCKBrowserInfo.IsGeckoLike )
586
- FCKTools.AppendBogusBr( newCell ) ;
587
- newRow.appendChild( newCell ) ;
588
- }
589
- }
590
-
591
- // Get the cell index from a TableMap.
592
- FCKTableHandler._GetCellIndexSpan = function( tableMap, rowIndex, cell )
593
- {
594
- if ( tableMap.length < rowIndex + 1 )
595
- return null ;
596
-
597
- var oRow = tableMap[ rowIndex ] ;
598
-
599
- for ( var c = 0 ; c < oRow.length ; c++ )
600
- {
601
- if ( oRow[c] == cell )
602
- return c ;
603
- }
604
-
605
- return null ;
606
- }
607
-
608
- // Get the cell location from a TableMap. Returns an array with an [x,y] location
609
- FCKTableHandler._GetCellLocation = function( tableMap, cell )
610
- {
611
- for ( var i = 0 ; i < tableMap.length; i++ )
612
- {
613
- for ( var c = 0 ; c < tableMap[i].length ; c++ )
614
- {
615
- if ( tableMap[i][c] == cell ) return [i,c];
616
- }
617
- }
618
- return null ;
619
- }
620
-
621
- // This function is quite hard to explain. It creates a matrix representing all cells in a table.
622
- // The difference here is that the "spanned" cells (colSpan and rowSpan) are duplicated on the matrix
623
- // cells that are "spanned". For example, a row with 3 cells where the second cell has colSpan=2 and rowSpan=3
624
- // will produce a bi-dimensional matrix with the following values (representing the cells):
625
- // Cell1, Cell2, Cell2, Cell3
626
- // Cell4, Cell2, Cell2, Cell5
627
- // Cell6, Cell2, Cell2, Cell7
628
- FCKTableHandler._CreateTableMap = function( refCell )
629
- {
630
- var table = (refCell.nodeName == 'TABLE' ? refCell : refCell.parentNode.parentNode.parentNode ) ;
631
-
632
- var aRows = table.rows ;
633
-
634
- // Row and Column counters.
635
- var r = -1 ;
636
-
637
- var aMap = new Array() ;
638
-
639
- for ( var i = 0 ; i < aRows.length ; i++ )
640
- {
641
- r++ ;
642
- if ( !aMap[r] )
643
- aMap[r] = new Array() ;
644
-
645
- var c = -1 ;
646
-
647
- for ( var j = 0 ; j < aRows[i].cells.length ; j++ )
648
- {
649
- var oCell = aRows[i].cells[j] ;
650
-
651
- c++ ;
652
- while ( aMap[r][c] )
653
- c++ ;
654
-
655
- var iColSpan = isNaN( oCell.colSpan ) ? 1 : oCell.colSpan ;
656
- var iRowSpan = isNaN( oCell.rowSpan ) ? 1 : oCell.rowSpan ;
657
-
658
- for ( var rs = 0 ; rs < iRowSpan ; rs++ )
659
- {
660
- if ( !aMap[r + rs] )
661
- aMap[r + rs] = new Array() ;
662
-
663
- for ( var cs = 0 ; cs < iColSpan ; cs++ )
664
- {
665
- aMap[r + rs][c + cs] = aRows[i].cells[j] ;
666
- }
667
- }
668
-
669
- c += iColSpan - 1 ;
670
- }
671
- }
672
- return aMap ;
673
- }
674
-
675
- // This function is the inverse of _CreateTableMap - it takes in a table map and converts it to an HTML table.
676
- FCKTableHandler._InstallTableMap = function( tableMap, table )
677
- {
678
- // Workaround for #1917 : MSIE will always report a cell's rowSpan as 1 as long
679
- // as the cell is not attached to a row. So we'll need an alternative attribute
680
- // for storing the calculated rowSpan in IE.
681
- var rowSpanAttr = FCKBrowserInfo.IsIE ? "_fckrowspan" : "rowSpan" ;
682
-
683
- // Disconnect all the cells in tableMap from their parents, set all colSpan and rowSpan attributes to 1.
684
- for ( var i = 0 ; i < tableMap.length ; i++ )
685
- {
686
- for ( var j = 0 ; j < tableMap[i].length ; j++ )
687
- {
688
- var cell = tableMap[i][j] ;
689
- if ( cell.parentNode )
690
- cell.parentNode.removeChild( cell ) ;
691
- cell.colSpan = cell[rowSpanAttr] = 1 ;
692
- }
693
- }
694
-
695
- // Scan by rows and set colSpan.
696
- var maxCol = 0 ;
697
- for ( var i = 0 ; i < tableMap.length ; i++ )
698
- {
699
- for ( var j = 0 ; j < tableMap[i].length ; j++ )
700
- {
701
- var cell = tableMap[i][j] ;
702
- if ( ! cell)
703
- continue ;
704
- if ( j > maxCol )
705
- maxCol = j ;
706
- if ( cell._colScanned === true )
707
- continue ;
708
- if ( tableMap[i][j-1] == cell )
709
- cell.colSpan++ ;
710
- if ( tableMap[i][j+1] != cell )
711
- cell._colScanned = true ;
712
- }
713
- }
714
-
715
- // Scan by columns and set rowSpan.
716
- for ( var i = 0 ; i <= maxCol ; i++ )
717
- {
718
- for ( var j = 0 ; j < tableMap.length ; j++ )
719
- {
720
- if ( ! tableMap[j] )
721
- continue ;
722
- var cell = tableMap[j][i] ;
723
- if ( ! cell || cell._rowScanned === true )
724
- continue ;
725
- if ( tableMap[j-1] && tableMap[j-1][i] == cell )
726
- cell[rowSpanAttr]++ ;
727
- if ( ! tableMap[j+1] || tableMap[j+1][i] != cell )
728
- cell._rowScanned = true ;
729
- }
730
- }
731
-
732
- // Clear all temporary flags.
733
- for ( var i = 0 ; i < tableMap.length ; i++ )
734
- {
735
- for ( var j = 0 ; j < tableMap[i].length ; j++)
736
- {
737
- var cell = tableMap[i][j] ;
738
- FCKDomTools.ClearElementJSProperty(cell, '_colScanned' ) ;
739
- FCKDomTools.ClearElementJSProperty(cell, '_rowScanned' ) ;
740
- }
741
- }
742
-
743
- // Insert physical rows and columns to the table.
744
- for ( var i = 0 ; i < tableMap.length ; i++ )
745
- {
746
- var rowObj = FCK.EditorDocument.createElement( 'tr' ) ;
747
- for ( var j = 0 ; j < tableMap[i].length ; )
748
- {
749
- var cell = tableMap[i][j] ;
750
- if ( tableMap[i-1] && tableMap[i-1][j] == cell )
751
- {
752
- j += cell.colSpan ;
753
- continue ;
754
- }
755
- rowObj.appendChild( cell ) ;
756
- if ( rowSpanAttr != 'rowSpan' )
757
- {
758
- cell.rowSpan = cell[rowSpanAttr] ;
759
- cell.removeAttribute( rowSpanAttr ) ;
760
- }
761
- j += cell.colSpan ;
762
- if ( cell.colSpan == 1 )
763
- cell.removeAttribute( 'colspan' ) ;
764
- if ( cell.rowSpan == 1 )
765
- cell.removeAttribute( 'rowspan' ) ;
766
- }
767
- if ( FCKBrowserInfo.IsIE )
768
- {
769
- table.rows[i].replaceNode( rowObj ) ;
770
- }
771
- else
772
- {
773
- table.rows[i].innerHTML = '' ;
774
- FCKDomTools.MoveChildren( rowObj, table.rows[i] ) ;
775
- }
776
- }
777
- }
778
-
779
- FCKTableHandler._MoveCaretToCell = function ( refCell, toStart )
780
- {
781
- var range = new FCKDomRange( FCK.EditorWindow ) ;
782
- range.MoveToNodeContents( refCell ) ;
783
- range.Collapse( toStart ) ;
784
- range.Select() ;
785
- }
786
-
787
- FCKTableHandler.ClearRow = function( tr )
788
- {
789
- // Get the array of row's cells.
790
- var aCells = tr.cells ;
791
-
792
- // Replace the contents of each cell with "nothing".
793
- for ( var i = 0 ; i < aCells.length ; i++ )
794
- {
795
- aCells[i].innerHTML = '' ;
796
-
797
- if ( FCKBrowserInfo.IsGeckoLike )
798
- FCKTools.AppendBogusBr( aCells[i] ) ;
799
- }
800
- }
801
-
802
- FCKTableHandler.GetMergeRightTarget = function()
803
- {
804
- var cells = this.GetSelectedCells() ;
805
- if ( cells.length != 1 )
806
- return null ;
807
-
808
- var refCell = cells[0] ;
809
- var tableMap = this._CreateTableMap( refCell ) ;
810
- var rowIdx = refCell.parentNode.rowIndex ;
811
- var colIdx = this._GetCellIndexSpan( tableMap, rowIdx, refCell ) ;
812
- var nextColIdx = colIdx + ( isNaN( refCell.colSpan ) ? 1 : refCell.colSpan ) ;
813
- var nextCell = tableMap[rowIdx][nextColIdx] ;
814
-
815
- if ( ! nextCell )
816
- return null ;
817
-
818
- // The two cells must have the same vertical geometry, otherwise merging does not make sense.
819
- this._MarkCells( [refCell, nextCell], '_SizeTest' ) ;
820
- var refGeometry = this._GetMarkerGeometry( tableMap, rowIdx, colIdx, '_SizeTest' ) ;
821
- var nextGeometry = this._GetMarkerGeometry( tableMap, rowIdx, nextColIdx, '_SizeTest' ) ;
822
- this._UnmarkCells( [refCell, nextCell], '_SizeTest' ) ;
823
-
824
- if ( refGeometry.height != nextGeometry.height || refGeometry.y != nextGeometry.y )
825
- return null ;
826
-
827
- return { 'refCell' : refCell, 'nextCell' : nextCell, 'tableMap' : tableMap } ;
828
- }
829
-
830
- FCKTableHandler.GetMergeDownTarget = function()
831
- {
832
- var cells = this.GetSelectedCells() ;
833
- if ( cells.length != 1 )
834
- return null ;
835
-
836
- var refCell = cells[0] ;
837
- var tableMap = this._CreateTableMap( refCell ) ;
838
- var rowIdx = refCell.parentNode.rowIndex ;
839
- var colIdx = this._GetCellIndexSpan( tableMap, rowIdx, refCell ) ;
840
- var newRowIdx = rowIdx + ( isNaN( refCell.rowSpan ) ? 1 : refCell.rowSpan ) ;
841
- if ( ! tableMap[newRowIdx] )
842
- return null ;
843
-
844
- var nextCell = tableMap[newRowIdx][colIdx] ;
845
-
846
- if ( ! nextCell )
847
- return null ;
848
-
849
- // Check if the selected cells are both in the same table section (thead, tfoot or tbody).
850
- if ( refCell.parentNode.parentNode != nextCell.parentNode.parentNode )
851
- return null ;
852
-
853
- // The two cells must have the same horizontal geometry, otherwise merging does not makes sense.
854
- this._MarkCells( [refCell, nextCell], '_SizeTest' ) ;
855
- var refGeometry = this._GetMarkerGeometry( tableMap, rowIdx, colIdx, '_SizeTest' ) ;
856
- var nextGeometry = this._GetMarkerGeometry( tableMap, newRowIdx, colIdx, '_SizeTest' ) ;
857
- this._UnmarkCells( [refCell, nextCell], '_SizeTest' ) ;
858
-
859
- if ( refGeometry.width != nextGeometry.width || refGeometry.x != nextGeometry.x )
860
- return null ;
861
-
862
- return { 'refCell' : refCell, 'nextCell' : nextCell, 'tableMap' : tableMap } ;
863
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcktablehandler_gecko.js DELETED
@@ -1,56 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Manage table operations (non-IE).
22
- */
23
-
24
- FCKTableHandler.GetSelectedCells = function()
25
- {
26
- var aCells = new Array() ;
27
-
28
- var oSelection = FCKSelection.GetSelection() ;
29
-
30
- // If the selection is a text.
31
- if ( oSelection.rangeCount == 1 && oSelection.anchorNode.nodeType == 3 )
32
- {
33
- var oParent = FCKTools.GetElementAscensor( oSelection.anchorNode, 'TD,TH' ) ;
34
-
35
- if ( oParent )
36
- aCells[0] = oParent ;
37
-
38
- return aCells ;
39
- }
40
-
41
- for ( var i = 0 ; i < oSelection.rangeCount ; i++ )
42
- {
43
- var oRange = oSelection.getRangeAt(i) ;
44
- var oCell ;
45
-
46
- if ( oRange.startContainer.tagName.Equals( 'TD', 'TH' ) )
47
- oCell = oRange.startContainer ;
48
- else
49
- oCell = oRange.startContainer.childNodes[ oRange.startOffset ] ;
50
-
51
- if ( oCell.nodeName.Equals( 'TD', 'TH' ) )
52
- aCells[aCells.length] = oCell ;
53
- }
54
-
55
- return aCells ;
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcktablehandler_ie.js DELETED
@@ -1,64 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Manage table operations (IE specific).
22
- */
23
-
24
- FCKTableHandler.GetSelectedCells = function()
25
- {
26
- if ( FCKSelection.GetType() == 'Control' )
27
- {
28
- var td = FCKSelection.MoveToAncestorNode( ['TD', 'TH'] ) ;
29
- return td ? [ td ] : [] ;
30
- }
31
-
32
- var aCells = new Array() ;
33
-
34
- var oRange = FCKSelection.GetSelection().createRange() ;
35
- // var oParent = oRange.parentElement() ;
36
- var oParent = FCKSelection.GetParentElement() ;
37
-
38
- if ( oParent && oParent.tagName.Equals( 'TD', 'TH' ) )
39
- aCells[0] = oParent ;
40
- else
41
- {
42
- oParent = FCKSelection.MoveToAncestorNode( 'TABLE' ) ;
43
-
44
- if ( oParent )
45
- {
46
- // Loops throw all cells checking if the cell is, or part of it, is inside the selection
47
- // and then add it to the selected cells collection.
48
- for ( var i = 0 ; i < oParent.cells.length ; i++ )
49
- {
50
- var oCellRange = FCK.EditorDocument.body.createTextRange() ;
51
- oCellRange.moveToElementText( oParent.cells[i] ) ;
52
-
53
- if ( oRange.inRange( oCellRange )
54
- || ( oRange.compareEndPoints('StartToStart',oCellRange) >= 0 && oRange.compareEndPoints('StartToEnd',oCellRange) <= 0 )
55
- || ( oRange.compareEndPoints('EndToStart',oCellRange) >= 0 && oRange.compareEndPoints('EndToEnd',oCellRange) <= 0 ) )
56
- {
57
- aCells[aCells.length] = oParent.cells[i] ;
58
- }
59
- }
60
- }
61
- }
62
-
63
- return aCells ;
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcktoolbaritems.js DELETED
@@ -1,124 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Toolbar items definitions.
22
- */
23
-
24
- var FCKToolbarItems = new Object() ;
25
- FCKToolbarItems.LoadedItems = new Object() ;
26
-
27
- FCKToolbarItems.RegisterItem = function( itemName, item )
28
- {
29
- this.LoadedItems[ itemName ] = item ;
30
- }
31
-
32
- FCKToolbarItems.GetItem = function( itemName )
33
- {
34
- var oItem = FCKToolbarItems.LoadedItems[ itemName ] ;
35
-
36
- if ( oItem )
37
- return oItem ;
38
-
39
- switch ( itemName )
40
- {
41
- case 'Source' : oItem = new FCKToolbarButton( 'Source' , FCKLang.Source, null, FCK_TOOLBARITEM_ICONTEXT, true, true, 1 ) ; break ;
42
- case 'DocProps' : oItem = new FCKToolbarButton( 'DocProps' , FCKLang.DocProps, null, null, null, null, 2 ) ; break ;
43
- case 'Save' : oItem = new FCKToolbarButton( 'Save' , FCKLang.Save, null, null, true, null, 3 ) ; break ;
44
- case 'NewPage' : oItem = new FCKToolbarButton( 'NewPage' , FCKLang.NewPage, null, null, true, null, 4 ) ; break ;
45
- case 'Preview' : oItem = new FCKToolbarButton( 'Preview' , FCKLang.Preview, null, null, true, null, 5 ) ; break ;
46
- case 'Templates' : oItem = new FCKToolbarButton( 'Templates' , FCKLang.Templates, null, null, null, null, 6 ) ; break ;
47
- case 'About' : oItem = new FCKToolbarButton( 'About' , FCKLang.About, null, null, true, null, 47 ) ; break ;
48
-
49
- case 'Cut' : oItem = new FCKToolbarButton( 'Cut' , FCKLang.Cut, null, null, false, true, 7 ) ; break ;
50
- case 'Copy' : oItem = new FCKToolbarButton( 'Copy' , FCKLang.Copy, null, null, false, true, 8 ) ; break ;
51
- case 'Paste' : oItem = new FCKToolbarButton( 'Paste' , FCKLang.Paste, null, null, false, true, 9 ) ; break ;
52
- case 'PasteText' : oItem = new FCKToolbarButton( 'PasteText' , FCKLang.PasteText, null, null, false, true, 10 ) ; break ;
53
- case 'PasteWord' : oItem = new FCKToolbarButton( 'PasteWord' , FCKLang.PasteWord, null, null, false, true, 11 ) ; break ;
54
- case 'Print' : oItem = new FCKToolbarButton( 'Print' , FCKLang.Print, null, null, false, true, 12 ) ; break ;
55
- case 'SpellCheck' : oItem = new FCKToolbarButton( 'SpellCheck', FCKLang.SpellCheck, null, null, null, null, 13 ) ; break ;
56
- case 'Undo' : oItem = new FCKToolbarButton( 'Undo' , FCKLang.Undo, null, null, false, true, 14 ) ; break ;
57
- case 'Redo' : oItem = new FCKToolbarButton( 'Redo' , FCKLang.Redo, null, null, false, true, 15 ) ; break ;
58
- case 'SelectAll' : oItem = new FCKToolbarButton( 'SelectAll' , FCKLang.SelectAll, null, null, true, null, 18 ) ; break ;
59
- case 'RemoveFormat' : oItem = new FCKToolbarButton( 'RemoveFormat', FCKLang.RemoveFormat, null, null, false, true, 19 ) ; break ;
60
- case 'FitWindow' : oItem = new FCKToolbarButton( 'FitWindow' , FCKLang.FitWindow, null, null, true, true, 66 ) ; break ;
61
-
62
- case 'Bold' : oItem = new FCKToolbarButton( 'Bold' , FCKLang.Bold, null, null, false, true, 20 ) ; break ;
63
- case 'Italic' : oItem = new FCKToolbarButton( 'Italic' , FCKLang.Italic, null, null, false, true, 21 ) ; break ;
64
- case 'Underline' : oItem = new FCKToolbarButton( 'Underline' , FCKLang.Underline, null, null, false, true, 22 ) ; break ;
65
- case 'StrikeThrough' : oItem = new FCKToolbarButton( 'StrikeThrough' , FCKLang.StrikeThrough, null, null, false, true, 23 ) ; break ;
66
- case 'Subscript' : oItem = new FCKToolbarButton( 'Subscript' , FCKLang.Subscript, null, null, false, true, 24 ) ; break ;
67
- case 'Superscript' : oItem = new FCKToolbarButton( 'Superscript' , FCKLang.Superscript, null, null, false, true, 25 ) ; break ;
68
-
69
- case 'OrderedList' : oItem = new FCKToolbarButton( 'InsertOrderedList' , FCKLang.NumberedListLbl, FCKLang.NumberedList, null, false, true, 26 ) ; break ;
70
- case 'UnorderedList' : oItem = new FCKToolbarButton( 'InsertUnorderedList' , FCKLang.BulletedListLbl, FCKLang.BulletedList, null, false, true, 27 ) ; break ;
71
- case 'Outdent' : oItem = new FCKToolbarButton( 'Outdent' , FCKLang.DecreaseIndent, null, null, false, true, 28 ) ; break ;
72
- case 'Indent' : oItem = new FCKToolbarButton( 'Indent' , FCKLang.IncreaseIndent, null, null, false, true, 29 ) ; break ;
73
- case 'Blockquote' : oItem = new FCKToolbarButton( 'Blockquote' , FCKLang.Blockquote, null, null, false, true, 73 ) ; break ;
74
- case 'CreateDiv' : oItem = new FCKToolbarButton( 'CreateDiv' , FCKLang.CreateDiv, null, null, false, true, 74 ) ; break ;
75
-
76
- case 'Link' : oItem = new FCKToolbarButton( 'Link' , FCKLang.InsertLinkLbl, FCKLang.InsertLink, null, false, true, 34 ) ; break ;
77
- case 'Unlink' : oItem = new FCKToolbarButton( 'Unlink' , FCKLang.RemoveLink, null, null, false, true, 35 ) ; break ;
78
- case 'Anchor' : oItem = new FCKToolbarButton( 'Anchor' , FCKLang.Anchor, null, null, null, null, 36 ) ; break ;
79
-
80
- case 'Image' : oItem = new FCKToolbarButton( 'Image' , FCKLang.InsertImageLbl, FCKLang.InsertImage, null, false, true, 37 ) ; break ;
81
- case 'Flash' : oItem = new FCKToolbarButton( 'Flash' , FCKLang.InsertFlashLbl, FCKLang.InsertFlash, null, false, true, 38 ) ; break ;
82
- case 'Table' : oItem = new FCKToolbarButton( 'Table' , FCKLang.InsertTableLbl, FCKLang.InsertTable, null, false, true, 39 ) ; break ;
83
- case 'SpecialChar' : oItem = new FCKToolbarButton( 'SpecialChar' , FCKLang.InsertSpecialCharLbl, FCKLang.InsertSpecialChar, null, false, true, 42 ) ; break ;
84
- case 'Smiley' : oItem = new FCKToolbarButton( 'Smiley' , FCKLang.InsertSmileyLbl, FCKLang.InsertSmiley, null, false, true, 41 ) ; break ;
85
- case 'PageBreak' : oItem = new FCKToolbarButton( 'PageBreak' , FCKLang.PageBreakLbl, FCKLang.PageBreak, null, false, true, 43 ) ; break ;
86
-
87
- case 'Rule' : oItem = new FCKToolbarButton( 'Rule' , FCKLang.InsertLineLbl, FCKLang.InsertLine, null, false, true, 40 ) ; break ;
88
-
89
- case 'JustifyLeft' : oItem = new FCKToolbarButton( 'JustifyLeft' , FCKLang.LeftJustify, null, null, false, true, 30 ) ; break ;
90
- case 'JustifyCenter' : oItem = new FCKToolbarButton( 'JustifyCenter' , FCKLang.CenterJustify, null, null, false, true, 31 ) ; break ;
91
- case 'JustifyRight' : oItem = new FCKToolbarButton( 'JustifyRight' , FCKLang.RightJustify, null, null, false, true, 32 ) ; break ;
92
- case 'JustifyFull' : oItem = new FCKToolbarButton( 'JustifyFull' , FCKLang.BlockJustify, null, null, false, true, 33 ) ; break ;
93
-
94
- case 'Style' : oItem = new FCKToolbarStyleCombo() ; break ;
95
- case 'FontName' : oItem = new FCKToolbarFontsCombo() ; break ;
96
- case 'FontSize' : oItem = new FCKToolbarFontSizeCombo() ; break ;
97
- case 'FontFormat' : oItem = new FCKToolbarFontFormatCombo() ; break ;
98
-
99
- case 'TextColor' : oItem = new FCKToolbarPanelButton( 'TextColor', FCKLang.TextColor, null, null, 45 ) ; break ;
100
- case 'BGColor' : oItem = new FCKToolbarPanelButton( 'BGColor' , FCKLang.BGColor, null, null, 46 ) ; break ;
101
-
102
- case 'Find' : oItem = new FCKToolbarButton( 'Find' , FCKLang.Find, null, null, null, null, 16 ) ; break ;
103
- case 'Replace' : oItem = new FCKToolbarButton( 'Replace' , FCKLang.Replace, null, null, null, null, 17 ) ; break ;
104
-
105
- case 'Form' : oItem = new FCKToolbarButton( 'Form' , FCKLang.Form, null, null, null, null, 48 ) ; break ;
106
- case 'Checkbox' : oItem = new FCKToolbarButton( 'Checkbox' , FCKLang.Checkbox, null, null, null, null, 49 ) ; break ;
107
- case 'Radio' : oItem = new FCKToolbarButton( 'Radio' , FCKLang.RadioButton, null, null, null, null, 50 ) ; break ;
108
- case 'TextField' : oItem = new FCKToolbarButton( 'TextField' , FCKLang.TextField, null, null, null, null, 51 ) ; break ;
109
- case 'Textarea' : oItem = new FCKToolbarButton( 'Textarea' , FCKLang.Textarea, null, null, null, null, 52 ) ; break ;
110
- case 'HiddenField' : oItem = new FCKToolbarButton( 'HiddenField' , FCKLang.HiddenField, null, null, null, null, 56 ) ; break ;
111
- case 'Button' : oItem = new FCKToolbarButton( 'Button' , FCKLang.Button, null, null, null, null, 54 ) ; break ;
112
- case 'Select' : oItem = new FCKToolbarButton( 'Select' , FCKLang.SelectionField, null, null, null, null, 53 ) ; break ;
113
- case 'ImageButton' : oItem = new FCKToolbarButton( 'ImageButton' , FCKLang.ImageButton, null, null, null, null, 55 ) ; break ;
114
- case 'ShowBlocks' : oItem = new FCKToolbarButton( 'ShowBlocks' , FCKLang.ShowBlocks, null, null, null, true, 72 ) ; break ;
115
-
116
- default:
117
- alert( FCKLang.UnknownToolbarItem.replace( /%1/g, itemName ) ) ;
118
- return null ;
119
- }
120
-
121
- FCKToolbarItems.LoadedItems[ itemName ] = oItem ;
122
-
123
- return oItem ;
124
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcktoolbarset.js DELETED
@@ -1,399 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Defines the FCKToolbarSet object that is used to load and draw the
22
- * toolbar.
23
- */
24
-
25
- function FCKToolbarSet_Create( overhideLocation )
26
- {
27
- var oToolbarSet ;
28
-
29
- var sLocation = overhideLocation || FCKConfig.ToolbarLocation ;
30
- switch ( sLocation )
31
- {
32
- case 'In' :
33
- document.getElementById( 'xToolbarRow' ).style.display = '' ;
34
- oToolbarSet = new FCKToolbarSet( document ) ;
35
- break ;
36
- case 'None' :
37
- oToolbarSet = new FCKToolbarSet( document ) ;
38
- break ;
39
-
40
- // case 'OutTop' :
41
- // Not supported.
42
-
43
- default :
44
- FCK.Events.AttachEvent( 'OnBlur', FCK_OnBlur ) ;
45
- FCK.Events.AttachEvent( 'OnFocus', FCK_OnFocus ) ;
46
-
47
- var eToolbarTarget ;
48
-
49
- // Out:[TargetWindow]([TargetId])
50
- var oOutMatch = sLocation.match( /^Out:(.+)\((\w+)\)$/ ) ;
51
- if ( oOutMatch )
52
- {
53
- if ( FCKBrowserInfo.IsAIR )
54
- FCKAdobeAIR.ToolbarSet_GetOutElement( window, oOutMatch ) ;
55
- else
56
- eToolbarTarget = eval( 'parent.' + oOutMatch[1] ).document.getElementById( oOutMatch[2] ) ;
57
- }
58
- else
59
- {
60
- // Out:[TargetId]
61
- oOutMatch = sLocation.match( /^Out:(\w+)$/ ) ;
62
- if ( oOutMatch )
63
- eToolbarTarget = parent.document.getElementById( oOutMatch[1] ) ;
64
- }
65
-
66
- if ( !eToolbarTarget )
67
- {
68
- alert( 'Invalid value for "ToolbarLocation"' ) ;
69
- return arguments.callee( 'In' );
70
- }
71
-
72
- // If it is a shared toolbar, it may be already available in the target element.
73
- oToolbarSet = eToolbarTarget.__FCKToolbarSet ;
74
- if ( oToolbarSet )
75
- break ;
76
-
77
- // Create the IFRAME that will hold the toolbar inside the target element.
78
- var eToolbarIFrame = FCKTools.GetElementDocument( eToolbarTarget ).createElement( 'iframe' ) ;
79
- eToolbarIFrame.src = 'javascript:void(0)' ;
80
- eToolbarIFrame.frameBorder = 0 ;
81
- eToolbarIFrame.width = '100%' ;
82
- eToolbarIFrame.height = '10' ;
83
- eToolbarTarget.appendChild( eToolbarIFrame ) ;
84
- eToolbarIFrame.unselectable = 'on' ;
85
-
86
- // Write the basic HTML for the toolbar (copy from the editor main page).
87
- var eTargetDocument = eToolbarIFrame.contentWindow.document ;
88
-
89
- // Workaround for Safari 12256. Ticket #63
90
- var sBase = '' ;
91
- if ( FCKBrowserInfo.IsSafari )
92
- sBase = '<base href="' + window.document.location + '">' ;
93
-
94
- // Initialize the IFRAME document body.
95
- eTargetDocument.open() ;
96
- eTargetDocument.write( '<html><head>' + sBase + '<script type="text/javascript"> var adjust = function() { window.frameElement.height = document.body.scrollHeight ; }; '
97
- + 'window.onresize = window.onload = '
98
- + 'function(){' // poll scrollHeight until it no longer changes for 1 sec.
99
- + 'var timer = null;'
100
- + 'var lastHeight = -1;'
101
- + 'var lastChange = 0;'
102
- + 'var poller = function(){'
103
- + 'var currentHeight = document.body.scrollHeight || 0;'
104
- + 'var currentTime = (new Date()).getTime();'
105
- + 'if (currentHeight != lastHeight){'
106
- + 'lastChange = currentTime;'
107
- + 'adjust();'
108
- + 'lastHeight = document.body.scrollHeight;'
109
- + '}'
110
- + 'if (lastChange < currentTime - 1000) clearInterval(timer);'
111
- + '};'
112
- + 'timer = setInterval(poller, 100);'
113
- + '}'
114
- + '</script></head><body style="overflow: hidden">' + document.getElementById( 'xToolbarSpace' ).innerHTML + '</body></html>' ) ;
115
- eTargetDocument.close() ;
116
-
117
- if( FCKBrowserInfo.IsAIR )
118
- FCKAdobeAIR.ToolbarSet_InitOutFrame( eTargetDocument ) ;
119
-
120
- FCKTools.AddEventListener( eTargetDocument, 'contextmenu', FCKTools.CancelEvent ) ;
121
-
122
- // Load external resources (must be done here, otherwise Firefox will not
123
- // have the document DOM ready to be used right away.
124
- FCKTools.AppendStyleSheet( eTargetDocument, FCKConfig.SkinEditorCSS ) ;
125
-
126
- oToolbarSet = eToolbarTarget.__FCKToolbarSet = new FCKToolbarSet( eTargetDocument ) ;
127
- oToolbarSet._IFrame = eToolbarIFrame ;
128
-
129
- if ( FCK.IECleanup )
130
- FCK.IECleanup.AddItem( eToolbarTarget, FCKToolbarSet_Target_Cleanup ) ;
131
- }
132
-
133
- oToolbarSet.CurrentInstance = FCK ;
134
- if ( !oToolbarSet.ToolbarItems )
135
- oToolbarSet.ToolbarItems = FCKToolbarItems ;
136
-
137
- FCK.AttachToOnSelectionChange( oToolbarSet.RefreshItemsState ) ;
138
-
139
- return oToolbarSet ;
140
- }
141
-
142
- function FCK_OnBlur( editorInstance )
143
- {
144
- var eToolbarSet = editorInstance.ToolbarSet ;
145
-
146
- if ( eToolbarSet.CurrentInstance == editorInstance )
147
- eToolbarSet.Disable() ;
148
- }
149
-
150
- function FCK_OnFocus( editorInstance )
151
- {
152
- var oToolbarset = editorInstance.ToolbarSet ;
153
- var oInstance = editorInstance || FCK ;
154
-
155
- // Unregister the toolbar window from the current instance.
156
- oToolbarset.CurrentInstance.FocusManager.RemoveWindow( oToolbarset._IFrame.contentWindow ) ;
157
-
158
- // Set the new current instance.
159
- oToolbarset.CurrentInstance = oInstance ;
160
-
161
- // Register the toolbar window in the current instance.
162
- oInstance.FocusManager.AddWindow( oToolbarset._IFrame.contentWindow, true ) ;
163
-
164
- oToolbarset.Enable() ;
165
- }
166
-
167
- function FCKToolbarSet_Cleanup()
168
- {
169
- this._TargetElement = null ;
170
- this._IFrame = null ;
171
- }
172
-
173
- function FCKToolbarSet_Target_Cleanup()
174
- {
175
- this.__FCKToolbarSet = null ;
176
- }
177
-
178
- var FCKToolbarSet = function( targetDocument )
179
- {
180
- this._Document = targetDocument ;
181
-
182
- // Get the element that will hold the elements structure.
183
- this._TargetElement = targetDocument.getElementById( 'xToolbar' ) ;
184
-
185
- // Setup the expand and collapse handlers.
186
- var eExpandHandle = targetDocument.getElementById( 'xExpandHandle' ) ;
187
- var eCollapseHandle = targetDocument.getElementById( 'xCollapseHandle' ) ;
188
-
189
- eExpandHandle.title = FCKLang.ToolbarExpand ;
190
- FCKTools.AddEventListener( eExpandHandle, 'click', FCKToolbarSet_Expand_OnClick ) ;
191
-
192
- eCollapseHandle.title = FCKLang.ToolbarCollapse ;
193
- FCKTools.AddEventListener( eCollapseHandle, 'click', FCKToolbarSet_Collapse_OnClick ) ;
194
-
195
- // Set the toolbar state at startup.
196
- if ( !FCKConfig.ToolbarCanCollapse || FCKConfig.ToolbarStartExpanded )
197
- this.Expand() ;
198
- else
199
- this.Collapse() ;
200
-
201
- // Enable/disable the collapse handler
202
- eCollapseHandle.style.display = FCKConfig.ToolbarCanCollapse ? '' : 'none' ;
203
-
204
- if ( FCKConfig.ToolbarCanCollapse )
205
- eCollapseHandle.style.display = '' ;
206
- else
207
- targetDocument.getElementById( 'xTBLeftBorder' ).style.display = '' ;
208
-
209
- // Set the default properties.
210
- this.Toolbars = new Array() ;
211
- this.IsLoaded = false ;
212
-
213
- if ( FCK.IECleanup )
214
- FCK.IECleanup.AddItem( this, FCKToolbarSet_Cleanup ) ;
215
- }
216
-
217
- function FCKToolbarSet_Expand_OnClick()
218
- {
219
- FCK.ToolbarSet.Expand() ;
220
- }
221
-
222
- function FCKToolbarSet_Collapse_OnClick()
223
- {
224
- FCK.ToolbarSet.Collapse() ;
225
- }
226
-
227
- FCKToolbarSet.prototype.Expand = function()
228
- {
229
- this._ChangeVisibility( false ) ;
230
- }
231
-
232
- FCKToolbarSet.prototype.Collapse = function()
233
- {
234
- this._ChangeVisibility( true ) ;
235
- }
236
-
237
- FCKToolbarSet.prototype._ChangeVisibility = function( collapse )
238
- {
239
- this._Document.getElementById( 'xCollapsed' ).style.display = collapse ? '' : 'none' ;
240
- this._Document.getElementById( 'xExpanded' ).style.display = collapse ? 'none' : '' ;
241
-
242
- if ( FCKBrowserInfo.IsGecko )
243
- {
244
- // I had to use "setTimeout" because Gecko was not responding in a right
245
- // way when calling window.onresize() directly.
246
- FCKTools.RunFunction( window.onresize ) ;
247
- }
248
- }
249
-
250
- FCKToolbarSet.prototype.Load = function( toolbarSetName )
251
- {
252
- this.Name = toolbarSetName ;
253
-
254
- this.Items = new Array() ;
255
-
256
- // Reset the array of toolbar items that are active only on WYSIWYG mode.
257
- this.ItemsWysiwygOnly = new Array() ;
258
-
259
- // Reset the array of toolbar items that are sensitive to the cursor position.
260
- this.ItemsContextSensitive = new Array() ;
261
-
262
- // Cleanup the target element.
263
- this._TargetElement.innerHTML = '' ;
264
-
265
- var ToolbarSet = FCKConfig.ToolbarSets[toolbarSetName] ;
266
-
267
- if ( !ToolbarSet )
268
- {
269
- alert( FCKLang.UnknownToolbarSet.replace( /%1/g, toolbarSetName ) ) ;
270
- return ;
271
- }
272
-
273
- this.Toolbars = new Array() ;
274
-
275
- for ( var x = 0 ; x < ToolbarSet.length ; x++ )
276
- {
277
- var oToolbarItems = ToolbarSet[x] ;
278
-
279
- // If the configuration for the toolbar is missing some element or has any extra comma
280
- // this item won't be valid, so skip it and keep on processing.
281
- if ( !oToolbarItems )
282
- continue ;
283
-
284
- var oToolbar ;
285
-
286
- if ( typeof( oToolbarItems ) == 'string' )
287
- {
288
- if ( oToolbarItems == '/' )
289
- oToolbar = new FCKToolbarBreak() ;
290
- }
291
- else
292
- {
293
- oToolbar = new FCKToolbar() ;
294
-
295
- for ( var j = 0 ; j < oToolbarItems.length ; j++ )
296
- {
297
- var sItem = oToolbarItems[j] ;
298
-
299
- if ( sItem == '-')
300
- oToolbar.AddSeparator() ;
301
- else
302
- {
303
- var oItem = FCKToolbarItems.GetItem( sItem ) ;
304
- if ( oItem )
305
- {
306
- oToolbar.AddItem( oItem ) ;
307
-
308
- this.Items.push( oItem ) ;
309
-
310
- if ( !oItem.SourceView )
311
- this.ItemsWysiwygOnly.push( oItem ) ;
312
-
313
- if ( oItem.ContextSensitive )
314
- this.ItemsContextSensitive.push( oItem ) ;
315
- }
316
- }
317
- }
318
-
319
- // oToolbar.AddTerminator() ;
320
- }
321
-
322
- oToolbar.Create( this._TargetElement ) ;
323
-
324
- this.Toolbars[ this.Toolbars.length ] = oToolbar ;
325
- }
326
-
327
- FCKTools.DisableSelection( this._Document.getElementById( 'xCollapseHandle' ).parentNode ) ;
328
-
329
- if ( FCK.Status != FCK_STATUS_COMPLETE )
330
- FCK.Events.AttachEvent( 'OnStatusChange', this.RefreshModeState ) ;
331
- else
332
- this.RefreshModeState() ;
333
-
334
- this.IsLoaded = true ;
335
- this.IsEnabled = true ;
336
-
337
- FCKTools.RunFunction( this.OnLoad ) ;
338
- }
339
-
340
- FCKToolbarSet.prototype.Enable = function()
341
- {
342
- if ( this.IsEnabled )
343
- return ;
344
-
345
- this.IsEnabled = true ;
346
-
347
- var aItems = this.Items ;
348
- for ( var i = 0 ; i < aItems.length ; i++ )
349
- aItems[i].RefreshState() ;
350
- }
351
-
352
- FCKToolbarSet.prototype.Disable = function()
353
- {
354
- if ( !this.IsEnabled )
355
- return ;
356
-
357
- this.IsEnabled = false ;
358
-
359
- var aItems = this.Items ;
360
- for ( var i = 0 ; i < aItems.length ; i++ )
361
- aItems[i].Disable() ;
362
- }
363
-
364
- FCKToolbarSet.prototype.RefreshModeState = function( editorInstance )
365
- {
366
- if ( FCK.Status != FCK_STATUS_COMPLETE )
367
- return ;
368
-
369
- var oToolbarSet = editorInstance ? editorInstance.ToolbarSet : this ;
370
- var aItems = oToolbarSet.ItemsWysiwygOnly ;
371
-
372
- if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
373
- {
374
- // Enable all buttons that are available on WYSIWYG mode only.
375
- for ( var i = 0 ; i < aItems.length ; i++ )
376
- aItems[i].Enable() ;
377
-
378
- // Refresh the buttons state.
379
- oToolbarSet.RefreshItemsState( editorInstance ) ;
380
- }
381
- else
382
- {
383
- // Refresh the buttons state.
384
- oToolbarSet.RefreshItemsState( editorInstance ) ;
385
-
386
- // Disable all buttons that are available on WYSIWYG mode only.
387
- for ( var j = 0 ; j < aItems.length ; j++ )
388
- aItems[j].Disable() ;
389
- }
390
- }
391
-
392
- FCKToolbarSet.prototype.RefreshItemsState = function( editorInstance )
393
- {
394
-
395
- var aItems = ( editorInstance ? editorInstance.ToolbarSet : this ).ItemsContextSensitive ;
396
-
397
- for ( var i = 0 ; i < aItems.length ; i++ )
398
- aItems[i].RefreshState() ;
399
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcktools.js DELETED
@@ -1,749 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Utility functions.
22
- */
23
-
24
- var FCKTools = new Object() ;
25
-
26
- FCKTools.CreateBogusBR = function( targetDocument )
27
- {
28
- var eBR = targetDocument.createElement( 'br' ) ;
29
- // eBR.setAttribute( '_moz_editor_bogus_node', 'TRUE' ) ;
30
- eBR.setAttribute( 'type', '_moz' ) ;
31
- return eBR ;
32
- }
33
-
34
- /**
35
- * Fixes relative URL entries defined inside CSS styles by appending a prefix
36
- * to them.
37
- * @param (String) cssStyles The CSS styles definition possibly containing url()
38
- * paths.
39
- * @param (String) urlFixPrefix The prefix to append to relative URLs.
40
- */
41
- FCKTools.FixCssUrls = function( urlFixPrefix, cssStyles )
42
- {
43
- if ( !urlFixPrefix || urlFixPrefix.length == 0 )
44
- return cssStyles ;
45
-
46
- return cssStyles.replace( /url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g, function( match, opener, path, closer )
47
- {
48
- if ( /^\/|^\w?:/.test( path ) )
49
- return match ;
50
- else
51
- return 'url(' + opener + urlFixPrefix + path + closer + ')' ;
52
- } ) ;
53
- }
54
-
55
- FCKTools._GetUrlFixedCss = function( cssStyles, urlFixPrefix )
56
- {
57
- var match = cssStyles.match( /^([^|]+)\|([\s\S]*)/ ) ;
58
-
59
- if ( match )
60
- return FCKTools.FixCssUrls( match[1], match[2] ) ;
61
- else
62
- return cssStyles ;
63
- }
64
-
65
- /**
66
- * Appends a <link css> or <style> element to the document.
67
- * @param (Object) documentElement The DOM document object to which append the
68
- * stylesheet.
69
- * @param (Variant) cssFileOrDef A String pointing to the CSS file URL or an
70
- * Array with many CSS file URLs or the CSS definitions for the <style>
71
- * element.
72
- * @return {Array} An array containing all elements created in the target
73
- * document. It may include <link> or <style> elements, depending on the
74
- * value passed with cssFileOrDef.
75
- */
76
- FCKTools.AppendStyleSheet = function( domDocument, cssFileOrArrayOrDef )
77
- {
78
- if ( !cssFileOrArrayOrDef )
79
- return [] ;
80
-
81
- if ( typeof( cssFileOrArrayOrDef ) == 'string' )
82
- {
83
- // Test if the passed argument is an URL.
84
- if ( /[\\\/\.][^{}]*$/.test( cssFileOrArrayOrDef ) )
85
- {
86
- // The string may have several URLs separated by comma.
87
- return this.AppendStyleSheet( domDocument, cssFileOrArrayOrDef.split(',') ) ;
88
- }
89
- else
90
- return [ this.AppendStyleString( domDocument, FCKTools._GetUrlFixedCss( cssFileOrArrayOrDef ) ) ] ;
91
- }
92
- else
93
- {
94
- var styles = [] ;
95
- for ( var i = 0 ; i < cssFileOrArrayOrDef.length ; i++ )
96
- styles.push( this._AppendStyleSheet( domDocument, cssFileOrArrayOrDef[i] ) ) ;
97
- return styles ;
98
- }
99
- }
100
-
101
- FCKTools.GetStyleHtml = (function()
102
- {
103
- var getStyle = function( styleDef, markTemp )
104
- {
105
- if ( styleDef.length == 0 )
106
- return '' ;
107
-
108
- var temp = markTemp ? ' _fcktemp="true"' : '' ;
109
- return '<' + 'style type="text/css"' + temp + '>' + styleDef + '<' + '/style>' ;
110
- }
111
-
112
- var getLink = function( cssFileUrl, markTemp )
113
- {
114
- if ( cssFileUrl.length == 0 )
115
- return '' ;
116
-
117
- var temp = markTemp ? ' _fcktemp="true"' : '' ;
118
- return '<' + 'link href="' + cssFileUrl + '" type="text/css" rel="stylesheet" ' + temp + '/>' ;
119
- }
120
-
121
- return function( cssFileOrArrayOrDef, markTemp )
122
- {
123
- if ( !cssFileOrArrayOrDef )
124
- return '' ;
125
-
126
- if ( typeof( cssFileOrArrayOrDef ) == 'string' )
127
- {
128
- // Test if the passed argument is an URL.
129
- if ( /[\\\/\.][^{}]*$/.test( cssFileOrArrayOrDef ) )
130
- {
131
- // The string may have several URLs separated by comma.
132
- return this.GetStyleHtml( cssFileOrArrayOrDef.split(','), markTemp ) ;
133
- }
134
- else
135
- return getStyle( this._GetUrlFixedCss( cssFileOrArrayOrDef ), markTemp ) ;
136
- }
137
- else
138
- {
139
- var html = '' ;
140
-
141
- for ( var i = 0 ; i < cssFileOrArrayOrDef.length ; i++ )
142
- html += getLink( cssFileOrArrayOrDef[i], markTemp ) ;
143
-
144
- return html ;
145
- }
146
- }
147
- })() ;
148
-
149
- FCKTools.GetElementDocument = function ( element )
150
- {
151
- return element.ownerDocument || element.document ;
152
- }
153
-
154
- // Get the window object where the element is placed in.
155
- FCKTools.GetElementWindow = function( element )
156
- {
157
- return this.GetDocumentWindow( this.GetElementDocument( element ) ) ;
158
- }
159
-
160
- FCKTools.GetDocumentWindow = function( document )
161
- {
162
- // With Safari, there is not way to retrieve the window from the document, so we must fix it.
163
- if ( FCKBrowserInfo.IsSafari && !document.parentWindow )
164
- this.FixDocumentParentWindow( window.top ) ;
165
-
166
- return document.parentWindow || document.defaultView ;
167
- }
168
-
169
- /*
170
- This is a Safari specific function that fix the reference to the parent
171
- window from the document object.
172
- */
173
- FCKTools.FixDocumentParentWindow = function( targetWindow )
174
- {
175
- if ( targetWindow.document )
176
- targetWindow.document.parentWindow = targetWindow ;
177
-
178
- for ( var i = 0 ; i < targetWindow.frames.length ; i++ )
179
- FCKTools.FixDocumentParentWindow( targetWindow.frames[i] ) ;
180
- }
181
-
182
- FCKTools.HTMLEncode = function( text )
183
- {
184
- if ( !text )
185
- return '' ;
186
-
187
- text = text.replace( /&/g, '&amp;' ) ;
188
- text = text.replace( /</g, '&lt;' ) ;
189
- text = text.replace( />/g, '&gt;' ) ;
190
-
191
- return text ;
192
- }
193
-
194
- FCKTools.HTMLDecode = function( text )
195
- {
196
- if ( !text )
197
- return '' ;
198
-
199
- text = text.replace( /&gt;/g, '>' ) ;
200
- text = text.replace( /&lt;/g, '<' ) ;
201
- text = text.replace( /&amp;/g, '&' ) ;
202
-
203
- return text ;
204
- }
205
-
206
- FCKTools._ProcessLineBreaksForPMode = function( oEditor, text, liState, node, strArray )
207
- {
208
- var closeState = 0 ;
209
- var blockStartTag = "<p>" ;
210
- var blockEndTag = "</p>" ;
211
- var lineBreakTag = "<br />" ;
212
- if ( liState )
213
- {
214
- blockStartTag = "<li>" ;
215
- blockEndTag = "</li>" ;
216
- closeState = 1 ;
217
- }
218
-
219
- // Are we currently inside a <p> tag now?
220
- // If yes, close it at the next double line break.
221
- while ( node && node != oEditor.FCK.EditorDocument.body )
222
- {
223
- if ( node.tagName.toLowerCase() == 'p' )
224
- {
225
- closeState = 1 ;
226
- break;
227
- }
228
- node = node.parentNode ;
229
- }
230
-
231
- for ( var i = 0 ; i < text.length ; i++ )
232
- {
233
- var c = text.charAt( i ) ;
234
- if ( c == '\r' )
235
- continue ;
236
-
237
- if ( c != '\n' )
238
- {
239
- strArray.push( c ) ;
240
- continue ;
241
- }
242
-
243
- // Now we have encountered a line break.
244
- // Check if the next character is also a line break.
245
- var n = text.charAt( i + 1 ) ;
246
- if ( n == '\r' )
247
- {
248
- i++ ;
249
- n = text.charAt( i + 1 ) ;
250
- }
251
- if ( n == '\n' )
252
- {
253
- i++ ; // ignore next character - we have already processed it.
254
- if ( closeState )
255
- strArray.push( blockEndTag ) ;
256
- strArray.push( blockStartTag ) ;
257
- closeState = 1 ;
258
- }
259
- else
260
- strArray.push( lineBreakTag ) ;
261
- }
262
- }
263
-
264
- FCKTools._ProcessLineBreaksForDivMode = function( oEditor, text, liState, node, strArray )
265
- {
266
- var closeState = 0 ;
267
- var blockStartTag = "<div>" ;
268
- var blockEndTag = "</div>" ;
269
- if ( liState )
270
- {
271
- blockStartTag = "<li>" ;
272
- blockEndTag = "</li>" ;
273
- closeState = 1 ;
274
- }
275
-
276
- // Are we currently inside a <div> tag now?
277
- // If yes, close it at the next double line break.
278
- while ( node && node != oEditor.FCK.EditorDocument.body )
279
- {
280
- if ( node.tagName.toLowerCase() == 'div' )
281
- {
282
- closeState = 1 ;
283
- break ;
284
- }
285
- node = node.parentNode ;
286
- }
287
-
288
- for ( var i = 0 ; i < text.length ; i++ )
289
- {
290
- var c = text.charAt( i ) ;
291
- if ( c == '\r' )
292
- continue ;
293
-
294
- if ( c != '\n' )
295
- {
296
- strArray.push( c ) ;
297
- continue ;
298
- }
299
-
300
- if ( closeState )
301
- {
302
- if ( strArray[ strArray.length - 1 ] == blockStartTag )
303
- {
304
- // A div tag must have some contents inside for it to be visible.
305
- strArray.push( "&nbsp;" ) ;
306
- }
307
- strArray.push( blockEndTag ) ;
308
- }
309
- strArray.push( blockStartTag ) ;
310
- closeState = 1 ;
311
- }
312
- if ( closeState )
313
- strArray.push( blockEndTag ) ;
314
- }
315
-
316
- FCKTools._ProcessLineBreaksForBrMode = function( oEditor, text, liState, node, strArray )
317
- {
318
- var closeState = 0 ;
319
- var blockStartTag = "<br />" ;
320
- var blockEndTag = "" ;
321
- if ( liState )
322
- {
323
- blockStartTag = "<li>" ;
324
- blockEndTag = "</li>" ;
325
- closeState = 1 ;
326
- }
327
-
328
- for ( var i = 0 ; i < text.length ; i++ )
329
- {
330
- var c = text.charAt( i ) ;
331
- if ( c == '\r' )
332
- continue ;
333
-
334
- if ( c != '\n' )
335
- {
336
- strArray.push( c ) ;
337
- continue ;
338
- }
339
-
340
- if ( closeState && blockEndTag.length )
341
- strArray.push ( blockEndTag ) ;
342
- strArray.push( blockStartTag ) ;
343
- closeState = 1 ;
344
- }
345
- }
346
-
347
- FCKTools.ProcessLineBreaks = function( oEditor, oConfig, text )
348
- {
349
- var enterMode = oConfig.EnterMode.toLowerCase() ;
350
- var strArray = [] ;
351
-
352
- // Is the caret or selection inside an <li> tag now?
353
- var liState = 0 ;
354
- var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
355
- range.MoveToSelection() ;
356
- var node = range._Range.startContainer ;
357
- while ( node && node.nodeType != 1 )
358
- node = node.parentNode ;
359
- if ( node && node.tagName.toLowerCase() == 'li' )
360
- liState = 1 ;
361
-
362
- if ( enterMode == 'p' )
363
- this._ProcessLineBreaksForPMode( oEditor, text, liState, node, strArray ) ;
364
- else if ( enterMode == 'div' )
365
- this._ProcessLineBreaksForDivMode( oEditor, text, liState, node, strArray ) ;
366
- else if ( enterMode == 'br' )
367
- this._ProcessLineBreaksForBrMode( oEditor, text, liState, node, strArray ) ;
368
- return strArray.join( "" ) ;
369
- }
370
-
371
- /**
372
- * Adds an option to a SELECT element.
373
- */
374
- FCKTools.AddSelectOption = function( selectElement, optionText, optionValue )
375
- {
376
- var oOption = FCKTools.GetElementDocument( selectElement ).createElement( "OPTION" ) ;
377
-
378
- oOption.text = optionText ;
379
- oOption.value = optionValue ;
380
-
381
- selectElement.options.add(oOption) ;
382
-
383
- return oOption ;
384
- }
385
-
386
- FCKTools.RunFunction = function( func, thisObject, paramsArray, timerWindow )
387
- {
388
- if ( func )
389
- this.SetTimeout( func, 0, thisObject, paramsArray, timerWindow ) ;
390
- }
391
-
392
- FCKTools.SetTimeout = function( func, milliseconds, thisObject, paramsArray, timerWindow )
393
- {
394
- return ( timerWindow || window ).setTimeout(
395
- function()
396
- {
397
- if ( paramsArray )
398
- func.apply( thisObject, [].concat( paramsArray ) ) ;
399
- else
400
- func.apply( thisObject ) ;
401
- },
402
- milliseconds ) ;
403
- }
404
-
405
- FCKTools.SetInterval = function( func, milliseconds, thisObject, paramsArray, timerWindow )
406
- {
407
- return ( timerWindow || window ).setInterval(
408
- function()
409
- {
410
- func.apply( thisObject, paramsArray || [] ) ;
411
- },
412
- milliseconds ) ;
413
- }
414
-
415
- FCKTools.ConvertStyleSizeToHtml = function( size )
416
- {
417
- return size.EndsWith( '%' ) ? size : parseInt( size, 10 ) ;
418
- }
419
-
420
- FCKTools.ConvertHtmlSizeToStyle = function( size )
421
- {
422
- return size.EndsWith( '%' ) ? size : ( size + 'px' ) ;
423
- }
424
-
425
- // START iCM MODIFICATIONS
426
- // Amended to accept a list of one or more ascensor tag names
427
- // Amended to check the element itself before working back up through the parent hierarchy
428
- FCKTools.GetElementAscensor = function( element, ascensorTagNames )
429
- {
430
- // var e = element.parentNode ;
431
- var e = element ;
432
- var lstTags = "," + ascensorTagNames.toUpperCase() + "," ;
433
-
434
- while ( e )
435
- {
436
- if ( lstTags.indexOf( "," + e.nodeName.toUpperCase() + "," ) != -1 )
437
- return e ;
438
-
439
- e = e.parentNode ;
440
- }
441
- return null ;
442
- }
443
- // END iCM MODIFICATIONS
444
-
445
- FCKTools.CreateEventListener = function( func, params )
446
- {
447
- var f = function()
448
- {
449
- var aAllParams = [] ;
450
-
451
- for ( var i = 0 ; i < arguments.length ; i++ )
452
- aAllParams.push( arguments[i] ) ;
453
-
454
- func.apply( this, aAllParams.concat( params ) ) ;
455
- }
456
-
457
- return f ;
458
- }
459
-
460
- FCKTools.IsStrictMode = function( document )
461
- {
462
- // There is no compatMode in Safari, but it seams that it always behave as
463
- // CSS1Compat, so let's assume it as the default for that browser.
464
- return ( 'CSS1Compat' == ( document.compatMode || ( FCKBrowserInfo.IsSafari ? 'CSS1Compat' : null ) ) ) ;
465
- }
466
-
467
- // Transforms a "arguments" object to an array.
468
- FCKTools.ArgumentsToArray = function( args, startIndex, maxLength )
469
- {
470
- startIndex = startIndex || 0 ;
471
- maxLength = maxLength || args.length ;
472
-
473
- var argsArray = new Array() ;
474
-
475
- for ( var i = startIndex ; i < startIndex + maxLength && i < args.length ; i++ )
476
- argsArray.push( args[i] ) ;
477
-
478
- return argsArray ;
479
- }
480
-
481
- FCKTools.CloneObject = function( sourceObject )
482
- {
483
- var fCloneCreator = function() {} ;
484
- fCloneCreator.prototype = sourceObject ;
485
- return new fCloneCreator ;
486
- }
487
-
488
- // Appends a bogus <br> at the end of the element, if not yet available.
489
- FCKTools.AppendBogusBr = function( element )
490
- {
491
- if ( !element )
492
- return ;
493
-
494
- var eLastChild = this.GetLastItem( element.getElementsByTagName('br') ) ;
495
-
496
- if ( !eLastChild || ( eLastChild.getAttribute( 'type', 2 ) != '_moz' && eLastChild.getAttribute( '_moz_dirty' ) == null ) )
497
- {
498
- var doc = this.GetElementDocument( element ) ;
499
-
500
- if ( FCKBrowserInfo.IsOpera )
501
- element.appendChild( doc.createTextNode('') ) ;
502
- else
503
- element.appendChild( this.CreateBogusBR( doc ) ) ;
504
- }
505
- }
506
-
507
- FCKTools.GetLastItem = function( list )
508
- {
509
- if ( list.length > 0 )
510
- return list[ list.length - 1 ] ;
511
-
512
- return null ;
513
- }
514
-
515
- FCKTools.GetDocumentPosition = function( w, node )
516
- {
517
- var x = 0 ;
518
- var y = 0 ;
519
- var curNode = node ;
520
- var prevNode = null ;
521
- var curWindow = FCKTools.GetElementWindow( curNode ) ;
522
- while ( curNode && !( curWindow == w && ( curNode == w.document.body || curNode == w.document.documentElement ) ) )
523
- {
524
- x += curNode.offsetLeft - curNode.scrollLeft ;
525
- y += curNode.offsetTop - curNode.scrollTop ;
526
-
527
- if ( ! FCKBrowserInfo.IsOpera )
528
- {
529
- var scrollNode = prevNode ;
530
- while ( scrollNode && scrollNode != curNode )
531
- {
532
- x -= scrollNode.scrollLeft ;
533
- y -= scrollNode.scrollTop ;
534
- scrollNode = scrollNode.parentNode ;
535
- }
536
- }
537
-
538
- prevNode = curNode ;
539
- if ( curNode.offsetParent )
540
- curNode = curNode.offsetParent ;
541
- else
542
- {
543
- if ( curWindow != w )
544
- {
545
- curNode = curWindow.frameElement ;
546
- prevNode = null ;
547
- if ( curNode )
548
- curWindow = curNode.contentWindow.parent ;
549
- }
550
- else
551
- curNode = null ;
552
- }
553
- }
554
-
555
- // document.body is a special case when it comes to offsetTop and offsetLeft values.
556
- // 1. It matters if document.body itself is a positioned element;
557
- // 2. It matters is when we're in IE and the element has no positioned ancestor.
558
- // Otherwise the values should be ignored.
559
- if ( FCKDomTools.GetCurrentElementStyle( w.document.body, 'position') != 'static'
560
- || ( FCKBrowserInfo.IsIE && FCKDomTools.GetPositionedAncestor( node ) == null ) )
561
- {
562
- x += w.document.body.offsetLeft ;
563
- y += w.document.body.offsetTop ;
564
- }
565
-
566
- return { "x" : x, "y" : y } ;
567
- }
568
-
569
- FCKTools.GetWindowPosition = function( w, node )
570
- {
571
- var pos = this.GetDocumentPosition( w, node ) ;
572
- var scroll = FCKTools.GetScrollPosition( w ) ;
573
- pos.x -= scroll.X ;
574
- pos.y -= scroll.Y ;
575
- return pos ;
576
- }
577
-
578
- FCKTools.ProtectFormStyles = function( formNode )
579
- {
580
- if ( !formNode || formNode.nodeType != 1 || formNode.tagName.toLowerCase() != 'form' )
581
- return [] ;
582
- var hijackRecord = [] ;
583
- var hijackNames = [ 'style', 'className' ] ;
584
- for ( var i = 0 ; i < hijackNames.length ; i++ )
585
- {
586
- var name = hijackNames[i] ;
587
- if ( formNode.elements.namedItem( name ) )
588
- {
589
- var hijackNode = formNode.elements.namedItem( name ) ;
590
- hijackRecord.push( [ hijackNode, hijackNode.nextSibling ] ) ;
591
- formNode.removeChild( hijackNode ) ;
592
- }
593
- }
594
- return hijackRecord ;
595
- }
596
-
597
- FCKTools.RestoreFormStyles = function( formNode, hijackRecord )
598
- {
599
- if ( !formNode || formNode.nodeType != 1 || formNode.tagName.toLowerCase() != 'form' )
600
- return ;
601
- if ( hijackRecord.length > 0 )
602
- {
603
- for ( var i = hijackRecord.length - 1 ; i >= 0 ; i-- )
604
- {
605
- var node = hijackRecord[i][0] ;
606
- var sibling = hijackRecord[i][1] ;
607
- if ( sibling )
608
- formNode.insertBefore( node, sibling ) ;
609
- else
610
- formNode.appendChild( node ) ;
611
- }
612
- }
613
- }
614
-
615
- // Perform a one-step DFS walk.
616
- FCKTools.GetNextNode = function( node, limitNode )
617
- {
618
- if ( node.firstChild )
619
- return node.firstChild ;
620
- else if ( node.nextSibling )
621
- return node.nextSibling ;
622
- else
623
- {
624
- var ancestor = node.parentNode ;
625
- while ( ancestor )
626
- {
627
- if ( ancestor == limitNode )
628
- return null ;
629
- if ( ancestor.nextSibling )
630
- return ancestor.nextSibling ;
631
- else
632
- ancestor = ancestor.parentNode ;
633
- }
634
- }
635
- return null ;
636
- }
637
-
638
- FCKTools.GetNextTextNode = function( textnode, limitNode, checkStop )
639
- {
640
- node = this.GetNextNode( textnode, limitNode ) ;
641
- if ( checkStop && node && checkStop( node ) )
642
- return null ;
643
- while ( node && node.nodeType != 3 )
644
- {
645
- node = this.GetNextNode( node, limitNode ) ;
646
- if ( checkStop && node && checkStop( node ) )
647
- return null ;
648
- }
649
- return node ;
650
- }
651
-
652
- /**
653
- * Merge all objects passed by argument into a single object.
654
- */
655
- FCKTools.Merge = function()
656
- {
657
- var args = arguments ;
658
- var o = args[0] ;
659
-
660
- for ( var i = 1 ; i < args.length ; i++ )
661
- {
662
- var arg = args[i] ;
663
- for ( var p in arg )
664
- o[p] = arg[p] ;
665
- }
666
-
667
- return o ;
668
- }
669
-
670
- /**
671
- * Check if the passed argument is a real Array. It may not working when
672
- * calling it cross windows.
673
- */
674
- FCKTools.IsArray = function( it )
675
- {
676
- return ( it instanceof Array ) ;
677
- }
678
-
679
- /**
680
- * Appends a "length" property to an object, containing the number of
681
- * properties available on it, excluded the append property itself.
682
- */
683
- FCKTools.AppendLengthProperty = function( targetObject, propertyName )
684
- {
685
- var counter = 0 ;
686
-
687
- for ( var n in targetObject )
688
- counter++ ;
689
-
690
- return targetObject[ propertyName || 'length' ] = counter ;
691
- }
692
-
693
- /**
694
- * Gets the browser parsed version of a css text (style attribute value). On
695
- * some cases, the browser makes changes to the css text, returning a different
696
- * value. For example, hexadecimal colors get transformed to rgb().
697
- */
698
- FCKTools.NormalizeCssText = function( unparsedCssText )
699
- {
700
- // Injects the style in a temporary span object, so the browser parses it,
701
- // retrieving its final format.
702
- var tempSpan = document.createElement( 'span' ) ;
703
- tempSpan.style.cssText = unparsedCssText ;
704
- return tempSpan.style.cssText ;
705
- }
706
-
707
- /**
708
- * Binding the "this" reference to an object for a function.
709
- */
710
- FCKTools.Bind = function( subject, func )
711
- {
712
- return function(){ return func.apply( subject, arguments ) ; } ;
713
- }
714
-
715
- /**
716
- * Retrieve the correct "empty iframe" URL for the current browser, which
717
- * causes the minimum fuzz (e.g. security warnings in HTTPS, DNS error in
718
- * IE5.5, etc.) for that browser, making the iframe ready to DOM use whithout
719
- * having to loading an external file.
720
- */
721
- FCKTools.GetVoidUrl = function()
722
- {
723
- if ( FCK_IS_CUSTOM_DOMAIN )
724
- return "javascript: void( function(){" +
725
- "document.open();" +
726
- "document.write('<html><head><title></title></head><body></body></html>');" +
727
- "document.domain = '" + FCK_RUNTIME_DOMAIN + "';" +
728
- "document.close();" +
729
- "}() ) ;";
730
-
731
- if ( FCKBrowserInfo.IsIE )
732
- {
733
- if ( FCKBrowserInfo.IsIE7 || !FCKBrowserInfo.IsIE6 )
734
- return "" ; // IE7+ / IE5.5
735
- else
736
- return "javascript: '';" ; // IE6+
737
- }
738
-
739
- return "javascript: void(0);" ; // All other browsers.
740
- }
741
-
742
- FCKTools.ResetStyles = function( element )
743
- {
744
- element.style.cssText = 'margin:0;' +
745
- 'padding:0;' +
746
- 'border:0;' +
747
- 'background-color:transparent;' +
748
- 'background-image:none;' ;
749
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcktools_gecko.js DELETED
@@ -1,282 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Utility functions. (Gecko version).
22
- */
23
-
24
- FCKTools.CancelEvent = function( e )
25
- {
26
- if ( e )
27
- e.preventDefault() ;
28
- }
29
-
30
- FCKTools.DisableSelection = function( element )
31
- {
32
- if ( FCKBrowserInfo.IsGecko )
33
- element.style.MozUserSelect = 'none' ; // Gecko only.
34
- else if ( FCKBrowserInfo.IsSafari )
35
- element.style.KhtmlUserSelect = 'none' ; // WebKit only.
36
- else
37
- element.style.userSelect = 'none' ; // CSS3 (not supported yet).
38
- }
39
-
40
- // Appends a CSS file to a document.
41
- FCKTools._AppendStyleSheet = function( documentElement, cssFileUrl )
42
- {
43
- var e = documentElement.createElement( 'LINK' ) ;
44
- e.rel = 'stylesheet' ;
45
- e.type = 'text/css' ;
46
- e.href = cssFileUrl ;
47
- documentElement.getElementsByTagName("HEAD")[0].appendChild( e ) ;
48
- return e ;
49
- }
50
-
51
- // Appends a CSS style string to a document.
52
- FCKTools.AppendStyleString = function( documentElement, cssStyles )
53
- {
54
- if ( !cssStyles )
55
- return null ;
56
-
57
- var e = documentElement.createElement( "STYLE" ) ;
58
- e.appendChild( documentElement.createTextNode( cssStyles ) ) ;
59
- documentElement.getElementsByTagName( "HEAD" )[0].appendChild( e ) ;
60
- return e ;
61
- }
62
-
63
- // Removes all attributes and values from the element.
64
- FCKTools.ClearElementAttributes = function( element )
65
- {
66
- // Loop throw all attributes in the element
67
- for ( var i = 0 ; i < element.attributes.length ; i++ )
68
- {
69
- // Remove the element by name.
70
- element.removeAttribute( element.attributes[i].name, 0 ) ; // 0 : Case Insensitive
71
- }
72
- }
73
-
74
- // Returns an Array of strings with all defined in the elements inside another element.
75
- FCKTools.GetAllChildrenIds = function( parentElement )
76
- {
77
- // Create the array that will hold all Ids.
78
- var aIds = new Array() ;
79
-
80
- // Define a recursive function that search for the Ids.
81
- var fGetIds = function( parent )
82
- {
83
- for ( var i = 0 ; i < parent.childNodes.length ; i++ )
84
- {
85
- var sId = parent.childNodes[i].id ;
86
-
87
- // Check if the Id is defined for the element.
88
- if ( sId && sId.length > 0 ) aIds[ aIds.length ] = sId ;
89
-
90
- // Recursive call.
91
- fGetIds( parent.childNodes[i] ) ;
92
- }
93
- }
94
-
95
- // Start the recursive calls.
96
- fGetIds( parentElement ) ;
97
-
98
- return aIds ;
99
- }
100
-
101
- // Replaces a tag with its contents. For example "<span>My <b>tag</b></span>"
102
- // will be replaced with "My <b>tag</b>".
103
- FCKTools.RemoveOuterTags = function( e )
104
- {
105
- var oFragment = e.ownerDocument.createDocumentFragment() ;
106
-
107
- for ( var i = 0 ; i < e.childNodes.length ; i++ )
108
- oFragment.appendChild( e.childNodes[i].cloneNode(true) ) ;
109
-
110
- e.parentNode.replaceChild( oFragment, e ) ;
111
- }
112
-
113
- FCKTools.CreateXmlObject = function( object )
114
- {
115
- switch ( object )
116
- {
117
- case 'XmlHttp' :
118
- return new XMLHttpRequest() ;
119
-
120
- case 'DOMDocument' :
121
- // Originaly, we were had the following here:
122
- // return document.implementation.createDocument( '', '', null ) ;
123
- // But that doesn't work if we're running under domain relaxation mode, so we need a workaround.
124
- // See http://ajaxian.com/archives/xml-messages-with-cross-domain-json about the trick we're using.
125
- var doc = ( new DOMParser() ).parseFromString( '<tmp></tmp>', 'text/xml' ) ;
126
- FCKDomTools.RemoveNode( doc.firstChild ) ;
127
- return doc ;
128
- }
129
- return null ;
130
- }
131
-
132
- FCKTools.GetScrollPosition = function( relativeWindow )
133
- {
134
- return { X : relativeWindow.pageXOffset, Y : relativeWindow.pageYOffset } ;
135
- }
136
-
137
- FCKTools.AddEventListener = function( sourceObject, eventName, listener )
138
- {
139
- sourceObject.addEventListener( eventName, listener, false ) ;
140
- }
141
-
142
- FCKTools.RemoveEventListener = function( sourceObject, eventName, listener )
143
- {
144
- sourceObject.removeEventListener( eventName, listener, false ) ;
145
- }
146
-
147
- // Listeners attached with this function cannot be detached.
148
- FCKTools.AddEventListenerEx = function( sourceObject, eventName, listener, paramsArray )
149
- {
150
- sourceObject.addEventListener(
151
- eventName,
152
- function( e )
153
- {
154
- listener.apply( sourceObject, [ e ].concat( paramsArray || [] ) ) ;
155
- },
156
- false
157
- ) ;
158
- }
159
-
160
- // Returns and object with the "Width" and "Height" properties.
161
- FCKTools.GetViewPaneSize = function( win )
162
- {
163
- return { Width : win.innerWidth, Height : win.innerHeight } ;
164
- }
165
-
166
- FCKTools.SaveStyles = function( element )
167
- {
168
- var data = FCKTools.ProtectFormStyles( element ) ;
169
-
170
- var oSavedStyles = new Object() ;
171
-
172
- if ( element.className.length > 0 )
173
- {
174
- oSavedStyles.Class = element.className ;
175
- element.className = '' ;
176
- }
177
-
178
- var sInlineStyle = element.getAttribute( 'style' ) ;
179
-
180
- if ( sInlineStyle && sInlineStyle.length > 0 )
181
- {
182
- oSavedStyles.Inline = sInlineStyle ;
183
- element.setAttribute( 'style', '', 0 ) ; // 0 : Case Insensitive
184
- }
185
-
186
- FCKTools.RestoreFormStyles( element, data ) ;
187
- return oSavedStyles ;
188
- }
189
-
190
- FCKTools.RestoreStyles = function( element, savedStyles )
191
- {
192
- var data = FCKTools.ProtectFormStyles( element ) ;
193
- element.className = savedStyles.Class || '' ;
194
-
195
- if ( savedStyles.Inline )
196
- element.setAttribute( 'style', savedStyles.Inline, 0 ) ; // 0 : Case Insensitive
197
- else
198
- element.removeAttribute( 'style', 0 ) ;
199
- FCKTools.RestoreFormStyles( element, data ) ;
200
- }
201
-
202
- FCKTools.RegisterDollarFunction = function( targetWindow )
203
- {
204
- targetWindow.$ = function( id )
205
- {
206
- return targetWindow.document.getElementById( id ) ;
207
- } ;
208
- }
209
-
210
- FCKTools.AppendElement = function( target, elementName )
211
- {
212
- return target.appendChild( target.ownerDocument.createElement( elementName ) ) ;
213
- }
214
-
215
- // Get the coordinates of an element.
216
- // @el : The element to get the position.
217
- // @relativeWindow: The window to which we want the coordinates relative to.
218
- FCKTools.GetElementPosition = function( el, relativeWindow )
219
- {
220
- // Initializes the Coordinates object that will be returned by the function.
221
- var c = { X:0, Y:0 } ;
222
-
223
- var oWindow = relativeWindow || window ;
224
-
225
- var oOwnerWindow = FCKTools.GetElementWindow( el ) ;
226
-
227
- var previousElement = null ;
228
- // Loop throw the offset chain.
229
- while ( el )
230
- {
231
- var sPosition = oOwnerWindow.getComputedStyle(el, '').position ;
232
-
233
- // Check for non "static" elements.
234
- // 'FCKConfig.FloatingPanelsZIndex' -- Submenus are under a positioned IFRAME.
235
- if ( sPosition && sPosition != 'static' && el.style.zIndex != FCKConfig.FloatingPanelsZIndex )
236
- break ;
237
-
238
- /*
239
- FCKDebug.Output( el.tagName + ":" + "offset=" + el.offsetLeft + "," + el.offsetTop + " "
240
- + "scroll=" + el.scrollLeft + "," + el.scrollTop ) ;
241
- */
242
-
243
- c.X += el.offsetLeft - el.scrollLeft ;
244
- c.Y += el.offsetTop - el.scrollTop ;
245
-
246
- // Backtrack due to offsetParent's calculation by the browser ignores scrollLeft and scrollTop.
247
- // Backtracking is not needed for Opera
248
- if ( ! FCKBrowserInfo.IsOpera )
249
- {
250
- var scrollElement = previousElement ;
251
- while ( scrollElement && scrollElement != el )
252
- {
253
- c.X -= scrollElement.scrollLeft ;
254
- c.Y -= scrollElement.scrollTop ;
255
- scrollElement = scrollElement.parentNode ;
256
- }
257
- }
258
-
259
- previousElement = el ;
260
- if ( el.offsetParent )
261
- el = el.offsetParent ;
262
- else
263
- {
264
- if ( oOwnerWindow != oWindow )
265
- {
266
- el = oOwnerWindow.frameElement ;
267
- previousElement = null ;
268
- if ( el )
269
- oOwnerWindow = FCKTools.GetElementWindow( el ) ;
270
- }
271
- else
272
- {
273
- c.X += el.scrollLeft ;
274
- c.Y += el.scrollTop ;
275
- break ;
276
- }
277
- }
278
- }
279
-
280
- // Return the Coordinates object
281
- return c ;
282
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fcktools_ie.js DELETED
@@ -1,234 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Utility functions. (IE version).
22
- */
23
-
24
- FCKTools.CancelEvent = function( e )
25
- {
26
- return false ;
27
- }
28
-
29
- // Appends one or more CSS files to a document.
30
- FCKTools._AppendStyleSheet = function( documentElement, cssFileUrl )
31
- {
32
- return documentElement.createStyleSheet( cssFileUrl ).owningElement ;
33
- }
34
-
35
- // Appends a CSS style string to a document.
36
- FCKTools.AppendStyleString = function( documentElement, cssStyles )
37
- {
38
- if ( !cssStyles )
39
- return null ;
40
-
41
- var s = documentElement.createStyleSheet( "" ) ;
42
- s.cssText = cssStyles ;
43
- return s ;
44
- }
45
-
46
- // Removes all attributes and values from the element.
47
- FCKTools.ClearElementAttributes = function( element )
48
- {
49
- element.clearAttributes() ;
50
- }
51
-
52
- FCKTools.GetAllChildrenIds = function( parentElement )
53
- {
54
- var aIds = new Array() ;
55
- for ( var i = 0 ; i < parentElement.all.length ; i++ )
56
- {
57
- var sId = parentElement.all[i].id ;
58
- if ( sId && sId.length > 0 )
59
- aIds[ aIds.length ] = sId ;
60
- }
61
- return aIds ;
62
- }
63
-
64
- FCKTools.RemoveOuterTags = function( e )
65
- {
66
- e.insertAdjacentHTML( 'beforeBegin', e.innerHTML ) ;
67
- e.parentNode.removeChild( e ) ;
68
- }
69
-
70
- FCKTools.CreateXmlObject = function( object )
71
- {
72
- var aObjs ;
73
-
74
- switch ( object )
75
- {
76
- case 'XmlHttp' :
77
- // Try the native XMLHttpRequest introduced with IE7.
78
- if ( document.location.protocol != 'file:' )
79
- try { return new XMLHttpRequest() ; } catch (e) {}
80
-
81
- aObjs = [ 'MSXML2.XmlHttp', 'Microsoft.XmlHttp' ] ;
82
- break ;
83
-
84
- case 'DOMDocument' :
85
- aObjs = [ 'MSXML2.DOMDocument', 'Microsoft.XmlDom' ] ;
86
- break ;
87
- }
88
-
89
- for ( var i = 0 ; i < 2 ; i++ )
90
- {
91
- try { return new ActiveXObject( aObjs[i] ) ; }
92
- catch (e)
93
- {}
94
- }
95
-
96
- if ( FCKLang.NoActiveX )
97
- {
98
- alert( FCKLang.NoActiveX ) ;
99
- FCKLang.NoActiveX = null ;
100
- }
101
- return null ;
102
- }
103
-
104
- FCKTools.DisableSelection = function( element )
105
- {
106
- element.unselectable = 'on' ;
107
-
108
- var e, i = 0 ;
109
- // The extra () is to avoid a warning with strict error checking. This is ok.
110
- while ( (e = element.all[ i++ ]) )
111
- {
112
- switch ( e.tagName )
113
- {
114
- case 'IFRAME' :
115
- case 'TEXTAREA' :
116
- case 'INPUT' :
117
- case 'SELECT' :
118
- /* Ignore the above tags */
119
- break ;
120
- default :
121
- e.unselectable = 'on' ;
122
- }
123
- }
124
- }
125
-
126
- FCKTools.GetScrollPosition = function( relativeWindow )
127
- {
128
- var oDoc = relativeWindow.document ;
129
-
130
- // Try with the doc element.
131
- var oPos = { X : oDoc.documentElement.scrollLeft, Y : oDoc.documentElement.scrollTop } ;
132
-
133
- if ( oPos.X > 0 || oPos.Y > 0 )
134
- return oPos ;
135
-
136
- // If no scroll, try with the body.
137
- return { X : oDoc.body.scrollLeft, Y : oDoc.body.scrollTop } ;
138
- }
139
-
140
- FCKTools.AddEventListener = function( sourceObject, eventName, listener )
141
- {
142
- sourceObject.attachEvent( 'on' + eventName, listener ) ;
143
- }
144
-
145
- FCKTools.RemoveEventListener = function( sourceObject, eventName, listener )
146
- {
147
- sourceObject.detachEvent( 'on' + eventName, listener ) ;
148
- }
149
-
150
- // Listeners attached with this function cannot be detached.
151
- FCKTools.AddEventListenerEx = function( sourceObject, eventName, listener, paramsArray )
152
- {
153
- // Ok... this is a closures party, but is the only way to make it clean of memory leaks.
154
- var o = new Object() ;
155
- o.Source = sourceObject ;
156
- o.Params = paramsArray || [] ; // Memory leak if we have DOM objects here.
157
- o.Listener = function( ev )
158
- {
159
- return listener.apply( o.Source, [ ev ].concat( o.Params ) ) ;
160
- }
161
-
162
- if ( FCK.IECleanup )
163
- FCK.IECleanup.AddItem( null, function() { o.Source = null ; o.Params = null ; } ) ;
164
-
165
- sourceObject.attachEvent( 'on' + eventName, o.Listener ) ;
166
-
167
- sourceObject = null ; // Memory leak cleaner (because of the above closure).
168
- paramsArray = null ; // Memory leak cleaner (because of the above closure).
169
- }
170
-
171
- // Returns and object with the "Width" and "Height" properties.
172
- FCKTools.GetViewPaneSize = function( win )
173
- {
174
- var oSizeSource ;
175
-
176
- var oDoc = win.document.documentElement ;
177
- if ( oDoc && oDoc.clientWidth ) // IE6 Strict Mode
178
- oSizeSource = oDoc ;
179
- else
180
- oSizeSource = win.document.body ; // Other IEs
181
-
182
- if ( oSizeSource )
183
- return { Width : oSizeSource.clientWidth, Height : oSizeSource.clientHeight } ;
184
- else
185
- return { Width : 0, Height : 0 } ;
186
- }
187
-
188
- FCKTools.SaveStyles = function( element )
189
- {
190
- var data = FCKTools.ProtectFormStyles( element ) ;
191
-
192
- var oSavedStyles = new Object() ;
193
-
194
- if ( element.className.length > 0 )
195
- {
196
- oSavedStyles.Class = element.className ;
197
- element.className = '' ;
198
- }
199
-
200
- var sInlineStyle = element.style.cssText ;
201
-
202
- if ( sInlineStyle.length > 0 )
203
- {
204
- oSavedStyles.Inline = sInlineStyle ;
205
- element.style.cssText = '' ;
206
- }
207
-
208
- FCKTools.RestoreFormStyles( element, data ) ;
209
- return oSavedStyles ;
210
- }
211
-
212
- FCKTools.RestoreStyles = function( element, savedStyles )
213
- {
214
- var data = FCKTools.ProtectFormStyles( element ) ;
215
- element.className = savedStyles.Class || '' ;
216
- element.style.cssText = savedStyles.Inline || '' ;
217
- FCKTools.RestoreFormStyles( element, data ) ;
218
- }
219
-
220
- FCKTools.RegisterDollarFunction = function( targetWindow )
221
- {
222
- targetWindow.$ = targetWindow.document.getElementById ;
223
- }
224
-
225
- FCKTools.AppendElement = function( target, elementName )
226
- {
227
- return target.appendChild( this.GetElementDocument( target ).createElement( elementName ) ) ;
228
- }
229
-
230
- // This function may be used by Regex replacements.
231
- FCKTools.ToLowerCase = function( strValue )
232
- {
233
- return strValue.toLowerCase() ;
234
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckundo.js DELETED
@@ -1,223 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- */
21
-
22
- var FCKUndo = new Object() ;
23
-
24
- FCKUndo.SavedData = new Array() ;
25
- FCKUndo.CurrentIndex = -1 ;
26
- FCKUndo.TypesCount = 0 ;
27
- FCKUndo.Changed = false ; // Is the document changed in respect to its initial image?
28
- FCKUndo.MaxTypes = 25 ;
29
- FCKUndo.Typing = false ;
30
- FCKUndo.SaveLocked = false ;
31
-
32
- FCKUndo._GetBookmark = function()
33
- {
34
- FCKSelection.Restore() ;
35
-
36
- var range = new FCKDomRange( FCK.EditorWindow ) ;
37
- try
38
- {
39
- // There are some tricky cases where this might fail (e.g. having a lone empty table in IE)
40
- range.MoveToSelection() ;
41
- }
42
- catch ( e )
43
- {
44
- return null ;
45
- }
46
- if ( FCKBrowserInfo.IsIE )
47
- {
48
- var bookmark = range.CreateBookmark() ;
49
- var dirtyHtml = FCK.EditorDocument.body.innerHTML ;
50
- range.MoveToBookmark( bookmark ) ;
51
- return [ bookmark, dirtyHtml ] ;
52
- }
53
- return range.CreateBookmark2() ;
54
- }
55
-
56
- FCKUndo._SelectBookmark = function( bookmark )
57
- {
58
- if ( ! bookmark )
59
- return ;
60
-
61
- var range = new FCKDomRange( FCK.EditorWindow ) ;
62
- if ( bookmark instanceof Object )
63
- {
64
- if ( FCKBrowserInfo.IsIE )
65
- range.MoveToBookmark( bookmark[0] ) ;
66
- else
67
- range.MoveToBookmark2( bookmark ) ;
68
- try
69
- {
70
- // this does not always succeed, there are still some tricky cases where it fails
71
- // e.g. add a special character at end of document, undo, redo -> error
72
- range.Select() ;
73
- }
74
- catch ( e )
75
- {
76
- // if select restore fails, put the caret at the end of the document
77
- range.MoveToPosition( FCK.EditorDocument.body, 4 ) ;
78
- range.Select() ;
79
- }
80
- }
81
- }
82
-
83
- FCKUndo._CompareCursors = function( cursor1, cursor2 )
84
- {
85
- for ( var i = 0 ; i < Math.min( cursor1.length, cursor2.length ) ; i++ )
86
- {
87
- if ( cursor1[i] < cursor2[i] )
88
- return -1;
89
- else if (cursor1[i] > cursor2[i] )
90
- return 1;
91
- }
92
- if ( cursor1.length < cursor2.length )
93
- return -1;
94
- else if (cursor1.length > cursor2.length )
95
- return 1;
96
- return 0;
97
- }
98
-
99
- FCKUndo._CheckIsBookmarksEqual = function( bookmark1, bookmark2 )
100
- {
101
- if ( ! ( bookmark1 && bookmark2 ) )
102
- return false ;
103
- if ( FCKBrowserInfo.IsIE )
104
- {
105
- var startOffset1 = bookmark1[1].search( bookmark1[0].StartId ) ;
106
- var startOffset2 = bookmark2[1].search( bookmark2[0].StartId ) ;
107
- var endOffset1 = bookmark1[1].search( bookmark1[0].EndId ) ;
108
- var endOffset2 = bookmark2[1].search( bookmark2[0].EndId ) ;
109
- return startOffset1 == startOffset2 && endOffset1 == endOffset2 ;
110
- }
111
- else
112
- {
113
- return this._CompareCursors( bookmark1.Start, bookmark2.Start ) == 0
114
- && this._CompareCursors( bookmark1.End, bookmark2.End ) == 0 ;
115
- }
116
- }
117
-
118
- FCKUndo.SaveUndoStep = function()
119
- {
120
- if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || this.SaveLocked )
121
- return ;
122
-
123
- // Assume the editor content is changed when SaveUndoStep() is called after the first time.
124
- // This also enables the undo button in toolbar.
125
- if ( this.SavedData.length )
126
- this.Changed = true ;
127
-
128
- // Get the HTML content.
129
- var sHtml = FCK.EditorDocument.body.innerHTML ;
130
- var bookmark = this._GetBookmark() ;
131
-
132
- // Shrink the array to the current level.
133
- this.SavedData = this.SavedData.slice( 0, this.CurrentIndex + 1 ) ;
134
-
135
- // Cancel operation if the new step is identical to the previous one.
136
- if ( this.CurrentIndex > 0
137
- && sHtml == this.SavedData[ this.CurrentIndex ][0]
138
- && this._CheckIsBookmarksEqual( bookmark, this.SavedData[ this.CurrentIndex ][1] ) )
139
- return ;
140
- // Save the selection and caret position in the first undo level for the first change.
141
- else if ( this.CurrentIndex == 0 && this.SavedData.length && sHtml == this.SavedData[0][0] )
142
- {
143
- this.SavedData[0][1] = bookmark ;
144
- return ;
145
- }
146
-
147
- // If we reach the Maximum number of undo levels, we must remove the first
148
- // entry of the list shifting all elements.
149
- if ( this.CurrentIndex + 1 >= FCKConfig.MaxUndoLevels )
150
- this.SavedData.shift() ;
151
- else
152
- this.CurrentIndex++ ;
153
-
154
- // Save the new level in front of the actual position.
155
- this.SavedData[ this.CurrentIndex ] = [ sHtml, bookmark ] ;
156
-
157
- FCK.Events.FireEvent( "OnSelectionChange" ) ;
158
- }
159
-
160
- FCKUndo.CheckUndoState = function()
161
- {
162
- return ( this.Changed || this.CurrentIndex > 0 ) ;
163
- }
164
-
165
- FCKUndo.CheckRedoState = function()
166
- {
167
- return ( this.CurrentIndex < ( this.SavedData.length - 1 ) ) ;
168
- }
169
-
170
- FCKUndo.Undo = function()
171
- {
172
- if ( this.CheckUndoState() )
173
- {
174
- // If it is the first step.
175
- if ( this.CurrentIndex == ( this.SavedData.length - 1 ) )
176
- {
177
- // Save the actual state for a possible "Redo" call.
178
- this.SaveUndoStep() ;
179
- }
180
-
181
- // Go a step back.
182
- this._ApplyUndoLevel( --this.CurrentIndex ) ;
183
-
184
- FCK.Events.FireEvent( "OnSelectionChange" ) ;
185
- }
186
- }
187
-
188
- FCKUndo.Redo = function()
189
- {
190
- if ( this.CheckRedoState() )
191
- {
192
- // Go a step forward.
193
- this._ApplyUndoLevel( ++this.CurrentIndex ) ;
194
-
195
- FCK.Events.FireEvent( "OnSelectionChange" ) ;
196
- }
197
- }
198
-
199
- FCKUndo._ApplyUndoLevel = function( level )
200
- {
201
- var oData = this.SavedData[ level ] ;
202
-
203
- if ( !oData )
204
- return ;
205
-
206
- // Update the editor contents with that step data.
207
- if ( FCKBrowserInfo.IsIE )
208
- {
209
- if ( oData[1] && oData[1][1] )
210
- FCK.SetInnerHtml( oData[1][1] ) ;
211
- else
212
- FCK.SetInnerHtml( oData[0] ) ;
213
- }
214
- else
215
- FCK.EditorDocument.body.innerHTML = oData[0] ;
216
-
217
- // Restore the selection
218
- this._SelectBookmark( oData[1] ) ;
219
-
220
- this.TypesCount = 0 ;
221
- this.Changed = false ;
222
- this.Typing = false ;
223
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckurlparams.js DELETED
@@ -1,39 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Defines the FCKURLParams object that is used to get all parameters
22
- * passed by the URL QueryString (after the "?").
23
- */
24
-
25
- // #### URLParams: holds all URL passed parameters (like ?Param1=Value1&Param2=Value2)
26
- var FCKURLParams = new Object() ;
27
-
28
- (function()
29
- {
30
- var aParams = document.location.search.substr(1).split('&') ;
31
- for ( var i = 0 ; i < aParams.length ; i++ )
32
- {
33
- var aParam = aParams[i].split('=') ;
34
- var sParamName = decodeURIComponent( aParam[0] ) ;
35
- var sParamValue = decodeURIComponent( aParam[1] ) ;
36
-
37
- FCKURLParams[ sParamName ] = sParamValue ;
38
- }
39
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckxhtml.js DELETED
@@ -1,534 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Defines the FCKXHtml object, responsible for the XHTML operations.
22
- */
23
-
24
- var FCKXHtml = new Object() ;
25
-
26
- FCKXHtml.CurrentJobNum = 0 ;
27
-
28
- FCKXHtml.GetXHTML = function( node, includeNode, format )
29
- {
30
- FCKDomTools.CheckAndRemovePaddingNode( FCKTools.GetElementDocument( node ), FCKConfig.EnterMode ) ;
31
- FCKXHtmlEntities.Initialize() ;
32
-
33
- // Set the correct entity to use for empty blocks.
34
- this._NbspEntity = ( FCKConfig.ProcessHTMLEntities? 'nbsp' : '#160' ) ;
35
-
36
- // Save the current IsDirty state. The XHTML processor may change the
37
- // original HTML, dirtying it.
38
- var bIsDirty = FCK.IsDirty() ;
39
-
40
- // Special blocks are blocks of content that remain untouched during the
41
- // process. It is used for SCRIPTs and STYLEs.
42
- FCKXHtml.SpecialBlocks = new Array() ;
43
-
44
- // Create the XML DOMDocument object.
45
- this.XML = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
46
-
47
- // Add a root element that holds all child nodes.
48
- this.MainNode = this.XML.appendChild( this.XML.createElement( 'xhtml' ) ) ;
49
-
50
- FCKXHtml.CurrentJobNum++ ;
51
-
52
- // var dTimer = new Date() ;
53
-
54
- if ( includeNode )
55
- this._AppendNode( this.MainNode, node ) ;
56
- else
57
- this._AppendChildNodes( this.MainNode, node, false ) ;
58
-
59
- // Get the resulting XHTML as a string.
60
- var sXHTML = this._GetMainXmlString() ;
61
-
62
- // alert( 'Time: ' + ( ( ( new Date() ) - dTimer ) ) + ' ms' ) ;
63
-
64
- this.XML = null ;
65
-
66
- // Safari adds xmlns="http://www.w3.org/1999/xhtml" to the root node (#963)
67
- if ( FCKBrowserInfo.IsSafari )
68
- sXHTML = sXHTML.replace( /^<xhtml.*?>/, '<xhtml>' ) ;
69
-
70
- // Strip the "XHTML" root node.
71
- sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).Trim() ;
72
-
73
- // According to the doctype set the proper end for self-closing tags
74
- // HTML: <br>
75
- // XHTML: Add a space, like <br/> -> <br />
76
- if (FCKConfig.DocType.length > 0 && FCKRegexLib.HtmlDocType.test( FCKConfig.DocType ) )
77
- sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, '>');
78
- else
79
- sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, ' />');
80
-
81
- if ( FCKConfig.ForceSimpleAmpersand )
82
- sXHTML = sXHTML.replace( FCKRegexLib.ForceSimpleAmpersand, '&' ) ;
83
-
84
- if ( format )
85
- sXHTML = FCKCodeFormatter.Format( sXHTML ) ;
86
-
87
- // Now we put back the SpecialBlocks contents.
88
- for ( var i = 0 ; i < FCKXHtml.SpecialBlocks.length ; i++ )
89
- {
90
- var oRegex = new RegExp( '___FCKsi___' + i ) ;
91
- sXHTML = sXHTML.replace( oRegex, FCKXHtml.SpecialBlocks[i] ) ;
92
- }
93
-
94
- // Replace entities marker with the ampersand.
95
- sXHTML = sXHTML.replace( FCKRegexLib.GeckoEntitiesMarker, '&' ) ;
96
-
97
- // Restore the IsDirty state if it was not dirty.
98
- if ( !bIsDirty )
99
- FCK.ResetIsDirty() ;
100
-
101
- FCKDomTools.EnforcePaddingNode( FCKTools.GetElementDocument( node ), FCKConfig.EnterMode ) ;
102
- return sXHTML ;
103
- }
104
-
105
- FCKXHtml._AppendAttribute = function( xmlNode, attributeName, attributeValue )
106
- {
107
- try
108
- {
109
- if ( attributeValue == undefined || attributeValue == null )
110
- attributeValue = '' ;
111
- else if ( attributeValue.replace )
112
- {
113
- if ( FCKConfig.ForceSimpleAmpersand )
114
- attributeValue = attributeValue.replace( /&/g, '___FCKAmp___' ) ;
115
-
116
- // Entities must be replaced in the attribute values.
117
- attributeValue = attributeValue.replace( FCKXHtmlEntities.EntitiesRegex, FCKXHtml_GetEntity ) ;
118
- }
119
-
120
- // Create the attribute.
121
- var oXmlAtt = this.XML.createAttribute( attributeName ) ;
122
- oXmlAtt.value = attributeValue ;
123
-
124
- // Set the attribute in the node.
125
- xmlNode.attributes.setNamedItem( oXmlAtt ) ;
126
- }
127
- catch (e)
128
- {}
129
- }
130
-
131
- FCKXHtml._AppendChildNodes = function( xmlNode, htmlNode, isBlockElement )
132
- {
133
- var oNode = htmlNode.firstChild ;
134
-
135
- while ( oNode )
136
- {
137
- this._AppendNode( xmlNode, oNode ) ;
138
- oNode = oNode.nextSibling ;
139
- }
140
-
141
- // Trim block elements. This is also needed to avoid Firefox leaving extra
142
- // BRs at the end of them.
143
- if ( isBlockElement && htmlNode.tagName && htmlNode.tagName.toLowerCase() != 'pre' )
144
- {
145
- FCKDomTools.TrimNode( xmlNode ) ;
146
-
147
- if ( FCKConfig.FillEmptyBlocks )
148
- {
149
- var lastChild = xmlNode.lastChild ;
150
- if ( lastChild && lastChild.nodeType == 1 && lastChild.nodeName == 'br' )
151
- this._AppendEntity( xmlNode, this._NbspEntity ) ;
152
- }
153
- }
154
-
155
- // If the resulting node is empty.
156
- if ( xmlNode.childNodes.length == 0 )
157
- {
158
- if ( isBlockElement && FCKConfig.FillEmptyBlocks )
159
- {
160
- this._AppendEntity( xmlNode, this._NbspEntity ) ;
161
- return xmlNode ;
162
- }
163
-
164
- var sNodeName = xmlNode.nodeName ;
165
-
166
- // Some inline elements are required to have something inside (span, strong, etc...).
167
- if ( FCKListsLib.InlineChildReqElements[ sNodeName ] )
168
- return null ;
169
-
170
- // We can't use short representation of empty elements that are not marked
171
- // as empty in th XHTML DTD.
172
- if ( !FCKListsLib.EmptyElements[ sNodeName ] )
173
- xmlNode.appendChild( this.XML.createTextNode('') ) ;
174
- }
175
-
176
- return xmlNode ;
177
- }
178
-
179
- FCKXHtml._AppendNode = function( xmlNode, htmlNode )
180
- {
181
- if ( !htmlNode )
182
- return false ;
183
-
184
- switch ( htmlNode.nodeType )
185
- {
186
- // Element Node.
187
- case 1 :
188
- // If we detect a <br> inside a <pre> in Gecko, turn it into a line break instead.
189
- // This is a workaround for the Gecko bug here: https://bugzilla.mozilla.org/show_bug.cgi?id=92921
190
- if ( FCKBrowserInfo.IsGecko
191
- && htmlNode.tagName.toLowerCase() == 'br'
192
- && htmlNode.parentNode.tagName.toLowerCase() == 'pre' )
193
- {
194
- var val = '\r' ;
195
- if ( htmlNode == htmlNode.parentNode.firstChild )
196
- val += '\r' ;
197
- return FCKXHtml._AppendNode( xmlNode, this.XML.createTextNode( val ) ) ;
198
- }
199
-
200
- // Here we found an element that is not the real element, but a
201
- // fake one (like the Flash placeholder image), so we must get the real one.
202
- if ( htmlNode.getAttribute('_fckfakelement') )
203
- return FCKXHtml._AppendNode( xmlNode, FCK.GetRealElement( htmlNode ) ) ;
204
-
205
- // Ignore bogus BR nodes in the DOM.
206
- if ( FCKBrowserInfo.IsGecko &&
207
- ( htmlNode.hasAttribute('_moz_editor_bogus_node') || htmlNode.getAttribute( 'type' ) == '_moz' ) )
208
- {
209
- if ( htmlNode.nextSibling )
210
- return false ;
211
- else
212
- {
213
- htmlNode.removeAttribute( '_moz_editor_bogus_node' ) ;
214
- htmlNode.removeAttribute( 'type' ) ;
215
- }
216
- }
217
-
218
- // This is for elements that are instrumental to FCKeditor and
219
- // must be removed from the final HTML.
220
- if ( htmlNode.getAttribute('_fcktemp') )
221
- return false ;
222
-
223
- // Get the element name.
224
- var sNodeName = htmlNode.tagName.toLowerCase() ;
225
-
226
- if ( FCKBrowserInfo.IsIE )
227
- {
228
- // IE doens't include the scope name in the nodeName. So, add the namespace.
229
- if ( htmlNode.scopeName && htmlNode.scopeName != 'HTML' && htmlNode.scopeName != 'FCK' )
230
- sNodeName = htmlNode.scopeName.toLowerCase() + ':' + sNodeName ;
231
- }
232
- else
233
- {
234
- if ( sNodeName.StartsWith( 'fck:' ) )
235
- sNodeName = sNodeName.Remove( 0,4 ) ;
236
- }
237
-
238
- // Check if the node name is valid, otherwise ignore this tag.
239
- // If the nodeName starts with a slash, it is a orphan closing tag.
240
- // On some strange cases, the nodeName is empty, even if the node exists.
241
- if ( !FCKRegexLib.ElementName.test( sNodeName ) )
242
- return false ;
243
-
244
- // The already processed nodes must be marked to avoid then to be duplicated (bad formatted HTML).
245
- // So here, the "mark" is checked... if the element is Ok, then mark it.
246
- if ( htmlNode._fckxhtmljob && htmlNode._fckxhtmljob == FCKXHtml.CurrentJobNum )
247
- return false ;
248
-
249
- var oNode = this.XML.createElement( sNodeName ) ;
250
-
251
- // Add all attributes.
252
- FCKXHtml._AppendAttributes( xmlNode, htmlNode, oNode, sNodeName ) ;
253
-
254
- htmlNode._fckxhtmljob = FCKXHtml.CurrentJobNum ;
255
-
256
- // Tag specific processing.
257
- var oTagProcessor = FCKXHtml.TagProcessors[ sNodeName ] ;
258
-
259
- if ( oTagProcessor )
260
- oNode = oTagProcessor( oNode, htmlNode, xmlNode ) ;
261
- else
262
- oNode = this._AppendChildNodes( oNode, htmlNode, Boolean( FCKListsLib.NonEmptyBlockElements[ sNodeName ] ) ) ;
263
-
264
- if ( !oNode )
265
- return false ;
266
-
267
- xmlNode.appendChild( oNode ) ;
268
-
269
- break ;
270
-
271
- // Text Node.
272
- case 3 :
273
- if ( htmlNode.parentNode && htmlNode.parentNode.nodeName.IEquals( 'pre' ) )
274
- return this._AppendTextNode( xmlNode, htmlNode.nodeValue ) ;
275
- return this._AppendTextNode( xmlNode, htmlNode.nodeValue.ReplaceNewLineChars(' ') ) ;
276
-
277
- // Comment
278
- case 8 :
279
- // IE catches the <!DOTYPE ... > as a comment, but it has no
280
- // innerHTML, so we can catch it, and ignore it.
281
- if ( FCKBrowserInfo.IsIE && !htmlNode.innerHTML )
282
- break ;
283
-
284
- try { xmlNode.appendChild( this.XML.createComment( htmlNode.nodeValue ) ) ; }
285
- catch (e) { /* Do nothing... probably this is a wrong format comment. */ }
286
- break ;
287
-
288
- // Unknown Node type.
289
- default :
290
- xmlNode.appendChild( this.XML.createComment( "Element not supported - Type: " + htmlNode.nodeType + " Name: " + htmlNode.nodeName ) ) ;
291
- break ;
292
- }
293
- return true ;
294
- }
295
-
296
- // Append an item to the SpecialBlocks array and returns the tag to be used.
297
- FCKXHtml._AppendSpecialItem = function( item )
298
- {
299
- return '___FCKsi___' + ( FCKXHtml.SpecialBlocks.push( item ) - 1 ) ;
300
- }
301
-
302
- FCKXHtml._AppendEntity = function( xmlNode, entity )
303
- {
304
- xmlNode.appendChild( this.XML.createTextNode( '#?-:' + entity + ';' ) ) ;
305
- }
306
-
307
- FCKXHtml._AppendTextNode = function( targetNode, textValue )
308
- {
309
- var bHadText = textValue.length > 0 ;
310
- if ( bHadText )
311
- targetNode.appendChild( this.XML.createTextNode( textValue.replace( FCKXHtmlEntities.EntitiesRegex, FCKXHtml_GetEntity ) ) ) ;
312
- return bHadText ;
313
- }
314
-
315
- // Retrieves a entity (internal format) for a given character.
316
- function FCKXHtml_GetEntity( character )
317
- {
318
- // We cannot simply place the entities in the text, because the XML parser
319
- // will translate & to &amp;. So we use a temporary marker which is replaced
320
- // in the end of the processing.
321
- var sEntity = FCKXHtmlEntities.Entities[ character ] || ( '#' + character.charCodeAt(0) ) ;
322
- return '#?-:' + sEntity + ';' ;
323
- }
324
-
325
- // An object that hold tag specific operations.
326
- FCKXHtml.TagProcessors =
327
- {
328
- a : function( node, htmlNode )
329
- {
330
- // Firefox may create empty tags when deleting the selection in some special cases (SF-BUG 1556878).
331
- if ( htmlNode.innerHTML.Trim().length == 0 && !htmlNode.name )
332
- return false ;
333
-
334
- var sSavedUrl = htmlNode.getAttribute( '_fcksavedurl' ) ;
335
- if ( sSavedUrl != null )
336
- FCKXHtml._AppendAttribute( node, 'href', sSavedUrl ) ;
337
-
338
-
339
- // Anchors with content has been marked with an additional class, now we must remove it.
340
- if ( FCKBrowserInfo.IsIE )
341
- {
342
- // Buggy IE, doesn't copy the name of changed anchors.
343
- if ( htmlNode.name )
344
- FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
345
- }
346
-
347
- node = FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
348
-
349
- return node ;
350
- },
351
-
352
- area : function( node, htmlNode )
353
- {
354
- var sSavedUrl = htmlNode.getAttribute( '_fcksavedurl' ) ;
355
- if ( sSavedUrl != null )
356
- FCKXHtml._AppendAttribute( node, 'href', sSavedUrl ) ;
357
-
358
- // IE ignores the "COORDS" and "SHAPE" attribute so we must add it manually.
359
- if ( FCKBrowserInfo.IsIE )
360
- {
361
- if ( ! node.attributes.getNamedItem( 'coords' ) )
362
- {
363
- var sCoords = htmlNode.getAttribute( 'coords', 2 ) ;
364
- if ( sCoords && sCoords != '0,0,0' )
365
- FCKXHtml._AppendAttribute( node, 'coords', sCoords ) ;
366
- }
367
-
368
- if ( ! node.attributes.getNamedItem( 'shape' ) )
369
- {
370
- var sShape = htmlNode.getAttribute( 'shape', 2 ) ;
371
- if ( sShape && sShape.length > 0 )
372
- FCKXHtml._AppendAttribute( node, 'shape', sShape.toLowerCase() ) ;
373
- }
374
- }
375
-
376
- return node ;
377
- },
378
-
379
- body : function( node, htmlNode )
380
- {
381
- node = FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
382
- // Remove spellchecker attributes added for Firefox when converting to HTML code (Bug #1351).
383
- node.removeAttribute( 'spellcheck' ) ;
384
- return node ;
385
- },
386
-
387
- // IE loses contents of iframes, and Gecko does give it back HtmlEncoded
388
- // Note: Opera does lose the content and doesn't provide it in the innerHTML string
389
- iframe : function( node, htmlNode )
390
- {
391
- var sHtml = htmlNode.innerHTML ;
392
-
393
- // Gecko does give back the encoded html
394
- if ( FCKBrowserInfo.IsGecko )
395
- sHtml = FCKTools.HTMLDecode( sHtml );
396
-
397
- // Remove the saved urls here as the data won't be processed as nodes
398
- sHtml = sHtml.replace( /\s_fcksavedurl="[^"]*"/g, '' ) ;
399
-
400
- node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( sHtml ) ) ) ;
401
-
402
- return node ;
403
- },
404
-
405
- img : function( node, htmlNode )
406
- {
407
- // The "ALT" attribute is required in XHTML.
408
- if ( ! node.attributes.getNamedItem( 'alt' ) )
409
- FCKXHtml._AppendAttribute( node, 'alt', '' ) ;
410
-
411
- var sSavedUrl = htmlNode.getAttribute( '_fcksavedurl' ) ;
412
- if ( sSavedUrl != null )
413
- FCKXHtml._AppendAttribute( node, 'src', sSavedUrl ) ;
414
-
415
- // Bug #768 : If the width and height are defined inline CSS,
416
- // don't define it again in the HTML attributes.
417
- if ( htmlNode.style.width )
418
- node.removeAttribute( 'width' ) ;
419
- if ( htmlNode.style.height )
420
- node.removeAttribute( 'height' ) ;
421
-
422
- return node ;
423
- },
424
-
425
- // Fix orphaned <li> nodes (Bug #503).
426
- li : function( node, htmlNode, targetNode )
427
- {
428
- // If the XML parent node is already a <ul> or <ol>, then add the <li> as usual.
429
- if ( targetNode.nodeName.IEquals( ['ul', 'ol'] ) )
430
- return FCKXHtml._AppendChildNodes( node, htmlNode, true ) ;
431
-
432
- var newTarget = FCKXHtml.XML.createElement( 'ul' ) ;
433
-
434
- // Reset the _fckxhtmljob so the HTML node is processed again.
435
- htmlNode._fckxhtmljob = null ;
436
-
437
- // Loop through all sibling LIs, adding them to the <ul>.
438
- do
439
- {
440
- FCKXHtml._AppendNode( newTarget, htmlNode ) ;
441
-
442
- // Look for the next element following this <li>.
443
- do
444
- {
445
- htmlNode = FCKDomTools.GetNextSibling( htmlNode ) ;
446
-
447
- } while ( htmlNode && htmlNode.nodeType == 3 && htmlNode.nodeValue.Trim().length == 0 )
448
-
449
- } while ( htmlNode && htmlNode.nodeName.toLowerCase() == 'li' )
450
-
451
- return newTarget ;
452
- },
453
-
454
- // Fix nested <ul> and <ol>.
455
- ol : function( node, htmlNode, targetNode )
456
- {
457
- if ( htmlNode.innerHTML.Trim().length == 0 )
458
- return false ;
459
-
460
- var ePSibling = targetNode.lastChild ;
461
-
462
- if ( ePSibling && ePSibling.nodeType == 3 )
463
- ePSibling = ePSibling.previousSibling ;
464
-
465
- if ( ePSibling && ePSibling.nodeName.toUpperCase() == 'LI' )
466
- {
467
- htmlNode._fckxhtmljob = null ;
468
- FCKXHtml._AppendNode( ePSibling, htmlNode ) ;
469
- return false ;
470
- }
471
-
472
- node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
473
-
474
- return node ;
475
- },
476
-
477
- pre : function ( node, htmlNode )
478
- {
479
- var firstChild = htmlNode.firstChild ;
480
-
481
- if ( firstChild && firstChild.nodeType == 3 )
482
- node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( '\r\n' ) ) ) ;
483
-
484
- FCKXHtml._AppendChildNodes( node, htmlNode, true ) ;
485
-
486
- return node ;
487
- },
488
-
489
- script : function( node, htmlNode )
490
- {
491
- // The "TYPE" attribute is required in XHTML.
492
- if ( ! node.attributes.getNamedItem( 'type' ) )
493
- FCKXHtml._AppendAttribute( node, 'type', 'text/javascript' ) ;
494
-
495
- node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( htmlNode.text ) ) ) ;
496
-
497
- return node ;
498
- },
499
-
500
- span : function( node, htmlNode )
501
- {
502
- // Firefox may create empty tags when deleting the selection in some special cases (SF-BUG 1084404).
503
- if ( htmlNode.innerHTML.length == 0 )
504
- return false ;
505
-
506
- node = FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
507
-
508
- return node ;
509
- },
510
-
511
- style : function( node, htmlNode )
512
- {
513
- // The "TYPE" attribute is required in XHTML.
514
- if ( ! node.attributes.getNamedItem( 'type' ) )
515
- FCKXHtml._AppendAttribute( node, 'type', 'text/css' ) ;
516
-
517
- var cssText = htmlNode.innerHTML ;
518
- if ( FCKBrowserInfo.IsIE ) // Bug #403 : IE always appends a \r\n to the beginning of StyleNode.innerHTML
519
- cssText = cssText.replace( /^(\r\n|\n|\r)/, '' ) ;
520
-
521
- node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( cssText ) ) ) ;
522
-
523
- return node ;
524
- },
525
-
526
- title : function( node, htmlNode )
527
- {
528
- node.appendChild( FCKXHtml.XML.createTextNode( FCK.EditorDocument.title ) ) ;
529
-
530
- return node ;
531
- }
532
- } ;
533
-
534
- FCKXHtml.TagProcessors.ul = FCKXHtml.TagProcessors.ol ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckxhtml_gecko.js DELETED
@@ -1,114 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Defines the FCKXHtml object, responsible for the XHTML operations.
22
- * Gecko specific.
23
- */
24
-
25
- FCKXHtml._GetMainXmlString = function()
26
- {
27
- return ( new XMLSerializer() ).serializeToString( this.MainNode ) ;
28
- }
29
-
30
- FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node )
31
- {
32
- var aAttributes = htmlNode.attributes ;
33
-
34
- for ( var n = 0 ; n < aAttributes.length ; n++ )
35
- {
36
- var oAttribute = aAttributes[n] ;
37
-
38
- if ( oAttribute.specified )
39
- {
40
- var sAttName = oAttribute.nodeName.toLowerCase() ;
41
- var sAttValue ;
42
-
43
- // Ignore any attribute starting with "_fck".
44
- if ( sAttName.StartsWith( '_fck' ) )
45
- continue ;
46
- // There is a bug in Mozilla that returns '_moz_xxx' attributes as specified.
47
- else if ( sAttName.indexOf( '_moz' ) == 0 )
48
- continue ;
49
- // There are one cases (on Gecko) when the oAttribute.nodeValue must be used:
50
- // - for the "class" attribute
51
- else if ( sAttName == 'class' )
52
- {
53
- sAttValue = oAttribute.nodeValue.replace( FCKRegexLib.FCK_Class, '' ) ;
54
- if ( sAttValue.length == 0 )
55
- continue ;
56
- }
57
- // XHTML doens't support attribute minimization like "CHECKED". It must be transformed to checked="checked".
58
- else if ( oAttribute.nodeValue === true )
59
- sAttValue = sAttName ;
60
- else
61
- sAttValue = htmlNode.getAttribute( sAttName, 2 ) ; // We must use getAttribute to get it exactly as it is defined.
62
-
63
- this._AppendAttribute( node, sAttName, sAttValue ) ;
64
- }
65
- }
66
- }
67
-
68
- if ( FCKBrowserInfo.IsOpera )
69
- {
70
- // Opera moves the <FCK:meta> element outside head (#1166).
71
-
72
- // Save a reference to the XML <head> node, so we can use it for
73
- // orphan <meta>s.
74
- FCKXHtml.TagProcessors['head'] = function( node, htmlNode )
75
- {
76
- FCKXHtml.XML._HeadElement = node ;
77
-
78
- node = FCKXHtml._AppendChildNodes( node, htmlNode, true ) ;
79
-
80
- return node ;
81
- }
82
-
83
- // Check whether a <meta> element is outside <head>, and move it to the
84
- // proper place.
85
- FCKXHtml.TagProcessors['meta'] = function( node, htmlNode, xmlNode )
86
- {
87
- if ( htmlNode.parentNode.nodeName.toLowerCase() != 'head' )
88
- {
89
- var headElement = FCKXHtml.XML._HeadElement ;
90
-
91
- if ( headElement && xmlNode != headElement )
92
- {
93
- delete htmlNode._fckxhtmljob ;
94
- FCKXHtml._AppendNode( headElement, htmlNode ) ;
95
- return null ;
96
- }
97
- }
98
-
99
- return node ;
100
- }
101
- }
102
-
103
- if ( FCKBrowserInfo.IsGecko )
104
- {
105
- // #2162, some Firefox extensions might add references to internal links
106
- FCKXHtml.TagProcessors['link'] = function( node, htmlNode )
107
- {
108
- if ( htmlNode.href.substr(0, 9).toLowerCase() == 'chrome://' )
109
- return false ;
110
-
111
- return node ;
112
- }
113
-
114
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckxhtml_ie.js DELETED
@@ -1,213 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Defines the FCKXHtml object, responsible for the XHTML operations.
22
- * IE specific.
23
- */
24
-
25
- FCKXHtml._GetMainXmlString = function()
26
- {
27
- return this.MainNode.xml ;
28
- }
29
-
30
- FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName )
31
- {
32
- var aAttributes = htmlNode.attributes,
33
- bHasStyle ;
34
-
35
- for ( var n = 0 ; n < aAttributes.length ; n++ )
36
- {
37
- var oAttribute = aAttributes[n] ;
38
-
39
- if ( oAttribute.specified )
40
- {
41
- var sAttName = oAttribute.nodeName.toLowerCase() ;
42
- var sAttValue ;
43
-
44
- // Ignore any attribute starting with "_fck".
45
- if ( sAttName.StartsWith( '_fck' ) )
46
- continue ;
47
- // The following must be done because of a bug on IE regarding the style
48
- // attribute. It returns "null" for the nodeValue.
49
- else if ( sAttName == 'style' )
50
- {
51
- // Just mark it to do it later in this function.
52
- bHasStyle = true ;
53
- continue ;
54
- }
55
- // There are two cases when the oAttribute.nodeValue must be used:
56
- // - for the "class" attribute
57
- // - for events attributes (on IE only).
58
- else if ( sAttName == 'class' )
59
- {
60
- sAttValue = oAttribute.nodeValue.replace( FCKRegexLib.FCK_Class, '' ) ;
61
- if ( sAttValue.length == 0 )
62
- continue ;
63
- }
64
- else if ( sAttName.indexOf('on') == 0 )
65
- sAttValue = oAttribute.nodeValue ;
66
- else if ( nodeName == 'body' && sAttName == 'contenteditable' )
67
- continue ;
68
- // XHTML doens't support attribute minimization like "CHECKED". It must be transformed to checked="checked".
69
- else if ( oAttribute.nodeValue === true )
70
- sAttValue = sAttName ;
71
- else
72
- {
73
- // We must use getAttribute to get it exactly as it is defined.
74
- // There are some rare cases that IE throws an error here, so we must try/catch.
75
- try
76
- {
77
- sAttValue = htmlNode.getAttribute( sAttName, 2 ) ;
78
- }
79
- catch (e) {}
80
- }
81
- this._AppendAttribute( node, sAttName, sAttValue || oAttribute.nodeValue ) ;
82
- }
83
- }
84
-
85
- // IE loses the style attribute in JavaScript-created elements tags. (#2390)
86
- if ( bHasStyle || htmlNode.style.cssText.length > 0 )
87
- {
88
- var data = FCKTools.ProtectFormStyles( htmlNode ) ;
89
- var sStyleValue = htmlNode.style.cssText.replace( FCKRegexLib.StyleProperties, FCKTools.ToLowerCase ) ;
90
- FCKTools.RestoreFormStyles( htmlNode, data ) ;
91
- this._AppendAttribute( node, 'style', sStyleValue ) ;
92
- }
93
- }
94
-
95
- // On very rare cases, IE is loosing the "align" attribute for DIV. (right align and apply bulleted list)
96
- FCKXHtml.TagProcessors['div'] = function( node, htmlNode )
97
- {
98
- if ( htmlNode.align.length > 0 )
99
- FCKXHtml._AppendAttribute( node, 'align', htmlNode.align ) ;
100
-
101
- node = FCKXHtml._AppendChildNodes( node, htmlNode, true ) ;
102
-
103
- return node ;
104
- }
105
-
106
- // IE automatically changes <FONT> tags to <FONT size=+0>.
107
- FCKXHtml.TagProcessors['font'] = function( node, htmlNode )
108
- {
109
- if ( node.attributes.length == 0 )
110
- node = FCKXHtml.XML.createDocumentFragment() ;
111
-
112
- node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
113
-
114
- return node ;
115
- }
116
-
117
- FCKXHtml.TagProcessors['form'] = function( node, htmlNode )
118
- {
119
- if ( htmlNode.acceptCharset && htmlNode.acceptCharset.length > 0 && htmlNode.acceptCharset != 'UNKNOWN' )
120
- FCKXHtml._AppendAttribute( node, 'accept-charset', htmlNode.acceptCharset ) ;
121
-
122
- // IE has a bug and htmlNode.attributes['name'].specified=false if there is
123
- // no element with id="name" inside the form (#360 and SF-BUG-1155726).
124
- var nameAtt = htmlNode.attributes['name'] ;
125
-
126
- if ( nameAtt && nameAtt.value.length > 0 )
127
- FCKXHtml._AppendAttribute( node, 'name', nameAtt.value ) ;
128
-
129
- node = FCKXHtml._AppendChildNodes( node, htmlNode, true ) ;
130
-
131
- return node ;
132
- }
133
-
134
- // IE doens't see the value attribute as an attribute for the <INPUT> tag.
135
- FCKXHtml.TagProcessors['input'] = function( node, htmlNode )
136
- {
137
- if ( htmlNode.name )
138
- FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
139
-
140
- if ( htmlNode.value && !node.attributes.getNamedItem( 'value' ) )
141
- FCKXHtml._AppendAttribute( node, 'value', htmlNode.value ) ;
142
-
143
- if ( !node.attributes.getNamedItem( 'type' ) )
144
- FCKXHtml._AppendAttribute( node, 'type', 'text' ) ;
145
-
146
- return node ;
147
- }
148
-
149
- FCKXHtml.TagProcessors['label'] = function( node, htmlNode )
150
- {
151
- if ( htmlNode.htmlFor.length > 0 )
152
- FCKXHtml._AppendAttribute( node, 'for', htmlNode.htmlFor ) ;
153
-
154
- node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
155
-
156
- return node ;
157
- }
158
-
159
- // Fix behavior for IE, it doesn't read back the .name on newly created maps
160
- FCKXHtml.TagProcessors['map'] = function( node, htmlNode )
161
- {
162
- if ( ! node.attributes.getNamedItem( 'name' ) )
163
- {
164
- var name = htmlNode.name ;
165
- if ( name )
166
- FCKXHtml._AppendAttribute( node, 'name', name ) ;
167
- }
168
-
169
- node = FCKXHtml._AppendChildNodes( node, htmlNode, true ) ;
170
-
171
- return node ;
172
- }
173
-
174
- FCKXHtml.TagProcessors['meta'] = function( node, htmlNode )
175
- {
176
- var oHttpEquiv = node.attributes.getNamedItem( 'http-equiv' ) ;
177
-
178
- if ( oHttpEquiv == null || oHttpEquiv.value.length == 0 )
179
- {
180
- // Get the http-equiv value from the outerHTML.
181
- var sHttpEquiv = htmlNode.outerHTML.match( FCKRegexLib.MetaHttpEquiv ) ;
182
-
183
- if ( sHttpEquiv )
184
- {
185
- sHttpEquiv = sHttpEquiv[1] ;
186
- FCKXHtml._AppendAttribute( node, 'http-equiv', sHttpEquiv ) ;
187
- }
188
- }
189
-
190
- return node ;
191
- }
192
-
193
- // IE ignores the "SELECTED" attribute so we must add it manually.
194
- FCKXHtml.TagProcessors['option'] = function( node, htmlNode )
195
- {
196
- if ( htmlNode.selected && !node.attributes.getNamedItem( 'selected' ) )
197
- FCKXHtml._AppendAttribute( node, 'selected', 'selected' ) ;
198
-
199
- node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
200
-
201
- return node ;
202
- }
203
-
204
- // IE doens't hold the name attribute as an attribute for the <TEXTAREA> and <SELECT> tags.
205
- FCKXHtml.TagProcessors['textarea'] = FCKXHtml.TagProcessors['select'] = function( node, htmlNode )
206
- {
207
- if ( htmlNode.name )
208
- FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
209
-
210
- node = FCKXHtml._AppendChildNodes( node, htmlNode ) ;
211
-
212
- return node ;
213
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/_source/internals/fckxhtmlentities.js DELETED
@@ -1,357 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This file define the HTML entities handled by the editor.
22
- */
23
-
24
- var FCKXHtmlEntities = new Object() ;
25
-
26
- FCKXHtmlEntities.Initialize = function()
27
- {
28
- if ( FCKXHtmlEntities.Entities )
29
- return ;
30
-
31
- var sChars = '' ;
32
- var oEntities, e ;
33
-
34
- if ( FCKConfig.ProcessHTMLEntities )
35
- {
36
- FCKXHtmlEntities.Entities = {
37
- // Latin-1 Entities
38
- ' ':'nbsp',
39
- '¡':'iexcl',
40
- '¢':'cent',
41
- '£':'pound',
42
- '¤':'curren',
43
- '¥':'yen',
44
- '¦':'brvbar',
45
- '§':'sect',
46
- '¨':'uml',
47
- '©':'copy',
48
- 'ª':'ordf',
49
- '«':'laquo',
50
- '¬':'not',
51
- '­':'shy',
52
- '®':'reg',
53
- '¯':'macr',
54
- '°':'deg',
55
- '±':'plusmn',
56
- '²':'sup2',
57
- '³':'sup3',
58
- '´':'acute',
59
- 'µ':'micro',
60
- '¶':'para',
61
- '·':'middot',
62
- '¸':'cedil',
63
- '¹':'sup1',
64
- 'º':'ordm',
65
- '»':'raquo',
66
- '¼':'frac14',
67
- '½':'frac12',
68
- '¾':'frac34',
69
- '¿':'iquest',
70
- '×':'times',
71
- '÷':'divide',
72
-
73
- // Symbols
74
-
75
- 'ƒ':'fnof',
76
- '•':'bull',
77
- '…':'hellip',
78
- '′':'prime',
79
- '″':'Prime',
80
- '‾':'oline',
81
- '⁄':'frasl',
82
- '℘':'weierp',
83
- 'ℑ':'image',
84
- 'ℜ':'real',
85
- '™':'trade',
86
- 'ℵ':'alefsym',
87
- '←':'larr',
88
- '↑':'uarr',
89
- '→':'rarr',
90
- '↓':'darr',
91
- '↔':'harr',
92
- '↵':'crarr',
93
- '⇐':'lArr',
94
- '⇑':'uArr',
95
- '⇒':'rArr',
96
- '⇓':'dArr',
97
- '⇔':'hArr',
98
- '∀':'forall',
99
- '∂':'part',
100
- '∃':'exist',
101
- '∅':'empty',
102
- '∇':'nabla',
103
- '∈':'isin',
104
- '∉':'notin',
105
- '∋':'ni',
106
- '∏':'prod',
107
- '∑':'sum',
108
- '−':'minus',
109
- '∗':'lowast',
110
- '√':'radic',
111
- '∝':'prop',
112
- '∞':'infin',
113
- '∠':'ang',
114
- '∧':'and',
115
- '∨':'or',
116
- '∩':'cap',
117
- '∪':'cup',
118
- '∫':'int',
119
- '∴':'there4',
120
- '∼':'sim',
121
- '≅':'cong',
122
- '≈':'asymp',
123
- '≠':'ne',
124
- '≡':'equiv',
125
- '≤':'le',
126
- '≥':'ge',
127
- '⊂':'sub',
128
- '⊃':'sup',
129
- '⊄':'nsub',
130
- '⊆':'sube',
131
- '⊇':'supe',
132
- '⊕':'oplus',
133
- '⊗':'otimes',
134
- '⊥':'perp',
135
- '⋅':'sdot',
136
- '\u2308':'lceil',
137
- '\u2309':'rceil',
138
- '\u230a':'lfloor',
139
- '\u230b':'rfloor',
140
- '\u2329':'lang',
141
- '\u232a':'rang',
142
- '◊':'loz',
143
- '♠':'spades',
144
- '♣':'clubs',
145
- '♥':'hearts',
146
- '♦':'diams',
147
-
148
- // Other Special Characters
149
-
150
- '"':'quot',
151
- // '&':'amp', // This entity is automatically handled by the XHTML parser.
152
- // '<':'lt', // This entity is automatically handled by the XHTML parser.
153
- '>':'gt', // Opera and Safari don't encode it in their implementation
154
- 'ˆ':'circ',
155
- '˜':'tilde',
156
- ' ':'ensp',
157
- ' ':'emsp',
158
- ' ':'thinsp',
159
- '‌':'zwnj',
160
- '‍':'zwj',
161
- '‎':'lrm',
162
- '‏':'rlm',
163
- '–':'ndash',
164
- '—':'mdash',
165
- '‘':'lsquo',
166
- '’':'rsquo',
167
- '‚':'sbquo',
168
- '“':'ldquo',
169
- '”':'rdquo',
170
- '„':'bdquo',
171
- '†':'dagger',
172
- '‡':'Dagger',
173
- '‰':'permil',
174
- '‹':'lsaquo',
175
- '›':'rsaquo',
176
- '€':'euro'
177
- } ;
178
-
179
- // Process Base Entities.
180
- for ( e in FCKXHtmlEntities.Entities )
181
- sChars += e ;
182
-
183
- // Include Latin Letters Entities.
184
- if ( FCKConfig.IncludeLatinEntities )
185
- {
186
- oEntities = {
187
- 'À':'Agrave',
188
- 'Á':'Aacute',
189
- 'Â':'Acirc',
190
- 'Ã':'Atilde',
191
- 'Ä':'Auml',
192
- 'Å':'Aring',
193
- 'Æ':'AElig',
194
- 'Ç':'Ccedil',
195
- 'È':'Egrave',
196
- 'É':'Eacute',
197
- 'Ê':'Ecirc',
198
- 'Ë':'Euml',
199
- 'Ì':'Igrave',
200
- 'Í':'Iacute',
201
- 'Î':'Icirc',
202
- 'Ï':'Iuml',
203
- 'Ð':'ETH',
204
- 'Ñ':'Ntilde',
205
- 'Ò':'Ograve',
206
- 'Ó':'Oacute',
207
- 'Ô':'Ocirc',
208
- 'Õ':'Otilde',
209
- 'Ö':'Ouml',
210
- 'Ø':'Oslash',
211
- 'Ù':'Ugrave',
212
- 'Ú':'Uacute',
213
- 'Û':'Ucirc',
214
- 'Ü':'Uuml',
215
- 'Ý':'Yacute',
216
- 'Þ':'THORN',
217
- 'ß':'szlig',
218
- 'à':'agrave',
219
- 'á':'aacute',
220
- 'â':'acirc',
221
- 'ã':'atilde',
222
- 'ä':'auml',
223
- 'å':'aring',
224
- 'æ':'aelig',
225
- 'ç':'ccedil',
226
- 'è':'egrave',
227
- 'é':'eacute',
228
- 'ê':'ecirc',
229
- 'ë':'euml',
230
- 'ì':'igrave',
231
- 'í':'iacute',
232
- 'î':'icirc',
233
- 'ï':'iuml',
234
- 'ð':'eth',
235
- 'ñ':'ntilde',
236
- 'ò':'ograve',
237
- 'ó':'oacute',
238
- 'ô':'ocirc',
239
- 'õ':'otilde',
240
- 'ö':'ouml',
241
- 'ø':'oslash',
242
- 'ù':'ugrave',
243
- 'ú':'uacute',
244
- 'û':'ucirc',
245
- 'ü':'uuml',
246
- 'ý':'yacute',
247
- 'þ':'thorn',
248
- 'ÿ':'yuml',
249
- 'Œ':'OElig',
250
- 'œ':'oelig',
251
- 'Š':'Scaron',
252
- 'š':'scaron',
253
- 'Ÿ':'Yuml'
254
- } ;
255
-
256
- for ( e in oEntities )
257
- {
258
- FCKXHtmlEntities.Entities[ e ] = oEntities[ e ] ;
259
- sChars += e ;
260
- }
261
-
262
- oEntities = null ;
263
- }
264
-
265
- // Include Greek Letters Entities.
266
- if ( FCKConfig.IncludeGreekEntities )
267
- {
268
- oEntities = {
269
- 'Α':'Alpha',
270
- 'Β':'Beta',
271
- 'Γ':'Gamma',
272
- 'Δ':'Delta',
273
- 'Ε':'Epsilon',
274
- 'Ζ':'Zeta',
275
- 'Η':'Eta',
276
- 'Θ':'Theta',
277
- 'Ι':'Iota',
278
- 'Κ':'Kappa',
279
- 'Λ':'Lambda',
280
- 'Μ':'Mu',
281
- 'Ν':'Nu',
282
- 'Ξ':'Xi',
283
- 'Ο':'Omicron',
284
- 'Π':'Pi',
285
- 'Ρ':'Rho',
286
- 'Σ':'Sigma',
287
- 'Τ':'Tau',
288
- 'Υ':'Upsilon',
289
- 'Φ':'Phi',
290
- 'Χ':'Chi',
291
- 'Ψ':'Psi',
292
- 'Ω':'Omega',
293
- 'α':'alpha',
294
- 'β':'beta',
295
- 'γ':'gamma',
296
- 'δ':'delta',
297
- 'ε':'epsilon',
298
- 'ζ':'zeta',
299
- 'η':'eta',
300
- 'θ':'theta',
301
- 'ι':'iota',
302
- 'κ':'kappa',
303
- 'λ':'lambda',
304
- 'μ':'mu',
305
- 'ν':'nu',
306
- 'ξ':'xi',
307
- 'ο':'omicron',
308
- 'π':'pi',
309
- 'ρ':'rho',
310
- 'ς':'sigmaf',
311
- 'σ':'sigma',
312
- 'τ':'tau',
313
- 'υ':'upsilon',
314
- 'φ':'phi',
315
- 'χ':'chi',
316
- 'ψ':'psi',
317
- 'ω':'omega',
318
- '\u03d1':'thetasym',
319
- '\u03d2':'upsih',
320
- '\u03d6':'piv'
321
- } ;
322
-
323
- for ( e in oEntities )
324
- {
325
- FCKXHtmlEntities.Entities[ e ] = oEntities[ e ] ;
326
- sChars += e ;
327
- }
328
-
329
- oEntities = null ;
330
- }
331
- }
332
- else
333
- {
334
- FCKXHtmlEntities.Entities = {
335
- '>':'gt' // Opera and Safari don't encode it in their implementation
336
- } ;
337
- sChars = '>';
338
-
339
- // Even if we are not processing the entities, we must render the &nbsp;
340
- // correctly. As we don't want HTML entities, let's use its numeric
341
- // representation (&#160).
342
- sChars += ' ' ;
343
- }
344
-
345
- // Create the Regex used to find entities in the text.
346
- var sRegexPattern = '[' + sChars + ']' ;
347
-
348
- if ( FCKConfig.ProcessNumericEntities )
349
- sRegexPattern = '[^ -~]|' + sRegexPattern ;
350
-
351
- var sAdditional = FCKConfig.AdditionalNumericEntities ;
352
-
353
- if ( sAdditional && sAdditional.length > 0 )
354
- sRegexPattern += '|' + FCKConfig.AdditionalNumericEntities ;
355
-
356
- FCKXHtmlEntities.EntitiesRegex = new RegExp( sRegexPattern, 'g' ) ;
357
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/css/behaviors/disablehandles.htc DELETED
@@ -1,15 +0,0 @@
1
- <public:component lightweight="true">
2
-
3
- <script language="javascript">
4
-
5
- function CancelEvent()
6
- {
7
- return false ;
8
- }
9
-
10
- this.onresizestart = CancelEvent ;
11
- this.onbeforeeditfocus = CancelEvent ;
12
-
13
- </script>
14
-
15
- </public:component>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/css/behaviors/showtableborders.htc DELETED
@@ -1,36 +0,0 @@
1
- <public:component lightweight="true">
2
-
3
- <public:attach event="oncontentready" onevent="ShowBorders()" />
4
- <public:attach event="onpropertychange" onevent="OnPropertyChange()" />
5
-
6
- <script language="javascript">
7
-
8
- var oClassRegex = /\s*FCK__ShowTableBorders/ ;
9
-
10
- function ShowBorders()
11
- {
12
- if ( this.border == 0 )
13
- {
14
- if ( !oClassRegex.test( this.className ) )
15
- this.className += ' FCK__ShowTableBorders' ;
16
- }
17
- else
18
- {
19
- if ( oClassRegex.test( this.className ) )
20
- {
21
- this.className = this.className.replace( oClassRegex, '' ) ;
22
- if ( this.className.length == 0 )
23
- this.removeAttribute( 'className', 0 ) ;
24
- }
25
- }
26
- }
27
-
28
- function OnPropertyChange()
29
- {
30
- if ( event.propertyName == 'border' || event.propertyName == 'className' )
31
- ShowBorders.call(this) ;
32
- }
33
-
34
- </script>
35
-
36
- </public:component>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/css/fck_editorarea.css DELETED
@@ -1,110 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This is the default CSS file used by the editor area. It defines the
22
- * initial font of the editor and background color.
23
- *
24
- * A user can configure the editor to use another CSS file. Just change
25
- * the value of the FCKConfig.EditorAreaCSS key in the configuration
26
- * file.
27
- */
28
-
29
- /**
30
- * The "body" styles should match your editor web site, mainly regarding
31
- * background color and font family and size.
32
- */
33
-
34
- body
35
- {
36
- background-color: #ffffff;
37
- padding: 5px 5px 5px 5px;
38
- margin: 0px;
39
- }
40
-
41
- body, td
42
- {
43
- font-family: Arial, Verdana, sans-serif;
44
- font-size: 12px;
45
- }
46
-
47
- a[href]
48
- {
49
- color: -moz-hyperlinktext !important; /* For Firefox... mark as important, otherwise it becomes black */
50
- text-decoration: -moz-anchor-decoration; /* For Firefox 3, otherwise no underline will be used */
51
- }
52
-
53
- /**
54
- * Just uncomment the following block if you want to avoid spaces between
55
- * paragraphs. Remember to apply the same style in your output front end page.
56
- */
57
-
58
- /*
59
- p, ul, li
60
- {
61
- margin-top: 0px;
62
- margin-bottom: 0px;
63
- }
64
- */
65
-
66
- /**
67
- * Uncomment the following block, or only selected lines if appropriate,
68
- * if you have some style items that would break the styles combo box.
69
- * You can also write other CSS overrides inside the style block below
70
- * as needed and they will be applied to inside the style combo only.
71
- */
72
-
73
- /*
74
- .SC_Item *, .SC_ItemSelected *
75
- {
76
- margin: 0px !important;
77
- padding: 0px !important;
78
- text-indent: 0px !important;
79
- clip: auto !important;
80
- position: static !important;
81
- }
82
- */
83
-
84
- /**
85
- * The following are some sample styles used in the "Styles" toolbar command.
86
- * You should instead remove them, and include the styles used by the site
87
- * you are using the editor in.
88
- */
89
-
90
- .Bold
91
- {
92
- font-weight: bold;
93
- }
94
-
95
- .Title
96
- {
97
- font-weight: bold;
98
- font-size: 18px;
99
- color: #cc3300;
100
- }
101
-
102
- .Code
103
- {
104
- border: #8b4513 1px solid;
105
- padding-right: 5px;
106
- padding-left: 5px;
107
- color: #000066;
108
- font-family: 'Courier New' , Monospace;
109
- background-color: #ff9933;
110
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/css/fck_internal.css DELETED
@@ -1,199 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This CSS Style Sheet defines rules used by the editor for its internal use.
22
- */
23
-
24
- /* #########
25
- * WARNING
26
- * #########
27
- * When changing this file, the minified version of it must be updated in the
28
- * fckeditor.html file (see FCK_InternalCSS).
29
- */
30
-
31
- /* Fix to allow putting the caret at the end of the content in Firefox if
32
- clicking below the content. */
33
- html
34
- {
35
- min-height: 100%;
36
- }
37
-
38
- table.FCK__ShowTableBorders, table.FCK__ShowTableBorders td, table.FCK__ShowTableBorders th
39
- {
40
- border: #d3d3d3 1px solid;
41
- }
42
-
43
- form
44
- {
45
- border: 1px dotted #FF0000;
46
- padding: 2px;
47
- }
48
-
49
- .FCK__Flash
50
- {
51
- border: #a9a9a9 1px solid;
52
- background-position: center center;
53
- background-image: url(images/fck_flashlogo.gif);
54
- background-repeat: no-repeat;
55
- width: 80px;
56
- height: 80px;
57
- }
58
-
59
- .FCK__UnknownObject
60
- {
61
- border: #a9a9a9 1px solid;
62
- background-position: center center;
63
- background-image: url(images/fck_plugin.gif);
64
- background-repeat: no-repeat;
65
- width: 80px;
66
- height: 80px;
67
- }
68
-
69
- /* Empty anchors images */
70
- .FCK__Anchor
71
- {
72
- border: 1px dotted #00F;
73
- background-position: center center;
74
- background-image: url(images/fck_anchor.gif);
75
- background-repeat: no-repeat;
76
- width: 16px;
77
- height: 15px;
78
- vertical-align: middle;
79
- }
80
-
81
- /* Anchors with content */
82
- .FCK__AnchorC
83
- {
84
- border: 1px dotted #00F;
85
- background-position: 1px center;
86
- background-image: url(images/fck_anchor.gif);
87
- background-repeat: no-repeat;
88
- padding-left: 18px;
89
- }
90
-
91
- /* Any anchor for non-IE, if we combine it with the previous rule IE ignores all. */
92
- a[name]
93
- {
94
- border: 1px dotted #00F;
95
- background-position: 0 center;
96
- background-image: url(images/fck_anchor.gif);
97
- background-repeat: no-repeat;
98
- padding-left: 18px;
99
- }
100
-
101
- .FCK__PageBreak
102
- {
103
- background-position: center center;
104
- background-image: url(images/fck_pagebreak.gif);
105
- background-repeat: no-repeat;
106
- clear: both;
107
- display: block;
108
- float: none;
109
- width: 100%;
110
- border-top: #999999 1px dotted;
111
- border-bottom: #999999 1px dotted;
112
- border-right: 0px;
113
- border-left: 0px;
114
- height: 5px;
115
- }
116
-
117
- /* Hidden fields */
118
- .FCK__InputHidden
119
- {
120
- width: 19px;
121
- height: 18px;
122
- background-image: url(images/fck_hiddenfield.gif);
123
- background-repeat: no-repeat;
124
- vertical-align: text-bottom;
125
- background-position: center center;
126
- }
127
-
128
- .FCK__ShowBlocks p,
129
- .FCK__ShowBlocks div,
130
- .FCK__ShowBlocks pre,
131
- .FCK__ShowBlocks address,
132
- .FCK__ShowBlocks blockquote,
133
- .FCK__ShowBlocks h1,
134
- .FCK__ShowBlocks h2,
135
- .FCK__ShowBlocks h3,
136
- .FCK__ShowBlocks h4,
137
- .FCK__ShowBlocks h5,
138
- .FCK__ShowBlocks h6
139
- {
140
- background-repeat: no-repeat;
141
- border: 1px dotted gray;
142
- padding-top: 8px;
143
- padding-left: 8px;
144
- }
145
-
146
- .FCK__ShowBlocks p
147
- {
148
- background-image: url(images/block_p.png);
149
- }
150
-
151
- .FCK__ShowBlocks div
152
- {
153
- background-image: url(images/block_div.png);
154
- }
155
-
156
- .FCK__ShowBlocks pre
157
- {
158
- background-image: url(images/block_pre.png);
159
- }
160
-
161
- .FCK__ShowBlocks address
162
- {
163
- background-image: url(images/block_address.png);
164
- }
165
-
166
- .FCK__ShowBlocks blockquote
167
- {
168
- background-image: url(images/block_blockquote.png);
169
- }
170
-
171
- .FCK__ShowBlocks h1
172
- {
173
- background-image: url(images/block_h1.png);
174
- }
175
-
176
- .FCK__ShowBlocks h2
177
- {
178
- background-image: url(images/block_h2.png);
179
- }
180
-
181
- .FCK__ShowBlocks h3
182
- {
183
- background-image: url(images/block_h3.png);
184
- }
185
-
186
- .FCK__ShowBlocks h4
187
- {
188
- background-image: url(images/block_h4.png);
189
- }
190
-
191
- .FCK__ShowBlocks h5
192
- {
193
- background-image: url(images/block_h5.png);
194
- }
195
-
196
- .FCK__ShowBlocks h6
197
- {
198
- background-image: url(images/block_h6.png);
199
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/css/fck_showtableborders_gecko.css DELETED
@@ -1,49 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This CSS Style Sheet defines the rules to show table borders on Gecko.
22
- */
23
-
24
- /* #########
25
- * WARNING
26
- * #########
27
- * When changing this file, the minified version of it must be updated in the
28
- * fckeditor.html file (see FCK_ShowTableBordersCSS).
29
- */
30
-
31
- /* For tables with the "border" attribute set to "0" */
32
- table[border="0"],
33
- table[border="0"] > tr > td, table[border="0"] > tr > th,
34
- table[border="0"] > tbody > tr > td, table[border="0"] > tbody > tr > th,
35
- table[border="0"] > thead > tr > td, table[border="0"] > thead > tr > th,
36
- table[border="0"] > tfoot > tr > td, table[border="0"] > tfoot > tr > th
37
- {
38
- border: #d3d3d3 1px dotted ;
39
- }
40
-
41
- /* For tables with no "border" attribute set */
42
- table:not([border]),
43
- table:not([border]) > tr > td, table:not([border]) > tr > th,
44
- table:not([border]) > tbody > tr > td, table:not([border]) > tbody > tr > th,
45
- table:not([border]) > thead > tr > td, table:not([border]) > thead > tr > th,
46
- table:not([border]) > tfoot > tr > td, table:not([border]) > tfoot > tr > th
47
- {
48
- border: #d3d3d3 1px dotted ;
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/css/images/block_address.png DELETED
Binary file
fckeditor/editor/css/images/block_blockquote.png DELETED
Binary file
fckeditor/editor/css/images/block_div.png DELETED
Binary file
fckeditor/editor/css/images/block_h1.png DELETED
Binary file
fckeditor/editor/css/images/block_h2.png DELETED
Binary file
fckeditor/editor/css/images/block_h3.png DELETED
Binary file
fckeditor/editor/css/images/block_h4.png DELETED
Binary file
fckeditor/editor/css/images/block_h5.png DELETED
Binary file
fckeditor/editor/css/images/block_h6.png DELETED
Binary file
fckeditor/editor/css/images/block_p.png DELETED
Binary file
fckeditor/editor/css/images/block_pre.png DELETED
Binary file
fckeditor/editor/css/images/fck_anchor.gif DELETED
Binary file
fckeditor/editor/css/images/fck_flashlogo.gif DELETED
Binary file
fckeditor/editor/css/images/fck_hiddenfield.gif DELETED
Binary file
fckeditor/editor/css/images/fck_pagebreak.gif DELETED
Binary file
fckeditor/editor/css/images/fck_plugin.gif DELETED
Binary file
fckeditor/editor/dialog/common/fck_dialog_common.css DELETED
@@ -1,85 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * This is the CSS file used for interface details in some dialog
22
- * windows.
23
- */
24
-
25
- /* #########
26
- * WARNING
27
- * #########
28
- * When changing this file, the minified version of it must be updated in the
29
- * fck_dialog_common.js file (see GetCommonDialogCss).
30
- */
31
-
32
- .ImagePreviewArea
33
- {
34
- border: #000000 1px solid;
35
- overflow: auto;
36
- width: 100%;
37
- height: 170px;
38
- background-color: #ffffff;
39
- }
40
-
41
- .FlashPreviewArea
42
- {
43
- border: #000000 1px solid;
44
- padding: 5px;
45
- overflow: auto;
46
- width: 100%;
47
- height: 170px;
48
- background-color: #ffffff;
49
- }
50
-
51
- .BtnReset
52
- {
53
- float: left;
54
- background-position: center center;
55
- background-image: url(images/reset.gif);
56
- width: 16px;
57
- height: 16px;
58
- background-repeat: no-repeat;
59
- border: 1px none;
60
- font-size: 1px ;
61
- }
62
-
63
- .BtnLocked, .BtnUnlocked
64
- {
65
- float: left;
66
- background-position: center center;
67
- background-image: url(images/locked.gif);
68
- width: 16px;
69
- height: 16px;
70
- background-repeat: no-repeat;
71
- border: none 1px;
72
- font-size: 1px ;
73
- }
74
-
75
- .BtnUnlocked
76
- {
77
- background-image: url(images/unlocked.gif);
78
- }
79
-
80
- .BtnOver
81
- {
82
- border: outset 1px;
83
- cursor: pointer;
84
- cursor: hand;
85
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/common/fck_dialog_common.js DELETED
@@ -1,347 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Useful functions used by almost all dialog window pages.
22
- * Dialogs should link to this file as the very first script on the page.
23
- */
24
-
25
- // Automatically detect the correct document.domain (#123).
26
- (function()
27
- {
28
- var d = document.domain ;
29
-
30
- while ( true )
31
- {
32
- // Test if we can access a parent property.
33
- try
34
- {
35
- var test = window.parent.document.domain ;
36
- break ;
37
- }
38
- catch( e ) {}
39
-
40
- // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
41
- d = d.replace( /.*?(?:\.|$)/, '' ) ;
42
-
43
- if ( d.length == 0 )
44
- break ; // It was not able to detect the domain.
45
-
46
- try
47
- {
48
- document.domain = d ;
49
- }
50
- catch (e)
51
- {
52
- break ;
53
- }
54
- }
55
- })() ;
56
-
57
- // Attention: FCKConfig must be available in the page.
58
- function GetCommonDialogCss( prefix )
59
- {
60
- // CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
61
- return FCKConfig.BasePath + 'dialog/common/' + '|.ImagePreviewArea{border:#000 1px solid;overflow:auto;width:100%;height:170px;background-color:#fff}.FlashPreviewArea{border:#000 1px solid;padding:5px;overflow:auto;width:100%;height:170px;background-color:#fff}.BtnReset{float:left;background-position:center center;background-image:url(images/reset.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px}.BtnLocked,.BtnUnlocked{float:left;background-position:center center;background-image:url(images/locked.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px}.BtnUnlocked{background-image:url(images/unlocked.gif)}.BtnOver{border:outset 1px;cursor:pointer;cursor:hand}' ;
62
- }
63
-
64
- // Gets a element by its Id. Used for shorter coding.
65
- function GetE( elementId )
66
- {
67
- return document.getElementById( elementId ) ;
68
- }
69
-
70
- function ShowE( element, isVisible )
71
- {
72
- if ( typeof( element ) == 'string' )
73
- element = GetE( element ) ;
74
- element.style.display = isVisible ? '' : 'none' ;
75
- }
76
-
77
- function SetAttribute( element, attName, attValue )
78
- {
79
- if ( attValue == null || attValue.length == 0 )
80
- element.removeAttribute( attName, 0 ) ; // 0 : Case Insensitive
81
- else
82
- element.setAttribute( attName, attValue, 0 ) ; // 0 : Case Insensitive
83
- }
84
-
85
- function GetAttribute( element, attName, valueIfNull )
86
- {
87
- var oAtt = element.attributes[attName] ;
88
-
89
- if ( oAtt == null || !oAtt.specified )
90
- return valueIfNull ? valueIfNull : '' ;
91
-
92
- var oValue = element.getAttribute( attName, 2 ) ;
93
-
94
- if ( oValue == null )
95
- oValue = oAtt.nodeValue ;
96
-
97
- return ( oValue == null ? valueIfNull : oValue ) ;
98
- }
99
-
100
- function SelectField( elementId )
101
- {
102
- var element = GetE( elementId ) ;
103
- element.focus() ;
104
-
105
- // element.select may not be available for some fields (like <select>).
106
- if ( element.select )
107
- element.select() ;
108
- }
109
-
110
- // Functions used by text fields to accept numbers only.
111
- var IsDigit = ( function()
112
- {
113
- var KeyIdentifierMap =
114
- {
115
- End : 35,
116
- Home : 36,
117
- Left : 37,
118
- Right : 39,
119
- 'U+00007F' : 46 // Delete
120
- } ;
121
-
122
- return function ( e )
123
- {
124
- if ( !e )
125
- e = event ;
126
-
127
- var iCode = ( e.keyCode || e.charCode ) ;
128
-
129
- if ( !iCode && e.keyIdentifier && ( e.keyIdentifier in KeyIdentifierMap ) )
130
- iCode = KeyIdentifierMap[ e.keyIdentifier ] ;
131
-
132
- return (
133
- ( iCode >= 48 && iCode <= 57 ) // Numbers
134
- || (iCode >= 35 && iCode <= 40) // Arrows, Home, End
135
- || iCode == 8 // Backspace
136
- || iCode == 46 // Delete
137
- || iCode == 9 // Tab
138
- ) ;
139
- }
140
- } )() ;
141
-
142
- String.prototype.Trim = function()
143
- {
144
- return this.replace( /(^\s*)|(\s*$)/g, '' ) ;
145
- }
146
-
147
- String.prototype.StartsWith = function( value )
148
- {
149
- return ( this.substr( 0, value.length ) == value ) ;
150
- }
151
-
152
- String.prototype.Remove = function( start, length )
153
- {
154
- var s = '' ;
155
-
156
- if ( start > 0 )
157
- s = this.substring( 0, start ) ;
158
-
159
- if ( start + length < this.length )
160
- s += this.substring( start + length , this.length ) ;
161
-
162
- return s ;
163
- }
164
-
165
- String.prototype.ReplaceAll = function( searchArray, replaceArray )
166
- {
167
- var replaced = this ;
168
-
169
- for ( var i = 0 ; i < searchArray.length ; i++ )
170
- {
171
- replaced = replaced.replace( searchArray[i], replaceArray[i] ) ;
172
- }
173
-
174
- return replaced ;
175
- }
176
-
177
- function OpenFileBrowser( url, width, height )
178
- {
179
- // oEditor must be defined.
180
-
181
- var iLeft = ( oEditor.FCKConfig.ScreenWidth - width ) / 2 ;
182
- var iTop = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ;
183
-
184
- var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes,scrollbars=yes" ;
185
- sOptions += ",width=" + width ;
186
- sOptions += ",height=" + height ;
187
- sOptions += ",left=" + iLeft ;
188
- sOptions += ",top=" + iTop ;
189
-
190
- window.open( url, 'FCKBrowseWindow', sOptions ) ;
191
- }
192
-
193
- /**
194
- Utility function to create/update an element with a name attribute in IE, so it behaves properly when moved around
195
- It also allows to change the name or other special attributes in an existing node
196
- oEditor : instance of FCKeditor where the element will be created
197
- oOriginal : current element being edited or null if it has to be created
198
- nodeName : string with the name of the element to create
199
- oAttributes : Hash object with the attributes that must be set at creation time in IE
200
- Those attributes will be set also after the element has been
201
- created for any other browser to avoid redudant code
202
- */
203
- function CreateNamedElement( oEditor, oOriginal, nodeName, oAttributes )
204
- {
205
- var oNewNode ;
206
-
207
- // IE doesn't allow easily to change properties of an existing object,
208
- // so remove the old and force the creation of a new one.
209
- var oldNode = null ;
210
- if ( oOriginal && oEditor.FCKBrowserInfo.IsIE )
211
- {
212
- // Force the creation only if some of the special attributes have changed:
213
- var bChanged = false;
214
- for( var attName in oAttributes )
215
- bChanged |= ( oOriginal.getAttribute( attName, 2) != oAttributes[attName] ) ;
216
-
217
- if ( bChanged )
218
- {
219
- oldNode = oOriginal ;
220
- oOriginal = null ;
221
- }
222
- }
223
-
224
- // If the node existed (and it's not IE), then we just have to update its attributes
225
- if ( oOriginal )
226
- {
227
- oNewNode = oOriginal ;
228
- }
229
- else
230
- {
231
- // #676, IE doesn't play nice with the name or type attribute
232
- if ( oEditor.FCKBrowserInfo.IsIE )
233
- {
234
- var sbHTML = [] ;
235
- sbHTML.push( '<' + nodeName ) ;
236
- for( var prop in oAttributes )
237
- {
238
- sbHTML.push( ' ' + prop + '="' + oAttributes[prop] + '"' ) ;
239
- }
240
- sbHTML.push( '>' ) ;
241
- if ( !oEditor.FCKListsLib.EmptyElements[nodeName.toLowerCase()] )
242
- sbHTML.push( '</' + nodeName + '>' ) ;
243
-
244
- oNewNode = oEditor.FCK.EditorDocument.createElement( sbHTML.join('') ) ;
245
- // Check if we are just changing the properties of an existing node: copy its properties
246
- if ( oldNode )
247
- {
248
- CopyAttributes( oldNode, oNewNode, oAttributes ) ;
249
- oEditor.FCKDomTools.MoveChildren( oldNode, oNewNode ) ;
250
- oldNode.parentNode.removeChild( oldNode ) ;
251
- oldNode = null ;
252
-
253
- if ( oEditor.FCK.Selection.SelectionData )
254
- {
255
- // Trick to refresh the selection object and avoid error in
256
- // fckdialog.html Selection.EnsureSelection
257
- var oSel = oEditor.FCK.EditorDocument.selection ;
258
- oEditor.FCK.Selection.SelectionData = oSel.createRange() ; // Now oSel.type will be 'None' reflecting the real situation
259
- }
260
- }
261
- oNewNode = oEditor.FCK.InsertElement( oNewNode ) ;
262
-
263
- // FCK.Selection.SelectionData is broken by now since we've
264
- // deleted the previously selected element. So we need to reassign it.
265
- if ( oEditor.FCK.Selection.SelectionData )
266
- {
267
- var range = oEditor.FCK.EditorDocument.body.createControlRange() ;
268
- range.add( oNewNode ) ;
269
- oEditor.FCK.Selection.SelectionData = range ;
270
- }
271
- }
272
- else
273
- {
274
- oNewNode = oEditor.FCK.InsertElement( nodeName ) ;
275
- }
276
- }
277
-
278
- // Set the basic attributes
279
- for( var attName in oAttributes )
280
- oNewNode.setAttribute( attName, oAttributes[attName], 0 ) ; // 0 : Case Insensitive
281
-
282
- return oNewNode ;
283
- }
284
-
285
- // Copy all the attributes from one node to the other, kinda like a clone
286
- // But oSkipAttributes is an object with the attributes that must NOT be copied
287
- function CopyAttributes( oSource, oDest, oSkipAttributes )
288
- {
289
- var aAttributes = oSource.attributes ;
290
-
291
- for ( var n = 0 ; n < aAttributes.length ; n++ )
292
- {
293
- var oAttribute = aAttributes[n] ;
294
-
295
- if ( oAttribute.specified )
296
- {
297
- var sAttName = oAttribute.nodeName ;
298
- // We can set the type only once, so do it with the proper value, not copying it.
299
- if ( sAttName in oSkipAttributes )
300
- continue ;
301
-
302
- var sAttValue = oSource.getAttribute( sAttName, 2 ) ;
303
- if ( sAttValue == null )
304
- sAttValue = oAttribute.nodeValue ;
305
-
306
- oDest.setAttribute( sAttName, sAttValue, 0 ) ; // 0 : Case Insensitive
307
- }
308
- }
309
- // The style:
310
- if ( oSource.style.cssText !== '' )
311
- oDest.style.cssText = oSource.style.cssText ;
312
- }
313
-
314
- /**
315
- * Replaces a tag with another one, keeping its contents:
316
- * for example TD --> TH, and TH --> TD.
317
- * input: the original node, and the new tag name
318
- * http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-renameNode
319
- */
320
- function RenameNode( oNode , newTag )
321
- {
322
- // TODO: if the browser natively supports document.renameNode call it.
323
- // does any browser currently support it in order to test?
324
-
325
- // Only rename element nodes.
326
- if ( oNode.nodeType != 1 )
327
- return null ;
328
-
329
- // If it's already correct exit here.
330
- if ( oNode.nodeName == newTag )
331
- return oNode ;
332
-
333
- var oDoc = oNode.ownerDocument ;
334
- // Create the new node
335
- var newNode = oDoc.createElement( newTag ) ;
336
-
337
- // Copy all attributes
338
- CopyAttributes( oNode, newNode, {} ) ;
339
-
340
- // Move children to the new node
341
- FCKDomTools.MoveChildren( oNode, newNode ) ;
342
-
343
- // Finally replace the node and return the new one
344
- oNode.parentNode.replaceChild( newNode, oNode ) ;
345
-
346
- return newNode ;
347
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/common/images/locked.gif DELETED
Binary file
fckeditor/editor/dialog/common/images/reset.gif DELETED
Binary file
fckeditor/editor/dialog/common/images/unlocked.gif DELETED
Binary file
fckeditor/editor/dialog/fck_about.html DELETED
@@ -1,161 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * "About" dialog window.
23
- -->
24
- <html xmlns="http://www.w3.org/1999/xhtml">
25
- <head>
26
- <title></title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta name="robots" content="noindex, nofollow" />
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
-
32
- var oEditor = window.parent.InnerDialogLoaded() ;
33
- var FCKLang = oEditor.FCKLang ;
34
-
35
- window.parent.AddTab( 'About', FCKLang.DlgAboutAboutTab ) ;
36
- window.parent.AddTab( 'License', FCKLang.DlgAboutLicenseTab ) ;
37
- window.parent.AddTab( 'BrowserInfo', FCKLang.DlgAboutBrowserInfoTab ) ;
38
-
39
- // Function called when a dialog tag is selected.
40
- function OnDialogTabChange( tabCode )
41
- {
42
- ShowE('divAbout', ( tabCode == 'About' ) ) ;
43
- ShowE('divLicense', ( tabCode == 'License' ) ) ;
44
- ShowE('divInfo' , ( tabCode == 'BrowserInfo' ) ) ;
45
- }
46
-
47
- function SendEMail()
48
- {
49
- var eMail = 'mailto:' ;
50
- eMail += 'fredck' ;
51
- eMail += '@' ;
52
- eMail += 'fckeditor' ;
53
- eMail += '.' ;
54
- eMail += 'net' ;
55
-
56
- window.location = eMail ;
57
- }
58
-
59
- window.onload = function()
60
- {
61
- // Translate the dialog box texts.
62
- oEditor.FCKLanguageManager.TranslatePage(document) ;
63
-
64
- window.parent.SetAutoSize( true ) ;
65
- }
66
-
67
- </script>
68
- </head>
69
- <body style="overflow: hidden">
70
- <div id="divAbout">
71
- <table cellpadding="0" cellspacing="0" border="0" width="100%" style="height: 100%">
72
- <tr>
73
- <td colspan="2">
74
- <img alt="" src="fck_about/logo_fckeditor.gif" width="236" height="41" align="left" />
75
- <table width="80" border="0" cellspacing="0" cellpadding="5" bgcolor="#ffffff" align="right">
76
- <tr>
77
- <td align="center" nowrap="nowrap" style="border-right: #000000 1px solid; border-top: #000000 1px solid;
78
- border-left: #000000 1px solid; border-bottom: #000000 1px solid">
79
- <span fcklang="DlgAboutVersion">version</span>
80
- <br />
81
- <b>2.6.4</b><br />
82
- Build 21629</td>
83
- </tr>
84
- </table>
85
- </td>
86
- </tr>
87
- <tr style="height: 100%">
88
- <td align="center" valign="middle">
89
- <span style="font-size: 14px" dir="ltr">
90
- <b><a href="http://www.fckeditor.net/?about" target="_blank" title="Visit the FCKeditor web site">
91
- Support <b>Open Source</b> Software</a></b> </span>
92
- <div style="padding-top:15px">
93
- <img alt="" src="fck_about/logo_fredck.gif" width="87" height="36" />
94
- </div>
95
- </td>
96
- <td align="center" nowrap="nowrap" valign="middle">
97
- <div>
98
- <div style="margin-bottom:5px" dir="ltr">Selected Sponsor</div>
99
- <a href="http://www.spellchecker.net/fckeditor/" target="_blank"><img alt="Selected Sponsor" border="0" src="fck_about/sponsors/spellchecker_net.gif" width="75" height="75" /></a>
100
- </div>
101
- </td>
102
- </tr>
103
- <tr>
104
- <td width="100%" nowrap="nowrap">
105
- <span fcklang="DlgAboutInfo">For further information go to</span> <a href="http://www.fckeditor.net/?About"
106
- target="_blank">http://www.fckeditor.net/</a>.
107
- <br />
108
- Copyright &copy; 2003-2009 <a href="#" onclick="SendEMail();">Frederico Caldeira Knabben</a>
109
- </td>
110
- <td align="center">
111
- <a href="http://www.fckeditor.net/sponsors/apply" target="_blank">Become a Sponsor</a>
112
- </td>
113
- </tr>
114
- </table>
115
- </div>
116
- <div id="divLicense" style="display: none">
117
- <p>
118
- Licensed under the terms of any of the following licenses at your
119
- choice:
120
- </p>
121
- <ul>
122
- <li style="margin-bottom:15px">
123
- <b>GNU General Public License</b> Version 2 or later (the "GPL")<br />
124
- <a href="http://www.gnu.org/licenses/gpl.html" target="_blank">http://www.gnu.org/licenses/gpl.html</a>
125
- </li>
126
- <li style="margin-bottom:15px">
127
- <b>GNU Lesser General Public License</b> Version 2.1 or later (the "LGPL")<br />
128
- <a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">http://www.gnu.org/licenses/lgpl.html</a>
129
- </li>
130
- <li>
131
- <b>Mozilla Public License</b> Version 1.1 or later (the "MPL")<br />
132
- <a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a>
133
- </li>
134
- </ul>
135
- </div>
136
- <div id="divInfo" style="display: none" dir="ltr">
137
- <table align="center" width="80%" border="0">
138
- <tr>
139
- <td>
140
- <script type="text/javascript">
141
- <!--
142
- document.write( '<b>User Agent<\/b><br />' + window.navigator.userAgent + '<br /><br />' ) ;
143
- document.write( '<b>Browser<\/b><br />' + window.navigator.appName + ' ' + window.navigator.appVersion + '<br /><br />' ) ;
144
- document.write( '<b>Platform<\/b><br />' + window.navigator.platform + '<br /><br />' ) ;
145
-
146
- var sUserLang = '?' ;
147
-
148
- if ( window.navigator.language )
149
- sUserLang = window.navigator.language.toLowerCase() ;
150
- else if ( window.navigator.userLanguage )
151
- sUserLang = window.navigator.userLanguage.toLowerCase() ;
152
-
153
- document.write( '<b>User Language<\/b><br />' + sUserLang ) ;
154
- //-->
155
- </script>
156
- </td>
157
- </tr>
158
- </table>
159
- </div>
160
- </body>
161
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_about/logo_fckeditor.gif DELETED
Binary file
fckeditor/editor/dialog/fck_about/logo_fredck.gif DELETED
Binary file
fckeditor/editor/dialog/fck_about/sponsors/spellchecker_net.gif DELETED
Binary file
fckeditor/editor/dialog/fck_anchor.html DELETED
@@ -1,220 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Anchor dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <title>Anchor Properties</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
- <meta content="noindex, nofollow" name="robots">
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
-
32
- var dialog = window.parent ;
33
- var oEditor = dialog.InnerDialogLoaded() ;
34
-
35
- var FCK = oEditor.FCK ;
36
- var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
37
- var FCKTools = oEditor.FCKTools ;
38
- var FCKRegexLib = oEditor.FCKRegexLib ;
39
-
40
- var oDOM = FCK.EditorDocument ;
41
-
42
- var oFakeImage = dialog.Selection.GetSelectedElement() ;
43
-
44
- var oAnchor ;
45
-
46
- if ( oFakeImage )
47
- {
48
- if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckanchor') )
49
- oAnchor = FCK.GetRealElement( oFakeImage ) ;
50
- else
51
- oFakeImage = null ;
52
- }
53
-
54
- //Search for a real anchor
55
- if ( !oFakeImage )
56
- {
57
- oAnchor = FCK.Selection.MoveToAncestorNode( 'A' ) ;
58
- if ( oAnchor )
59
- FCK.Selection.SelectNode( oAnchor ) ;
60
- }
61
-
62
- window.onload = function()
63
- {
64
- // First of all, translate the dialog box texts
65
- oEditor.FCKLanguageManager.TranslatePage(document) ;
66
-
67
- if ( oAnchor )
68
- GetE('txtName').value = oAnchor.name ;
69
- else
70
- oAnchor = null ;
71
-
72
- window.parent.SetOkButton( true ) ;
73
- window.parent.SetAutoSize( true ) ;
74
-
75
- SelectField( 'txtName' ) ;
76
- }
77
-
78
- function Ok()
79
- {
80
- var sNewName = GetE('txtName').value ;
81
-
82
- // Remove any illegal character in a name attribute:
83
- // A name should start with a letter, but the validator passes anyway.
84
- sNewName = sNewName.replace( /[^\w-_\.:]/g, '_' ) ;
85
-
86
- if ( sNewName.length == 0 )
87
- {
88
- // Remove the anchor if the user leaves the name blank
89
- if ( oAnchor )
90
- {
91
- // Removes the current anchor from the document using the new command
92
- FCK.Commands.GetCommand( 'AnchorDelete' ).Execute() ;
93
- return true ;
94
- }
95
-
96
- alert( oEditor.FCKLang.DlgAnchorErrorName ) ;
97
- return false ;
98
- }
99
-
100
- oEditor.FCKUndo.SaveUndoStep() ;
101
-
102
- if ( oAnchor ) // Modifying an existent anchor.
103
- {
104
- ReadjustLinksToAnchor( oAnchor.name, sNewName );
105
-
106
- // Buggy explorer, bad bad browser. http://alt-tag.com/blog/archives/2006/02/ie-dom-bugs/
107
- // Instead of just replacing the .name for the existing anchor (in order to preserve the content), we must remove the .name
108
- // and assign .name, although it won't appear until it's specially processed in fckxhtml.js
109
-
110
- // We remove the previous name
111
- oAnchor.removeAttribute( 'name' ) ;
112
- // Now we set it, but later we must process it specially
113
- oAnchor.name = sNewName ;
114
-
115
- return true ;
116
- }
117
-
118
- // Create a new anchor preserving the current selection
119
- var aNewAnchors = oEditor.FCK.CreateLink( '#' ) ;
120
-
121
- if ( aNewAnchors.length == 0 )
122
- aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ;
123
- else
124
- {
125
- // Remove the fake href
126
- for ( var i = 0 ; i < aNewAnchors.length ; i++ )
127
- aNewAnchors[i].removeAttribute( 'href' ) ;
128
- }
129
-
130
- // More than one anchors may have been created, so interact through all of them (see #220).
131
- for ( var i = 0 ; i < aNewAnchors.length ; i++ )
132
- {
133
- oAnchor = aNewAnchors[i] ;
134
-
135
- // Set the name
136
- if ( FCKBrowserInfo.IsIE )
137
- {
138
- // Setting anchor names directly in IE will trash the HTML code stored
139
- // in FCKTempBin after undos. See #2263.
140
- var replaceAnchor = oEditor.FCK.EditorDocument.createElement( '<a name="' +
141
- FCKTools.HTMLEncode( sNewName ).replace( '"', '&quot;' ) + '">' ) ;
142
- oEditor.FCKDomTools.MoveChildren( oAnchor, replaceAnchor ) ;
143
- oAnchor.parentNode.replaceChild( replaceAnchor, oAnchor ) ;
144
- oAnchor = replaceAnchor ;
145
- }
146
- else
147
- oAnchor.name = sNewName ;
148
-
149
- // IE does require special processing to show the Anchor's image
150
- // Opera doesn't allow to select empty anchors
151
- if ( FCKBrowserInfo.IsIE || FCKBrowserInfo.IsOpera )
152
- {
153
- if ( oAnchor.innerHTML != '' )
154
- {
155
- if ( FCKBrowserInfo.IsIE )
156
- oAnchor.className += ' FCK__AnchorC' ;
157
- }
158
- else
159
- {
160
- // Create a fake image for both IE and Opera
161
- var oImg = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oAnchor.cloneNode(true) ) ;
162
- oImg.setAttribute( '_fckanchor', 'true', 0 ) ;
163
-
164
- oAnchor.parentNode.insertBefore( oImg, oAnchor ) ;
165
- oAnchor.parentNode.removeChild( oAnchor ) ;
166
- }
167
-
168
- }
169
- }
170
-
171
- return true ;
172
- }
173
-
174
- // Checks all the links in the current page pointing to the current name and changes them to the new name
175
- function ReadjustLinksToAnchor( sCurrent, sNew )
176
- {
177
- var oDoc = FCK.EditorDocument ;
178
-
179
- var aLinks = oDoc.getElementsByTagName( 'A' ) ;
180
-
181
- var sReference = '#' + sCurrent ;
182
- // The url of the document, so we check absolute and partial references.
183
- var sFullReference = oDoc.location.href.replace( /(#.*$)/, '') ;
184
- sFullReference += sReference ;
185
-
186
- var oLink ;
187
- var i = aLinks.length - 1 ;
188
- while ( i >= 0 && ( oLink = aLinks[i--] ) )
189
- {
190
- var sHRef = oLink.getAttribute( '_fcksavedurl' ) ;
191
- if ( sHRef == null )
192
- sHRef = oLink.getAttribute( 'href' , 2 ) || '' ;
193
-
194
- if ( sHRef == sReference || sHRef == sFullReference )
195
- {
196
- oLink.href = '#' + sNew ;
197
- SetAttribute( oLink, '_fcksavedurl', '#' + sNew ) ;
198
- }
199
- }
200
- }
201
-
202
- </script>
203
- </head>
204
- <body style="overflow: hidden">
205
- <table height="100%" width="100%">
206
- <tr>
207
- <td align="center">
208
- <table border="0" cellpadding="0" cellspacing="0" width="80%">
209
- <tr>
210
- <td>
211
- <span fckLang="DlgAnchorName">Anchor Name</span><BR>
212
- <input id="txtName" style="WIDTH: 100%" type="text">
213
- </td>
214
- </tr>
215
- </table>
216
- </td>
217
- </tr>
218
- </table>
219
- </body>
220
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_button.html DELETED
@@ -1,104 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Button dialog window.
23
- -->
24
- <html xmlns="http://www.w3.org/1999/xhtml">
25
- <head>
26
- <title>Button Properties</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta content="noindex, nofollow" name="robots" />
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
-
32
- var dialog = window.parent ;
33
- var oEditor = dialog.InnerDialogLoaded() ;
34
-
35
- // Gets the document DOM
36
- var oDOM = oEditor.FCK.EditorDocument ;
37
-
38
- var oActiveEl = dialog.Selection.GetSelectedElement() ;
39
-
40
- window.onload = function()
41
- {
42
- // First of all, translate the dialog box texts
43
- oEditor.FCKLanguageManager.TranslatePage(document) ;
44
-
45
- if ( oActiveEl && oActiveEl.tagName.toUpperCase() == "INPUT" && ( oActiveEl.type == "button" || oActiveEl.type == "submit" || oActiveEl.type == "reset" ) )
46
- {
47
- GetE('txtName').value = oActiveEl.name ;
48
- GetE('txtValue').value = oActiveEl.value ;
49
- GetE('txtType').value = oActiveEl.type ;
50
- }
51
- else
52
- oActiveEl = null ;
53
-
54
- dialog.SetOkButton( true ) ;
55
- dialog.SetAutoSize( true ) ;
56
- SelectField( 'txtName' ) ;
57
- }
58
-
59
- function Ok()
60
- {
61
- oEditor.FCKUndo.SaveUndoStep() ;
62
-
63
- oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: GetE('txtType').value } ) ;
64
-
65
- SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
66
-
67
- return true ;
68
- }
69
-
70
- </script>
71
- </head>
72
- <body style="overflow: hidden">
73
- <table width="100%" style="height: 100%">
74
- <tr>
75
- <td align="center">
76
- <table border="0" cellpadding="0" cellspacing="0" width="80%">
77
- <tr>
78
- <td colspan="">
79
- <span fcklang="DlgCheckboxName">Name</span><br />
80
- <input type="text" size="20" id="txtName" style="width: 100%" />
81
- </td>
82
- </tr>
83
- <tr>
84
- <td>
85
- <span fcklang="DlgButtonText">Text (Value)</span><br />
86
- <input type="text" id="txtValue" style="width: 100%" />
87
- </td>
88
- </tr>
89
- <tr>
90
- <td>
91
- <span fcklang="DlgButtonType">Type</span><br />
92
- <select id="txtType">
93
- <option fcklang="DlgButtonTypeBtn" value="button" selected="selected">Button</option>
94
- <option fcklang="DlgButtonTypeSbm" value="submit">Submit</option>
95
- <option fcklang="DlgButtonTypeRst" value="reset">Reset</option>
96
- </select>
97
- </td>
98
- </tr>
99
- </table>
100
- </td>
101
- </tr>
102
- </table>
103
- </body>
104
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_checkbox.html DELETED
@@ -1,104 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Checkbox dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <title>Checkbox Properties</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
- <meta content="noindex, nofollow" name="robots">
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
-
32
- var dialog = window.parent ;
33
- var oEditor = dialog.InnerDialogLoaded() ;
34
-
35
- // Gets the document DOM
36
- var oDOM = oEditor.FCK.EditorDocument ;
37
-
38
- var oActiveEl = dialog.Selection.GetSelectedElement() ;
39
-
40
- window.onload = function()
41
- {
42
- // First of all, translate the dialog box texts
43
- oEditor.FCKLanguageManager.TranslatePage(document) ;
44
-
45
- if ( oActiveEl && oActiveEl.tagName == 'INPUT' && oActiveEl.type == 'checkbox' )
46
- {
47
- GetE('txtName').value = oActiveEl.name ;
48
- GetE('txtValue').value = oEditor.FCKBrowserInfo.IsIE ? oActiveEl.value : GetAttribute( oActiveEl, 'value' ) ;
49
- GetE('txtSelected').checked = oActiveEl.checked ;
50
- }
51
- else
52
- oActiveEl = null ;
53
-
54
- dialog.SetOkButton( true ) ;
55
- dialog.SetAutoSize( true ) ;
56
- SelectField( 'txtName' ) ;
57
- }
58
-
59
- function Ok()
60
- {
61
- oEditor.FCKUndo.SaveUndoStep() ;
62
-
63
- oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: 'checkbox' } ) ;
64
-
65
- if ( oEditor.FCKBrowserInfo.IsIE )
66
- oActiveEl.value = GetE('txtValue').value ;
67
- else
68
- SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
69
-
70
- var bIsChecked = GetE('txtSelected').checked ;
71
- SetAttribute( oActiveEl, 'checked', bIsChecked ? 'checked' : null ) ; // For Firefox
72
- oActiveEl.checked = bIsChecked ;
73
-
74
- return true ;
75
- }
76
-
77
- </script>
78
- </head>
79
- <body style="OVERFLOW: hidden" scroll="no">
80
- <table height="100%" width="100%">
81
- <tr>
82
- <td align="center">
83
- <table border="0" cellpadding="0" cellspacing="0" width="80%">
84
- <tr>
85
- <td>
86
- <span fckLang="DlgCheckboxName">Name</span><br>
87
- <input type="text" size="20" id="txtName" style="WIDTH: 100%">
88
- </td>
89
- </tr>
90
- <tr>
91
- <td>
92
- <span fckLang="DlgCheckboxValue">Value</span><br>
93
- <input type="text" size="20" id="txtValue" style="WIDTH: 100%">
94
- </td>
95
- </tr>
96
- <tr>
97
- <td><input type="checkbox" id="txtSelected"><label for="txtSelected" fckLang="DlgCheckboxSelected">Checked</label></td>
98
- </tr>
99
- </table>
100
- </td>
101
- </tr>
102
- </table>
103
- </body>
104
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_colorselector.html DELETED
@@ -1,172 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Color Selection dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
27
- <meta name="robots" content="noindex, nofollow" />
28
- <style TYPE="text/css">
29
- #ColorTable { cursor: pointer ; cursor: hand ; }
30
- #hicolor { height: 74px ; width: 74px ; border-width: 1px ; border-style: solid ; }
31
- #hicolortext { width: 75px ; text-align: right ; margin-bottom: 7px ; }
32
- #selhicolor { height: 20px ; width: 74px ; border-width: 1px ; border-style: solid ; }
33
- #selcolor { width: 75px ; height: 20px ; margin-top: 0px ; margin-bottom: 7px ; }
34
- #btnClear { width: 75px ; height: 22px ; margin-bottom: 6px ; }
35
- .ColorCell { height: 15px ; width: 15px ; }
36
- </style>
37
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
38
- <script type="text/javascript">
39
-
40
- var oEditor = window.parent.InnerDialogLoaded() ;
41
-
42
- function OnLoad()
43
- {
44
- // First of all, translate the dialog box texts
45
- oEditor.FCKLanguageManager.TranslatePage(document) ;
46
-
47
- CreateColorTable() ;
48
-
49
- window.parent.SetOkButton( true ) ;
50
- window.parent.SetAutoSize( true ) ;
51
- }
52
-
53
- function CreateColorTable()
54
- {
55
- // Get the target table.
56
- var oTable = document.getElementById('ColorTable') ;
57
-
58
- // Create the base colors array.
59
- var aColors = ['00','33','66','99','cc','ff'] ;
60
-
61
- // This function combines two ranges of three values from the color array into a row.
62
- function AppendColorRow( rangeA, rangeB )
63
- {
64
- for ( var i = rangeA ; i < rangeA + 3 ; i++ )
65
- {
66
- var oRow = oTable.insertRow(-1) ;
67
-
68
- for ( var j = rangeB ; j < rangeB + 3 ; j++ )
69
- {
70
- for ( var n = 0 ; n < 6 ; n++ )
71
- {
72
- AppendColorCell( oRow, '#' + aColors[j] + aColors[n] + aColors[i] ) ;
73
- }
74
- }
75
- }
76
- }
77
-
78
- // This function create a single color cell in the color table.
79
- function AppendColorCell( targetRow, color )
80
- {
81
- var oCell = targetRow.insertCell(-1) ;
82
- oCell.className = 'ColorCell' ;
83
- oCell.bgColor = color ;
84
-
85
- oCell.onmouseover = function()
86
- {
87
- document.getElementById('hicolor').style.backgroundColor = this.bgColor ;
88
- document.getElementById('hicolortext').innerHTML = this.bgColor ;
89
- }
90
-
91
- oCell.onclick = function()
92
- {
93
- document.getElementById('selhicolor').style.backgroundColor = this.bgColor ;
94
- document.getElementById('selcolor').value = this.bgColor ;
95
- }
96
- }
97
-
98
- AppendColorRow( 0, 0 ) ;
99
- AppendColorRow( 3, 0 ) ;
100
- AppendColorRow( 0, 3 ) ;
101
- AppendColorRow( 3, 3 ) ;
102
-
103
- // Create the last row.
104
- var oRow = oTable.insertRow(-1) ;
105
-
106
- // Create the gray scale colors cells.
107
- for ( var n = 0 ; n < 6 ; n++ )
108
- {
109
- AppendColorCell( oRow, '#' + aColors[n] + aColors[n] + aColors[n] ) ;
110
- }
111
-
112
- // Fill the row with black cells.
113
- for ( var i = 0 ; i < 12 ; i++ )
114
- {
115
- AppendColorCell( oRow, '#000000' ) ;
116
- }
117
- }
118
-
119
- function Clear()
120
- {
121
- document.getElementById('selhicolor').style.backgroundColor = '' ;
122
- document.getElementById('selcolor').value = '' ;
123
- }
124
-
125
- function ClearActual()
126
- {
127
- document.getElementById('hicolor').style.backgroundColor = '' ;
128
- document.getElementById('hicolortext').innerHTML = '&nbsp;' ;
129
- }
130
-
131
- function UpdateColor()
132
- {
133
- try { document.getElementById('selhicolor').style.backgroundColor = document.getElementById('selcolor').value ; }
134
- catch (e) { Clear() ; }
135
- }
136
-
137
- function Ok()
138
- {
139
- if ( typeof(window.parent.Args().CustomValue) == 'function' )
140
- window.parent.Args().CustomValue( document.getElementById('selcolor').value ) ;
141
-
142
- return true ;
143
- }
144
- </script>
145
- </head>
146
- <body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
147
- <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
148
- <tr>
149
- <td align="center" valign="middle">
150
- <table border="0" cellspacing="5" cellpadding="0" width="100%">
151
- <tr>
152
- <td valign="top" align="center" nowrap width="100%">
153
- <table id="ColorTable" border="0" cellspacing="0" cellpadding="0" width="270" onmouseout="ClearActual();">
154
- </table>
155
- </td>
156
- <td valign="top" align="left" nowrap>
157
- <span fckLang="DlgColorHighlight">Highlight</span>
158
- <div id="hicolor"></div>
159
- <div id="hicolortext">&nbsp;</div>
160
- <span fckLang="DlgColorSelected">Selected</span>
161
- <div id="selhicolor"></div>
162
- <input id="selcolor" type="text" maxlength="20" onchange="UpdateColor();">
163
- <br>
164
- <input id="btnClear" type="button" fckLang="DlgColorBtnClear" value="Clear" onclick="Clear();" />
165
- </td>
166
- </tr>
167
- </table>
168
- </td>
169
- </tr>
170
- </table>
171
- </body>
172
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_div.html DELETED
@@ -1,396 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Form dialog window.
23
- -->
24
- <html xmlns="http://www.w3.org/1999/xhtml">
25
- <head>
26
- <title></title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta content="noindex, nofollow" name="robots" />
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
- var dialog = window.parent ;
32
- var oEditor = dialog.InnerDialogLoaded() ;
33
- var FCK = oEditor.FCK ;
34
- var FCKLang = oEditor.FCKLang ;
35
- var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
36
- var FCKStyles = oEditor.FCKStyles ;
37
- var FCKElementPath = oEditor.FCKElementPath ;
38
- var FCKDomRange = oEditor.FCKDomRange ;
39
- var FCKDomTools = oEditor.FCKDomTools ;
40
- var FCKDomRangeIterator = oEditor.FCKDomRangeIterator ;
41
- var FCKListsLib = oEditor.FCKListsLib ;
42
- var AlwaysCreate = dialog.Args().CustomValue ;
43
-
44
- String.prototype.IEquals = function()
45
- {
46
- var thisUpper = this.toUpperCase() ;
47
-
48
- var aArgs = arguments ;
49
-
50
- // The arguments could also be a single array.
51
- if ( aArgs.length == 1 && aArgs[0].pop )
52
- aArgs = aArgs[0] ;
53
-
54
- for ( var i = 0 ; i < aArgs.length ; i++ )
55
- {
56
- if ( thisUpper == aArgs[i].toUpperCase() )
57
- return true ;
58
- }
59
- return false ;
60
- }
61
-
62
- var CurrentContainers = [] ;
63
- if ( !AlwaysCreate )
64
- {
65
- dialog.Selection.EnsureSelection() ;
66
- CurrentContainers = FCKDomTools.GetSelectedDivContainers() ;
67
- }
68
-
69
- // Add some tabs
70
- dialog.AddTab( 'General', FCKLang.DlgDivGeneralTab );
71
- dialog.AddTab( 'Advanced', FCKLang.DlgDivAdvancedTab ) ;
72
-
73
- function AddStyleOption( styleName )
74
- {
75
- var el = GetE( 'selStyle' ) ;
76
- var opt = document.createElement( 'option' ) ;
77
- opt.text = opt.value = styleName ;
78
-
79
- if ( FCKBrowserInfo.IsIE )
80
- el.add( opt ) ;
81
- else
82
- el.add( opt, null ) ;
83
- }
84
-
85
- function OnDialogTabChange( tabCode )
86
- {
87
- ShowE( 'divGeneral', tabCode == 'General' ) ;
88
- ShowE( 'divAdvanced', tabCode == 'Advanced' ) ;
89
- dialog.SetAutoSize( true ) ;
90
- }
91
-
92
- function GetNearestAncestorDirection( node )
93
- {
94
- var dir = 'ltr' ; // HTML default.
95
- while ( ( node = node.parentNode ) )
96
- {
97
- if ( node.dir )
98
- dir = node.dir ;
99
- }
100
- return dir ;
101
- }
102
-
103
- window.onload = function()
104
- {
105
- // First of all, translate the dialog box texts
106
- oEditor.FCKLanguageManager.TranslatePage(document) ;
107
-
108
- dialog.SetOkButton( true ) ;
109
- dialog.SetAutoSize( true ) ;
110
-
111
- // Popuplate the style menu
112
- var styles = FCKStyles.GetStyles() ;
113
- var selectableStyles = {} ;
114
- for ( var i in styles )
115
- {
116
- if ( ! /^_FCK_/.test( i ) && styles[i].Element == 'div' )
117
- selectableStyles[i] = styles[i] ;
118
- }
119
- if ( CurrentContainers.length <= 1 )
120
- {
121
- var target = CurrentContainers[0] ;
122
- var match = null ;
123
- for ( var i in selectableStyles )
124
- {
125
- if ( target && styles[i].CheckElementRemovable( target, true ) )
126
- match = i ;
127
- }
128
- if ( !match )
129
- AddStyleOption( "" ) ;
130
- for ( var i in selectableStyles )
131
- AddStyleOption( i ) ;
132
- if ( match )
133
- GetE( 'selStyle' ).value = match ;
134
-
135
- // Set the value for other inputs
136
- if ( target )
137
- {
138
- GetE( 'txtClass' ).value = target.className ;
139
- GetE( 'txtId' ).value = target.id ;
140
- GetE( 'txtLang' ).value = target.lang ;
141
- GetE( 'txtInlineStyle').value = target.style.cssText ;
142
- GetE( 'txtTitle' ).value = target.title ;
143
- GetE( 'selLangDir').value = target.dir || GetNearestAncestorDirection( target ) ;
144
- }
145
- }
146
- else
147
- {
148
- GetE( 'txtId' ).disabled = true ;
149
- AddStyleOption( "" ) ;
150
- for ( var i in selectableStyles )
151
- AddStyleOption( i ) ;
152
- }
153
- }
154
-
155
- function CreateDiv()
156
- {
157
- var newBlocks = [] ;
158
- var range = new FCKDomRange( FCK.EditorWindow ) ;
159
- range.MoveToSelection() ;
160
-
161
- var bookmark = range.CreateBookmark() ;
162
-
163
- // Kludge for #1592: if the bookmark nodes are in the beginning of
164
- // $tagName, then move them to the nearest block element in the
165
- // $tagName.
166
- if ( FCKBrowserInfo.IsIE )
167
- {
168
- var bStart = range.GetBookmarkNode( bookmark, true ) ;
169
- var bEnd = range.GetBookmarkNode( bookmark, false ) ;
170
-
171
- var cursor ;
172
-
173
- if ( bStart
174
- && bStart.parentNode.nodeName.IEquals( 'div' )
175
- && !bStart.previousSibling )
176
- {
177
- cursor = bStart ;
178
- while ( ( cursor = cursor.nextSibling ) )
179
- {
180
- if ( FCKListsLib.BlockElements[ cursor.nodeName.toLowerCase() ] )
181
- FCKDomTools.MoveNode( bStart, cursor, true ) ;
182
- }
183
- }
184
-
185
- if ( bEnd
186
- && bEnd.parentNode.nodeName.IEquals( 'div' )
187
- && !bEnd.previousSibling )
188
- {
189
- cursor = bEnd ;
190
- while ( ( cursor = cursor.nextSibling ) )
191
- {
192
- if ( FCKListsLib.BlockElements[ cursor.nodeName.toLowerCase() ] )
193
- {
194
- if ( cursor.firstChild == bStart )
195
- FCKDomTools.InsertAfterNode( bStart, bEnd ) ;
196
- else
197
- FCKDomTools.MoveNode( bEnd, cursor, true ) ;
198
- }
199
- }
200
- }
201
- }
202
-
203
- var iterator = new FCKDomRangeIterator( range ) ;
204
- var block ;
205
-
206
- var paragraphs = [] ;
207
- while ( ( block = iterator.GetNextParagraph() ) )
208
- paragraphs.push( block ) ;
209
-
210
- // Make sure all paragraphs have the same parent.
211
- var commonParent = paragraphs[0].parentNode ;
212
- var tmp = [] ;
213
- for ( var i = 0 ; i < paragraphs.length ; i++ )
214
- {
215
- block = paragraphs[i] ;
216
- commonParent = FCKDomTools.GetCommonParents( block.parentNode, commonParent ).pop() ;
217
- }
218
-
219
- // The common parent must not be the following tags: table, tbody, tr, ol, ul.
220
- while ( commonParent.nodeName.IEquals( 'table', 'tbody', 'tr', 'ol', 'ul' ) )
221
- commonParent = commonParent.parentNode ;
222
-
223
- // Reconstruct the block list to be processed such that all resulting blocks
224
- // satisfy parentNode == commonParent.
225
- var lastBlock = null ;
226
- while ( paragraphs.length > 0 )
227
- {
228
- block = paragraphs.shift() ;
229
- while ( block.parentNode != commonParent )
230
- block = block.parentNode ;
231
- if ( block != lastBlock )
232
- tmp.push( block ) ;
233
- lastBlock = block ;
234
- }
235
- paragraphs = tmp ;
236
-
237
- // Split the paragraphs into groups depending on their BlockLimit element.
238
- var groups = [] ;
239
- var lastBlockLimit = null ;
240
- for ( var i = 0 ; i < paragraphs.length ; i++ )
241
- {
242
- block = paragraphs[i] ;
243
- var elementPath = new FCKElementPath( block ) ;
244
- if ( elementPath.BlockLimit != lastBlockLimit )
245
- {
246
- groups.push( [] ) ;
247
- lastBlockLimit = elementPath.BlockLimit ;
248
- }
249
- groups[groups.length - 1].push( block ) ;
250
- }
251
-
252
- // Create a DIV container for each group.
253
- for ( var i = 0 ; i < groups.length ; i++ )
254
- {
255
- var divNode = FCK.EditorDocument.createElement( 'div' ) ;
256
- groups[i][0].parentNode.insertBefore( divNode, groups[i][0] ) ;
257
- for ( var j = 0 ; j < groups[i].length ; j++ )
258
- FCKDomTools.MoveNode( groups[i][j], divNode ) ;
259
- newBlocks.push( divNode ) ;
260
- }
261
-
262
- range.MoveToBookmark( bookmark ) ;
263
- range.Select() ;
264
-
265
- FCK.Focus() ;
266
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
267
-
268
- return newBlocks ;
269
- }
270
-
271
- function Ok()
272
- {
273
- oEditor.FCKUndo.SaveUndoStep() ;
274
-
275
- if ( CurrentContainers.length < 1 )
276
- CurrentContainers = CreateDiv();
277
-
278
- var setValue = function( attrName, inputName )
279
- {
280
- var val = GetE( inputName ).value ;
281
- for ( var i = 0 ; i < CurrentContainers.length ; i++ )
282
- {
283
- if ( val == '' )
284
- CurrentContainers[i].removeAttribute( attrName ) ;
285
- else
286
- CurrentContainers[i].setAttribute( attrName, val ) ;
287
- }
288
- }
289
-
290
- // Apply modifications to the DIV container according to dialog inputs.
291
- if ( CurrentContainers.length == 1 )
292
- {
293
- setValue( 'class', 'txtClass' ) ;
294
- setValue( 'id', 'txtId' ) ;
295
- }
296
- setValue( 'lang', 'txtLang' ) ;
297
- if ( FCKBrowserInfo.IsIE )
298
- {
299
- for ( var i = 0 ; i < CurrentContainers.length ; i++ )
300
- CurrentContainers[i].style.cssText = GetE( 'txtInlineStyle' ).value ;
301
- }
302
- else
303
- setValue( 'style', 'txtInlineStyle' ) ;
304
- setValue( 'title', 'txtTitle' ) ;
305
- for ( var i = 0 ; i < CurrentContainers.length ; i++ )
306
- {
307
- var dir = GetE( 'selLangDir' ).value ;
308
- var styleName = GetE( 'selStyle' ).value ;
309
- if ( GetNearestAncestorDirection( CurrentContainers[i] ) != dir )
310
- CurrentContainers[i].dir = dir ;
311
- else
312
- CurrentContainers[i].removeAttribute( 'dir' ) ;
313
-
314
- if ( styleName )
315
- FCKStyles.GetStyle( styleName ).ApplyToObject( CurrentContainers[i] ) ;
316
- }
317
-
318
- return true ;
319
- }
320
-
321
- </script>
322
- </head>
323
- <body style="overflow: hidden">
324
- <div id="divGeneral">
325
- <table cellspacing="0" cellpadding="0" width="100%" border="0">
326
- <colgroup span="2">
327
- <col width="49%" />
328
- <col width="2%" />
329
- <col width="49%" />
330
- </colgroup>
331
- <tr>
332
- <td>
333
- <span fcklang="DlgDivStyle">Style</span><br />
334
- <select id="selStyle" style="width: 100%;">
335
- </select>
336
- </td>
337
- <td>&nbsp;</td>
338
- <td>
339
- <span fcklang="DlgGenClass">Stylesheet Classes</span><br />
340
- <input id="txtClass" style="width: 100%" type="text" />
341
- </td>
342
- </tr>
343
- </table>
344
- </div>
345
- <div id="divAdvanced" style="display: none">
346
- <table cellspacing="0" cellpadding="0" width="100%" border="0">
347
- <colgroup span="2">
348
- <col width="49%" />
349
- <col width="2%" />
350
- <col width="49%" />
351
- </colgroup>
352
- <tr>
353
- <td>
354
- <span fcklang="DlgGenId">Id</span><br />
355
- <input style="width: 100%" type="text" id="txtId" />
356
- </td>
357
- <td>&nbsp;</td>
358
- <td>
359
- <span fcklang="DlgGenLangCode">Language Code</span><br />
360
- <input style="width: 100%" type="text" id="txtLang" />
361
- </td>
362
- </tr>
363
- <tr>
364
- <td colspan="3">&nbsp;</td>
365
- </tr>
366
- <tr>
367
- <td colspan="3">
368
- <span fcklang="DlgDivInlineStyle">Inline Style</span><br />
369
- <input style="width: 100%" type="text" id="txtInlineStyle" />
370
- </td>
371
- </tr>
372
- <tr>
373
- <td colspan="3">&nbsp;</td>
374
- </tr>
375
- <tr>
376
- <td colspan="3">
377
- <span fcklang="DlgGenTitle">Advisory Title</span><br />
378
- <input style="width: 100%" type="text" id="txtTitle" />
379
- </td>
380
- </tr>
381
- <tr>
382
- <td>&nbsp;</td>
383
- </tr>
384
- <tr>
385
- <td>
386
- <span fcklang="DlgGenLangDir">Language Direction</span><br />
387
- <select id="selLangDir">
388
- <option fcklang="DlgGenLangDirLtr" value="ltr">Left to Right (LTR)
389
- <option fcklang="DlgGenLangDirRtl" value="rtl">Right to Left (RTL)
390
- </select>
391
- </td>
392
- </tr>
393
- </table>
394
- </div>
395
- </body>
396
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_docprops.html DELETED
@@ -1,600 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Link dialog window.
23
- -->
24
- <html xmlns="http://www.w3.org/1999/xhtml">
25
- <head>
26
- <title></title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta content="noindex, nofollow" name="robots" />
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
-
32
- var oEditor = window.parent.InnerDialogLoaded() ;
33
- var FCK = oEditor.FCK ;
34
- var FCKLang = oEditor.FCKLang ;
35
- var FCKConfig = oEditor.FCKConfig ;
36
-
37
- //#### Dialog Tabs
38
-
39
- // Set the dialog tabs.
40
- window.parent.AddTab( 'General' , FCKLang.DlgDocGeneralTab ) ;
41
- window.parent.AddTab( 'Background' , FCKLang.DlgDocBackTab ) ;
42
- window.parent.AddTab( 'Colors' , FCKLang.DlgDocColorsTab ) ;
43
- window.parent.AddTab( 'Meta' , FCKLang.DlgDocMetaTab ) ;
44
-
45
- // Function called when a dialog tag is selected.
46
- function OnDialogTabChange( tabCode )
47
- {
48
- ShowE( 'divGeneral' , ( tabCode == 'General' ) ) ;
49
- ShowE( 'divBackground' , ( tabCode == 'Background' ) ) ;
50
- ShowE( 'divColors' , ( tabCode == 'Colors' ) ) ;
51
- ShowE( 'divMeta' , ( tabCode == 'Meta' ) ) ;
52
-
53
- ShowE( 'ePreview' , ( tabCode == 'Background' || tabCode == 'Colors' ) ) ;
54
- }
55
-
56
- //#### Get Base elements from the document: BEGIN
57
-
58
- // The HTML element of the document.
59
- var oHTML = FCK.EditorDocument.getElementsByTagName('html')[0] ;
60
-
61
- // The HEAD element of the document.
62
- var oHead = oHTML.getElementsByTagName('head')[0] ;
63
-
64
- var oBody = FCK.EditorDocument.body ;
65
-
66
- // This object contains all META tags defined in the document.
67
- var oMetaTags = new Object() ;
68
-
69
- // Get all META tags defined in the document.
70
- AppendMetaCollection( oMetaTags, oHead.getElementsByTagName('meta') ) ;
71
- AppendMetaCollection( oMetaTags, oHead.getElementsByTagName('fck:meta') ) ;
72
-
73
- function AppendMetaCollection( targetObject, metaCollection )
74
- {
75
- // Loop throw all METAs and put it in the HashTable.
76
- for ( var i = 0 ; i < metaCollection.length ; i++ )
77
- {
78
- // Try to get the "name" attribute.
79
- var sName = GetAttribute( metaCollection[i], 'name', GetAttribute( metaCollection[i], '___fcktoreplace:name', '' ) ) ;
80
-
81
- // If no "name", try with the "http-equiv" attribute.
82
- if ( sName.length == 0 )
83
- {
84
- if ( oEditor.FCKBrowserInfo.IsIE )
85
- {
86
- // Get the http-equiv value from the outerHTML.
87
- var oHttpEquivMatch = metaCollection[i].outerHTML.match( oEditor.FCKRegexLib.MetaHttpEquiv ) ;
88
- if ( oHttpEquivMatch )
89
- sName = oHttpEquivMatch[1] ;
90
- }
91
- else
92
- sName = GetAttribute( metaCollection[i], 'http-equiv', '' ) ;
93
- }
94
-
95
- if ( sName.length > 0 )
96
- targetObject[ sName.toLowerCase() ] = metaCollection[i] ;
97
- }
98
- }
99
-
100
- //#### END
101
-
102
- // Set a META tag in the document.
103
- function SetMetadata( name, content, isHttp )
104
- {
105
- if ( content.length == 0 )
106
- {
107
- RemoveMetadata( name ) ;
108
- return ;
109
- }
110
-
111
- var oMeta = oMetaTags[ name.toLowerCase() ] ;
112
-
113
- if ( !oMeta )
114
- {
115
- oMeta = oHead.appendChild( FCK.EditorDocument.createElement('META') ) ;
116
-
117
- if ( isHttp )
118
- SetAttribute( oMeta, 'http-equiv', name ) ;
119
- else
120
- {
121
- // On IE, it is not possible to set the "name" attribute of the META tag.
122
- // So a temporary attribute is used and it is replaced when getting the
123
- // editor's HTML/XHTML value. This is sad, I know :(
124
- if ( oEditor.FCKBrowserInfo.IsIE )
125
- SetAttribute( oMeta, '___fcktoreplace:name', name ) ;
126
- else
127
- SetAttribute( oMeta, 'name', name ) ;
128
- }
129
-
130
- oMetaTags[ name.toLowerCase() ] = oMeta ;
131
- }
132
-
133
- SetAttribute( oMeta, 'content', content ) ;
134
- // oMeta.content = content ;
135
- }
136
-
137
- function RemoveMetadata( name )
138
- {
139
- var oMeta = oMetaTags[ name.toLowerCase() ] ;
140
-
141
- if ( oMeta && oMeta != null )
142
- {
143
- oMeta.parentNode.removeChild( oMeta ) ;
144
- oMetaTags[ name.toLowerCase() ] = null ;
145
- }
146
- }
147
-
148
- function GetMetadata( name )
149
- {
150
- var oMeta = oMetaTags[ name.toLowerCase() ] ;
151
-
152
- if ( oMeta && oMeta != null )
153
- return oMeta.getAttribute( 'content', 2 ) ;
154
- else
155
- return '' ;
156
- }
157
-
158
- window.onload = function ()
159
- {
160
- // Show/Hide the "Browse Server" button.
161
- GetE('tdBrowse').style.display = oEditor.FCKConfig.ImageBrowser ? "" : "none";
162
-
163
- // First of all, translate the dialog box texts
164
- oEditor.FCKLanguageManager.TranslatePage( document ) ;
165
-
166
- FillFields() ;
167
-
168
- UpdatePreview() ;
169
-
170
- // Show the "Ok" button.
171
- window.parent.SetOkButton( true ) ;
172
-
173
- window.parent.SetAutoSize( true ) ;
174
- }
175
-
176
- function FillFields()
177
- {
178
- // ### General Info
179
- GetE('txtPageTitle').value = FCK.EditorDocument.title ;
180
-
181
- GetE('selDirection').value = GetAttribute( oHTML, 'dir', '' ) ;
182
- GetE('txtLang').value = GetAttribute( oHTML, 'xml:lang', GetAttribute( oHTML, 'lang', '' ) ) ; // "xml:lang" takes precedence to "lang".
183
-
184
- // Character Set Encoding.
185
- // if ( oEditor.FCKBrowserInfo.IsIE )
186
- // var sCharSet = FCK.EditorDocument.charset ;
187
- // else
188
- var sCharSet = GetMetadata( 'Content-Type' ) ;
189
-
190
- if ( sCharSet != null && sCharSet.length > 0 )
191
- {
192
- // if ( !oEditor.FCKBrowserInfo.IsIE )
193
- sCharSet = sCharSet.match( /[^=]*$/ ) ;
194
-
195
- GetE('selCharSet').value = sCharSet ;
196
-
197
- if ( GetE('selCharSet').selectedIndex == -1 )
198
- {
199
- GetE('selCharSet').value = '...' ;
200
- GetE('txtCustomCharSet').value = sCharSet ;
201
-
202
- CheckOther( GetE('selCharSet'), 'txtCustomCharSet' ) ;
203
- }
204
- }
205
-
206
- // Document Type.
207
- if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 )
208
- {
209
- GetE('selDocType').value = FCK.DocTypeDeclaration ;
210
-
211
- if ( GetE('selDocType').selectedIndex == -1 )
212
- {
213
- GetE('selDocType').value = '...' ;
214
- GetE('txtDocType').value = FCK.DocTypeDeclaration ;
215
-
216
- CheckOther( GetE('selDocType'), 'txtDocType' ) ;
217
- }
218
- }
219
-
220
- // Document Type.
221
- GetE('chkIncXHTMLDecl').checked = ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 ) ;
222
-
223
- // ### Background
224
- GetE('txtBackColor').value = GetAttribute( oBody, 'bgColor' , '' ) ;
225
- GetE('txtBackImage').value = GetAttribute( oBody, 'background' , '' ) ;
226
- GetE('chkBackNoScroll').checked = ( GetAttribute( oBody, 'bgProperties', '' ).toLowerCase() == 'fixed' ) ;
227
-
228
- // ### Colors
229
- GetE('txtColorText').value = GetAttribute( oBody, 'text' , '' ) ;
230
- GetE('txtColorLink').value = GetAttribute( oBody, 'link' , '' ) ;
231
- GetE('txtColorVisited').value = GetAttribute( oBody, 'vLink' , '' ) ;
232
- GetE('txtColorActive').value = GetAttribute( oBody, 'aLink' , '' ) ;
233
-
234
- // ### Margins
235
- GetE('txtMarginTop').value = GetAttribute( oBody, 'topMargin' , '' ) ;
236
- GetE('txtMarginLeft').value = GetAttribute( oBody, 'leftMargin' , '' ) ;
237
- GetE('txtMarginRight').value = GetAttribute( oBody, 'rightMargin' , '' ) ;
238
- GetE('txtMarginBottom').value = GetAttribute( oBody, 'bottomMargin' , '' ) ;
239
-
240
- // ### Meta Data
241
- GetE('txtMetaKeywords').value = GetMetadata( 'keywords' ) ;
242
- GetE('txtMetaDescription').value = GetMetadata( 'description' ) ;
243
- GetE('txtMetaAuthor').value = GetMetadata( 'author' ) ;
244
- GetE('txtMetaCopyright').value = GetMetadata( 'copyright' ) ;
245
- }
246
-
247
- // Called when the "Ok" button is clicked.
248
- function Ok()
249
- {
250
- // ### General Info
251
- FCK.EditorDocument.title = GetE('txtPageTitle').value ;
252
-
253
- var oHTML = FCK.EditorDocument.getElementsByTagName('html')[0] ;
254
-
255
- SetAttribute( oHTML, 'dir' , GetE('selDirection').value ) ;
256
- SetAttribute( oHTML, 'lang' , GetE('txtLang').value ) ;
257
- SetAttribute( oHTML, 'xml:lang' , GetE('txtLang').value ) ;
258
-
259
- // Character Set Enconding.
260
- var sCharSet = GetE('selCharSet').value ;
261
- if ( sCharSet == '...' )
262
- sCharSet = GetE('txtCustomCharSet').value ;
263
-
264
- if ( sCharSet.length > 0 )
265
- sCharSet = 'text/html; charset=' + sCharSet ;
266
-
267
- // if ( oEditor.FCKBrowserInfo.IsIE )
268
- // FCK.EditorDocument.charset = sCharSet ;
269
- // else
270
- SetMetadata( 'Content-Type', sCharSet, true ) ;
271
-
272
- // Document Type
273
- var sDocType = GetE('selDocType').value ;
274
- if ( sDocType == '...' )
275
- sDocType = GetE('txtDocType').value ;
276
-
277
- FCK.DocTypeDeclaration = sDocType ;
278
-
279
- // XHTML Declarations.
280
- if ( GetE('chkIncXHTMLDecl').checked )
281
- {
282
- if ( sCharSet.length == 0 )
283
- sCharSet = 'utf-8' ;
284
-
285
- FCK.XmlDeclaration = '<' + '?xml version="1.0" encoding="' + sCharSet + '"?>' ;
286
-
287
- SetAttribute( oHTML, 'xmlns', 'http://www.w3.org/1999/xhtml' ) ;
288
- }
289
- else
290
- {
291
- FCK.XmlDeclaration = null ;
292
- oHTML.removeAttribute( 'xmlns', 0 ) ;
293
- }
294
-
295
- // ### Background
296
- SetAttribute( oBody, 'bgcolor' , GetE('txtBackColor').value ) ;
297
- SetAttribute( oBody, 'background' , GetE('txtBackImage').value ) ;
298
- SetAttribute( oBody, 'bgproperties' , GetE('chkBackNoScroll').checked ? 'fixed' : '' ) ;
299
-
300
- // ### Colors
301
- SetAttribute( oBody, 'text' , GetE('txtColorText').value ) ;
302
- SetAttribute( oBody, 'link' , GetE('txtColorLink').value ) ;
303
- SetAttribute( oBody, 'vlink', GetE('txtColorVisited').value ) ;
304
- SetAttribute( oBody, 'alink', GetE('txtColorActive').value ) ;
305
-
306
- // ### Margins
307
- SetAttribute( oBody, 'topmargin' , GetE('txtMarginTop').value ) ;
308
- SetAttribute( oBody, 'leftmargin' , GetE('txtMarginLeft').value ) ;
309
- SetAttribute( oBody, 'rightmargin' , GetE('txtMarginRight').value ) ;
310
- SetAttribute( oBody, 'bottommargin' , GetE('txtMarginBottom').value ) ;
311
-
312
- // ### Meta data
313
- SetMetadata( 'keywords' , GetE('txtMetaKeywords').value ) ;
314
- SetMetadata( 'description' , GetE('txtMetaDescription').value ) ;
315
- SetMetadata( 'author' , GetE('txtMetaAuthor').value ) ;
316
- SetMetadata( 'copyright' , GetE('txtMetaCopyright').value ) ;
317
-
318
- return true ;
319
- }
320
-
321
- var bPreviewIsLoaded = false ;
322
- var oPreviewWindow ;
323
- var oPreviewBody ;
324
-
325
- // Called by the Preview page when loaded.
326
- function OnPreviewLoad( previewWindow, previewBody )
327
- {
328
- oPreviewWindow = previewWindow ;
329
- oPreviewBody = previewBody ;
330
-
331
- bPreviewIsLoaded = true ;
332
- UpdatePreview() ;
333
- }
334
-
335
- function UpdatePreview()
336
- {
337
- if ( !bPreviewIsLoaded )
338
- return ;
339
-
340
- // ### Background
341
- SetAttribute( oPreviewBody, 'bgcolor' , GetE('txtBackColor').value ) ;
342
- SetAttribute( oPreviewBody, 'background' , GetE('txtBackImage').value ) ;
343
- SetAttribute( oPreviewBody, 'bgproperties' , GetE('chkBackNoScroll').checked ? 'fixed' : '' ) ;
344
-
345
- // ### Colors
346
- SetAttribute( oPreviewBody, 'text', GetE('txtColorText').value ) ;
347
-
348
- oPreviewWindow.SetLinkColor( GetE('txtColorLink').value ) ;
349
- oPreviewWindow.SetVisitedColor( GetE('txtColorVisited').value ) ;
350
- oPreviewWindow.SetActiveColor( GetE('txtColorActive').value ) ;
351
- }
352
-
353
- function CheckOther( combo, txtField )
354
- {
355
- var bNotOther = ( combo.value != '...' ) ;
356
-
357
- GetE(txtField).style.backgroundColor = ( bNotOther ? '#cccccc' : '' ) ;
358
- GetE(txtField).disabled = bNotOther ;
359
- }
360
-
361
- function SetColor( inputId, color )
362
- {
363
- GetE( inputId ).value = color + '' ;
364
- UpdatePreview() ;
365
- }
366
-
367
- function SelectBackColor( color ) { SetColor('txtBackColor', color ) ; }
368
- function SelectColorText( color ) { SetColor('txtColorText', color ) ; }
369
- function SelectColorLink( color ) { SetColor('txtColorLink', color ) ; }
370
- function SelectColorVisited( color ) { SetColor('txtColorVisited', color ) ; }
371
- function SelectColorActive( color ) { SetColor('txtColorActive', color ) ; }
372
-
373
- function SelectColor( wich )
374
- {
375
- switch ( wich )
376
- {
377
- case 'Back' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectBackColor, window ) ; return ;
378
- case 'ColorText' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorText, window ) ; return ;
379
- case 'ColorLink' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorLink, window ) ; return ;
380
- case 'ColorVisited' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorVisited, window ) ; return ;
381
- case 'ColorActive' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorActive, window ) ; return ;
382
- }
383
- }
384
-
385
- function BrowseServerBack()
386
- {
387
- OpenFileBrowser( FCKConfig.ImageBrowserURL, FCKConfig.ImageBrowserWindowWidth, FCKConfig.ImageBrowserWindowHeight ) ;
388
- }
389
-
390
- function SetUrl( url )
391
- {
392
- GetE('txtBackImage').value = url ;
393
- UpdatePreview() ;
394
- }
395
-
396
- </script>
397
- </head>
398
- <body style="overflow: hidden">
399
- <table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 100%">
400
- <tr>
401
- <td valign="top" style="height: 100%">
402
- <div id="divGeneral">
403
- <span fcklang="DlgDocPageTitle">Page Title</span><br />
404
- <input id="txtPageTitle" style="width: 100%" type="text" />
405
- <br />
406
- <table cellspacing="0" cellpadding="0" border="0">
407
- <tr>
408
- <td>
409
- <span fcklang="DlgDocLangDir">Language Direction</span><br />
410
- <select id="selDirection">
411
- <option value="" selected="selected"></option>
412
- <option value="ltr" fcklang="DlgDocLangDirLTR">Left to Right (LTR)</option>
413
- <option value="rtl" fcklang="DlgDocLangDirRTL">Right to Left (RTL)</option>
414
- </select>
415
- </td>
416
- <td>
417
- &nbsp;&nbsp;&nbsp;</td>
418
- <td>
419
- <span fcklang="DlgDocLangCode">Language Code</span><br />
420
- <input id="txtLang" type="text" />
421
- </td>
422
- </tr>
423
- </table>
424
- <br />
425
- <table cellspacing="0" cellpadding="0" width="100%" border="0">
426
- <tr>
427
- <td style="white-space: nowrap">
428
- <span fcklang="DlgDocCharSet">Character Set Encoding</span><br />
429
- <select id="selCharSet" onchange="CheckOther( this, 'txtCustomCharSet' );">
430
- <option value="" selected="selected"></option>
431
- <option value="us-ascii">ASCII</option>
432
- <option fcklang="DlgDocCharSetCE" value="iso-8859-2">Central European</option>
433
- <option fcklang="DlgDocCharSetCT" value="big5">Chinese Traditional (Big5)</option>
434
- <option fcklang="DlgDocCharSetCR" value="iso-8859-5">Cyrillic</option>
435
- <option fcklang="DlgDocCharSetGR" value="iso-8859-7">Greek</option>
436
- <option fcklang="DlgDocCharSetJP" value="iso-2022-jp">Japanese</option>
437
- <option fcklang="DlgDocCharSetKR" value="iso-2022-kr">Korean</option>
438
- <option fcklang="DlgDocCharSetTR" value="iso-8859-9">Turkish</option>
439
- <option fcklang="DlgDocCharSetUN" value="utf-8">Unicode (UTF-8)</option>
440
- <option fcklang="DlgDocCharSetWE" value="iso-8859-1">Western European</option>
441
- <option fcklang="DlgOpOther" value="...">&lt;Other&gt;</option>
442
- </select>
443
- </td>
444
- <td>
445
- &nbsp;&nbsp;&nbsp;</td>
446
- <td width="100%">
447
- <span fcklang="DlgDocCharSetOther">Other Character Set Encoding</span><br />
448
- <input id="txtCustomCharSet" style="width: 100%; background-color: #cccccc" disabled="disabled"
449
- type="text" />
450
- </td>
451
- </tr>
452
- <tr>
453
- <td colspan="3">
454
- &nbsp;</td>
455
- </tr>
456
- <tr>
457
- <td nowrap="nowrap">
458
- <span fcklang="DlgDocDocType">Document Type Heading</span><br />
459
- <select id="selDocType" onchange="CheckOther( this, 'txtDocType' );">
460
- <option value="" selected="selected"></option>
461
- <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'>HTML
462
- 4.01 Transitional</option>
463
- <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'>
464
- HTML 4.01 Strict</option>
465
- <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'>
466
- HTML 4.01 Frameset</option>
467
- <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>
468
- XHTML 1.0 Transitional</option>
469
- <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'>
470
- XHTML 1.0 Strict</option>
471
- <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'>
472
- XHTML 1.0 Frameset</option>
473
- <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'>
474
- XHTML 1.1</option>
475
- <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'>HTML 3.2</option>
476
- <option value='<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">'>HTML 2.0</option>
477
- <option value="..." fcklang="DlgOpOther">&lt;Other&gt;</option>
478
- </select>
479
- </td>
480
- <td>
481
- </td>
482
- <td width="100%">
483
- <span fcklang="DlgDocDocTypeOther">Other Document Type Heading</span><br />
484
- <input id="txtDocType" style="width: 100%; background-color: #cccccc" disabled="disabled"
485
- type="text" />
486
- </td>
487
- </tr>
488
- </table>
489
- <br />
490
- <input id="chkIncXHTMLDecl" type="checkbox" />
491
- <label for="chkIncXHTMLDecl" fcklang="DlgDocIncXHTML">
492
- Include XHTML Declarations</label>
493
- </div>
494
- <div id="divBackground" style="display: none">
495
- <span fcklang="DlgDocBgColor">Background Color</span><br />
496
- <input id="txtBackColor" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" />&nbsp;<input
497
- id="btnSelBackColor" onclick="SelectColor( 'Back' )" type="button" value="Select..."
498
- fcklang="DlgCellBtnSelect" /><br />
499
- <br />
500
- <span fcklang="DlgDocBgImage">Background Image URL</span><br />
501
- <table cellspacing="0" cellpadding="0" width="100%" border="0">
502
- <tr>
503
- <td width="100%">
504
- <input id="txtBackImage" style="width: 100%" type="text" onchange="UpdatePreview();"
505
- onkeyup="UpdatePreview();" /></td>
506
- <td id="tdBrowse" nowrap="nowrap">
507
- &nbsp;<input id="btnBrowse" onclick="BrowseServerBack();" type="button" fcklang="DlgBtnBrowseServer"
508
- value="Browse Server" /></td>
509
- </tr>
510
- </table>
511
- <input id="chkBackNoScroll" type="checkbox" onclick="UpdatePreview();" />
512
- <label for="chkBackNoScroll" fcklang="DlgDocBgNoScroll">
513
- Nonscrolling Background</label>
514
- </div>
515
- <div id="divColors" style="display: none">
516
- <table cellspacing="0" cellpadding="0" width="100%" border="0">
517
- <tr>
518
- <td>
519
- <span fcklang="DlgDocCText">Text</span><br />
520
- <input id="txtColorText" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
521
- onclick="SelectColor( 'ColorText' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
522
- <br />
523
- <span fcklang="DlgDocCLink">Link</span><br />
524
- <input id="txtColorLink" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
525
- onclick="SelectColor( 'ColorLink' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
526
- <br />
527
- <span fcklang="DlgDocCVisited">Visited Link</span><br />
528
- <input id="txtColorVisited" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
529
- onclick="SelectColor( 'ColorVisited' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
530
- <br />
531
- <span fcklang="DlgDocCActive">Active Link</span><br />
532
- <input id="txtColorActive" type="text" onchange="UpdatePreview();" onkeyup="UpdatePreview();" /><input
533
- onclick="SelectColor( 'ColorActive' )" type="button" value="Select..." fcklang="DlgCellBtnSelect" />
534
- </td>
535
- <td valign="middle" align="center">
536
- <table cellspacing="2" cellpadding="0" border="0">
537
- <tr>
538
- <td>
539
- <span fcklang="DlgDocMargins">Page Margins</span></td>
540
- </tr>
541
- <tr>
542
- <td style="border: #000000 1px solid; padding: 5px">
543
- <table cellpadding="0" cellspacing="0" border="0" dir="ltr">
544
- <tr>
545
- <td align="center" colspan="3">
546
- <span fcklang="DlgDocMaTop">Top</span><br />
547
- <input id="txtMarginTop" type="text" size="3" />
548
- </td>
549
- </tr>
550
- <tr>
551
- <td align="left">
552
- <span fcklang="DlgDocMaLeft">Left</span><br />
553
- <input id="txtMarginLeft" type="text" size="3" />
554
- </td>
555
- <td>
556
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
557
- <td align="right">
558
- <span fcklang="DlgDocMaRight">Right</span><br />
559
- <input id="txtMarginRight" type="text" size="3" />
560
- </td>
561
- </tr>
562
- <tr>
563
- <td align="center" colspan="3">
564
- <span fcklang="DlgDocMaBottom">Bottom</span><br />
565
- <input id="txtMarginBottom" type="text" size="3" />
566
- </td>
567
- </tr>
568
- </table>
569
- </td>
570
- </tr>
571
- </table>
572
- </td>
573
- </tr>
574
- </table>
575
- </div>
576
- <div id="divMeta" style="display: none">
577
- <span fcklang="DlgDocMeIndex">Document Indexing Keywords (comma separated)</span><br />
578
- <textarea id="txtMetaKeywords" style="width: 100%" rows="2" cols="20"></textarea>
579
- <br />
580
- <span fcklang="DlgDocMeDescr">Document Description</span><br />
581
- <textarea id="txtMetaDescription" style="width: 100%" rows="4" cols="20"></textarea>
582
- <br />
583
- <span fcklang="DlgDocMeAuthor">Author</span><br />
584
- <input id="txtMetaAuthor" style="width: 100%" type="text" /><br />
585
- <br />
586
- <span fcklang="DlgDocMeCopy">Copyright</span><br />
587
- <input id="txtMetaCopyright" type="text" style="width: 100%" />
588
- </div>
589
- </td>
590
- </tr>
591
- <tr id="ePreview" style="display: none">
592
- <td>
593
- <span fcklang="DlgDocPreview">Preview</span><br />
594
- <iframe id="frmPreview" src="fck_docprops/fck_document_preview.html" width="100%"
595
- height="100"></iframe>
596
- </td>
597
- </tr>
598
- </table>
599
- </body>
600
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_docprops/fck_document_preview.html DELETED
@@ -1,113 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Preview shown in the "Document Properties" dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <title>Document Properties - Preview</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
- <meta name="robots" content="noindex, nofollow">
29
- <script language="javascript">
30
-
31
- var eBase = parent.FCK.EditorDocument.getElementsByTagName( 'BASE' ) ;
32
- if ( eBase.length > 0 && eBase[0].href.length > 0 )
33
- {
34
- document.write( '<base href="' + eBase[0].href + '">' ) ;
35
- }
36
-
37
- window.onload = function()
38
- {
39
- if ( typeof( parent.OnPreviewLoad ) == 'function' )
40
- parent.OnPreviewLoad( window, document.body ) ;
41
- }
42
-
43
- function SetBaseHRef( baseHref )
44
- {
45
- var eBase = document.createElement( 'BASE' ) ;
46
- eBase.href = baseHref ;
47
-
48
- var eHead = document.getElementsByTagName( 'HEAD' )[0] ;
49
- eHead.appendChild( eBase ) ;
50
- }
51
-
52
- function SetLinkColor( color )
53
- {
54
- if ( color && color.length > 0 )
55
- document.getElementById('eLink').style.color = color ;
56
- else
57
- document.getElementById('eLink').style.color = window.document.linkColor ;
58
- }
59
-
60
- function SetVisitedColor( color )
61
- {
62
- if ( color && color.length > 0 )
63
- document.getElementById('eVisited').style.color = color ;
64
- else
65
- document.getElementById('eVisited').style.color = window.document.vlinkColor ;
66
- }
67
-
68
- function SetActiveColor( color )
69
- {
70
- if ( color && color.length > 0 )
71
- document.getElementById('eActive').style.color = color ;
72
- else
73
- document.getElementById('eActive').style.color = window.document.alinkColor ;
74
- }
75
- </script>
76
- </head>
77
- <body>
78
- <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
79
- <tr>
80
- <td align="center" valign="middle">
81
- Normal Text
82
- </td>
83
- <td id="eLink" align="center" valign="middle">
84
- <u>Link Text</u>
85
- </td>
86
- </tr>
87
- <tr>
88
- <td id="eVisited" valign="middle" align="center">
89
- <u>Visited Link</u>
90
- </td>
91
- <td id="eActive" valign="middle" align="center">
92
- <u>Active Link</u>
93
- </td>
94
- </tr>
95
- </table>
96
- <br>
97
- <br>
98
- <br>
99
- <br>
100
- <br>
101
- <br>
102
- <br>
103
- <br>
104
- <br>
105
- <br>
106
- <br>
107
- <br>
108
- <br>
109
- <br>
110
- <br>
111
- <br>
112
- </body>
113
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_flash.html DELETED
@@ -1,152 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Flash Properties dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <title>Flash Properties</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
- <meta content="noindex, nofollow" name="robots">
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script src="fck_flash/fck_flash.js" type="text/javascript"></script>
31
- <script type="text/javascript">
32
-
33
- document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
34
-
35
- </script>
36
- </head>
37
- <body scroll="no" style="OVERFLOW: hidden">
38
- <div id="divInfo">
39
- <table cellSpacing="1" cellPadding="1" width="100%" border="0">
40
- <tr>
41
- <td>
42
- <table cellSpacing="0" cellPadding="0" width="100%" border="0">
43
- <tr>
44
- <td width="100%"><span fckLang="DlgImgURL">URL</span>
45
- </td>
46
- <td id="tdBrowse" style="DISPLAY: none" noWrap rowSpan="2">&nbsp; <input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server" fckLang="DlgBtnBrowseServer">
47
- </td>
48
- </tr>
49
- <tr>
50
- <td vAlign="top"><input id="txtUrl" onblur="UpdatePreview();" style="WIDTH: 100%" type="text">
51
- </td>
52
- </tr>
53
- </table>
54
- </td>
55
- </tr>
56
- <TR>
57
- <TD>
58
- <table cellSpacing="0" cellPadding="0" border="0">
59
- <TR>
60
- <TD nowrap>
61
- <span fckLang="DlgImgWidth">Width</span><br>
62
- <input id="txtWidth" onkeypress="return IsDigit(event);" type="text" size="3">
63
- </TD>
64
- <TD>&nbsp;</TD>
65
- <TD>
66
- <span fckLang="DlgImgHeight">Height</span><br>
67
- <input id="txtHeight" onkeypress="return IsDigit(event);" type="text" size="3">
68
- </TD>
69
- </TR>
70
- </table>
71
- </TD>
72
- </TR>
73
- <tr>
74
- <td vAlign="top">
75
- <table cellSpacing="0" cellPadding="0" width="100%" border="0">
76
- <tr>
77
- <td valign="top" width="100%">
78
- <table cellSpacing="0" cellPadding="0" width="100%">
79
- <tr>
80
- <td><span fckLang="DlgImgPreview">Preview</span></td>
81
- </tr>
82
- <tr>
83
- <td id="ePreviewCell" valign="top" class="FlashPreviewArea"><iframe src="fck_flash/fck_flash_preview.html" frameborder="0" marginheight="0" marginwidth="0"></iframe></td>
84
- </tr>
85
- </table>
86
- </td>
87
- </tr>
88
- </table>
89
- </td>
90
- </tr>
91
- </table>
92
- </div>
93
- <div id="divUpload" style="DISPLAY: none">
94
- <form id="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data" action="" onsubmit="return CheckUpload();">
95
- <span fckLang="DlgLnkUpload">Upload</span><br />
96
- <input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
97
- <br />
98
- <input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
99
- <script type="text/javascript">
100
- document.write( '<iframe name="UploadWindow" style="DISPLAY: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
101
- </script>
102
- </form>
103
- </div>
104
- <div id="divAdvanced" style="DISPLAY: none">
105
- <TABLE cellSpacing="0" cellPadding="0" border="0">
106
- <TR>
107
- <TD nowrap>
108
- <span fckLang="DlgFlashScale">Scale</span><BR>
109
- <select id="cmbScale">
110
- <option value="" selected></option>
111
- <option value="showall" fckLang="DlgFlashScaleAll">Show all</option>
112
- <option value="noborder" fckLang="DlgFlashScaleNoBorder">No Border</option>
113
- <option value="exactfit" fckLang="DlgFlashScaleFit">Exact Fit</option>
114
- </select></TD>
115
- <TD>&nbsp;&nbsp;&nbsp; &nbsp;
116
- </TD>
117
- <td valign="bottom">
118
- <table>
119
- <tr>
120
- <td><input id="chkAutoPlay" type="checkbox" checked></td>
121
- <td><label for="chkAutoPlay" nowrap fckLang="DlgFlashChkPlay">Auto Play</label>&nbsp;&nbsp;</td>
122
- <td><input id="chkLoop" type="checkbox" checked></td>
123
- <td><label for="chkLoop" nowrap fckLang="DlgFlashChkLoop">Loop</label>&nbsp;&nbsp;</td>
124
- <td><input id="chkMenu" type="checkbox" checked></td>
125
- <td><label for="chkMenu" nowrap fckLang="DlgFlashChkMenu">Enable Flash Menu</label></td>
126
- </tr>
127
- </table>
128
- </td>
129
- </TR>
130
- </TABLE>
131
- <br>
132
- &nbsp;
133
- <table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
134
- <tr>
135
- <td vAlign="top" width="50%"><span fckLang="DlgGenId">Id</span><br>
136
- <input id="txtAttId" style="WIDTH: 100%" type="text">
137
- </td>
138
- <td>&nbsp;&nbsp;</td>
139
- <td vAlign="top" nowrap><span fckLang="DlgGenClass">Stylesheet Classes</span><br>
140
- <input id="txtAttClasses" style="WIDTH: 100%" type="text">
141
- </td>
142
- <td>&nbsp;&nbsp;</td>
143
- <td vAlign="top" nowrap width="50%">&nbsp;<span fckLang="DlgGenTitle">Advisory Title</span><br>
144
- <input id="txtAttTitle" style="WIDTH: 100%" type="text">
145
- </td>
146
- </tr>
147
- </table>
148
- <span fckLang="DlgGenStyle">Style</span><br>
149
- <input id="txtAttStyle" style="WIDTH: 100%" type="text">
150
- </div>
151
- </body>
152
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_flash/fck_flash.js DELETED
@@ -1,300 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Scripts related to the Flash dialog window (see fck_flash.html).
22
- */
23
-
24
- var dialog = window.parent ;
25
- var oEditor = dialog.InnerDialogLoaded() ;
26
- var FCK = oEditor.FCK ;
27
- var FCKLang = oEditor.FCKLang ;
28
- var FCKConfig = oEditor.FCKConfig ;
29
- var FCKTools = oEditor.FCKTools ;
30
-
31
- //#### Dialog Tabs
32
-
33
- // Set the dialog tabs.
34
- dialog.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ;
35
-
36
- if ( FCKConfig.FlashUpload )
37
- dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ;
38
-
39
- if ( !FCKConfig.FlashDlgHideAdvanced )
40
- dialog.AddTab( 'Advanced', oEditor.FCKLang.DlgAdvancedTag ) ;
41
-
42
- // Function called when a dialog tag is selected.
43
- function OnDialogTabChange( tabCode )
44
- {
45
- ShowE('divInfo' , ( tabCode == 'Info' ) ) ;
46
- ShowE('divUpload' , ( tabCode == 'Upload' ) ) ;
47
- ShowE('divAdvanced' , ( tabCode == 'Advanced' ) ) ;
48
- }
49
-
50
- // Get the selected flash embed (if available).
51
- var oFakeImage = dialog.Selection.GetSelectedElement() ;
52
- var oEmbed ;
53
-
54
- if ( oFakeImage )
55
- {
56
- if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckflash') )
57
- oEmbed = FCK.GetRealElement( oFakeImage ) ;
58
- else
59
- oFakeImage = null ;
60
- }
61
-
62
- window.onload = function()
63
- {
64
- // Translate the dialog box texts.
65
- oEditor.FCKLanguageManager.TranslatePage(document) ;
66
-
67
- // Load the selected element information (if any).
68
- LoadSelection() ;
69
-
70
- // Show/Hide the "Browse Server" button.
71
- GetE('tdBrowse').style.display = FCKConfig.FlashBrowser ? '' : 'none' ;
72
-
73
- // Set the actual uploader URL.
74
- if ( FCKConfig.FlashUpload )
75
- GetE('frmUpload').action = FCKConfig.FlashUploadURL ;
76
-
77
- dialog.SetAutoSize( true ) ;
78
-
79
- // Activate the "OK" button.
80
- dialog.SetOkButton( true ) ;
81
-
82
- SelectField( 'txtUrl' ) ;
83
- }
84
-
85
- function LoadSelection()
86
- {
87
- if ( ! oEmbed ) return ;
88
-
89
- GetE('txtUrl').value = GetAttribute( oEmbed, 'src', '' ) ;
90
- GetE('txtWidth').value = GetAttribute( oEmbed, 'width', '' ) ;
91
- GetE('txtHeight').value = GetAttribute( oEmbed, 'height', '' ) ;
92
-
93
- // Get Advances Attributes
94
- GetE('txtAttId').value = oEmbed.id ;
95
- GetE('chkAutoPlay').checked = GetAttribute( oEmbed, 'play', 'true' ) == 'true' ;
96
- GetE('chkLoop').checked = GetAttribute( oEmbed, 'loop', 'true' ) == 'true' ;
97
- GetE('chkMenu').checked = GetAttribute( oEmbed, 'menu', 'true' ) == 'true' ;
98
- GetE('cmbScale').value = GetAttribute( oEmbed, 'scale', '' ).toLowerCase() ;
99
-
100
- GetE('txtAttTitle').value = oEmbed.title ;
101
-
102
- if ( oEditor.FCKBrowserInfo.IsIE )
103
- {
104
- GetE('txtAttClasses').value = oEmbed.getAttribute('className') || '' ;
105
- GetE('txtAttStyle').value = oEmbed.style.cssText ;
106
- }
107
- else
108
- {
109
- GetE('txtAttClasses').value = oEmbed.getAttribute('class',2) || '' ;
110
- GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) || '' ;
111
- }
112
-
113
- UpdatePreview() ;
114
- }
115
-
116
- //#### The OK button was hit.
117
- function Ok()
118
- {
119
- if ( GetE('txtUrl').value.length == 0 )
120
- {
121
- dialog.SetSelectedTab( 'Info' ) ;
122
- GetE('txtUrl').focus() ;
123
-
124
- alert( oEditor.FCKLang.DlgAlertUrl ) ;
125
-
126
- return false ;
127
- }
128
-
129
- oEditor.FCKUndo.SaveUndoStep() ;
130
- if ( !oEmbed )
131
- {
132
- oEmbed = FCK.EditorDocument.createElement( 'EMBED' ) ;
133
- oFakeImage = null ;
134
- }
135
- UpdateEmbed( oEmbed ) ;
136
-
137
- if ( !oFakeImage )
138
- {
139
- oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oEmbed ) ;
140
- oFakeImage.setAttribute( '_fckflash', 'true', 0 ) ;
141
- oFakeImage = FCK.InsertElement( oFakeImage ) ;
142
- }
143
-
144
- oEditor.FCKEmbedAndObjectProcessor.RefreshView( oFakeImage, oEmbed ) ;
145
-
146
- return true ;
147
- }
148
-
149
- function UpdateEmbed( e )
150
- {
151
- SetAttribute( e, 'type' , 'application/x-shockwave-flash' ) ;
152
- SetAttribute( e, 'pluginspage' , 'http://www.macromedia.com/go/getflashplayer' ) ;
153
-
154
- SetAttribute( e, 'src', GetE('txtUrl').value ) ;
155
- SetAttribute( e, "width" , GetE('txtWidth').value ) ;
156
- SetAttribute( e, "height", GetE('txtHeight').value ) ;
157
-
158
- // Advances Attributes
159
-
160
- SetAttribute( e, 'id' , GetE('txtAttId').value ) ;
161
- SetAttribute( e, 'scale', GetE('cmbScale').value ) ;
162
-
163
- SetAttribute( e, 'play', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
164
- SetAttribute( e, 'loop', GetE('chkLoop').checked ? 'true' : 'false' ) ;
165
- SetAttribute( e, 'menu', GetE('chkMenu').checked ? 'true' : 'false' ) ;
166
-
167
- SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ;
168
-
169
- if ( oEditor.FCKBrowserInfo.IsIE )
170
- {
171
- SetAttribute( e, 'className', GetE('txtAttClasses').value ) ;
172
- e.style.cssText = GetE('txtAttStyle').value ;
173
- }
174
- else
175
- {
176
- SetAttribute( e, 'class', GetE('txtAttClasses').value ) ;
177
- SetAttribute( e, 'style', GetE('txtAttStyle').value ) ;
178
- }
179
- }
180
-
181
- var ePreview ;
182
-
183
- function SetPreviewElement( previewEl )
184
- {
185
- ePreview = previewEl ;
186
-
187
- if ( GetE('txtUrl').value.length > 0 )
188
- UpdatePreview() ;
189
- }
190
-
191
- function UpdatePreview()
192
- {
193
- if ( !ePreview )
194
- return ;
195
-
196
- while ( ePreview.firstChild )
197
- ePreview.removeChild( ePreview.firstChild ) ;
198
-
199
- if ( GetE('txtUrl').value.length == 0 )
200
- ePreview.innerHTML = '&nbsp;' ;
201
- else
202
- {
203
- var oDoc = ePreview.ownerDocument || ePreview.document ;
204
- var e = oDoc.createElement( 'EMBED' ) ;
205
-
206
- SetAttribute( e, 'src', GetE('txtUrl').value ) ;
207
- SetAttribute( e, 'type', 'application/x-shockwave-flash' ) ;
208
- SetAttribute( e, 'width', '100%' ) ;
209
- SetAttribute( e, 'height', '100%' ) ;
210
-
211
- ePreview.appendChild( e ) ;
212
- }
213
- }
214
-
215
- // <embed id="ePreview" src="fck_flash/claims.swf" width="100%" height="100%" style="visibility:hidden" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
216
-
217
- function BrowseServer()
218
- {
219
- OpenFileBrowser( FCKConfig.FlashBrowserURL, FCKConfig.FlashBrowserWindowWidth, FCKConfig.FlashBrowserWindowHeight ) ;
220
- }
221
-
222
- function SetUrl( url, width, height )
223
- {
224
- GetE('txtUrl').value = url ;
225
-
226
- if ( width )
227
- GetE('txtWidth').value = width ;
228
-
229
- if ( height )
230
- GetE('txtHeight').value = height ;
231
-
232
- UpdatePreview() ;
233
-
234
- dialog.SetSelectedTab( 'Info' ) ;
235
- }
236
-
237
- function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
238
- {
239
- // Remove animation
240
- window.parent.Throbber.Hide() ;
241
- GetE( 'divUpload' ).style.display = '' ;
242
-
243
- switch ( errorNumber )
244
- {
245
- case 0 : // No errors
246
- alert( 'Your file has been successfully uploaded' ) ;
247
- break ;
248
- case 1 : // Custom error
249
- alert( customMsg ) ;
250
- return ;
251
- case 101 : // Custom warning
252
- alert( customMsg ) ;
253
- break ;
254
- case 201 :
255
- alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
256
- break ;
257
- case 202 :
258
- alert( 'Invalid file type' ) ;
259
- return ;
260
- case 203 :
261
- alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
262
- return ;
263
- case 500 :
264
- alert( 'The connector is disabled' ) ;
265
- break ;
266
- default :
267
- alert( 'Error on file upload. Error number: ' + errorNumber ) ;
268
- return ;
269
- }
270
-
271
- SetUrl( fileUrl ) ;
272
- GetE('frmUpload').reset() ;
273
- }
274
-
275
- var oUploadAllowedExtRegex = new RegExp( FCKConfig.FlashUploadAllowedExtensions, 'i' ) ;
276
- var oUploadDeniedExtRegex = new RegExp( FCKConfig.FlashUploadDeniedExtensions, 'i' ) ;
277
-
278
- function CheckUpload()
279
- {
280
- var sFile = GetE('txtUploadFile').value ;
281
-
282
- if ( sFile.length == 0 )
283
- {
284
- alert( 'Please select a file to upload' ) ;
285
- return false ;
286
- }
287
-
288
- if ( ( FCKConfig.FlashUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
289
- ( FCKConfig.FlashUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
290
- {
291
- OnUploadCompleted( 202 ) ;
292
- return false ;
293
- }
294
-
295
- // Show animation
296
- window.parent.Throbber.Show( 100 ) ;
297
- GetE( 'divUpload' ).style.display = 'none' ;
298
-
299
- return true ;
300
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_flash/fck_flash_preview.html DELETED
@@ -1,50 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Preview page for the Flash dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <title></title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
- <meta name="robots" content="noindex, nofollow">
29
- <script src="../common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script language="javascript">
31
-
32
- var FCKTools = window.parent.FCKTools ;
33
- var FCKConfig = window.parent.FCKConfig ;
34
-
35
- // Sets the Skin CSS
36
- document.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ;
37
- document.write( FCKTools.GetStyleHtml( GetCommonDialogCss( '../' ) ) ) ;
38
-
39
- if ( window.parent.FCKConfig.BaseHref.length > 0 )
40
- document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ;
41
-
42
- window.onload = function()
43
- {
44
- window.parent.SetPreviewElement( document.body ) ;
45
- }
46
-
47
- </script>
48
- </head>
49
- <body style="COLOR: #000000; BACKGROUND-COLOR: #ffffff"></body>
50
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_form.html DELETED
@@ -1,109 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Form dialog window.
23
- -->
24
- <html xmlns="http://www.w3.org/1999/xhtml">
25
- <head>
26
- <title></title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta content="noindex, nofollow" name="robots" />
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
-
32
- var dialog = window.parent ;
33
- var oEditor = dialog.InnerDialogLoaded() ;
34
-
35
- // Gets the document DOM
36
- var oDOM = oEditor.FCK.EditorDocument ;
37
-
38
- var oActiveEl = dialog.Selection.GetSelection().MoveToAncestorNode( 'FORM' ) ;
39
-
40
- window.onload = function()
41
- {
42
- // First of all, translate the dialog box texts
43
- oEditor.FCKLanguageManager.TranslatePage(document) ;
44
-
45
- if ( oActiveEl )
46
- {
47
- GetE('txtName').value = oActiveEl.name ;
48
- GetE('txtAction').value = oActiveEl.getAttribute( 'action', 2 ) ;
49
- GetE('txtMethod').value = oActiveEl.method ;
50
- }
51
- else
52
- oActiveEl = null ;
53
-
54
- dialog.SetOkButton( true ) ;
55
- dialog.SetAutoSize( true ) ;
56
- SelectField( 'txtName' ) ;
57
- }
58
-
59
- function Ok()
60
- {
61
- if ( !oActiveEl )
62
- {
63
- oActiveEl = oEditor.FCK.InsertElement( 'form' ) ;
64
-
65
- if ( oEditor.FCKBrowserInfo.IsGeckoLike )
66
- oEditor.FCKTools.AppendBogusBr( oActiveEl ) ;
67
- }
68
-
69
- oActiveEl.name = GetE('txtName').value ;
70
- SetAttribute( oActiveEl, 'action', GetE('txtAction').value ) ;
71
- oActiveEl.method = GetE('txtMethod').value ;
72
-
73
- return true ;
74
- }
75
-
76
- </script>
77
- </head>
78
- <body style="overflow: hidden">
79
- <table width="100%" style="height: 100%">
80
- <tr>
81
- <td align="center">
82
- <table cellspacing="0" cellpadding="0" width="80%" border="0">
83
- <tr>
84
- <td>
85
- <span fcklang="DlgFormName">Name</span><br />
86
- <input style="width: 100%" type="text" id="txtName" />
87
- </td>
88
- </tr>
89
- <tr>
90
- <td>
91
- <span fcklang="DlgFormAction">Action</span><br />
92
- <input style="width: 100%" type="text" id="txtAction" />
93
- </td>
94
- </tr>
95
- <tr>
96
- <td>
97
- <span fcklang="DlgFormMethod">Method</span><br />
98
- <select id="txtMethod">
99
- <option value="get" selected="selected">GET</option>
100
- <option value="post">POST</option>
101
- </select>
102
- </td>
103
- </tr>
104
- </table>
105
- </td>
106
- </tr>
107
- </table>
108
- </body>
109
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_hiddenfield.html DELETED
@@ -1,115 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Hidden Field dialog window.
23
- -->
24
- <html xmlns="http://www.w3.org/1999/xhtml">
25
- <head>
26
- <title>Hidden Field Properties</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta content="noindex, nofollow" name="robots" />
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
-
32
- var dialog = window.parent ;
33
- var oEditor = dialog.InnerDialogLoaded() ;
34
-
35
- var FCK = oEditor.FCK ;
36
-
37
- // Gets the document DOM
38
- var oDOM = FCK.EditorDocument ;
39
-
40
- // Get the selected flash embed (if available).
41
- var oFakeImage = dialog.Selection.GetSelectedElement() ;
42
- var oActiveEl ;
43
-
44
- if ( oFakeImage )
45
- {
46
- if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckinputhidden') )
47
- oActiveEl = FCK.GetRealElement( oFakeImage ) ;
48
- else
49
- oFakeImage = null ;
50
- }
51
-
52
- window.onload = function()
53
- {
54
- // First of all, translate the dialog box texts
55
- oEditor.FCKLanguageManager.TranslatePage(document) ;
56
-
57
- if ( oActiveEl )
58
- {
59
- GetE('txtName').value = oActiveEl.name ;
60
- GetE('txtValue').value = oActiveEl.value ;
61
- }
62
-
63
- dialog.SetOkButton( true ) ;
64
- dialog.SetAutoSize( true ) ;
65
- SelectField( 'txtName' ) ;
66
- }
67
-
68
-
69
- function Ok()
70
- {
71
- oEditor.FCKUndo.SaveUndoStep() ;
72
-
73
- oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: 'hidden' } ) ;
74
-
75
- SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
76
-
77
- if ( !oFakeImage )
78
- {
79
- oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__InputHidden', oActiveEl ) ;
80
- oFakeImage.setAttribute( '_fckinputhidden', 'true', 0 ) ;
81
-
82
- oActiveEl.parentNode.insertBefore( oFakeImage, oActiveEl ) ;
83
- oActiveEl.parentNode.removeChild( oActiveEl ) ;
84
- }
85
- else
86
- oEditor.FCKUndo.SaveUndoStep() ;
87
-
88
- return true ;
89
- }
90
-
91
- </script>
92
- </head>
93
- <body style="overflow: hidden" scroll="no">
94
- <table height="100%" width="100%">
95
- <tr>
96
- <td align="center">
97
- <table border="0" class="inhoud" cellpadding="0" cellspacing="0" width="80%">
98
- <tr>
99
- <td>
100
- <span fcklang="DlgHiddenName">Name</span><br />
101
- <input type="text" size="20" id="txtName" style="width: 100%" />
102
- </td>
103
- </tr>
104
- <tr>
105
- <td>
106
- <span fcklang="DlgHiddenValue">Value</span><br />
107
- <input type="text" size="30" id="txtValue" style="width: 100%" />
108
- </td>
109
- </tr>
110
- </table>
111
- </td>
112
- </tr>
113
- </table>
114
- </body>
115
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_image.html DELETED
@@ -1,258 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Image Properties dialog window.
23
- -->
24
- <html xmlns="http://www.w3.org/1999/xhtml">
25
- <head>
26
- <title>Image Properties</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta name="robots" content="noindex, nofollow" />
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script src="fck_image/fck_image.js" type="text/javascript"></script>
31
- <script type="text/javascript">
32
-
33
- document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
34
-
35
- </script>
36
- </head>
37
- <body scroll="no" style="overflow: hidden">
38
- <div id="divInfo">
39
- <table cellspacing="1" cellpadding="1" border="0" width="100%" height="100%">
40
- <tr>
41
- <td>
42
- <table cellspacing="0" cellpadding="0" width="100%" border="0">
43
- <tr>
44
- <td width="100%">
45
- <span fcklang="DlgImgURL">URL</span>
46
- </td>
47
- <td id="tdBrowse" style="display: none" nowrap="nowrap" rowspan="2">
48
- &nbsp;
49
- <input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server"
50
- fcklang="DlgBtnBrowseServer" />
51
- </td>
52
- </tr>
53
- <tr>
54
- <td valign="top">
55
- <input id="txtUrl" style="width: 100%" type="text" onblur="UpdatePreview();" />
56
- </td>
57
- </tr>
58
- </table>
59
- </td>
60
- </tr>
61
- <tr>
62
- <td>
63
- <span fcklang="DlgImgAlt">Short Description</span><br />
64
- <input id="txtAlt" style="width: 100%" type="text" /><br />
65
- </td>
66
- </tr>
67
- <tr height="100%">
68
- <td valign="top">
69
- <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">
70
- <tr>
71
- <td valign="top">
72
- <br />
73
- <table cellspacing="0" cellpadding="0" border="0">
74
- <tr>
75
- <td nowrap="nowrap">
76
- <span fcklang="DlgImgWidth">Width</span>&nbsp;</td>
77
- <td>
78
- <input type="text" size="3" id="txtWidth" onkeyup="OnSizeChanged('Width',this.value);" /></td>
79
- <td rowspan="2">
80
- <div id="btnLockSizes" class="BtnLocked" onmouseover="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ) + ' BtnOver';"
81
- onmouseout="this.className = (bLockRatio ? 'BtnLocked' : 'BtnUnlocked' );" title="Lock Sizes"
82
- onclick="SwitchLock(this);">
83
- </div>
84
- </td>
85
- <td rowspan="2">
86
- <div id="btnResetSize" class="BtnReset" onmouseover="this.className='BtnReset BtnOver';"
87
- onmouseout="this.className='BtnReset';" title="Reset Size" onclick="ResetSizes();">
88
- </div>
89
- </td>
90
- </tr>
91
- <tr>
92
- <td nowrap="nowrap">
93
- <span fcklang="DlgImgHeight">Height</span>&nbsp;</td>
94
- <td>
95
- <input type="text" size="3" id="txtHeight" onkeyup="OnSizeChanged('Height',this.value);" /></td>
96
- </tr>
97
- </table>
98
- <br />
99
- <table cellspacing="0" cellpadding="0" border="0">
100
- <tr>
101
- <td nowrap="nowrap">
102
- <span fcklang="DlgImgBorder">Border</span>&nbsp;</td>
103
- <td>
104
- <input type="text" size="2" value="" id="txtBorder" onkeyup="UpdatePreview();" /></td>
105
- </tr>
106
- <tr>
107
- <td nowrap="nowrap">
108
- <span fcklang="DlgImgHSpace">HSpace</span>&nbsp;</td>
109
- <td>
110
- <input type="text" size="2" id="txtHSpace" onkeyup="UpdatePreview();" /></td>
111
- </tr>
112
- <tr>
113
- <td nowrap="nowrap">
114
- <span fcklang="DlgImgVSpace">VSpace</span>&nbsp;</td>
115
- <td>
116
- <input type="text" size="2" id="txtVSpace" onkeyup="UpdatePreview();" /></td>
117
- </tr>
118
- <tr>
119
- <td nowrap="nowrap">
120
- <span fcklang="DlgImgAlign">Align</span>&nbsp;</td>
121
- <td>
122
- <select id="cmbAlign" onchange="UpdatePreview();">
123
- <option value="" selected="selected"></option>
124
- <option fcklang="DlgImgAlignLeft" value="left">Left</option>
125
- <option fcklang="DlgImgAlignAbsBottom" value="absBottom">Abs Bottom</option>
126
- <option fcklang="DlgImgAlignAbsMiddle" value="absMiddle">Abs Middle</option>
127
- <option fcklang="DlgImgAlignBaseline" value="baseline">Baseline</option>
128
- <option fcklang="DlgImgAlignBottom" value="bottom">Bottom</option>
129
- <option fcklang="DlgImgAlignMiddle" value="middle">Middle</option>
130
- <option fcklang="DlgImgAlignRight" value="right">Right</option>
131
- <option fcklang="DlgImgAlignTextTop" value="textTop">Text Top</option>
132
- <option fcklang="DlgImgAlignTop" value="top">Top</option>
133
- </select>
134
- </td>
135
- </tr>
136
- </table>
137
- </td>
138
- <td>
139
- &nbsp;&nbsp;&nbsp;</td>
140
- <td width="100%" valign="top">
141
- <table cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed">
142
- <tr>
143
- <td>
144
- <span fcklang="DlgImgPreview">Preview</span></td>
145
- </tr>
146
- <tr>
147
- <td valign="top">
148
- <iframe class="ImagePreviewArea" src="fck_image/fck_image_preview.html" frameborder="0"
149
- marginheight="0" marginwidth="0"></iframe>
150
- </td>
151
- </tr>
152
- </table>
153
- </td>
154
- </tr>
155
- </table>
156
- </td>
157
- </tr>
158
- </table>
159
- </div>
160
- <div id="divUpload" style="display: none">
161
- <form id="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data"
162
- action="" onsubmit="return CheckUpload();">
163
- <span fcklang="DlgLnkUpload">Upload</span><br />
164
- <input id="txtUploadFile" style="width: 100%" type="file" size="40" name="NewFile" /><br />
165
- <br />
166
- <input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" />
167
- <script type="text/javascript">
168
- document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
169
- </script>
170
- </form>
171
- </div>
172
- <div id="divLink" style="display: none">
173
- <table cellspacing="1" cellpadding="1" border="0" width="100%">
174
- <tr>
175
- <td>
176
- <div>
177
- <span fcklang="DlgLnkURL">URL</span><br />
178
- <input id="txtLnkUrl" style="width: 100%" type="text" onblur="UpdatePreview();" />
179
- </div>
180
- <div id="divLnkBrowseServer" align="right">
181
- <input type="button" value="Browse Server" fcklang="DlgBtnBrowseServer" onclick="LnkBrowseServer();" />
182
- </div>
183
- <div>
184
- <span fcklang="DlgLnkTarget">Target</span><br />
185
- <select id="cmbLnkTarget">
186
- <option value="" fcklang="DlgGenNotSet" selected="selected">&lt;not set&gt;</option>
187
- <option value="_blank" fcklang="DlgLnkTargetBlank">New Window (_blank)</option>
188
- <option value="_top" fcklang="DlgLnkTargetTop">Topmost Window (_top)</option>
189
- <option value="_self" fcklang="DlgLnkTargetSelf">Same Window (_self)</option>
190
- <option value="_parent" fcklang="DlgLnkTargetParent">Parent Window (_parent)</option>
191
- </select>
192
- </div>
193
- </td>
194
- </tr>
195
- </table>
196
- </div>
197
- <div id="divAdvanced" style="display: none">
198
- <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
199
- <tr>
200
- <td valign="top" width="50%">
201
- <span fcklang="DlgGenId">Id</span><br />
202
- <input id="txtAttId" style="width: 100%" type="text" />
203
- </td>
204
- <td width="1">
205
- &nbsp;&nbsp;</td>
206
- <td valign="top">
207
- <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
208
- <tr>
209
- <td width="60%">
210
- <span fcklang="DlgGenLangDir">Language Direction</span><br />
211
- <select id="cmbAttLangDir" style="width: 100%">
212
- <option value="" fcklang="DlgGenNotSet" selected="selected">&lt;not set&gt;</option>
213
- <option value="ltr" fcklang="DlgGenLangDirLtr">Left to Right (LTR)</option>
214
- <option value="rtl" fcklang="DlgGenLangDirRtl">Right to Left (RTL)</option>
215
- </select>
216
- </td>
217
- <td width="1%">
218
- &nbsp;&nbsp;</td>
219
- <td nowrap="nowrap">
220
- <span fcklang="DlgGenLangCode">Language Code</span><br />
221
- <input id="txtAttLangCode" style="width: 100%" type="text" />&nbsp;
222
- </td>
223
- </tr>
224
- </table>
225
- </td>
226
- </tr>
227
- <tr>
228
- <td colspan="3">
229
- &nbsp;</td>
230
- </tr>
231
- <tr>
232
- <td colspan="3">
233
- <span fcklang="DlgGenLongDescr">Long Description URL</span><br />
234
- <input id="txtLongDesc" style="width: 100%" type="text" />
235
- </td>
236
- </tr>
237
- <tr>
238
- <td colspan="3">
239
- &nbsp;</td>
240
- </tr>
241
- <tr>
242
- <td valign="top">
243
- <span fcklang="DlgGenClass">Stylesheet Classes</span><br />
244
- <input id="txtAttClasses" style="width: 100%" type="text" />
245
- </td>
246
- <td>
247
- </td>
248
- <td valign="top">
249
- &nbsp;<span fcklang="DlgGenTitle">Advisory Title</span><br />
250
- <input id="txtAttTitle" style="width: 100%" type="text" />
251
- </td>
252
- </tr>
253
- </table>
254
- <span fcklang="DlgGenStyle">Style</span><br />
255
- <input id="txtAttStyle" style="width: 100%" type="text" />
256
- </div>
257
- </body>
258
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_image/fck_image.js DELETED
@@ -1,512 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Scripts related to the Image dialog window (see fck_image.html).
22
- */
23
-
24
- var dialog = window.parent ;
25
- var oEditor = dialog.InnerDialogLoaded() ;
26
- var FCK = oEditor.FCK ;
27
- var FCKLang = oEditor.FCKLang ;
28
- var FCKConfig = oEditor.FCKConfig ;
29
- var FCKDebug = oEditor.FCKDebug ;
30
- var FCKTools = oEditor.FCKTools ;
31
-
32
- var bImageButton = ( document.location.search.length > 0 && document.location.search.substr(1) == 'ImageButton' ) ;
33
-
34
- //#### Dialog Tabs
35
-
36
- // Set the dialog tabs.
37
- dialog.AddTab( 'Info', FCKLang.DlgImgInfoTab ) ;
38
-
39
- if ( !bImageButton && !FCKConfig.ImageDlgHideLink )
40
- dialog.AddTab( 'Link', FCKLang.DlgImgLinkTab ) ;
41
-
42
- if ( FCKConfig.ImageUpload )
43
- dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ;
44
-
45
- if ( !FCKConfig.ImageDlgHideAdvanced )
46
- dialog.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
47
-
48
- // Function called when a dialog tag is selected.
49
- function OnDialogTabChange( tabCode )
50
- {
51
- ShowE('divInfo' , ( tabCode == 'Info' ) ) ;
52
- ShowE('divLink' , ( tabCode == 'Link' ) ) ;
53
- ShowE('divUpload' , ( tabCode == 'Upload' ) ) ;
54
- ShowE('divAdvanced' , ( tabCode == 'Advanced' ) ) ;
55
- }
56
-
57
- // Get the selected image (if available).
58
- var oImage = dialog.Selection.GetSelectedElement() ;
59
-
60
- if ( oImage && oImage.tagName != 'IMG' && !( oImage.tagName == 'INPUT' && oImage.type == 'image' ) )
61
- oImage = null ;
62
-
63
- // Get the active link.
64
- var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ;
65
-
66
- var oImageOriginal ;
67
-
68
- function UpdateOriginal( resetSize )
69
- {
70
- if ( !eImgPreview )
71
- return ;
72
-
73
- if ( GetE('txtUrl').value.length == 0 )
74
- {
75
- oImageOriginal = null ;
76
- return ;
77
- }
78
-
79
- oImageOriginal = document.createElement( 'IMG' ) ; // new Image() ;
80
-
81
- if ( resetSize )
82
- {
83
- oImageOriginal.onload = function()
84
- {
85
- this.onload = null ;
86
- ResetSizes() ;
87
- }
88
- }
89
-
90
- oImageOriginal.src = eImgPreview.src ;
91
- }
92
-
93
- var bPreviewInitialized ;
94
-
95
- window.onload = function()
96
- {
97
- // Translate the dialog box texts.
98
- oEditor.FCKLanguageManager.TranslatePage(document) ;
99
-
100
- GetE('btnLockSizes').title = FCKLang.DlgImgLockRatio ;
101
- GetE('btnResetSize').title = FCKLang.DlgBtnResetSize ;
102
-
103
- // Load the selected element information (if any).
104
- LoadSelection() ;
105
-
106
- // Show/Hide the "Browse Server" button.
107
- GetE('tdBrowse').style.display = FCKConfig.ImageBrowser ? '' : 'none' ;
108
- GetE('divLnkBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ;
109
-
110
- UpdateOriginal() ;
111
-
112
- // Set the actual uploader URL.
113
- if ( FCKConfig.ImageUpload )
114
- GetE('frmUpload').action = FCKConfig.ImageUploadURL ;
115
-
116
- dialog.SetAutoSize( true ) ;
117
-
118
- // Activate the "OK" button.
119
- dialog.SetOkButton( true ) ;
120
-
121
- SelectField( 'txtUrl' ) ;
122
- }
123
-
124
- function LoadSelection()
125
- {
126
- if ( ! oImage ) return ;
127
-
128
- var sUrl = oImage.getAttribute( '_fcksavedurl' ) ;
129
- if ( sUrl == null )
130
- sUrl = GetAttribute( oImage, 'src', '' ) ;
131
-
132
- GetE('txtUrl').value = sUrl ;
133
- GetE('txtAlt').value = GetAttribute( oImage, 'alt', '' ) ;
134
- GetE('txtVSpace').value = GetAttribute( oImage, 'vspace', '' ) ;
135
- GetE('txtHSpace').value = GetAttribute( oImage, 'hspace', '' ) ;
136
- GetE('txtBorder').value = GetAttribute( oImage, 'border', '' ) ;
137
- GetE('cmbAlign').value = GetAttribute( oImage, 'align', '' ) ;
138
-
139
- var iWidth, iHeight ;
140
-
141
- var regexSize = /^\s*(\d+)px\s*$/i ;
142
-
143
- if ( oImage.style.width )
144
- {
145
- var aMatchW = oImage.style.width.match( regexSize ) ;
146
- if ( aMatchW )
147
- {
148
- iWidth = aMatchW[1] ;
149
- oImage.style.width = '' ;
150
- SetAttribute( oImage, 'width' , iWidth ) ;
151
- }
152
- }
153
-
154
- if ( oImage.style.height )
155
- {
156
- var aMatchH = oImage.style.height.match( regexSize ) ;
157
- if ( aMatchH )
158
- {
159
- iHeight = aMatchH[1] ;
160
- oImage.style.height = '' ;
161
- SetAttribute( oImage, 'height', iHeight ) ;
162
- }
163
- }
164
-
165
- GetE('txtWidth').value = iWidth ? iWidth : GetAttribute( oImage, "width", '' ) ;
166
- GetE('txtHeight').value = iHeight ? iHeight : GetAttribute( oImage, "height", '' ) ;
167
-
168
- // Get Advances Attributes
169
- GetE('txtAttId').value = oImage.id ;
170
- GetE('cmbAttLangDir').value = oImage.dir ;
171
- GetE('txtAttLangCode').value = oImage.lang ;
172
- GetE('txtAttTitle').value = oImage.title ;
173
- GetE('txtLongDesc').value = oImage.longDesc ;
174
-
175
- if ( oEditor.FCKBrowserInfo.IsIE )
176
- {
177
- GetE('txtAttClasses').value = oImage.className || '' ;
178
- GetE('txtAttStyle').value = oImage.style.cssText ;
179
- }
180
- else
181
- {
182
- GetE('txtAttClasses').value = oImage.getAttribute('class',2) || '' ;
183
- GetE('txtAttStyle').value = oImage.getAttribute('style',2) ;
184
- }
185
-
186
- if ( oLink )
187
- {
188
- var sLinkUrl = oLink.getAttribute( '_fcksavedurl' ) ;
189
- if ( sLinkUrl == null )
190
- sLinkUrl = oLink.getAttribute('href',2) ;
191
-
192
- GetE('txtLnkUrl').value = sLinkUrl ;
193
- GetE('cmbLnkTarget').value = oLink.target ;
194
- }
195
-
196
- UpdatePreview() ;
197
- }
198
-
199
- //#### The OK button was hit.
200
- function Ok()
201
- {
202
- if ( GetE('txtUrl').value.length == 0 )
203
- {
204
- dialog.SetSelectedTab( 'Info' ) ;
205
- GetE('txtUrl').focus() ;
206
-
207
- alert( FCKLang.DlgImgAlertUrl ) ;
208
-
209
- return false ;
210
- }
211
-
212
- var bHasImage = ( oImage != null ) ;
213
-
214
- if ( bHasImage && bImageButton && oImage.tagName == 'IMG' )
215
- {
216
- if ( confirm( 'Do you want to transform the selected image on a image button?' ) )
217
- oImage = null ;
218
- }
219
- else if ( bHasImage && !bImageButton && oImage.tagName == 'INPUT' )
220
- {
221
- if ( confirm( 'Do you want to transform the selected image button on a simple image?' ) )
222
- oImage = null ;
223
- }
224
-
225
- oEditor.FCKUndo.SaveUndoStep() ;
226
- if ( !bHasImage )
227
- {
228
- if ( bImageButton )
229
- {
230
- oImage = FCK.EditorDocument.createElement( 'input' ) ;
231
- oImage.type = 'image' ;
232
- oImage = FCK.InsertElement( oImage ) ;
233
- }
234
- else
235
- oImage = FCK.InsertElement( 'img' ) ;
236
- }
237
-
238
- UpdateImage( oImage ) ;
239
-
240
- var sLnkUrl = GetE('txtLnkUrl').value.Trim() ;
241
-
242
- if ( sLnkUrl.length == 0 )
243
- {
244
- if ( oLink )
245
- FCK.ExecuteNamedCommand( 'Unlink' ) ;
246
- }
247
- else
248
- {
249
- if ( oLink ) // Modifying an existent link.
250
- oLink.href = sLnkUrl ;
251
- else // Creating a new link.
252
- {
253
- if ( !bHasImage )
254
- oEditor.FCKSelection.SelectNode( oImage ) ;
255
-
256
- oLink = oEditor.FCK.CreateLink( sLnkUrl )[0] ;
257
-
258
- if ( !bHasImage )
259
- {
260
- oEditor.FCKSelection.SelectNode( oLink ) ;
261
- oEditor.FCKSelection.Collapse( false ) ;
262
- }
263
- }
264
-
265
- SetAttribute( oLink, '_fcksavedurl', sLnkUrl ) ;
266
- SetAttribute( oLink, 'target', GetE('cmbLnkTarget').value ) ;
267
- }
268
-
269
- return true ;
270
- }
271
-
272
- function UpdateImage( e, skipId )
273
- {
274
- e.src = GetE('txtUrl').value ;
275
- SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ;
276
- SetAttribute( e, "alt" , GetE('txtAlt').value ) ;
277
- SetAttribute( e, "width" , GetE('txtWidth').value ) ;
278
- SetAttribute( e, "height", GetE('txtHeight').value ) ;
279
- SetAttribute( e, "vspace", GetE('txtVSpace').value ) ;
280
- SetAttribute( e, "hspace", GetE('txtHSpace').value ) ;
281
- SetAttribute( e, "border", GetE('txtBorder').value ) ;
282
- SetAttribute( e, "align" , GetE('cmbAlign').value ) ;
283
-
284
- // Advances Attributes
285
-
286
- if ( ! skipId )
287
- SetAttribute( e, 'id', GetE('txtAttId').value ) ;
288
-
289
- SetAttribute( e, 'dir' , GetE('cmbAttLangDir').value ) ;
290
- SetAttribute( e, 'lang' , GetE('txtAttLangCode').value ) ;
291
- SetAttribute( e, 'title' , GetE('txtAttTitle').value ) ;
292
- SetAttribute( e, 'longDesc' , GetE('txtLongDesc').value ) ;
293
-
294
- if ( oEditor.FCKBrowserInfo.IsIE )
295
- {
296
- e.className = GetE('txtAttClasses').value ;
297
- e.style.cssText = GetE('txtAttStyle').value ;
298
- }
299
- else
300
- {
301
- SetAttribute( e, 'class' , GetE('txtAttClasses').value ) ;
302
- SetAttribute( e, 'style', GetE('txtAttStyle').value ) ;
303
- }
304
- }
305
-
306
- var eImgPreview ;
307
- var eImgPreviewLink ;
308
-
309
- function SetPreviewElements( imageElement, linkElement )
310
- {
311
- eImgPreview = imageElement ;
312
- eImgPreviewLink = linkElement ;
313
-
314
- UpdatePreview() ;
315
- UpdateOriginal() ;
316
-
317
- bPreviewInitialized = true ;
318
- }
319
-
320
- function UpdatePreview()
321
- {
322
- if ( !eImgPreview || !eImgPreviewLink )
323
- return ;
324
-
325
- if ( GetE('txtUrl').value.length == 0 )
326
- eImgPreviewLink.style.display = 'none' ;
327
- else
328
- {
329
- UpdateImage( eImgPreview, true ) ;
330
-
331
- if ( GetE('txtLnkUrl').value.Trim().length > 0 )
332
- eImgPreviewLink.href = 'javascript:void(null);' ;
333
- else
334
- SetAttribute( eImgPreviewLink, 'href', '' ) ;
335
-
336
- eImgPreviewLink.style.display = '' ;
337
- }
338
- }
339
-
340
- var bLockRatio = true ;
341
-
342
- function SwitchLock( lockButton )
343
- {
344
- bLockRatio = !bLockRatio ;
345
- lockButton.className = bLockRatio ? 'BtnLocked' : 'BtnUnlocked' ;
346
- lockButton.title = bLockRatio ? 'Lock sizes' : 'Unlock sizes' ;
347
-
348
- if ( bLockRatio )
349
- {
350
- if ( GetE('txtWidth').value.length > 0 )
351
- OnSizeChanged( 'Width', GetE('txtWidth').value ) ;
352
- else
353
- OnSizeChanged( 'Height', GetE('txtHeight').value ) ;
354
- }
355
- }
356
-
357
- // Fired when the width or height input texts change
358
- function OnSizeChanged( dimension, value )
359
- {
360
- // Verifies if the aspect ration has to be maintained
361
- if ( oImageOriginal && bLockRatio )
362
- {
363
- var e = dimension == 'Width' ? GetE('txtHeight') : GetE('txtWidth') ;
364
-
365
- if ( value.length == 0 || isNaN( value ) )
366
- {
367
- e.value = '' ;
368
- return ;
369
- }
370
-
371
- if ( dimension == 'Width' )
372
- value = value == 0 ? 0 : Math.round( oImageOriginal.height * ( value / oImageOriginal.width ) ) ;
373
- else
374
- value = value == 0 ? 0 : Math.round( oImageOriginal.width * ( value / oImageOriginal.height ) ) ;
375
-
376
- if ( !isNaN( value ) )
377
- e.value = value ;
378
- }
379
-
380
- UpdatePreview() ;
381
- }
382
-
383
- // Fired when the Reset Size button is clicked
384
- function ResetSizes()
385
- {
386
- if ( ! oImageOriginal ) return ;
387
- if ( oEditor.FCKBrowserInfo.IsGecko && !oImageOriginal.complete )
388
- {
389
- setTimeout( ResetSizes, 50 ) ;
390
- return ;
391
- }
392
-
393
- GetE('txtWidth').value = oImageOriginal.width ;
394
- GetE('txtHeight').value = oImageOriginal.height ;
395
-
396
- UpdatePreview() ;
397
- }
398
-
399
- function BrowseServer()
400
- {
401
- OpenServerBrowser(
402
- 'Image',
403
- FCKConfig.ImageBrowserURL,
404
- FCKConfig.ImageBrowserWindowWidth,
405
- FCKConfig.ImageBrowserWindowHeight ) ;
406
- }
407
-
408
- function LnkBrowseServer()
409
- {
410
- OpenServerBrowser(
411
- 'Link',
412
- FCKConfig.LinkBrowserURL,
413
- FCKConfig.LinkBrowserWindowWidth,
414
- FCKConfig.LinkBrowserWindowHeight ) ;
415
- }
416
-
417
- function OpenServerBrowser( type, url, width, height )
418
- {
419
- sActualBrowser = type ;
420
- OpenFileBrowser( url, width, height ) ;
421
- }
422
-
423
- var sActualBrowser ;
424
-
425
- function SetUrl( url, width, height, alt )
426
- {
427
- if ( sActualBrowser == 'Link' )
428
- {
429
- GetE('txtLnkUrl').value = url ;
430
- UpdatePreview() ;
431
- }
432
- else
433
- {
434
- GetE('txtUrl').value = url ;
435
- GetE('txtWidth').value = width ? width : '' ;
436
- GetE('txtHeight').value = height ? height : '' ;
437
-
438
- if ( alt )
439
- GetE('txtAlt').value = alt;
440
-
441
- UpdatePreview() ;
442
- UpdateOriginal( true ) ;
443
- }
444
-
445
- dialog.SetSelectedTab( 'Info' ) ;
446
- }
447
-
448
- function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
449
- {
450
- // Remove animation
451
- window.parent.Throbber.Hide() ;
452
- GetE( 'divUpload' ).style.display = '' ;
453
-
454
- switch ( errorNumber )
455
- {
456
- case 0 : // No errors
457
- alert( 'Your file has been successfully uploaded' ) ;
458
- break ;
459
- case 1 : // Custom error
460
- alert( customMsg ) ;
461
- return ;
462
- case 101 : // Custom warning
463
- alert( customMsg ) ;
464
- break ;
465
- case 201 :
466
- alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
467
- break ;
468
- case 202 :
469
- alert( 'Invalid file type' ) ;
470
- return ;
471
- case 203 :
472
- alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
473
- return ;
474
- case 500 :
475
- alert( 'The connector is disabled' ) ;
476
- break ;
477
- default :
478
- alert( 'Error on file upload. Error number: ' + errorNumber ) ;
479
- return ;
480
- }
481
-
482
- sActualBrowser = '' ;
483
- SetUrl( fileUrl ) ;
484
- GetE('frmUpload').reset() ;
485
- }
486
-
487
- var oUploadAllowedExtRegex = new RegExp( FCKConfig.ImageUploadAllowedExtensions, 'i' ) ;
488
- var oUploadDeniedExtRegex = new RegExp( FCKConfig.ImageUploadDeniedExtensions, 'i' ) ;
489
-
490
- function CheckUpload()
491
- {
492
- var sFile = GetE('txtUploadFile').value ;
493
-
494
- if ( sFile.length == 0 )
495
- {
496
- alert( 'Please select a file to upload' ) ;
497
- return false ;
498
- }
499
-
500
- if ( ( FCKConfig.ImageUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
501
- ( FCKConfig.ImageUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
502
- {
503
- OnUploadCompleted( 202 ) ;
504
- return false ;
505
- }
506
-
507
- // Show animation
508
- window.parent.Throbber.Show( 100 ) ;
509
- GetE( 'divUpload' ).style.display = 'none' ;
510
-
511
- return true ;
512
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_image/fck_image_preview.html DELETED
@@ -1,72 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Preview page for the Image dialog window.
23
- *
24
- * Curiosity: http://en.wikipedia.org/wiki/Lorem_ipsum
25
- -->
26
- <html xmlns="http://www.w3.org/1999/xhtml">
27
- <head>
28
- <title></title>
29
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
- <meta name="robots" content="noindex, nofollow" />
31
- <script src="../common/fck_dialog_common.js" type="text/javascript"></script>
32
- <script type="text/javascript">
33
-
34
- var FCKTools = window.parent.FCKTools ;
35
- var FCKConfig = window.parent.FCKConfig ;
36
-
37
- // Set the preview CSS
38
- document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaCSS ) ) ;
39
- document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaStyles ) ) ;
40
-
41
- if ( window.parent.FCKConfig.BaseHref.length > 0 )
42
- document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ;
43
-
44
- window.onload = function()
45
- {
46
- window.parent.SetPreviewElements(
47
- document.getElementById( 'imgPreview' ),
48
- document.getElementById( 'lnkPreview' ) ) ;
49
- }
50
-
51
- </script>
52
- </head>
53
- <body>
54
- <div>
55
- <a id="lnkPreview" onclick="return false;" style="cursor: default">
56
- <img id="imgPreview" onload="window.parent.UpdateOriginal();"
57
- style="display: none" alt="" /></a>Lorem ipsum dolor sit amet, consectetuer adipiscing
58
- elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus
59
- a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis,
60
- nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed
61
- velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper
62
- nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices
63
- a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus
64
- faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget
65
- tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit,
66
- tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis
67
- id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus,
68
- eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur
69
- ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.
70
- </div>
71
- </body>
72
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_link.html DELETED
@@ -1,295 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Link dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <title>Link Properties</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta name="robots" content="noindex, nofollow" />
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script src="fck_link/fck_link.js" type="text/javascript"></script>
31
- </head>
32
- <body scroll="no" style="OVERFLOW: hidden">
33
- <div id="divInfo" style="DISPLAY: none">
34
- <span fckLang="DlgLnkType">Link Type</span><br />
35
- <select id="cmbLinkType" onchange="SetLinkType(this.value);">
36
- <option value="url" fckLang="DlgLnkTypeURL" selected="selected">URL</option>
37
- <option value="anchor" fckLang="DlgLnkTypeAnchor">Anchor in this page</option>
38
- <option value="email" fckLang="DlgLnkTypeEMail">E-Mail</option>
39
- </select>
40
- <br />
41
- <br />
42
- <div id="divLinkTypeUrl">
43
- <table cellspacing="0" cellpadding="0" width="100%" border="0" dir="ltr">
44
- <tr>
45
- <td nowrap="nowrap">
46
- <span fckLang="DlgLnkProto">Protocol</span><br />
47
- <select id="cmbLinkProtocol">
48
- <option value="http://" selected="selected">http://</option>
49
- <option value="https://">https://</option>
50
- <option value="ftp://">ftp://</option>
51
- <option value="news://">news://</option>
52
- <option value="" fckLang="DlgLnkProtoOther">&lt;other&gt;</option>
53
- </select>
54
- </td>
55
- <td nowrap="nowrap">&nbsp;</td>
56
- <td nowrap="nowrap" width="100%">
57
- <span fckLang="DlgLnkURL">URL</span><br />
58
- <input id="txtUrl" style="WIDTH: 100%" type="text" onkeyup="OnUrlChange();" onchange="OnUrlChange();" />
59
- </td>
60
- </tr>
61
- </table>
62
- <br />
63
- <div id="divBrowseServer">
64
- <input type="button" value="Browse Server" fckLang="DlgBtnBrowseServer" onclick="BrowseServer();" />
65
- </div>
66
- </div>
67
- <div id="divLinkTypeAnchor" style="DISPLAY: none" align="center">
68
- <div id="divSelAnchor" style="DISPLAY: none">
69
- <table cellspacing="0" cellpadding="0" border="0" width="70%">
70
- <tr>
71
- <td colspan="3">
72
- <span fckLang="DlgLnkAnchorSel">Select an Anchor</span>
73
- </td>
74
- </tr>
75
- <tr>
76
- <td width="50%">
77
- <span fckLang="DlgLnkAnchorByName">By Anchor Name</span><br />
78
- <select id="cmbAnchorName" onchange="GetE('cmbAnchorId').value='';" style="WIDTH: 100%">
79
- <option value="" selected="selected"></option>
80
- </select>
81
- </td>
82
- <td>&nbsp;&nbsp;&nbsp;</td>
83
- <td width="50%">
84
- <span fckLang="DlgLnkAnchorById">By Element Id</span><br />
85
- <select id="cmbAnchorId" onchange="GetE('cmbAnchorName').value='';" style="WIDTH: 100%">
86
- <option value="" selected="selected"></option>
87
- </select>
88
- </td>
89
- </tr>
90
- </table>
91
- </div>
92
- <div id="divNoAnchor" style="DISPLAY: none">
93
- <span fckLang="DlgLnkNoAnchors">&lt;No anchors available in the document&gt;</span>
94
- </div>
95
- </div>
96
- <div id="divLinkTypeEMail" style="DISPLAY: none">
97
- <span fckLang="DlgLnkEMail">E-Mail Address</span><br />
98
- <input id="txtEMailAddress" style="WIDTH: 100%" type="text" /><br />
99
- <span fckLang="DlgLnkEMailSubject">Message Subject</span><br />
100
- <input id="txtEMailSubject" style="WIDTH: 100%" type="text" /><br />
101
- <span fckLang="DlgLnkEMailBody">Message Body</span><br />
102
- <textarea id="txtEMailBody" style="WIDTH: 100%" rows="3" cols="20"></textarea>
103
- </div>
104
- </div>
105
- <div id="divUpload" style="DISPLAY: none">
106
- <form id="frmUpload" method="post" target="UploadWindow" enctype="multipart/form-data" action="" onsubmit="return CheckUpload();">
107
- <span fckLang="DlgLnkUpload">Upload</span><br />
108
- <input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
109
- <br />
110
- <input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
111
- <script type="text/javascript">
112
- document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
113
- </script>
114
- </form>
115
- </div>
116
- <div id="divTarget" style="DISPLAY: none">
117
- <table cellspacing="0" cellpadding="0" width="100%" border="0">
118
- <tr>
119
- <td nowrap="nowrap">
120
- <span fckLang="DlgLnkTarget">Target</span><br />
121
- <select id="cmbTarget" onchange="SetTarget(this.value);">
122
- <option value="" fckLang="DlgGenNotSet" selected="selected">&lt;not set&gt;</option>
123
- <option value="frame" fckLang="DlgLnkTargetFrame">&lt;frame&gt;</option>
124
- <option value="popup" fckLang="DlgLnkTargetPopup">&lt;popup window&gt;</option>
125
- <option value="_blank" fckLang="DlgLnkTargetBlank">New Window (_blank)</option>
126
- <option value="_top" fckLang="DlgLnkTargetTop">Topmost Window (_top)</option>
127
- <option value="_self" fckLang="DlgLnkTargetSelf">Same Window (_self)</option>
128
- <option value="_parent" fckLang="DlgLnkTargetParent">Parent Window (_parent)</option>
129
- </select>
130
- </td>
131
- <td>&nbsp;</td>
132
- <td id="tdTargetFrame" nowrap="nowrap" width="100%">
133
- <span fckLang="DlgLnkTargetFrameName">Target Frame Name</span><br />
134
- <input id="txtTargetFrame" style="WIDTH: 100%" type="text" onkeyup="OnTargetNameChange();"
135
- onchange="OnTargetNameChange();" />
136
- </td>
137
- <td id="tdPopupName" style="DISPLAY: none" nowrap="nowrap" width="100%">
138
- <span fckLang="DlgLnkPopWinName">Popup Window Name</span><br />
139
- <input id="txtPopupName" style="WIDTH: 100%" type="text" />
140
- </td>
141
- </tr>
142
- </table>
143
- <br />
144
- <table id="tablePopupFeatures" style="DISPLAY: none" cellspacing="0" cellpadding="0" align="center"
145
- border="0">
146
- <tr>
147
- <td>
148
- <span fckLang="DlgLnkPopWinFeat">Popup Window Features</span><br />
149
- <table cellspacing="0" cellpadding="0" border="0">
150
- <tr>
151
- <td valign="top" nowrap="nowrap" width="50%">
152
- <input id="chkPopupResizable" name="chkFeature" value="resizable" type="checkbox" /><label for="chkPopupResizable" fckLang="DlgLnkPopResize">Resizable</label><br />
153
- <input id="chkPopupLocationBar" name="chkFeature" value="location" type="checkbox" /><label for="chkPopupLocationBar" fckLang="DlgLnkPopLocation">Location
154
- Bar</label><br />
155
- <input id="chkPopupManuBar" name="chkFeature" value="menubar" type="checkbox" /><label for="chkPopupManuBar" fckLang="DlgLnkPopMenu">Menu
156
- Bar</label><br />
157
- <input id="chkPopupScrollBars" name="chkFeature" value="scrollbars" type="checkbox" /><label for="chkPopupScrollBars" fckLang="DlgLnkPopScroll">Scroll
158
- Bars</label>
159
- </td>
160
- <td></td>
161
- <td valign="top" nowrap="nowrap" width="50%">
162
- <input id="chkPopupStatusBar" name="chkFeature" value="status" type="checkbox" /><label for="chkPopupStatusBar" fckLang="DlgLnkPopStatus">Status
163
- Bar</label><br />
164
- <input id="chkPopupToolbar" name="chkFeature" value="toolbar" type="checkbox" /><label for="chkPopupToolbar" fckLang="DlgLnkPopToolbar">Toolbar</label><br />
165
- <input id="chkPopupFullScreen" name="chkFeature" value="fullscreen" type="checkbox" /><label for="chkPopupFullScreen" fckLang="DlgLnkPopFullScrn">Full
166
- Screen (IE)</label><br />
167
- <input id="chkPopupDependent" name="chkFeature" value="dependent" type="checkbox" /><label for="chkPopupDependent" fckLang="DlgLnkPopDependent">Dependent
168
- (Netscape)</label>
169
- </td>
170
- </tr>
171
- <tr>
172
- <td valign="top" nowrap="nowrap" width="50%">&nbsp;</td>
173
- <td></td>
174
- <td valign="top" nowrap="nowrap" width="50%"></td>
175
- </tr>
176
- <tr>
177
- <td valign="top">
178
- <table cellspacing="0" cellpadding="0" border="0">
179
- <tr>
180
- <td nowrap="nowrap"><span fckLang="DlgLnkPopWidth">Width</span></td>
181
- <td>&nbsp;<input id="txtPopupWidth" type="text" maxlength="4" size="4" /></td>
182
- </tr>
183
- <tr>
184
- <td nowrap="nowrap"><span fckLang="DlgLnkPopHeight">Height</span></td>
185
- <td>&nbsp;<input id="txtPopupHeight" type="text" maxlength="4" size="4" /></td>
186
- </tr>
187
- </table>
188
- </td>
189
- <td>&nbsp;&nbsp;</td>
190
- <td valign="top">
191
- <table cellspacing="0" cellpadding="0" border="0">
192
- <tr>
193
- <td nowrap="nowrap"><span fckLang="DlgLnkPopLeft">Left Position</span></td>
194
- <td>&nbsp;<input id="txtPopupLeft" type="text" maxlength="4" size="4" /></td>
195
- </tr>
196
- <tr>
197
- <td nowrap="nowrap"><span fckLang="DlgLnkPopTop">Top Position</span></td>
198
- <td>&nbsp;<input id="txtPopupTop" type="text" maxlength="4" size="4" /></td>
199
- </tr>
200
- </table>
201
- </td>
202
- </tr>
203
- </table>
204
- </td>
205
- </tr>
206
- </table>
207
- </div>
208
- <div id="divAttribs" style="DISPLAY: none">
209
- <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
210
- <tr>
211
- <td valign="top" width="50%">
212
- <span fckLang="DlgGenId">Id</span><br />
213
- <input id="txtAttId" style="WIDTH: 100%" type="text" />
214
- </td>
215
- <td width="1"></td>
216
- <td valign="top">
217
- <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
218
- <tr>
219
- <td width="60%">
220
- <span fckLang="DlgGenLangDir">Language Direction</span><br />
221
- <select id="cmbAttLangDir" style="WIDTH: 100%">
222
- <option value="" fckLang="DlgGenNotSet" selected>&lt;not set&gt;</option>
223
- <option value="ltr" fckLang="DlgGenLangDirLtr">Left to Right (LTR)</option>
224
- <option value="rtl" fckLang="DlgGenLangDirRtl">Right to Left (RTL)</option>
225
- </select>
226
- </td>
227
- <td width="1%">&nbsp;&nbsp;&nbsp;</td>
228
- <td nowrap="nowrap"><span fckLang="DlgGenAccessKey">Access Key</span><br />
229
- <input id="txtAttAccessKey" style="WIDTH: 100%" type="text" maxlength="1" size="1" />
230
- </td>
231
- </tr>
232
- </table>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td valign="top" width="50%">
237
- <span fckLang="DlgGenName">Name</span><br />
238
- <input id="txtAttName" style="WIDTH: 100%" type="text" />
239
- </td>
240
- <td width="1"></td>
241
- <td valign="top">
242
- <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
243
- <tr>
244
- <td width="60%">
245
- <span fckLang="DlgGenLangCode">Language Code</span><br />
246
- <input id="txtAttLangCode" style="WIDTH: 100%" type="text" />
247
- </td>
248
- <td width="1%">&nbsp;&nbsp;&nbsp;</td>
249
- <td nowrap="nowrap">
250
- <span fckLang="DlgGenTabIndex">Tab Index</span><br />
251
- <input id="txtAttTabIndex" style="WIDTH: 100%" type="text" maxlength="5" size="5" />
252
- </td>
253
- </tr>
254
- </table>
255
- </td>
256
- </tr>
257
- <tr>
258
- <td valign="top" width="50%">&nbsp;</td>
259
- <td width="1"></td>
260
- <td valign="top"></td>
261
- </tr>
262
- <tr>
263
- <td valign="top" width="50%">
264
- <span fckLang="DlgGenTitle">Advisory Title</span><br />
265
- <input id="txtAttTitle" style="WIDTH: 100%" type="text" />
266
- </td>
267
- <td width="1">&nbsp;&nbsp;&nbsp;</td>
268
- <td valign="top">
269
- <span fckLang="DlgGenContType">Advisory Content Type</span><br />
270
- <input id="txtAttContentType" style="WIDTH: 100%" type="text" />
271
- </td>
272
- </tr>
273
- <tr>
274
- <td valign="top">
275
- <span fckLang="DlgGenClass">Stylesheet Classes</span><br />
276
- <input id="txtAttClasses" style="WIDTH: 100%" type="text" />
277
- </td>
278
- <td></td>
279
- <td valign="top">
280
- <span fckLang="DlgGenLinkCharset">Linked Resource Charset</span><br />
281
- <input id="txtAttCharSet" style="WIDTH: 100%" type="text" />
282
- </td>
283
- </tr>
284
- </table>
285
- <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
286
- <tr>
287
- <td>
288
- <span fckLang="DlgGenStyle">Style</span><br />
289
- <input id="txtAttStyle" style="WIDTH: 100%" type="text" />
290
- </td>
291
- </tr>
292
- </table>
293
- </div>
294
- </body>
295
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_link/fck_link.js DELETED
@@ -1,893 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Scripts related to the Link dialog window (see fck_link.html).
22
- */
23
-
24
- var dialog = window.parent ;
25
- var oEditor = dialog.InnerDialogLoaded() ;
26
-
27
- var FCK = oEditor.FCK ;
28
- var FCKLang = oEditor.FCKLang ;
29
- var FCKConfig = oEditor.FCKConfig ;
30
- var FCKRegexLib = oEditor.FCKRegexLib ;
31
- var FCKTools = oEditor.FCKTools ;
32
-
33
- //#### Dialog Tabs
34
-
35
- // Set the dialog tabs.
36
- dialog.AddTab( 'Info', FCKLang.DlgLnkInfoTab ) ;
37
-
38
- if ( !FCKConfig.LinkDlgHideTarget )
39
- dialog.AddTab( 'Target', FCKLang.DlgLnkTargetTab, true ) ;
40
-
41
- if ( FCKConfig.LinkUpload )
42
- dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload, true ) ;
43
-
44
- if ( !FCKConfig.LinkDlgHideAdvanced )
45
- dialog.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
46
-
47
- // Function called when a dialog tag is selected.
48
- function OnDialogTabChange( tabCode )
49
- {
50
- ShowE('divInfo' , ( tabCode == 'Info' ) ) ;
51
- ShowE('divTarget' , ( tabCode == 'Target' ) ) ;
52
- ShowE('divUpload' , ( tabCode == 'Upload' ) ) ;
53
- ShowE('divAttribs' , ( tabCode == 'Advanced' ) ) ;
54
-
55
- dialog.SetAutoSize( true ) ;
56
- }
57
-
58
- //#### Regular Expressions library.
59
- var oRegex = new Object() ;
60
-
61
- oRegex.UriProtocol = /^(((http|https|ftp|news):\/\/)|mailto:)/gi ;
62
-
63
- oRegex.UrlOnChangeProtocol = /^(http|https|ftp|news):\/\/(?=.)/gi ;
64
-
65
- oRegex.UrlOnChangeTestOther = /^((javascript:)|[#\/\.])/gi ;
66
-
67
- oRegex.ReserveTarget = /^_(blank|self|top|parent)$/i ;
68
-
69
- oRegex.PopupUri = /^javascript:void\(\s*window.open\(\s*'([^']+)'\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*\)\s*$/ ;
70
-
71
- // Accessible popups
72
- oRegex.OnClickPopup = /^\s*on[cC]lick="\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*"$/ ;
73
-
74
- oRegex.PopupFeatures = /(?:^|,)([^=]+)=(\d+|yes|no)/gi ;
75
-
76
- //#### Parser Functions
77
-
78
- var oParser = new Object() ;
79
-
80
- // This method simply returns the two inputs in numerical order. You can even
81
- // provide strings, as the method would parseInt() the values.
82
- oParser.SortNumerical = function(a, b)
83
- {
84
- return parseInt( a, 10 ) - parseInt( b, 10 ) ;
85
- }
86
-
87
- oParser.ParseEMailParams = function(sParams)
88
- {
89
- // Initialize the oEMailParams object.
90
- var oEMailParams = new Object() ;
91
- oEMailParams.Subject = '' ;
92
- oEMailParams.Body = '' ;
93
-
94
- var aMatch = sParams.match( /(^|^\?|&)subject=([^&]+)/i ) ;
95
- if ( aMatch ) oEMailParams.Subject = decodeURIComponent( aMatch[2] ) ;
96
-
97
- aMatch = sParams.match( /(^|^\?|&)body=([^&]+)/i ) ;
98
- if ( aMatch ) oEMailParams.Body = decodeURIComponent( aMatch[2] ) ;
99
-
100
- return oEMailParams ;
101
- }
102
-
103
- // This method returns either an object containing the email info, or FALSE
104
- // if the parameter is not an email link.
105
- oParser.ParseEMailUri = function( sUrl )
106
- {
107
- // Initializes the EMailInfo object.
108
- var oEMailInfo = new Object() ;
109
- oEMailInfo.Address = '' ;
110
- oEMailInfo.Subject = '' ;
111
- oEMailInfo.Body = '' ;
112
-
113
- var aLinkInfo = sUrl.match( /^(\w+):(.*)$/ ) ;
114
- if ( aLinkInfo && aLinkInfo[1] == 'mailto' )
115
- {
116
- // This seems to be an unprotected email link.
117
- var aParts = aLinkInfo[2].match( /^([^\?]+)\??(.+)?/ ) ;
118
- if ( aParts )
119
- {
120
- // Set the e-mail address.
121
- oEMailInfo.Address = aParts[1] ;
122
-
123
- // Look for the optional e-mail parameters.
124
- if ( aParts[2] )
125
- {
126
- var oEMailParams = oParser.ParseEMailParams( aParts[2] ) ;
127
- oEMailInfo.Subject = oEMailParams.Subject ;
128
- oEMailInfo.Body = oEMailParams.Body ;
129
- }
130
- }
131
- return oEMailInfo ;
132
- }
133
- else if ( aLinkInfo && aLinkInfo[1] == 'javascript' )
134
- {
135
- // This may be a protected email.
136
-
137
- // Try to match the url against the EMailProtectionFunction.
138
- var func = FCKConfig.EMailProtectionFunction ;
139
- if ( func != null )
140
- {
141
- try
142
- {
143
- // Escape special chars.
144
- func = func.replace( /([\/^$*+.?()\[\]])/g, '\\$1' ) ;
145
-
146
- // Define the possible keys.
147
- var keys = new Array('NAME', 'DOMAIN', 'SUBJECT', 'BODY') ;
148
-
149
- // Get the order of the keys (hold them in the array <pos>) and
150
- // the function replaced by regular expression patterns.
151
- var sFunc = func ;
152
- var pos = new Array() ;
153
- for ( var i = 0 ; i < keys.length ; i ++ )
154
- {
155
- var rexp = new RegExp( keys[i] ) ;
156
- var p = func.search( rexp ) ;
157
- if ( p >= 0 )
158
- {
159
- sFunc = sFunc.replace( rexp, '\'([^\']*)\'' ) ;
160
- pos[pos.length] = p + ':' + keys[i] ;
161
- }
162
- }
163
-
164
- // Sort the available keys.
165
- pos.sort( oParser.SortNumerical ) ;
166
-
167
- // Replace the excaped single quotes in the url, such they do
168
- // not affect the regexp afterwards.
169
- aLinkInfo[2] = aLinkInfo[2].replace( /\\'/g, '###SINGLE_QUOTE###' ) ;
170
-
171
- // Create the regexp and execute it.
172
- var rFunc = new RegExp( '^' + sFunc + '$' ) ;
173
- var aMatch = rFunc.exec( aLinkInfo[2] ) ;
174
- if ( aMatch )
175
- {
176
- var aInfo = new Array();
177
- for ( var i = 1 ; i < aMatch.length ; i ++ )
178
- {
179
- var k = pos[i-1].match(/^\d+:(.+)$/) ;
180
- aInfo[k[1]] = aMatch[i].replace(/###SINGLE_QUOTE###/g, '\'') ;
181
- }
182
-
183
- // Fill the EMailInfo object that will be returned
184
- oEMailInfo.Address = aInfo['NAME'] + '@' + aInfo['DOMAIN'] ;
185
- oEMailInfo.Subject = decodeURIComponent( aInfo['SUBJECT'] ) ;
186
- oEMailInfo.Body = decodeURIComponent( aInfo['BODY'] ) ;
187
-
188
- return oEMailInfo ;
189
- }
190
- }
191
- catch (e)
192
- {
193
- }
194
- }
195
-
196
- // Try to match the email against the encode protection.
197
- var aMatch = aLinkInfo[2].match( /^(?:void\()?location\.href='mailto:'\+(String\.fromCharCode\([\d,]+\))\+'(.*)'\)?$/ ) ;
198
- if ( aMatch )
199
- {
200
- // The link is encoded
201
- oEMailInfo.Address = eval( aMatch[1] ) ;
202
- if ( aMatch[2] )
203
- {
204
- var oEMailParams = oParser.ParseEMailParams( aMatch[2] ) ;
205
- oEMailInfo.Subject = oEMailParams.Subject ;
206
- oEMailInfo.Body = oEMailParams.Body ;
207
- }
208
- return oEMailInfo ;
209
- }
210
- }
211
- return false;
212
- }
213
-
214
- oParser.CreateEMailUri = function( address, subject, body )
215
- {
216
- // Switch for the EMailProtection setting.
217
- switch ( FCKConfig.EMailProtection )
218
- {
219
- case 'function' :
220
- var func = FCKConfig.EMailProtectionFunction ;
221
- if ( func == null )
222
- {
223
- if ( FCKConfig.Debug )
224
- {
225
- alert('EMailProtection alert!\nNo function defined. Please set "FCKConfig.EMailProtectionFunction"') ;
226
- }
227
- return '';
228
- }
229
-
230
- // Split the email address into name and domain parts.
231
- var aAddressParts = address.split( '@', 2 ) ;
232
- if ( aAddressParts[1] == undefined )
233
- {
234
- aAddressParts[1] = '' ;
235
- }
236
-
237
- // Replace the keys by their values (embedded in single quotes).
238
- func = func.replace(/NAME/g, "'" + aAddressParts[0].replace(/'/g, '\\\'') + "'") ;
239
- func = func.replace(/DOMAIN/g, "'" + aAddressParts[1].replace(/'/g, '\\\'') + "'") ;
240
- func = func.replace(/SUBJECT/g, "'" + encodeURIComponent( subject ).replace(/'/g, '\\\'') + "'") ;
241
- func = func.replace(/BODY/g, "'" + encodeURIComponent( body ).replace(/'/g, '\\\'') + "'") ;
242
-
243
- return 'javascript:' + func ;
244
-
245
- case 'encode' :
246
- var aParams = [] ;
247
- var aAddressCode = [] ;
248
-
249
- if ( subject.length > 0 )
250
- aParams.push( 'subject='+ encodeURIComponent( subject ) ) ;
251
- if ( body.length > 0 )
252
- aParams.push( 'body=' + encodeURIComponent( body ) ) ;
253
- for ( var i = 0 ; i < address.length ; i++ )
254
- aAddressCode.push( address.charCodeAt( i ) ) ;
255
-
256
- return 'javascript:void(location.href=\'mailto:\'+String.fromCharCode(' + aAddressCode.join( ',' ) + ')+\'?' + aParams.join( '&' ) + '\')' ;
257
- }
258
-
259
- // EMailProtection 'none'
260
-
261
- var sBaseUri = 'mailto:' + address ;
262
-
263
- var sParams = '' ;
264
-
265
- if ( subject.length > 0 )
266
- sParams = '?subject=' + encodeURIComponent( subject ) ;
267
-
268
- if ( body.length > 0 )
269
- {
270
- sParams += ( sParams.length == 0 ? '?' : '&' ) ;
271
- sParams += 'body=' + encodeURIComponent( body ) ;
272
- }
273
-
274
- return sBaseUri + sParams ;
275
- }
276
-
277
- //#### Initialization Code
278
-
279
- // oLink: The actual selected link in the editor.
280
- var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ;
281
- if ( oLink )
282
- FCK.Selection.SelectNode( oLink ) ;
283
-
284
- window.onload = function()
285
- {
286
- // Translate the dialog box texts.
287
- oEditor.FCKLanguageManager.TranslatePage(document) ;
288
-
289
- // Fill the Anchor Names and Ids combos.
290
- LoadAnchorNamesAndIds() ;
291
-
292
- // Load the selected link information (if any).
293
- LoadSelection() ;
294
-
295
- // Update the dialog box.
296
- SetLinkType( GetE('cmbLinkType').value ) ;
297
-
298
- // Show/Hide the "Browse Server" button.
299
- GetE('divBrowseServer').style.display = FCKConfig.LinkBrowser ? '' : 'none' ;
300
-
301
- // Show the initial dialog content.
302
- GetE('divInfo').style.display = '' ;
303
-
304
- // Set the actual uploader URL.
305
- if ( FCKConfig.LinkUpload )
306
- GetE('frmUpload').action = FCKConfig.LinkUploadURL ;
307
-
308
- // Set the default target (from configuration).
309
- SetDefaultTarget() ;
310
-
311
- // Activate the "OK" button.
312
- dialog.SetOkButton( true ) ;
313
-
314
- // Select the first field.
315
- switch( GetE('cmbLinkType').value )
316
- {
317
- case 'url' :
318
- SelectField( 'txtUrl' ) ;
319
- break ;
320
- case 'email' :
321
- SelectField( 'txtEMailAddress' ) ;
322
- break ;
323
- case 'anchor' :
324
- if ( GetE('divSelAnchor').style.display != 'none' )
325
- SelectField( 'cmbAnchorName' ) ;
326
- else
327
- SelectField( 'cmbLinkType' ) ;
328
- }
329
- }
330
-
331
- var bHasAnchors ;
332
-
333
- function LoadAnchorNamesAndIds()
334
- {
335
- // Since version 2.0, the anchors are replaced in the DOM by IMGs so the user see the icon
336
- // to edit them. So, we must look for that images now.
337
- var aAnchors = new Array() ;
338
- var i ;
339
- var oImages = oEditor.FCK.EditorDocument.getElementsByTagName( 'IMG' ) ;
340
- for( i = 0 ; i < oImages.length ; i++ )
341
- {
342
- if ( oImages[i].getAttribute('_fckanchor') )
343
- aAnchors[ aAnchors.length ] = oEditor.FCK.GetRealElement( oImages[i] ) ;
344
- }
345
-
346
- // Add also real anchors
347
- var oLinks = oEditor.FCK.EditorDocument.getElementsByTagName( 'A' ) ;
348
- for( i = 0 ; i < oLinks.length ; i++ )
349
- {
350
- if ( oLinks[i].name && ( oLinks[i].name.length > 0 ) )
351
- aAnchors[ aAnchors.length ] = oLinks[i] ;
352
- }
353
-
354
- var aIds = FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ;
355
-
356
- bHasAnchors = ( aAnchors.length > 0 || aIds.length > 0 ) ;
357
-
358
- for ( i = 0 ; i < aAnchors.length ; i++ )
359
- {
360
- var sName = aAnchors[i].name ;
361
- if ( sName && sName.length > 0 )
362
- FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ;
363
- }
364
-
365
- for ( i = 0 ; i < aIds.length ; i++ )
366
- {
367
- FCKTools.AddSelectOption( GetE('cmbAnchorId'), aIds[i], aIds[i] ) ;
368
- }
369
-
370
- ShowE( 'divSelAnchor' , bHasAnchors ) ;
371
- ShowE( 'divNoAnchor' , !bHasAnchors ) ;
372
- }
373
-
374
- function LoadSelection()
375
- {
376
- if ( !oLink ) return ;
377
-
378
- var sType = 'url' ;
379
-
380
- // Get the actual Link href.
381
- var sHRef = oLink.getAttribute( '_fcksavedurl' ) ;
382
- if ( sHRef == null )
383
- sHRef = oLink.getAttribute( 'href' , 2 ) || '' ;
384
-
385
- // Look for a popup javascript link.
386
- var oPopupMatch = oRegex.PopupUri.exec( sHRef ) ;
387
- if( oPopupMatch )
388
- {
389
- GetE('cmbTarget').value = 'popup' ;
390
- sHRef = oPopupMatch[1] ;
391
- FillPopupFields( oPopupMatch[2], oPopupMatch[3] ) ;
392
- SetTarget( 'popup' ) ;
393
- }
394
-
395
- // Accessible popups, the popup data is in the onclick attribute
396
- if ( !oPopupMatch )
397
- {
398
- var onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ;
399
- if ( onclick )
400
- {
401
- // Decode the protected string
402
- onclick = decodeURIComponent( onclick ) ;
403
-
404
- oPopupMatch = oRegex.OnClickPopup.exec( onclick ) ;
405
- if( oPopupMatch )
406
- {
407
- GetE( 'cmbTarget' ).value = 'popup' ;
408
- FillPopupFields( oPopupMatch[1], oPopupMatch[2] ) ;
409
- SetTarget( 'popup' ) ;
410
- }
411
- }
412
- }
413
-
414
- // Search for the protocol.
415
- var sProtocol = oRegex.UriProtocol.exec( sHRef ) ;
416
-
417
- // Search for a protected email link.
418
- var oEMailInfo = oParser.ParseEMailUri( sHRef );
419
-
420
- if ( oEMailInfo )
421
- {
422
- sType = 'email' ;
423
-
424
- GetE('txtEMailAddress').value = oEMailInfo.Address ;
425
- GetE('txtEMailSubject').value = oEMailInfo.Subject ;
426
- GetE('txtEMailBody').value = oEMailInfo.Body ;
427
- }
428
- else if ( sProtocol )
429
- {
430
- sProtocol = sProtocol[0].toLowerCase() ;
431
- GetE('cmbLinkProtocol').value = sProtocol ;
432
-
433
- // Remove the protocol and get the remaining URL.
434
- var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ;
435
- sType = 'url' ;
436
- GetE('txtUrl').value = sUrl ;
437
- }
438
- else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link.
439
- {
440
- sType = 'anchor' ;
441
- GetE('cmbAnchorName').value = GetE('cmbAnchorId').value = sHRef.substr(1) ;
442
- }
443
- else // It is another type of link.
444
- {
445
- sType = 'url' ;
446
-
447
- GetE('cmbLinkProtocol').value = '' ;
448
- GetE('txtUrl').value = sHRef ;
449
- }
450
-
451
- if ( !oPopupMatch )
452
- {
453
- // Get the target.
454
- var sTarget = oLink.target ;
455
-
456
- if ( sTarget && sTarget.length > 0 )
457
- {
458
- if ( oRegex.ReserveTarget.test( sTarget ) )
459
- {
460
- sTarget = sTarget.toLowerCase() ;
461
- GetE('cmbTarget').value = sTarget ;
462
- }
463
- else
464
- GetE('cmbTarget').value = 'frame' ;
465
- GetE('txtTargetFrame').value = sTarget ;
466
- }
467
- }
468
-
469
- // Get Advances Attributes
470
- GetE('txtAttId').value = oLink.id ;
471
- GetE('txtAttName').value = oLink.name ;
472
- GetE('cmbAttLangDir').value = oLink.dir ;
473
- GetE('txtAttLangCode').value = oLink.lang ;
474
- GetE('txtAttAccessKey').value = oLink.accessKey ;
475
- GetE('txtAttTabIndex').value = oLink.tabIndex <= 0 ? '' : oLink.tabIndex ;
476
- GetE('txtAttTitle').value = oLink.title ;
477
- GetE('txtAttContentType').value = oLink.type ;
478
- GetE('txtAttCharSet').value = oLink.charset ;
479
-
480
- var sClass ;
481
- if ( oEditor.FCKBrowserInfo.IsIE )
482
- {
483
- sClass = oLink.getAttribute('className',2) || '' ;
484
- // Clean up temporary classes for internal use:
485
- sClass = sClass.replace( FCKRegexLib.FCK_Class, '' ) ;
486
-
487
- GetE('txtAttStyle').value = oLink.style.cssText ;
488
- }
489
- else
490
- {
491
- sClass = oLink.getAttribute('class',2) || '' ;
492
- GetE('txtAttStyle').value = oLink.getAttribute('style',2) || '' ;
493
- }
494
- GetE('txtAttClasses').value = sClass ;
495
-
496
- // Update the Link type combo.
497
- GetE('cmbLinkType').value = sType ;
498
- }
499
-
500
- //#### Link type selection.
501
- function SetLinkType( linkType )
502
- {
503
- ShowE('divLinkTypeUrl' , (linkType == 'url') ) ;
504
- ShowE('divLinkTypeAnchor' , (linkType == 'anchor') ) ;
505
- ShowE('divLinkTypeEMail' , (linkType == 'email') ) ;
506
-
507
- if ( !FCKConfig.LinkDlgHideTarget )
508
- dialog.SetTabVisibility( 'Target' , (linkType == 'url') ) ;
509
-
510
- if ( FCKConfig.LinkUpload )
511
- dialog.SetTabVisibility( 'Upload' , (linkType == 'url') ) ;
512
-
513
- if ( !FCKConfig.LinkDlgHideAdvanced )
514
- dialog.SetTabVisibility( 'Advanced' , (linkType != 'anchor' || bHasAnchors) ) ;
515
-
516
- if ( linkType == 'email' )
517
- dialog.SetAutoSize( true ) ;
518
- }
519
-
520
- //#### Target type selection.
521
- function SetTarget( targetType )
522
- {
523
- GetE('tdTargetFrame').style.display = ( targetType == 'popup' ? 'none' : '' ) ;
524
- GetE('tdPopupName').style.display =
525
- GetE('tablePopupFeatures').style.display = ( targetType == 'popup' ? '' : 'none' ) ;
526
-
527
- switch ( targetType )
528
- {
529
- case "_blank" :
530
- case "_self" :
531
- case "_parent" :
532
- case "_top" :
533
- GetE('txtTargetFrame').value = targetType ;
534
- break ;
535
- case "" :
536
- GetE('txtTargetFrame').value = '' ;
537
- break ;
538
- }
539
-
540
- if ( targetType == 'popup' )
541
- dialog.SetAutoSize( true ) ;
542
- }
543
-
544
- //#### Called while the user types the URL.
545
- function OnUrlChange()
546
- {
547
- var sUrl = GetE('txtUrl').value ;
548
- var sProtocol = oRegex.UrlOnChangeProtocol.exec( sUrl ) ;
549
-
550
- if ( sProtocol )
551
- {
552
- sUrl = sUrl.substr( sProtocol[0].length ) ;
553
- GetE('txtUrl').value = sUrl ;
554
- GetE('cmbLinkProtocol').value = sProtocol[0].toLowerCase() ;
555
- }
556
- else if ( oRegex.UrlOnChangeTestOther.test( sUrl ) )
557
- {
558
- GetE('cmbLinkProtocol').value = '' ;
559
- }
560
- }
561
-
562
- //#### Called while the user types the target name.
563
- function OnTargetNameChange()
564
- {
565
- var sFrame = GetE('txtTargetFrame').value ;
566
-
567
- if ( sFrame.length == 0 )
568
- GetE('cmbTarget').value = '' ;
569
- else if ( oRegex.ReserveTarget.test( sFrame ) )
570
- GetE('cmbTarget').value = sFrame.toLowerCase() ;
571
- else
572
- GetE('cmbTarget').value = 'frame' ;
573
- }
574
-
575
- // Accessible popups
576
- function BuildOnClickPopup()
577
- {
578
- var sWindowName = "'" + GetE('txtPopupName').value.replace(/\W/gi, "") + "'" ;
579
-
580
- var sFeatures = '' ;
581
- var aChkFeatures = document.getElementsByName( 'chkFeature' ) ;
582
- for ( var i = 0 ; i < aChkFeatures.length ; i++ )
583
- {
584
- if ( i > 0 ) sFeatures += ',' ;
585
- sFeatures += aChkFeatures[i].value + '=' + ( aChkFeatures[i].checked ? 'yes' : 'no' ) ;
586
- }
587
-
588
- if ( GetE('txtPopupWidth').value.length > 0 ) sFeatures += ',width=' + GetE('txtPopupWidth').value ;
589
- if ( GetE('txtPopupHeight').value.length > 0 ) sFeatures += ',height=' + GetE('txtPopupHeight').value ;
590
- if ( GetE('txtPopupLeft').value.length > 0 ) sFeatures += ',left=' + GetE('txtPopupLeft').value ;
591
- if ( GetE('txtPopupTop').value.length > 0 ) sFeatures += ',top=' + GetE('txtPopupTop').value ;
592
-
593
- if ( sFeatures != '' )
594
- sFeatures = sFeatures + ",status" ;
595
-
596
- return ( "window.open(this.href," + sWindowName + ",'" + sFeatures + "'); return false" ) ;
597
- }
598
-
599
- //#### Fills all Popup related fields.
600
- function FillPopupFields( windowName, features )
601
- {
602
- if ( windowName )
603
- GetE('txtPopupName').value = windowName ;
604
-
605
- var oFeatures = new Object() ;
606
- var oFeaturesMatch ;
607
- while( ( oFeaturesMatch = oRegex.PopupFeatures.exec( features ) ) != null )
608
- {
609
- var sValue = oFeaturesMatch[2] ;
610
- if ( sValue == ( 'yes' || '1' ) )
611
- oFeatures[ oFeaturesMatch[1] ] = true ;
612
- else if ( ! isNaN( sValue ) && sValue != 0 )
613
- oFeatures[ oFeaturesMatch[1] ] = sValue ;
614
- }
615
-
616
- // Update all features check boxes.
617
- var aChkFeatures = document.getElementsByName('chkFeature') ;
618
- for ( var i = 0 ; i < aChkFeatures.length ; i++ )
619
- {
620
- if ( oFeatures[ aChkFeatures[i].value ] )
621
- aChkFeatures[i].checked = true ;
622
- }
623
-
624
- // Update position and size text boxes.
625
- if ( oFeatures['width'] ) GetE('txtPopupWidth').value = oFeatures['width'] ;
626
- if ( oFeatures['height'] ) GetE('txtPopupHeight').value = oFeatures['height'] ;
627
- if ( oFeatures['left'] ) GetE('txtPopupLeft').value = oFeatures['left'] ;
628
- if ( oFeatures['top'] ) GetE('txtPopupTop').value = oFeatures['top'] ;
629
- }
630
-
631
- //#### The OK button was hit.
632
- function Ok()
633
- {
634
- var sUri, sInnerHtml ;
635
- oEditor.FCKUndo.SaveUndoStep() ;
636
-
637
- switch ( GetE('cmbLinkType').value )
638
- {
639
- case 'url' :
640
- sUri = GetE('txtUrl').value ;
641
-
642
- if ( sUri.length == 0 )
643
- {
644
- alert( FCKLang.DlnLnkMsgNoUrl ) ;
645
- return false ;
646
- }
647
-
648
- sUri = GetE('cmbLinkProtocol').value + sUri ;
649
-
650
- break ;
651
-
652
- case 'email' :
653
- sUri = GetE('txtEMailAddress').value ;
654
-
655
- if ( sUri.length == 0 )
656
- {
657
- alert( FCKLang.DlnLnkMsgNoEMail ) ;
658
- return false ;
659
- }
660
-
661
- sUri = oParser.CreateEMailUri(
662
- sUri,
663
- GetE('txtEMailSubject').value,
664
- GetE('txtEMailBody').value ) ;
665
- break ;
666
-
667
- case 'anchor' :
668
- var sAnchor = GetE('cmbAnchorName').value ;
669
- if ( sAnchor.length == 0 ) sAnchor = GetE('cmbAnchorId').value ;
670
-
671
- if ( sAnchor.length == 0 )
672
- {
673
- alert( FCKLang.DlnLnkMsgNoAnchor ) ;
674
- return false ;
675
- }
676
-
677
- sUri = '#' + sAnchor ;
678
- break ;
679
- }
680
-
681
- // If no link is selected, create a new one (it may result in more than one link creation - #220).
682
- var aLinks = oLink ? [ oLink ] : oEditor.FCK.CreateLink( sUri, true ) ;
683
-
684
- // If no selection, no links are created, so use the uri as the link text (by dom, 2006-05-26)
685
- var aHasSelection = ( aLinks.length > 0 ) ;
686
- if ( !aHasSelection )
687
- {
688
- sInnerHtml = sUri;
689
-
690
- // Built a better text for empty links.
691
- switch ( GetE('cmbLinkType').value )
692
- {
693
- // anchor: use old behavior --> return true
694
- case 'anchor':
695
- sInnerHtml = sInnerHtml.replace( /^#/, '' ) ;
696
- break ;
697
-
698
- // url: try to get path
699
- case 'url':
700
- var oLinkPathRegEx = new RegExp("//?([^?\"']+)([?].*)?$") ;
701
- var asLinkPath = oLinkPathRegEx.exec( sUri ) ;
702
- if (asLinkPath != null)
703
- sInnerHtml = asLinkPath[1]; // use matched path
704
- break ;
705
-
706
- // mailto: try to get email address
707
- case 'email':
708
- sInnerHtml = GetE('txtEMailAddress').value ;
709
- break ;
710
- }
711
-
712
- // Create a new (empty) anchor.
713
- aLinks = [ oEditor.FCK.InsertElement( 'a' ) ] ;
714
- }
715
-
716
- for ( var i = 0 ; i < aLinks.length ; i++ )
717
- {
718
- oLink = aLinks[i] ;
719
-
720
- if ( aHasSelection )
721
- sInnerHtml = oLink.innerHTML ; // Save the innerHTML (IE changes it if it is like an URL).
722
-
723
- oLink.href = sUri ;
724
- SetAttribute( oLink, '_fcksavedurl', sUri ) ;
725
-
726
- var onclick;
727
- // Accessible popups
728
- if( GetE('cmbTarget').value == 'popup' )
729
- {
730
- onclick = BuildOnClickPopup() ;
731
- // Encode the attribute
732
- onclick = encodeURIComponent( " onclick=\"" + onclick + "\"" ) ;
733
- SetAttribute( oLink, 'onclick_fckprotectedatt', onclick ) ;
734
- }
735
- else
736
- {
737
- // Check if the previous onclick was for a popup:
738
- // In that case remove the onclick handler.
739
- onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ;
740
- if ( onclick )
741
- {
742
- // Decode the protected string
743
- onclick = decodeURIComponent( onclick ) ;
744
-
745
- if( oRegex.OnClickPopup.test( onclick ) )
746
- SetAttribute( oLink, 'onclick_fckprotectedatt', '' ) ;
747
- }
748
- }
749
-
750
- oLink.innerHTML = sInnerHtml ; // Set (or restore) the innerHTML
751
-
752
- // Target
753
- if( GetE('cmbTarget').value != 'popup' )
754
- SetAttribute( oLink, 'target', GetE('txtTargetFrame').value ) ;
755
- else
756
- SetAttribute( oLink, 'target', null ) ;
757
-
758
- // Let's set the "id" only for the first link to avoid duplication.
759
- if ( i == 0 )
760
- SetAttribute( oLink, 'id', GetE('txtAttId').value ) ;
761
-
762
- // Advances Attributes
763
- SetAttribute( oLink, 'name' , GetE('txtAttName').value ) ;
764
- SetAttribute( oLink, 'dir' , GetE('cmbAttLangDir').value ) ;
765
- SetAttribute( oLink, 'lang' , GetE('txtAttLangCode').value ) ;
766
- SetAttribute( oLink, 'accesskey', GetE('txtAttAccessKey').value ) ;
767
- SetAttribute( oLink, 'tabindex' , ( GetE('txtAttTabIndex').value > 0 ? GetE('txtAttTabIndex').value : null ) ) ;
768
- SetAttribute( oLink, 'title' , GetE('txtAttTitle').value ) ;
769
- SetAttribute( oLink, 'type' , GetE('txtAttContentType').value ) ;
770
- SetAttribute( oLink, 'charset' , GetE('txtAttCharSet').value ) ;
771
-
772
- if ( oEditor.FCKBrowserInfo.IsIE )
773
- {
774
- var sClass = GetE('txtAttClasses').value ;
775
- // If it's also an anchor add an internal class
776
- if ( GetE('txtAttName').value.length != 0 )
777
- sClass += ' FCK__AnchorC' ;
778
- SetAttribute( oLink, 'className', sClass ) ;
779
-
780
- oLink.style.cssText = GetE('txtAttStyle').value ;
781
- }
782
- else
783
- {
784
- SetAttribute( oLink, 'class', GetE('txtAttClasses').value ) ;
785
- SetAttribute( oLink, 'style', GetE('txtAttStyle').value ) ;
786
- }
787
- }
788
-
789
- // Select the (first) link.
790
- oEditor.FCKSelection.SelectNode( aLinks[0] );
791
-
792
- return true ;
793
- }
794
-
795
- function BrowseServer()
796
- {
797
- OpenFileBrowser( FCKConfig.LinkBrowserURL, FCKConfig.LinkBrowserWindowWidth, FCKConfig.LinkBrowserWindowHeight ) ;
798
- }
799
-
800
- function SetUrl( url )
801
- {
802
- GetE('txtUrl').value = url ;
803
- OnUrlChange() ;
804
- dialog.SetSelectedTab( 'Info' ) ;
805
- }
806
-
807
- function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
808
- {
809
- // Remove animation
810
- window.parent.Throbber.Hide() ;
811
- GetE( 'divUpload' ).style.display = '' ;
812
-
813
- switch ( errorNumber )
814
- {
815
- case 0 : // No errors
816
- alert( 'Your file has been successfully uploaded' ) ;
817
- break ;
818
- case 1 : // Custom error
819
- alert( customMsg ) ;
820
- return ;
821
- case 101 : // Custom warning
822
- alert( customMsg ) ;
823
- break ;
824
- case 201 :
825
- alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
826
- break ;
827
- case 202 :
828
- alert( 'Invalid file type' ) ;
829
- return ;
830
- case 203 :
831
- alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
832
- return ;
833
- case 500 :
834
- alert( 'The connector is disabled' ) ;
835
- break ;
836
- default :
837
- alert( 'Error on file upload. Error number: ' + errorNumber ) ;
838
- return ;
839
- }
840
-
841
- SetUrl( fileUrl ) ;
842
- GetE('frmUpload').reset() ;
843
- }
844
-
845
- var oUploadAllowedExtRegex = new RegExp( FCKConfig.LinkUploadAllowedExtensions, 'i' ) ;
846
- var oUploadDeniedExtRegex = new RegExp( FCKConfig.LinkUploadDeniedExtensions, 'i' ) ;
847
-
848
- function CheckUpload()
849
- {
850
- var sFile = GetE('txtUploadFile').value ;
851
-
852
- if ( sFile.length == 0 )
853
- {
854
- alert( 'Please select a file to upload' ) ;
855
- return false ;
856
- }
857
-
858
- if ( ( FCKConfig.LinkUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
859
- ( FCKConfig.LinkUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
860
- {
861
- OnUploadCompleted( 202 ) ;
862
- return false ;
863
- }
864
-
865
- // Show animation
866
- window.parent.Throbber.Show( 100 ) ;
867
- GetE( 'divUpload' ).style.display = 'none' ;
868
-
869
- return true ;
870
- }
871
-
872
- function SetDefaultTarget()
873
- {
874
- var target = FCKConfig.DefaultLinkTarget || '' ;
875
-
876
- if ( oLink || target.length == 0 )
877
- return ;
878
-
879
- switch ( target )
880
- {
881
- case '_blank' :
882
- case '_self' :
883
- case '_parent' :
884
- case '_top' :
885
- GetE('cmbTarget').value = target ;
886
- break ;
887
- default :
888
- GetE('cmbTarget').value = 'frame' ;
889
- break ;
890
- }
891
-
892
- GetE('txtTargetFrame').value = target ;
893
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_listprop.html DELETED
@@ -1,120 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Bulleted List dialog window.
23
- -->
24
- <html xmlns="http://www.w3.org/1999/xhtml">
25
- <head>
26
- <title></title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta content="noindex, nofollow" name="robots" />
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
-
32
- var dialog = window.parent ;
33
- var oEditor = dialog.InnerDialogLoaded() ;
34
-
35
- // Gets the document DOM
36
- var oDOM = oEditor.FCK.EditorDocument ;
37
- var sListType = ( location.search == '?OL' ? 'OL' : 'UL' ) ;
38
-
39
- var oActiveEl = dialog.Selection.GetSelection().MoveToAncestorNode( sListType ) ;
40
- var oActiveSel ;
41
-
42
- window.onload = function()
43
- {
44
- // First of all, translate the dialog box texts
45
- oEditor.FCKLanguageManager.TranslatePage(document) ;
46
-
47
- if ( sListType == 'UL' )
48
- oActiveSel = GetE('selBulleted') ;
49
- else
50
- {
51
- if ( oActiveEl )
52
- {
53
- oActiveSel = GetE('selNumbered') ;
54
- GetE('eStart').style.display = '' ;
55
- GetE('txtStartPosition').value = GetAttribute( oActiveEl, 'start' ) ;
56
- }
57
- }
58
-
59
- oActiveSel.style.display = '' ;
60
-
61
- if ( oActiveEl )
62
- {
63
- if ( oActiveEl.getAttribute('type') )
64
- oActiveSel.value = oActiveEl.getAttribute('type') ;
65
- }
66
-
67
- dialog.SetOkButton( true ) ;
68
- dialog.SetAutoSize( true ) ;
69
-
70
- SelectField( sListType == 'OL' ? 'txtStartPosition' : 'selBulleted' ) ;
71
- }
72
-
73
- function Ok()
74
- {
75
- if ( oActiveEl ){
76
- SetAttribute( oActiveEl, 'type' , oActiveSel.value ) ;
77
- if(oActiveEl.tagName == 'OL')
78
- SetAttribute( oActiveEl, 'start', GetE('txtStartPosition').value ) ;
79
- }
80
-
81
- return true ;
82
- }
83
-
84
- </script>
85
- </head>
86
- <body style="overflow: hidden">
87
- <table width="100%" style="height: 100%">
88
- <tr>
89
- <td style="text-align:center">
90
- <table cellspacing="0" cellpadding="0" border="0" style="margin-left: auto; margin-right: auto;">
91
- <tr>
92
- <td id="eStart" style="display: none; padding-right: 5px; padding-left: 5px">
93
- <span fcklang="DlgLstStart">Start</span><br />
94
- <input type="text" id="txtStartPosition" size="5" />
95
- </td>
96
- <td style="padding-right: 5px; padding-left: 5px">
97
- <span fcklang="DlgLstType">List Type</span><br />
98
- <select id="selBulleted" style="display: none">
99
- <option value="" selected="selected"></option>
100
- <option value="circle" fcklang="DlgLstTypeCircle">Circle</option>
101
- <option value="disc" fcklang="DlgLstTypeDisc">Disc</option>
102
- <option value="square" fcklang="DlgLstTypeSquare">Square</option>
103
- </select>
104
- <select id="selNumbered" style="display: none">
105
- <option value="" selected="selected"></option>
106
- <option value="1" fcklang="DlgLstTypeNumbers">Numbers (1, 2, 3)</option>
107
- <option value="a" fcklang="DlgLstTypeLCase">Lowercase Letters (a, b, c)</option>
108
- <option value="A" fcklang="DlgLstTypeUCase">Uppercase Letters (A, B, C)</option>
109
- <option value="i" fcklang="DlgLstTypeSRoman">Small Roman Numerals (i, ii, iii)</option>
110
- <option value="I" fcklang="DlgLstTypeLRoman">Large Roman Numerals (I, II, III)</option>
111
- </select>
112
- &nbsp;
113
- </td>
114
- </tr>
115
- </table>
116
- </td>
117
- </tr>
118
- </table>
119
- </body>
120
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_paste.html DELETED
@@ -1,347 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * This dialog is shown when, for some reason (usually security settings),
23
- * the user is not able to paste data from the clipboard to the editor using
24
- * the toolbar buttons or the context menu.
25
- -->
26
- <html xmlns="http://www.w3.org/1999/xhtml">
27
- <head>
28
- <title></title>
29
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
- <meta name="robots" content="noindex, nofollow" />
31
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
32
- <script type="text/javascript">
33
- var dialog = window.parent ;
34
- var oEditor = dialog.InnerDialogLoaded() ;
35
- var FCK = oEditor.FCK;
36
- var FCKTools = oEditor.FCKTools ;
37
- var FCKConfig = oEditor.FCKConfig ;
38
- var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
39
-
40
- window.onload = function ()
41
- {
42
- // First of all, translate the dialog box texts
43
- oEditor.FCKLanguageManager.TranslatePage(document) ;
44
-
45
- var sPastingType = dialog.Args().CustomValue ;
46
-
47
- if ( sPastingType == 'Word' || sPastingType == 'Security' )
48
- {
49
- if ( sPastingType == 'Security' )
50
- document.getElementById( 'xSecurityMsg' ).style.display = '' ;
51
-
52
- // For document.domain compatibility (#123) we must do all the magic in
53
- // the URL for IE.
54
- var sFrameUrl = !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE ?
55
- 'javascript:void(0)' :
56
- 'javascript:void( (function(){' +
57
- 'document.open() ;' +
58
- 'document.domain=\'' + document.domain + '\' ;' +
59
- 'document.write(\'<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>\') ;' +
60
- 'document.close() ;' +
61
- 'document.body.contentEditable = true ;' +
62
- 'window.focus() ;' +
63
- '})() )' ;
64
-
65
- var eFrameSpace = document.getElementById( 'xFrameSpace' ) ;
66
- eFrameSpace.innerHTML = '<iframe id="frmData" src="' + sFrameUrl + '" ' +
67
- 'height="98%" width="99%" frameborder="0" style="border: #000000 1px; background-color: #ffffff"><\/iframe>' ;
68
-
69
- var oFrame = eFrameSpace.firstChild ;
70
-
71
- if ( !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE )
72
- {
73
- // Avoid errors if the pasted content has any script that fails: #389
74
- var oDoc = oFrame.contentWindow.document ;
75
- oDoc.open() ;
76
- oDoc.write('<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>') ;
77
- oDoc.close() ;
78
-
79
- if ( FCKBrowserInfo.IsIE )
80
- oDoc.body.contentEditable = true ;
81
- else
82
- oDoc.designMode = 'on' ;
83
-
84
- oFrame.contentWindow.focus();
85
- }
86
- }
87
- else
88
- {
89
- document.getElementById('txtData').style.display = '' ;
90
- SelectField( 'txtData' ) ;
91
- }
92
-
93
- if ( sPastingType != 'Word' )
94
- document.getElementById('oWordCommands').style.display = 'none' ;
95
-
96
- dialog.SetOkButton( true ) ;
97
- dialog.SetAutoSize( true ) ;
98
- }
99
-
100
- function Ok()
101
- {
102
- // Before doing anything, save undo snapshot.
103
- oEditor.FCKUndo.SaveUndoStep() ;
104
-
105
- var sHtml ;
106
-
107
- var sPastingType = dialog.Args().CustomValue ;
108
-
109
- if ( sPastingType == 'Word' || sPastingType == 'Security' )
110
- {
111
- var oFrame = document.getElementById('frmData') ;
112
- var oBody ;
113
-
114
- if ( oFrame.contentDocument )
115
- oBody = oFrame.contentDocument.body ;
116
- else
117
- oBody = oFrame.contentWindow.document.body ;
118
-
119
- if ( sPastingType == 'Word' )
120
- {
121
- // If a plugin creates a FCK.CustomCleanWord function it will be called instead of the default one
122
- if ( typeof( FCK.CustomCleanWord ) == 'function' )
123
- sHtml = FCK.CustomCleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
124
- else
125
- sHtml = CleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
126
- }
127
- else
128
- sHtml = oBody.innerHTML ;
129
-
130
- // Fix relative anchor URLs (IE automatically adds the current page URL).
131
- var re = new RegExp( window.location + "#", "g" ) ;
132
- sHtml = sHtml.replace( re, '#') ;
133
- }
134
- else
135
- {
136
- sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value ) ;
137
- sHtml = FCKTools.ProcessLineBreaks( oEditor, FCKConfig, sHtml ) ;
138
-
139
- // FCK.InsertHtml() does not work for us, since document fragments cannot contain node fragments. :(
140
- // Use the marker method instead. It's primitive, but it works.
141
- var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
142
- var oDoc = oEditor.FCK.EditorDocument ;
143
- dialog.Selection.EnsureSelection() ;
144
- range.MoveToSelection() ;
145
- range.DeleteContents() ;
146
- var marker = [] ;
147
- for ( var i = 0 ; i < 5 ; i++ )
148
- marker.push( parseInt(Math.random() * 100000, 10 ) ) ;
149
- marker = marker.join( "" ) ;
150
- range.InsertNode ( oDoc.createTextNode( marker ) ) ;
151
- var bookmark = range.CreateBookmark() ;
152
-
153
- // Now we've got a marker indicating the paste position in the editor document.
154
- // Find its position in the HTML code.
155
- var htmlString = oDoc.body.innerHTML ;
156
- var index = htmlString.indexOf( marker ) ;
157
-
158
- // Split it the HTML code up, add the code we generated, and put them back together.
159
- var htmlList = [] ;
160
- htmlList.push( htmlString.substr( 0, index ) ) ;
161
- htmlList.push( sHtml ) ;
162
- htmlList.push( htmlString.substr( index + marker.length ) ) ;
163
- htmlString = htmlList.join( "" ) ;
164
-
165
- if ( oEditor.FCKBrowserInfo.IsIE )
166
- oEditor.FCK.SetInnerHtml( htmlString ) ;
167
- else
168
- oDoc.body.innerHTML = htmlString ;
169
-
170
- range.MoveToBookmark( bookmark ) ;
171
- range.Collapse( false ) ;
172
- range.Select() ;
173
- range.Release() ;
174
- return true ;
175
- }
176
-
177
- oEditor.FCK.InsertHtml( sHtml ) ;
178
-
179
- return true ;
180
- }
181
-
182
- // This function will be called from the PasteFromWord dialog (fck_paste.html)
183
- // Input: oNode a DOM node that contains the raw paste from the clipboard
184
- // bIgnoreFont, bRemoveStyles booleans according to the values set in the dialog
185
- // Output: the cleaned string
186
- function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
187
- {
188
- var html = oNode.innerHTML ;
189
-
190
- html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
191
- html = html.replace(/<o:p>[\s\S]*?<\/o:p>/g, '&nbsp;') ;
192
-
193
- // Remove mso-xxx styles.
194
- html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
195
-
196
- // Remove margin styles.
197
- html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ;
198
- html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
199
-
200
- html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
201
- html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
202
-
203
- html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
204
-
205
- html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
206
-
207
- html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
208
-
209
- html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ;
210
- html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ;
211
-
212
- // Remove FONT face attributes.
213
- if ( bIgnoreFont )
214
- {
215
- html = html.replace( /\s*face="[^"]*"/gi, '' ) ;
216
- html = html.replace( /\s*face=[^ >]*/gi, '' ) ;
217
-
218
- html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ;
219
- }
220
-
221
- // Remove Class attributes
222
- html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
223
-
224
- // Remove styles.
225
- if ( bRemoveStyles )
226
- html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
227
-
228
- // Remove style, meta and link tags
229
- html = html.replace( /<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi, '' ) ;
230
- html = html.replace( /<(?:META|LINK)[^>]*>\s*/gi, '' ) ;
231
-
232
- // Remove empty styles.
233
- html = html.replace( /\s*style="\s*"/gi, '' ) ;
234
-
235
- html = html.replace( /<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi, '&nbsp;' ) ;
236
-
237
- html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
238
-
239
- // Remove Lang attributes
240
- html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
241
-
242
- html = html.replace( /<SPAN\s*>([\s\S]*?)<\/SPAN>/gi, '$1' ) ;
243
-
244
- html = html.replace( /<FONT\s*>([\s\S]*?)<\/FONT>/gi, '$1' ) ;
245
-
246
- // Remove XML elements and declarations
247
- html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
248
-
249
- // Remove w: tags with contents.
250
- html = html.replace( /<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi, '' ) ;
251
-
252
- // Remove Tags with XML namespace declarations: <o:p><\/o:p>
253
- html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
254
-
255
- // Remove comments [SF BUG-1481861].
256
- html = html.replace(/<\!--[\s\S]*?-->/g, '' ) ;
257
-
258
- html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
259
-
260
- html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
261
-
262
- // Remove "display:none" tags.
263
- html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig, '' ) ;
264
-
265
- // Remove language tags
266
- html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ;
267
-
268
- // Remove onmouseover and onmouseout events (from MS Word comments effect)
269
- html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3") ;
270
- html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3") ;
271
-
272
- if ( FCKConfig.CleanWordKeepsStructure )
273
- {
274
- // The original <Hn> tag send from Word is something like this: <Hn style="margin-top:0px;margin-bottom:0px">
275
- html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
276
-
277
- // Word likes to insert extra <font> tags, when using MSIE. (Wierd).
278
- html = html.replace( /<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
279
- html = html.replace( /<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
280
- }
281
- else
282
- {
283
- html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
284
- html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
285
- html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
286
- html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
287
- html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
288
- html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
289
-
290
- html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
291
-
292
- // Transform <P> to <DIV>
293
- var re = new RegExp( '(<P)([^>]*>[\\s\\S]*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error
294
- html = html.replace( re, '<div$2<\/div>' ) ;
295
-
296
- // Remove empty tags (three times, just to be sure).
297
- // This also removes any empty anchor
298
- html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
299
- html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
300
- html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
301
- }
302
-
303
- return html ;
304
- }
305
-
306
- </script>
307
-
308
- </head>
309
- <body style="overflow: hidden">
310
- <table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 98%">
311
- <tr>
312
- <td>
313
- <div id="xSecurityMsg" style="display: none">
314
- <span fcklang="DlgPasteSec">Because of your browser security settings,
315
- the editor is not able to access your clipboard data directly. You are required
316
- to paste it again in this window.</span><br />
317
- &nbsp;
318
- </div>
319
- <div>
320
- <span fcklang="DlgPasteMsg2">Please paste inside the following box using the keyboard
321
- (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.</span><br />
322
- &nbsp;
323
- </div>
324
- </td>
325
- </tr>
326
- <tr>
327
- <td id="xFrameSpace" valign="top" height="100%" style="border: #000000 1px solid">
328
- <textarea id="txtData" cols="80" rows="5" style="border: #000000 1px; display: none;
329
- width: 99%; height: 98%"></textarea>
330
- </td>
331
- </tr>
332
- <tr id="oWordCommands">
333
- <td>
334
-
335
- <input id="chkRemoveFont" type="checkbox" checked="checked" />
336
- <label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont">
337
- Ignore Font Face definitions</label>
338
- <br />
339
- <input id="chkRemoveStyles" type="checkbox" />
340
- <label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles">
341
- Remove Styles definitions</label>
342
-
343
- </td>
344
- </tr>
345
- </table>
346
- </body>
347
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_radiobutton.html DELETED
@@ -1,104 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Radio Button dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <title>Radio Button Properties</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
- <meta content="noindex, nofollow" name="robots">
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
-
32
- var dialog = window.parent ;
33
- var oEditor = dialog.InnerDialogLoaded() ;
34
-
35
- // Gets the document DOM
36
- var oDOM = oEditor.FCK.EditorDocument ;
37
-
38
- var oActiveEl = dialog.Selection.GetSelectedElement() ;
39
-
40
- window.onload = function()
41
- {
42
- // First of all, translate the dialog box texts
43
- oEditor.FCKLanguageManager.TranslatePage(document) ;
44
-
45
- if ( oActiveEl && oActiveEl.tagName.toUpperCase() == 'INPUT' && oActiveEl.type == 'radio' )
46
- {
47
- GetE('txtName').value = oActiveEl.name ;
48
- GetE('txtValue').value = oEditor.FCKBrowserInfo.IsIE ? oActiveEl.value : GetAttribute( oActiveEl, 'value' ) ;
49
- GetE('txtSelected').checked = oActiveEl.checked ;
50
- }
51
- else
52
- oActiveEl = null ;
53
-
54
- dialog.SetOkButton( true ) ;
55
- dialog.SetAutoSize( true ) ;
56
- SelectField( 'txtName' ) ;
57
- }
58
-
59
- function Ok()
60
- {
61
- oEditor.FCKUndo.SaveUndoStep() ;
62
-
63
- oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: 'radio' } ) ;
64
-
65
- if ( oEditor.FCKBrowserInfo.IsIE )
66
- oActiveEl.value = GetE('txtValue').value ;
67
- else
68
- SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
69
-
70
- var bIsChecked = GetE('txtSelected').checked ;
71
- SetAttribute( oActiveEl, 'checked', bIsChecked ? 'checked' : null ) ; // For Firefox
72
- oActiveEl.checked = bIsChecked ;
73
-
74
- return true ;
75
- }
76
-
77
- </script>
78
- </head>
79
- <body style="OVERFLOW: hidden" scroll="no">
80
- <table height="100%" width="100%">
81
- <tr>
82
- <td align="center">
83
- <table border="0" cellpadding="0" cellspacing="0" width="80%">
84
- <tr>
85
- <td>
86
- <span fckLang="DlgCheckboxName">Name</span><br>
87
- <input type="text" size="20" id="txtName" style="WIDTH: 100%">
88
- </td>
89
- </tr>
90
- <tr>
91
- <td>
92
- <span fckLang="DlgCheckboxValue">Value</span><br>
93
- <input type="text" size="20" id="txtValue" style="WIDTH: 100%">
94
- </td>
95
- </tr>
96
- <tr>
97
- <td><input type="checkbox" id="txtSelected"><label for="txtSelected" fckLang="DlgCheckboxSelected">Checked</label></td>
98
- </tr>
99
- </table>
100
- </td>
101
- </tr>
102
- </table>
103
- </body>
104
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_replace.html DELETED
@@ -1,650 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * "Find" and "Replace" dialog box window.
23
- -->
24
- <html xmlns="http://www.w3.org/1999/xhtml">
25
- <head>
26
- <title></title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta content="noindex, nofollow" name="robots" />
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript">
31
-
32
- var dialog = window.parent ;
33
- var oEditor = dialog.InnerDialogLoaded() ;
34
- var dialogArguments = dialog.Args() ;
35
-
36
- var FCKLang = oEditor.FCKLang ;
37
- var FCKDomTools = oEditor.FCKDomTools ;
38
- var FCKDomRange = oEditor.FCKDomRange ;
39
- var FCKListsLib = oEditor.FCKListsLib ;
40
- var FCKTools = oEditor.FCKTools ;
41
- var EditorDocument = oEditor.FCK.EditorDocument ;
42
- var HighlightStyle = oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ) ;
43
-
44
- dialog.AddTab( 'Find', FCKLang.DlgFindTitle ) ;
45
- dialog.AddTab( 'Replace', FCKLang.DlgReplaceTitle ) ;
46
- var idMap = {} ;
47
-
48
- function OnDialogTabChange( tabCode )
49
- {
50
- ShowE( 'divFind', ( tabCode == 'Find' ) ) ;
51
- ShowE( 'divReplace', ( tabCode == 'Replace' ) ) ;
52
- idMap['FindText'] = 'txtFind' + tabCode ;
53
- idMap['CheckCase'] = 'chkCase' + tabCode ;
54
- idMap['CheckWord'] = 'chkWord' + tabCode ;
55
-
56
- if ( tabCode == 'Replace' )
57
- dialog.SetAutoSize( true ) ;
58
- }
59
-
60
- GetNextNonEmptyTextNode = function( node, stopNode )
61
- {
62
- while ( ( node = FCKDomTools.GetNextSourceNode( node, false, 3, stopNode ) ) && node && node.length < 1 )
63
- 1 ;
64
- return node ;
65
- }
66
-
67
- CharacterCursor = function( arg )
68
- {
69
- if ( arg.nodeType && arg.nodeType == 9 )
70
- {
71
- this._textNode = GetNextNonEmptyTextNode( arg.body, arg.documentElement ) ;
72
- this._offset = 0 ;
73
- this._doc = arg ;
74
- }
75
- else
76
- {
77
- this._textNode = arguments[0] ;
78
- this._offset = arguments[1] ;
79
- this._doc = FCKTools.GetElementDocument( arguments[0] ) ;
80
- }
81
- }
82
- CharacterCursor.prototype =
83
- {
84
- GetCharacter : function()
85
- {
86
- return ( this._textNode && this._textNode.nodeValue.charAt( this._offset ) ) || null ;
87
- },
88
-
89
- // Non-normalized.
90
- GetTextNode : function()
91
- {
92
- return this._textNode ;
93
- },
94
-
95
- // Non-normalized.
96
- GetIndex : function()
97
- {
98
- return this._offset ;
99
- },
100
-
101
- // Return value means whehther we've crossed a line break or a paragraph boundary.
102
- MoveNext : function()
103
- {
104
- if ( this._offset < this._textNode.length - 1 )
105
- {
106
- this._offset++ ;
107
- return false ;
108
- }
109
-
110
- var crossed = false ;
111
- var curNode = this._textNode ;
112
- while ( ( curNode = FCKDomTools.GetNextSourceNode( curNode ) )
113
- && curNode && ( curNode.nodeType != 3 || curNode.length < 1 ) )
114
- {
115
- var tag = curNode.nodeName.toLowerCase() ;
116
- if ( FCKListsLib.BlockElements[tag] || tag == 'br' )
117
- crossed = true ;
118
- }
119
-
120
- this._textNode = curNode ;
121
- this._offset = 0 ;
122
- return crossed ;
123
- },
124
-
125
- // Return value means whehther we've crossed a line break or a paragraph boundary.
126
- MoveBack : function()
127
- {
128
- if ( this._offset > 0 && this._textNode.length > 0 )
129
- {
130
- this._offset = Math.min( this._offset - 1, this._textNode.length - 1 ) ;
131
- return false ;
132
- }
133
-
134
- var crossed = false ;
135
- var curNode = this._textNode ;
136
- while ( ( curNode = FCKDomTools.GetPreviousSourceNode( curNode ) )
137
- && curNode && ( curNode.nodeType != 3 || curNode.length < 1 ) )
138
- {
139
- var tag = curNode.nodeName.toLowerCase() ;
140
- if ( FCKListsLib.BlockElements[tag] || tag == 'br' )
141
- crossed = true ;
142
- }
143
-
144
- this._textNode = curNode ;
145
- this._offset = curNode && curNode.length - 1 ;
146
- return crossed ;
147
- },
148
-
149
- Clone : function()
150
- {
151
- return new CharacterCursor( this._textNode, this._offset ) ;
152
- }
153
- } ;
154
-
155
- CharacterRange = function( initCursor, maxLength )
156
- {
157
- this._cursors = initCursor.push ? initCursor : [initCursor] ;
158
- this._maxLength = maxLength ;
159
- this._highlightRange = null ;
160
- }
161
- CharacterRange.prototype =
162
- {
163
- ToDomRange : function()
164
- {
165
- var firstCursor = this._cursors[0] ;
166
- var lastCursor = this._cursors[ this._cursors.length - 1 ] ;
167
- var domRange = new FCKDomRange( FCKTools.GetElementWindow( firstCursor.GetTextNode() ) ) ;
168
- var w3cRange = domRange._Range = domRange.CreateRange() ;
169
- w3cRange.setStart( firstCursor.GetTextNode(), firstCursor.GetIndex() ) ;
170
- w3cRange.setEnd( lastCursor.GetTextNode(), lastCursor.GetIndex() + 1 ) ;
171
- domRange._UpdateElementInfo() ;
172
- return domRange ;
173
- },
174
-
175
- Highlight : function()
176
- {
177
- if ( this._cursors.length < 1 )
178
- return ;
179
-
180
- var domRange = this.ToDomRange() ;
181
- HighlightStyle.ApplyToRange( domRange, false, true ) ;
182
- this._highlightRange = domRange ;
183
-
184
- var charRange = CharacterRange.CreateFromDomRange( domRange ) ;
185
- var focusNode = domRange.StartNode ;
186
- if ( focusNode.nodeType != 1 )
187
- focusNode = focusNode.parentNode ;
188
- FCKDomTools.ScrollIntoView( focusNode, false ) ;
189
- this._cursors = charRange._cursors ;
190
- },
191
-
192
- RemoveHighlight : function()
193
- {
194
- if ( this._highlightRange )
195
- {
196
- HighlightStyle.RemoveFromRange( this._highlightRange, false, true ) ;
197
- var charRange = CharacterRange.CreateFromDomRange( this._highlightRange ) ;
198
- this._cursors = charRange._cursors ;
199
- this._highlightRange = null ;
200
- }
201
- },
202
-
203
- GetHighlightDomRange : function()
204
- {
205
- return this._highlightRange;
206
- },
207
-
208
- MoveNext : function()
209
- {
210
- var next = this._cursors[ this._cursors.length - 1 ].Clone() ;
211
- var retval = next.MoveNext() ;
212
- if ( retval )
213
- this._cursors = [] ;
214
- this._cursors.push( next ) ;
215
- if ( this._cursors.length > this._maxLength )
216
- this._cursors.shift() ;
217
- return retval ;
218
- },
219
-
220
- MoveBack : function()
221
- {
222
- var prev = this._cursors[0].Clone() ;
223
- var retval = prev.MoveBack() ;
224
- if ( retval )
225
- this._cursors = [] ;
226
- this._cursors.unshift( prev ) ;
227
- if ( this._cursors.length > this._maxLength )
228
- this._cursors.pop() ;
229
- return retval ;
230
- },
231
-
232
- GetEndCharacter : function()
233
- {
234
- if ( this._cursors.length < 1 )
235
- return null ;
236
- var retval = this._cursors[ this._cursors.length - 1 ].GetCharacter() ;
237
- return retval ;
238
- },
239
-
240
- GetNextRange : function( len )
241
- {
242
- if ( this._cursors.length == 0 )
243
- return null ;
244
- var cur = this._cursors[ this._cursors.length - 1 ].Clone() ;
245
- cur.MoveNext() ;
246
- return new CharacterRange( cur, len ) ;
247
- },
248
-
249
- GetCursors : function()
250
- {
251
- return this._cursors ;
252
- }
253
- } ;
254
-
255
- CharacterRange.CreateFromDomRange = function( domRange )
256
- {
257
- var w3cRange = domRange._Range ;
258
- var startContainer = w3cRange.startContainer ;
259
- var endContainer = w3cRange.endContainer ;
260
- var startTextNode, startIndex, endTextNode, endIndex ;
261
-
262
- if ( startContainer.nodeType == 3 )
263
- {
264
- startTextNode = startContainer ;
265
- startIndex = w3cRange.startOffset ;
266
- }
267
- else if ( domRange.StartNode.nodeType == 3 )
268
- {
269
- startTextNode = domRange.StartNode ;
270
- startIndex = 0 ;
271
- }
272
- else
273
- {
274
- startTextNode = GetNextNonEmptyTextNode( domRange.StartNode, domRange.StartNode.parentNode ) ;
275
- if ( !startTextNode )
276
- return null ;
277
- startIndex = 0 ;
278
- }
279
-
280
- if ( endContainer.nodeType == 3 && w3cRange.endOffset > 0 )
281
- {
282
- endTextNode = endContainer ;
283
- endIndex = w3cRange.endOffset - 1 ;
284
- }
285
- else
286
- {
287
- endTextNode = domRange.EndNode ;
288
- while ( endTextNode.nodeType != 3 )
289
- endTextNode = endTextNode.lastChild ;
290
- endIndex = endTextNode.length - 1 ;
291
- }
292
-
293
- var cursors = [] ;
294
- var current = new CharacterCursor( startTextNode, startIndex ) ;
295
- cursors.push( current ) ;
296
- if ( !( current.GetTextNode() == endTextNode && current.GetIndex() == endIndex ) && !domRange.CheckIsEmpty() )
297
- {
298
- do
299
- {
300
- current = current.Clone() ;
301
- current.MoveNext() ;
302
- cursors.push( current ) ;
303
- }
304
- while ( !( current.GetTextNode() == endTextNode && current.GetIndex() == endIndex ) ) ;
305
- }
306
-
307
- return new CharacterRange( cursors, cursors.length ) ;
308
- }
309
-
310
- // Knuth-Morris-Pratt Algorithm for stream input
311
- KMP_NOMATCH = 0 ;
312
- KMP_ADVANCED = 1 ;
313
- KMP_MATCHED = 2 ;
314
- KmpMatch = function( pattern, ignoreCase )
315
- {
316
- var overlap = [ -1 ] ;
317
- for ( var i = 0 ; i < pattern.length ; i++ )
318
- {
319
- overlap.push( overlap[i] + 1 ) ;
320
- while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) )
321
- overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1 ;
322
- }
323
- this._Overlap = overlap ;
324
- this._State = 0 ;
325
- this._IgnoreCase = ( ignoreCase === true ) ;
326
- if ( ignoreCase )
327
- this.Pattern = pattern.toLowerCase();
328
- else
329
- this.Pattern = pattern ;
330
- }
331
- KmpMatch.prototype = {
332
- FeedCharacter : function( c )
333
- {
334
- if ( this._IgnoreCase )
335
- c = c.toLowerCase();
336
-
337
- while ( true )
338
- {
339
- if ( c == this.Pattern.charAt( this._State ) )
340
- {
341
- this._State++ ;
342
- if ( this._State == this.Pattern.length )
343
- {
344
- // found a match, start over, don't care about partial matches involving the current match
345
- this._State = 0;
346
- return KMP_MATCHED;
347
- }
348
- return KMP_ADVANCED ;
349
- }
350
- else if ( this._State == 0 )
351
- return KMP_NOMATCH;
352
- else
353
- this._State = this._Overlap[ this._State ];
354
- }
355
-
356
- return null ;
357
- },
358
-
359
- Reset : function()
360
- {
361
- this._State = 0 ;
362
- }
363
- };
364
-
365
- // Place a range at the start of document.
366
- function OnLoad()
367
- {
368
- // First of all, translate the dialog box texts.
369
- oEditor.FCKLanguageManager.TranslatePage( document ) ;
370
-
371
- // Show the appropriate tab at startup.
372
- if ( dialogArguments.CustomValue == 'Find' )
373
- {
374
- dialog.SetSelectedTab( 'Find' ) ;
375
- dialog.SetAutoSize( true ) ;
376
- }
377
- else
378
- dialog.SetSelectedTab( 'Replace' ) ;
379
-
380
- SelectField( 'txtFind' + dialogArguments.CustomValue ) ;
381
- }
382
-
383
- function btnStat()
384
- {
385
- GetE('btnReplace').disabled =
386
- GetE('btnReplaceAll').disabled =
387
- GetE('btnFind').disabled =
388
- ( GetE(idMap["FindText"]).value.length == 0 ) ;
389
- }
390
-
391
- function btnStatDelayed()
392
- {
393
- setTimeout( btnStat, 1 ) ;
394
- }
395
-
396
- function GetSearchString()
397
- {
398
- return GetE(idMap['FindText']).value ;
399
- }
400
-
401
- function GetReplaceString()
402
- {
403
- return GetE("txtReplace").value ;
404
- }
405
-
406
- function GetCheckCase()
407
- {
408
- return !! ( GetE(idMap['CheckCase']).checked ) ;
409
- }
410
-
411
- function GetMatchWord()
412
- {
413
- return !! ( GetE(idMap['CheckWord']).checked ) ;
414
- }
415
-
416
- /* Is this character a unicode whitespace or a punctuation mark?
417
- * References:
418
- * http://unicode.org/Public/UNIDATA/PropList.txt (whitespaces)
419
- * http://php.chinaunix.net/manual/tw/ref.regex.php (punctuation marks)
420
- */
421
- function CheckIsWordSeparator( c )
422
- {
423
- if ( !c )
424
- return true;
425
- var code = c.charCodeAt( 0 );
426
- if ( code >= 9 && code <= 0xd )
427
- return true;
428
- if ( code >= 0x2000 && code <= 0x200a )
429
- return true;
430
- switch ( code )
431
- {
432
- case 0x20:
433
- case 0x85:
434
- case 0xa0:
435
- case 0x1680:
436
- case 0x180e:
437
- case 0x2028:
438
- case 0x2029:
439
- case 0x202f:
440
- case 0x205f:
441
- case 0x3000:
442
- return true;
443
- default:
444
- }
445
- return /[.,"'?!;:]/.test( c ) ;
446
- }
447
-
448
- FindRange = null ;
449
- function _Find()
450
- {
451
- var searchString = GetSearchString() ;
452
- if ( !FindRange )
453
- FindRange = new CharacterRange( new CharacterCursor( EditorDocument ), searchString.length ) ;
454
- else
455
- {
456
- FindRange.RemoveHighlight() ;
457
- FindRange = FindRange.GetNextRange( searchString.length ) ;
458
- }
459
- var matcher = new KmpMatch( searchString, ! GetCheckCase() ) ;
460
- var matchState = KMP_NOMATCH ;
461
- var character = '%' ;
462
-
463
- while ( character != null )
464
- {
465
- while ( ( character = FindRange.GetEndCharacter() ) )
466
- {
467
- matchState = matcher.FeedCharacter( character ) ;
468
- if ( matchState == KMP_MATCHED )
469
- break ;
470
- if ( FindRange.MoveNext() )
471
- matcher.Reset() ;
472
- }
473
-
474
- if ( matchState == KMP_MATCHED )
475
- {
476
- if ( GetMatchWord() )
477
- {
478
- var cursors = FindRange.GetCursors() ;
479
- var head = cursors[ cursors.length - 1 ].Clone() ;
480
- var tail = cursors[0].Clone() ;
481
- if ( !head.MoveNext() && !CheckIsWordSeparator( head.GetCharacter() ) )
482
- continue ;
483
- if ( !tail.MoveBack() && !CheckIsWordSeparator( tail.GetCharacter() ) )
484
- continue ;
485
- }
486
-
487
- FindRange.Highlight() ;
488
- return true ;
489
- }
490
- }
491
-
492
- FindRange = null ;
493
- return false ;
494
- }
495
-
496
- function Find()
497
- {
498
- if ( ! _Find() )
499
- alert( FCKLang.DlgFindNotFoundMsg ) ;
500
- }
501
-
502
- function Replace()
503
- {
504
- var saveUndoStep = function( selectRange )
505
- {
506
- var ieRange ;
507
- if ( oEditor.FCKBrowserInfo.IsIE )
508
- ieRange = document.selection.createRange() ;
509
-
510
- selectRange.Select() ;
511
- oEditor.FCKUndo.SaveUndoStep() ;
512
- var cloneRange = selectRange.Clone() ;
513
- cloneRange.Collapse( false ) ;
514
- cloneRange.Select() ;
515
-
516
- if ( ieRange )
517
- setTimeout( function(){ ieRange.select() ; }, 1 ) ;
518
- }
519
-
520
- if ( FindRange && FindRange.GetHighlightDomRange() )
521
- {
522
- var range = FindRange.GetHighlightDomRange() ;
523
- var bookmark = range.CreateBookmark() ;
524
- FindRange.RemoveHighlight() ;
525
- range.MoveToBookmark( bookmark ) ;
526
-
527
- saveUndoStep( range ) ;
528
- range.DeleteContents() ;
529
- range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ;
530
- range._UpdateElementInfo() ;
531
-
532
- FindRange = CharacterRange.CreateFromDomRange( range ) ;
533
- }
534
- else
535
- {
536
- if ( ! _Find() )
537
- {
538
- FindRange && FindRange.RemoveHighlight() ;
539
- alert( FCKLang.DlgFindNotFoundMsg ) ;
540
- }
541
- }
542
- }
543
-
544
- function ReplaceAll()
545
- {
546
- oEditor.FCKUndo.SaveUndoStep() ;
547
- var replaceCount = 0 ;
548
-
549
- while ( _Find() )
550
- {
551
- var range = FindRange.GetHighlightDomRange() ;
552
- var bookmark = range.CreateBookmark() ;
553
- FindRange.RemoveHighlight() ;
554
- range.MoveToBookmark( bookmark) ;
555
-
556
- range.DeleteContents() ;
557
- range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ;
558
- range._UpdateElementInfo() ;
559
-
560
- FindRange = CharacterRange.CreateFromDomRange( range ) ;
561
- replaceCount++ ;
562
- }
563
- if ( replaceCount == 0 )
564
- {
565
- FindRange && FindRange.RemoveHighlight() ;
566
- alert( FCKLang.DlgFindNotFoundMsg ) ;
567
- }
568
- dialog.Cancel() ;
569
- }
570
-
571
- window.onunload = function()
572
- {
573
- if ( FindRange )
574
- {
575
- FindRange.RemoveHighlight() ;
576
- FindRange.ToDomRange().Select() ;
577
- }
578
- }
579
- </script>
580
- </head>
581
- <body onload="OnLoad()" style="overflow: hidden">
582
- <div id="divFind" style="display: none">
583
- <table cellspacing="3" cellpadding="2" width="100%" border="0">
584
- <tr>
585
- <td nowrap="nowrap">
586
- <label for="txtFindFind" fcklang="DlgReplaceFindLbl">
587
- Find what:</label>
588
- </td>
589
- <td width="100%">
590
- <input id="txtFindFind" onkeyup="btnStat()" oninput="btnStat()" onpaste="btnStatDelayed()" style="width: 100%" tabindex="1"
591
- type="text" />
592
- </td>
593
- <td>
594
- <input id="btnFind" style="width: 80px" disabled="disabled" onclick="Find();"
595
- type="button" value="Find" fcklang="DlgFindFindBtn" />
596
- </td>
597
- </tr>
598
- <tr>
599
- <td valign="bottom" colspan="3">
600
- &nbsp;<input id="chkCaseFind" tabindex="3" type="checkbox" /><label for="chkCaseFind" fcklang="DlgReplaceCaseChk">Match
601
- case</label>
602
- <br />
603
- &nbsp;<input id="chkWordFind" tabindex="4" type="checkbox" /><label for="chkWordFind" fcklang="DlgReplaceWordChk">Match
604
- whole word</label>
605
- </td>
606
- </tr>
607
- </table>
608
- </div>
609
- <div id="divReplace" style="display:none">
610
- <table cellspacing="3" cellpadding="2" width="100%" border="0">
611
- <tr>
612
- <td nowrap="nowrap">
613
- <label for="txtFindReplace" fcklang="DlgReplaceFindLbl">
614
- Find what:</label>
615
- </td>
616
- <td width="100%">
617
- <input id="txtFindReplace" onkeyup="btnStat()" oninput="btnStat()" onpaste="btnStatDelayed()" style="width: 100%" tabindex="1"
618
- type="text" />
619
- </td>
620
- <td>
621
- <input id="btnReplace" style="width: 80px" disabled="disabled" onclick="Replace();"
622
- type="button" value="Replace" fcklang="DlgReplaceReplaceBtn" />
623
- </td>
624
- </tr>
625
- <tr>
626
- <td valign="top" nowrap="nowrap">
627
- <label for="txtReplace" fcklang="DlgReplaceReplaceLbl">
628
- Replace with:</label>
629
- </td>
630
- <td valign="top">
631
- <input id="txtReplace" style="width: 100%" tabindex="2" type="text" />
632
- </td>
633
- <td>
634
- <input id="btnReplaceAll" style="width: 80px" disabled="disabled" onclick="ReplaceAll()" type="button"
635
- value="Replace All" fcklang="DlgReplaceReplAllBtn" />
636
- </td>
637
- </tr>
638
- <tr>
639
- <td valign="bottom" colspan="3">
640
- &nbsp;<input id="chkCaseReplace" tabindex="3" type="checkbox" /><label for="chkCaseReplace" fcklang="DlgReplaceCaseChk">Match
641
- case</label>
642
- <br />
643
- &nbsp;<input id="chkWordReplace" tabindex="4" type="checkbox" /><label for="chkWordReplace" fcklang="DlgReplaceWordChk">Match
644
- whole word</label>
645
- </td>
646
- </tr>
647
- </table>
648
- </div>
649
- </body>
650
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_select.html DELETED
@@ -1,180 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Select dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <title>Select Properties</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
- <meta content="noindex, nofollow" name="robots">
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script type="text/javascript" src="fck_select/fck_select.js"></script>
31
- <script type="text/javascript">
32
-
33
- var dialog = window.parent ;
34
- var oEditor = dialog.InnerDialogLoaded() ;
35
-
36
- // Gets the document DOM
37
- var oDOM = oEditor.FCK.EditorDocument ;
38
-
39
- var oActiveEl = dialog.Selection.GetSelectedElement() ;
40
-
41
- var oListText ;
42
- var oListValue ;
43
-
44
- window.onload = function()
45
- {
46
- // First of all, translate the dialog box texts
47
- oEditor.FCKLanguageManager.TranslatePage(document) ;
48
-
49
- oListText = document.getElementById( 'cmbText' ) ;
50
- oListValue = document.getElementById( 'cmbValue' ) ;
51
-
52
- // Fix the lists widths. (Bug #970)
53
- oListText.style.width = oListText.offsetWidth ;
54
- oListValue.style.width = oListValue.offsetWidth ;
55
-
56
- if ( oActiveEl && oActiveEl.tagName == 'SELECT' )
57
- {
58
- GetE('txtName').value = oActiveEl.name ;
59
- GetE('txtSelValue').value = oActiveEl.value ;
60
- GetE('txtLines').value = GetAttribute( oActiveEl, 'size' ) ;
61
- GetE('chkMultiple').checked = oActiveEl.multiple ;
62
-
63
- // Load the actual options
64
- for ( var i = 0 ; i < oActiveEl.options.length ; i++ )
65
- {
66
- var sText = HTMLDecode( oActiveEl.options[i].innerHTML ) ;
67
- var sValue = oActiveEl.options[i].value ;
68
-
69
- AddComboOption( oListText, sText, sText ) ;
70
- AddComboOption( oListValue, sValue, sValue ) ;
71
- }
72
- }
73
- else
74
- oActiveEl = null ;
75
-
76
- dialog.SetOkButton( true ) ;
77
- dialog.SetAutoSize( true ) ;
78
- SelectField( 'txtName' ) ;
79
- }
80
-
81
- function Ok()
82
- {
83
- oEditor.FCKUndo.SaveUndoStep() ;
84
-
85
- var sSize = GetE('txtLines').value ;
86
- if ( sSize == null || isNaN( sSize ) || sSize <= 1 )
87
- sSize = '' ;
88
-
89
- oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'SELECT', {name: GetE('txtName').value} ) ;
90
-
91
- SetAttribute( oActiveEl, 'size' , sSize ) ;
92
- oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;
93
-
94
- // Remove all options.
95
- while ( oActiveEl.options.length > 0 )
96
- oActiveEl.remove(0) ;
97
-
98
- // Add all available options.
99
- for ( var i = 0 ; i < oListText.options.length ; i++ )
100
- {
101
- var sText = oListText.options[i].value ;
102
- var sValue = oListValue.options[i].value ;
103
- if ( sValue.length == 0 ) sValue = sText ;
104
-
105
- var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;
106
-
107
- if ( sValue == GetE('txtSelValue').value )
108
- {
109
- SetAttribute( oOption, 'selected', 'selected' ) ;
110
- oOption.selected = true ;
111
- }
112
- }
113
-
114
- return true ;
115
- }
116
-
117
- </script>
118
- </head>
119
- <body style="overflow: hidden">
120
- <table width="100%" height="100%">
121
- <tr>
122
- <td>
123
- <table width="100%">
124
- <tr>
125
- <td nowrap><span fckLang="DlgSelectName">Name</span>&nbsp;</td>
126
- <td width="100%" colSpan="2"><input id="txtName" style="WIDTH: 100%" type="text"></td>
127
- </tr>
128
- <tr>
129
- <td nowrap><span fckLang="DlgSelectValue">Value</span>&nbsp;</td>
130
- <td width="100%" colSpan="2"><input id="txtSelValue" style="WIDTH: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly></td>
131
- </tr>
132
- <tr>
133
- <td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td>
134
- <td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<span fckLang="DlgSelectLines">lines</span></td>
135
- <td nowrap align="right"><input id="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow
136
- multiple selections</label></td>
137
- </tr>
138
- </table>
139
- <br>
140
- <hr style="POSITION: absolute">
141
- <span style="LEFT: 10px; POSITION: relative; TOP: -7px" class="BackColor">&nbsp;<span fckLang="DlgSelectOpAvail">Available
142
- Options</span>&nbsp;</span>
143
- <table width="100%">
144
- <tr>
145
- <td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>
146
- <input id="txtText" style="WIDTH: 100%" type="text">
147
- </td>
148
- <td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>
149
- <input id="txtValue" style="WIDTH: 100%" type="text">
150
- </td>
151
- <td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>
152
- <td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>
153
- </tr>
154
- <tr>
155
- <td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"
156
- size="5"></select>
157
- </td>
158
- <td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"
159
- size="5"></select>
160
- </td>
161
- <td vAlign="top" colSpan="2">
162
- </td>
163
- </tr>
164
- <tr>
165
- <td vAlign="bottom" colSpan="2"><input style="WIDTH: 100%" onclick="Move(-1);" type="button" fckLang="DlgSelectBtnUp" value="Up">
166
- <br>
167
- <input style="WIDTH: 100%" onclick="Move(1);" type="button" fckLang="DlgSelectBtnDown"
168
- value="Down">
169
- </td>
170
- </tr>
171
- <TR>
172
- <TD vAlign="bottom" colSpan="4"><INPUT onclick="SetSelectedValue();" type="button" fckLang="DlgSelectBtnSetValue" value="Set as selected value">&nbsp;&nbsp;
173
- <input onclick="Delete();" type="button" fckLang="DlgSelectBtnDelete" value="Delete"></TD>
174
- </TR>
175
- </table>
176
- </td>
177
- </tr>
178
- </table>
179
- </body>
180
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_select/fck_select.js DELETED
@@ -1,194 +0,0 @@
1
- /*
2
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
- *
5
- * == BEGIN LICENSE ==
6
- *
7
- * Licensed under the terms of any of the following licenses at your
8
- * choice:
9
- *
10
- * - GNU General Public License Version 2 or later (the "GPL")
11
- * http://www.gnu.org/licenses/gpl.html
12
- *
13
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
- * http://www.gnu.org/licenses/lgpl.html
15
- *
16
- * - Mozilla Public License Version 1.1 or later (the "MPL")
17
- * http://www.mozilla.org/MPL/MPL-1.1.html
18
- *
19
- * == END LICENSE ==
20
- *
21
- * Scripts for the fck_select.html page.
22
- */
23
-
24
- function Select( combo )
25
- {
26
- var iIndex = combo.selectedIndex ;
27
-
28
- oListText.selectedIndex = iIndex ;
29
- oListValue.selectedIndex = iIndex ;
30
-
31
- var oTxtText = document.getElementById( "txtText" ) ;
32
- var oTxtValue = document.getElementById( "txtValue" ) ;
33
-
34
- oTxtText.value = oListText.value ;
35
- oTxtValue.value = oListValue.value ;
36
- }
37
-
38
- function Add()
39
- {
40
- var oTxtText = document.getElementById( "txtText" ) ;
41
- var oTxtValue = document.getElementById( "txtValue" ) ;
42
-
43
- AddComboOption( oListText, oTxtText.value, oTxtText.value ) ;
44
- AddComboOption( oListValue, oTxtValue.value, oTxtValue.value ) ;
45
-
46
- oListText.selectedIndex = oListText.options.length - 1 ;
47
- oListValue.selectedIndex = oListValue.options.length - 1 ;
48
-
49
- oTxtText.value = '' ;
50
- oTxtValue.value = '' ;
51
-
52
- oTxtText.focus() ;
53
- }
54
-
55
- function Modify()
56
- {
57
- var iIndex = oListText.selectedIndex ;
58
-
59
- if ( iIndex < 0 ) return ;
60
-
61
- var oTxtText = document.getElementById( "txtText" ) ;
62
- var oTxtValue = document.getElementById( "txtValue" ) ;
63
-
64
- oListText.options[ iIndex ].innerHTML = HTMLEncode( oTxtText.value ) ;
65
- oListText.options[ iIndex ].value = oTxtText.value ;
66
-
67
- oListValue.options[ iIndex ].innerHTML = HTMLEncode( oTxtValue.value ) ;
68
- oListValue.options[ iIndex ].value = oTxtValue.value ;
69
-
70
- oTxtText.value = '' ;
71
- oTxtValue.value = '' ;
72
-
73
- oTxtText.focus() ;
74
- }
75
-
76
- function Move( steps )
77
- {
78
- ChangeOptionPosition( oListText, steps ) ;
79
- ChangeOptionPosition( oListValue, steps ) ;
80
- }
81
-
82
- function Delete()
83
- {
84
- RemoveSelectedOptions( oListText ) ;
85
- RemoveSelectedOptions( oListValue ) ;
86
- }
87
-
88
- function SetSelectedValue()
89
- {
90
- var iIndex = oListValue.selectedIndex ;
91
- if ( iIndex < 0 ) return ;
92
-
93
- var oTxtValue = document.getElementById( "txtSelValue" ) ;
94
-
95
- oTxtValue.value = oListValue.options[ iIndex ].value ;
96
- }
97
-
98
- // Moves the selected option by a number of steps (also negative)
99
- function ChangeOptionPosition( combo, steps )
100
- {
101
- var iActualIndex = combo.selectedIndex ;
102
-
103
- if ( iActualIndex < 0 )
104
- return ;
105
-
106
- var iFinalIndex = iActualIndex + steps ;
107
-
108
- if ( iFinalIndex < 0 )
109
- iFinalIndex = 0 ;
110
-
111
- if ( iFinalIndex > ( combo.options.length - 1 ) )
112
- iFinalIndex = combo.options.length - 1 ;
113
-
114
- if ( iActualIndex == iFinalIndex )
115
- return ;
116
-
117
- var oOption = combo.options[ iActualIndex ] ;
118
- var sText = HTMLDecode( oOption.innerHTML ) ;
119
- var sValue = oOption.value ;
120
-
121
- combo.remove( iActualIndex ) ;
122
-
123
- oOption = AddComboOption( combo, sText, sValue, null, iFinalIndex ) ;
124
-
125
- oOption.selected = true ;
126
- }
127
-
128
- // Remove all selected options from a SELECT object
129
- function RemoveSelectedOptions(combo)
130
- {
131
- // Save the selected index
132
- var iSelectedIndex = combo.selectedIndex ;
133
-
134
- var oOptions = combo.options ;
135
-
136
- // Remove all selected options
137
- for ( var i = oOptions.length - 1 ; i >= 0 ; i-- )
138
- {
139
- if (oOptions[i].selected) combo.remove(i) ;
140
- }
141
-
142
- // Reset the selection based on the original selected index
143
- if ( combo.options.length > 0 )
144
- {
145
- if ( iSelectedIndex >= combo.options.length ) iSelectedIndex = combo.options.length - 1 ;
146
- combo.selectedIndex = iSelectedIndex ;
147
- }
148
- }
149
-
150
- // Add a new option to a SELECT object (combo or list)
151
- function AddComboOption( combo, optionText, optionValue, documentObject, index )
152
- {
153
- var oOption ;
154
-
155
- if ( documentObject )
156
- oOption = documentObject.createElement("OPTION") ;
157
- else
158
- oOption = document.createElement("OPTION") ;
159
-
160
- if ( index != null )
161
- combo.options.add( oOption, index ) ;
162
- else
163
- combo.options.add( oOption ) ;
164
-
165
- oOption.innerHTML = optionText.length > 0 ? HTMLEncode( optionText ) : '&nbsp;' ;
166
- oOption.value = optionValue ;
167
-
168
- return oOption ;
169
- }
170
-
171
- function HTMLEncode( text )
172
- {
173
- if ( !text )
174
- return '' ;
175
-
176
- text = text.replace( /&/g, '&amp;' ) ;
177
- text = text.replace( /</g, '&lt;' ) ;
178
- text = text.replace( />/g, '&gt;' ) ;
179
-
180
- return text ;
181
- }
182
-
183
-
184
- function HTMLDecode( text )
185
- {
186
- if ( !text )
187
- return '' ;
188
-
189
- text = text.replace( /&gt;/g, '>' ) ;
190
- text = text.replace( /&lt;/g, '<' ) ;
191
- text = text.replace( /&amp;/g, '&' ) ;
192
-
193
- return text ;
194
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_smiley.html DELETED
@@ -1,111 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Smileys (emoticons) dialog window.
23
- -->
24
- <html xmlns="http://www.w3.org/1999/xhtml">
25
- <head>
26
- <title></title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28
- <meta name="robots" content="noindex, nofollow" />
29
- <style type="text/css">
30
- .Hand
31
- {
32
- cursor: pointer;
33
- cursor: hand;
34
- }
35
- </style>
36
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
37
- <script type="text/javascript">
38
-
39
- var dialog = window.parent ;
40
- var oEditor = dialog.InnerDialogLoaded() ;
41
-
42
- window.onload = function ()
43
- {
44
- // First of all, translate the dialog box texts
45
- oEditor.FCKLanguageManager.TranslatePage(document) ;
46
-
47
- dialog.SetAutoSize( true ) ;
48
- }
49
-
50
- function InsertSmiley( url )
51
- {
52
- oEditor.FCKUndo.SaveUndoStep() ;
53
-
54
- var oImg = oEditor.FCK.InsertElement( 'img' ) ;
55
- oImg.src = url ;
56
- oImg.setAttribute( '_fcksavedurl', url ) ;
57
-
58
- // For long smileys list, it seams that IE continues loading the images in
59
- // the background when you quickly select one image. so, let's clear
60
- // everything before closing.
61
- document.body.innerHTML = '' ;
62
-
63
- dialog.Cancel() ;
64
- }
65
-
66
- function over(td)
67
- {
68
- td.className = 'LightBackground Hand' ;
69
- }
70
-
71
- function out(td)
72
- {
73
- td.className = 'DarkBackground Hand' ;
74
- }
75
- </script>
76
- </head>
77
- <body style="overflow: hidden">
78
- <table cellpadding="2" cellspacing="2" align="center" border="0" width="100%" height="100%">
79
- <script type="text/javascript">
80
-
81
- var FCKConfig = oEditor.FCKConfig ;
82
-
83
- var sBasePath = FCKConfig.SmileyPath ;
84
- var aImages = FCKConfig.SmileyImages ;
85
- var iCols = FCKConfig.SmileyColumns ;
86
- var iColWidth = parseInt( 100 / iCols, 10 ) ;
87
-
88
- var i = 0 ;
89
- while (i < aImages.length)
90
- {
91
- document.write( '<tr>' ) ;
92
- for(var j = 0 ; j < iCols ; j++)
93
- {
94
- if (aImages[i])
95
- {
96
- var sUrl = sBasePath + aImages[i] ;
97
- document.write( '<td width="' + iColWidth + '%" align="center" class="DarkBackground Hand" onclick="InsertSmiley(\'' + sUrl.replace(/'/g, "\\'" ) + '\')" onmouseover="over(this)" onmouseout="out(this)">' ) ;
98
- document.write( '<img src="' + sUrl + '" border="0" />' ) ;
99
- }
100
- else
101
- document.write( '<td width="' + iColWidth + '%" class="DarkBackground">&nbsp;' ) ;
102
- document.write( '<\/td>' ) ;
103
- i++ ;
104
- }
105
- document.write('<\/tr>') ;
106
- }
107
-
108
- </script>
109
- </table>
110
- </body>
111
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_source.html DELETED
@@ -1,68 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Source editor dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <title>Source</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
- <meta name="robots" content="noindex, nofollow">
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script language="javascript">
31
-
32
- var oEditor = window.parent.InnerDialogLoaded() ;
33
- var FCK = oEditor.FCK ;
34
- var FCKConfig = oEditor.FCKConfig ;
35
- var FCKTools = oEditor.FCKTools ;
36
-
37
- document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
38
-
39
- window.onload = function()
40
- {
41
- // EnableXHTML and EnableSourceXHTML has been deprecated
42
- // document.getElementById('txtSource').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ;
43
- document.getElementById('txtSource').value = FCK.GetXHTML( FCKConfig.FormatSource ) ;
44
-
45
- // Activate the "OK" button.
46
- window.parent.SetOkButton( true ) ;
47
- }
48
-
49
- //#### The OK button was hit.
50
- function Ok()
51
- {
52
- if ( oEditor.FCKBrowserInfo.IsIE )
53
- oEditor.FCKUndo.SaveUndoStep() ;
54
-
55
- FCK.SetData( document.getElementById('txtSource').value, false ) ;
56
-
57
- return true ;
58
- }
59
- </script>
60
- </head>
61
- <body scroll="no" style="OVERFLOW: hidden">
62
- <table width="100%" height="100%">
63
- <tr>
64
- <td height="100%"><textarea id="txtSource" dir="ltr" style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; FONT-SIZE: 14px; PADDING-BOTTOM: 5px; WIDTH: 100%; PADDING-TOP: 5px; FONT-FAMILY: Monospace; HEIGHT: 100%">Loading. Please wait...</textarea></td>
65
- </tr>
66
- </table>
67
- </body>
68
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_specialchar.html DELETED
@@ -1,121 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Special Chars Selector dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <meta name="robots" content="noindex, nofollow">
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
- <style type="text/css">
29
- .Hand
30
- {
31
- cursor: pointer ;
32
- cursor: hand ;
33
- }
34
- .Sample { font-size: 24px; }
35
- </style>
36
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
37
- <script type="text/javascript">
38
-
39
- var oEditor = window.parent.InnerDialogLoaded() ;
40
-
41
- var oSample ;
42
-
43
- function insertChar(charValue)
44
- {
45
- oEditor.FCKUndo.SaveUndoStep() ;
46
- oEditor.FCK.InsertHtml( charValue || "" ) ;
47
- window.parent.Cancel() ;
48
- }
49
-
50
- function over(td)
51
- {
52
- if ( ! oSample )
53
- return ;
54
- oSample.innerHTML = td.innerHTML ;
55
- td.className = 'LightBackground SpecialCharsOver Hand' ;
56
- }
57
-
58
- function out(td)
59
- {
60
- if ( ! oSample )
61
- return ;
62
- oSample.innerHTML = "&nbsp;" ;
63
- td.className = 'DarkBackground SpecialCharsOut Hand' ;
64
- }
65
-
66
- function setDefaults()
67
- {
68
- // Gets the sample placeholder.
69
- oSample = document.getElementById("SampleTD") ;
70
-
71
- // First of all, translates the dialog box texts.
72
- oEditor.FCKLanguageManager.TranslatePage(document) ;
73
-
74
- window.parent.SetAutoSize( true ) ;
75
- }
76
-
77
- </script>
78
- </head>
79
- <body onload="setDefaults()" style="overflow: hidden">
80
- <table cellpadding="0" cellspacing="0" width="100%" height="100%">
81
- <tr>
82
- <td width="100%">
83
- <table cellpadding="1" cellspacing="1" align="center" border="0" width="100%" height="100%">
84
- <script type="text/javascript">
85
- var aChars = ["!","&quot;","#","$","%","&amp;","\\'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&lt;","=","&gt;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","&euro;","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","&ndash;","&mdash;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;","&OElig;","&oelig;","&#372;","&#374","&#373","&#375;","&sbquo;","&#8219;","&bdquo;","&hellip;","&trade;","&#9658;","&bull;","&rarr;","&rArr;","&hArr;","&diams;","&asymp;"] ;
86
-
87
- var cols = 20 ;
88
-
89
- var i = 0 ;
90
- while (i < aChars.length)
91
- {
92
- document.write("<TR>") ;
93
- for(var j = 0 ; j < cols ; j++)
94
- {
95
- if (aChars[i])
96
- {
97
- document.write('<TD width="1%" class="DarkBackground SpecialCharsOut Hand" align="center" onclick="insertChar(\'' + aChars[i].replace(/&/g, "&amp;") + '\')" onmouseover="over(this)" onmouseout="out(this)">') ;
98
- document.write(aChars[i]) ;
99
- }
100
- else
101
- document.write("<TD class='DarkBackground SpecialCharsOut'>&nbsp;") ;
102
- document.write("<\/TD>") ;
103
- i++ ;
104
- }
105
- document.write("<\/TR>") ;
106
- }
107
- </script>
108
- </table>
109
- </td>
110
- <td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;</td>
111
- <td valign="top">
112
- <table width="40" cellpadding="0" cellspacing="0" border="0">
113
- <tr>
114
- <td id="SampleTD" width="40" height="40" align="center" class="DarkBackground SpecialCharsOut Sample">&nbsp;</td>
115
- </tr>
116
- </table>
117
- </td>
118
- </tr>
119
- </table>
120
- </body>
121
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_spellerpages.html DELETED
@@ -1,70 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
- <!--
3
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
- *
6
- * == BEGIN LICENSE ==
7
- *
8
- * Licensed under the terms of any of the following licenses at your
9
- * choice:
10
- *
11
- * - GNU General Public License Version 2 or later (the "GPL")
12
- * http://www.gnu.org/licenses/gpl.html
13
- *
14
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
- * http://www.gnu.org/licenses/lgpl.html
16
- *
17
- * - Mozilla Public License Version 1.1 or later (the "MPL")
18
- * http://www.mozilla.org/MPL/MPL-1.1.html
19
- *
20
- * == END LICENSE ==
21
- *
22
- * Spell Check dialog window.
23
- -->
24
- <html>
25
- <head>
26
- <title>Spell Check</title>
27
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
- <meta content="noindex, nofollow" name="robots">
29
- <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30
- <script src="fck_spellerpages/spellerpages/spellChecker.js"></script>
31
- <script type="text/javascript">
32
-
33
- var oEditor = window.parent.InnerDialogLoaded() ;
34
- var FCKLang = oEditor.FCKLang ;
35
-
36
- window.onload = function()
37
- {
38
- document.getElementById('txtHtml').value = oEditor.FCK.EditorDocument.body.innerHTML ;
39
-
40
- var oSpeller = new spellChecker( document.getElementById('txtHtml') ) ;
41
- oSpeller.spellCheckScript = oEditor.FCKConfig.SpellerPagesServerScript || 'server-scripts/spellchecker.php' ;
42
- oSpeller.OnFinished = oSpeller_OnFinished ;
43
- oSpeller.openChecker() ;
44
- }
45
-
46
- function OnSpellerControlsLoad( controlsWindow )
47
- {
48
- // Translate the dialog box texts
49
- oEditor.FCKLanguageManager.TranslatePage( controlsWindow.document ) ;
50
- }
51
-
52
- function oSpeller_OnFinished( numberOCorrections )
53
- {
54
- if ( numberOCorrections > 0 )
55
- {
56
- oEditor.FCKUndo.SaveUndoStep() ;
57
- oEditor.FCK.EditorDocument.body.innerHTML = document.getElementById('txtHtml').value ;
58
- if ( oEditor.FCKBrowserInfo.IsIE )
59
- oEditor.FCKSelection.Collapse( true ) ;
60
- }
61
- window.parent.Cancel() ;
62
- }
63
-
64
- </script>
65
- </head>
66
- <body style="OVERFLOW: hidden" scroll="no" style="padding:0px;">
67
- <input type="hidden" id="txtHtml" value="">
68
- <iframe id="frmSpell" src="javascript:void(0)" name="spellchecker" width="100%" height="100%" frameborder="0"></iframe>
69
- </body>
70
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html DELETED
File without changes
fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js DELETED
@@ -1,87 +0,0 @@
1
- ////////////////////////////////////////////////////
2
- // controlWindow object
3
- ////////////////////////////////////////////////////
4
- function controlWindow( controlForm ) {
5
- // private properties
6
- this._form = controlForm;
7
-
8
- // public properties
9
- this.windowType = "controlWindow";
10
- // this.noSuggestionSelection = "- No suggestions -"; // by FredCK
11
- this.noSuggestionSelection = FCKLang.DlgSpellNoSuggestions ;
12
- // set up the properties for elements of the given control form
13
- this.suggestionList = this._form.sugg;
14
- this.evaluatedText = this._form.misword;
15
- this.replacementText = this._form.txtsugg;
16
- this.undoButton = this._form.btnUndo;
17
-
18
- // public methods
19
- this.addSuggestion = addSuggestion;
20
- this.clearSuggestions = clearSuggestions;
21
- this.selectDefaultSuggestion = selectDefaultSuggestion;
22
- this.resetForm = resetForm;
23
- this.setSuggestedText = setSuggestedText;
24
- this.enableUndo = enableUndo;
25
- this.disableUndo = disableUndo;
26
- }
27
-
28
- function resetForm() {
29
- if( this._form ) {
30
- this._form.reset();
31
- }
32
- }
33
-
34
- function setSuggestedText() {
35
- var slct = this.suggestionList;
36
- var txt = this.replacementText;
37
- var str = "";
38
- if( (slct.options[0].text) && slct.options[0].text != this.noSuggestionSelection ) {
39
- str = slct.options[slct.selectedIndex].text;
40
- }
41
- txt.value = str;
42
- }
43
-
44
- function selectDefaultSuggestion() {
45
- var slct = this.suggestionList;
46
- var txt = this.replacementText;
47
- if( slct.options.length == 0 ) {
48
- this.addSuggestion( this.noSuggestionSelection );
49
- } else {
50
- slct.options[0].selected = true;
51
- }
52
- this.setSuggestedText();
53
- }
54
-
55
- function addSuggestion( sugg_text ) {
56
- var slct = this.suggestionList;
57
- if( sugg_text ) {
58
- var i = slct.options.length;
59
- var newOption = new Option( sugg_text, 'sugg_text'+i );
60
- slct.options[i] = newOption;
61
- }
62
- }
63
-
64
- function clearSuggestions() {
65
- var slct = this.suggestionList;
66
- for( var j = slct.length - 1; j > -1; j-- ) {
67
- if( slct.options[j] ) {
68
- slct.options[j] = null;
69
- }
70
- }
71
- }
72
-
73
- function enableUndo() {
74
- if( this.undoButton ) {
75
- if( this.undoButton.disabled == true ) {
76
- this.undoButton.disabled = false;
77
- }
78
- }
79
- }
80
-
81
- function disableUndo() {
82
- if( this.undoButton ) {
83
- if( this.undoButton.disabled == false ) {
84
- this.undoButton.disabled = true;
85
- }
86
- }
87
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html DELETED
@@ -1,153 +0,0 @@
1
- <html>
2
- <head>
3
- <link rel="stylesheet" type="text/css" href="spellerStyle.css" />
4
- <script type="text/javascript" src="controlWindow.js"></script>
5
- <script type="text/javascript">
6
- var spellerObject;
7
- var controlWindowObj;
8
-
9
- if( parent.opener ) {
10
- spellerObject = parent.opener.speller;
11
- }
12
-
13
- function ignore_word() {
14
- if( spellerObject ) {
15
- spellerObject.ignoreWord();
16
- }
17
- }
18
-
19
- function ignore_all() {
20
- if( spellerObject ) {
21
- spellerObject.ignoreAll();
22
- }
23
- }
24
-
25
- function replace_word() {
26
- if( spellerObject ) {
27
- spellerObject.replaceWord();
28
- }
29
- }
30
-
31
- function replace_all() {
32
- if( spellerObject ) {
33
- spellerObject.replaceAll();
34
- }
35
- }
36
-
37
- function end_spell() {
38
- if( spellerObject ) {
39
- spellerObject.terminateSpell();
40
- }
41
- }
42
-
43
- function undo() {
44
- if( spellerObject ) {
45
- spellerObject.undo();
46
- }
47
- }
48
-
49
- function suggText() {
50
- if( controlWindowObj ) {
51
- controlWindowObj.setSuggestedText();
52
- }
53
- }
54
-
55
- var FCKLang = window.parent.parent.FCKLang ; // by FredCK
56
-
57
- function init_spell() {
58
- // By FredCK (fckLang attributes have been added to the HTML source of this page)
59
- window.parent.parent.OnSpellerControlsLoad( this ) ;
60
-
61
- var controlForm = document.spellcheck;
62
-
63
- // create a new controlWindow object
64
- controlWindowObj = new controlWindow( controlForm );
65
-
66
- // call the init_spell() function in the parent frameset
67
- if( parent.frames.length ) {
68
- parent.init_spell( controlWindowObj );
69
- } else {
70
- alert( 'This page was loaded outside of a frameset. It might not display properly' );
71
- }
72
- }
73
-
74
- </script>
75
- </head>
76
- <body class="controlWindowBody" onLoad="init_spell();" style="OVERFLOW: hidden" scroll="no"> <!-- by FredCK -->
77
- <form name="spellcheck">
78
- <table border="0" cellpadding="0" cellspacing="0" border="0" align="center">
79
- <tr>
80
- <td colspan="3" class="normalLabel"><span fckLang="DlgSpellNotInDic">Not in dictionary:</span></td>
81
- </tr>
82
- <tr>
83
- <td colspan="3"><input class="readonlyInput" type="text" name="misword" readonly /></td>
84
- </tr>
85
- <tr>
86
- <td colspan="3" height="5"></td>
87
- </tr>
88
- <tr>
89
- <td class="normalLabel"><span fckLang="DlgSpellChangeTo">Change to:</span></td>
90
- </tr>
91
- <tr valign="top">
92
- <td>
93
- <table border="0" cellpadding="0" cellspacing="0" border="0">
94
- <tr>
95
- <td class="normalLabel">
96
- <input class="textDefault" type="text" name="txtsugg" />
97
- </td>
98
- </tr>
99
- <tr>
100
- <td>
101
- <select class="suggSlct" name="sugg" size="7" onChange="suggText();" onDblClick="replace_word();">
102
- <option></option>
103
- </select>
104
- </td>
105
- </tr>
106
- </table>
107
- </td>
108
- <td>&nbsp;&nbsp;</td>
109
- <td>
110
- <table border="0" cellpadding="0" cellspacing="0" border="0">
111
- <tr>
112
- <td>
113
- <input class="buttonDefault" type="button" fckLang="DlgSpellBtnIgnore" value="Ignore" onClick="ignore_word();">
114
- </td>
115
- <td>&nbsp;&nbsp;</td>
116
- <td>
117
- <input class="buttonDefault" type="button" fckLang="DlgSpellBtnIgnoreAll" value="Ignore All" onClick="ignore_all();">
118
- </td>
119
- </tr>
120
- <tr>
121
- <td colspan="3" height="5"></td>
122
- </tr>
123
- <tr>
124
- <td>
125
- <input class="buttonDefault" type="button" fckLang="DlgSpellBtnReplace" value="Replace" onClick="replace_word();">
126
- </td>
127
- <td>&nbsp;&nbsp;</td>
128
- <td>
129
- <input class="buttonDefault" type="button" fckLang="DlgSpellBtnReplaceAll" value="Replace All" onClick="replace_all();">
130
- </td>
131
- </tr>
132
- <tr>
133
- <td colspan="3" height="5"></td>
134
- </tr>
135
- <tr>
136
- <td>
137
- <input class="buttonDefault" type="button" name="btnUndo" fckLang="DlgSpellBtnUndo" value="Undo" onClick="undo();"
138
- disabled>
139
- </td>
140
- <td>&nbsp;&nbsp;</td>
141
- <td>
142
- <!-- by FredCK
143
- <input class="buttonDefault" type="button" value="Close" onClick="end_spell();">
144
- -->
145
- </td>
146
- </tr>
147
- </table>
148
- </td>
149
- </tr>
150
- </table>
151
- </form>
152
- </body>
153
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm DELETED
@@ -1,148 +0,0 @@
1
- <cfsetting enablecfoutputonly="true">
2
- <!---
3
- This code uses a CF User Defined Function and should work in CF version 5.0
4
- and up without alteration.
5
-
6
- Also if you are hosting your site at an ISP, you will have to check with them
7
- to see if the use of <CFEXECUTE> is allowed. In most cases ISP will not allow
8
- the use of that tag for security reasons. Clients would be able to access each
9
- others files in certain cases.
10
- --->
11
-
12
- <!--- The following variables values must reflect your installation. --->
13
- <cfset aspell_dir = "C:\Program Files\Aspell\bin">
14
- <cfset lang = "en_US">
15
- <cfset aspell_opts = "-a --lang=#lang# --encoding=utf-8 -H --rem-sgml-check=alt">
16
- <cfset tempfile_in = GetTempFile(GetTempDirectory(), "spell_")>
17
- <cfset tempfile_out = GetTempFile(GetTempDirectory(), "spell_")>
18
- <cfset spellercss = "../spellerStyle.css">
19
- <cfset word_win_src = "../wordWindow.js">
20
-
21
- <cfset form.checktext = form["textinputs[]"]>
22
-
23
- <!--- make no difference between URL and FORM scopes --->
24
- <cfparam name="url.checktext" default="">
25
- <cfparam name="form.checktext" default="#url.checktext#">
26
-
27
- <!--- Takes care of those pesky smart quotes from MS apps, replaces them with regular quotes --->
28
- <cfset submitted_text = ReplaceList(form.checktext,"%u201C,%u201D","%22,%22")>
29
-
30
- <!--- submitted_text now is ready for processing --->
31
-
32
- <!--- use carat on each line to escape possible aspell commands --->
33
- <cfset text = "">
34
- <cfset CRLF = Chr(13) & Chr(10)>
35
-
36
- <cfloop list="#submitted_text#" index="field" delimiters=",">
37
- <cfset text = text & "%" & CRLF
38
- & "^A" & CRLF
39
- & "!" & CRLF>
40
- <!--- Strip all tags for the text. (by FredCK - #339 / #681) --->
41
- <cfset field = REReplace(URLDecode(field), "<[^>]+>", " ", "all")>
42
- <cfloop list="#field#" index="line" delimiters="#CRLF#">
43
- <cfset text = ListAppend(text, "^" & Trim(JSStringFormat(line)), CRLF)>
44
- </cfloop>
45
- </cfloop>
46
-
47
- <!--- create temp file from the submitted text, this will be passed to aspell to be check for misspelled words --->
48
- <cffile action="write" file="#tempfile_in#" output="#text#" charset="utf-8">
49
-
50
- <!--- execute aspell in an UTF-8 console and redirect output to a file. UTF-8 encoding is lost if done differently --->
51
- <cfexecute name="cmd.exe" arguments='/c type "#tempfile_in#" | "#aspell_dir#\aspell.exe" #aspell_opts# > "#tempfile_out#"' timeout="100"/>
52
-
53
- <!--- read output file for further processing --->
54
- <cffile action="read" file="#tempfile_out#" variable="food" charset="utf-8">
55
-
56
- <!--- remove temp files --->
57
- <cffile action="delete" file="#tempfile_in#">
58
- <cffile action="delete" file="#tempfile_out#">
59
-
60
- <cfset texts = StructNew()>
61
- <cfset texts.textinputs = "">
62
- <cfset texts.words = "">
63
- <cfset texts.abort = "">
64
-
65
- <!--- Generate Text Inputs --->
66
- <cfset i = 0>
67
- <cfloop list="#submitted_text#" index="textinput">
68
- <cfset texts.textinputs = ListAppend(texts.textinputs, 'textinputs[#i#] = decodeURIComponent("#textinput#");', CRLF)>
69
- <cfset i = i + 1>
70
- </cfloop>
71
-
72
- <!--- Generate Words Lists --->
73
- <cfset word_cnt = 0>
74
- <cfset input_cnt = -1>
75
- <cfloop list="#food#" index="aspell_line" delimiters="#CRLF#">
76
- <cfset leftChar = Left(aspell_line, 1)>
77
- <cfif leftChar eq "*">
78
- <cfset input_cnt = input_cnt + 1>
79
- <cfset word_cnt = 0>
80
- <cfset texts.words = ListAppend(texts.words, "words[#input_cnt#] = [];", CRLF)>
81
- <cfset texts.words = ListAppend(texts.words, "suggs[#input_cnt#] = [];", CRLF)>
82
- <cfelse>
83
- <cfif leftChar eq "&" or leftChar eq "##">
84
- <!--- word that misspelled --->
85
- <cfset bad_word = Trim(ListGetAt(aspell_line, 2, " "))>
86
- <cfset bad_word = Replace(bad_word, "'", "\'", "ALL")>
87
- <!--- sugestions --->
88
- <cfset sug_list = Trim(ListRest(aspell_line, ":"))>
89
- <cfset sug_list = ListQualify(Replace(sug_list, "'", "\'", "ALL"), "'")>
90
- <!--- javascript --->
91
- <cfset texts.words = ListAppend(texts.words, "words[#input_cnt#][#word_cnt#] = '#bad_word#';", CRLF)>
92
- <cfset texts.words = ListAppend(texts.words, "suggs[#input_cnt#][#word_cnt#] = [#sug_list#];", CRLF)>
93
- <cfset word_cnt = word_cnt + 1>
94
- </cfif>
95
- </cfif>
96
- </cfloop>
97
-
98
- <cfif texts.words eq "">
99
- <cfset texts.abort = "alert('Spell check complete.\n\nNo misspellings found.'); top.window.close();">
100
- </cfif>
101
-
102
- <cfcontent type="text/html; charset=utf-8">
103
-
104
- <cfoutput><html>
105
- <head>
106
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
107
- <link rel="stylesheet" type="text/css" href="#spellercss#" />
108
- <script language="javascript" src="#word_win_src#"></script>
109
- <script language="javascript">
110
- var suggs = new Array();
111
- var words = new Array();
112
- var textinputs = new Array();
113
- var error;
114
-
115
- #texts.textinputs##CRLF#
116
- #texts.words#
117
- #texts.abort#
118
-
119
- var wordWindowObj = new wordWindow();
120
- wordWindowObj.originalSpellings = words;
121
- wordWindowObj.suggestions = suggs;
122
- wordWindowObj.textInputs = textinputs;
123
-
124
- function init_spell() {
125
- // check if any error occured during server-side processing
126
- if( error ) {
127
- alert( error );
128
- } else {
129
- // call the init_spell() function in the parent frameset
130
- if (parent.frames.length) {
131
- parent.init_spell( wordWindowObj );
132
- } else {
133
- alert('This page was loaded outside of a frameset. It might not display properly');
134
- }
135
- }
136
- }
137
- </script>
138
-
139
- </head>
140
- <body onLoad="init_spell();">
141
-
142
- <script type="text/javascript">
143
- wordWindowObj.writeBody();
144
- </script>
145
-
146
- </body>
147
- </html></cfoutput>
148
- <cfsetting enablecfoutputonly="false">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php DELETED
@@ -1,199 +0,0 @@
1
- <?php
2
- header('Content-type: text/html; charset=utf-8');
3
-
4
- // The following variables values must reflect your installation needs.
5
-
6
- $aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows)
7
- //$aspell_prog = 'aspell'; // by FredCK (for Linux)
8
-
9
- $lang = 'en_US';
10
- $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; // by FredCK
11
-
12
- $tempfiledir = "./";
13
-
14
- $spellercss = '../spellerStyle.css'; // by FredCK
15
- $word_win_src = '../wordWindow.js'; // by FredCK
16
-
17
- $textinputs = $_POST['textinputs']; # array
18
- $input_separator = "A";
19
-
20
- # set the JavaScript variable to the submitted text.
21
- # textinputs is an array, each element corresponding to the (url-encoded)
22
- # value of the text control submitted for spell-checking
23
- function print_textinputs_var() {
24
- global $textinputs;
25
- foreach( $textinputs as $key=>$val ) {
26
- # $val = str_replace( "'", "%27", $val );
27
- echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n";
28
- }
29
- }
30
-
31
- # make declarations for the text input index
32
- function print_textindex_decl( $text_input_idx ) {
33
- echo "words[$text_input_idx] = [];\n";
34
- echo "suggs[$text_input_idx] = [];\n";
35
- }
36
-
37
- # set an element of the JavaScript 'words' array to a misspelled word
38
- function print_words_elem( $word, $index, $text_input_idx ) {
39
- echo "words[$text_input_idx][$index] = '" . escape_quote( $word ) . "';\n";
40
- }
41
-
42
-
43
- # set an element of the JavaScript 'suggs' array to a list of suggestions
44
- function print_suggs_elem( $suggs, $index, $text_input_idx ) {
45
- echo "suggs[$text_input_idx][$index] = [";
46
- foreach( $suggs as $key=>$val ) {
47
- if( $val ) {
48
- echo "'" . escape_quote( $val ) . "'";
49
- if ( $key+1 < count( $suggs )) {
50
- echo ", ";
51
- }
52
- }
53
- }
54
- echo "];\n";
55
- }
56
-
57
- # escape single quote
58
- function escape_quote( $str ) {
59
- return preg_replace ( "/'/", "\\'", $str );
60
- }
61
-
62
-
63
- # handle a server-side error.
64
- function error_handler( $err ) {
65
- echo "error = '" . preg_replace( "/['\\\\]/", "\\\\$0", $err ) . "';\n";
66
- }
67
-
68
- ## get the list of misspelled words. Put the results in the javascript words array
69
- ## for each misspelled word, get suggestions and put in the javascript suggs array
70
- function print_checker_results() {
71
-
72
- global $aspell_prog;
73
- global $aspell_opts;
74
- global $tempfiledir;
75
- global $textinputs;
76
- global $input_separator;
77
- $aspell_err = "";
78
- # create temp file
79
- $tempfile = tempnam( $tempfiledir, 'aspell_data_' );
80
-
81
- # open temp file, add the submitted text.
82
- if( $fh = fopen( $tempfile, 'w' )) {
83
- for( $i = 0; $i < count( $textinputs ); $i++ ) {
84
- $text = urldecode( $textinputs[$i] );
85
-
86
- // Strip all tags for the text. (by FredCK - #339 / #681)
87
- $text = preg_replace( "/<[^>]+>/", " ", $text ) ;
88
-
89
- $lines = explode( "\n", $text );
90
- fwrite ( $fh, "%\n" ); # exit terse mode
91
- fwrite ( $fh, "^$input_separator\n" );
92
- fwrite ( $fh, "!\n" ); # enter terse mode
93
- foreach( $lines as $key=>$value ) {
94
- # use carat on each line to escape possible aspell commands
95
- fwrite( $fh, "^$value\n" );
96
- }
97
- }
98
- fclose( $fh );
99
-
100
- # exec aspell command - redirect STDERR to STDOUT
101
- $cmd = "$aspell_prog $aspell_opts < $tempfile 2>&1";
102
- if( $aspellret = shell_exec( $cmd )) {
103
- $linesout = explode( "\n", $aspellret );
104
- $index = 0;
105
- $text_input_index = -1;
106
- # parse each line of aspell return
107
- foreach( $linesout as $key=>$val ) {
108
- $chardesc = substr( $val, 0, 1 );
109
- # if '&', then not in dictionary but has suggestions
110
- # if '#', then not in dictionary and no suggestions
111
- # if '*', then it is a delimiter between text inputs
112
- # if '@' then version info
113
- if( $chardesc == '&' || $chardesc == '#' ) {
114
- $line = explode( " ", $val, 5 );
115
- print_words_elem( $line[1], $index, $text_input_index );
116
- if( isset( $line[4] )) {
117
- $suggs = explode( ", ", $line[4] );
118
- } else {
119
- $suggs = array();
120
- }
121
- print_suggs_elem( $suggs, $index, $text_input_index );
122
- $index++;
123
- } elseif( $chardesc == '*' ) {
124
- $text_input_index++;
125
- print_textindex_decl( $text_input_index );
126
- $index = 0;
127
- } elseif( $chardesc != '@' && $chardesc != "" ) {
128
- # assume this is error output
129
- $aspell_err .= $val;
130
- }
131
- }
132
- if( $aspell_err ) {
133
- $aspell_err = "Error executing `$cmd`\\n$aspell_err";
134
- error_handler( $aspell_err );
135
- }
136
- } else {
137
- error_handler( "System error: Aspell program execution failed (`$cmd`)" );
138
- }
139
- } else {
140
- error_handler( "System error: Could not open file '$tempfile' for writing" );
141
- }
142
-
143
- # close temp file, delete file
144
- unlink( $tempfile );
145
- }
146
-
147
-
148
- ?>
149
- <html>
150
- <head>
151
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
152
- <link rel="stylesheet" type="text/css" href="<?php echo $spellercss ?>" />
153
- <script language="javascript" src="<?php echo $word_win_src ?>"></script>
154
- <script language="javascript">
155
- var suggs = new Array();
156
- var words = new Array();
157
- var textinputs = new Array();
158
- var error;
159
- <?php
160
-
161
- print_textinputs_var();
162
-
163
- print_checker_results();
164
-
165
- ?>
166
-
167
- var wordWindowObj = new wordWindow();
168
- wordWindowObj.originalSpellings = words;
169
- wordWindowObj.suggestions = suggs;
170
- wordWindowObj.textInputs = textinputs;
171
-
172
- function init_spell() {
173
- // check if any error occured during server-side processing
174
- if( error ) {
175
- alert( error );
176
- } else {
177
- // call the init_spell() function in the parent frameset
178
- if (parent.frames.length) {
179
- parent.init_spell( wordWindowObj );
180
- } else {
181
- alert('This page was loaded outside of a frameset. It might not display properly');
182
- }
183
- }
184
- }
185
-
186
-
187
-
188
- </script>
189
-
190
- </head>
191
- <!-- <body onLoad="init_spell();"> by FredCK -->
192
- <body onLoad="init_spell();" bgcolor="#ffffff">
193
-
194
- <script type="text/javascript">
195
- wordWindowObj.writeBody();
196
- </script>
197
-
198
- </body>
199
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl DELETED
@@ -1,181 +0,0 @@
1
- #!/usr/bin/perl
2
-
3
- use CGI qw/ :standard /;
4
- use File::Temp qw/ tempfile tempdir /;
5
-
6
- # my $spellercss = '/speller/spellerStyle.css'; # by FredCK
7
- my $spellercss = '../spellerStyle.css'; # by FredCK
8
- # my $wordWindowSrc = '/speller/wordWindow.js'; # by FredCK
9
- my $wordWindowSrc = '../wordWindow.js'; # by FredCK
10
- my @textinputs = param( 'textinputs[]' ); # array
11
- # my $aspell_cmd = 'aspell'; # by FredCK (for Linux)
12
- my $aspell_cmd = '"C:\Program Files\Aspell\bin\aspell.exe"'; # by FredCK (for Windows)
13
- my $lang = 'en_US';
14
- # my $aspell_opts = "-a --lang=$lang --encoding=utf-8"; # by FredCK
15
- my $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; # by FredCK
16
- my $input_separator = "A";
17
-
18
- # set the 'wordtext' JavaScript variable to the submitted text.
19
- sub printTextVar {
20
- for( my $i = 0; $i <= $#textinputs; $i++ ) {
21
- print "textinputs[$i] = decodeURIComponent('" . escapeQuote( $textinputs[$i] ) . "')\n";
22
- }
23
- }
24
-
25
- sub printTextIdxDecl {
26
- my $idx = shift;
27
- print "words[$idx] = [];\n";
28
- print "suggs[$idx] = [];\n";
29
- }
30
-
31
- sub printWordsElem {
32
- my( $textIdx, $wordIdx, $word ) = @_;
33
- print "words[$textIdx][$wordIdx] = '" . escapeQuote( $word ) . "';\n";
34
- }
35
-
36
- sub printSuggsElem {
37
- my( $textIdx, $wordIdx, @suggs ) = @_;
38
- print "suggs[$textIdx][$wordIdx] = [";
39
- for my $i ( 0..$#suggs ) {
40
- print "'" . escapeQuote( $suggs[$i] ) . "'";
41
- if( $i < $#suggs ) {
42
- print ", ";
43
- }
44
- }
45
- print "];\n";
46
- }
47
-
48
- sub printCheckerResults {
49
- my $textInputIdx = -1;
50
- my $wordIdx = 0;
51
- my $unhandledText;
52
- # create temp file
53
- my $dir = tempdir( CLEANUP => 1 );
54
- my( $fh, $tmpfilename ) = tempfile( DIR => $dir );
55
-
56
- # temp file was created properly?
57
-
58
- # open temp file, add the submitted text.
59
- for( my $i = 0; $i <= $#textinputs; $i++ ) {
60
- $text = url_decode( $textinputs[$i] );
61
- # Strip all tags for the text. (by FredCK - #339 / #681)
62
- $text =~ s/<[^>]+>/ /g;
63
- @lines = split( /\n/, $text );
64
- print $fh "\%\n"; # exit terse mode
65
- print $fh "^$input_separator\n";
66
- print $fh "!\n"; # enter terse mode
67
- for my $line ( @lines ) {
68
- # use carat on each line to escape possible aspell commands
69
- print $fh "^$line\n";
70
- }
71
-
72
- }
73
- # exec aspell command
74
- my $cmd = "$aspell_cmd $aspell_opts < $tmpfilename 2>&1";
75
- open ASPELL, "$cmd |" or handleError( "Could not execute `$cmd`\\n$!" ) and return;
76
- # parse each line of aspell return
77
- for my $ret ( <ASPELL> ) {
78
- chomp( $ret );
79
- # if '&', then not in dictionary but has suggestions
80
- # if '#', then not in dictionary and no suggestions
81
- # if '*', then it is a delimiter between text inputs
82
- if( $ret =~ /^\*/ ) {
83
- $textInputIdx++;
84
- printTextIdxDecl( $textInputIdx );
85
- $wordIdx = 0;
86
-
87
- } elsif( $ret =~ /^(&|#)/ ) {
88
- my @tokens = split( " ", $ret, 5 );
89
- printWordsElem( $textInputIdx, $wordIdx, $tokens[1] );
90
- my @suggs = ();
91
- if( $tokens[4] ) {
92
- @suggs = split( ", ", $tokens[4] );
93
- }
94
- printSuggsElem( $textInputIdx, $wordIdx, @suggs );
95
- $wordIdx++;
96
- } else {
97
- $unhandledText .= $ret;
98
- }
99
- }
100
- close ASPELL or handleError( "Error executing `$cmd`\\n$unhandledText" ) and return;
101
- }
102
-
103
- sub escapeQuote {
104
- my $str = shift;
105
- $str =~ s/'/\\'/g;
106
- return $str;
107
- }
108
-
109
- sub handleError {
110
- my $err = shift;
111
- print "error = '" . escapeQuote( $err ) . "';\n";
112
- }
113
-
114
- sub url_decode {
115
- local $_ = @_ ? shift : $_;
116
- defined or return;
117
- # change + signs to spaces
118
- tr/+/ /;
119
- # change hex escapes to the proper characters
120
- s/%([a-fA-F0-9]{2})/pack "H2", $1/eg;
121
- return $_;
122
- }
123
-
124
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
125
- # Display HTML
126
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
127
-
128
- print <<EOF;
129
- Content-type: text/html; charset=utf-8
130
-
131
- <html>
132
- <head>
133
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
134
- <link rel="stylesheet" type="text/css" href="$spellercss"/>
135
- <script src="$wordWindowSrc"></script>
136
- <script type="text/javascript">
137
- var suggs = new Array();
138
- var words = new Array();
139
- var textinputs = new Array();
140
- var error;
141
- EOF
142
-
143
- printTextVar();
144
-
145
- printCheckerResults();
146
-
147
- print <<EOF;
148
- var wordWindowObj = new wordWindow();
149
- wordWindowObj.originalSpellings = words;
150
- wordWindowObj.suggestions = suggs;
151
- wordWindowObj.textInputs = textinputs;
152
-
153
-
154
- function init_spell() {
155
- // check if any error occured during server-side processing
156
- if( error ) {
157
- alert( error );
158
- } else {
159
- // call the init_spell() function in the parent frameset
160
- if (parent.frames.length) {
161
- parent.init_spell( wordWindowObj );
162
- } else {
163
- error = "This page was loaded outside of a frameset. ";
164
- error += "It might not display properly";
165
- alert( error );
166
- }
167
- }
168
- }
169
-
170
- </script>
171
-
172
- </head>
173
- <body onLoad="init_spell();">
174
-
175
- <script type="text/javascript">
176
- wordWindowObj.writeBody();
177
- </script>
178
-
179
- </body>
180
- </html>
181
- EOF
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js DELETED
@@ -1,461 +0,0 @@
1
- ////////////////////////////////////////////////////
2
- // spellChecker.js
3
- //
4
- // spellChecker object
5
- //
6
- // This file is sourced on web pages that have a textarea object to evaluate
7
- // for spelling. It includes the implementation for the spellCheckObject.
8
- //
9
- ////////////////////////////////////////////////////
10
-
11
-
12
- // constructor
13
- function spellChecker( textObject ) {
14
-
15
- // public properties - configurable
16
- // this.popUpUrl = '/speller/spellchecker.html'; // by FredCK
17
- this.popUpUrl = 'fck_spellerpages/spellerpages/spellchecker.html'; // by FredCK
18
- this.popUpName = 'spellchecker';
19
- // this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes"; // by FredCK
20
- this.popUpProps = null ; // by FredCK
21
- // this.spellCheckScript = '/speller/server-scripts/spellchecker.php'; // by FredCK
22
- //this.spellCheckScript = '/cgi-bin/spellchecker.pl';
23
-
24
- // values used to keep track of what happened to a word
25
- this.replWordFlag = "R"; // single replace
26
- this.ignrWordFlag = "I"; // single ignore
27
- this.replAllFlag = "RA"; // replace all occurances
28
- this.ignrAllFlag = "IA"; // ignore all occurances
29
- this.fromReplAll = "~RA"; // an occurance of a "replace all" word
30
- this.fromIgnrAll = "~IA"; // an occurance of a "ignore all" word
31
- // properties set at run time
32
- this.wordFlags = new Array();
33
- this.currentTextIndex = 0;
34
- this.currentWordIndex = 0;
35
- this.spellCheckerWin = null;
36
- this.controlWin = null;
37
- this.wordWin = null;
38
- this.textArea = textObject; // deprecated
39
- this.textInputs = arguments;
40
-
41
- // private methods
42
- this._spellcheck = _spellcheck;
43
- this._getSuggestions = _getSuggestions;
44
- this._setAsIgnored = _setAsIgnored;
45
- this._getTotalReplaced = _getTotalReplaced;
46
- this._setWordText = _setWordText;
47
- this._getFormInputs = _getFormInputs;
48
-
49
- // public methods
50
- this.openChecker = openChecker;
51
- this.startCheck = startCheck;
52
- this.checkTextBoxes = checkTextBoxes;
53
- this.checkTextAreas = checkTextAreas;
54
- this.spellCheckAll = spellCheckAll;
55
- this.ignoreWord = ignoreWord;
56
- this.ignoreAll = ignoreAll;
57
- this.replaceWord = replaceWord;
58
- this.replaceAll = replaceAll;
59
- this.terminateSpell = terminateSpell;
60
- this.undo = undo;
61
-
62
- // set the current window's "speller" property to the instance of this class.
63
- // this object can now be referenced by child windows/frames.
64
- window.speller = this;
65
- }
66
-
67
- // call this method to check all text boxes (and only text boxes) in the HTML document
68
- function checkTextBoxes() {
69
- this.textInputs = this._getFormInputs( "^text$" );
70
- this.openChecker();
71
- }
72
-
73
- // call this method to check all textareas (and only textareas ) in the HTML document
74
- function checkTextAreas() {
75
- this.textInputs = this._getFormInputs( "^textarea$" );
76
- this.openChecker();
77
- }
78
-
79
- // call this method to check all text boxes and textareas in the HTML document
80
- function spellCheckAll() {
81
- this.textInputs = this._getFormInputs( "^text(area)?$" );
82
- this.openChecker();
83
- }
84
-
85
- // call this method to check text boxe(s) and/or textarea(s) that were passed in to the
86
- // object's constructor or to the textInputs property
87
- function openChecker() {
88
- this.spellCheckerWin = window.open( this.popUpUrl, this.popUpName, this.popUpProps );
89
- if( !this.spellCheckerWin.opener ) {
90
- this.spellCheckerWin.opener = window;
91
- }
92
- }
93
-
94
- function startCheck( wordWindowObj, controlWindowObj ) {
95
-
96
- // set properties from args
97
- this.wordWin = wordWindowObj;
98
- this.controlWin = controlWindowObj;
99
-
100
- // reset properties
101
- this.wordWin.resetForm();
102
- this.controlWin.resetForm();
103
- this.currentTextIndex = 0;
104
- this.currentWordIndex = 0;
105
- // initialize the flags to an array - one element for each text input
106
- this.wordFlags = new Array( this.wordWin.textInputs.length );
107
- // each element will be an array that keeps track of each word in the text
108
- for( var i=0; i<this.wordFlags.length; i++ ) {
109
- this.wordFlags[i] = [];
110
- }
111
-
112
- // start
113
- this._spellcheck();
114
-
115
- return true;
116
- }
117
-
118
- function ignoreWord() {
119
- var wi = this.currentWordIndex;
120
- var ti = this.currentTextIndex;
121
- if( !this.wordWin ) {
122
- alert( 'Error: Word frame not available.' );
123
- return false;
124
- }
125
- if( !this.wordWin.getTextVal( ti, wi )) {
126
- alert( 'Error: "Not in dictionary" text is missing.' );
127
- return false;
128
- }
129
- // set as ignored
130
- if( this._setAsIgnored( ti, wi, this.ignrWordFlag )) {
131
- this.currentWordIndex++;
132
- this._spellcheck();
133
- }
134
- return true;
135
- }
136
-
137
- function ignoreAll() {
138
- var wi = this.currentWordIndex;
139
- var ti = this.currentTextIndex;
140
- if( !this.wordWin ) {
141
- alert( 'Error: Word frame not available.' );
142
- return false;
143
- }
144
- // get the word that is currently being evaluated.
145
- var s_word_to_repl = this.wordWin.getTextVal( ti, wi );
146
- if( !s_word_to_repl ) {
147
- alert( 'Error: "Not in dictionary" text is missing' );
148
- return false;
149
- }
150
-
151
- // set this word as an "ignore all" word.
152
- this._setAsIgnored( ti, wi, this.ignrAllFlag );
153
-
154
- // loop through all the words after this word
155
- for( var i = ti; i < this.wordWin.textInputs.length; i++ ) {
156
- for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) {
157
- if(( i == ti && j > wi ) || i > ti ) {
158
- // future word: set as "from ignore all" if
159
- // 1) do not already have a flag and
160
- // 2) have the same value as current word
161
- if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl )
162
- && ( !this.wordFlags[i][j] )) {
163
- this._setAsIgnored( i, j, this.fromIgnrAll );
164
- }
165
- }
166
- }
167
- }
168
-
169
- // finally, move on
170
- this.currentWordIndex++;
171
- this._spellcheck();
172
- return true;
173
- }
174
-
175
- function replaceWord() {
176
- var wi = this.currentWordIndex;
177
- var ti = this.currentTextIndex;
178
- if( !this.wordWin ) {
179
- alert( 'Error: Word frame not available.' );
180
- return false;
181
- }
182
- if( !this.wordWin.getTextVal( ti, wi )) {
183
- alert( 'Error: "Not in dictionary" text is missing' );
184
- return false;
185
- }
186
- if( !this.controlWin.replacementText ) {
187
- return false ;
188
- }
189
- var txt = this.controlWin.replacementText;
190
- if( txt.value ) {
191
- var newspell = new String( txt.value );
192
- if( this._setWordText( ti, wi, newspell, this.replWordFlag )) {
193
- this.currentWordIndex++;
194
- this._spellcheck();
195
- }
196
- }
197
- return true;
198
- }
199
-
200
- function replaceAll() {
201
- var ti = this.currentTextIndex;
202
- var wi = this.currentWordIndex;
203
- if( !this.wordWin ) {
204
- alert( 'Error: Word frame not available.' );
205
- return false;
206
- }
207
- var s_word_to_repl = this.wordWin.getTextVal( ti, wi );
208
- if( !s_word_to_repl ) {
209
- alert( 'Error: "Not in dictionary" text is missing' );
210
- return false;
211
- }
212
- var txt = this.controlWin.replacementText;
213
- if( !txt.value ) return false;
214
- var newspell = new String( txt.value );
215
-
216
- // set this word as a "replace all" word.
217
- this._setWordText( ti, wi, newspell, this.replAllFlag );
218
-
219
- // loop through all the words after this word
220
- for( var i = ti; i < this.wordWin.textInputs.length; i++ ) {
221
- for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) {
222
- if(( i == ti && j > wi ) || i > ti ) {
223
- // future word: set word text to s_word_to_repl if
224
- // 1) do not already have a flag and
225
- // 2) have the same value as s_word_to_repl
226
- if(( this.wordWin.getTextVal( i, j ) == s_word_to_repl )
227
- && ( !this.wordFlags[i][j] )) {
228
- this._setWordText( i, j, newspell, this.fromReplAll );
229
- }
230
- }
231
- }
232
- }
233
-
234
- // finally, move on
235
- this.currentWordIndex++;
236
- this._spellcheck();
237
- return true;
238
- }
239
-
240
- function terminateSpell() {
241
- // called when we have reached the end of the spell checking.
242
- var msg = ""; // by FredCK
243
- var numrepl = this._getTotalReplaced();
244
- if( numrepl == 0 ) {
245
- // see if there were no misspellings to begin with
246
- if( !this.wordWin ) {
247
- msg = "";
248
- } else {
249
- if( this.wordWin.totalMisspellings() ) {
250
- // msg += "No words changed."; // by FredCK
251
- msg += FCKLang.DlgSpellNoChanges ; // by FredCK
252
- } else {
253
- // msg += "No misspellings found."; // by FredCK
254
- msg += FCKLang.DlgSpellNoMispell ; // by FredCK
255
- }
256
- }
257
- } else if( numrepl == 1 ) {
258
- // msg += "One word changed."; // by FredCK
259
- msg += FCKLang.DlgSpellOneChange ; // by FredCK
260
- } else {
261
- // msg += numrepl + " words changed."; // by FredCK
262
- msg += FCKLang.DlgSpellManyChanges.replace( /%1/g, numrepl ) ;
263
- }
264
- if( msg ) {
265
- // msg += "\n"; // by FredCK
266
- alert( msg );
267
- }
268
-
269
- if( numrepl > 0 ) {
270
- // update the text field(s) on the opener window
271
- for( var i = 0; i < this.textInputs.length; i++ ) {
272
- // this.textArea.value = this.wordWin.text;
273
- if( this.wordWin ) {
274
- if( this.wordWin.textInputs[i] ) {
275
- this.textInputs[i].value = this.wordWin.textInputs[i];
276
- }
277
- }
278
- }
279
- }
280
-
281
- // return back to the calling window
282
- // this.spellCheckerWin.close(); // by FredCK
283
- if ( typeof( this.OnFinished ) == 'function' ) // by FredCK
284
- this.OnFinished(numrepl) ; // by FredCK
285
-
286
- return true;
287
- }
288
-
289
- function undo() {
290
- // skip if this is the first word!
291
- var ti = this.currentTextIndex;
292
- var wi = this.currentWordIndex;
293
-
294
- if( this.wordWin.totalPreviousWords( ti, wi ) > 0 ) {
295
- this.wordWin.removeFocus( ti, wi );
296
-
297
- // go back to the last word index that was acted upon
298
- do {
299
- // if the current word index is zero then reset the seed
300
- if( this.currentWordIndex == 0 && this.currentTextIndex > 0 ) {
301
- this.currentTextIndex--;
302
- this.currentWordIndex = this.wordWin.totalWords( this.currentTextIndex )-1;
303
- if( this.currentWordIndex < 0 ) this.currentWordIndex = 0;
304
- } else {
305
- if( this.currentWordIndex > 0 ) {
306
- this.currentWordIndex--;
307
- }
308
- }
309
- } while (
310
- this.wordWin.totalWords( this.currentTextIndex ) == 0
311
- || this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromIgnrAll
312
- || this.wordFlags[this.currentTextIndex][this.currentWordIndex] == this.fromReplAll
313
- );
314
-
315
- var text_idx = this.currentTextIndex;
316
- var idx = this.currentWordIndex;
317
- var preReplSpell = this.wordWin.originalSpellings[text_idx][idx];
318
-
319
- // if we got back to the first word then set the Undo button back to disabled
320
- if( this.wordWin.totalPreviousWords( text_idx, idx ) == 0 ) {
321
- this.controlWin.disableUndo();
322
- }
323
-
324
- var i, j, origSpell ;
325
- // examine what happened to this current word.
326
- switch( this.wordFlags[text_idx][idx] ) {
327
- // replace all: go through this and all the future occurances of the word
328
- // and revert them all to the original spelling and clear their flags
329
- case this.replAllFlag :
330
- for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) {
331
- for( j = 0; j < this.wordWin.totalWords( i ); j++ ) {
332
- if(( i == text_idx && j >= idx ) || i > text_idx ) {
333
- origSpell = this.wordWin.originalSpellings[i][j];
334
- if( origSpell == preReplSpell ) {
335
- this._setWordText ( i, j, origSpell, undefined );
336
- }
337
- }
338
- }
339
- }
340
- break;
341
-
342
- // ignore all: go through all the future occurances of the word
343
- // and clear their flags
344
- case this.ignrAllFlag :
345
- for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) {
346
- for( j = 0; j < this.wordWin.totalWords( i ); j++ ) {
347
- if(( i == text_idx && j >= idx ) || i > text_idx ) {
348
- origSpell = this.wordWin.originalSpellings[i][j];
349
- if( origSpell == preReplSpell ) {
350
- this.wordFlags[i][j] = undefined;
351
- }
352
- }
353
- }
354
- }
355
- break;
356
-
357
- // replace: revert the word to its original spelling
358
- case this.replWordFlag :
359
- this._setWordText ( text_idx, idx, preReplSpell, undefined );
360
- break;
361
- }
362
-
363
- // For all four cases, clear the wordFlag of this word. re-start the process
364
- this.wordFlags[text_idx][idx] = undefined;
365
- this._spellcheck();
366
- }
367
- }
368
-
369
- function _spellcheck() {
370
- var ww = this.wordWin;
371
-
372
- // check if this is the last word in the current text element
373
- if( this.currentWordIndex == ww.totalWords( this.currentTextIndex) ) {
374
- this.currentTextIndex++;
375
- this.currentWordIndex = 0;
376
- // keep going if we're not yet past the last text element
377
- if( this.currentTextIndex < this.wordWin.textInputs.length ) {
378
- this._spellcheck();
379
- return;
380
- } else {
381
- this.terminateSpell();
382
- return;
383
- }
384
- }
385
-
386
- // if this is after the first one make sure the Undo button is enabled
387
- if( this.currentWordIndex > 0 ) {
388
- this.controlWin.enableUndo();
389
- }
390
-
391
- // skip the current word if it has already been worked on
392
- if( this.wordFlags[this.currentTextIndex][this.currentWordIndex] ) {
393
- // increment the global current word index and move on.
394
- this.currentWordIndex++;
395
- this._spellcheck();
396
- } else {
397
- var evalText = ww.getTextVal( this.currentTextIndex, this.currentWordIndex );
398
- if( evalText ) {
399
- this.controlWin.evaluatedText.value = evalText;
400
- ww.setFocus( this.currentTextIndex, this.currentWordIndex );
401
- this._getSuggestions( this.currentTextIndex, this.currentWordIndex );
402
- }
403
- }
404
- }
405
-
406
- function _getSuggestions( text_num, word_num ) {
407
- this.controlWin.clearSuggestions();
408
- // add suggestion in list for each suggested word.
409
- // get the array of suggested words out of the
410
- // three-dimensional array containing all suggestions.
411
- var a_suggests = this.wordWin.suggestions[text_num][word_num];
412
- if( a_suggests ) {
413
- // got an array of suggestions.
414
- for( var ii = 0; ii < a_suggests.length; ii++ ) {
415
- this.controlWin.addSuggestion( a_suggests[ii] );
416
- }
417
- }
418
- this.controlWin.selectDefaultSuggestion();
419
- }
420
-
421
- function _setAsIgnored( text_num, word_num, flag ) {
422
- // set the UI
423
- this.wordWin.removeFocus( text_num, word_num );
424
- // do the bookkeeping
425
- this.wordFlags[text_num][word_num] = flag;
426
- return true;
427
- }
428
-
429
- function _getTotalReplaced() {
430
- var i_replaced = 0;
431
- for( var i = 0; i < this.wordFlags.length; i++ ) {
432
- for( var j = 0; j < this.wordFlags[i].length; j++ ) {
433
- if(( this.wordFlags[i][j] == this.replWordFlag )
434
- || ( this.wordFlags[i][j] == this.replAllFlag )
435
- || ( this.wordFlags[i][j] == this.fromReplAll )) {
436
- i_replaced++;
437
- }
438
- }
439
- }
440
- return i_replaced;
441
- }
442
-
443
- function _setWordText( text_num, word_num, newText, flag ) {
444
- // set the UI and form inputs
445
- this.wordWin.setText( text_num, word_num, newText );
446
- // keep track of what happened to this word:
447
- this.wordFlags[text_num][word_num] = flag;
448
- return true;
449
- }
450
-
451
- function _getFormInputs( inputPattern ) {
452
- var inputs = new Array();
453
- for( var i = 0; i < document.forms.length; i++ ) {
454
- for( var j = 0; j < document.forms[i].elements.length; j++ ) {
455
- if( document.forms[i].elements[j].type.match( inputPattern )) {
456
- inputs[inputs.length] = document.forms[i].elements[j];
457
- }
458
- }
459
- }
460
- return inputs;
461
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html DELETED
@@ -1,71 +0,0 @@
1
-
2
- <script>
3
-
4
- var wordWindow = null;
5
- var controlWindow = null;
6
-
7
- function init_spell( spellerWindow ) {
8
-
9
- if( spellerWindow ) {
10
- if( spellerWindow.windowType == "wordWindow" ) {
11
- wordWindow = spellerWindow;
12
- } else if ( spellerWindow.windowType == "controlWindow" ) {
13
- controlWindow = spellerWindow;
14
- }
15
- }
16
-
17
- if( controlWindow && wordWindow ) {
18
- // populate the speller object and start it off!
19
- var speller = opener.speller;
20
- wordWindow.speller = speller;
21
- speller.startCheck( wordWindow, controlWindow );
22
- }
23
- }
24
-
25
- // encodeForPost
26
- function encodeForPost( str ) {
27
- var s = new String( str );
28
- s = encodeURIComponent( s );
29
- // additionally encode single quotes to evade any PHP
30
- // magic_quotes_gpc setting (it inserts escape characters and
31
- // therefore skews the btye positions of misspelled words)
32
- return s.replace( /\'/g, '%27' );
33
- }
34
-
35
- // post the text area data to the script that populates the speller
36
- function postWords() {
37
- var bodyDoc = window.frames[0].document;
38
- bodyDoc.open();
39
- bodyDoc.write('<html>');
40
- bodyDoc.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
41
- bodyDoc.write('<link rel="stylesheet" type="text/css" href="spellerStyle.css"/>');
42
- if (opener) {
43
- var speller = opener.speller;
44
- bodyDoc.write('<body class="normalText" onLoad="document.forms[0].submit();">');
45
- bodyDoc.write('<p>' + window.parent.FCKLang.DlgSpellProgress + '<\/p>'); // by FredCK
46
- bodyDoc.write('<form action="'+speller.spellCheckScript+'" method="post">');
47
- for( var i = 0; i < speller.textInputs.length; i++ ) {
48
- bodyDoc.write('<input type="hidden" name="textinputs[]" value="'+encodeForPost(speller.textInputs[i].value)+'">');
49
- }
50
- bodyDoc.write('<\/form>');
51
- bodyDoc.write('<\/body>');
52
- } else {
53
- bodyDoc.write('<body class="normalText">');
54
- bodyDoc.write('<p><b>This page cannot be displayed<\/b><\/p><p>The window was not opened from another window.<\/p>');
55
- bodyDoc.write('<\/body>');
56
- }
57
- bodyDoc.write('<\/html>');
58
- bodyDoc.close();
59
- }
60
- </script>
61
-
62
- <html>
63
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
64
- <head>
65
- <title>Speller Pages</title>
66
- </head>
67
- <frameset rows="*,201" onLoad="postWords();">
68
- <frame src="blank.html">
69
- <frame src="controls.html">
70
- </frameset>
71
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css DELETED
@@ -1,49 +0,0 @@
1
- .blend {
2
- font-family: courier new;
3
- font-size: 10pt;
4
- border: 0;
5
- margin-bottom:-1;
6
- }
7
- .normalLabel {
8
- font-size:8pt;
9
- }
10
- .normalText {
11
- font-family:arial, helvetica, sans-serif;
12
- font-size:10pt;
13
- color:000000;
14
- background-color:FFFFFF;
15
- }
16
- .plainText {
17
- font-family: courier new, courier, monospace;
18
- font-size: 10pt;
19
- color:000000;
20
- background-color:FF