diff options
| author | hukl <contact@smyck.org> | 2009-02-17 21:54:39 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-02-17 21:54:39 +0100 |
| commit | f61b5b0597e0c25f084ee67d402f12a43a7a9947 (patch) | |
| tree | 3b4c3f9f38637f1a7ecf703ece4fd3bc4c6e2934 /public/javascripts | |
| parent | 3d3b786cc43266f6292f5edd25733dbb9bd6ed06 (diff) | |
added tinymce editor for body area of pages
Diffstat (limited to 'public/javascripts')
241 files changed, 33391 insertions, 0 deletions
diff --git a/public/javascripts/tiny_mce/langs/en.js b/public/javascripts/tiny_mce/langs/en.js new file mode 100755 index 0000000..8519b4d --- /dev/null +++ b/public/javascripts/tiny_mce/langs/en.js | |||
| @@ -0,0 +1,154 @@ | |||
| 1 | tinyMCE.addI18n({en:{ | ||
| 2 | common:{ | ||
| 3 | edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", | ||
| 4 | apply:"Apply", | ||
| 5 | insert:"Insert", | ||
| 6 | update:"Update", | ||
| 7 | cancel:"Cancel", | ||
| 8 | close:"Close", | ||
| 9 | browse:"Browse", | ||
| 10 | class_name:"Class", | ||
| 11 | not_set:"-- Not set --", | ||
| 12 | clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", | ||
| 13 | clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", | ||
| 14 | popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", | ||
| 15 | invalid_data:"Error: Invalid values entered, these are marked in red.", | ||
| 16 | more_colors:"More colors" | ||
| 17 | }, | ||
| 18 | contextmenu:{ | ||
| 19 | align:"Alignment", | ||
| 20 | left:"Left", | ||
| 21 | center:"Center", | ||
| 22 | right:"Right", | ||
| 23 | full:"Full" | ||
| 24 | }, | ||
| 25 | insertdatetime:{ | ||
| 26 | date_fmt:"%Y-%m-%d", | ||
| 27 | time_fmt:"%H:%M:%S", | ||
| 28 | insertdate_desc:"Insert date", | ||
| 29 | inserttime_desc:"Insert time", | ||
| 30 | months_long:"January,February,March,April,May,June,July,August,September,October,November,December", | ||
| 31 | months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", | ||
| 32 | day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", | ||
| 33 | day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" | ||
| 34 | }, | ||
| 35 | print:{ | ||
| 36 | print_desc:"Print" | ||
| 37 | }, | ||
| 38 | preview:{ | ||
| 39 | preview_desc:"Preview" | ||
| 40 | }, | ||
| 41 | directionality:{ | ||
| 42 | ltr_desc:"Direction left to right", | ||
| 43 | rtl_desc:"Direction right to left" | ||
| 44 | }, | ||
| 45 | layer:{ | ||
| 46 | insertlayer_desc:"Insert new layer", | ||
| 47 | forward_desc:"Move forward", | ||
| 48 | backward_desc:"Move backward", | ||
| 49 | absolute_desc:"Toggle absolute positioning", | ||
| 50 | content:"New layer..." | ||
| 51 | }, | ||
| 52 | save:{ | ||
| 53 | save_desc:"Save", | ||
| 54 | cancel_desc:"Cancel all changes" | ||
| 55 | }, | ||
| 56 | nonbreaking:{ | ||
| 57 | nonbreaking_desc:"Insert non-breaking space character" | ||
| 58 | }, | ||
| 59 | iespell:{ | ||
| 60 | iespell_desc:"Run spell checking", | ||
| 61 | download:"ieSpell not detected. Do you want to install it now?" | ||
| 62 | }, | ||
| 63 | advhr:{ | ||
| 64 | advhr_desc:"Horizontal rule" | ||
| 65 | }, | ||
| 66 | emotions:{ | ||
| 67 | emotions_desc:"Emotions" | ||
| 68 | }, | ||
| 69 | searchreplace:{ | ||
| 70 | search_desc:"Find", | ||
| 71 | replace_desc:"Find/Replace" | ||
| 72 | }, | ||
| 73 | advimage:{ | ||
| 74 | image_desc:"Insert/edit image" | ||
| 75 | }, | ||
| 76 | advlink:{ | ||
| 77 | link_desc:"Insert/edit link" | ||
| 78 | }, | ||
| 79 | xhtmlxtras:{ | ||
| 80 | cite_desc:"Citation", | ||
| 81 | abbr_desc:"Abbreviation", | ||
| 82 | acronym_desc:"Acronym", | ||
| 83 | del_desc:"Deletion", | ||
| 84 | ins_desc:"Insertion", | ||
| 85 | attribs_desc:"Insert/Edit Attributes" | ||
| 86 | }, | ||
| 87 | style:{ | ||
| 88 | desc:"Edit CSS Style" | ||
| 89 | }, | ||
| 90 | paste:{ | ||
| 91 | paste_text_desc:"Paste as Plain Text", | ||
| 92 | paste_word_desc:"Paste from Word", | ||
| 93 | selectall_desc:"Select All" | ||
| 94 | }, | ||
| 95 | paste_dlg:{ | ||
| 96 | text_title:"Use CTRL+V on your keyboard to paste the text into the window.", | ||
| 97 | text_linebreaks:"Keep linebreaks", | ||
| 98 | word_title:"Use CTRL+V on your keyboard to paste the text into the window." | ||
| 99 | }, | ||
| 100 | table:{ | ||
| 101 | desc:"Inserts a new table", | ||
| 102 | row_before_desc:"Insert row before", | ||
| 103 | row_after_desc:"Insert row after", | ||
| 104 | delete_row_desc:"Delete row", | ||
| 105 | col_before_desc:"Insert column before", | ||
| 106 | col_after_desc:"Insert column after", | ||
| 107 | delete_col_desc:"Remove column", | ||
| 108 | split_cells_desc:"Split merged table cells", | ||
| 109 | merge_cells_desc:"Merge table cells", | ||
| 110 | row_desc:"Table row properties", | ||
| 111 | cell_desc:"Table cell properties", | ||
| 112 | props_desc:"Table properties", | ||
| 113 | paste_row_before_desc:"Paste table row before", | ||
| 114 | paste_row_after_desc:"Paste table row after", | ||
| 115 | cut_row_desc:"Cut table row", | ||
| 116 | copy_row_desc:"Copy table row", | ||
| 117 | del:"Delete table", | ||
| 118 | row:"Row", | ||
| 119 | col:"Column", | ||
| 120 | cell:"Cell" | ||
| 121 | }, | ||
| 122 | autosave:{ | ||
| 123 | unload_msg:"The changes you made will be lost if you navigate away from this page." | ||
| 124 | }, | ||
| 125 | fullscreen:{ | ||
| 126 | desc:"Toggle fullscreen mode" | ||
| 127 | }, | ||
| 128 | media:{ | ||
| 129 | desc:"Insert / edit embedded media", | ||
| 130 | edit:"Edit embedded media" | ||
| 131 | }, | ||
| 132 | fullpage:{ | ||
| 133 | desc:"Document properties" | ||
| 134 | }, | ||
| 135 | template:{ | ||
| 136 | desc:"Insert predefined template content" | ||
| 137 | }, | ||
| 138 | visualchars:{ | ||
| 139 | desc:"Visual control characters on/off." | ||
| 140 | }, | ||
| 141 | spellchecker:{ | ||
| 142 | desc:"Toggle spellchecker", | ||
| 143 | menu:"Spellchecker settings", | ||
| 144 | ignore_word:"Ignore word", | ||
| 145 | ignore_words:"Ignore all", | ||
| 146 | langs:"Languages", | ||
| 147 | wait:"Please wait...", | ||
| 148 | sug:"Suggestions", | ||
| 149 | no_sug:"No suggestions", | ||
| 150 | no_mpell:"No misspellings found." | ||
| 151 | }, | ||
| 152 | pagebreak:{ | ||
| 153 | desc:"Insert page break." | ||
| 154 | }}}); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/license.txt b/public/javascripts/tiny_mce/license.txt new file mode 100755 index 0000000..60d6d4c --- /dev/null +++ b/public/javascripts/tiny_mce/license.txt | |||
| @@ -0,0 +1,504 @@ | |||
| 1 | GNU LESSER GENERAL PUBLIC LICENSE | ||
| 2 | Version 2.1, February 1999 | ||
| 3 | |||
| 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. | ||
| 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 6 | Everyone is permitted to copy and distribute verbatim copies | ||
| 7 | of this license document, but changing it is not allowed. | ||
| 8 | |||
| 9 | [This is the first released version of the Lesser GPL. It also counts | ||
| 10 | as the successor of the GNU Library Public License, version 2, hence | ||
| 11 | the version number 2.1.] | ||
| 12 | |||
| 13 | Preamble | ||
| 14 | |||
| 15 | The licenses for most software are designed to take away your | ||
| 16 | freedom to share and change it. By contrast, the GNU General Public | ||
| 17 | Licenses are intended to guarantee your freedom to share and change | ||
| 18 | free software--to make sure the software is free for all its users. | ||
| 19 | |||
| 20 | This license, the Lesser General Public License, applies to some | ||
| 21 | specially designated software packages--typically libraries--of the | ||
| 22 | Free Software Foundation and other authors who decide to use it. You | ||
| 23 | can use it too, but we suggest you first think carefully about whether | ||
| 24 | this license or the ordinary General Public License is the better | ||
| 25 | strategy to use in any particular case, based on the explanations below. | ||
| 26 | |||
| 27 | When we speak of free software, we are referring to freedom of use, | ||
| 28 | not price. Our General Public Licenses are designed to make sure that | ||
| 29 | you have the freedom to distribute copies of free software (and charge | ||
| 30 | for this service if you wish); that you receive source code or can get | ||
| 31 | it if you want it; that you can change the software and use pieces of | ||
| 32 | it in new free programs; and that you are informed that you can do | ||
| 33 | these things. | ||
| 34 | |||
| 35 | To protect your rights, we need to make restrictions that forbid | ||
| 36 | distributors to deny you these rights or to ask you to surrender these | ||
| 37 | rights. These restrictions translate to certain responsibilities for | ||
| 38 | you if you distribute copies of the library or if you modify it. | ||
| 39 | |||
| 40 | For example, if you distribute copies of the library, whether gratis | ||
| 41 | or for a fee, you must give the recipients all the rights that we gave | ||
| 42 | you. You must make sure that they, too, receive or can get the source | ||
| 43 | code. If you link other code with the library, you must provide | ||
| 44 | complete object files to the recipients, so that they can relink them | ||
| 45 | with the library after making changes to the library and recompiling | ||
| 46 | it. And you must show them these terms so they know their rights. | ||
| 47 | |||
| 48 | We protect your rights with a two-step method: (1) we copyright the | ||
| 49 | library, and (2) we offer you this license, which gives you legal | ||
| 50 | permission to copy, distribute and/or modify the library. | ||
| 51 | |||
| 52 | To protect each distributor, we want to make it very clear that | ||
| 53 | there is no warranty for the free library. Also, if the library is | ||
| 54 | modified by someone else and passed on, the recipients should know | ||
| 55 | that what they have is not the original version, so that the original | ||
| 56 | author's reputation will not be affected by problems that might be | ||
| 57 | introduced by others. | ||
| 58 | |||
| 59 | Finally, software patents pose a constant threat to the existence of | ||
| 60 | any free program. We wish to make sure that a company cannot | ||
| 61 | effectively restrict the users of a free program by obtaining a | ||
| 62 | restrictive license from a patent holder. Therefore, we insist that | ||
| 63 | any patent license obtained for a version of the library must be | ||
| 64 | consistent with the full freedom of use specified in this license. | ||
| 65 | |||
| 66 | Most GNU software, including some libraries, is covered by the | ||
| 67 | ordinary GNU General Public License. This license, the GNU Lesser | ||
| 68 | General Public License, applies to certain designated libraries, and | ||
| 69 | is quite different from the ordinary General Public License. We use | ||
| 70 | this license for certain libraries in order to permit linking those | ||
| 71 | libraries into non-free programs. | ||
| 72 | |||
| 73 | When a program is linked with a library, whether statically or using | ||
| 74 | a shared library, the combination of the two is legally speaking a | ||
| 75 | combined work, a derivative of the original library. The ordinary | ||
| 76 | General Public License therefore permits such linking only if the | ||
| 77 | entire combination fits its criteria of freedom. The Lesser General | ||
| 78 | Public License permits more lax criteria for linking other code with | ||
| 79 | the library. | ||
| 80 | |||
| 81 | We call this license the "Lesser" General Public License because it | ||
| 82 | does Less to protect the user's freedom than the ordinary General | ||
| 83 | Public License. It also provides other free software developers Less | ||
| 84 | of an advantage over competing non-free programs. These disadvantages | ||
| 85 | are the reason we use the ordinary General Public License for many | ||
| 86 | libraries. However, the Lesser license provides advantages in certain | ||
| 87 | special circumstances. | ||
| 88 | |||
| 89 | For example, on rare occasions, there may be a special need to | ||
| 90 | encourage the widest possible use of a certain library, so that it becomes | ||
| 91 | a de-facto standard. To achieve this, non-free programs must be | ||
| 92 | allowed to use the library. A more frequent case is that a free | ||
| 93 | library does the same job as widely used non-free libraries. In this | ||
| 94 | case, there is little to gain by limiting the free library to free | ||
| 95 | software only, so we use the Lesser General Public License. | ||
| 96 | |||
| 97 | In other cases, permission to use a particular library in non-free | ||
| 98 | programs enables a greater number of people to use a large body of | ||
| 99 | free software. For example, permission to use the GNU C Library in | ||
| 100 | non-free programs enables many more people to use the whole GNU | ||
| 101 | operating system, as well as its variant, the GNU/Linux operating | ||
| 102 | system. | ||
| 103 | |||
| 104 | Although the Lesser General Public License is Less protective of the | ||
| 105 | users' freedom, it does ensure that the user of a program that is | ||
| 106 | linked with the Library has the freedom and the wherewithal to run | ||
| 107 | that program using a modified version of the Library. | ||
| 108 | |||
| 109 | The precise terms and conditions for copying, distribution and | ||
| 110 | modification follow. Pay close attention to the difference between a | ||
| 111 | "work based on the library" and a "work that uses the library". The | ||
| 112 | former contains code derived from the library, whereas the latter must | ||
| 113 | be combined with the library in order to run. | ||
| 114 | |||
| 115 | GNU LESSER GENERAL PUBLIC LICENSE | ||
| 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
| 117 | |||
| 118 | 0. This License Agreement applies to any software library or other | ||
| 119 | program which contains a notice placed by the copyright holder or | ||
| 120 | other authorized party saying it may be distributed under the terms of | ||
| 121 | this Lesser General Public License (also called "this License"). | ||
| 122 | Each licensee is addressed as "you". | ||
| 123 | |||
| 124 | A "library" means a collection of software functions and/or data | ||
| 125 | prepared so as to be conveniently linked with application programs | ||
| 126 | (which use some of those functions and data) to form executables. | ||
| 127 | |||
| 128 | The "Library", below, refers to any such software library or work | ||
| 129 | which has been distributed under these terms. A "work based on the | ||
| 130 | Library" means either the Library or any derivative work under | ||
| 131 | copyright law: that is to say, a work containing the Library or a | ||
| 132 | portion of it, either verbatim or with modifications and/or translated | ||
| 133 | straightforwardly into another language. (Hereinafter, translation is | ||
| 134 | included without limitation in the term "modification".) | ||
| 135 | |||
| 136 | "Source code" for a work means the preferred form of the work for | ||
| 137 | making modifications to it. For a library, complete source code means | ||
| 138 | all the source code for all modules it contains, plus any associated | ||
| 139 | interface definition files, plus the scripts used to control compilation | ||
| 140 | and installation of the library. | ||
| 141 | |||
| 142 | Activities other than copying, distribution and modification are not | ||
| 143 | covered by this License; they are outside its scope. The act of | ||
| 144 | running a program using the Library is not restricted, and output from | ||
| 145 | such a program is covered only if its contents constitute a work based | ||
| 146 | on the Library (independent of the use of the Library in a tool for | ||
| 147 | writing it). Whether that is true depends on what the Library does | ||
| 148 | and what the program that uses the Library does. | ||
| 149 | |||
| 150 | 1. You may copy and distribute verbatim copies of the Library's | ||
| 151 | complete source code as you receive it, in any medium, provided that | ||
| 152 | you conspicuously and appropriately publish on each copy an | ||
| 153 | appropriate copyright notice and disclaimer of warranty; keep intact | ||
| 154 | all the notices that refer to this License and to the absence of any | ||
| 155 | warranty; and distribute a copy of this License along with the | ||
| 156 | Library. | ||
| 157 | |||
| 158 | You may charge a fee for the physical act of transferring a copy, | ||
| 159 | and you may at your option offer warranty protection in exchange for a | ||
| 160 | fee. | ||
| 161 | |||
| 162 | 2. You may modify your copy or copies of the Library or any portion | ||
| 163 | of it, thus forming a work based on the Library, and copy and | ||
| 164 | distribute such modifications or work under the terms of Section 1 | ||
| 165 | above, provided that you also meet all of these conditions: | ||
| 166 | |||
| 167 | a) The modified work must itself be a software library. | ||
| 168 | |||
| 169 | b) You must cause the files modified to carry prominent notices | ||
| 170 | stating that you changed the files and the date of any change. | ||
| 171 | |||
| 172 | c) You must cause the whole of the work to be licensed at no | ||
| 173 | charge to all third parties under the terms of this License. | ||
| 174 | |||
| 175 | d) If a facility in the modified Library refers to a function or a | ||
| 176 | table of data to be supplied by an application program that uses | ||
| 177 | the facility, other than as an argument passed when the facility | ||
| 178 | is invoked, then you must make a good faith effort to ensure that, | ||
| 179 | in the event an application does not supply such function or | ||
| 180 | table, the facility still operates, and performs whatever part of | ||
| 181 | its purpose remains meaningful. | ||
| 182 | |||
| 183 | (For example, a function in a library to compute square roots has | ||
| 184 | a purpose that is entirely well-defined independent of the | ||
| 185 | application. Therefore, Subsection 2d requires that any | ||
| 186 | application-supplied function or table used by this function must | ||
| 187 | be optional: if the application does not supply it, the square | ||
| 188 | root function must still compute square roots.) | ||
| 189 | |||
| 190 | These requirements apply to the modified work as a whole. If | ||
| 191 | identifiable sections of that work are not derived from the Library, | ||
| 192 | and can be reasonably considered independent and separate works in | ||
| 193 | themselves, then this License, and its terms, do not apply to those | ||
| 194 | sections when you distribute them as separate works. But when you | ||
| 195 | distribute the same sections as part of a whole which is a work based | ||
| 196 | on the Library, the distribution of the whole must be on the terms of | ||
| 197 | this License, whose permissions for other licensees extend to the | ||
| 198 | entire whole, and thus to each and every part regardless of who wrote | ||
| 199 | it. | ||
| 200 | |||
| 201 | Thus, it is not the intent of this section to claim rights or contest | ||
| 202 | your rights to work written entirely by you; rather, the intent is to | ||
| 203 | exercise the right to control the distribution of derivative or | ||
| 204 | collective works based on the Library. | ||
| 205 | |||
| 206 | In addition, mere aggregation of another work not based on the Library | ||
| 207 | with the Library (or with a work based on the Library) on a volume of | ||
| 208 | a storage or distribution medium does not bring the other work under | ||
| 209 | the scope of this License. | ||
| 210 | |||
| 211 | 3. You may opt to apply the terms of the ordinary GNU General Public | ||
| 212 | License instead of this License to a given copy of the Library. To do | ||
| 213 | this, you must alter all the notices that refer to this License, so | ||
| 214 | that they refer to the ordinary GNU General Public License, version 2, | ||
| 215 | instead of to this License. (If a newer version than version 2 of the | ||
| 216 | ordinary GNU General Public License has appeared, then you can specify | ||
| 217 | that version instead if you wish.) Do not make any other change in | ||
| 218 | these notices. | ||
| 219 | |||
| 220 | Once this change is made in a given copy, it is irreversible for | ||
| 221 | that copy, so the ordinary GNU General Public License applies to all | ||
| 222 | subsequent copies and derivative works made from that copy. | ||
| 223 | |||
| 224 | This option is useful when you wish to copy part of the code of | ||
| 225 | the Library into a program that is not a library. | ||
| 226 | |||
| 227 | 4. You may copy and distribute the Library (or a portion or | ||
| 228 | derivative of it, under Section 2) in object code or executable form | ||
| 229 | under the terms of Sections 1 and 2 above provided that you accompany | ||
| 230 | it with the complete corresponding machine-readable source code, which | ||
| 231 | must be distributed under the terms of Sections 1 and 2 above on a | ||
| 232 | medium customarily used for software interchange. | ||
| 233 | |||
| 234 | If distribution of object code is made by offering access to copy | ||
| 235 | from a designated place, then offering equivalent access to copy the | ||
| 236 | source code from the same place satisfies the requirement to | ||
| 237 | distribute the source code, even though third parties are not | ||
| 238 | compelled to copy the source along with the object code. | ||
| 239 | |||
| 240 | 5. A program that contains no derivative of any portion of the | ||
| 241 | Library, but is designed to work with the Library by being compiled or | ||
| 242 | linked with it, is called a "work that uses the Library". Such a | ||
| 243 | work, in isolation, is not a derivative work of the Library, and | ||
| 244 | therefore falls outside the scope of this License. | ||
| 245 | |||
| 246 | However, linking a "work that uses the Library" with the Library | ||
| 247 | creates an executable that is a derivative of the Library (because it | ||
| 248 | contains portions of the Library), rather than a "work that uses the | ||
| 249 | library". The executable is therefore covered by this License. | ||
| 250 | Section 6 states terms for distribution of such executables. | ||
| 251 | |||
| 252 | When a "work that uses the Library" uses material from a header file | ||
| 253 | that is part of the Library, the object code for the work may be a | ||
| 254 | derivative work of the Library even though the source code is not. | ||
| 255 | Whether this is true is especially significant if the work can be | ||
| 256 | linked without the Library, or if the work is itself a library. The | ||
| 257 | threshold for this to be true is not precisely defined by law. | ||
| 258 | |||
| 259 | If such an object file uses only numerical parameters, data | ||
| 260 | structure layouts and accessors, and small macros and small inline | ||
| 261 | functions (ten lines or less in length), then the use of the object | ||
| 262 | file is unrestricted, regardless of whether it is legally a derivative | ||
| 263 | work. (Executables containing this object code plus portions of the | ||
| 264 | Library will still fall under Section 6.) | ||
| 265 | |||
| 266 | Otherwise, if the work is a derivative of the Library, you may | ||
| 267 | distribute the object code for the work under the terms of Section 6. | ||
| 268 | Any executables containing that work also fall under Section 6, | ||
| 269 | whether or not they are linked directly with the Library itself. | ||
| 270 | |||
| 271 | 6. As an exception to the Sections above, you may also combine or | ||
| 272 | link a "work that uses the Library" with the Library to produce a | ||
| 273 | work containing portions of the Library, and distribute that work | ||
| 274 | under terms of your choice, provided that the terms permit | ||
| 275 | modification of the work for the customer's own use and reverse | ||
| 276 | engineering for debugging such modifications. | ||
| 277 | |||
| 278 | You must give prominent notice with each copy of the work that the | ||
| 279 | Library is used in it and that the Library and its use are covered by | ||
| 280 | this License. You must supply a copy of this License. If the work | ||
| 281 | during execution displays copyright notices, you must include the | ||
| 282 | copyright notice for the Library among them, as well as a reference | ||
| 283 | directing the user to the copy of this License. Also, you must do one | ||
| 284 | of these things: | ||
| 285 | |||
| 286 | a) Accompany the work with the complete corresponding | ||
| 287 | machine-readable source code for the Library including whatever | ||
| 288 | changes were used in the work (which must be distributed under | ||
| 289 | Sections 1 and 2 above); and, if the work is an executable linked | ||
| 290 | with the Library, with the complete machine-readable "work that | ||
| 291 | uses the Library", as object code and/or source code, so that the | ||
| 292 | user can modify the Library and then relink to produce a modified | ||
| 293 | executable containing the modified Library. (It is understood | ||
| 294 | that the user who changes the contents of definitions files in the | ||
| 295 | Library will not necessarily be able to recompile the application | ||
| 296 | to use the modified definitions.) | ||
| 297 | |||
| 298 | b) Use a suitable shared library mechanism for linking with the | ||
| 299 | Library. A suitable mechanism is one that (1) uses at run time a | ||
| 300 | copy of the library already present on the user's computer system, | ||
| 301 | rather than copying library functions into the executable, and (2) | ||
| 302 | will operate properly with a modified version of the library, if | ||
| 303 | the user installs one, as long as the modified version is | ||
| 304 | interface-compatible with the version that the work was made with. | ||
| 305 | |||
| 306 | c) Accompany the work with a written offer, valid for at | ||
| 307 | least three years, to give the same user the materials | ||
| 308 | specified in Subsection 6a, above, for a charge no more | ||
| 309 | than the cost of performing this distribution. | ||
| 310 | |||
| 311 | d) If distribution of the work is made by offering access to copy | ||
| 312 | from a designated place, offer equivalent access to copy the above | ||
| 313 | specified materials from the same place. | ||
| 314 | |||
| 315 | e) Verify that the user has already received a copy of these | ||
| 316 | materials or that you have already sent this user a copy. | ||
| 317 | |||
| 318 | For an executable, the required form of the "work that uses the | ||
| 319 | Library" must include any data and utility programs needed for | ||
| 320 | reproducing the executable from it. However, as a special exception, | ||
| 321 | the materials to be distributed need not include anything that is | ||
| 322 | normally distributed (in either source or binary form) with the major | ||
| 323 | components (compiler, kernel, and so on) of the operating system on | ||
| 324 | which the executable runs, unless that component itself accompanies | ||
| 325 | the executable. | ||
| 326 | |||
| 327 | It may happen that this requirement contradicts the license | ||
| 328 | restrictions of other proprietary libraries that do not normally | ||
| 329 | accompany the operating system. Such a contradiction means you cannot | ||
| 330 | use both them and the Library together in an executable that you | ||
| 331 | distribute. | ||
| 332 | |||
| 333 | 7. You may place library facilities that are a work based on the | ||
| 334 | Library side-by-side in a single library together with other library | ||
| 335 | facilities not covered by this License, and distribute such a combined | ||
| 336 | library, provided that the separate distribution of the work based on | ||
| 337 | the Library and of the other library facilities is otherwise | ||
| 338 | permitted, and provided that you do these two things: | ||
| 339 | |||
| 340 | a) Accompany the combined library with a copy of the same work | ||
| 341 | based on the Library, uncombined with any other library | ||
| 342 | facilities. This must be distributed under the terms of the | ||
| 343 | Sections above. | ||
| 344 | |||
| 345 | b) Give prominent notice with the combined library of the fact | ||
| 346 | that part of it is a work based on the Library, and explaining | ||
| 347 | where to find the accompanying uncombined form of the same work. | ||
| 348 | |||
| 349 | 8. You may not copy, modify, sublicense, link with, or distribute | ||
| 350 | the Library except as expressly provided under this License. Any | ||
| 351 | attempt otherwise to copy, modify, sublicense, link with, or | ||
| 352 | distribute the Library is void, and will automatically terminate your | ||
| 353 | rights under this License. However, parties who have received copies, | ||
| 354 | or rights, from you under this License will not have their licenses | ||
| 355 | terminated so long as such parties remain in full compliance. | ||
| 356 | |||
| 357 | 9. You are not required to accept this License, since you have not | ||
| 358 | signed it. However, nothing else grants you permission to modify or | ||
| 359 | distribute the Library or its derivative works. These actions are | ||
| 360 | prohibited by law if you do not accept this License. Therefore, by | ||
| 361 | modifying or distributing the Library (or any work based on the | ||
| 362 | Library), you indicate your acceptance of this License to do so, and | ||
| 363 | all its terms and conditions for copying, distributing or modifying | ||
| 364 | the Library or works based on it. | ||
| 365 | |||
| 366 | 10. Each time you redistribute the Library (or any work based on the | ||
| 367 | Library), the recipient automatically receives a license from the | ||
| 368 | original licensor to copy, distribute, link with or modify the Library | ||
| 369 | subject to these terms and conditions. You may not impose any further | ||
| 370 | restrictions on the recipients' exercise of the rights granted herein. | ||
| 371 | You are not responsible for enforcing compliance by third parties with | ||
| 372 | this License. | ||
| 373 | |||
| 374 | 11. If, as a consequence of a court judgment or allegation of patent | ||
| 375 | infringement or for any other reason (not limited to patent issues), | ||
| 376 | conditions are imposed on you (whether by court order, agreement or | ||
| 377 | otherwise) that contradict the conditions of this License, they do not | ||
| 378 | excuse you from the conditions of this License. If you cannot | ||
| 379 | distribute so as to satisfy simultaneously your obligations under this | ||
| 380 | License and any other pertinent obligations, then as a consequence you | ||
| 381 | may not distribute the Library at all. For example, if a patent | ||
| 382 | license would not permit royalty-free redistribution of the Library by | ||
| 383 | all those who receive copies directly or indirectly through you, then | ||
| 384 | the only way you could satisfy both it and this License would be to | ||
| 385 | refrain entirely from distribution of the Library. | ||
| 386 | |||
| 387 | If any portion of this section is held invalid or unenforceable under any | ||
| 388 | particular circumstance, the balance of the section is intended to apply, | ||
| 389 | and the section as a whole is intended to apply in other circumstances. | ||
| 390 | |||
| 391 | It is not the purpose of this section to induce you to infringe any | ||
| 392 | patents or other property right claims or to contest validity of any | ||
| 393 | such claims; this section has the sole purpose of protecting the | ||
| 394 | integrity of the free software distribution system which is | ||
| 395 | implemented by public license practices. Many people have made | ||
| 396 | generous contributions to the wide range of software distributed | ||
| 397 | through that system in reliance on consistent application of that | ||
| 398 | system; it is up to the author/donor to decide if he or she is willing | ||
| 399 | to distribute software through any other system and a licensee cannot | ||
| 400 | impose that choice. | ||
| 401 | |||
| 402 | This section is intended to make thoroughly clear what is believed to | ||
| 403 | be a consequence of the rest of this License. | ||
| 404 | |||
| 405 | 12. If the distribution and/or use of the Library is restricted in | ||
| 406 | certain countries either by patents or by copyrighted interfaces, the | ||
| 407 | original copyright holder who places the Library under this License may add | ||
| 408 | an explicit geographical distribution limitation excluding those countries, | ||
| 409 | so that distribution is permitted only in or among countries not thus | ||
| 410 | excluded. In such case, this License incorporates the limitation as if | ||
| 411 | written in the body of this License. | ||
| 412 | |||
| 413 | 13. The Free Software Foundation may publish revised and/or new | ||
| 414 | versions of the Lesser General Public License from time to time. | ||
| 415 | Such new versions will be similar in spirit to the present version, | ||
| 416 | but may differ in detail to address new problems or concerns. | ||
| 417 | |||
| 418 | Each version is given a distinguishing version number. If the Library | ||
| 419 | specifies a version number of this License which applies to it and | ||
| 420 | "any later version", you have the option of following the terms and | ||
| 421 | conditions either of that version or of any later version published by | ||
| 422 | the Free Software Foundation. If the Library does not specify a | ||
| 423 | license version number, you may choose any version ever published by | ||
| 424 | the Free Software Foundation. | ||
| 425 | |||
| 426 | 14. If you wish to incorporate parts of the Library into other free | ||
| 427 | programs whose distribution conditions are incompatible with these, | ||
| 428 | write to the author to ask for permission. For software which is | ||
| 429 | copyrighted by the Free Software Foundation, write to the Free | ||
| 430 | Software Foundation; we sometimes make exceptions for this. Our | ||
| 431 | decision will be guided by the two goals of preserving the free status | ||
| 432 | of all derivatives of our free software and of promoting the sharing | ||
| 433 | and reuse of software generally. | ||
| 434 | |||
| 435 | NO WARRANTY | ||
| 436 | |||
| 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO | ||
| 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. | ||
| 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR | ||
| 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY | ||
| 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE | ||
| 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME | ||
| 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | ||
| 446 | |||
| 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN | ||
| 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY | ||
| 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU | ||
| 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR | ||
| 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE | ||
| 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | ||
| 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | ||
| 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | ||
| 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH | ||
| 456 | DAMAGES. | ||
| 457 | |||
| 458 | END OF TERMS AND CONDITIONS | ||
| 459 | |||
| 460 | How to Apply These Terms to Your New Libraries | ||
| 461 | |||
| 462 | If you develop a new library, and you want it to be of the greatest | ||
| 463 | possible use to the public, we recommend making it free software that | ||
| 464 | everyone can redistribute and change. You can do so by permitting | ||
| 465 | redistribution under these terms (or, alternatively, under the terms of the | ||
| 466 | ordinary General Public License). | ||
| 467 | |||
| 468 | To apply these terms, attach the following notices to the library. It is | ||
| 469 | safest to attach them to the start of each source file to most effectively | ||
| 470 | convey the exclusion of warranty; and each file should have at least the | ||
| 471 | "copyright" line and a pointer to where the full notice is found. | ||
| 472 | |||
| 473 | <one line to give the library's name and a brief idea of what it does.> | ||
| 474 | Copyright (C) <year> <name of author> | ||
| 475 | |||
| 476 | This library is free software; you can redistribute it and/or | ||
| 477 | modify it under the terms of the GNU Lesser General Public | ||
| 478 | License as published by the Free Software Foundation; either | ||
| 479 | version 2.1 of the License, or (at your option) any later version. | ||
| 480 | |||
| 481 | This library is distributed in the hope that it will be useful, | ||
| 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 484 | Lesser General Public License for more details. | ||
| 485 | |||
| 486 | You should have received a copy of the GNU Lesser General Public | ||
| 487 | License along with this library; if not, write to the Free Software | ||
| 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 489 | |||
| 490 | Also add information on how to contact you by electronic and paper mail. | ||
| 491 | |||
| 492 | You should also get your employer (if you work as a programmer) or your | ||
| 493 | school, if any, to sign a "copyright disclaimer" for the library, if | ||
| 494 | necessary. Here is a sample; alter the names: | ||
| 495 | |||
| 496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the | ||
| 497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. | ||
| 498 | |||
| 499 | <signature of Ty Coon>, 1 April 1990 | ||
| 500 | Ty Coon, President of Vice | ||
| 501 | |||
| 502 | That's all there is to it! | ||
| 503 | |||
| 504 | |||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css b/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css new file mode 100755 index 0000000..0e22834 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | input.radio {border:1px none #000; background:transparent; vertical-align:middle;} | ||
| 2 | .panel_wrapper div.current {height:80px;} | ||
| 3 | #width {width:50px; vertical-align:middle;} | ||
| 4 | #width2 {width:50px; vertical-align:middle;} | ||
| 5 | #size {width:100px;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js new file mode 100755 index 0000000..f335004 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.AdvancedHRPlugin',{init:function(ed,url){ed.addCommand('mceAdvancedHr',function(){ed.windowManager.open({file:url+'/rule.htm',width:250+parseInt(ed.getLang('advhr.delta_width',0)),height:160+parseInt(ed.getLang('advhr.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('advhr',{title:'advhr.advhr_desc',cmd:'mceAdvancedHr'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('advhr',n.nodeName=='HR');});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='HR')ed.selection.select(e);});},getInfo:function(){return{longname:'Advanced HR',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advhr',tinymce.plugins.AdvancedHRPlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js new file mode 100755 index 0000000..8a84753 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.AdvancedHRPlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | // Register commands | ||
| 12 | ed.addCommand('mceAdvancedHr', function() { | ||
| 13 | ed.windowManager.open({ | ||
| 14 | file : url + '/rule.htm', | ||
| 15 | width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), | ||
| 16 | height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), | ||
| 17 | inline : 1 | ||
| 18 | }, { | ||
| 19 | plugin_url : url | ||
| 20 | }); | ||
| 21 | }); | ||
| 22 | |||
| 23 | // Register buttons | ||
| 24 | ed.addButton('advhr', { | ||
| 25 | title : 'advhr.advhr_desc', | ||
| 26 | cmd : 'mceAdvancedHr' | ||
| 27 | }); | ||
| 28 | |||
| 29 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 30 | cm.setActive('advhr', n.nodeName == 'HR'); | ||
| 31 | }); | ||
| 32 | |||
| 33 | ed.onClick.add(function(ed, e) { | ||
| 34 | e = e.target; | ||
| 35 | |||
| 36 | if (e.nodeName === 'HR') | ||
| 37 | ed.selection.select(e); | ||
| 38 | }); | ||
| 39 | }, | ||
| 40 | |||
| 41 | getInfo : function() { | ||
| 42 | return { | ||
| 43 | longname : 'Advanced HR', | ||
| 44 | author : 'Moxiecode Systems AB', | ||
| 45 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 46 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', | ||
| 47 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 48 | }; | ||
| 49 | } | ||
| 50 | }); | ||
| 51 | |||
| 52 | // Register plugin | ||
| 53 | tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); | ||
| 54 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/js/rule.js b/public/javascripts/tiny_mce/plugins/advhr/js/rule.js new file mode 100755 index 0000000..b6cbd66 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advhr/js/rule.js | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | var AdvHRDialog = { | ||
| 2 | init : function(ed) { | ||
| 3 | var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; | ||
| 4 | |||
| 5 | w = dom.getAttrib(n, 'width'); | ||
| 6 | f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); | ||
| 7 | f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; | ||
| 8 | f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); | ||
| 9 | selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); | ||
| 10 | }, | ||
| 11 | |||
| 12 | update : function() { | ||
| 13 | var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; | ||
| 14 | |||
| 15 | h = '<hr'; | ||
| 16 | |||
| 17 | if (f.size.value) { | ||
| 18 | h += ' size="' + f.size.value + '"'; | ||
| 19 | st += ' height:' + f.size.value + 'px;'; | ||
| 20 | } | ||
| 21 | |||
| 22 | if (f.width.value) { | ||
| 23 | h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"'; | ||
| 24 | st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';'; | ||
| 25 | } | ||
| 26 | |||
| 27 | if (f.noshade.checked) { | ||
| 28 | h += ' noshade="noshade"'; | ||
| 29 | st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;'; | ||
| 30 | } | ||
| 31 | |||
| 32 | if (ed.settings.inline_styles) | ||
| 33 | h += ' style="' + tinymce.trim(st) + '"'; | ||
| 34 | |||
| 35 | h += ' />'; | ||
| 36 | |||
| 37 | ed.execCommand("mceInsertContent", false, h); | ||
| 38 | tinyMCEPopup.close(); | ||
| 39 | } | ||
| 40 | }; | ||
| 41 | |||
| 42 | tinyMCEPopup.requireLangPack(); | ||
| 43 | tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js new file mode 100755 index 0000000..873bfd8 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | tinyMCE.addI18n('en.advhr_dlg',{ | ||
| 2 | width:"Width", | ||
| 3 | size:"Height", | ||
| 4 | noshade:"No shadow" | ||
| 5 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/rule.htm b/public/javascripts/tiny_mce/plugins/advhr/rule.htm new file mode 100755 index 0000000..8f20f7f --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advhr/rule.htm | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#advhr.advhr_desc}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/rule.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 9 | <link href="css/advhr.css" rel="stylesheet" type="text/css" /> | ||
| 10 | <base target="_self" /> | ||
| 11 | </head> | ||
| 12 | <body> | ||
| 13 | <form onsubmit="AdvHRDialog.update();return false;" action="#"> | ||
| 14 | <div class="tabs"> | ||
| 15 | <ul> | ||
| 16 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li> | ||
| 17 | </ul> | ||
| 18 | </div> | ||
| 19 | |||
| 20 | <div class="panel_wrapper"> | ||
| 21 | <div id="general_panel" class="panel current"> | ||
| 22 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 23 | <tr> | ||
| 24 | <td><label for="width">{#advhr_dlg.width}</label></td> | ||
| 25 | <td nowrap="nowrap"> | ||
| 26 | <input id="width" name="width" type="text" value="" class="mceFocus" /> | ||
| 27 | <select name="width2" id="width2"> | ||
| 28 | <option value="">px</option> | ||
| 29 | <option value="%">%</option> | ||
| 30 | </select> | ||
| 31 | </td> | ||
| 32 | </tr> | ||
| 33 | <tr> | ||
| 34 | <td><label for="size">{#advhr_dlg.size}</label></td> | ||
| 35 | <td><select id="size" name="size"> | ||
| 36 | <option value="">Normal</option> | ||
| 37 | <option value="1">1</option> | ||
| 38 | <option value="2">2</option> | ||
| 39 | <option value="3">3</option> | ||
| 40 | <option value="4">4</option> | ||
| 41 | <option value="5">5</option> | ||
| 42 | </select></td> | ||
| 43 | </tr> | ||
| 44 | <tr> | ||
| 45 | <td><label for="noshade">{#advhr_dlg.noshade}</label></td> | ||
| 46 | <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td> | ||
| 47 | </tr> | ||
| 48 | </table> | ||
| 49 | </div> | ||
| 50 | </div> | ||
| 51 | |||
| 52 | <div class="mceActionPanel"> | ||
| 53 | <div style="float: left"> | ||
| 54 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 55 | </div> | ||
| 56 | |||
| 57 | <div style="float: right"> | ||
| 58 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 59 | </div> | ||
| 60 | </div> | ||
| 61 | </form> | ||
| 62 | </body> | ||
| 63 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css b/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css new file mode 100755 index 0000000..0a6251a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #src_list, #over_list, #out_list {width:280px;} | ||
| 2 | .mceActionPanel {margin-top:7px;} | ||
| 3 | .alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} | ||
| 4 | .checkbox {border:0;} | ||
| 5 | .panel_wrapper div.current {height:305px;} | ||
| 6 | #prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} | ||
| 7 | #align, #classlist {width:150px;} | ||
| 8 | #width, #height {vertical-align:middle; width:50px; text-align:center;} | ||
| 9 | #vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} | ||
| 10 | #class_list {width:180px;} | ||
| 11 | input {width: 280px;} | ||
| 12 | #constrain, #onmousemovecheck {width:auto;} | ||
| 13 | #id, #dir, #lang, #usemap, #longdesc {width:200px;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js new file mode 100755 index 0000000..3af5057 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.AdvancedImagePlugin',{init:function(ed,url){ed.addCommand('mceAdvImage',function(){if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({file:url+'/image.htm',width:480+parseInt(ed.getLang('advimage.delta_width',0)),height:385+parseInt(ed.getLang('advimage.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('image',{title:'advimage.image_desc',cmd:'mceAdvImage'});},getInfo:function(){return{longname:'Advanced image',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advimage',tinymce.plugins.AdvancedImagePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js new file mode 100755 index 0000000..f526842 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 677 2008-03-07 13:52:41Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.AdvancedImagePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | // Register commands | ||
| 12 | ed.addCommand('mceAdvImage', function() { | ||
| 13 | // Internal image object like a flash placeholder | ||
| 14 | if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) | ||
| 15 | return; | ||
| 16 | |||
| 17 | ed.windowManager.open({ | ||
| 18 | file : url + '/image.htm', | ||
| 19 | width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), | ||
| 20 | height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), | ||
| 21 | inline : 1 | ||
| 22 | }, { | ||
| 23 | plugin_url : url | ||
| 24 | }); | ||
| 25 | }); | ||
| 26 | |||
| 27 | // Register buttons | ||
| 28 | ed.addButton('image', { | ||
| 29 | title : 'advimage.image_desc', | ||
| 30 | cmd : 'mceAdvImage' | ||
| 31 | }); | ||
| 32 | }, | ||
| 33 | |||
| 34 | getInfo : function() { | ||
| 35 | return { | ||
| 36 | longname : 'Advanced image', | ||
| 37 | author : 'Moxiecode Systems AB', | ||
| 38 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 39 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', | ||
| 40 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 41 | }; | ||
| 42 | } | ||
| 43 | }); | ||
| 44 | |||
| 45 | // Register plugin | ||
| 46 | tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); | ||
| 47 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/image.htm b/public/javascripts/tiny_mce/plugins/advimage/image.htm new file mode 100755 index 0000000..dd84083 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advimage/image.htm | |||
| @@ -0,0 +1,238 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#advimage_dlg.dialog_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 9 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 10 | <script type="text/javascript" src="js/image.js"></script> | ||
| 11 | <link href="css/advimage.css" rel="stylesheet" type="text/css" /> | ||
| 12 | <base target="_self" /> | ||
| 13 | </head> | ||
| 14 | <body id="advimage" style="display: none"> | ||
| 15 | <form onsubmit="ImageDialog.insert();return false;" action="#"> | ||
| 16 | <div class="tabs"> | ||
| 17 | <ul> | ||
| 18 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li> | ||
| 19 | <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li> | ||
| 20 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li> | ||
| 21 | </ul> | ||
| 22 | </div> | ||
| 23 | |||
| 24 | <div class="panel_wrapper"> | ||
| 25 | <div id="general_panel" class="panel current"> | ||
| 26 | <fieldset> | ||
| 27 | <legend>{#advimage_dlg.general}</legend> | ||
| 28 | |||
| 29 | <table class="properties"> | ||
| 30 | <tr> | ||
| 31 | <td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td> | ||
| 32 | <td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> | ||
| 33 | <tr> | ||
| 34 | <td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td> | ||
| 35 | <td id="srcbrowsercontainer"> </td> | ||
| 36 | </tr> | ||
| 37 | </table></td> | ||
| 38 | </tr> | ||
| 39 | <tr> | ||
| 40 | <td><label for="src_list">{#advimage_dlg.image_list}</label></td> | ||
| 41 | <td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"></select></td> | ||
| 42 | </tr> | ||
| 43 | <tr> | ||
| 44 | <td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td> | ||
| 45 | <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td> | ||
| 46 | </tr> | ||
| 47 | <tr> | ||
| 48 | <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td> | ||
| 49 | <td colspan="2"><input id="title" name="title" type="text" value="" /></td> | ||
| 50 | </tr> | ||
| 51 | </table> | ||
| 52 | </fieldset> | ||
| 53 | |||
| 54 | <fieldset> | ||
| 55 | <legend>{#advimage_dlg.preview}</legend> | ||
| 56 | <div id="prev"></div> | ||
| 57 | </fieldset> | ||
| 58 | </div> | ||
| 59 | |||
| 60 | <div id="appearance_panel" class="panel"> | ||
| 61 | <fieldset> | ||
| 62 | <legend>{#advimage_dlg.tab_appearance}</legend> | ||
| 63 | |||
| 64 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 65 | <tr> | ||
| 66 | <td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td> | ||
| 67 | <td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();"> | ||
| 68 | <option value="">{#not_set}</option> | ||
| 69 | <option value="baseline">{#advimage_dlg.align_baseline}</option> | ||
| 70 | <option value="top">{#advimage_dlg.align_top}</option> | ||
| 71 | <option value="middle">{#advimage_dlg.align_middle}</option> | ||
| 72 | <option value="bottom">{#advimage_dlg.align_bottom}</option> | ||
| 73 | <option value="text-top">{#advimage_dlg.align_texttop}</option> | ||
| 74 | <option value="text-bottom">{#advimage_dlg.align_textbottom}</option> | ||
| 75 | <option value="left">{#advimage_dlg.align_left}</option> | ||
| 76 | <option value="right">{#advimage_dlg.align_right}</option> | ||
| 77 | </select> | ||
| 78 | </td> | ||
| 79 | <td rowspan="6" valign="top"> | ||
| 80 | <div class="alignPreview"> | ||
| 81 | <img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" /> | ||
| 82 | Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam | ||
| 83 | nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum | ||
| 84 | edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam | ||
| 85 | erat volutpat. | ||
| 86 | </div> | ||
| 87 | </td> | ||
| 88 | </tr> | ||
| 89 | |||
| 90 | <tr> | ||
| 91 | <td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td> | ||
| 92 | <td nowrap="nowrap"> | ||
| 93 | <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x | ||
| 94 | <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px | ||
| 95 | </td> | ||
| 96 | </tr> | ||
| 97 | |||
| 98 | <tr> | ||
| 99 | <td> </td> | ||
| 100 | <td><table border="0" cellpadding="0" cellspacing="0"> | ||
| 101 | <tr> | ||
| 102 | <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td> | ||
| 103 | <td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td> | ||
| 104 | </tr> | ||
| 105 | </table></td> | ||
| 106 | </tr> | ||
| 107 | |||
| 108 | <tr> | ||
| 109 | <td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td> | ||
| 110 | <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" /> | ||
| 111 | </td> | ||
| 112 | </tr> | ||
| 113 | |||
| 114 | <tr> | ||
| 115 | <td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td> | ||
| 116 | <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td> | ||
| 117 | </tr> | ||
| 118 | |||
| 119 | <tr> | ||
| 120 | <td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td> | ||
| 121 | <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td> | ||
| 122 | </tr> | ||
| 123 | |||
| 124 | <tr> | ||
| 125 | <td><label for="class_list">{#class_name}</label></td> | ||
| 126 | <td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"></select></td> | ||
| 127 | </tr> | ||
| 128 | |||
| 129 | <tr> | ||
| 130 | <td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td> | ||
| 131 | <td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td> | ||
| 132 | </tr> | ||
| 133 | |||
| 134 | <!-- <tr> | ||
| 135 | <td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td> | ||
| 136 | <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> | ||
| 137 | </tr> --> | ||
| 138 | </table> | ||
| 139 | </fieldset> | ||
| 140 | </div> | ||
| 141 | |||
| 142 | <div id="advanced_panel" class="panel"> | ||
| 143 | <fieldset> | ||
| 144 | <legend>{#advimage_dlg.swap_image}</legend> | ||
| 145 | |||
| 146 | <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" /> | ||
| 147 | <label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label> | ||
| 148 | |||
| 149 | <table border="0" cellpadding="4" cellspacing="0" width="100%"> | ||
| 150 | <tr> | ||
| 151 | <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td> | ||
| 152 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 153 | <tr> | ||
| 154 | <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td> | ||
| 155 | <td id="onmouseoversrccontainer"> </td> | ||
| 156 | </tr> | ||
| 157 | </table></td> | ||
| 158 | </tr> | ||
| 159 | <tr> | ||
| 160 | <td><label for="over_list">{#advimage_dlg.image_list}</label></td> | ||
| 161 | <td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"></select></td> | ||
| 162 | </tr> | ||
| 163 | <tr> | ||
| 164 | <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td> | ||
| 165 | <td class="column2"><table border="0" cellspacing="0" cellpadding="0"> | ||
| 166 | <tr> | ||
| 167 | <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td> | ||
| 168 | <td id="onmouseoutsrccontainer"> </td> | ||
| 169 | </tr> | ||
| 170 | </table></td> | ||
| 171 | </tr> | ||
| 172 | <tr> | ||
| 173 | <td><label for="out_list">{#advimage_dlg.image_list}</label></td> | ||
| 174 | <td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"></select></td> | ||
| 175 | </tr> | ||
| 176 | </table> | ||
| 177 | </fieldset> | ||
| 178 | |||
| 179 | <fieldset> | ||
| 180 | <legend>{#advimage_dlg.misc}</legend> | ||
| 181 | |||
| 182 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 183 | <tr> | ||
| 184 | <td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td> | ||
| 185 | <td><input id="id" name="id" type="text" value="" /></td> | ||
| 186 | </tr> | ||
| 187 | |||
| 188 | <tr> | ||
| 189 | <td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td> | ||
| 190 | <td> | ||
| 191 | <select id="dir" name="dir" onchange="ImageDialog.changeAppearance();"> | ||
| 192 | <option value="">{#not_set}</option> | ||
| 193 | <option value="ltr">{#advimage_dlg.ltr}</option> | ||
| 194 | <option value="rtl">{#advimage_dlg.rtl}</option> | ||
| 195 | </select> | ||
| 196 | </td> | ||
| 197 | </tr> | ||
| 198 | |||
| 199 | <tr> | ||
| 200 | <td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td> | ||
| 201 | <td> | ||
| 202 | <input id="lang" name="lang" type="text" value="" /> | ||
| 203 | </td> | ||
| 204 | </tr> | ||
| 205 | |||
| 206 | <tr> | ||
| 207 | <td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td> | ||
| 208 | <td> | ||
| 209 | <input id="usemap" name="usemap" type="text" value="" /> | ||
| 210 | </td> | ||
| 211 | </tr> | ||
| 212 | |||
| 213 | <tr> | ||
| 214 | <td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td> | ||
| 215 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 216 | <tr> | ||
| 217 | <td><input id="longdesc" name="longdesc" type="text" value="" /></td> | ||
| 218 | <td id="longdesccontainer"> </td> | ||
| 219 | </tr> | ||
| 220 | </table></td> | ||
| 221 | </tr> | ||
| 222 | </table> | ||
| 223 | </fieldset> | ||
| 224 | </div> | ||
| 225 | </div> | ||
| 226 | |||
| 227 | <div class="mceActionPanel"> | ||
| 228 | <div style="float: left"> | ||
| 229 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 230 | </div> | ||
| 231 | |||
| 232 | <div style="float: right"> | ||
| 233 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 234 | </div> | ||
| 235 | </div> | ||
| 236 | </form> | ||
| 237 | </body> | ||
| 238 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif b/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif new file mode 100755 index 0000000..53bf689 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/js/image.js b/public/javascripts/tiny_mce/plugins/advimage/js/image.js new file mode 100755 index 0000000..64fc6f6 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advimage/js/image.js | |||
| @@ -0,0 +1,441 @@ | |||
| 1 | var ImageDialog = { | ||
| 2 | preInit : function() { | ||
| 3 | var url; | ||
| 4 | |||
| 5 | tinyMCEPopup.requireLangPack(); | ||
| 6 | |||
| 7 | if (url = tinyMCEPopup.getParam("external_image_list_url")) | ||
| 8 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 9 | }, | ||
| 10 | |||
| 11 | init : function(ed) { | ||
| 12 | var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); | ||
| 13 | |||
| 14 | tinyMCEPopup.resizeToInnerSize(); | ||
| 15 | this.fillClassList('class_list'); | ||
| 16 | this.fillFileList('src_list', 'tinyMCEImageList'); | ||
| 17 | this.fillFileList('over_list', 'tinyMCEImageList'); | ||
| 18 | this.fillFileList('out_list', 'tinyMCEImageList'); | ||
| 19 | TinyMCE_EditableSelects.init(); | ||
| 20 | |||
| 21 | if (n.nodeName == 'IMG') { | ||
| 22 | nl.src.value = dom.getAttrib(n, 'src'); | ||
| 23 | nl.width.value = dom.getAttrib(n, 'width'); | ||
| 24 | nl.height.value = dom.getAttrib(n, 'height'); | ||
| 25 | nl.alt.value = dom.getAttrib(n, 'alt'); | ||
| 26 | nl.title.value = dom.getAttrib(n, 'title'); | ||
| 27 | nl.vspace.value = this.getAttrib(n, 'vspace'); | ||
| 28 | nl.hspace.value = this.getAttrib(n, 'hspace'); | ||
| 29 | nl.border.value = this.getAttrib(n, 'border'); | ||
| 30 | selectByValue(f, 'align', this.getAttrib(n, 'align')); | ||
| 31 | selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); | ||
| 32 | nl.style.value = dom.getAttrib(n, 'style'); | ||
| 33 | nl.id.value = dom.getAttrib(n, 'id'); | ||
| 34 | nl.dir.value = dom.getAttrib(n, 'dir'); | ||
| 35 | nl.lang.value = dom.getAttrib(n, 'lang'); | ||
| 36 | nl.usemap.value = dom.getAttrib(n, 'usemap'); | ||
| 37 | nl.longdesc.value = dom.getAttrib(n, 'longdesc'); | ||
| 38 | nl.insert.value = ed.getLang('update'); | ||
| 39 | |||
| 40 | if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) | ||
| 41 | nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); | ||
| 42 | |||
| 43 | if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) | ||
| 44 | nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); | ||
| 45 | |||
| 46 | if (ed.settings.inline_styles) { | ||
| 47 | // Move attribs to styles | ||
| 48 | if (dom.getAttrib(n, 'align')) | ||
| 49 | this.updateStyle('align'); | ||
| 50 | |||
| 51 | if (dom.getAttrib(n, 'hspace')) | ||
| 52 | this.updateStyle('hspace'); | ||
| 53 | |||
| 54 | if (dom.getAttrib(n, 'border')) | ||
| 55 | this.updateStyle('border'); | ||
| 56 | |||
| 57 | if (dom.getAttrib(n, 'vspace')) | ||
| 58 | this.updateStyle('vspace'); | ||
| 59 | } | ||
| 60 | } | ||
| 61 | |||
| 62 | // Setup browse button | ||
| 63 | document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); | ||
| 64 | if (isVisible('srcbrowser')) | ||
| 65 | document.getElementById('src').style.width = '260px'; | ||
| 66 | |||
| 67 | // Setup browse button | ||
| 68 | document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); | ||
| 69 | if (isVisible('overbrowser')) | ||
| 70 | document.getElementById('onmouseoversrc').style.width = '260px'; | ||
| 71 | |||
| 72 | // Setup browse button | ||
| 73 | document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); | ||
| 74 | if (isVisible('outbrowser')) | ||
| 75 | document.getElementById('onmouseoutsrc').style.width = '260px'; | ||
| 76 | |||
| 77 | // If option enabled default contrain proportions to checked | ||
| 78 | if (ed.getParam("advimage_constrain_proportions", true)) | ||
| 79 | f.constrain.checked = true; | ||
| 80 | |||
| 81 | // Check swap image if valid data | ||
| 82 | if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) | ||
| 83 | this.setSwapImage(true); | ||
| 84 | else | ||
| 85 | this.setSwapImage(false); | ||
| 86 | |||
| 87 | this.changeAppearance(); | ||
| 88 | this.showPreviewImage(nl.src.value, 1); | ||
| 89 | }, | ||
| 90 | |||
| 91 | insert : function(file, title) { | ||
| 92 | var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; | ||
| 93 | |||
| 94 | if (f.src.value === '') { | ||
| 95 | if (ed.selection.getNode().nodeName == 'IMG') { | ||
| 96 | ed.dom.remove(ed.selection.getNode()); | ||
| 97 | ed.execCommand('mceRepaint'); | ||
| 98 | } | ||
| 99 | |||
| 100 | tinyMCEPopup.close(); | ||
| 101 | return; | ||
| 102 | } | ||
| 103 | |||
| 104 | if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { | ||
| 105 | if (!f.alt.value) { | ||
| 106 | tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { | ||
| 107 | if (s) | ||
| 108 | t.insertAndClose(); | ||
| 109 | }); | ||
| 110 | |||
| 111 | return; | ||
| 112 | } | ||
| 113 | } | ||
| 114 | |||
| 115 | t.insertAndClose(); | ||
| 116 | }, | ||
| 117 | |||
| 118 | insertAndClose : function() { | ||
| 119 | var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; | ||
| 120 | |||
| 121 | tinyMCEPopup.restoreSelection(); | ||
| 122 | |||
| 123 | // Fixes crash in Safari | ||
| 124 | if (tinymce.isWebKit) | ||
| 125 | ed.getWin().focus(); | ||
| 126 | |||
| 127 | if (!ed.settings.inline_styles) { | ||
| 128 | args = { | ||
| 129 | vspace : nl.vspace.value, | ||
| 130 | hspace : nl.hspace.value, | ||
| 131 | border : nl.border.value, | ||
| 132 | align : getSelectValue(f, 'align') | ||
| 133 | }; | ||
| 134 | } else { | ||
| 135 | // Remove deprecated values | ||
| 136 | args = { | ||
| 137 | vspace : '', | ||
| 138 | hspace : '', | ||
| 139 | border : '', | ||
| 140 | align : '' | ||
| 141 | }; | ||
| 142 | } | ||
| 143 | |||
| 144 | tinymce.extend(args, { | ||
| 145 | src : nl.src.value, | ||
| 146 | width : nl.width.value, | ||
| 147 | height : nl.height.value, | ||
| 148 | alt : nl.alt.value, | ||
| 149 | title : nl.title.value, | ||
| 150 | 'class' : getSelectValue(f, 'class_list'), | ||
| 151 | style : nl.style.value, | ||
| 152 | id : nl.id.value, | ||
| 153 | dir : nl.dir.value, | ||
| 154 | lang : nl.lang.value, | ||
| 155 | usemap : nl.usemap.value, | ||
| 156 | longdesc : nl.longdesc.value | ||
| 157 | }); | ||
| 158 | |||
| 159 | args.onmouseover = args.onmouseout = ''; | ||
| 160 | |||
| 161 | if (f.onmousemovecheck.checked) { | ||
| 162 | if (nl.onmouseoversrc.value) | ||
| 163 | args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; | ||
| 164 | |||
| 165 | if (nl.onmouseoutsrc.value) | ||
| 166 | args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; | ||
| 167 | } | ||
| 168 | |||
| 169 | el = ed.selection.getNode(); | ||
| 170 | |||
| 171 | if (el && el.nodeName == 'IMG') { | ||
| 172 | ed.dom.setAttribs(el, args); | ||
| 173 | } else { | ||
| 174 | ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1}); | ||
| 175 | ed.dom.setAttribs('__mce_tmp', args); | ||
| 176 | ed.dom.setAttrib('__mce_tmp', 'id', ''); | ||
| 177 | ed.undoManager.add(); | ||
| 178 | } | ||
| 179 | |||
| 180 | tinyMCEPopup.close(); | ||
| 181 | }, | ||
| 182 | |||
| 183 | getAttrib : function(e, at) { | ||
| 184 | var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; | ||
| 185 | |||
| 186 | if (ed.settings.inline_styles) { | ||
| 187 | switch (at) { | ||
| 188 | case 'align': | ||
| 189 | if (v = dom.getStyle(e, 'float')) | ||
| 190 | return v; | ||
| 191 | |||
| 192 | if (v = dom.getStyle(e, 'vertical-align')) | ||
| 193 | return v; | ||
| 194 | |||
| 195 | break; | ||
| 196 | |||
| 197 | case 'hspace': | ||
| 198 | v = dom.getStyle(e, 'margin-left') | ||
| 199 | v2 = dom.getStyle(e, 'margin-right'); | ||
| 200 | |||
| 201 | if (v && v == v2) | ||
| 202 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 203 | |||
| 204 | break; | ||
| 205 | |||
| 206 | case 'vspace': | ||
| 207 | v = dom.getStyle(e, 'margin-top') | ||
| 208 | v2 = dom.getStyle(e, 'margin-bottom'); | ||
| 209 | if (v && v == v2) | ||
| 210 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 211 | |||
| 212 | break; | ||
| 213 | |||
| 214 | case 'border': | ||
| 215 | v = 0; | ||
| 216 | |||
| 217 | tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { | ||
| 218 | sv = dom.getStyle(e, 'border-' + sv + '-width'); | ||
| 219 | |||
| 220 | // False or not the same as prev | ||
| 221 | if (!sv || (sv != v && v !== 0)) { | ||
| 222 | v = 0; | ||
| 223 | return false; | ||
| 224 | } | ||
| 225 | |||
| 226 | if (sv) | ||
| 227 | v = sv; | ||
| 228 | }); | ||
| 229 | |||
| 230 | if (v) | ||
| 231 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 232 | |||
| 233 | break; | ||
| 234 | } | ||
| 235 | } | ||
| 236 | |||
| 237 | if (v = dom.getAttrib(e, at)) | ||
| 238 | return v; | ||
| 239 | |||
| 240 | return ''; | ||
| 241 | }, | ||
| 242 | |||
| 243 | setSwapImage : function(st) { | ||
| 244 | var f = document.forms[0]; | ||
| 245 | |||
| 246 | f.onmousemovecheck.checked = st; | ||
| 247 | setBrowserDisabled('overbrowser', !st); | ||
| 248 | setBrowserDisabled('outbrowser', !st); | ||
| 249 | |||
| 250 | if (f.over_list) | ||
| 251 | f.over_list.disabled = !st; | ||
| 252 | |||
| 253 | if (f.out_list) | ||
| 254 | f.out_list.disabled = !st; | ||
| 255 | |||
| 256 | f.onmouseoversrc.disabled = !st; | ||
| 257 | f.onmouseoutsrc.disabled = !st; | ||
| 258 | }, | ||
| 259 | |||
| 260 | fillClassList : function(id) { | ||
| 261 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 262 | |||
| 263 | if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { | ||
| 264 | cl = []; | ||
| 265 | |||
| 266 | tinymce.each(v.split(';'), function(v) { | ||
| 267 | var p = v.split('='); | ||
| 268 | |||
| 269 | cl.push({'title' : p[0], 'class' : p[1]}); | ||
| 270 | }); | ||
| 271 | } else | ||
| 272 | cl = tinyMCEPopup.editor.dom.getClasses(); | ||
| 273 | |||
| 274 | if (cl.length > 0) { | ||
| 275 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); | ||
| 276 | |||
| 277 | tinymce.each(cl, function(o) { | ||
| 278 | lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); | ||
| 279 | }); | ||
| 280 | } else | ||
| 281 | dom.remove(dom.getParent(id, 'tr')); | ||
| 282 | }, | ||
| 283 | |||
| 284 | fillFileList : function(id, l) { | ||
| 285 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 286 | |||
| 287 | l = window[l]; | ||
| 288 | |||
| 289 | if (l && l.length > 0) { | ||
| 290 | lst.options[lst.options.length] = new Option('', ''); | ||
| 291 | |||
| 292 | tinymce.each(l, function(o) { | ||
| 293 | lst.options[lst.options.length] = new Option(o[0], o[1]); | ||
| 294 | }); | ||
| 295 | } else | ||
| 296 | dom.remove(dom.getParent(id, 'tr')); | ||
| 297 | }, | ||
| 298 | |||
| 299 | resetImageData : function() { | ||
| 300 | var f = document.forms[0]; | ||
| 301 | |||
| 302 | f.elements.width.value = f.elements.height.value = ''; | ||
| 303 | }, | ||
| 304 | |||
| 305 | updateImageData : function(img, st) { | ||
| 306 | var f = document.forms[0]; | ||
| 307 | |||
| 308 | if (!st) { | ||
| 309 | f.elements.width.value = img.width; | ||
| 310 | f.elements.height.value = img.height; | ||
| 311 | } | ||
| 312 | |||
| 313 | this.preloadImg = img; | ||
| 314 | }, | ||
| 315 | |||
| 316 | changeAppearance : function() { | ||
| 317 | var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); | ||
| 318 | |||
| 319 | if (img) { | ||
| 320 | if (ed.getParam('inline_styles')) { | ||
| 321 | ed.dom.setAttrib(img, 'style', f.style.value); | ||
| 322 | } else { | ||
| 323 | img.align = f.align.value; | ||
| 324 | img.border = f.border.value; | ||
| 325 | img.hspace = f.hspace.value; | ||
| 326 | img.vspace = f.vspace.value; | ||
| 327 | } | ||
| 328 | } | ||
| 329 | }, | ||
| 330 | |||
| 331 | changeHeight : function() { | ||
| 332 | var f = document.forms[0], tp, t = this; | ||
| 333 | |||
| 334 | if (!f.constrain.checked || !t.preloadImg) { | ||
| 335 | return; | ||
| 336 | } | ||
| 337 | |||
| 338 | if (f.width.value == "" || f.height.value == "") | ||
| 339 | return; | ||
| 340 | |||
| 341 | tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; | ||
| 342 | f.height.value = tp.toFixed(0); | ||
| 343 | }, | ||
| 344 | |||
| 345 | changeWidth : function() { | ||
| 346 | var f = document.forms[0], tp, t = this; | ||
| 347 | |||
| 348 | if (!f.constrain.checked || !t.preloadImg) { | ||
| 349 | return; | ||
| 350 | } | ||
| 351 | |||
| 352 | if (f.width.value == "" || f.height.value == "") | ||
| 353 | return; | ||
| 354 | |||
| 355 | tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; | ||
| 356 | f.width.value = tp.toFixed(0); | ||
| 357 | }, | ||
| 358 | |||
| 359 | updateStyle : function(ty) { | ||
| 360 | var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); | ||
| 361 | |||
| 362 | if (tinyMCEPopup.editor.settings.inline_styles) { | ||
| 363 | // Handle align | ||
| 364 | if (ty == 'align') { | ||
| 365 | dom.setStyle(img, 'float', ''); | ||
| 366 | dom.setStyle(img, 'vertical-align', ''); | ||
| 367 | |||
| 368 | v = getSelectValue(f, 'align'); | ||
| 369 | if (v) { | ||
| 370 | if (v == 'left' || v == 'right') | ||
| 371 | dom.setStyle(img, 'float', v); | ||
| 372 | else | ||
| 373 | img.style.verticalAlign = v; | ||
| 374 | } | ||
| 375 | } | ||
| 376 | |||
| 377 | // Handle border | ||
| 378 | if (ty == 'border') { | ||
| 379 | dom.setStyle(img, 'border', ''); | ||
| 380 | |||
| 381 | v = f.border.value; | ||
| 382 | if (v || v == '0') { | ||
| 383 | if (v == '0') | ||
| 384 | img.style.border = '0'; | ||
| 385 | else | ||
| 386 | img.style.border = v + 'px solid black'; | ||
| 387 | } | ||
| 388 | } | ||
| 389 | |||
| 390 | // Handle hspace | ||
| 391 | if (ty == 'hspace') { | ||
| 392 | dom.setStyle(img, 'marginLeft', ''); | ||
| 393 | dom.setStyle(img, 'marginRight', ''); | ||
| 394 | |||
| 395 | v = f.hspace.value; | ||
| 396 | if (v) { | ||
| 397 | img.style.marginLeft = v + 'px'; | ||
| 398 | img.style.marginRight = v + 'px'; | ||
| 399 | } | ||
| 400 | } | ||
| 401 | |||
| 402 | // Handle vspace | ||
| 403 | if (ty == 'vspace') { | ||
| 404 | dom.setStyle(img, 'marginTop', ''); | ||
| 405 | dom.setStyle(img, 'marginBottom', ''); | ||
| 406 | |||
| 407 | v = f.vspace.value; | ||
| 408 | if (v) { | ||
| 409 | img.style.marginTop = v + 'px'; | ||
| 410 | img.style.marginBottom = v + 'px'; | ||
| 411 | } | ||
| 412 | } | ||
| 413 | |||
| 414 | // Merge | ||
| 415 | dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText)); | ||
| 416 | } | ||
| 417 | }, | ||
| 418 | |||
| 419 | changeMouseMove : function() { | ||
| 420 | }, | ||
| 421 | |||
| 422 | showPreviewImage : function(u, st) { | ||
| 423 | if (!u) { | ||
| 424 | tinyMCEPopup.dom.setHTML('prev', ''); | ||
| 425 | return; | ||
| 426 | } | ||
| 427 | |||
| 428 | if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) | ||
| 429 | this.resetImageData(); | ||
| 430 | |||
| 431 | u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); | ||
| 432 | |||
| 433 | if (!st) | ||
| 434 | tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />'); | ||
| 435 | else | ||
| 436 | tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />'); | ||
| 437 | } | ||
| 438 | }; | ||
| 439 | |||
| 440 | ImageDialog.preInit(); | ||
| 441 | tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js new file mode 100755 index 0000000..f493d19 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | tinyMCE.addI18n('en.advimage_dlg',{ | ||
| 2 | tab_general:"General", | ||
| 3 | tab_appearance:"Appearance", | ||
| 4 | tab_advanced:"Advanced", | ||
| 5 | general:"General", | ||
| 6 | title:"Title", | ||
| 7 | preview:"Preview", | ||
| 8 | constrain_proportions:"Constrain proportions", | ||
| 9 | langdir:"Language direction", | ||
| 10 | langcode:"Language code", | ||
| 11 | long_desc:"Long description link", | ||
| 12 | style:"Style", | ||
| 13 | classes:"Classes", | ||
| 14 | ltr:"Left to right", | ||
| 15 | rtl:"Right to left", | ||
| 16 | id:"Id", | ||
| 17 | map:"Image map", | ||
| 18 | swap_image:"Swap image", | ||
| 19 | alt_image:"Alternative image", | ||
| 20 | mouseover:"for mouse over", | ||
| 21 | mouseout:"for mouse out", | ||
| 22 | misc:"Miscellaneous", | ||
| 23 | example_img:"Appearance preview image", | ||
| 24 | missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.", | ||
| 25 | dialog_title:"Insert/edit image", | ||
| 26 | src:"Image URL", | ||
| 27 | alt:"Image description", | ||
| 28 | list:"Image list", | ||
| 29 | border:"Border", | ||
| 30 | dimensions:"Dimensions", | ||
| 31 | vspace:"Vertical space", | ||
| 32 | hspace:"Horizontal space", | ||
| 33 | align:"Alignment", | ||
| 34 | align_baseline:"Baseline", | ||
| 35 | align_top:"Top", | ||
| 36 | align_middle:"Middle", | ||
| 37 | align_bottom:"Bottom", | ||
| 38 | align_texttop:"Text top", | ||
| 39 | align_textbottom:"Text bottom", | ||
| 40 | align_left:"Left", | ||
| 41 | align_right:"Right", | ||
| 42 | image_list:"Image list" | ||
| 43 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css b/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css new file mode 100755 index 0000000..1436431 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | .mceLinkList, .mceAnchorList, #targetlist {width:280px;} | ||
| 2 | .mceActionPanel {margin-top:7px;} | ||
| 3 | .panel_wrapper div.current {height:320px;} | ||
| 4 | #classlist, #title, #href {width:280px;} | ||
| 5 | #popupurl, #popupname {width:200px;} | ||
| 6 | #popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} | ||
| 7 | #id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} | ||
| 8 | #events_panel input {width:200px;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js new file mode 100755 index 0000000..4899f7b --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.AdvancedLinkPlugin',{init:function(ed,url){this.editor=ed;ed.addCommand('mceAdvLink',function(){var se=ed.selection;if(se.isCollapsed()&&!ed.dom.getParent(se.getNode(),'A'))return;ed.windowManager.open({file:url+'/link.htm',width:480+parseInt(ed.getLang('advlink.delta_width',0)),height:400+parseInt(ed.getLang('advlink.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('link',{title:'advlink.link_desc',cmd:'mceAdvLink'});ed.addShortcut('ctrl+k','advlink.advlink_desc','mceAdvLink');ed.onNodeChange.add(function(ed,cm,n,co){cm.setDisabled('link',co&&n.nodeName!='A');cm.setActive('link',n.nodeName=='A'&&!n.name);});},getInfo:function(){return{longname:'Advanced link',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advlink',tinymce.plugins.AdvancedLinkPlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js new file mode 100755 index 0000000..fc5325a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | this.editor = ed; | ||
| 12 | |||
| 13 | // Register commands | ||
| 14 | ed.addCommand('mceAdvLink', function() { | ||
| 15 | var se = ed.selection; | ||
| 16 | |||
| 17 | // No selection and not in link | ||
| 18 | if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) | ||
| 19 | return; | ||
| 20 | |||
| 21 | ed.windowManager.open({ | ||
| 22 | file : url + '/link.htm', | ||
| 23 | width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), | ||
| 24 | height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), | ||
| 25 | inline : 1 | ||
| 26 | }, { | ||
| 27 | plugin_url : url | ||
| 28 | }); | ||
| 29 | }); | ||
| 30 | |||
| 31 | // Register buttons | ||
| 32 | ed.addButton('link', { | ||
| 33 | title : 'advlink.link_desc', | ||
| 34 | cmd : 'mceAdvLink' | ||
| 35 | }); | ||
| 36 | |||
| 37 | ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); | ||
| 38 | |||
| 39 | ed.onNodeChange.add(function(ed, cm, n, co) { | ||
| 40 | cm.setDisabled('link', co && n.nodeName != 'A'); | ||
| 41 | cm.setActive('link', n.nodeName == 'A' && !n.name); | ||
| 42 | }); | ||
| 43 | }, | ||
| 44 | |||
| 45 | getInfo : function() { | ||
| 46 | return { | ||
| 47 | longname : 'Advanced link', | ||
| 48 | author : 'Moxiecode Systems AB', | ||
| 49 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 50 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', | ||
| 51 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 52 | }; | ||
| 53 | } | ||
| 54 | }); | ||
| 55 | |||
| 56 | // Register plugin | ||
| 57 | tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); | ||
| 58 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js b/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js new file mode 100755 index 0000000..a896250 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js | |||
| @@ -0,0 +1,527 @@ | |||
| 1 | /* Functions for the advlink plugin popup */ | ||
| 2 | |||
| 3 | tinyMCEPopup.requireLangPack(); | ||
| 4 | |||
| 5 | var templates = { | ||
| 6 | "window.open" : "window.open('${url}','${target}','${options}')" | ||
| 7 | }; | ||
| 8 | |||
| 9 | function preinit() { | ||
| 10 | var url; | ||
| 11 | |||
| 12 | if (url = tinyMCEPopup.getParam("external_link_list_url")) | ||
| 13 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 14 | } | ||
| 15 | |||
| 16 | function changeClass() { | ||
| 17 | var f = document.forms[0]; | ||
| 18 | |||
| 19 | f.classes.value = getSelectValue(f, 'classlist'); | ||
| 20 | } | ||
| 21 | |||
| 22 | function init() { | ||
| 23 | tinyMCEPopup.resizeToInnerSize(); | ||
| 24 | |||
| 25 | var formObj = document.forms[0]; | ||
| 26 | var inst = tinyMCEPopup.editor; | ||
| 27 | var elm = inst.selection.getNode(); | ||
| 28 | var action = "insert"; | ||
| 29 | var html; | ||
| 30 | |||
| 31 | document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); | ||
| 32 | document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); | ||
| 33 | document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href'); | ||
| 34 | document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href'); | ||
| 35 | document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); | ||
| 36 | |||
| 37 | // Link list | ||
| 38 | html = getLinkListHTML('linklisthref','href'); | ||
| 39 | if (html == "") | ||
| 40 | document.getElementById("linklisthrefrow").style.display = 'none'; | ||
| 41 | else | ||
| 42 | document.getElementById("linklisthrefcontainer").innerHTML = html; | ||
| 43 | |||
| 44 | // Resize some elements | ||
| 45 | if (isVisible('hrefbrowser')) | ||
| 46 | document.getElementById('href').style.width = '260px'; | ||
| 47 | |||
| 48 | if (isVisible('popupurlbrowser')) | ||
| 49 | document.getElementById('popupurl').style.width = '180px'; | ||
| 50 | |||
| 51 | elm = inst.dom.getParent(elm, "A"); | ||
| 52 | if (elm != null && elm.nodeName == "A") | ||
| 53 | action = "update"; | ||
| 54 | |||
| 55 | formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); | ||
| 56 | |||
| 57 | setPopupControlsDisabled(true); | ||
| 58 | |||
| 59 | if (action == "update") { | ||
| 60 | var href = inst.dom.getAttrib(elm, 'href'); | ||
| 61 | var onclick = inst.dom.getAttrib(elm, 'onclick'); | ||
| 62 | |||
| 63 | // Setup form data | ||
| 64 | setFormValue('href', href); | ||
| 65 | setFormValue('title', inst.dom.getAttrib(elm, 'title')); | ||
| 66 | setFormValue('id', inst.dom.getAttrib(elm, 'id')); | ||
| 67 | setFormValue('style', inst.dom.getAttrib(elm, "style")); | ||
| 68 | setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); | ||
| 69 | setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); | ||
| 70 | setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); | ||
| 71 | setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); | ||
| 72 | setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); | ||
| 73 | setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); | ||
| 74 | setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); | ||
| 75 | setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); | ||
| 76 | setFormValue('type', inst.dom.getAttrib(elm, 'type')); | ||
| 77 | setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); | ||
| 78 | setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); | ||
| 79 | setFormValue('onclick', onclick); | ||
| 80 | setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); | ||
| 81 | setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); | ||
| 82 | setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); | ||
| 83 | setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); | ||
| 84 | setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); | ||
| 85 | setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); | ||
| 86 | setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); | ||
| 87 | setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); | ||
| 88 | setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); | ||
| 89 | setFormValue('target', inst.dom.getAttrib(elm, 'target')); | ||
| 90 | setFormValue('classes', inst.dom.getAttrib(elm, 'class')); | ||
| 91 | |||
| 92 | // Parse onclick data | ||
| 93 | if (onclick != null && onclick.indexOf('window.open') != -1) | ||
| 94 | parseWindowOpen(onclick); | ||
| 95 | else | ||
| 96 | parseFunction(onclick); | ||
| 97 | |||
| 98 | // Select by the values | ||
| 99 | selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); | ||
| 100 | selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); | ||
| 101 | selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); | ||
| 102 | selectByValue(formObj, 'linklisthref', href); | ||
| 103 | |||
| 104 | if (href.charAt(0) == '#') | ||
| 105 | selectByValue(formObj, 'anchorlist', href); | ||
| 106 | |||
| 107 | addClassesToList('classlist', 'advlink_styles'); | ||
| 108 | |||
| 109 | selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); | ||
| 110 | selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); | ||
| 111 | } else | ||
| 112 | addClassesToList('classlist', 'advlink_styles'); | ||
| 113 | } | ||
| 114 | |||
| 115 | function checkPrefix(n) { | ||
| 116 | if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) | ||
| 117 | n.value = 'mailto:' + n.value; | ||
| 118 | |||
| 119 | if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) | ||
| 120 | n.value = 'http://' + n.value; | ||
| 121 | } | ||
| 122 | |||
| 123 | function setFormValue(name, value) { | ||
| 124 | document.forms[0].elements[name].value = value; | ||
| 125 | } | ||
| 126 | |||
| 127 | function parseWindowOpen(onclick) { | ||
| 128 | var formObj = document.forms[0]; | ||
| 129 | |||
| 130 | // Preprocess center code | ||
| 131 | if (onclick.indexOf('return false;') != -1) { | ||
| 132 | formObj.popupreturn.checked = true; | ||
| 133 | onclick = onclick.replace('return false;', ''); | ||
| 134 | } else | ||
| 135 | formObj.popupreturn.checked = false; | ||
| 136 | |||
| 137 | var onClickData = parseLink(onclick); | ||
| 138 | |||
| 139 | if (onClickData != null) { | ||
| 140 | formObj.ispopup.checked = true; | ||
| 141 | setPopupControlsDisabled(false); | ||
| 142 | |||
| 143 | var onClickWindowOptions = parseOptions(onClickData['options']); | ||
| 144 | var url = onClickData['url']; | ||
| 145 | |||
| 146 | formObj.popupname.value = onClickData['target']; | ||
| 147 | formObj.popupurl.value = url; | ||
| 148 | formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); | ||
| 149 | formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); | ||
| 150 | |||
| 151 | formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); | ||
| 152 | formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); | ||
| 153 | |||
| 154 | if (formObj.popupleft.value.indexOf('screen') != -1) | ||
| 155 | formObj.popupleft.value = "c"; | ||
| 156 | |||
| 157 | if (formObj.popuptop.value.indexOf('screen') != -1) | ||
| 158 | formObj.popuptop.value = "c"; | ||
| 159 | |||
| 160 | formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; | ||
| 161 | formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; | ||
| 162 | formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; | ||
| 163 | formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; | ||
| 164 | formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; | ||
| 165 | formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; | ||
| 166 | formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; | ||
| 167 | |||
| 168 | buildOnClick(); | ||
| 169 | } | ||
| 170 | } | ||
| 171 | |||
| 172 | function parseFunction(onclick) { | ||
| 173 | var formObj = document.forms[0]; | ||
| 174 | var onClickData = parseLink(onclick); | ||
| 175 | |||
| 176 | // TODO: Add stuff here | ||
| 177 | } | ||
| 178 | |||
| 179 | function getOption(opts, name) { | ||
| 180 | return typeof(opts[name]) == "undefined" ? "" : opts[name]; | ||
| 181 | } | ||
| 182 | |||
| 183 | function setPopupControlsDisabled(state) { | ||
| 184 | var formObj = document.forms[0]; | ||
| 185 | |||
| 186 | formObj.popupname.disabled = state; | ||
| 187 | formObj.popupurl.disabled = state; | ||
| 188 | formObj.popupwidth.disabled = state; | ||
| 189 | formObj.popupheight.disabled = state; | ||
| 190 | formObj.popupleft.disabled = state; | ||
| 191 | formObj.popuptop.disabled = state; | ||
| 192 | formObj.popuplocation.disabled = state; | ||
| 193 | formObj.popupscrollbars.disabled = state; | ||
| 194 | formObj.popupmenubar.disabled = state; | ||
| 195 | formObj.popupresizable.disabled = state; | ||
| 196 | formObj.popuptoolbar.disabled = state; | ||
| 197 | formObj.popupstatus.disabled = state; | ||
| 198 | formObj.popupreturn.disabled = state; | ||
| 199 | formObj.popupdependent.disabled = state; | ||
| 200 | |||
| 201 | setBrowserDisabled('popupurlbrowser', state); | ||
| 202 | } | ||
| 203 | |||
| 204 | function parseLink(link) { | ||
| 205 | link = link.replace(new RegExp(''', 'g'), "'"); | ||
| 206 | |||
| 207 | var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); | ||
| 208 | |||
| 209 | // Is function name a template function | ||
| 210 | var template = templates[fnName]; | ||
| 211 | if (template) { | ||
| 212 | // Build regexp | ||
| 213 | var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); | ||
| 214 | var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; | ||
| 215 | var replaceStr = ""; | ||
| 216 | for (var i=0; i<variableNames.length; i++) { | ||
| 217 | // Is string value | ||
| 218 | if (variableNames[i].indexOf("'${") != -1) | ||
| 219 | regExp += "'(.*)'"; | ||
| 220 | else // Number value | ||
| 221 | regExp += "([0-9]*)"; | ||
| 222 | |||
| 223 | replaceStr += "$" + (i+1); | ||
| 224 | |||
| 225 | // Cleanup variable name | ||
| 226 | variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), ""); | ||
| 227 | |||
| 228 | if (i != variableNames.length-1) { | ||
| 229 | regExp += "\\s*,\\s*"; | ||
| 230 | replaceStr += "<delim>"; | ||
| 231 | } else | ||
| 232 | regExp += ".*"; | ||
| 233 | } | ||
| 234 | |||
| 235 | regExp += "\\);?"; | ||
| 236 | |||
| 237 | // Build variable array | ||
| 238 | var variables = []; | ||
| 239 | variables["_function"] = fnName; | ||
| 240 | var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>'); | ||
| 241 | for (var i=0; i<variableNames.length; i++) | ||
| 242 | variables[variableNames[i]] = variableValues[i]; | ||
| 243 | |||
| 244 | return variables; | ||
| 245 | } | ||
| 246 | |||
| 247 | return null; | ||
| 248 | } | ||
| 249 | |||
| 250 | function parseOptions(opts) { | ||
| 251 | if (opts == null || opts == "") | ||
| 252 | return []; | ||
| 253 | |||
| 254 | // Cleanup the options | ||
| 255 | opts = opts.toLowerCase(); | ||
| 256 | opts = opts.replace(/;/g, ","); | ||
| 257 | opts = opts.replace(/[^0-9a-z=,]/g, ""); | ||
| 258 | |||
| 259 | var optionChunks = opts.split(','); | ||
| 260 | var options = []; | ||
| 261 | |||
| 262 | for (var i=0; i<optionChunks.length; i++) { | ||
| 263 | var parts = optionChunks[i].split('='); | ||
| 264 | |||
| 265 | if (parts.length == 2) | ||
| 266 | options[parts[0]] = parts[1]; | ||
| 267 | } | ||
| 268 | |||
| 269 | return options; | ||
| 270 | } | ||
| 271 | |||
| 272 | function buildOnClick() { | ||
| 273 | var formObj = document.forms[0]; | ||
| 274 | |||
| 275 | if (!formObj.ispopup.checked) { | ||
| 276 | formObj.onclick.value = ""; | ||
| 277 | return; | ||
| 278 | } | ||
| 279 | |||
| 280 | var onclick = "window.open('"; | ||
| 281 | var url = formObj.popupurl.value; | ||
| 282 | |||
| 283 | onclick += url + "','"; | ||
| 284 | onclick += formObj.popupname.value + "','"; | ||
| 285 | |||
| 286 | if (formObj.popuplocation.checked) | ||
| 287 | onclick += "location=yes,"; | ||
| 288 | |||
| 289 | if (formObj.popupscrollbars.checked) | ||
| 290 | onclick += "scrollbars=yes,"; | ||
| 291 | |||
| 292 | if (formObj.popupmenubar.checked) | ||
| 293 | onclick += "menubar=yes,"; | ||
| 294 | |||
| 295 | if (formObj.popupresizable.checked) | ||
| 296 | onclick += "resizable=yes,"; | ||
| 297 | |||
| 298 | if (formObj.popuptoolbar.checked) | ||
| 299 | onclick += "toolbar=yes,"; | ||
| 300 | |||
| 301 | if (formObj.popupstatus.checked) | ||
| 302 | onclick += "status=yes,"; | ||
| 303 | |||
| 304 | if (formObj.popupdependent.checked) | ||
| 305 | onclick += "dependent=yes,"; | ||
| 306 | |||
| 307 | if (formObj.popupwidth.value != "") | ||
| 308 | onclick += "width=" + formObj.popupwidth.value + ","; | ||
| 309 | |||
| 310 | if (formObj.popupheight.value != "") | ||
| 311 | onclick += "height=" + formObj.popupheight.value + ","; | ||
| 312 | |||
| 313 | if (formObj.popupleft.value != "") { | ||
| 314 | if (formObj.popupleft.value != "c") | ||
| 315 | onclick += "left=" + formObj.popupleft.value + ","; | ||
| 316 | else | ||
| 317 | onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',"; | ||
| 318 | } | ||
| 319 | |||
| 320 | if (formObj.popuptop.value != "") { | ||
| 321 | if (formObj.popuptop.value != "c") | ||
| 322 | onclick += "top=" + formObj.popuptop.value + ","; | ||
| 323 | else | ||
| 324 | onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',"; | ||
| 325 | } | ||
| 326 | |||
| 327 | if (onclick.charAt(onclick.length-1) == ',') | ||
| 328 | onclick = onclick.substring(0, onclick.length-1); | ||
| 329 | |||
| 330 | onclick += "');"; | ||
| 331 | |||
| 332 | if (formObj.popupreturn.checked) | ||
| 333 | onclick += "return false;"; | ||
| 334 | |||
| 335 | // tinyMCE.debug(onclick); | ||
| 336 | |||
| 337 | formObj.onclick.value = onclick; | ||
| 338 | |||
| 339 | if (formObj.href.value == "") | ||
| 340 | formObj.href.value = url; | ||
| 341 | } | ||
| 342 | |||
| 343 | function setAttrib(elm, attrib, value) { | ||
| 344 | var formObj = document.forms[0]; | ||
| 345 | var valueElm = formObj.elements[attrib.toLowerCase()]; | ||
| 346 | var dom = tinyMCEPopup.editor.dom; | ||
| 347 | |||
| 348 | if (typeof(value) == "undefined" || value == null) { | ||
| 349 | value = ""; | ||
| 350 | |||
| 351 | if (valueElm) | ||
| 352 | value = valueElm.value; | ||
| 353 | } | ||
| 354 | |||
| 355 | // Clean up the style | ||
| 356 | if (attrib == 'style') | ||
| 357 | value = dom.serializeStyle(dom.parseStyle(value)); | ||
| 358 | |||
| 359 | dom.setAttrib(elm, attrib, value); | ||
| 360 | } | ||
| 361 | |||
| 362 | function getAnchorListHTML(id, target) { | ||
| 363 | var inst = tinyMCEPopup.editor; | ||
| 364 | var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i; | ||
| 365 | var html = ""; | ||
| 366 | |||
| 367 | html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value='; | ||
| 368 | html += 'this.options[this.selectedIndex].value;">'; | ||
| 369 | html += '<option value="">---</option>'; | ||
| 370 | |||
| 371 | for (i=0; i<nodes.length; i++) { | ||
| 372 | if ((name = inst.dom.getAttrib(nodes[i], "name")) != "") | ||
| 373 | html += '<option value="#' + name + '">' + name + '</option>'; | ||
| 374 | } | ||
| 375 | |||
| 376 | html += '</select>'; | ||
| 377 | |||
| 378 | return html; | ||
| 379 | } | ||
| 380 | |||
| 381 | function insertAction() { | ||
| 382 | var inst = tinyMCEPopup.editor; | ||
| 383 | var elm, elementArray, i; | ||
| 384 | |||
| 385 | elm = inst.selection.getNode(); | ||
| 386 | checkPrefix(document.forms[0].href); | ||
| 387 | |||
| 388 | elm = inst.dom.getParent(elm, "A"); | ||
| 389 | |||
| 390 | // Remove element if there is no href | ||
| 391 | if (!document.forms[0].href.value) { | ||
| 392 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 393 | i = inst.selection.getBookmark(); | ||
| 394 | inst.dom.remove(elm, 1); | ||
| 395 | inst.selection.moveToBookmark(i); | ||
| 396 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 397 | tinyMCEPopup.close(); | ||
| 398 | return; | ||
| 399 | } | ||
| 400 | |||
| 401 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 402 | |||
| 403 | // Create new anchor elements | ||
| 404 | if (elm == null) { | ||
| 405 | tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); | ||
| 406 | |||
| 407 | elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); | ||
| 408 | for (i=0; i<elementArray.length; i++) | ||
| 409 | setAllAttribs(elm = elementArray[i]); | ||
| 410 | } else | ||
| 411 | setAllAttribs(elm); | ||
| 412 | |||
| 413 | // Don't move caret if selection was image | ||
| 414 | if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') { | ||
| 415 | inst.focus(); | ||
| 416 | inst.selection.select(elm); | ||
| 417 | inst.selection.collapse(0); | ||
| 418 | tinyMCEPopup.storeSelection(); | ||
| 419 | } | ||
| 420 | |||
| 421 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 422 | tinyMCEPopup.close(); | ||
| 423 | } | ||
| 424 | |||
| 425 | function setAllAttribs(elm) { | ||
| 426 | var formObj = document.forms[0]; | ||
| 427 | var href = formObj.href.value; | ||
| 428 | var target = getSelectValue(formObj, 'targetlist'); | ||
| 429 | |||
| 430 | setAttrib(elm, 'href', href); | ||
| 431 | setAttrib(elm, 'title'); | ||
| 432 | setAttrib(elm, 'target', target == '_self' ? '' : target); | ||
| 433 | setAttrib(elm, 'id'); | ||
| 434 | setAttrib(elm, 'style'); | ||
| 435 | setAttrib(elm, 'class', getSelectValue(formObj, 'classlist')); | ||
| 436 | setAttrib(elm, 'rel'); | ||
| 437 | setAttrib(elm, 'rev'); | ||
| 438 | setAttrib(elm, 'charset'); | ||
| 439 | setAttrib(elm, 'hreflang'); | ||
| 440 | setAttrib(elm, 'dir'); | ||
| 441 | setAttrib(elm, 'lang'); | ||
| 442 | setAttrib(elm, 'tabindex'); | ||
| 443 | setAttrib(elm, 'accesskey'); | ||
| 444 | setAttrib(elm, 'type'); | ||
| 445 | setAttrib(elm, 'onfocus'); | ||
| 446 | setAttrib(elm, 'onblur'); | ||
| 447 | setAttrib(elm, 'onclick'); | ||
| 448 | setAttrib(elm, 'ondblclick'); | ||
| 449 | setAttrib(elm, 'onmousedown'); | ||
| 450 | setAttrib(elm, 'onmouseup'); | ||
| 451 | setAttrib(elm, 'onmouseover'); | ||
| 452 | setAttrib(elm, 'onmousemove'); | ||
| 453 | setAttrib(elm, 'onmouseout'); | ||
| 454 | setAttrib(elm, 'onkeypress'); | ||
| 455 | setAttrib(elm, 'onkeydown'); | ||
| 456 | setAttrib(elm, 'onkeyup'); | ||
| 457 | |||
| 458 | // Refresh in old MSIE | ||
| 459 | if (tinyMCE.isMSIE5) | ||
| 460 | elm.outerHTML = elm.outerHTML; | ||
| 461 | } | ||
| 462 | |||
| 463 | function getSelectValue(form_obj, field_name) { | ||
| 464 | var elm = form_obj.elements[field_name]; | ||
| 465 | |||
| 466 | if (!elm || elm.options == null || elm.selectedIndex == -1) | ||
| 467 | return ""; | ||
| 468 | |||
| 469 | return elm.options[elm.selectedIndex].value; | ||
| 470 | } | ||
| 471 | |||
| 472 | function getLinkListHTML(elm_id, target_form_element, onchange_func) { | ||
| 473 | if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0) | ||
| 474 | return ""; | ||
| 475 | |||
| 476 | var html = ""; | ||
| 477 | |||
| 478 | html += '<select id="' + elm_id + '" name="' + elm_id + '"'; | ||
| 479 | html += ' class="mceLinkList" onfoc2us="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value='; | ||
| 480 | html += 'this.options[this.selectedIndex].value;'; | ||
| 481 | |||
| 482 | if (typeof(onchange_func) != "undefined") | ||
| 483 | html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);'; | ||
| 484 | |||
| 485 | html += '"><option value="">---</option>'; | ||
| 486 | |||
| 487 | for (var i=0; i<tinyMCELinkList.length; i++) | ||
| 488 | html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>'; | ||
| 489 | |||
| 490 | html += '</select>'; | ||
| 491 | |||
| 492 | return html; | ||
| 493 | |||
| 494 | // tinyMCE.debug('-- image list start --', html, '-- image list end --'); | ||
| 495 | } | ||
| 496 | |||
| 497 | function getTargetListHTML(elm_id, target_form_element) { | ||
| 498 | var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); | ||
| 499 | var html = ''; | ||
| 500 | |||
| 501 | html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value='; | ||
| 502 | html += 'this.options[this.selectedIndex].value;">'; | ||
| 503 | html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>'; | ||
| 504 | html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>'; | ||
| 505 | html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>'; | ||
| 506 | html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>'; | ||
| 507 | |||
| 508 | for (var i=0; i<targets.length; i++) { | ||
| 509 | var key, value; | ||
| 510 | |||
| 511 | if (targets[i] == "") | ||
| 512 | continue; | ||
| 513 | |||
| 514 | key = targets[i].split('=')[0]; | ||
| 515 | value = targets[i].split('=')[1]; | ||
| 516 | |||
| 517 | html += '<option value="' + key + '">' + value + ' (' + key + ')</option>'; | ||
| 518 | } | ||
| 519 | |||
| 520 | html += '</select>'; | ||
| 521 | |||
| 522 | return html; | ||
| 523 | } | ||
| 524 | |||
| 525 | // While loading | ||
| 526 | preinit(); | ||
| 527 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js new file mode 100755 index 0000000..c71ffbd --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | tinyMCE.addI18n('en.advlink_dlg',{ | ||
| 2 | title:"Insert/edit link", | ||
| 3 | url:"Link URL", | ||
| 4 | target:"Target", | ||
| 5 | titlefield:"Title", | ||
| 6 | is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", | ||
| 7 | is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", | ||
| 8 | list:"Link list", | ||
| 9 | general_tab:"General", | ||
| 10 | popup_tab:"Popup", | ||
| 11 | events_tab:"Events", | ||
| 12 | advanced_tab:"Advanced", | ||
| 13 | general_props:"General properties", | ||
| 14 | popup_props:"Popup properties", | ||
| 15 | event_props:"Events", | ||
| 16 | advanced_props:"Advanced properties", | ||
| 17 | popup_opts:"Options", | ||
| 18 | anchor_names:"Anchors", | ||
| 19 | target_same:"Open in this window / frame", | ||
| 20 | target_parent:"Open in parent window / frame", | ||
| 21 | target_top:"Open in top frame (replaces all frames)", | ||
| 22 | target_blank:"Open in new window", | ||
| 23 | popup:"Javascript popup", | ||
| 24 | popup_url:"Popup URL", | ||
| 25 | popup_name:"Window name", | ||
| 26 | popup_return:"Insert 'return false'", | ||
| 27 | popup_scrollbars:"Show scrollbars", | ||
| 28 | popup_statusbar:"Show status bar", | ||
| 29 | popup_toolbar:"Show toolbars", | ||
| 30 | popup_menubar:"Show menu bar", | ||
| 31 | popup_location:"Show location bar", | ||
| 32 | popup_resizable:"Make window resizable", | ||
| 33 | popup_dependent:"Dependent (Mozilla/Firefox only)", | ||
| 34 | popup_size:"Size", | ||
| 35 | popup_position:"Position (X/Y)", | ||
| 36 | id:"Id", | ||
| 37 | style:"Style", | ||
| 38 | classes:"Classes", | ||
| 39 | target_name:"Target name", | ||
| 40 | langdir:"Language direction", | ||
| 41 | target_langcode:"Target language", | ||
| 42 | langcode:"Language code", | ||
| 43 | encoding:"Target character encoding", | ||
| 44 | mime:"Target MIME type", | ||
| 45 | rel:"Relationship page to target", | ||
| 46 | rev:"Relationship target to page", | ||
| 47 | tabindex:"Tabindex", | ||
| 48 | accesskey:"Accesskey", | ||
| 49 | ltr:"Left to right", | ||
| 50 | rtl:"Right to left", | ||
| 51 | link_list:"Link list" | ||
| 52 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/link.htm b/public/javascripts/tiny_mce/plugins/advlink/link.htm new file mode 100755 index 0000000..f46e8f8 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/advlink/link.htm | |||
| @@ -0,0 +1,339 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#advlink_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 9 | <script type="text/javascript" src="js/advlink.js"></script> | ||
| 10 | <link href="css/advlink.css" rel="stylesheet" type="text/css" /> | ||
| 11 | <base target="_self" /> | ||
| 12 | </head> | ||
| 13 | <body id="advlink" style="display: none"> | ||
| 14 | <form onsubmit="insertAction();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li> | ||
| 18 | <li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li> | ||
| 19 | <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li> | ||
| 20 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li> | ||
| 21 | </ul> | ||
| 22 | </div> | ||
| 23 | |||
| 24 | <div class="panel_wrapper"> | ||
| 25 | <div id="general_panel" class="panel current"> | ||
| 26 | <fieldset> | ||
| 27 | <legend>{#advlink_dlg.general_props}</legend> | ||
| 28 | |||
| 29 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 30 | <tr> | ||
| 31 | <td nowrap="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td> | ||
| 32 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 33 | <tr> | ||
| 34 | <td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td> | ||
| 35 | <td id="hrefbrowsercontainer"> </td> | ||
| 36 | </tr> | ||
| 37 | </table></td> | ||
| 38 | </tr> | ||
| 39 | <tr id="linklisthrefrow"> | ||
| 40 | <td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td> | ||
| 41 | <td colspan="2" id="linklisthrefcontainer"> </td> | ||
| 42 | </tr> | ||
| 43 | <tr> | ||
| 44 | <td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td> | ||
| 45 | <td colspan="2" id="anchorlistcontainer"> </td> | ||
| 46 | </tr> | ||
| 47 | <tr> | ||
| 48 | <td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td> | ||
| 49 | <td id="targetlistcontainer"> </td> | ||
| 50 | </tr> | ||
| 51 | <tr> | ||
| 52 | <td nowrap="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td> | ||
| 53 | <td><input id="title" name="title" type="text" value="" /></td> | ||
| 54 | </tr> | ||
| 55 | <tr> | ||
| 56 | <td><label id="classlabel" for="classlist">{#class_name}</label></td> | ||
| 57 | <td> | ||
| 58 | <select id="classlist" name="classlist" onchange="changeClass();"> | ||
| 59 | <option value="" selected>{#not_set}</option> | ||
| 60 | </select> | ||
| 61 | </td> | ||
| 62 | </tr> | ||
| 63 | </table> | ||
| 64 | </fieldset> | ||
| 65 | </div> | ||
| 66 | |||
| 67 | <div id="popup_panel" class="panel"> | ||
| 68 | <fieldset> | ||
| 69 | <legend>{#advlink_dlg.popup_props}</legend> | ||
| 70 | |||
| 71 | <input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" /> | ||
| 72 | <label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label> | ||
| 73 | |||
| 74 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 75 | <tr> | ||
| 76 | <td nowrap="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label> </td> | ||
| 77 | <td> | ||
| 78 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 79 | <tr> | ||
| 80 | <td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td> | ||
| 81 | <td id="popupurlbrowsercontainer"> </td> | ||
| 82 | </tr> | ||
| 83 | </table> | ||
| 84 | </td> | ||
| 85 | </tr> | ||
| 86 | <tr> | ||
| 87 | <td nowrap="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label> </td> | ||
| 88 | <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td> | ||
| 89 | </tr> | ||
| 90 | <tr> | ||
| 91 | <td nowrap="nowrap"><label>{#advlink_dlg.popup_size}</label> </td> | ||
| 92 | <td nowrap="nowrap"> | ||
| 93 | <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x | ||
| 94 | <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px | ||
| 95 | </td> | ||
| 96 | </tr> | ||
| 97 | <tr> | ||
| 98 | <td nowrap="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label> </td> | ||
| 99 | <td nowrap="nowrap"> | ||
| 100 | <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> / | ||
| 101 | <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center) | ||
| 102 | </td> | ||
| 103 | </tr> | ||
| 104 | </table> | ||
| 105 | |||
| 106 | <fieldset> | ||
| 107 | <legend>{#advlink_dlg.popup_opts}</legend> | ||
| 108 | |||
| 109 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 110 | <tr> | ||
| 111 | <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 112 | <td nowrap="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td> | ||
| 113 | <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 114 | <td nowrap="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td> | ||
| 115 | </tr> | ||
| 116 | <tr> | ||
| 117 | <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 118 | <td nowrap="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td> | ||
| 119 | <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 120 | <td nowrap="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td> | ||
| 121 | </tr> | ||
| 122 | <tr> | ||
| 123 | <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 124 | <td nowrap="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td> | ||
| 125 | <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 126 | <td nowrap="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td> | ||
| 127 | </tr> | ||
| 128 | <tr> | ||
| 129 | <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 130 | <td nowrap="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td> | ||
| 131 | <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td> | ||
| 132 | <td nowrap="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td> | ||
| 133 | </tr> | ||
| 134 | </table> | ||
| 135 | </fieldset> | ||
| 136 | </fieldset> | ||
| 137 | </div> | ||
| 138 | |||
| 139 | <div id="advanced_panel" class="panel"> | ||
| 140 | <fieldset> | ||
| 141 | <legend>{#advlink_dlg.advanced_props}</legend> | ||
| 142 | |||
| 143 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 144 | <tr> | ||
| 145 | <td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td> | ||
| 146 | <td><input id="id" name="id" type="text" value="" /></td> | ||
| 147 | </tr> | ||
| 148 | |||
| 149 | <tr> | ||
| 150 | <td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td> | ||
| 151 | <td><input type="text" id="style" name="style" value="" /></td> | ||
| 152 | </tr> | ||
| 153 | |||
| 154 | <tr> | ||
| 155 | <td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td> | ||
| 156 | <td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> | ||
| 157 | </tr> | ||
| 158 | |||
| 159 | <tr> | ||
| 160 | <td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td> | ||
| 161 | <td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td> | ||
| 162 | </tr> | ||
| 163 | |||
| 164 | <tr> | ||
| 165 | <td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td> | ||
| 166 | <td> | ||
| 167 | <select id="dir" name="dir"> | ||
| 168 | <option value="">{#not_set}</option> | ||
| 169 | <option value="ltr">{#advlink_dlg.ltr}</option> | ||
| 170 | <option value="rtl">{#advlink_dlg.rtl}</option> | ||
| 171 | </select> | ||
| 172 | </td> | ||
| 173 | </tr> | ||
| 174 | |||
| 175 | <tr> | ||
| 176 | <td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td> | ||
| 177 | <td><input type="text" id="hreflang" name="hreflang" value="" /></td> | ||
| 178 | </tr> | ||
| 179 | |||
| 180 | <tr> | ||
| 181 | <td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td> | ||
| 182 | <td> | ||
| 183 | <input id="lang" name="lang" type="text" value="" /> | ||
| 184 | </td> | ||
| 185 | </tr> | ||
| 186 | |||
| 187 | <tr> | ||
| 188 | <td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td> | ||
| 189 | <td><input type="text" id="charset" name="charset" value="" /></td> | ||
| 190 | </tr> | ||
| 191 | |||
| 192 | <tr> | ||
| 193 | <td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td> | ||
| 194 | <td><input type="text" id="type" name="type" value="" /></td> | ||
| 195 | </tr> | ||
| 196 | |||
| 197 | <tr> | ||
| 198 | <td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td> | ||
| 199 | <td><select id="rel" name="rel"> | ||
| 200 | <option value="">{#not_set}</option> | ||
| 201 | <option value="lightbox">Lightbox</option> | ||
| 202 | <option value="alternate">Alternate</option> | ||
| 203 | <option value="designates">Designates</option> | ||
| 204 | <option value="stylesheet">Stylesheet</option> | ||
| 205 | <option value="start">Start</option> | ||
| 206 | <option value="next">Next</option> | ||
| 207 | <option value="prev">Prev</option> | ||
| 208 | <option value="contents">Contents</option> | ||
| 209 | <option value="index">Index</option> | ||
| 210 | <option value="glossary">Glossary</option> | ||
| 211 | <option value="copyright">Copyright</option> | ||
| 212 | <option value="chapter">Chapter</option> | ||
| 213 | <option value="subsection">Subsection</option> | ||
| 214 | <option value="appendix">Appendix</option> | ||
| 215 | <option value="help">Help</option> | ||
| 216 | <option value="bookmark">Bookmark</option> | ||
| 217 | <option value="nofollow">No Follow</option> | ||
| 218 | <option value="tag">Tag</option> | ||
| 219 | </select> | ||
| 220 | </td> | ||
| 221 | </tr> | ||
| 222 | |||
| 223 | <tr> | ||
| 224 | <td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td> | ||
| 225 | <td><select id="rev" name="rev"> | ||
| 226 | <option value="">{#not_set}</option> | ||
| 227 | <option value="alternate">Alternate</option> | ||
| 228 | <option value="designates">Designates</option> | ||
| 229 | <option value="stylesheet">Stylesheet</option> | ||
| 230 | <option value="start">Start</option> | ||
| 231 | <option value="next">Next</option> | ||
| 232 | <option value="prev">Prev</option> | ||
| 233 | <option value="contents">Contents</option> | ||
| 234 | <option value="index">Index</option> | ||
| 235 | <option value="glossary">Glossary</option> | ||
| 236 | <option value="copyright">Copyright</option> | ||
| 237 | <option value="chapter">Chapter</option> | ||
| 238 | <option value="subsection">Subsection</option> | ||
| 239 | <option value="appendix">Appendix</option> | ||
| 240 | <option value="help">Help</option> | ||
| 241 | <option value="bookmark">Bookmark</option> | ||
| 242 | </select> | ||
| 243 | </td> | ||
| 244 | </tr> | ||
| 245 | |||
| 246 | <tr> | ||
| 247 | <td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td> | ||
| 248 | <td><input type="text" id="tabindex" name="tabindex" value="" /></td> | ||
| 249 | </tr> | ||
| 250 | |||
| 251 | <tr> | ||
| 252 | <td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td> | ||
| 253 | <td><input type="text" id="accesskey" name="accesskey" value="" /></td> | ||
| 254 | </tr> | ||
| 255 | </table> | ||
| 256 | </fieldset> | ||
| 257 | </div> | ||
| 258 | |||
| 259 | <div id="events_panel" class="panel"> | ||
| 260 | <fieldset> | ||
| 261 | <legend>{#advlink_dlg.event_props}</legend> | ||
| 262 | |||
| 263 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 264 | <tr> | ||
| 265 | <td class="column1"><label for="onfocus">onfocus</label></td> | ||
| 266 | <td><input id="onfocus" name="onfocus" type="text" value="" /></td> | ||
| 267 | </tr> | ||
| 268 | |||
| 269 | <tr> | ||
| 270 | <td class="column1"><label for="onblur">onblur</label></td> | ||
| 271 | <td><input id="onblur" name="onblur" type="text" value="" /></td> | ||
| 272 | </tr> | ||
| 273 | |||
| 274 | <tr> | ||
| 275 | <td class="column1"><label for="onclick">onclick</label></td> | ||
| 276 | <td><input id="onclick" name="onclick" type="text" value="" /></td> | ||
| 277 | </tr> | ||
| 278 | |||
| 279 | <tr> | ||
| 280 | <td class="column1"><label for="ondblclick">ondblclick</label></td> | ||
| 281 | <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> | ||
| 282 | </tr> | ||
| 283 | |||
| 284 | <tr> | ||
| 285 | <td class="column1"><label for="onmousedown">onmousedown</label></td> | ||
| 286 | <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> | ||
| 287 | </tr> | ||
| 288 | |||
| 289 | <tr> | ||
| 290 | <td class="column1"><label for="onmouseup">onmouseup</label></td> | ||
| 291 | <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> | ||
| 292 | </tr> | ||
| 293 | |||
| 294 | <tr> | ||
| 295 | <td class="column1"><label for="onmouseover">onmouseover</label></td> | ||
| 296 | <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> | ||
| 297 | </tr> | ||
| 298 | |||
| 299 | <tr> | ||
| 300 | <td class="column1"><label for="onmousemove">onmousemove</label></td> | ||
| 301 | <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> | ||
| 302 | </tr> | ||
| 303 | |||
| 304 | <tr> | ||
| 305 | <td class="column1"><label for="onmouseout">onmouseout</label></td> | ||
| 306 | <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> | ||
| 307 | </tr> | ||
| 308 | |||
| 309 | <tr> | ||
| 310 | <td class="column1"><label for="onkeypress">onkeypress</label></td> | ||
| 311 | <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> | ||
| 312 | </tr> | ||
| 313 | |||
| 314 | <tr> | ||
| 315 | <td class="column1"><label for="onkeydown">onkeydown</label></td> | ||
| 316 | <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> | ||
| 317 | </tr> | ||
| 318 | |||
| 319 | <tr> | ||
| 320 | <td class="column1"><label for="onkeyup">onkeyup</label></td> | ||
| 321 | <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> | ||
| 322 | </tr> | ||
| 323 | </table> | ||
| 324 | </fieldset> | ||
| 325 | </div> | ||
| 326 | </div> | ||
| 327 | |||
| 328 | <div class="mceActionPanel"> | ||
| 329 | <div style="float: left"> | ||
| 330 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 331 | </div> | ||
| 332 | |||
| 333 | <div style="float: right"> | ||
| 334 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 335 | </div> | ||
| 336 | </div> | ||
| 337 | </form> | ||
| 338 | </body> | ||
| 339 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js new file mode 100755 index 0000000..01a994e --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.AutoSavePlugin',{init:function(ed,url){var t=this;t.editor=ed;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;},getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinymce.majorVersion+"."+tinymce.minorVersion};},'static':{_beforeUnloadHandler:function(){var msg;tinymce.each(tinyMCE.editors,function(ed){if(ed.getParam("fullscreen_is_enabled"))return;if(ed.isDirty()){msg=ed.getLang("autosave.unload_msg");return false;}});return msg;}}});tinymce.PluginManager.add('autosave',tinymce.plugins.AutoSavePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js new file mode 100755 index 0000000..3c4325a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.AutoSavePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | window.onbeforeunload = tinymce.plugins.AutoSavePlugin._beforeUnloadHandler; | ||
| 16 | }, | ||
| 17 | |||
| 18 | getInfo : function() { | ||
| 19 | return { | ||
| 20 | longname : 'Auto save', | ||
| 21 | author : 'Moxiecode Systems AB', | ||
| 22 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 23 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', | ||
| 24 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 25 | }; | ||
| 26 | }, | ||
| 27 | |||
| 28 | // Private plugin internal methods | ||
| 29 | |||
| 30 | 'static' : { | ||
| 31 | _beforeUnloadHandler : function() { | ||
| 32 | var msg; | ||
| 33 | |||
| 34 | tinymce.each(tinyMCE.editors, function(ed) { | ||
| 35 | if (ed.getParam("fullscreen_is_enabled")) | ||
| 36 | return; | ||
| 37 | |||
| 38 | if (ed.isDirty()) { | ||
| 39 | msg = ed.getLang("autosave.unload_msg"); | ||
| 40 | return false; | ||
| 41 | } | ||
| 42 | }); | ||
| 43 | |||
| 44 | return msg; | ||
| 45 | } | ||
| 46 | } | ||
| 47 | }); | ||
| 48 | |||
| 49 | // Register plugin | ||
| 50 | tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSavePlugin); | ||
| 51 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js new file mode 100755 index 0000000..88f7ea6 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.BBCodePlugin',{init:function(ed,url){var t=this,dialect=ed.getParam('bbcode_dialect','punbb').toLowerCase();ed.onBeforeSetContent.add(function(ed,o){o.content=t['_'+dialect+'_bbcode2html'](o.content);});ed.onPostProcess.add(function(ed,o){if(o.set)o.content=t['_'+dialect+'_bbcode2html'](o.content);if(o.get)o.content=t['_'+dialect+'_html2bbcode'](o.content);});},getInfo:function(){return{longname:'BBCode Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_punbb_html2bbcode:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str);};rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");rep(/<font>(.*?)<\/font>/gi,"$1");rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");rep(/<\/(strong|b)>/gi,"[/b]");rep(/<(strong|b)>/gi,"[b]");rep(/<\/(em|i)>/gi,"[/i]");rep(/<(em|i)>/gi,"[i]");rep(/<\/u>/gi,"[/u]");rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");rep(/<u>/gi,"[u]");rep(/<blockquote[^>]*>/gi,"[quote]");rep(/<\/blockquote>/gi,"[/quote]");rep(/<br \/>/gi,"\n");rep(/<br\/>/gi,"\n");rep(/<br>/gi,"\n");rep(/<p>/gi,"");rep(/<\/p>/gi,"\n");rep(/ /gi," ");rep(/"/gi,"\"");rep(/</gi,"<");rep(/>/gi,">");rep(/&/gi,"&");return s;},_punbb_bbcode2html:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str);};rep(/\n/gi,"<br />");rep(/\[b\]/gi,"<strong>");rep(/\[\/b\]/gi,"</strong>");rep(/\[i\]/gi,"<em>");rep(/\[\/i\]/gi,"</em>");rep(/\[u\]/gi,"<u>");rep(/\[\/u\]/gi,"</u>");rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> ");rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> ");return s;}});tinymce.PluginManager.add('bbcode',tinymce.plugins.BBCodePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js new file mode 100755 index 0000000..1d7493e --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js | |||
| @@ -0,0 +1,117 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.BBCodePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); | ||
| 12 | |||
| 13 | ed.onBeforeSetContent.add(function(ed, o) { | ||
| 14 | o.content = t['_' + dialect + '_bbcode2html'](o.content); | ||
| 15 | }); | ||
| 16 | |||
| 17 | ed.onPostProcess.add(function(ed, o) { | ||
| 18 | if (o.set) | ||
| 19 | o.content = t['_' + dialect + '_bbcode2html'](o.content); | ||
| 20 | |||
| 21 | if (o.get) | ||
| 22 | o.content = t['_' + dialect + '_html2bbcode'](o.content); | ||
| 23 | }); | ||
| 24 | }, | ||
| 25 | |||
| 26 | getInfo : function() { | ||
| 27 | return { | ||
| 28 | longname : 'BBCode Plugin', | ||
| 29 | author : 'Moxiecode Systems AB', | ||
| 30 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 31 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', | ||
| 32 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 33 | }; | ||
| 34 | }, | ||
| 35 | |||
| 36 | // Private methods | ||
| 37 | |||
| 38 | // HTML -> BBCode in PunBB dialect | ||
| 39 | _punbb_html2bbcode : function(s) { | ||
| 40 | s = tinymce.trim(s); | ||
| 41 | |||
| 42 | function rep(re, str) { | ||
| 43 | s = s.replace(re, str); | ||
| 44 | }; | ||
| 45 | |||
| 46 | // example: <strong> to [b] | ||
| 47 | rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"); | ||
| 48 | rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); | ||
| 49 | rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); | ||
| 50 | rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); | ||
| 51 | rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); | ||
| 52 | rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"); | ||
| 53 | rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"); | ||
| 54 | rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"); | ||
| 55 | rep(/<font>(.*?)<\/font>/gi,"$1"); | ||
| 56 | rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"); | ||
| 57 | rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"); | ||
| 58 | rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"); | ||
| 59 | rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); | ||
| 60 | rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); | ||
| 61 | rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); | ||
| 62 | rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); | ||
| 63 | rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); | ||
| 64 | rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); | ||
| 65 | rep(/<\/(strong|b)>/gi,"[/b]"); | ||
| 66 | rep(/<(strong|b)>/gi,"[b]"); | ||
| 67 | rep(/<\/(em|i)>/gi,"[/i]"); | ||
| 68 | rep(/<(em|i)>/gi,"[i]"); | ||
| 69 | rep(/<\/u>/gi,"[/u]"); | ||
| 70 | rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"); | ||
| 71 | rep(/<u>/gi,"[u]"); | ||
| 72 | rep(/<blockquote[^>]*>/gi,"[quote]"); | ||
| 73 | rep(/<\/blockquote>/gi,"[/quote]"); | ||
| 74 | rep(/<br \/>/gi,"\n"); | ||
| 75 | rep(/<br\/>/gi,"\n"); | ||
| 76 | rep(/<br>/gi,"\n"); | ||
| 77 | rep(/<p>/gi,""); | ||
| 78 | rep(/<\/p>/gi,"\n"); | ||
| 79 | rep(/ /gi," "); | ||
| 80 | rep(/"/gi,"\""); | ||
| 81 | rep(/</gi,"<"); | ||
| 82 | rep(/>/gi,">"); | ||
| 83 | rep(/&/gi,"&"); | ||
| 84 | |||
| 85 | return s; | ||
| 86 | }, | ||
| 87 | |||
| 88 | // BBCode -> HTML from PunBB dialect | ||
| 89 | _punbb_bbcode2html : function(s) { | ||
| 90 | s = tinymce.trim(s); | ||
| 91 | |||
| 92 | function rep(re, str) { | ||
| 93 | s = s.replace(re, str); | ||
| 94 | }; | ||
| 95 | |||
| 96 | // example: [b] to <strong> | ||
| 97 | rep(/\n/gi,"<br />"); | ||
| 98 | rep(/\[b\]/gi,"<strong>"); | ||
| 99 | rep(/\[\/b\]/gi,"</strong>"); | ||
| 100 | rep(/\[i\]/gi,"<em>"); | ||
| 101 | rep(/\[\/i\]/gi,"</em>"); | ||
| 102 | rep(/\[u\]/gi,"<u>"); | ||
| 103 | rep(/\[\/u\]/gi,"</u>"); | ||
| 104 | rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>"); | ||
| 105 | rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>"); | ||
| 106 | rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />"); | ||
| 107 | rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>"); | ||
| 108 | rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> "); | ||
| 109 | rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> "); | ||
| 110 | |||
| 111 | return s; | ||
| 112 | } | ||
| 113 | }); | ||
| 114 | |||
| 115 | // Register plugin | ||
| 116 | tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); | ||
| 117 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin.js b/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin.js new file mode 100755 index 0000000..02a1da8 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.Compat2x',{getInfo:function(){return{longname:'Compat2x',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};}});(function(){tinymce.extend(tinyMCE,{addToLang:function(p,l){each(l,function(v,k){tinyMCE.i18n[(tinyMCE.settings.language||'en')+'.'+(p?p+'_':'')+k]=v;});},getInstanceById:function(n){return this.get(n);}});})();(function(){var EditorManager=tinymce.EditorManager;tinyMCE.instances={};tinyMCE.plugins={};tinymce.PluginManager.onAdd.add(function(pm,n,p){tinyMCE.plugins[n]=p;});tinyMCE.majorVersion=tinymce.majorVersion;tinyMCE.minorVersion=tinymce.minorVersion;tinyMCE.releaseDate=tinymce.releaseDate;tinyMCE.baseURL=tinymce.baseURL;tinyMCE.isIE=tinyMCE.isMSIE=tinymce.isIE||tinymce.isOpera;tinyMCE.isMSIE5=tinymce.isIE;tinyMCE.isMSIE5_0=tinymce.isIE;tinyMCE.isMSIE7=tinymce.isIE;tinyMCE.isGecko=tinymce.isGecko;tinyMCE.isSafari=tinymce.isWebKit;tinyMCE.isOpera=tinymce.isOpera;tinyMCE.isMac=false;tinyMCE.isNS7=false;tinyMCE.isNS71=false;tinyMCE.compat=true;TinyMCE_Engine=tinyMCE;tinymce.extend(tinyMCE,{getParam:function(n,dv){return this.activeEditor.getParam(n,dv);},addEvent:function(e,na,f,sc){tinymce.dom.Event.add(e,na,f,sc||this);},getControlHTML:function(n){return EditorManager.activeEditor.controlManager.createControl(n);},loadCSS:function(u){tinymce.DOM.loadCSS(u);},importCSS:function(doc,u){if(doc==document)this.loadCSS(u);else new tinymce.dom.DOMUtils(doc).loadCSS(u);},log:function(){console.debug.apply(console,arguments);},getLang:function(n,dv){var v=EditorManager.activeEditor.getLang(n.replace(/^lang_/g,''),dv);if(/^[0-9\-.]+$/g.test(v))return parseInt(v);return v;},isInstance:function(o){return o!=null&&typeof(o)=="object"&&o.execCommand;},triggerNodeChange:function(){EditorManager.activeEditor.nodeChanged();},regexpReplace:function(in_str,reg_exp,replace_str,opts){var re;if(in_str==null)return in_str;if(typeof(opts)=="undefined")opts='g';re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str);},trim:function(s){return tinymce.trim(s);},xmlEncode:function(s){return tinymce.DOM.encode(s);},explode:function(s,d){var o=[];tinymce.each(s.split(d),function(v){if(v!='')o.push(v);});return o;},switchClass:function(id,cls){var b;if(/^mceButton/.test(cls)){b=EditorManager.activeEditor.controlManager.get(id);if(!b)return;switch(cls){case"mceButtonNormal":b.setDisabled(false);b.setActive(false);return;case"mceButtonDisabled":b.setDisabled(true);return;case"mceButtonSelected":b.setActive(true);b.setDisabled(false);return;}}},addCSSClass:function(e,n,b){return tinymce.DOM.addClass(e,n,b);},hasCSSClass:function(e,n){return tinymce.DOM.hasClass(e,n);},removeCSSClass:function(e,n){return tinymce.DOM.removeClass(e,n);},getCSSClasses:function(){var cl=EditorManager.activeEditor.dom.getClasses(),o=[];each(cl,function(c){o.push(c['class']);});return o;},setWindowArg:function(n,v){EditorManager.activeEditor.windowManager.params[n]=v;},getWindowArg:function(n,dv){var wm=EditorManager.activeEditor.windowManager,v;v=wm.getParam(n);if(v==='')return'';return v||wm.getFeature(n)||dv;},getParentNode:function(n,f){return this._getDOM().getParent(n,f);},selectElements:function(n,na,f){var i,a=[],nl,x;for(x=0,na=na.split(',');x<na.length;x++)for(i=0,nl=n.getElementsByTagName(na[x]);i<nl.length;i++)(!f||f(nl[i]))&&a.push(nl[i]);return a;},getNodeTree:function(n,na,t,nn){return this.selectNodes(n,function(n){return(!t||n.nodeType==t)&&(!nn||n.nodeName==nn);},na?na:[]);},getAttrib:function(e,n,dv){return this._getDOM().getAttrib(e,n,dv);},setAttrib:function(e,n,v){return this._getDOM().setAttrib(e,n,v);},getElementsByAttributeValue:function(n,e,a,v){var i,nl=n.getElementsByTagName(e),o=[];for(i=0;i<nl.length;i++){if(tinyMCE.getAttrib(nl[i],a).indexOf(v)!=-1)o[o.length]=nl[i];}return o;},selectNodes:function(n,f,a){var i;if(!a)a=[];if(f(n))a[a.length]=n;if(n.hasChildNodes()){for(i=0;i<n.childNodes.length;i++)tinyMCE.selectNodes(n.childNodes[i],f,a);}return a;},getContent:function(){return EditorManager.activeEditor.getContent();},getParentElement:function(n,na,f){if(na)na=new RegExp('^('+na.toUpperCase().replace(/,/g,'|')+')$','g');return this._getDOM().getParent(n,function(n){return n.nodeType==1&&(!na||na.test(n.nodeName))&&(!f||f(n));},this.activeEditor.getBody());},importPluginLanguagePack:function(n){tinymce.PluginManager.requireLangPack(n);},getButtonHTML:function(cn,lang,img,c,u,v){var ed=EditorManager.activeEditor;img=img.replace(/\{\$pluginurl\}/g,tinyMCE.pluginURL);img=img.replace(/\{\$themeurl\}/g,tinyMCE.themeURL);lang=lang.replace(/^lang_/g,'');return ed.controlManager.createButton(cn,{title:lang,command:c,ui:u,value:v,scope:this,'class':'compat',image:img});},addSelectAccessibility:function(e,s,w){if(!s._isAccessible){s.onkeydown=tinyMCE.accessibleEventHandler;s.onblur=tinyMCE.accessibleEventHandler;s._isAccessible=true;s._win=w;}return false;},accessibleEventHandler:function(e){var elm,win=this._win;e=tinymce.isIE?win.event:e;elm=tinymce.isIE?e.srcElement:e.target;if(e.type=="blur"){if(elm.oldonchange){elm.onchange=elm.oldonchange;elm.oldonchange=null;}return true;}if(elm.nodeName=="SELECT"&&!elm.oldonchange){elm.oldonchange=elm.onchange;elm.onchange=null;}if(e.keyCode==13||e.keyCode==32){elm.onchange=elm.oldonchange;elm.onchange();elm.oldonchange=null;tinyMCE.cancelEvent(e);return false;}return true;},cancelEvent:function(e){return tinymce.dom.Event.cancel(e);},handleVisualAid:function(e){EditorManager.activeEditor.addVisual(e);},getAbsPosition:function(n,r){return tinymce.DOM.getPos(n,r);},cleanupEventStr:function(s){s=""+s;s=s.replace('function anonymous()\n{\n','');s=s.replace('\n}','');s=s.replace(/^return true;/gi,'');return s;},getVisualAidClass:function(s){return s;},parseStyle:function(s){return this._getDOM().parseStyle(s);},serializeStyle:function(s){return this._getDOM().serializeStyle(s);},openWindow:function(tpl,args){var ed=EditorManager.activeEditor,o={},n;for(n in tpl)o[n]=tpl[n];tpl=o;args=args||{};tpl.url=new tinymce.util.URI(tinymce.ThemeManager.themeURLs[ed.settings.theme]).toAbsolute(tpl.file);tpl.inline=tpl.inline||args.inline;ed.windowManager.open(tpl,args);},closeWindow:function(win){EditorManager.activeEditor.windowManager.close(win);},getOuterHTML:function(e){return tinymce.DOM.getOuterHTML(e);},setOuterHTML:function(e,h,d){return tinymce.DOM.setOuterHTML(e,h,d);},hasPlugin:function(n){return tinymce.PluginManager.get(n)!=null;},_setEventsEnabled:function(){},addPlugin:function(pn,f){var t=this;function PluginWrapper(ed){tinyMCE.selectedInstance=ed;ed.onInit.add(function(){t.settings=ed.settings;t.settings['base_href']=tinyMCE.documentBasePath;tinyMCE.settings=t.settings;tinyMCE.documentBasePath=ed.documentBasePath;if(f.initInstance)f.initInstance(ed);ed.contentDocument=ed.getDoc();ed.contentWindow=ed.getWin();ed.undoRedo=ed.undoManager;ed.startContent=ed.getContent({format:'raw'});tinyMCE.instances[ed.id]=ed;tinyMCE.loadedFiles=[];});ed.onActivate.add(function(){tinyMCE.settings=ed.settings;tinyMCE.selectedInstance=ed;});if(f.handleNodeChange){ed.onNodeChange.add(function(ed,cm,n){f.handleNodeChange(ed.id,n,0,0,false,!ed.selection.isCollapsed());});}if(f.onChange){ed.onChange.add(function(ed,n){return f.onChange(ed);});}if(f.cleanup){ed.onGetContent.add(function(){});}this.getInfo=function(){return f.getInfo();};this.createControl=function(n){tinyMCE.pluginURL=tinymce.baseURL+'/plugins/'+pn;tinyMCE.themeURL=tinymce.baseURL+'/themes/'+tinyMCE.activeEditor.settings.theme;if(f.getControlHTML)return f.getControlHTML(n);return null;};this.execCommand=function(cmd,ui,val){if(f.execCommand)return f.execCommand(ed.id,ed.getBody(),cmd,ui,val);return false;};};tinymce.PluginManager.add(pn,PluginWrapper);},_getDOM:function(){return tinyMCE.activeEditor?tinyMCE.activeEditor.dom:tinymce.DOM;},convertRelativeToAbsoluteURL:function(b,u){return new tinymce.util.URI(b).toAbsolute(u);},convertAbsoluteURLToRelativeURL:function(b,u){return new tinymce.util.URI(b).toRelative(u);}});tinymce.extend(tinymce.Editor.prototype,{getFocusElement:function(){return this.selection.getNode();},getData:function(n){if(!this.data)this.data=[];if(!this.data[n])this.data[n]=[];return this.data[n];},hasPlugin:function(n){return this.plugins[n]!=null;},getContainerWin:function(){return window;},getHTML:function(raw){return this.getContent({format:raw?'raw':'html'});},setHTML:function(h){this.setContent(h);},getSel:function(){return this.selection.getSel();},getRng:function(){return this.selection.getRng();},isHidden:function(){var s;if(!tinymce.isGecko)return false;s=this.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},translate:function(s){var c=this.settings.language,o;if(!s)return s;o=tinymce.EditorManager.i18n[c+'.'+s]||s.replace(/{\#([^}]+)\}/g,function(a,b){return tinymce.EditorManager.i18n[c+'.'+b]||'{#'+b+'}';});o=o.replace(/{\$lang_([^}]+)\}/g,function(a,b){return tinymce.EditorManager.i18n[c+'.'+b]||'{$lang_'+b+'}';});return o;},repaint:function(){this.execCommand('mceRepaint');}});tinymce.extend(tinymce.dom.Selection.prototype,{getSelectedText:function(){return this.getContent({format:'text'});},getSelectedHTML:function(){return this.getContent({format:'html'});},getFocusElement:function(){return this.getNode();},selectNode:function(node,collapse,select_text_node,to_start){var t=this;t.select(node,select_text_node||0);if(!is(collapse))collapse=true;if(collapse){if(!is(to_start))to_start=true;t.collapse(to_start);}}});}).call(this);tinymce.PluginManager.add('compat2x',tinymce.plugins.Compat2x);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js new file mode 100755 index 0000000..60d4f2d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/compat2x/editor_plugin_src.js | |||
| @@ -0,0 +1,616 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.Compat2x', { | ||
| 12 | getInfo : function() { | ||
| 13 | return { | ||
| 14 | longname : 'Compat2x', | ||
| 15 | author : 'Moxiecode Systems AB', | ||
| 16 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 17 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x', | ||
| 18 | version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion | ||
| 19 | }; | ||
| 20 | } | ||
| 21 | }); | ||
| 22 | |||
| 23 | (function() { | ||
| 24 | // Extend tinyMCE/EditorManager | ||
| 25 | tinymce.extend(tinyMCE, { | ||
| 26 | addToLang : function(p, l) { | ||
| 27 | each(l, function(v, k) { | ||
| 28 | tinyMCE.i18n[(tinyMCE.settings.language || 'en') + '.' + (p ? p + '_' : '') + k] = v; | ||
| 29 | }); | ||
| 30 | }, | ||
| 31 | |||
| 32 | getInstanceById : function(n) { | ||
| 33 | return this.get(n); | ||
| 34 | } | ||
| 35 | }); | ||
| 36 | })(); | ||
| 37 | |||
| 38 | (function() { | ||
| 39 | var EditorManager = tinymce.EditorManager; | ||
| 40 | |||
| 41 | tinyMCE.instances = {}; | ||
| 42 | tinyMCE.plugins = {}; | ||
| 43 | tinymce.PluginManager.onAdd.add(function(pm, n, p) { | ||
| 44 | tinyMCE.plugins[n] = p; | ||
| 45 | }); | ||
| 46 | |||
| 47 | tinyMCE.majorVersion = tinymce.majorVersion; | ||
| 48 | tinyMCE.minorVersion = tinymce.minorVersion; | ||
| 49 | tinyMCE.releaseDate = tinymce.releaseDate; | ||
| 50 | tinyMCE.baseURL = tinymce.baseURL; | ||
| 51 | tinyMCE.isIE = tinyMCE.isMSIE = tinymce.isIE || tinymce.isOpera; | ||
| 52 | tinyMCE.isMSIE5 = tinymce.isIE; | ||
| 53 | tinyMCE.isMSIE5_0 = tinymce.isIE; | ||
| 54 | tinyMCE.isMSIE7 = tinymce.isIE; | ||
| 55 | tinyMCE.isGecko = tinymce.isGecko; | ||
| 56 | tinyMCE.isSafari = tinymce.isWebKit; | ||
| 57 | tinyMCE.isOpera = tinymce.isOpera; | ||
| 58 | tinyMCE.isMac = false; | ||
| 59 | tinyMCE.isNS7 = false; | ||
| 60 | tinyMCE.isNS71 = false; | ||
| 61 | tinyMCE.compat = true; | ||
| 62 | |||
| 63 | // Extend tinyMCE class | ||
| 64 | TinyMCE_Engine = tinyMCE; | ||
| 65 | tinymce.extend(tinyMCE, { | ||
| 66 | getParam : function(n, dv) { | ||
| 67 | return this.activeEditor.getParam(n, dv); | ||
| 68 | }, | ||
| 69 | |||
| 70 | addEvent : function(e, na, f, sc) { | ||
| 71 | tinymce.dom.Event.add(e, na, f, sc || this); | ||
| 72 | }, | ||
| 73 | |||
| 74 | getControlHTML : function(n) { | ||
| 75 | return EditorManager.activeEditor.controlManager.createControl(n); | ||
| 76 | }, | ||
| 77 | |||
| 78 | loadCSS : function(u) { | ||
| 79 | tinymce.DOM.loadCSS(u); | ||
| 80 | }, | ||
| 81 | |||
| 82 | importCSS : function(doc, u) { | ||
| 83 | if (doc == document) | ||
| 84 | this.loadCSS(u); | ||
| 85 | else | ||
| 86 | new tinymce.dom.DOMUtils(doc).loadCSS(u); | ||
| 87 | }, | ||
| 88 | |||
| 89 | log : function() { | ||
| 90 | console.debug.apply(console, arguments); | ||
| 91 | }, | ||
| 92 | |||
| 93 | getLang : function(n, dv) { | ||
| 94 | var v = EditorManager.activeEditor.getLang(n.replace(/^lang_/g, ''), dv); | ||
| 95 | |||
| 96 | // Is number | ||
| 97 | if (/^[0-9\-.]+$/g.test(v)) | ||
| 98 | return parseInt(v); | ||
| 99 | |||
| 100 | return v; | ||
| 101 | }, | ||
| 102 | |||
| 103 | isInstance : function(o) { | ||
| 104 | return o != null && typeof(o) == "object" && o.execCommand; | ||
| 105 | }, | ||
| 106 | |||
| 107 | triggerNodeChange : function() { | ||
| 108 | EditorManager.activeEditor.nodeChanged(); | ||
| 109 | }, | ||
| 110 | |||
| 111 | regexpReplace : function(in_str, reg_exp, replace_str, opts) { | ||
| 112 | var re; | ||
| 113 | |||
| 114 | if (in_str == null) | ||
| 115 | return in_str; | ||
| 116 | |||
| 117 | if (typeof(opts) == "undefined") | ||
| 118 | opts = 'g'; | ||
| 119 | |||
| 120 | re = new RegExp(reg_exp, opts); | ||
| 121 | |||
| 122 | return in_str.replace(re, replace_str); | ||
| 123 | }, | ||
| 124 | |||
| 125 | trim : function(s) { | ||
| 126 | return tinymce.trim(s); | ||
| 127 | }, | ||
| 128 | |||
| 129 | xmlEncode : function(s) { | ||
| 130 | return tinymce.DOM.encode(s); | ||
| 131 | }, | ||
| 132 | |||
| 133 | explode : function(s, d) { | ||
| 134 | var o = []; | ||
| 135 | |||
| 136 | tinymce.each(s.split(d), function(v) { | ||
| 137 | if (v != '') | ||
| 138 | o.push(v); | ||
| 139 | }); | ||
| 140 | |||
| 141 | return o; | ||
| 142 | }, | ||
| 143 | |||
| 144 | switchClass : function(id, cls) { | ||
| 145 | var b; | ||
| 146 | |||
| 147 | if (/^mceButton/.test(cls)) { | ||
| 148 | b = EditorManager.activeEditor.controlManager.get(id); | ||
| 149 | |||
| 150 | if (!b) | ||
| 151 | return; | ||
| 152 | |||
| 153 | switch (cls) { | ||
| 154 | case "mceButtonNormal": | ||
| 155 | b.setDisabled(false); | ||
| 156 | b.setActive(false); | ||
| 157 | return; | ||
| 158 | |||
| 159 | case "mceButtonDisabled": | ||
| 160 | b.setDisabled(true); | ||
| 161 | return; | ||
| 162 | |||
| 163 | case "mceButtonSelected": | ||
| 164 | b.setActive(true); | ||
| 165 | b.setDisabled(false); | ||
| 166 | return; | ||
| 167 | } | ||
| 168 | } | ||
| 169 | }, | ||
| 170 | |||
| 171 | addCSSClass : function(e, n, b) { | ||
| 172 | return tinymce.DOM.addClass(e, n, b); | ||
| 173 | }, | ||
| 174 | |||
| 175 | hasCSSClass : function(e, n) { | ||
| 176 | return tinymce.DOM.hasClass(e, n); | ||
| 177 | }, | ||
| 178 | |||
| 179 | removeCSSClass : function(e, n) { | ||
| 180 | return tinymce.DOM.removeClass(e, n); | ||
| 181 | }, | ||
| 182 | |||
| 183 | getCSSClasses : function() { | ||
| 184 | var cl = EditorManager.activeEditor.dom.getClasses(), o = []; | ||
| 185 | |||
| 186 | each(cl, function(c) { | ||
| 187 | o.push(c['class']); | ||
| 188 | }); | ||
| 189 | |||
| 190 | return o; | ||
| 191 | }, | ||
| 192 | |||
| 193 | setWindowArg : function(n, v) { | ||
| 194 | EditorManager.activeEditor.windowManager.params[n] = v; | ||
| 195 | }, | ||
| 196 | |||
| 197 | getWindowArg : function(n, dv) { | ||
| 198 | var wm = EditorManager.activeEditor.windowManager, v; | ||
| 199 | |||
| 200 | v = wm.getParam(n); | ||
| 201 | if (v === '') | ||
| 202 | return ''; | ||
| 203 | |||
| 204 | return v || wm.getFeature(n) || dv; | ||
| 205 | }, | ||
| 206 | |||
| 207 | getParentNode : function(n, f) { | ||
| 208 | return this._getDOM().getParent(n, f); | ||
| 209 | }, | ||
| 210 | |||
| 211 | selectElements : function(n, na, f) { | ||
| 212 | var i, a = [], nl, x; | ||
| 213 | |||
| 214 | for (x=0, na = na.split(','); x<na.length; x++) | ||
| 215 | for (i=0, nl = n.getElementsByTagName(na[x]); i<nl.length; i++) | ||
| 216 | (!f || f(nl[i])) && a.push(nl[i]); | ||
| 217 | |||
| 218 | return a; | ||
| 219 | }, | ||
| 220 | |||
| 221 | getNodeTree : function(n, na, t, nn) { | ||
| 222 | return this.selectNodes(n, function(n) { | ||
| 223 | return (!t || n.nodeType == t) && (!nn || n.nodeName == nn); | ||
| 224 | }, na ? na : []); | ||
| 225 | }, | ||
| 226 | |||
| 227 | getAttrib : function(e, n, dv) { | ||
| 228 | return this._getDOM().getAttrib(e, n, dv); | ||
| 229 | }, | ||
| 230 | |||
| 231 | setAttrib : function(e, n, v) { | ||
| 232 | return this._getDOM().setAttrib(e, n, v); | ||
| 233 | }, | ||
| 234 | |||
| 235 | getElementsByAttributeValue : function(n, e, a, v) { | ||
| 236 | var i, nl = n.getElementsByTagName(e), o = []; | ||
| 237 | |||
| 238 | for (i=0; i<nl.length; i++) { | ||
| 239 | if (tinyMCE.getAttrib(nl[i], a).indexOf(v) != -1) | ||
| 240 | o[o.length] = nl[i]; | ||
| 241 | } | ||
| 242 | |||
| 243 | return o; | ||
| 244 | }, | ||
| 245 | |||
| 246 | selectNodes : function(n, f, a) { | ||
| 247 | var i; | ||
| 248 | |||
| 249 | if (!a) | ||
| 250 | a = []; | ||
| 251 | |||
| 252 | if (f(n)) | ||
| 253 | a[a.length] = n; | ||
| 254 | |||
| 255 | if (n.hasChildNodes()) { | ||
| 256 | for (i=0; i<n.childNodes.length; i++) | ||
| 257 | tinyMCE.selectNodes(n.childNodes[i], f, a); | ||
| 258 | } | ||
| 259 | |||
| 260 | return a; | ||
| 261 | }, | ||
| 262 | |||
| 263 | getContent : function() { | ||
| 264 | return EditorManager.activeEditor.getContent(); | ||
| 265 | }, | ||
| 266 | |||
| 267 | getParentElement : function(n, na, f) { | ||
| 268 | if (na) | ||
| 269 | na = new RegExp('^(' + na.toUpperCase().replace(/,/g, '|') + ')$', 'g'); | ||
| 270 | |||
| 271 | return this._getDOM().getParent(n, function(n) { | ||
| 272 | return n.nodeType == 1 && (!na || na.test(n.nodeName)) && (!f || f(n)); | ||
| 273 | }, this.activeEditor.getBody()); | ||
| 274 | }, | ||
| 275 | |||
| 276 | importPluginLanguagePack : function(n) { | ||
| 277 | tinymce.PluginManager.requireLangPack(n); | ||
| 278 | }, | ||
| 279 | |||
| 280 | getButtonHTML : function(cn, lang, img, c, u, v) { | ||
| 281 | var ed = EditorManager.activeEditor; | ||
| 282 | |||
| 283 | img = img.replace(/\{\$pluginurl\}/g, tinyMCE.pluginURL); | ||
| 284 | img = img.replace(/\{\$themeurl\}/g, tinyMCE.themeURL); | ||
| 285 | lang = lang.replace(/^lang_/g, ''); | ||
| 286 | |||
| 287 | return ed.controlManager.createButton(cn, { | ||
| 288 | title : lang, | ||
| 289 | command : c, | ||
| 290 | ui : u, | ||
| 291 | value : v, | ||
| 292 | scope : this, | ||
| 293 | 'class' : 'compat', | ||
| 294 | image : img | ||
| 295 | }); | ||
| 296 | }, | ||
| 297 | |||
| 298 | addSelectAccessibility : function(e, s, w) { | ||
| 299 | // Add event handlers | ||
| 300 | if (!s._isAccessible) { | ||
| 301 | s.onkeydown = tinyMCE.accessibleEventHandler; | ||
| 302 | s.onblur = tinyMCE.accessibleEventHandler; | ||
| 303 | s._isAccessible = true; | ||
| 304 | s._win = w; | ||
| 305 | } | ||
| 306 | |||
| 307 | return false; | ||
| 308 | }, | ||
| 309 | |||
| 310 | accessibleEventHandler : function(e) { | ||
| 311 | var elm, win = this._win; | ||
| 312 | |||
| 313 | e = tinymce.isIE ? win.event : e; | ||
| 314 | elm = tinymce.isIE ? e.srcElement : e.target; | ||
| 315 | |||
| 316 | // Unpiggyback onchange on blur | ||
| 317 | if (e.type == "blur") { | ||
| 318 | if (elm.oldonchange) { | ||
| 319 | elm.onchange = elm.oldonchange; | ||
| 320 | elm.oldonchange = null; | ||
| 321 | } | ||
| 322 | |||
| 323 | return true; | ||
| 324 | } | ||
| 325 | |||
| 326 | // Piggyback onchange | ||
| 327 | if (elm.nodeName == "SELECT" && !elm.oldonchange) { | ||
| 328 | elm.oldonchange = elm.onchange; | ||
| 329 | elm.onchange = null; | ||
| 330 | } | ||
| 331 | |||
| 332 | // Execute onchange and remove piggyback | ||
| 333 | if (e.keyCode == 13 || e.keyCode == 32) { | ||
| 334 | elm.onchange = elm.oldonchange; | ||
| 335 | elm.onchange(); | ||
| 336 | elm.oldonchange = null; | ||
| 337 | |||
| 338 | tinyMCE.cancelEvent(e); | ||
| 339 | return false; | ||
| 340 | } | ||
| 341 | |||
| 342 | return true; | ||
| 343 | }, | ||
| 344 | |||
| 345 | cancelEvent : function(e) { | ||
| 346 | return tinymce.dom.Event.cancel(e); | ||
| 347 | }, | ||
| 348 | |||
| 349 | handleVisualAid : function(e) { | ||
| 350 | EditorManager.activeEditor.addVisual(e); | ||
| 351 | }, | ||
| 352 | |||
| 353 | getAbsPosition : function(n, r) { | ||
| 354 | return tinymce.DOM.getPos(n, r); | ||
| 355 | }, | ||
| 356 | |||
| 357 | cleanupEventStr : function(s) { | ||
| 358 | s = "" + s; | ||
| 359 | s = s.replace('function anonymous()\n{\n', ''); | ||
| 360 | s = s.replace('\n}', ''); | ||
| 361 | s = s.replace(/^return true;/gi, ''); // Remove event blocker | ||
| 362 | |||
| 363 | return s; | ||
| 364 | }, | ||
| 365 | |||
| 366 | getVisualAidClass : function(s) { | ||
| 367 | // TODO: Implement | ||
| 368 | return s; | ||
| 369 | }, | ||
| 370 | |||
| 371 | parseStyle : function(s) { | ||
| 372 | return this._getDOM().parseStyle(s); | ||
| 373 | }, | ||
| 374 | |||
| 375 | serializeStyle : function(s) { | ||
| 376 | return this._getDOM().serializeStyle(s); | ||
| 377 | }, | ||
| 378 | |||
| 379 | openWindow : function(tpl, args) { | ||
| 380 | var ed = EditorManager.activeEditor, o = {}, n; | ||
| 381 | |||
| 382 | // Convert name/value array to object | ||
| 383 | for (n in tpl) | ||
| 384 | o[n] = tpl[n]; | ||
| 385 | |||
| 386 | tpl = o; | ||
| 387 | |||
| 388 | args = args || {}; | ||
| 389 | tpl.url = new tinymce.util.URI(tinymce.ThemeManager.themeURLs[ed.settings.theme]).toAbsolute(tpl.file); | ||
| 390 | tpl.inline = tpl.inline || args.inline; | ||
| 391 | |||
| 392 | ed.windowManager.open(tpl, args); | ||
| 393 | }, | ||
| 394 | |||
| 395 | closeWindow : function(win) { | ||
| 396 | EditorManager.activeEditor.windowManager.close(win); | ||
| 397 | }, | ||
| 398 | |||
| 399 | getOuterHTML : function(e) { | ||
| 400 | return tinymce.DOM.getOuterHTML(e); | ||
| 401 | }, | ||
| 402 | |||
| 403 | setOuterHTML : function(e, h, d) { | ||
| 404 | return tinymce.DOM.setOuterHTML(e, h, d); | ||
| 405 | }, | ||
| 406 | |||
| 407 | hasPlugin : function(n) { | ||
| 408 | return tinymce.PluginManager.get(n) != null; | ||
| 409 | }, | ||
| 410 | |||
| 411 | _setEventsEnabled : function() { | ||
| 412 | // Ignore it!! | ||
| 413 | }, | ||
| 414 | |||
| 415 | addPlugin : function(pn, f) { | ||
| 416 | var t = this; | ||
| 417 | |||
| 418 | function PluginWrapper(ed) { | ||
| 419 | tinyMCE.selectedInstance = ed; | ||
| 420 | |||
| 421 | ed.onInit.add(function() { | ||
| 422 | t.settings = ed.settings; | ||
| 423 | t.settings['base_href'] = tinyMCE.documentBasePath; | ||
| 424 | tinyMCE.settings = t.settings; | ||
| 425 | tinyMCE.documentBasePath = ed.documentBasePath; | ||
| 426 | //ed.formElement = DOM.get(ed.id); | ||
| 427 | |||
| 428 | if (f.initInstance) | ||
| 429 | f.initInstance(ed); | ||
| 430 | |||
| 431 | ed.contentDocument = ed.getDoc(); | ||
| 432 | ed.contentWindow = ed.getWin(); | ||
| 433 | ed.undoRedo = ed.undoManager; | ||
| 434 | ed.startContent = ed.getContent({format : 'raw'}); | ||
| 435 | |||
| 436 | tinyMCE.instances[ed.id] = ed; | ||
| 437 | tinyMCE.loadedFiles = []; | ||
| 438 | }); | ||
| 439 | |||
| 440 | ed.onActivate.add(function() { | ||
| 441 | tinyMCE.settings = ed.settings; | ||
| 442 | tinyMCE.selectedInstance = ed; | ||
| 443 | }); | ||
| 444 | |||
| 445 | /* if (f.removeInstance) { | ||
| 446 | ed.onDestroy.add(function() { | ||
| 447 | return f.removeInstance(ed.id); | ||
| 448 | }); | ||
| 449 | }*/ | ||
| 450 | |||
| 451 | if (f.handleNodeChange) { | ||
| 452 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 453 | f.handleNodeChange(ed.id, n, 0, 0, false, !ed.selection.isCollapsed()); | ||
| 454 | }); | ||
| 455 | } | ||
| 456 | |||
| 457 | if (f.onChange) { | ||
| 458 | ed.onChange.add(function(ed, n) { | ||
| 459 | return f.onChange(ed); | ||
| 460 | }); | ||
| 461 | } | ||
| 462 | |||
| 463 | if (f.cleanup) { | ||
| 464 | ed.onGetContent.add(function() { | ||
| 465 | //f.cleanup(type, content, inst); | ||
| 466 | }); | ||
| 467 | } | ||
| 468 | |||
| 469 | this.getInfo = function() { | ||
| 470 | return f.getInfo(); | ||
| 471 | }; | ||
| 472 | |||
| 473 | this.createControl = function(n) { | ||
| 474 | tinyMCE.pluginURL = tinymce.baseURL + '/plugins/' + pn; | ||
| 475 | tinyMCE.themeURL = tinymce.baseURL + '/themes/' + tinyMCE.activeEditor.settings.theme; | ||
| 476 | |||
| 477 | if (f.getControlHTML) | ||
| 478 | return f.getControlHTML(n); | ||
| 479 | |||
| 480 | return null; | ||
| 481 | }; | ||
| 482 | |||
| 483 | this.execCommand = function(cmd, ui, val) { | ||
| 484 | if (f.execCommand) | ||
| 485 | return f.execCommand(ed.id, ed.getBody(), cmd, ui, val); | ||
| 486 | |||
| 487 | return false; | ||
| 488 | }; | ||
| 489 | }; | ||
| 490 | |||
| 491 | tinymce.PluginManager.add(pn, PluginWrapper); | ||
| 492 | }, | ||
| 493 | |||
| 494 | _getDOM : function() { | ||
| 495 | return tinyMCE.activeEditor ? tinyMCE.activeEditor.dom : tinymce.DOM; | ||
| 496 | }, | ||
| 497 | |||
| 498 | convertRelativeToAbsoluteURL : function(b, u) { | ||
| 499 | return new tinymce.util.URI(b).toAbsolute(u); | ||
| 500 | }, | ||
| 501 | |||
| 502 | convertAbsoluteURLToRelativeURL : function(b, u) { | ||
| 503 | return new tinymce.util.URI(b).toRelative(u); | ||
| 504 | } | ||
| 505 | }); | ||
| 506 | |||
| 507 | // Extend Editor class | ||
| 508 | tinymce.extend(tinymce.Editor.prototype, { | ||
| 509 | getFocusElement : function() { | ||
| 510 | return this.selection.getNode(); | ||
| 511 | }, | ||
| 512 | |||
| 513 | getData : function(n) { | ||
| 514 | if (!this.data) | ||
| 515 | this.data = []; | ||
| 516 | |||
| 517 | if (!this.data[n]) | ||
| 518 | this.data[n] = []; | ||
| 519 | |||
| 520 | return this.data[n]; | ||
| 521 | }, | ||
| 522 | |||
| 523 | hasPlugin : function(n) { | ||
| 524 | return this.plugins[n] != null; | ||
| 525 | }, | ||
| 526 | |||
| 527 | getContainerWin : function() { | ||
| 528 | return window; | ||
| 529 | }, | ||
| 530 | |||
| 531 | getHTML : function(raw) { | ||
| 532 | return this.getContent({ format : raw ? 'raw' : 'html'}); | ||
| 533 | }, | ||
| 534 | |||
| 535 | setHTML : function(h) { | ||
| 536 | this.setContent(h); | ||
| 537 | }, | ||
| 538 | |||
| 539 | getSel : function() { | ||
| 540 | return this.selection.getSel(); | ||
| 541 | }, | ||
| 542 | |||
| 543 | getRng : function() { | ||
| 544 | return this.selection.getRng(); | ||
| 545 | }, | ||
| 546 | |||
| 547 | isHidden : function() { | ||
| 548 | var s; | ||
| 549 | |||
| 550 | if (!tinymce.isGecko) | ||
| 551 | return false; | ||
| 552 | |||
| 553 | s = this.getSel(); | ||
| 554 | |||
| 555 | // Weird, wheres that cursor selection? | ||
| 556 | return (!s || !s.rangeCount || s.rangeCount == 0); | ||
| 557 | }, | ||
| 558 | |||
| 559 | translate : function(s) { | ||
| 560 | var c = this.settings.language, o; | ||
| 561 | |||
| 562 | if (!s) | ||
| 563 | return s; | ||
| 564 | |||
| 565 | o = tinymce.EditorManager.i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) { | ||
| 566 | return tinymce.EditorManager.i18n[c + '.' + b] || '{#' + b + '}'; | ||
| 567 | }); | ||
| 568 | |||
| 569 | o = o.replace(/{\$lang_([^}]+)\}/g, function(a, b) { | ||
| 570 | return tinymce.EditorManager.i18n[c + '.' + b] || '{$lang_' + b + '}'; | ||
| 571 | }); | ||
| 572 | |||
| 573 | return o; | ||
| 574 | }, | ||
| 575 | |||
| 576 | repaint : function() { | ||
| 577 | this.execCommand('mceRepaint'); | ||
| 578 | } | ||
| 579 | }); | ||
| 580 | |||
| 581 | // Extend selection | ||
| 582 | tinymce.extend(tinymce.dom.Selection.prototype, { | ||
| 583 | getSelectedText : function() { | ||
| 584 | return this.getContent({format : 'text'}); | ||
| 585 | }, | ||
| 586 | |||
| 587 | getSelectedHTML : function() { | ||
| 588 | return this.getContent({format : 'html'}); | ||
| 589 | }, | ||
| 590 | |||
| 591 | getFocusElement : function() { | ||
| 592 | return this.getNode(); | ||
| 593 | }, | ||
| 594 | |||
| 595 | selectNode : function(node, collapse, select_text_node, to_start) { | ||
| 596 | var t = this; | ||
| 597 | |||
| 598 | t.select(node, select_text_node || 0); | ||
| 599 | |||
| 600 | if (!is(collapse)) | ||
| 601 | collapse = true; | ||
| 602 | |||
| 603 | if (collapse) { | ||
| 604 | if (!is(to_start)) | ||
| 605 | to_start = true; | ||
| 606 | |||
| 607 | t.collapse(to_start); | ||
| 608 | } | ||
| 609 | } | ||
| 610 | }); | ||
| 611 | }).call(this); | ||
| 612 | |||
| 613 | // Register plugin | ||
| 614 | tinymce.PluginManager.add('compat2x', tinymce.plugins.Compat2x); | ||
| 615 | })(); | ||
| 616 | |||
diff --git a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js new file mode 100755 index 0000000..f68744d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var Event=tinymce.dom.Event,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.ContextMenu',{init:function(ed){var t=this;t.editor=ed;t.onContextMenu=new tinymce.util.Dispatcher(this);ed.onContextMenu.add(function(ed,e){if(!e.ctrlKey){t._getMenu(ed).showMenu(e.clientX,e.clientY);Event.add(ed.getDoc(),'click',hide);Event.cancel(e);}});function hide(){if(t._menu){t._menu.removeAll();t._menu.destroy();Event.remove(ed.getDoc(),'click',hide);}};ed.onMouseDown.add(hide);ed.onKeyDown.add(hide);},getInfo:function(){return{longname:'Contextmenu',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_getMenu:function(ed){var t=this,m=t._menu,se=ed.selection,col=se.isCollapsed(),el=se.getNode()||ed.getBody(),am,p1,p2;if(m){m.removeAll();m.destroy();}p1=DOM.getPos(ed.getContentAreaContainer());p2=DOM.getPos(ed.getContainer());m=ed.controlManager.createDropMenu('contextmenu',{offset_x:p1.x+ed.getParam('contextmenu_offset_x',0),offset_y:p1.y+ed.getParam('contextmenu_offset_y',0),constrain:1});t._menu=m;m.add({title:'advanced.cut_desc',icon:'cut',cmd:'Cut'}).setDisabled(col);m.add({title:'advanced.copy_desc',icon:'copy',cmd:'Copy'}).setDisabled(col);m.add({title:'advanced.paste_desc',icon:'paste',cmd:'Paste'});if((el.nodeName=='A'&&!ed.dom.getAttrib(el,'name'))||!col){m.addSeparator();m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});}m.addSeparator();m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();am=m.addMenu({title:'contextmenu.align'});am.add({title:'contextmenu.left',icon:'justifyleft',cmd:'JustifyLeft'});am.add({title:'contextmenu.center',icon:'justifycenter',cmd:'JustifyCenter'});am.add({title:'contextmenu.right',icon:'justifyright',cmd:'JustifyRight'});am.add({title:'contextmenu.full',icon:'justifyfull',cmd:'JustifyFull'});t.onContextMenu.dispatch(t,m,el,col);return m;}});tinymce.PluginManager.add('contextmenu',tinymce.plugins.ContextMenu);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js new file mode 100755 index 0000000..a2c1866 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 848 2008-05-15 11:54:40Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.ContextMenu', { | ||
| 12 | init : function(ed) { | ||
| 13 | var t = this; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | t.onContextMenu = new tinymce.util.Dispatcher(this); | ||
| 17 | |||
| 18 | ed.onContextMenu.add(function(ed, e) { | ||
| 19 | if (!e.ctrlKey) { | ||
| 20 | t._getMenu(ed).showMenu(e.clientX, e.clientY); | ||
| 21 | Event.add(ed.getDoc(), 'click', hide); | ||
| 22 | Event.cancel(e); | ||
| 23 | } | ||
| 24 | }); | ||
| 25 | |||
| 26 | function hide() { | ||
| 27 | if (t._menu) { | ||
| 28 | t._menu.removeAll(); | ||
| 29 | t._menu.destroy(); | ||
| 30 | Event.remove(ed.getDoc(), 'click', hide); | ||
| 31 | } | ||
| 32 | }; | ||
| 33 | |||
| 34 | ed.onMouseDown.add(hide); | ||
| 35 | ed.onKeyDown.add(hide); | ||
| 36 | }, | ||
| 37 | |||
| 38 | getInfo : function() { | ||
| 39 | return { | ||
| 40 | longname : 'Contextmenu', | ||
| 41 | author : 'Moxiecode Systems AB', | ||
| 42 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 43 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', | ||
| 44 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 45 | }; | ||
| 46 | }, | ||
| 47 | |||
| 48 | _getMenu : function(ed) { | ||
| 49 | var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; | ||
| 50 | |||
| 51 | if (m) { | ||
| 52 | m.removeAll(); | ||
| 53 | m.destroy(); | ||
| 54 | } | ||
| 55 | |||
| 56 | p1 = DOM.getPos(ed.getContentAreaContainer()); | ||
| 57 | p2 = DOM.getPos(ed.getContainer()); | ||
| 58 | |||
| 59 | m = ed.controlManager.createDropMenu('contextmenu', { | ||
| 60 | offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), | ||
| 61 | offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), | ||
| 62 | constrain : 1 | ||
| 63 | }); | ||
| 64 | |||
| 65 | t._menu = m; | ||
| 66 | |||
| 67 | m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); | ||
| 68 | m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); | ||
| 69 | m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); | ||
| 70 | |||
| 71 | if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { | ||
| 72 | m.addSeparator(); | ||
| 73 | m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); | ||
| 74 | m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); | ||
| 75 | } | ||
| 76 | |||
| 77 | m.addSeparator(); | ||
| 78 | m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); | ||
| 79 | |||
| 80 | m.addSeparator(); | ||
| 81 | am = m.addMenu({title : 'contextmenu.align'}); | ||
| 82 | am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); | ||
| 83 | am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); | ||
| 84 | am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); | ||
| 85 | am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); | ||
| 86 | |||
| 87 | t.onContextMenu.dispatch(t, m, el, col); | ||
| 88 | |||
| 89 | return m; | ||
| 90 | } | ||
| 91 | }); | ||
| 92 | |||
| 93 | // Register plugin | ||
| 94 | tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); | ||
| 95 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js new file mode 100755 index 0000000..6966d80 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.Directionality',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceDirectionLTR',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="ltr")ed.dom.setAttrib(e,"dir","ltr");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addCommand('mceDirectionRTL',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="rtl")ed.dom.setAttrib(e,"dir","rtl");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addButton('ltr',{title:'directionality.ltr_desc',cmd:'mceDirectionLTR'});ed.addButton('rtl',{title:'directionality.rtl_desc',cmd:'mceDirectionRTL'});ed.onNodeChange.add(t._nodeChange,t);},getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var dom=ed.dom,dir;n=dom.getParent(n,dom.isBlock);if(!n){cm.setDisabled('ltr',1);cm.setDisabled('rtl',1);return;}dir=dom.getAttrib(n,'dir');cm.setActive('ltr',dir=="ltr");cm.setDisabled('ltr',0);cm.setActive('rtl',dir=="rtl");cm.setDisabled('rtl',0);}});tinymce.PluginManager.add('directionality',tinymce.plugins.Directionality);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js new file mode 100755 index 0000000..81818e3 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Directionality', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | ed.addCommand('mceDirectionLTR', function() { | ||
| 16 | var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); | ||
| 17 | |||
| 18 | if (e) { | ||
| 19 | if (ed.dom.getAttrib(e, "dir") != "ltr") | ||
| 20 | ed.dom.setAttrib(e, "dir", "ltr"); | ||
| 21 | else | ||
| 22 | ed.dom.setAttrib(e, "dir", ""); | ||
| 23 | } | ||
| 24 | |||
| 25 | ed.nodeChanged(); | ||
| 26 | }); | ||
| 27 | |||
| 28 | ed.addCommand('mceDirectionRTL', function() { | ||
| 29 | var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); | ||
| 30 | |||
| 31 | if (e) { | ||
| 32 | if (ed.dom.getAttrib(e, "dir") != "rtl") | ||
| 33 | ed.dom.setAttrib(e, "dir", "rtl"); | ||
| 34 | else | ||
| 35 | ed.dom.setAttrib(e, "dir", ""); | ||
| 36 | } | ||
| 37 | |||
| 38 | ed.nodeChanged(); | ||
| 39 | }); | ||
| 40 | |||
| 41 | ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); | ||
| 42 | ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); | ||
| 43 | |||
| 44 | ed.onNodeChange.add(t._nodeChange, t); | ||
| 45 | }, | ||
| 46 | |||
| 47 | getInfo : function() { | ||
| 48 | return { | ||
| 49 | longname : 'Directionality', | ||
| 50 | author : 'Moxiecode Systems AB', | ||
| 51 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 52 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', | ||
| 53 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 54 | }; | ||
| 55 | }, | ||
| 56 | |||
| 57 | // Private methods | ||
| 58 | |||
| 59 | _nodeChange : function(ed, cm, n) { | ||
| 60 | var dom = ed.dom, dir; | ||
| 61 | |||
| 62 | n = dom.getParent(n, dom.isBlock); | ||
| 63 | if (!n) { | ||
| 64 | cm.setDisabled('ltr', 1); | ||
| 65 | cm.setDisabled('rtl', 1); | ||
| 66 | return; | ||
| 67 | } | ||
| 68 | |||
| 69 | dir = dom.getAttrib(n, 'dir'); | ||
| 70 | cm.setActive('ltr', dir == "ltr"); | ||
| 71 | cm.setDisabled('ltr', 0); | ||
| 72 | cm.setActive('rtl', dir == "rtl"); | ||
| 73 | cm.setDisabled('rtl', 0); | ||
| 74 | } | ||
| 75 | }); | ||
| 76 | |||
| 77 | // Register plugin | ||
| 78 | tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); | ||
| 79 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js new file mode 100755 index 0000000..87fac10 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.EmotionsPlugin',{init:function(ed,url){ed.addCommand('mceEmotion',function(){ed.windowManager.open({file:url+'/emotions.htm',width:250+parseInt(ed.getLang('emotions.delta_width',0)),height:160+parseInt(ed.getLang('emotions.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('emotions',{title:'emotions.emotions_desc',cmd:'mceEmotion'});},getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('emotions',tinymce.plugins.EmotionsPlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js new file mode 100755 index 0000000..df0d370 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.EmotionsPlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | // Register commands | ||
| 12 | ed.addCommand('mceEmotion', function() { | ||
| 13 | ed.windowManager.open({ | ||
| 14 | file : url + '/emotions.htm', | ||
| 15 | width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), | ||
| 16 | height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), | ||
| 17 | inline : 1 | ||
| 18 | }, { | ||
| 19 | plugin_url : url | ||
| 20 | }); | ||
| 21 | }); | ||
| 22 | |||
| 23 | // Register buttons | ||
| 24 | ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); | ||
| 25 | }, | ||
| 26 | |||
| 27 | getInfo : function() { | ||
| 28 | return { | ||
| 29 | longname : 'Emotions', | ||
| 30 | author : 'Moxiecode Systems AB', | ||
| 31 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 32 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', | ||
| 33 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 34 | }; | ||
| 35 | } | ||
| 36 | }); | ||
| 37 | |||
| 38 | // Register plugin | ||
| 39 | tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); | ||
| 40 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/emotions.htm b/public/javascripts/tiny_mce/plugins/emotions/emotions.htm new file mode 100755 index 0000000..8110ee0 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/emotions.htm | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#emotions_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/emotions.js"></script> | ||
| 7 | <base target="_self" /> | ||
| 8 | </head> | ||
| 9 | <body style="display: none"> | ||
| 10 | <div align="center"> | ||
| 11 | <div class="title">{#emotions_dlg.title}:<br /><br /></div> | ||
| 12 | |||
| 13 | <table border="0" cellspacing="0" cellpadding="4"> | ||
| 14 | <tr> | ||
| 15 | <td><a href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}" title="{#emotions_dlg.cool}" /></a></td> | ||
| 16 | <td><a href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}" title="{#emotions_dlg.cry}" /></a></td> | ||
| 17 | <td><a href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}" title="{#emotions_dlg.embarassed}" /></a></td> | ||
| 18 | <td><a href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}" title="{#emotions_dlg.foot_in_mouth}" /></a></td> | ||
| 19 | </tr> | ||
| 20 | <tr> | ||
| 21 | <td><a href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" title="{#emotions_dlg.frown}" /></a></td> | ||
| 22 | <td><a href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}" title="{#emotions_dlg.innocent}" /></a></td> | ||
| 23 | <td><a href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}" title="{#emotions_dlg.kiss}" /></a></td> | ||
| 24 | <td><a href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}" title="{#emotions_dlg.laughing}" /></a></td> | ||
| 25 | </tr> | ||
| 26 | <tr> | ||
| 27 | <td><a href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}" title="{#emotions_dlg.money_mouth}" /></a></td> | ||
| 28 | <td><a href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}" title="{#emotions_dlg.sealed}" /></a></td> | ||
| 29 | <td><a href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}" title="{#emotions_dlg.smile}" /></a></td> | ||
| 30 | <td><a href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}" title="{#emotions_dlg.surprised}" /></a></td> | ||
| 31 | </tr> | ||
| 32 | <tr> | ||
| 33 | <td><a href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue-out}" title="{#emotions_dlg.tongue_out}" /></a></td> | ||
| 34 | <td><a href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}" title="{#emotions_dlg.undecided}" /></a></td> | ||
| 35 | <td><a href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}" title="{#emotions_dlg.wink}" /></a></td> | ||
| 36 | <td><a href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}" title="{#emotions_dlg.yell}" /></a></td> | ||
| 37 | </tr> | ||
| 38 | </table> | ||
| 39 | </div> | ||
| 40 | </body> | ||
| 41 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif new file mode 100755 index 0000000..ba90cc3 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif new file mode 100755 index 0000000..74d897a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif new file mode 100755 index 0000000..963a96b --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif new file mode 100755 index 0000000..16f68cc --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif new file mode 100755 index 0000000..716f55e --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif new file mode 100755 index 0000000..334d49e --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif new file mode 100755 index 0000000..4efd549 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif new file mode 100755 index 0000000..1606c11 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif new file mode 100755 index 0000000..ca2451e --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif new file mode 100755 index 0000000..b33d3cc --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif new file mode 100755 index 0000000..e6a9e60 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif new file mode 100755 index 0000000..cb99cdd --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif new file mode 100755 index 0000000..2075dc1 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif new file mode 100755 index 0000000..bef7e25 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif new file mode 100755 index 0000000..9faf1af --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif new file mode 100755 index 0000000..648e6e8 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js b/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js new file mode 100755 index 0000000..c549367 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var EmotionsDialog = { | ||
| 4 | init : function(ed) { | ||
| 5 | tinyMCEPopup.resizeToInnerSize(); | ||
| 6 | }, | ||
| 7 | |||
| 8 | insert : function(file, title) { | ||
| 9 | var ed = tinyMCEPopup.editor, dom = ed.dom; | ||
| 10 | |||
| 11 | tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { | ||
| 12 | src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, | ||
| 13 | alt : ed.getLang(title), | ||
| 14 | title : ed.getLang(title), | ||
| 15 | border : 0 | ||
| 16 | })); | ||
| 17 | |||
| 18 | tinyMCEPopup.close(); | ||
| 19 | } | ||
| 20 | }; | ||
| 21 | |||
| 22 | tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js new file mode 100755 index 0000000..3b57ad9 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | tinyMCE.addI18n('en.emotions_dlg',{ | ||
| 2 | title:"Insert emotion", | ||
| 3 | desc:"Emotions", | ||
| 4 | cool:"Cool", | ||
| 5 | cry:"Cry", | ||
| 6 | embarassed:"Embarassed", | ||
| 7 | foot_in_mouth:"Foot in mouth", | ||
| 8 | frown:"Frown", | ||
| 9 | innocent:"Innocent", | ||
| 10 | kiss:"Kiss", | ||
| 11 | laughing:"Laughing", | ||
| 12 | money_mouth:"Money mouth", | ||
| 13 | sealed:"Sealed", | ||
| 14 | smile:"Smile", | ||
| 15 | surprised:"Surprised", | ||
| 16 | tongue_out:"Tongue out", | ||
| 17 | undecided:"Undecided", | ||
| 18 | wink:"Wink", | ||
| 19 | yell:"Yell" | ||
| 20 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/dialog.htm b/public/javascripts/tiny_mce/plugins/example/dialog.htm new file mode 100755 index 0000000..b4c6284 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/example/dialog.htm | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#example_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/dialog.js"></script> | ||
| 7 | </head> | ||
| 8 | <body> | ||
| 9 | |||
| 10 | <form onsubmit="ExampleDialog.insert();return false;" action="#"> | ||
| 11 | <p>Here is a example dialog.</p> | ||
| 12 | <p>Selected text: <input id="someval" name="someval" type="text" class="text" /></p> | ||
| 13 | <p>Custom arg: <input id="somearg" name="somearg" type="text" class="text" /></p> | ||
| 14 | |||
| 15 | <div class="mceActionPanel"> | ||
| 16 | <div style="float: left"> | ||
| 17 | <input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" /> | ||
| 18 | </div> | ||
| 19 | |||
| 20 | <div style="float: right"> | ||
| 21 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 22 | </div> | ||
| 23 | </div> | ||
| 24 | </form> | ||
| 25 | |||
| 26 | </body> | ||
| 27 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/editor_plugin.js b/public/javascripts/tiny_mce/plugins/example/editor_plugin.js new file mode 100755 index 0000000..cb7010d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/example/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.PluginManager.requireLangPack('example');tinymce.create('tinymce.plugins.ExamplePlugin',{init:function(ed,url){ed.addCommand('mceExample',function(){ed.windowManager.open({file:url+'/dialog.htm',width:320+parseInt(ed.getLang('example.delta_width',0)),height:120+parseInt(ed.getLang('example.delta_height',0)),inline:1},{plugin_url:url,some_custom_arg:'custom arg'});});ed.addButton('example',{title:'example.desc',cmd:'mceExample',image:url+'/img/example.gif'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('example',n.nodeName=='IMG');});},createControl:function(n,cm){return null;},getInfo:function(){return{longname:'Example plugin',author:'Some author',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',version:"1.0"};}});tinymce.PluginManager.add('example',tinymce.plugins.ExamplePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js new file mode 100755 index 0000000..5050550 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | // Load plugin specific language pack | ||
| 10 | tinymce.PluginManager.requireLangPack('example'); | ||
| 11 | |||
| 12 | tinymce.create('tinymce.plugins.ExamplePlugin', { | ||
| 13 | /** | ||
| 14 | * Initializes the plugin, this will be executed after the plugin has been created. | ||
| 15 | * This call is done before the editor instance has finished it's initialization so use the onInit event | ||
| 16 | * of the editor instance to intercept that event. | ||
| 17 | * | ||
| 18 | * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. | ||
| 19 | * @param {string} url Absolute URL to where the plugin is located. | ||
| 20 | */ | ||
| 21 | init : function(ed, url) { | ||
| 22 | // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); | ||
| 23 | ed.addCommand('mceExample', function() { | ||
| 24 | ed.windowManager.open({ | ||
| 25 | file : url + '/dialog.htm', | ||
| 26 | width : 320 + parseInt(ed.getLang('example.delta_width', 0)), | ||
| 27 | height : 120 + parseInt(ed.getLang('example.delta_height', 0)), | ||
| 28 | inline : 1 | ||
| 29 | }, { | ||
| 30 | plugin_url : url, // Plugin absolute URL | ||
| 31 | some_custom_arg : 'custom arg' // Custom argument | ||
| 32 | }); | ||
| 33 | }); | ||
| 34 | |||
| 35 | // Register example button | ||
| 36 | ed.addButton('example', { | ||
| 37 | title : 'example.desc', | ||
| 38 | cmd : 'mceExample', | ||
| 39 | image : url + '/img/example.gif' | ||
| 40 | }); | ||
| 41 | |||
| 42 | // Add a node change handler, selects the button in the UI when a image is selected | ||
| 43 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 44 | cm.setActive('example', n.nodeName == 'IMG'); | ||
| 45 | }); | ||
| 46 | }, | ||
| 47 | |||
| 48 | /** | ||
| 49 | * Creates control instances based in the incomming name. This method is normally not | ||
| 50 | * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons | ||
| 51 | * but you sometimes need to create more complex controls like listboxes, split buttons etc then this | ||
| 52 | * method can be used to create those. | ||
| 53 | * | ||
| 54 | * @param {String} n Name of the control to create. | ||
| 55 | * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. | ||
| 56 | * @return {tinymce.ui.Control} New control instance or null if no control was created. | ||
| 57 | */ | ||
| 58 | createControl : function(n, cm) { | ||
| 59 | return null; | ||
| 60 | }, | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Returns information about the plugin as a name/value array. | ||
| 64 | * The current keys are longname, author, authorurl, infourl and version. | ||
| 65 | * | ||
| 66 | * @return {Object} Name/value array containing information about the plugin. | ||
| 67 | */ | ||
| 68 | getInfo : function() { | ||
| 69 | return { | ||
| 70 | longname : 'Example plugin', | ||
| 71 | author : 'Some author', | ||
| 72 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 73 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', | ||
| 74 | version : "1.0" | ||
| 75 | }; | ||
| 76 | } | ||
| 77 | }); | ||
| 78 | |||
| 79 | // Register plugin | ||
| 80 | tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); | ||
| 81 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/img/example.gif b/public/javascripts/tiny_mce/plugins/example/img/example.gif new file mode 100755 index 0000000..1ab5da4 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/example/img/example.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/example/js/dialog.js b/public/javascripts/tiny_mce/plugins/example/js/dialog.js new file mode 100755 index 0000000..fa83411 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/example/js/dialog.js | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var ExampleDialog = { | ||
| 4 | init : function() { | ||
| 5 | var f = document.forms[0]; | ||
| 6 | |||
| 7 | // Get the selected contents as text and place it in the input | ||
| 8 | f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); | ||
| 9 | f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); | ||
| 10 | }, | ||
| 11 | |||
| 12 | insert : function() { | ||
| 13 | // Insert the contents from the input into the document | ||
| 14 | tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); | ||
| 15 | tinyMCEPopup.close(); | ||
| 16 | } | ||
| 17 | }; | ||
| 18 | |||
| 19 | tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/langs/en.js b/public/javascripts/tiny_mce/plugins/example/langs/en.js new file mode 100755 index 0000000..e0784f8 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/example/langs/en.js | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | tinyMCE.addI18n('en.example',{ | ||
| 2 | desc : 'This is just a template button' | ||
| 3 | }); | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js new file mode 100755 index 0000000..ebcf948 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | tinyMCE.addI18n('en.example_dlg',{ | ||
| 2 | title : 'This is just a example title' | ||
| 3 | }); | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css b/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css new file mode 100755 index 0000000..7a3334f --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css | |||
| @@ -0,0 +1,182 @@ | |||
| 1 | /* Hide the advanced tab */ | ||
| 2 | #advanced_tab { | ||
| 3 | display: none; | ||
| 4 | } | ||
| 5 | |||
| 6 | #metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { | ||
| 7 | width: 280px; | ||
| 8 | } | ||
| 9 | |||
| 10 | #doctype, #docencoding { | ||
| 11 | width: 200px; | ||
| 12 | } | ||
| 13 | |||
| 14 | #langcode { | ||
| 15 | width: 30px; | ||
| 16 | } | ||
| 17 | |||
| 18 | #bgimage { | ||
| 19 | width: 220px; | ||
| 20 | } | ||
| 21 | |||
| 22 | #fontface { | ||
| 23 | width: 240px; | ||
| 24 | } | ||
| 25 | |||
| 26 | #leftmargin, #rightmargin, #topmargin, #bottommargin { | ||
| 27 | width: 50px; | ||
| 28 | } | ||
| 29 | |||
| 30 | .panel_wrapper div.current { | ||
| 31 | height: 400px; | ||
| 32 | } | ||
| 33 | |||
| 34 | #stylesheet, #style { | ||
| 35 | width: 240px; | ||
| 36 | } | ||
| 37 | |||
| 38 | /* Head list classes */ | ||
| 39 | |||
| 40 | .headlistwrapper { | ||
| 41 | width: 100%; | ||
| 42 | } | ||
| 43 | |||
| 44 | .addbutton, .removebutton, .moveupbutton, .movedownbutton { | ||
| 45 | border-top: 1px solid; | ||
| 46 | border-left: 1px solid; | ||
| 47 | border-bottom: 1px solid; | ||
| 48 | border-right: 1px solid; | ||
| 49 | border-color: #F0F0EE; | ||
| 50 | cursor: default; | ||
| 51 | display: block; | ||
| 52 | width: 20px; | ||
| 53 | height: 20px; | ||
| 54 | } | ||
| 55 | |||
| 56 | #doctypes { | ||
| 57 | width: 200px; | ||
| 58 | } | ||
| 59 | |||
| 60 | .addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover { | ||
| 61 | border: 1px solid #0A246A; | ||
| 62 | background-color: #B6BDD2; | ||
| 63 | } | ||
| 64 | |||
| 65 | .addbutton { | ||
| 66 | background-image: url('../images/add.gif'); | ||
| 67 | float: left; | ||
| 68 | margin-right: 3px; | ||
| 69 | } | ||
| 70 | |||
| 71 | .removebutton { | ||
| 72 | background-image: url('../images/remove.gif'); | ||
| 73 | float: left; | ||
| 74 | } | ||
| 75 | |||
| 76 | .moveupbutton { | ||
| 77 | background-image: url('../images/move_up.gif'); | ||
| 78 | float: left; | ||
| 79 | margin-right: 3px; | ||
| 80 | } | ||
| 81 | |||
| 82 | .movedownbutton { | ||
| 83 | background-image: url('../images/move_down.gif'); | ||
| 84 | float: left; | ||
| 85 | } | ||
| 86 | |||
| 87 | .selected { | ||
| 88 | border: 1px solid #0A246A; | ||
| 89 | background-color: #B6BDD2; | ||
| 90 | } | ||
| 91 | |||
| 92 | .toolbar { | ||
| 93 | width: 100%; | ||
| 94 | } | ||
| 95 | |||
| 96 | #headlist { | ||
| 97 | width: 100%; | ||
| 98 | margin-top: 3px; | ||
| 99 | font-size: 11px; | ||
| 100 | } | ||
| 101 | |||
| 102 | #info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { | ||
| 103 | display: none; | ||
| 104 | } | ||
| 105 | |||
| 106 | #addmenu { | ||
| 107 | position: absolute; | ||
| 108 | border: 1px solid gray; | ||
| 109 | display: none; | ||
| 110 | z-index: 100; | ||
| 111 | background-color: white; | ||
| 112 | } | ||
| 113 | |||
| 114 | #addmenu a { | ||
| 115 | display: block; | ||
| 116 | width: 100%; | ||
| 117 | line-height: 20px; | ||
| 118 | text-decoration: none; | ||
| 119 | background-color: white; | ||
| 120 | } | ||
| 121 | |||
| 122 | #addmenu a:hover { | ||
| 123 | background-color: #B6BDD2; | ||
| 124 | color: black; | ||
| 125 | } | ||
| 126 | |||
| 127 | #addmenu span { | ||
| 128 | padding-left: 10px; | ||
| 129 | padding-right: 10px; | ||
| 130 | } | ||
| 131 | |||
| 132 | #updateElementPanel { | ||
| 133 | display: none; | ||
| 134 | } | ||
| 135 | |||
| 136 | #script_element .panel_wrapper div.current { | ||
| 137 | height: 108px; | ||
| 138 | } | ||
| 139 | |||
| 140 | #style_element .panel_wrapper div.current { | ||
| 141 | height: 108px; | ||
| 142 | } | ||
| 143 | |||
| 144 | #link_element .panel_wrapper div.current { | ||
| 145 | height: 140px; | ||
| 146 | } | ||
| 147 | |||
| 148 | #element_script_value { | ||
| 149 | width: 100%; | ||
| 150 | height: 100px; | ||
| 151 | } | ||
| 152 | |||
| 153 | #element_comment_value { | ||
| 154 | width: 100%; | ||
| 155 | height: 120px; | ||
| 156 | } | ||
| 157 | |||
| 158 | #element_style_value { | ||
| 159 | width: 100%; | ||
| 160 | height: 100px; | ||
| 161 | } | ||
| 162 | |||
| 163 | #element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { | ||
| 164 | width: 250px; | ||
| 165 | } | ||
| 166 | |||
| 167 | .updateElementButton { | ||
| 168 | margin-top: 3px; | ||
| 169 | } | ||
| 170 | |||
| 171 | /* MSIE specific styles */ | ||
| 172 | |||
| 173 | * html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { | ||
| 174 | width: 22px; | ||
| 175 | height: 22px; | ||
| 176 | } | ||
| 177 | |||
| 178 | textarea { | ||
| 179 | height: 55px; | ||
| 180 | } | ||
| 181 | |||
| 182 | .panel_wrapper div.current {height:420px;} \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js new file mode 100755 index 0000000..727beb5 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.FullPagePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceFullPageProperties',function(){ed.windowManager.open({file:url+'/fullpage.htm',width:430+parseInt(ed.getLang('fullpage.delta_width',0)),height:495+parseInt(ed.getLang('fullpage.delta_height',0)),inline:1},{plugin_url:url,head_html:t.head});});ed.addButton('fullpage',{title:'fullpage.desc',cmd:'mceFullPageProperties'});ed.onBeforeSetContent.add(t._setContent,t);ed.onSetContent.add(t._setBodyAttribs,t);ed.onGetContent.add(t._getContent,t);},getInfo:function(){return{longname:'Fullpage',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_setBodyAttribs:function(ed,o){var bdattr,i,len,kv,k,v,t,attr=this.head.match(/body(.*?)>/i);if(attr&&attr[1]){bdattr=attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(bdattr){for(i=0,len=bdattr.length;i<len;i++){kv=bdattr[i].split('=');k=kv[0].replace(/\s/,'');v=kv[1];if(v){v=v.replace(/^\s+/,'').replace(/\s+$/,'');t=v.match(/^["'](.*)["']$/);if(t)v=t[1];}else v=k;ed.dom.setAttrib(ed.getBody(),'style',v);}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true});},_setContent:function(ed,o){var t=this,sp,ep,c=o.content,v,st='';c=c.replace(/<(\/?)BODY/gi,'<$1body');sp=c.indexOf('<body');if(sp!=-1){sp=c.indexOf('>',sp);t.head=c.substring(0,sp+1);ep=c.indexOf('</body',sp);if(ep==-1)ep=c.indexOf('</body',ep);o.content=c.substring(sp+1,ep);t.foot=c.substring(ep);function low(s){return s.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase();})};t.head=low(t.head);t.foot=low(t.foot);}else{t.head='';if(ed.getParam('fullpage_default_xml_pi'))t.head+='<?xml version="1.0" encoding="'+ed.getParam('fullpage_default_encoding','ISO-8859-1')+'" ?>\n';t.head+=ed.getParam('fullpage_default_doctype','<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');t.head+='\n<html>\n<head>\n<title>'+ed.getParam('fullpage_default_title','Untitled document')+'</title>\n';if(v=ed.getParam('fullpage_default_encoding'))t.head+='<meta http-equiv="Content-Type" content="'+v+'" />\n';if(v=ed.getParam('fullpage_default_font_family'))st+='font-family: '+v+';';if(v=ed.getParam('fullpage_default_font_size'))st+='font-size: '+v+';';if(v=ed.getParam('fullpage_default_text_color'))st+='color: '+v+';';t.head+='</head>\n<body'+(st?' style="'+st+'"':'')+'>\n';t.foot='\n</body>\n</html>';}},_getContent:function(ed,o){var t=this;o.content=tinymce.trim(t.head)+'\n'+tinymce.trim(o.content)+'\n'+tinymce.trim(t.foot);}});tinymce.PluginManager.add('fullpage',tinymce.plugins.FullPagePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js new file mode 100755 index 0000000..019682d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js | |||
| @@ -0,0 +1,142 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 920 2008-09-09 14:05:33Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.FullPagePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mceFullPageProperties', function() { | ||
| 17 | ed.windowManager.open({ | ||
| 18 | file : url + '/fullpage.htm', | ||
| 19 | width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), | ||
| 20 | height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), | ||
| 21 | inline : 1 | ||
| 22 | }, { | ||
| 23 | plugin_url : url, | ||
| 24 | head_html : t.head | ||
| 25 | }); | ||
| 26 | }); | ||
| 27 | |||
| 28 | // Register buttons | ||
| 29 | ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); | ||
| 30 | |||
| 31 | ed.onBeforeSetContent.add(t._setContent, t); | ||
| 32 | ed.onSetContent.add(t._setBodyAttribs, t); | ||
| 33 | ed.onGetContent.add(t._getContent, t); | ||
| 34 | }, | ||
| 35 | |||
| 36 | getInfo : function() { | ||
| 37 | return { | ||
| 38 | longname : 'Fullpage', | ||
| 39 | author : 'Moxiecode Systems AB', | ||
| 40 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 41 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', | ||
| 42 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 43 | }; | ||
| 44 | }, | ||
| 45 | |||
| 46 | // Private plugin internal methods | ||
| 47 | |||
| 48 | _setBodyAttribs : function(ed, o) { | ||
| 49 | var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i); | ||
| 50 | |||
| 51 | if (attr && attr[1]) { | ||
| 52 | bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g); | ||
| 53 | |||
| 54 | if (bdattr) { | ||
| 55 | for(i = 0, len = bdattr.length; i < len; i++) { | ||
| 56 | kv = bdattr[i].split('='); | ||
| 57 | k = kv[0].replace(/\s/,''); | ||
| 58 | v = kv[1]; | ||
| 59 | |||
| 60 | if (v) { | ||
| 61 | v = v.replace(/^\s+/,'').replace(/\s+$/,''); | ||
| 62 | t = v.match(/^["'](.*)["']$/); | ||
| 63 | |||
| 64 | if (t) | ||
| 65 | v = t[1]; | ||
| 66 | } else | ||
| 67 | v = k; | ||
| 68 | |||
| 69 | ed.dom.setAttrib(ed.getBody(), 'style', v); | ||
| 70 | } | ||
| 71 | } | ||
| 72 | } | ||
| 73 | }, | ||
| 74 | |||
| 75 | _createSerializer : function() { | ||
| 76 | return new tinymce.dom.Serializer({ | ||
| 77 | dom : this.editor.dom, | ||
| 78 | apply_source_formatting : true | ||
| 79 | }); | ||
| 80 | }, | ||
| 81 | |||
| 82 | _setContent : function(ed, o) { | ||
| 83 | var t = this, sp, ep, c = o.content, v, st = ''; | ||
| 84 | |||
| 85 | // Parse out head, body and footer | ||
| 86 | c = c.replace(/<(\/?)BODY/gi, '<$1body'); | ||
| 87 | sp = c.indexOf('<body'); | ||
| 88 | |||
| 89 | if (sp != -1) { | ||
| 90 | sp = c.indexOf('>', sp); | ||
| 91 | t.head = c.substring(0, sp + 1); | ||
| 92 | |||
| 93 | ep = c.indexOf('</body', sp); | ||
| 94 | if (ep == -1) | ||
| 95 | ep = c.indexOf('</body', ep); | ||
| 96 | |||
| 97 | o.content = c.substring(sp + 1, ep); | ||
| 98 | t.foot = c.substring(ep); | ||
| 99 | |||
| 100 | function low(s) { | ||
| 101 | return s.replace(/<\/?[A-Z]+/g, function(a) { | ||
| 102 | return a.toLowerCase(); | ||
| 103 | }) | ||
| 104 | }; | ||
| 105 | |||
| 106 | t.head = low(t.head); | ||
| 107 | t.foot = low(t.foot); | ||
| 108 | } else { | ||
| 109 | t.head = ''; | ||
| 110 | if (ed.getParam('fullpage_default_xml_pi')) | ||
| 111 | t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n'; | ||
| 112 | |||
| 113 | t.head += ed.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'); | ||
| 114 | t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n'; | ||
| 115 | |||
| 116 | if (v = ed.getParam('fullpage_default_encoding')) | ||
| 117 | t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n'; | ||
| 118 | |||
| 119 | if (v = ed.getParam('fullpage_default_font_family')) | ||
| 120 | st += 'font-family: ' + v + ';'; | ||
| 121 | |||
| 122 | if (v = ed.getParam('fullpage_default_font_size')) | ||
| 123 | st += 'font-size: ' + v + ';'; | ||
| 124 | |||
| 125 | if (v = ed.getParam('fullpage_default_text_color')) | ||
| 126 | st += 'color: ' + v + ';'; | ||
| 127 | |||
| 128 | t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n'; | ||
| 129 | t.foot = '\n</body>\n</html>'; | ||
| 130 | } | ||
| 131 | }, | ||
| 132 | |||
| 133 | _getContent : function(ed, o) { | ||
| 134 | var t = this; | ||
| 135 | |||
| 136 | o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot); | ||
| 137 | } | ||
| 138 | }); | ||
| 139 | |||
| 140 | // Register plugin | ||
| 141 | tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); | ||
| 142 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm b/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm new file mode 100755 index 0000000..d74da0d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm | |||
| @@ -0,0 +1,577 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#fullpage_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="js/fullpage.js"></script> | ||
| 9 | <link href="css/fullpage.css" rel="stylesheet" type="text/css" /> | ||
| 10 | <base target="_self" /> | ||
| 11 | </head> | ||
| 12 | <body id="advlink" style="display: none"> | ||
| 13 | <form onsubmit="updateAction();return false;" name="fullpage" action="#"> | ||
| 14 | <div class="tabs"> | ||
| 15 | <ul> | ||
| 16 | <li id="meta_tab" class="current"><span><a href="javascript:mcTabs.displayTab('meta_tab','meta_panel');" onmousedown="return false;">{#fullpage_dlg.meta_tab}</a></span></li> | ||
| 17 | <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li> | ||
| 18 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_tab}</a></span></li> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="meta_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#fullpage_dlg.meta_props}</legend> | ||
| 26 | |||
| 27 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 28 | <tr> | ||
| 29 | <td nowrap="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label> </td> | ||
| 30 | <td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td> | ||
| 31 | </tr> | ||
| 32 | <tr> | ||
| 33 | <td nowrap="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label> </td> | ||
| 34 | <td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td> | ||
| 35 | </tr> | ||
| 36 | <tr> | ||
| 37 | <td nowrap="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label> </td> | ||
| 38 | <td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td> | ||
| 39 | </tr> | ||
| 40 | <tr> | ||
| 41 | <td nowrap="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label> </td> | ||
| 42 | <td><input type="text" id="metaauthor" name="metaauthor" value="" /></td> | ||
| 43 | </tr> | ||
| 44 | <tr> | ||
| 45 | <td nowrap="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label> </td> | ||
| 46 | <td><input type="text" id="metacopyright" name="metacopyright" value="" /></td> | ||
| 47 | </tr> | ||
| 48 | <tr> | ||
| 49 | <td nowrap="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label> </td> | ||
| 50 | <td> | ||
| 51 | <select id="metarobots" name="metarobots"> | ||
| 52 | <option value="">{#not_set}</option> | ||
| 53 | <option value="index,follow">{#fullpage_dlg.meta_index_follow}</option> | ||
| 54 | <option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option> | ||
| 55 | <option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option> | ||
| 56 | <option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option> | ||
| 57 | </select> | ||
| 58 | </td> | ||
| 59 | </tr> | ||
| 60 | </table> | ||
| 61 | </fieldset> | ||
| 62 | |||
| 63 | <fieldset> | ||
| 64 | <legend>{#fullpage_dlg.langprops}</legend> | ||
| 65 | |||
| 66 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 67 | <tr> | ||
| 68 | <td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td> | ||
| 69 | <td> | ||
| 70 | <select id="docencoding" name="docencoding"> | ||
| 71 | <option value="">{#not_set}</option> | ||
| 72 | </select> | ||
| 73 | </td> | ||
| 74 | </tr> | ||
| 75 | <tr> | ||
| 76 | <td nowrap="nowrap"><label for="doctypes">{#fullpage_dlg.doctypes}</label> </td> | ||
| 77 | <td> | ||
| 78 | <select id="doctypes" name="doctypes"> | ||
| 79 | <option value="">{#not_set}</option> | ||
| 80 | </select> | ||
| 81 | </td> | ||
| 82 | </tr> | ||
| 83 | <tr> | ||
| 84 | <td nowrap="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label> </td> | ||
| 85 | <td><input type="text" id="langcode" name="langcode" value="" /></td> | ||
| 86 | </tr> | ||
| 87 | <tr> | ||
| 88 | <td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td> | ||
| 89 | <td> | ||
| 90 | <select id="langdir" name="langdir"> | ||
| 91 | <option value="">{#not_set}</option> | ||
| 92 | <option value="ltr">{#fullpage_dlg.ltr}</option> | ||
| 93 | <option value="rtl">{#fullpage_dlg.rtl}</option> | ||
| 94 | </select> | ||
| 95 | </td> | ||
| 96 | </tr> | ||
| 97 | <tr> | ||
| 98 | <td nowrap="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label> </td> | ||
| 99 | <td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td> | ||
| 100 | </tr> | ||
| 101 | </table> | ||
| 102 | </fieldset> | ||
| 103 | </div> | ||
| 104 | |||
| 105 | <div id="appearance_panel" class="panel"> | ||
| 106 | <fieldset> | ||
| 107 | <legend>{#fullpage_dlg.appearance_textprops}</legend> | ||
| 108 | |||
| 109 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 110 | <tr> | ||
| 111 | <td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td> | ||
| 112 | <td> | ||
| 113 | <select id="fontface" name="fontface" onchange="changedStyleField(this);"> | ||
| 114 | <option value="">{#not_set}</option> | ||
| 115 | </select> | ||
| 116 | </td> | ||
| 117 | </tr> | ||
| 118 | |||
| 119 | <tr> | ||
| 120 | <td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td> | ||
| 121 | <td> | ||
| 122 | <select id="fontsize" name="fontsize" onchange="changedStyleField(this);"> | ||
| 123 | <option value="">{#not_set}</option> | ||
| 124 | </select> | ||
| 125 | </td> | ||
| 126 | </tr> | ||
| 127 | |||
| 128 | <tr> | ||
| 129 | <td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td> | ||
| 130 | <td> | ||
| 131 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 132 | <tr> | ||
| 133 | <td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');changedStyleField(this);" /></td> | ||
| 134 | <td id="textcolor_pickcontainer"> </td> | ||
| 135 | </tr> | ||
| 136 | </table> | ||
| 137 | </td> | ||
| 138 | </tr> | ||
| 139 | </table> | ||
| 140 | </fieldset> | ||
| 141 | |||
| 142 | <fieldset> | ||
| 143 | <legend>{#fullpage_dlg.appearance_bgprops}</legend> | ||
| 144 | |||
| 145 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 146 | <tr> | ||
| 147 | <td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td> | ||
| 148 | <td> | ||
| 149 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 150 | <tr> | ||
| 151 | <td><input id="bgimage" name="bgimage" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 152 | <td id="bgimage_pickcontainer"> </td> | ||
| 153 | </tr> | ||
| 154 | </table> | ||
| 155 | </td> | ||
| 156 | </tr> | ||
| 157 | <tr> | ||
| 158 | <td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td> | ||
| 159 | <td> | ||
| 160 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 161 | <tr> | ||
| 162 | <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedStyleField(this);" /></td> | ||
| 163 | <td id="bgcolor_pickcontainer"> </td> | ||
| 164 | </tr> | ||
| 165 | </table> | ||
| 166 | </td> | ||
| 167 | </tr> | ||
| 168 | </table> | ||
| 169 | </fieldset> | ||
| 170 | |||
| 171 | <fieldset> | ||
| 172 | <legend>{#fullpage_dlg.appearance_marginprops}</legend> | ||
| 173 | |||
| 174 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 175 | <tr> | ||
| 176 | <td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td> | ||
| 177 | <td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 178 | <td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td> | ||
| 179 | <td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 180 | </tr> | ||
| 181 | <tr> | ||
| 182 | <td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td> | ||
| 183 | <td><input id="topmargin" name="topmargin" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 184 | <td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td> | ||
| 185 | <td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 186 | </tr> | ||
| 187 | </table> | ||
| 188 | </fieldset> | ||
| 189 | |||
| 190 | <fieldset> | ||
| 191 | <legend>{#fullpage_dlg.appearance_linkprops}</legend> | ||
| 192 | |||
| 193 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 194 | <tr> | ||
| 195 | <td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td> | ||
| 196 | <td> | ||
| 197 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 198 | <tr> | ||
| 199 | <td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');changedStyleField(this);" /></td> | ||
| 200 | <td id="link_color_pickcontainer"> </td> | ||
| 201 | </tr> | ||
| 202 | </table> | ||
| 203 | </td> | ||
| 204 | |||
| 205 | <td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td> | ||
| 206 | <td> | ||
| 207 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 208 | <tr> | ||
| 209 | <td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');changedStyleField(this);" /></td> | ||
| 210 | <td id="visited_color_pickcontainer"> </td> | ||
| 211 | </tr> | ||
| 212 | </table> | ||
| 213 | </td> | ||
| 214 | </tr> | ||
| 215 | |||
| 216 | <tr> | ||
| 217 | <td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td> | ||
| 218 | <td> | ||
| 219 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 220 | <tr> | ||
| 221 | <td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');changedStyleField(this);" /></td> | ||
| 222 | <td id="active_color_pickcontainer"> </td> | ||
| 223 | </tr> | ||
| 224 | </table> | ||
| 225 | </td> | ||
| 226 | |||
| 227 | <td> </td> | ||
| 228 | <td> </td> | ||
| 229 | |||
| 230 | <!-- <td class="column1"><label for="hover_color">{#fullpage_dlg.hover_color}</label></td> | ||
| 231 | <td> | ||
| 232 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 233 | <tr> | ||
| 234 | <td><input id="hover_color" name="hover_color" type="text" value="" size="9" onchange="changedStyleField(this);" /></td> | ||
| 235 | <td id="hover_color_pickcontainer"> </td> | ||
| 236 | </tr> | ||
| 237 | </table> | ||
| 238 | </td> --> | ||
| 239 | </tr> | ||
| 240 | </table> | ||
| 241 | </fieldset> | ||
| 242 | |||
| 243 | <fieldset> | ||
| 244 | <legend>{#fullpage_dlg.appearance_style}</legend> | ||
| 245 | |||
| 246 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 247 | <tr> | ||
| 248 | <td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td> | ||
| 249 | <td><table border="0" cellpadding="0" cellspacing="0"> | ||
| 250 | <tr> | ||
| 251 | <td><input id="stylesheet" name="stylesheet" type="text" value="" /></td> | ||
| 252 | <td id="stylesheet_browsercontainer"> </td> | ||
| 253 | </tr> | ||
| 254 | </table></td> | ||
| 255 | </tr> | ||
| 256 | <tr> | ||
| 257 | <td class="column1"><label for="style">{#fullpage_dlg.style}</label></td> | ||
| 258 | <td><input id="style" name="style" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 259 | </tr> | ||
| 260 | </table> | ||
| 261 | </fieldset> | ||
| 262 | </div> | ||
| 263 | |||
| 264 | <div id="advanced_panel" class="panel"> | ||
| 265 | <div id="addmenu"> | ||
| 266 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 267 | <tr><td><a href="javascript:addHeadElm('title');" onmousedown="return false;"><span>{#fullpage_dlg.add_title}</span></a></td></tr> | ||
| 268 | <tr><td><a href="javascript:addHeadElm('meta');" onmousedown="return false;"><span>{#fullpage_dlg.add_meta}</span></a></td></tr> | ||
| 269 | <tr><td><a href="javascript:addHeadElm('script');" onmousedown="return false;"><span>{#fullpage_dlg.add_script}</span></a></td></tr> | ||
| 270 | <tr><td><a href="javascript:addHeadElm('style');" onmousedown="return false;"><span>{#fullpage_dlg.add_style}</span></a></td></tr> | ||
| 271 | <tr><td><a href="javascript:addHeadElm('link');" onmousedown="return false;"><span>{#fullpage_dlg.add_link}</span></a></td></tr> | ||
| 272 | <tr><td><a href="javascript:addHeadElm('base');" onmousedown="return false;"><span>{#fullpage_dlg.add_base}</span></a></td></tr> | ||
| 273 | <tr><td><a href="javascript:addHeadElm('comment');" onmousedown="return false;"><span>{#fullpage_dlg.add_comment}</span></a></td></tr> | ||
| 274 | </table> | ||
| 275 | </div> | ||
| 276 | |||
| 277 | <fieldset> | ||
| 278 | <legend>{#fullpage_dlg.head_elements}</legend> | ||
| 279 | |||
| 280 | <div class="headlistwrapper"> | ||
| 281 | <div class="toolbar"> | ||
| 282 | <div style="float: left"> | ||
| 283 | <a id="addbutton" href="javascript:showAddMenu();" onmousedown="return false;" class="addbutton" title="{#fullpage_dlg.add}"></a> | ||
| 284 | <a href="#" onmousedown="return false;" class="removebutton" title="{#fullpage_dlg.remove}"></a> | ||
| 285 | </div> | ||
| 286 | <div style="float: right"> | ||
| 287 | <a href="#" onmousedown="return false;" class="moveupbutton" title="{#fullpage_dlg.moveup}"></a> | ||
| 288 | <a href="#" onmousedown="return false;" class="movedownbutton" title="{#fullpage_dlg.movedown}"></a> | ||
| 289 | </div> | ||
| 290 | <br style="clear: both" /> | ||
| 291 | </div> | ||
| 292 | <select id="headlist" size="26" onchange="updateHeadElm(this.options[this.selectedIndex].value);"> | ||
| 293 | <option value="title_0"><title>Some title bla bla bla</title></option> | ||
| 294 | <option value="meta_1"><meta name="keywords">Some bla bla bla</meta></option> | ||
| 295 | <option value="meta_2"><meta name="description">Some bla bla bla bla bla bla bla bla bla</meta></option> | ||
| 296 | <option value="script_3"><script language="javascript">...</script></option> | ||
| 297 | <option value="style_4"><style>...</style></option> | ||
| 298 | <option value="base_5"><base href="." /></option> | ||
| 299 | <option value="comment_6"><!-- ... --></option> | ||
| 300 | <option value="link_7"><link href="." /></option> | ||
| 301 | </select> | ||
| 302 | </div> | ||
| 303 | </fieldset> | ||
| 304 | |||
| 305 | <fieldset id="meta_element"> | ||
| 306 | <legend>{#fullpage_dlg.meta_element}</legend> | ||
| 307 | |||
| 308 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 309 | <tr> | ||
| 310 | <td class="column1"><label for="element_meta_type">{#fullpage_dlg.type}</label></td> | ||
| 311 | <td><select id="element_meta_type"> | ||
| 312 | <option value="name">name</option> | ||
| 313 | <option value="http-equiv">http-equiv</option> | ||
| 314 | </select></td> | ||
| 315 | </tr> | ||
| 316 | <tr> | ||
| 317 | <td class="column1"><label for="element_meta_name">{#fullpage_dlg.name}</label></td> | ||
| 318 | <td><input id="element_meta_name" name="element_meta_name" type="text" value="" /></td> | ||
| 319 | </tr> | ||
| 320 | <tr> | ||
| 321 | <td class="column1"><label for="element_meta_content">{#fullpage_dlg.content}</label></td> | ||
| 322 | <td><input id="element_meta_content" name="element_meta_content" type="text" value="" /></td> | ||
| 323 | </tr> | ||
| 324 | </table> | ||
| 325 | |||
| 326 | <input type="button" id="meta_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 327 | </fieldset> | ||
| 328 | |||
| 329 | <fieldset id="title_element"> | ||
| 330 | <legend>{#fullpage_dlg.title_element}</legend> | ||
| 331 | |||
| 332 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 333 | <tr> | ||
| 334 | <td class="column1"><label for="element_title">{#fullpage_dlg.meta_title}</label></td> | ||
| 335 | <td><input id="element_title" name="element_title" type="text" value="" /></td> | ||
| 336 | </tr> | ||
| 337 | </table> | ||
| 338 | |||
| 339 | <input type="button" id="title_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 340 | </fieldset> | ||
| 341 | |||
| 342 | <fieldset id="script_element"> | ||
| 343 | <legend>{#fullpage_dlg.script_element}</legend> | ||
| 344 | |||
| 345 | <div class="tabs"> | ||
| 346 | <ul> | ||
| 347 | <li id="script_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('script_props_tab','script_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li> | ||
| 348 | <li id="script_value_tab"><span><a href="javascript:mcTabs.displayTab('script_value_tab','script_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li> | ||
| 349 | </ul> | ||
| 350 | </div> | ||
| 351 | |||
| 352 | <br style="clear: both" /> | ||
| 353 | |||
| 354 | <div class="panel_wrapper"> | ||
| 355 | <div id="script_props_panel" class="panel current"> | ||
| 356 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 357 | <tr> | ||
| 358 | <td class="column1"><label for="element_script_type">{#fullpage_dlg.type}</label></td> | ||
| 359 | <td><select id="element_script_type"> | ||
| 360 | <option value="text/javascript">text/javascript</option> | ||
| 361 | <option value="text/jscript">text/jscript</option> | ||
| 362 | <option value="text/vbscript">text/vbscript</option> | ||
| 363 | <option value="text/vbs">text/vbs</option> | ||
| 364 | <option value="text/ecmascript">text/ecmascript</option> | ||
| 365 | <option value="text/xml">text/xml</option> | ||
| 366 | </select></td> | ||
| 367 | </tr> | ||
| 368 | <tr> | ||
| 369 | <td class="column1"><label for="element_script_src">{#fullpage_dlg.src}</label></td> | ||
| 370 | <td><table border="0" cellpadding="0" cellspacing="0"> | ||
| 371 | <tr> | ||
| 372 | <td><input id="element_script_src" name="element_script_src" type="text" value="" /></td> | ||
| 373 | <td id="script_src_pickcontainer"> </td> | ||
| 374 | </tr> | ||
| 375 | </table></td> | ||
| 376 | </tr> | ||
| 377 | <tr> | ||
| 378 | <td class="column1"><label for="element_script_charset">{#fullpage_dlg.charset}</label></td> | ||
| 379 | <td><select id="element_script_charset"><option value="">{#not_set}</option></select></td> | ||
| 380 | </tr> | ||
| 381 | <tr> | ||
| 382 | <td class="column1"><label for="element_script_defer">{#fullpage_dlg.defer}</label></td> | ||
| 383 | <td><input type="checkbox" id="element_script_defer" name="element_script_defer" class="checkbox" /></td> | ||
| 384 | </tr> | ||
| 385 | </table> | ||
| 386 | </div> | ||
| 387 | |||
| 388 | <div id="script_value_panel" class="panel"> | ||
| 389 | <textarea id="element_script_value"></textarea> | ||
| 390 | </div> | ||
| 391 | </div> | ||
| 392 | |||
| 393 | <input type="button" id="script_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 394 | </fieldset> | ||
| 395 | |||
| 396 | <fieldset id="style_element"> | ||
| 397 | <legend>{#fullpage_dlg.style_element}</legend> | ||
| 398 | |||
| 399 | <div class="tabs"> | ||
| 400 | <ul> | ||
| 401 | <li id="style_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('style_props_tab','style_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li> | ||
| 402 | <li id="style_value_tab"><span><a href="javascript:mcTabs.displayTab('style_value_tab','style_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li> | ||
| 403 | </ul> | ||
| 404 | </div> | ||
| 405 | |||
| 406 | <br style="clear: both" /> | ||
| 407 | |||
| 408 | <div class="panel_wrapper"> | ||
| 409 | <div id="style_props_panel" class="panel current"> | ||
| 410 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 411 | <tr> | ||
| 412 | <td class="column1"><label for="element_style_type">{#fullpage_dlg.type}</label></td> | ||
| 413 | <td><select id="element_style_type"> | ||
| 414 | <option value="text/css">text/css</option> | ||
| 415 | </select></td> | ||
| 416 | </tr> | ||
| 417 | <tr> | ||
| 418 | <td class="column1"><label for="element_style_media">{#fullpage_dlg.media}</label></td> | ||
| 419 | <td><select id="element_style_media"></select></td> | ||
| 420 | </tr> | ||
| 421 | </table> | ||
| 422 | </div> | ||
| 423 | |||
| 424 | <div id="style_value_panel" class="panel"> | ||
| 425 | <textarea id="element_style_value"></textarea> | ||
| 426 | </div> | ||
| 427 | </div> | ||
| 428 | |||
| 429 | <input type="button" id="style_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 430 | </fieldset> | ||
| 431 | |||
| 432 | <fieldset id="base_element"> | ||
| 433 | <legend>{#fullpage_dlg.base_element}</legend> | ||
| 434 | |||
| 435 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 436 | <tr> | ||
| 437 | <td class="column1"><label for="element_base_href">{#fullpage_dlg.href}</label></td> | ||
| 438 | <td><input id="element_base_href" name="element_base_href" type="text" value="" /></td> | ||
| 439 | </tr> | ||
| 440 | <tr> | ||
| 441 | <td class="column1"><label for="element_base_target">{#fullpage_dlg.target}</label></td> | ||
| 442 | <td><input id="element_base_target" name="element_base_target" type="text" value="" /></td> | ||
| 443 | </tr> | ||
| 444 | </table> | ||
| 445 | |||
| 446 | <input type="button" id="base_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 447 | </fieldset> | ||
| 448 | |||
| 449 | <fieldset id="link_element"> | ||
| 450 | <legend>{#fullpage_dlg.link_element}</legend> | ||
| 451 | |||
| 452 | <div class="tabs"> | ||
| 453 | <ul> | ||
| 454 | <li id="link_general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('link_general_tab','link_general_panel');" onmousedown="return false;">{#fullpage_dlg.general_props}</a></span></li> | ||
| 455 | <li id="link_advanced_tab"><span><a href="javascript:mcTabs.displayTab('link_advanced_tab','link_advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_props}</a></span></li> | ||
| 456 | </ul> | ||
| 457 | </div> | ||
| 458 | |||
| 459 | <br style="clear: both" /> | ||
| 460 | |||
| 461 | <div class="panel_wrapper"> | ||
| 462 | <div id="link_general_panel" class="panel current"> | ||
| 463 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 464 | <tr> | ||
| 465 | <td class="column1"><label for="element_link_href">{#fullpage_dlg.href}</label></td> | ||
| 466 | <td><table border="0" cellpadding="0" cellspacing="0"> | ||
| 467 | <tr> | ||
| 468 | <td><input id="element_link_href" name="element_link_href" type="text" value="" /></td> | ||
| 469 | <td id="link_href_pickcontainer"> </td> | ||
| 470 | </tr> | ||
| 471 | </table></td> | ||
| 472 | </tr> | ||
| 473 | <tr> | ||
| 474 | <td class="column1"><label for="element_link_title">{#fullpage_dlg.meta_title}</label></td> | ||
| 475 | <td><input id="element_link_title" name="element_link_title" type="text" value="" /></td> | ||
| 476 | </tr> | ||
| 477 | <tr> | ||
| 478 | <td class="column1"><label for="element_link_type">{#fullpage_dlg.type}</label></td> | ||
| 479 | <td><select id="element_link_type" name="element_link_type"> | ||
| 480 | <option value="text/css">text/css</option> | ||
| 481 | <option value="text/javascript">text/javascript</option> | ||
| 482 | </select></td> | ||
| 483 | </tr> | ||
| 484 | <tr> | ||
| 485 | <td class="column1"><label for="element_link_media">{#fullpage_dlg.media}</label></td> | ||
| 486 | <td><select id="element_link_media" name="element_link_media"></select></td> | ||
| 487 | </tr> | ||
| 488 | <tr> | ||
| 489 | <td><label for="element_style_rel">{#fullpage_dlg.rel}</label></td> | ||
| 490 | <td><select id="element_style_rel" name="element_style_rel"> | ||
| 491 | <option value="">{#not_set}</option> | ||
| 492 | <option value="stylesheet">Stylesheet</option> | ||
| 493 | <option value="alternate">Alternate</option> | ||
| 494 | <option value="designates">Designates</option> | ||
| 495 | <option value="start">Start</option> | ||
| 496 | <option value="next">Next</option> | ||
| 497 | <option value="prev">Prev</option> | ||
| 498 | <option value="contents">Contents</option> | ||
| 499 | <option value="index">Index</option> | ||
| 500 | <option value="glossary">Glossary</option> | ||
| 501 | <option value="copyright">Copyright</option> | ||
| 502 | <option value="chapter">Chapter</option> | ||
| 503 | <option value="subsection">Subsection</option> | ||
| 504 | <option value="appendix">Appendix</option> | ||
| 505 | <option value="help">Help</option> | ||
| 506 | <option value="bookmark">Bookmark</option> | ||
| 507 | </select> | ||
| 508 | </td> | ||
| 509 | </tr> | ||
| 510 | </table> | ||
| 511 | </div> | ||
| 512 | |||
| 513 | <div id="link_advanced_panel" class="panel"> | ||
| 514 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 515 | <tr> | ||
| 516 | <td class="column1"><label for="element_link_charset">{#fullpage_dlg.charset}</label></td> | ||
| 517 | <td><select id="element_link_charset"><option value="">{#not_set}</option></select></td> | ||
| 518 | </tr> | ||
| 519 | <tr> | ||
| 520 | <td class="column1"><label for="element_link_hreflang">{#fullpage_dlg.hreflang}</label></td> | ||
| 521 | <td><input id="element_link_hreflang" name="element_link_hreflang" type="text" value="" /></td> | ||
| 522 | </tr> | ||
| 523 | <tr> | ||
| 524 | <td class="column1"><label for="element_link_target">{#fullpage_dlg.target}</label></td> | ||
| 525 | <td><input id="element_link_target" name="element_link_target" type="text" value="" /></td> | ||
| 526 | </tr> | ||
| 527 | <tr> | ||
| 528 | <td><label for="element_style_rev">{#fullpage_dlg.rev}</label></td> | ||
| 529 | <td><select id="element_style_rev" name="element_style_rev"> | ||
| 530 | <option value="">{#not_set}</option> | ||
| 531 | <option value="alternate">Alternate</option> | ||
| 532 | <option value="designates">Designates</option> | ||
| 533 | <option value="stylesheet">Stylesheet</option> | ||
| 534 | <option value="start">Start</option> | ||
| 535 | <option value="next">Next</option> | ||
| 536 | <option value="prev">Prev</option> | ||
| 537 | <option value="contents">Contents</option> | ||
| 538 | <option value="index">Index</option> | ||
| 539 | <option value="glossary">Glossary</option> | ||
| 540 | <option value="copyright">Copyright</option> | ||
| 541 | <option value="chapter">Chapter</option> | ||
| 542 | <option value="subsection">Subsection</option> | ||
| 543 | <option value="appendix">Appendix</option> | ||
| 544 | <option value="help">Help</option> | ||
| 545 | <option value="bookmark">Bookmark</option> | ||
| 546 | </select> | ||
| 547 | </td> | ||
| 548 | </tr> | ||
| 549 | </table> | ||
| 550 | </div> | ||
| 551 | </div> | ||
| 552 | |||
| 553 | <input type="button" id="link_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 554 | </fieldset> | ||
| 555 | |||
| 556 | <fieldset id="comment_element"> | ||
| 557 | <legend>{#fullpage_dlg.comment_element}</legend> | ||
| 558 | |||
| 559 | <textarea id="element_comment_value"></textarea> | ||
| 560 | |||
| 561 | <input type="button" id="comment_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 562 | </fieldset> | ||
| 563 | </div> | ||
| 564 | </div> | ||
| 565 | |||
| 566 | <div class="mceActionPanel"> | ||
| 567 | <div style="float: left"> | ||
| 568 | <input type="submit" id="insert" name="update" value="{#update}" /> | ||
| 569 | </div> | ||
| 570 | |||
| 571 | <div style="float: right"> | ||
| 572 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 573 | </div> | ||
| 574 | </div> | ||
| 575 | </form> | ||
| 576 | </body> | ||
| 577 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js b/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js new file mode 100755 index 0000000..89059ef --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js | |||
| @@ -0,0 +1,461 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var doc; | ||
| 4 | |||
| 5 | var defaultDocTypes = | ||
| 6 | 'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' + | ||
| 7 | 'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' + | ||
| 8 | 'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' + | ||
| 9 | 'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' + | ||
| 10 | 'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' + | ||
| 11 | 'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' + | ||
| 12 | 'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'; | ||
| 13 | |||
| 14 | var defaultEncodings = | ||
| 15 | 'Western european (iso-8859-1)=iso-8859-1,' + | ||
| 16 | 'Central European (iso-8859-2)=iso-8859-2,' + | ||
| 17 | 'Unicode (UTF-8)=utf-8,' + | ||
| 18 | 'Chinese traditional (Big5)=big5,' + | ||
| 19 | 'Cyrillic (iso-8859-5)=iso-8859-5,' + | ||
| 20 | 'Japanese (iso-2022-jp)=iso-2022-jp,' + | ||
| 21 | 'Greek (iso-8859-7)=iso-8859-7,' + | ||
| 22 | 'Korean (iso-2022-kr)=iso-2022-kr,' + | ||
| 23 | 'ASCII (us-ascii)=us-ascii'; | ||
| 24 | |||
| 25 | var defaultMediaTypes = | ||
| 26 | 'all=all,' + | ||
| 27 | 'screen=screen,' + | ||
| 28 | 'print=print,' + | ||
| 29 | 'tty=tty,' + | ||
| 30 | 'tv=tv,' + | ||
| 31 | 'projection=projection,' + | ||
| 32 | 'handheld=handheld,' + | ||
| 33 | 'braille=braille,' + | ||
| 34 | 'aural=aural'; | ||
| 35 | |||
| 36 | var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; | ||
| 37 | var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; | ||
| 38 | |||
| 39 | function init() { | ||
| 40 | var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style; | ||
| 41 | |||
| 42 | // Setup doctype select box | ||
| 43 | doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(','); | ||
| 44 | for (i=0; i<doctypes.length; i++) { | ||
| 45 | p = doctypes[i].split('='); | ||
| 46 | |||
| 47 | if (p.length > 1) | ||
| 48 | addSelectValue(f, 'doctypes', p[0], p[1]); | ||
| 49 | } | ||
| 50 | |||
| 51 | // Setup fonts select box | ||
| 52 | fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';'); | ||
| 53 | for (i=0; i<fonts.length; i++) { | ||
| 54 | p = fonts[i].split('='); | ||
| 55 | |||
| 56 | if (p.length > 1) | ||
| 57 | addSelectValue(f, 'fontface', p[0], p[1]); | ||
| 58 | } | ||
| 59 | |||
| 60 | // Setup fontsize select box | ||
| 61 | fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(','); | ||
| 62 | for (i=0; i<fonts.length; i++) | ||
| 63 | addSelectValue(f, 'fontsize', fonts[i], fonts[i]); | ||
| 64 | |||
| 65 | // Setup mediatype select boxs | ||
| 66 | mediaTypes = ed.getParam("fullpage_media_types", defaultMediaTypes).split(','); | ||
| 67 | for (i=0; i<mediaTypes.length; i++) { | ||
| 68 | p = mediaTypes[i].split('='); | ||
| 69 | |||
| 70 | if (p.length > 1) { | ||
| 71 | addSelectValue(f, 'element_style_media', p[0], p[1]); | ||
| 72 | addSelectValue(f, 'element_link_media', p[0], p[1]); | ||
| 73 | } | ||
| 74 | } | ||
| 75 | |||
| 76 | // Setup encodings select box | ||
| 77 | encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(','); | ||
| 78 | for (i=0; i<encodings.length; i++) { | ||
| 79 | p = encodings[i].split('='); | ||
| 80 | |||
| 81 | if (p.length > 1) { | ||
| 82 | addSelectValue(f, 'docencoding', p[0], p[1]); | ||
| 83 | addSelectValue(f, 'element_script_charset', p[0], p[1]); | ||
| 84 | addSelectValue(f, 'element_link_charset', p[0], p[1]); | ||
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 88 | document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); | ||
| 89 | document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); | ||
| 90 | //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color'); | ||
| 91 | document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); | ||
| 92 | document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); | ||
| 93 | document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); | ||
| 94 | document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); | ||
| 95 | document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage'); | ||
| 96 | document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage'); | ||
| 97 | document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); | ||
| 98 | |||
| 99 | // Resize some elements | ||
| 100 | if (isVisible('stylesheetbrowser')) | ||
| 101 | document.getElementById('stylesheet').style.width = '220px'; | ||
| 102 | |||
| 103 | if (isVisible('link_href_browser')) | ||
| 104 | document.getElementById('element_link_href').style.width = '230px'; | ||
| 105 | |||
| 106 | if (isVisible('bgimage_browser')) | ||
| 107 | document.getElementById('bgimage').style.width = '210px'; | ||
| 108 | |||
| 109 | // Add iframe | ||
| 110 | dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}}); | ||
| 111 | doc = dom.get('documentIframe').contentWindow.document; | ||
| 112 | h = tinyMCEPopup.getWindowArg('head_html'); | ||
| 113 | |||
| 114 | // Preprocess the HTML disable scripts and urls | ||
| 115 | h = h.replace(/<script>/gi, '<script type="text/javascript">'); | ||
| 116 | h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-'); | ||
| 117 | h = h.replace(/(src=|href=)/g, 'mce_$1'); | ||
| 118 | |||
| 119 | // Write in the content in the iframe | ||
| 120 | doc.write(h + '</body></html>'); | ||
| 121 | doc.close(); | ||
| 122 | |||
| 123 | // Parse xml and doctype | ||
| 124 | xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1); | ||
| 125 | xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1); | ||
| 126 | docType = getReItem(/<\!DOCTYPE.*?>/gi, h, 0); | ||
| 127 | f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1); | ||
| 128 | |||
| 129 | // Parse title | ||
| 130 | if (e = doc.getElementsByTagName('title')[0]) | ||
| 131 | el.metatitle.value = e.textContent || e.text; | ||
| 132 | |||
| 133 | // Parse meta | ||
| 134 | tinymce.each(doc.getElementsByTagName('meta'), function(n) { | ||
| 135 | var na = (n.getAttribute('name', 2) || '').toLowerCase(), va = n.getAttribute('content', 2), eq = n.getAttribute('httpEquiv', 2) || ''; | ||
| 136 | |||
| 137 | e = el['meta' + na]; | ||
| 138 | |||
| 139 | if (na == 'robots') { | ||
| 140 | selectByValue(f, 'metarobots', tinymce.trim(va), true, true); | ||
| 141 | return; | ||
| 142 | } | ||
| 143 | |||
| 144 | switch (eq.toLowerCase()) { | ||
| 145 | case "content-type": | ||
| 146 | tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1); | ||
| 147 | |||
| 148 | // Override XML encoding | ||
| 149 | if (tmp != "") | ||
| 150 | xmlEnc = tmp; | ||
| 151 | |||
| 152 | return; | ||
| 153 | } | ||
| 154 | |||
| 155 | if (e) | ||
| 156 | e.value = va; | ||
| 157 | }); | ||
| 158 | |||
| 159 | selectByValue(f, 'doctypes', docType, true, true); | ||
| 160 | selectByValue(f, 'docencoding', xmlEnc, true, true); | ||
| 161 | selectByValue(f, 'langdir', doc.body.getAttribute('dir', 2) || '', true, true); | ||
| 162 | |||
| 163 | if (xmlVer != '') | ||
| 164 | el.xml_pi.checked = true; | ||
| 165 | |||
| 166 | // Parse appearance | ||
| 167 | |||
| 168 | // Parse primary stylesheet | ||
| 169 | tinymce.each(doc.getElementsByTagName("link"), function(l) { | ||
| 170 | var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || ''; | ||
| 171 | |||
| 172 | if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") { | ||
| 173 | f.stylesheet.value = l.getAttribute('mce_href', 2) || ''; | ||
| 174 | return false; | ||
| 175 | } | ||
| 176 | }); | ||
| 177 | |||
| 178 | // Get from style elements | ||
| 179 | tinymce.each(doc.getElementsByTagName("style"), function(st) { | ||
| 180 | var tmp = parseStyleElement(st); | ||
| 181 | |||
| 182 | for (x=0; x<tmp.length; x++) { | ||
| 183 | if (tmp[x].rule.indexOf('a:visited') != -1 && tmp[x].data['color']) | ||
| 184 | f.visited_color.value = tmp[x].data['color']; | ||
| 185 | |||
| 186 | if (tmp[x].rule.indexOf('a:link') != -1 && tmp[x].data['color']) | ||
| 187 | f.link_color.value = tmp[x].data['color']; | ||
| 188 | |||
| 189 | if (tmp[x].rule.indexOf('a:active') != -1 && tmp[x].data['color']) | ||
| 190 | f.active_color.value = tmp[x].data['color']; | ||
| 191 | } | ||
| 192 | }); | ||
| 193 | |||
| 194 | f.textcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "text"); | ||
| 195 | f.active_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "alink"); | ||
| 196 | f.link_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "link"); | ||
| 197 | f.visited_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "vlink"); | ||
| 198 | f.bgcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "bgcolor"); | ||
| 199 | f.bgimage.value = tinyMCEPopup.dom.getAttrib(doc.body, "background"); | ||
| 200 | |||
| 201 | // Get from style info | ||
| 202 | style = tinyMCEPopup.dom.parseStyle(tinyMCEPopup.dom.getAttrib(doc.body, 'style')); | ||
| 203 | |||
| 204 | if (style['font-family']) | ||
| 205 | selectByValue(f, 'fontface', style['font-family'], true, true); | ||
| 206 | else | ||
| 207 | selectByValue(f, 'fontface', ed.getParam("fullpage_default_fontface", ""), true, true); | ||
| 208 | |||
| 209 | if (style['font-size']) | ||
| 210 | selectByValue(f, 'fontsize', style['font-size'], true, true); | ||
| 211 | else | ||
| 212 | selectByValue(f, 'fontsize', ed.getParam("fullpage_default_fontsize", ""), true, true); | ||
| 213 | |||
| 214 | if (style['color']) | ||
| 215 | f.textcolor.value = convertRGBToHex(style['color']); | ||
| 216 | |||
| 217 | if (style['background-image']) | ||
| 218 | f.bgimage.value = style['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 219 | |||
| 220 | if (style['background-color']) | ||
| 221 | f.bgcolor.value = style['background-color']; | ||
| 222 | |||
| 223 | if (style['margin']) { | ||
| 224 | tmp = style['margin'].replace(/[^0-9 ]/g, ''); | ||
| 225 | tmp = tmp.split(/ +/); | ||
| 226 | f.topmargin.value = tmp.length > 0 ? tmp[0] : ''; | ||
| 227 | f.rightmargin.value = tmp.length > 1 ? tmp[1] : tmp[0]; | ||
| 228 | f.bottommargin.value = tmp.length > 2 ? tmp[2] : tmp[0]; | ||
| 229 | f.leftmargin.value = tmp.length > 3 ? tmp[3] : tmp[0]; | ||
| 230 | } | ||
| 231 | |||
| 232 | if (style['margin-left']) | ||
| 233 | f.leftmargin.value = style['margin-left'].replace(/[^0-9]/g, ''); | ||
| 234 | |||
| 235 | if (style['margin-right']) | ||
| 236 | f.rightmargin.value = style['margin-right'].replace(/[^0-9]/g, ''); | ||
| 237 | |||
| 238 | if (style['margin-top']) | ||
| 239 | f.topmargin.value = style['margin-top'].replace(/[^0-9]/g, ''); | ||
| 240 | |||
| 241 | if (style['margin-bottom']) | ||
| 242 | f.bottommargin.value = style['margin-bottom'].replace(/[^0-9]/g, ''); | ||
| 243 | |||
| 244 | f.style.value = tinyMCEPopup.dom.serializeStyle(style); | ||
| 245 | |||
| 246 | // Update colors | ||
| 247 | updateColor('textcolor_pick', 'textcolor'); | ||
| 248 | updateColor('bgcolor_pick', 'bgcolor'); | ||
| 249 | updateColor('visited_color_pick', 'visited_color'); | ||
| 250 | updateColor('active_color_pick', 'active_color'); | ||
| 251 | updateColor('link_color_pick', 'link_color'); | ||
| 252 | } | ||
| 253 | |||
| 254 | function getReItem(r, s, i) { | ||
| 255 | var c = r.exec(s); | ||
| 256 | |||
| 257 | if (c && c.length > i) | ||
| 258 | return c[i]; | ||
| 259 | |||
| 260 | return ''; | ||
| 261 | } | ||
| 262 | |||
| 263 | function updateAction() { | ||
| 264 | var f = document.forms[0], nl, i, h, v, s, head, html, l, tmp, addlink = true, ser; | ||
| 265 | |||
| 266 | head = doc.getElementsByTagName('head')[0]; | ||
| 267 | |||
| 268 | // Fix scripts without a type | ||
| 269 | nl = doc.getElementsByTagName('script'); | ||
| 270 | for (i=0; i<nl.length; i++) { | ||
| 271 | if (tinyMCEPopup.dom.getAttrib(nl[i], 'mce_type') == '') | ||
| 272 | nl[i].setAttribute('mce_type', 'text/javascript'); | ||
| 273 | } | ||
| 274 | |||
| 275 | // Get primary stylesheet | ||
| 276 | nl = doc.getElementsByTagName("link"); | ||
| 277 | for (i=0; i<nl.length; i++) { | ||
| 278 | l = nl[i]; | ||
| 279 | |||
| 280 | tmp = tinyMCEPopup.dom.getAttrib(l, 'media'); | ||
| 281 | |||
| 282 | if (tinyMCEPopup.dom.getAttrib(l, 'mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") { | ||
| 283 | addlink = false; | ||
| 284 | |||
| 285 | if (f.stylesheet.value == '') | ||
| 286 | l.parentNode.removeChild(l); | ||
| 287 | else | ||
| 288 | l.setAttribute('mce_href', f.stylesheet.value); | ||
| 289 | |||
| 290 | break; | ||
| 291 | } | ||
| 292 | } | ||
| 293 | |||
| 294 | // Add new link | ||
| 295 | if (f.stylesheet.value != '') { | ||
| 296 | l = doc.createElement('link'); | ||
| 297 | |||
| 298 | l.setAttribute('type', 'text/css'); | ||
| 299 | l.setAttribute('mce_href', f.stylesheet.value); | ||
| 300 | l.setAttribute('rel', 'stylesheet'); | ||
| 301 | |||
| 302 | head.appendChild(l); | ||
| 303 | } | ||
| 304 | |||
| 305 | setMeta(head, 'keywords', f.metakeywords.value); | ||
| 306 | setMeta(head, 'description', f.metadescription.value); | ||
| 307 | setMeta(head, 'author', f.metaauthor.value); | ||
| 308 | setMeta(head, 'copyright', f.metacopyright.value); | ||
| 309 | setMeta(head, 'robots', getSelectValue(f, 'metarobots')); | ||
| 310 | setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding')); | ||
| 311 | |||
| 312 | doc.body.dir = getSelectValue(f, 'langdir'); | ||
| 313 | doc.body.style.cssText = f.style.value; | ||
| 314 | |||
| 315 | doc.body.setAttribute('vLink', f.visited_color.value); | ||
| 316 | doc.body.setAttribute('link', f.link_color.value); | ||
| 317 | doc.body.setAttribute('text', f.textcolor.value); | ||
| 318 | doc.body.setAttribute('aLink', f.active_color.value); | ||
| 319 | |||
| 320 | doc.body.style.fontFamily = getSelectValue(f, 'fontface'); | ||
| 321 | doc.body.style.fontSize = getSelectValue(f, 'fontsize'); | ||
| 322 | doc.body.style.backgroundColor = f.bgcolor.value; | ||
| 323 | |||
| 324 | if (f.leftmargin.value != '') | ||
| 325 | doc.body.style.marginLeft = f.leftmargin.value + 'px'; | ||
| 326 | |||
| 327 | if (f.rightmargin.value != '') | ||
| 328 | doc.body.style.marginRight = f.rightmargin.value + 'px'; | ||
| 329 | |||
| 330 | if (f.bottommargin.value != '') | ||
| 331 | doc.body.style.marginBottom = f.bottommargin.value + 'px'; | ||
| 332 | |||
| 333 | if (f.topmargin.value != '') | ||
| 334 | doc.body.style.marginTop = f.topmargin.value + 'px'; | ||
| 335 | |||
| 336 | html = doc.getElementsByTagName('html')[0]; | ||
| 337 | html.setAttribute('lang', f.langcode.value); | ||
| 338 | html.setAttribute('xml:lang', f.langcode.value); | ||
| 339 | |||
| 340 | if (f.bgimage.value != '') | ||
| 341 | doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')"; | ||
| 342 | else | ||
| 343 | doc.body.style.backgroundImage = ''; | ||
| 344 | |||
| 345 | ser = tinyMCEPopup.editor.plugins.fullpage._createSerializer(); | ||
| 346 | ser.setRules('-title,meta[http-equiv|name|content],base[href|target],link[href|rel|type|title|media],style[type],script[type|language|src],html[lang|xml::lang|xmlns],body[style|dir|vlink|link|text|alink],head'); | ||
| 347 | |||
| 348 | h = ser.serialize(doc.documentElement); | ||
| 349 | h = h.substring(0, h.lastIndexOf('</body>')); | ||
| 350 | |||
| 351 | if (h.indexOf('<title>') == -1) | ||
| 352 | h = h.replace(/<head.*?>/, '$&\n' + '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>'); | ||
| 353 | else | ||
| 354 | h = h.replace(/<title>(.*?)<\/title>/, '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>'); | ||
| 355 | |||
| 356 | if ((v = getSelectValue(f, 'doctypes')) != '') | ||
| 357 | h = v + '\n' + h; | ||
| 358 | |||
| 359 | if (f.xml_pi.checked) { | ||
| 360 | s = '<?xml version="1.0"'; | ||
| 361 | |||
| 362 | if ((v = getSelectValue(f, 'docencoding')) != '') | ||
| 363 | s += ' encoding="' + v + '"'; | ||
| 364 | |||
| 365 | s += '?>\n'; | ||
| 366 | h = s + h; | ||
| 367 | } | ||
| 368 | |||
| 369 | h = h.replace(/type=\"\-mce\-/gi, 'type="'); | ||
| 370 | |||
| 371 | tinyMCEPopup.editor.plugins.fullpage.head = h; | ||
| 372 | tinyMCEPopup.editor.plugins.fullpage._setBodyAttribs(tinyMCEPopup.editor, {}); | ||
| 373 | tinyMCEPopup.close(); | ||
| 374 | } | ||
| 375 | |||
| 376 | function changedStyleField(field) { | ||
| 377 | } | ||
| 378 | |||
| 379 | function setMeta(he, k, v) { | ||
| 380 | var nl, i, m; | ||
| 381 | |||
| 382 | nl = he.getElementsByTagName('meta'); | ||
| 383 | for (i=0; i<nl.length; i++) { | ||
| 384 | if (k == 'Content-Type' && tinyMCEPopup.dom.getAttrib(nl[i], 'http-equiv') == k) { | ||
| 385 | if (v == '') | ||
| 386 | nl[i].parentNode.removeChild(nl[i]); | ||
| 387 | else | ||
| 388 | nl[i].setAttribute('content', "text/html; charset=" + v); | ||
| 389 | |||
| 390 | return; | ||
| 391 | } | ||
| 392 | |||
| 393 | if (tinyMCEPopup.dom.getAttrib(nl[i], 'name') == k) { | ||
| 394 | if (v == '') | ||
| 395 | nl[i].parentNode.removeChild(nl[i]); | ||
| 396 | else | ||
| 397 | nl[i].setAttribute('content', v); | ||
| 398 | return; | ||
| 399 | } | ||
| 400 | } | ||
| 401 | |||
| 402 | if (v == '') | ||
| 403 | return; | ||
| 404 | |||
| 405 | m = doc.createElement('meta'); | ||
| 406 | |||
| 407 | if (k == 'Content-Type') | ||
| 408 | m.httpEquiv = k; | ||
| 409 | else | ||
| 410 | m.setAttribute('name', k); | ||
| 411 | |||
| 412 | m.setAttribute('content', v); | ||
| 413 | he.appendChild(m); | ||
| 414 | } | ||
| 415 | |||
| 416 | function parseStyleElement(e) { | ||
| 417 | var v = e.innerHTML; | ||
| 418 | var p, i, r; | ||
| 419 | |||
| 420 | v = v.replace(/<!--/gi, ''); | ||
| 421 | v = v.replace(/-->/gi, ''); | ||
| 422 | v = v.replace(/[\n\r]/gi, ''); | ||
| 423 | v = v.replace(/\s+/gi, ' '); | ||
| 424 | |||
| 425 | r = []; | ||
| 426 | p = v.split(/{|}/); | ||
| 427 | |||
| 428 | for (i=0; i<p.length; i+=2) { | ||
| 429 | if (p[i] != "") | ||
| 430 | r[r.length] = {rule : tinymce.trim(p[i]), data : tinyMCEPopup.dom.parseStyle(p[i+1])}; | ||
| 431 | } | ||
| 432 | |||
| 433 | return r; | ||
| 434 | } | ||
| 435 | |||
| 436 | function serializeStyleElement(d) { | ||
| 437 | var i, s, st; | ||
| 438 | |||
| 439 | s = '<!--\n'; | ||
| 440 | |||
| 441 | for (i=0; i<d.length; i++) { | ||
| 442 | s += d[i].rule + ' {\n'; | ||
| 443 | |||
| 444 | st = tinyMCE.serializeStyle(d[i].data); | ||
| 445 | |||
| 446 | if (st != '') | ||
| 447 | st += ';'; | ||
| 448 | |||
| 449 | s += st.replace(/;/g, ';\n'); | ||
| 450 | s += '}\n'; | ||
| 451 | |||
| 452 | if (i != d.length - 1) | ||
| 453 | s += '\n'; | ||
| 454 | } | ||
| 455 | |||
| 456 | s += '\n-->'; | ||
| 457 | |||
| 458 | return s; | ||
| 459 | } | ||
| 460 | |||
| 461 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js new file mode 100755 index 0000000..f5801b8 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | tinyMCE.addI18n('en.fullpage_dlg',{ | ||
| 2 | title:"Document properties", | ||
| 3 | meta_tab:"General", | ||
| 4 | appearance_tab:"Appearance", | ||
| 5 | advanced_tab:"Advanced", | ||
| 6 | meta_props:"Meta information", | ||
| 7 | langprops:"Language and encoding", | ||
| 8 | meta_title:"Title", | ||
| 9 | meta_keywords:"Keywords", | ||
| 10 | meta_description:"Description", | ||
| 11 | meta_robots:"Robots", | ||
| 12 | doctypes:"Doctype", | ||
| 13 | langcode:"Language code", | ||
| 14 | langdir:"Language direction", | ||
| 15 | ltr:"Left to right", | ||
| 16 | rtl:"Right to left", | ||
| 17 | xml_pi:"XML declaration", | ||
| 18 | encoding:"Character encoding", | ||
| 19 | appearance_bgprops:"Background properties", | ||
| 20 | appearance_marginprops:"Body margins", | ||
| 21 | appearance_linkprops:"Link colors", | ||
| 22 | appearance_textprops:"Text properties", | ||
| 23 | bgcolor:"Background color", | ||
| 24 | bgimage:"Background image", | ||
| 25 | left_margin:"Left margin", | ||
| 26 | right_margin:"Right margin", | ||
| 27 | top_margin:"Top margin", | ||
| 28 | bottom_margin:"Bottom margin", | ||
| 29 | text_color:"Text color", | ||
| 30 | font_size:"Font size", | ||
| 31 | font_face:"Font face", | ||
| 32 | link_color:"Link color", | ||
| 33 | hover_color:"Hover color", | ||
| 34 | visited_color:"Visited color", | ||
| 35 | active_color:"Active color", | ||
| 36 | textcolor:"Color", | ||
| 37 | fontsize:"Font size", | ||
| 38 | fontface:"Font family", | ||
| 39 | meta_index_follow:"Index and follow the links", | ||
| 40 | meta_index_nofollow:"Index and don't follow the links", | ||
| 41 | meta_noindex_follow:"Do not index but follow the links", | ||
| 42 | meta_noindex_nofollow:"Do not index and don\'t follow the links", | ||
| 43 | appearance_style:"Stylesheet and style properties", | ||
| 44 | stylesheet:"Stylesheet", | ||
| 45 | style:"Style", | ||
| 46 | author:"Author", | ||
| 47 | copyright:"Copyright", | ||
| 48 | add:"Add new element", | ||
| 49 | remove:"Remove selected element", | ||
| 50 | moveup:"Move selected element up", | ||
| 51 | movedown:"Move selected element down", | ||
| 52 | head_elements:"Head elements", | ||
| 53 | info:"Information", | ||
| 54 | add_title:"Title element", | ||
| 55 | add_meta:"Meta element", | ||
| 56 | add_script:"Script element", | ||
| 57 | add_style:"Style element", | ||
| 58 | add_link:"Link element", | ||
| 59 | add_base:"Base element", | ||
| 60 | add_comment:"Comment node", | ||
| 61 | title_element:"Title element", | ||
| 62 | script_element:"Script element", | ||
| 63 | style_element:"Style element", | ||
| 64 | base_element:"Base element", | ||
| 65 | link_element:"Link element", | ||
| 66 | meta_element:"Meta element", | ||
| 67 | comment_element:"Comment", | ||
| 68 | src:"Src", | ||
| 69 | language:"Language", | ||
| 70 | href:"Href", | ||
| 71 | target:"Target", | ||
| 72 | type:"Type", | ||
| 73 | charset:"Charset", | ||
| 74 | defer:"Defer", | ||
| 75 | media:"Media", | ||
| 76 | properties:"Properties", | ||
| 77 | name:"Name", | ||
| 78 | value:"Value", | ||
| 79 | content:"Content", | ||
| 80 | rel:"Rel", | ||
| 81 | rev:"Rev", | ||
| 82 | hreflang:"Href lang", | ||
| 83 | general_props:"General", | ||
| 84 | advanced_props:"Advanced" | ||
| 85 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js b/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js new file mode 100755 index 0000000..fbcec59 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=DOM.doc.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{DOM.win.setTimeout(function(){tinymce.dom.Event.remove(DOM.win,'resize',t.resizeFunc);tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(DOM.doc.body,'overflow',ed.getParam('fullscreen_overflow'));DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));tinyMCE.settings=tinyMCE.oldSettings;},10);}return;}if(ed.getParam('fullscreen_new_window')){win=DOM.win.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{tinyMCE.oldSettings=tinyMCE.settings;s.fullscreen_overflow=DOM.getStyle(DOM.doc.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(tinymce.isIE&&(s.fullscreen_html_overflow=='visible'||s.fullscreen_html_overflow=='scroll'))s.fullscreen_html_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(DOM.doc.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();DOM.win.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(DOM.doc.body,'div',{id:'mce_fullscreen_container',style:'position:'+(tinymce.isIE6||(tinymce.isIE&&!DOM.boxModel)?'absolute':'fixed')+';top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:200000;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;s.save_onsavecallback=function(){ed.setContent(tinyMCE.get(s.id).getContent({format:'raw'}),{format:'raw'});ed.execCommand('mceSave');};tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent());t.fullscreenEditor.focus();});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();t.resizeFunc=tinymce.dom.Event.add(DOM.win,'resize',function(){var vp=tinymce.DOM.getViewPort();t.fullscreenEditor.theme.resizeTo(vp.w,vp.h);});}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js new file mode 100755 index 0000000..77a8c3b --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js | |||
| @@ -0,0 +1,145 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 923 2008-09-09 16:45:29Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var DOM = tinymce.DOM; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.FullScreenPlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this, s = {}, vp; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | |||
| 17 | // Register commands | ||
| 18 | ed.addCommand('mceFullScreen', function() { | ||
| 19 | var win, de = DOM.doc.documentElement; | ||
| 20 | |||
| 21 | if (ed.getParam('fullscreen_is_enabled')) { | ||
| 22 | if (ed.getParam('fullscreen_new_window')) | ||
| 23 | closeFullscreen(); // Call to close in new window | ||
| 24 | else { | ||
| 25 | DOM.win.setTimeout(function() { | ||
| 26 | tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); | ||
| 27 | tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'}); | ||
| 28 | tinyMCE.remove(ed); | ||
| 29 | DOM.remove('mce_fullscreen_container'); | ||
| 30 | de.style.overflow = ed.getParam('fullscreen_html_overflow'); | ||
| 31 | DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow')); | ||
| 32 | DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); | ||
| 33 | tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings | ||
| 34 | }, 10); | ||
| 35 | } | ||
| 36 | |||
| 37 | return; | ||
| 38 | } | ||
| 39 | |||
| 40 | if (ed.getParam('fullscreen_new_window')) { | ||
| 41 | win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); | ||
| 42 | try { | ||
| 43 | win.resizeTo(screen.availWidth, screen.availHeight); | ||
| 44 | } catch (e) { | ||
| 45 | // Ignore | ||
| 46 | } | ||
| 47 | } else { | ||
| 48 | tinyMCE.oldSettings = tinyMCE.settings; // Store old settings | ||
| 49 | s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto'; | ||
| 50 | s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); | ||
| 51 | vp = DOM.getViewPort(); | ||
| 52 | s.fullscreen_scrollx = vp.x; | ||
| 53 | s.fullscreen_scrolly = vp.y; | ||
| 54 | |||
| 55 | // Fixes an Opera bug where the scrollbars doesn't reappear | ||
| 56 | if (tinymce.isOpera && s.fullscreen_overflow == 'visible') | ||
| 57 | s.fullscreen_overflow = 'auto'; | ||
| 58 | |||
| 59 | // Fixes an IE bug where horizontal scrollbars would appear | ||
| 60 | if (tinymce.isIE && s.fullscreen_overflow == 'scroll') | ||
| 61 | s.fullscreen_overflow = 'auto'; | ||
| 62 | |||
| 63 | // Fixes an IE bug where the scrollbars doesn't reappear | ||
| 64 | if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll')) | ||
| 65 | s.fullscreen_html_overflow = 'auto'; | ||
| 66 | |||
| 67 | if (s.fullscreen_overflow == '0px') | ||
| 68 | s.fullscreen_overflow = ''; | ||
| 69 | |||
| 70 | DOM.setStyle(DOM.doc.body, 'overflow', 'hidden'); | ||
| 71 | de.style.overflow = 'hidden'; //Fix for IE6/7 | ||
| 72 | vp = DOM.getViewPort(); | ||
| 73 | DOM.win.scrollTo(0, 0); | ||
| 74 | |||
| 75 | if (tinymce.isIE) | ||
| 76 | vp.h -= 1; | ||
| 77 | |||
| 78 | n = DOM.add(DOM.doc.body, 'div', {id : 'mce_fullscreen_container', style : 'position:' + (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel) ? 'absolute' : 'fixed') + ';top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'}); | ||
| 79 | DOM.add(n, 'div', {id : 'mce_fullscreen'}); | ||
| 80 | |||
| 81 | tinymce.each(ed.settings, function(v, n) { | ||
| 82 | s[n] = v; | ||
| 83 | }); | ||
| 84 | |||
| 85 | s.id = 'mce_fullscreen'; | ||
| 86 | s.width = n.clientWidth; | ||
| 87 | s.height = n.clientHeight - 15; | ||
| 88 | s.fullscreen_is_enabled = true; | ||
| 89 | s.fullscreen_editor_id = ed.id; | ||
| 90 | s.theme_advanced_resizing = false; | ||
| 91 | s.save_onsavecallback = function() { | ||
| 92 | ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'}); | ||
| 93 | ed.execCommand('mceSave'); | ||
| 94 | }; | ||
| 95 | |||
| 96 | tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { | ||
| 97 | s[k] = v; | ||
| 98 | }); | ||
| 99 | |||
| 100 | if (s.theme_advanced_toolbar_location === 'external') | ||
| 101 | s.theme_advanced_toolbar_location = 'top'; | ||
| 102 | |||
| 103 | t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); | ||
| 104 | t.fullscreenEditor.onInit.add(function() { | ||
| 105 | t.fullscreenEditor.setContent(ed.getContent()); | ||
| 106 | t.fullscreenEditor.focus(); | ||
| 107 | }); | ||
| 108 | |||
| 109 | t.fullscreenEditor.render(); | ||
| 110 | tinyMCE.add(t.fullscreenEditor); | ||
| 111 | |||
| 112 | t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); | ||
| 113 | t.fullscreenElement.update(); | ||
| 114 | //document.body.overflow = 'hidden'; | ||
| 115 | |||
| 116 | t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() { | ||
| 117 | var vp = tinymce.DOM.getViewPort(); | ||
| 118 | |||
| 119 | t.fullscreenEditor.theme.resizeTo(vp.w, vp.h); | ||
| 120 | }); | ||
| 121 | } | ||
| 122 | }); | ||
| 123 | |||
| 124 | // Register buttons | ||
| 125 | ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); | ||
| 126 | |||
| 127 | ed.onNodeChange.add(function(ed, cm) { | ||
| 128 | cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); | ||
| 129 | }); | ||
| 130 | }, | ||
| 131 | |||
| 132 | getInfo : function() { | ||
| 133 | return { | ||
| 134 | longname : 'Fullscreen', | ||
| 135 | author : 'Moxiecode Systems AB', | ||
| 136 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 137 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', | ||
| 138 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 139 | }; | ||
| 140 | } | ||
| 141 | }); | ||
| 142 | |||
| 143 | // Register plugin | ||
| 144 | tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); | ||
| 145 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm b/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm new file mode 100755 index 0000000..4b081ca --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title></title> | ||
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
| 6 | <script type="text/javascript" src="../../tiny_mce.js"></script> | ||
| 7 | <script type="text/javascript"> | ||
| 8 | function patchCallback(settings, key) { | ||
| 9 | if (settings[key]) | ||
| 10 | settings[key] = "window.opener." + settings[key]; | ||
| 11 | } | ||
| 12 | |||
| 13 | var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id; | ||
| 14 | |||
| 15 | // Clone array | ||
| 16 | for (var n in paSe) | ||
| 17 | settings[n] = paSe[n]; | ||
| 18 | |||
| 19 | // Override options for fullscreen | ||
| 20 | for (var n in paSe.fullscreen_settings) | ||
| 21 | settings[n] = paSe.fullscreen_settings[n]; | ||
| 22 | |||
| 23 | // Patch callbacks, make them point to window.opener | ||
| 24 | patchCallback(settings, 'urlconverter_callback'); | ||
| 25 | patchCallback(settings, 'insertlink_callback'); | ||
| 26 | patchCallback(settings, 'insertimage_callback'); | ||
| 27 | patchCallback(settings, 'setupcontent_callback'); | ||
| 28 | patchCallback(settings, 'save_callback'); | ||
| 29 | patchCallback(settings, 'onchange_callback'); | ||
| 30 | patchCallback(settings, 'init_instance_callback'); | ||
| 31 | patchCallback(settings, 'file_browser_callback'); | ||
| 32 | patchCallback(settings, 'cleanup_callback'); | ||
| 33 | patchCallback(settings, 'execcommand_callback'); | ||
| 34 | patchCallback(settings, 'oninit'); | ||
| 35 | |||
| 36 | // Set options | ||
| 37 | delete settings.id; | ||
| 38 | settings['mode'] = 'exact'; | ||
| 39 | settings['elements'] = 'fullscreenarea'; | ||
| 40 | settings['add_unload_trigger'] = false; | ||
| 41 | settings['ask'] = false; | ||
| 42 | settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI(); | ||
| 43 | settings['fullscreen_is_enabled'] = true; | ||
| 44 | settings['fullscreen_editor_id'] = oeID; | ||
| 45 | settings['theme_advanced_resizing'] = false; | ||
| 46 | settings['strict_loading_mode'] = true; | ||
| 47 | |||
| 48 | settings.save_onsavecallback = function() { | ||
| 49 | window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'}); | ||
| 50 | window.opener.tinyMCE.get(oeID).execCommand('mceSave'); | ||
| 51 | window.close(); | ||
| 52 | }; | ||
| 53 | |||
| 54 | function unloadHandler(e) { | ||
| 55 | moveContent(); | ||
| 56 | } | ||
| 57 | |||
| 58 | function moveContent() { | ||
| 59 | window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent()); | ||
| 60 | } | ||
| 61 | |||
| 62 | function closeFullscreen() { | ||
| 63 | moveContent(); | ||
| 64 | window.close(); | ||
| 65 | } | ||
| 66 | |||
| 67 | function doParentSubmit() { | ||
| 68 | moveContent(); | ||
| 69 | |||
| 70 | if (window.opener.tinyMCE.selectedInstance.formElement.form) | ||
| 71 | window.opener.tinyMCE.selectedInstance.formElement.form.submit(); | ||
| 72 | |||
| 73 | window.close(); | ||
| 74 | |||
| 75 | return false; | ||
| 76 | } | ||
| 77 | |||
| 78 | function render() { | ||
| 79 | var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM; | ||
| 80 | |||
| 81 | e.value = window.opener.tinyMCE.get(oeID).getContent(); | ||
| 82 | |||
| 83 | vp = dom.getViewPort(); | ||
| 84 | settings.width = vp.w; | ||
| 85 | settings.height = vp.h - 15; | ||
| 86 | |||
| 87 | tinymce.dom.Event.add(window, 'resize', function() { | ||
| 88 | var vp = dom.getViewPort(); | ||
| 89 | |||
| 90 | tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h); | ||
| 91 | }); | ||
| 92 | |||
| 93 | tinyMCE.init(settings); | ||
| 94 | } | ||
| 95 | |||
| 96 | // Add onunload | ||
| 97 | tinymce.dom.Event.add(window, "beforeunload", unloadHandler); | ||
| 98 | </script> | ||
| 99 | <base target="_self" /> | ||
| 100 | </head> | ||
| 101 | <body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no"> | ||
| 102 | <form onsubmit="doParentSubmit();"> | ||
| 103 | <textarea id="fullscreenarea" style="width:100%; height:100%"></textarea> | ||
| 104 | </form> | ||
| 105 | |||
| 106 | <script type="text/javascript"> | ||
| 107 | render(); | ||
| 108 | </script> | ||
| 109 | |||
| 110 | </body> | ||
| 111 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js b/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js new file mode 100755 index 0000000..06dae75 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.IESpell',{init:function(ed,url){var t=this,sp;if(!tinymce.isIE)return;t.editor=ed;ed.addCommand('mceIESpell',function(){try{sp=new ActiveXObject("ieSpell.ieSpellExtension");sp.CheckDocumentNode(ed.getDoc().documentElement);}catch(e){if(e.number==-2146827859){ed.windowManager.confirm(ed.getLang("iespell.download"),function(s){if(s)window.open('http://www.iespell.com/download.php','ieSpellDownload','');});}else ed.windowManager.alert("Error Loading ieSpell: Exception "+e.number);}});ed.addButton('iespell',{title:'iespell.iespell_desc',cmd:'mceIESpell'});},getInfo:function(){return{longname:'IESpell (IE Only)',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('iespell',tinymce.plugins.IESpell);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js new file mode 100755 index 0000000..a68f69a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.IESpell', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this, sp; | ||
| 12 | |||
| 13 | if (!tinymce.isIE) | ||
| 14 | return; | ||
| 15 | |||
| 16 | t.editor = ed; | ||
| 17 | |||
| 18 | // Register commands | ||
| 19 | ed.addCommand('mceIESpell', function() { | ||
| 20 | try { | ||
| 21 | sp = new ActiveXObject("ieSpell.ieSpellExtension"); | ||
| 22 | sp.CheckDocumentNode(ed.getDoc().documentElement); | ||
| 23 | } catch (e) { | ||
| 24 | if (e.number == -2146827859) { | ||
| 25 | ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { | ||
| 26 | if (s) | ||
| 27 | window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); | ||
| 28 | }); | ||
| 29 | } else | ||
| 30 | ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); | ||
| 31 | } | ||
| 32 | }); | ||
| 33 | |||
| 34 | // Register buttons | ||
| 35 | ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); | ||
| 36 | }, | ||
| 37 | |||
| 38 | getInfo : function() { | ||
| 39 | return { | ||
| 40 | longname : 'IESpell (IE Only)', | ||
| 41 | author : 'Moxiecode Systems AB', | ||
| 42 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 43 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', | ||
| 44 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 45 | }; | ||
| 46 | } | ||
| 47 | }); | ||
| 48 | |||
| 49 | // Register plugin | ||
| 50 | tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); | ||
| 51 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js b/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js new file mode 100755 index 0000000..5560b6b --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var DOM=tinymce.DOM,Element=tinymce.dom.Element,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.InlinePopups',{init:function(ed,url){ed.onBeforeRenderUI.add(function(){ed.windowManager=new tinymce.InlineWindowManager(ed);DOM.loadCSS(url+'/skins/'+(ed.settings.inlinepopups_skin||'clearlooks2')+"/window.css");});},getInfo:function(){return{longname:'InlinePopups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager',{InlineWindowManager:function(ed){var t=this;t.parent(ed);t.zIndex=300000;t.count=0;t.windows={};},open:function(f,p){var t=this,id,opt='',ed=t.editor,dw=0,dh=0,vp,po,mdf,clf,we,w,u;f=f||{};p=p||{};if(!f.inline)return t.parent(f,p);if(!f.type)t.bookmark=ed.selection.getBookmark('simple');id=DOM.uniqueId();vp=DOM.getViewPort();f.width=parseInt(f.width||320);f.height=parseInt(f.height||240)+(tinymce.isIE?8:0);f.min_width=parseInt(f.min_width||150);f.min_height=parseInt(f.min_height||100);f.max_width=parseInt(f.max_width||2000);f.max_height=parseInt(f.max_height||2000);f.left=f.left||Math.round(Math.max(vp.x,vp.x+(vp.w/ 2.0) - (f.width /2.0)));f.top=f.top||Math.round(Math.max(vp.y,vp.y+(vp.h/ 2.0) - (f.height /2.0)));f.movable=f.resizable=true;p.mce_width=f.width;p.mce_height=f.height;p.mce_inline=true;p.mce_window_id=id;p.mce_auto_focus=f.auto_focus;t.features=f;t.params=p;t.onOpen.dispatch(t,f,p);if(f.type){opt+=' mceModal';if(f.type)opt+=' mce'+f.type.substring(0,1).toUpperCase()+f.type.substring(1);f.resizable=false;}if(f.statusbar)opt+=' mceStatusbar';if(f.resizable)opt+=' mceResizable';if(f.minimizable)opt+=' mceMinimizable';if(f.maximizable)opt+=' mceMaximizable';if(f.movable)opt+=' mceMovable';t._addAll(DOM.doc.body,['div',{id:id,'class':ed.settings.inlinepopups_skin||'clearlooks2',style:'width:100px;height:100px'},['div',{id:id+'_wrapper','class':'mceWrapper'+opt},['div',{id:id+'_top','class':'mceTop'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_title'},f.title||'']],['div',{id:id+'_middle','class':'mceMiddle'},['div',{id:id+'_left','class':'mceLeft'}],['span',{id:id+'_content'}],['div',{id:id+'_right','class':'mceRight'}]],['div',{id:id+'_bottom','class':'mceBottom'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_status'},'Content']],['a',{'class':'mceMove',tabindex:'-1',href:'javascript:;'}],['a',{'class':'mceMin',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMax',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMed',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceClose',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{id:id+'_resize_n','class':'mceResize mceResizeN',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_s','class':'mceResize mceResizeS',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_w','class':'mceResize mceResizeW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_e','class':'mceResize mceResizeE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_nw','class':'mceResize mceResizeNW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_ne','class':'mceResize mceResizeNE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_sw','class':'mceResize mceResizeSW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_se','class':'mceResize mceResizeSE',tabindex:'-1',href:'javascript:;'}]]]);DOM.setStyles(id,{top:-10000,left:-10000});if(tinymce.isGecko)DOM.setStyle(id,'overflow','auto');if(!f.type){dw+=DOM.get(id+'_left').clientWidth;dw+=DOM.get(id+'_right').clientWidth;dh+=DOM.get(id+'_top').clientHeight;dh+=DOM.get(id+'_bottom').clientHeight;}DOM.setStyles(id,{top:f.top,left:f.left,width:f.width+dw,height:f.height+dh});u=f.url||f.file;if(u){if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);}if(!f.type){DOM.add(id+'_content','iframe',{id:id+'_ifr',src:'javascript:""',frameBorder:0,style:'border:0;width:10px;height:10px'});DOM.setStyles(id+'_ifr',{width:f.width,height:f.height});DOM.setAttrib(id+'_ifr','src',u);}else{DOM.add(id+'_wrapper','a',{id:id+'_ok','class':'mceButton mceOk',href:'javascript:;',onmousedown:'return false;'},'Ok');if(f.type=='confirm')DOM.add(id+'_wrapper','a',{'class':'mceButton mceCancel',href:'javascript:;',onmousedown:'return false;'},'Cancel');DOM.add(id+'_middle','div',{'class':'mceIcon'});DOM.setHTML(id+'_content',f.content.replace('\n','<br />'));}mdf=Event.add(id,'mousedown',function(e){var n=e.target,w,vp;w=t.windows[id];t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){if(n.className=='mceMax'){w.oldPos=w.element.getXY();w.oldSize=w.element.getSize();vp=DOM.getViewPort();vp.w-=2;vp.h-=2;w.element.moveTo(vp.x,vp.y);w.element.resizeTo(vp.w,vp.h);DOM.setStyles(id+'_ifr',{width:vp.w-w.deltaWidth,height:vp.h-w.deltaHeight});DOM.addClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMed'){w.element.moveTo(w.oldPos.x,w.oldPos.y);w.element.resizeTo(w.oldSize.w,w.oldSize.h);w.iframeElement.resizeTo(w.oldSize.w-w.deltaWidth,w.oldSize.h-w.deltaHeight);DOM.removeClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMove')return t._startDrag(id,e,n.className);else if(DOM.hasClass(n,'mceResize'))return t._startDrag(id,e,n.className.substring(13));}});clf=Event.add(id,'click',function(e){var n=e.target;t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){switch(n.className){case'mceClose':t.close(null,id);return Event.cancel(e);case'mceButton mceOk':case'mceButton mceCancel':f.button_func(n.className=='mceButton mceOk');return Event.cancel(e);}}});w=t.windows[id]={id:id,mousedown_func:mdf,click_func:clf,element:new Element(id,{blocker:1,container:ed.getContainer()}),iframeElement:new Element(id+'_ifr'),features:f,deltaWidth:dw,deltaHeight:dh};w.iframeElement.on('focus',function(){t.focus(id);});if(t.count==0&&t.editor.getParam('dialog_type','modal')=='modal'){DOM.add(DOM.doc.body,'div',{id:'mceModalBlocker','class':(t.editor.settings.inlinepopups_skin||'clearlooks2')+'_modalBlocker',style:{zIndex:t.zIndex-1}});DOM.show('mceModalBlocker');}else DOM.setStyle('mceModalBlocker','z-index',t.zIndex-1);if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!DOM.boxModel))DOM.setStyles('mceModalBlocker',{position:'absolute',width:vp.w-2,height:vp.h-2});t.focus(id);t._fixIELayout(id,1);if(DOM.get(id+'_ok'))DOM.get(id+'_ok').focus();t.count++;return w;},focus:function(id){var t=this,w;if(w=t.windows[id]){w.zIndex=this.zIndex++;w.element.setStyle('zIndex',w.zIndex);w.element.update();id=id+'_wrapper';DOM.removeClass(t.lastId,'mceFocus');DOM.addClass(id,'mceFocus');t.lastId=id;}},_addAll:function(te,ne){var i,n,t=this,dom=tinymce.DOM;if(is(ne,'string'))te.appendChild(dom.doc.createTextNode(ne));else if(ne.length){te=te.appendChild(dom.create(ne[0],ne[1]));for(i=2;i<ne.length;i++)t._addAll(te,ne[i]);}},_startDrag:function(id,se,ac){var t=this,mu,mm,d=DOM.doc,eb,w=t.windows[id],we=w.element,sp=we.getXY(),p,sz,ph,cp,vp,sx,sy,sex,sey,dx,dy,dw,dh;cp={x:0,y:0};vp=DOM.getViewPort();vp.w-=2;vp.h-=2;sex=se.screenX;sey=se.screenY;dx=dy=dw=dh=0;mu=Event.add(d,'mouseup',function(e){Event.remove(d,'mouseup',mu);Event.remove(d,'mousemove',mm);if(eb)eb.remove();we.moveBy(dx,dy);we.resizeBy(dw,dh);sz=we.getSize();DOM.setStyles(id+'_ifr',{width:sz.w-w.deltaWidth,height:sz.h-w.deltaHeight});t._fixIELayout(id,1);return Event.cancel(e);});if(ac!='Move')startMove();function startMove(){if(eb)return;t._fixIELayout(id,0);DOM.add(d.body,'div',{id:'mceEventBlocker','class':'mceEventBlocker '+(t.editor.settings.inlinepopups_skin||'clearlooks2'),style:{zIndex:t.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!DOM.boxModel))DOM.setStyles('mceEventBlocker',{position:'absolute',width:vp.w-2,height:vp.h-2});eb=new Element('mceEventBlocker');eb.update();p=we.getXY();sz=we.getSize();sx=cp.x+p.x-vp.x;sy=cp.y+p.y-vp.y;DOM.add(eb.get(),'div',{id:'mcePlaceHolder','class':'mcePlaceHolder',style:{left:sx,top:sy,width:sz.w,height:sz.h}});ph=new Element('mcePlaceHolder');};mm=Event.add(d,'mousemove',function(e){var x,y,v;startMove();x=e.screenX-sex;y=e.screenY-sey;switch(ac){case'ResizeW':dx=x;dw=0-x;break;case'ResizeE':dw=x;break;case'ResizeN':case'ResizeNW':case'ResizeNE':if(ac=="ResizeNW"){dx=x;dw=0-x;}else if(ac=="ResizeNE")dw=x;dy=y;dh=0-y;break;case'ResizeS':case'ResizeSW':case'ResizeSE':if(ac=="ResizeSW"){dx=x;dw=0-x;}else if(ac=="ResizeSE")dw=x;dh=y;break;case'mceMove':dx=x;dy=y;break;}if(dw<(v=w.features.min_width-sz.w)){if(dx!==0)dx+=dw-v;dw=v;}if(dh<(v=w.features.min_height-sz.h)){if(dy!==0)dy+=dh-v;dh=v;}dw=Math.min(dw,w.features.max_width-sz.w);dh=Math.min(dh,w.features.max_height-sz.h);dx=Math.max(dx,vp.x-(sx+vp.x));dy=Math.max(dy,vp.y-(sy+vp.y));dx=Math.min(dx,(vp.w+vp.x)-(sx+sz.w+vp.x));dy=Math.min(dy,(vp.h+vp.y)-(sy+sz.h+vp.y));if(dx+dy!==0){if(sx+dx<0)dx=0;if(sy+dy<0)dy=0;ph.moveTo(sx+dx,sy+dy);}if(dw+dh!==0)ph.resizeTo(sz.w+dw,sz.h+dh);return Event.cancel(e);});return Event.cancel(se);},resizeBy:function(dw,dh,id){var w=this.windows[id];if(w){w.element.resizeBy(dw,dh);w.iframeElement.resizeBy(dw,dh);}},close:function(win,id){var t=this,w,d=DOM.doc,ix=0,fw,id;id=t._findId(id||win);if(!t.windows[id]){t.parent(win);return;}t.count--;if(t.count==0)DOM.remove('mceModalBlocker');if(w=t.windows[id]){t.onClose.dispatch(t);Event.remove(d,'mousedown',w.mousedownFunc);Event.remove(d,'click',w.clickFunc);Event.clear(id);Event.clear(id+'_ifr');DOM.setAttrib(id+'_ifr','src','javascript:""');w.element.remove();delete t.windows[id];each(t.windows,function(w){if(w.zIndex>ix){fw=w;ix=w.zIndex;}});if(fw)t.focus(fw.id);}},setTitle:function(w,ti){var e;w=this._findId(w);if(e=DOM.get(w+'_title'))e.innerHTML=DOM.encode(ti);},alert:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'alert',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},confirm:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'confirm',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},_findId:function(w){var t=this;if(typeof(w)=='string')return w;each(t.windows,function(wo){var ifr=DOM.get(wo.id+'_ifr');if(ifr&&w==ifr.contentWindow){w=wo.id;return false;}});return w;},_fixIELayout:function(id,s){var w,img;if(!tinymce.isIE6)return;each(['n','s','w','e','nw','ne','sw','se'],function(v){var e=DOM.get(id+'_resize_'+v);DOM.setStyles(e,{width:s?e.clientWidth:'',height:s?e.clientHeight:'',cursor:DOM.getStyle(e,'cursor',1)});DOM.setStyle(id+"_bottom",'bottom','-1px');e=0;});if(w=this.windows[id]){w.element.hide();w.element.show();each(DOM.select('div,a',id),function(e,i){if(e.currentStyle.backgroundImage!='none'){img=new Image();img.src=e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,'$1');}});DOM.get(id).style.filter='';}}});tinymce.PluginManager.add('inlinepopups',tinymce.plugins.InlinePopups);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js new file mode 100755 index 0000000..027a23c --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js | |||
| @@ -0,0 +1,632 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 961 2008-11-14 10:31:07Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.InlinePopups', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | // Replace window manager | ||
| 14 | ed.onBeforeRenderUI.add(function() { | ||
| 15 | ed.windowManager = new tinymce.InlineWindowManager(ed); | ||
| 16 | DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); | ||
| 17 | }); | ||
| 18 | }, | ||
| 19 | |||
| 20 | getInfo : function() { | ||
| 21 | return { | ||
| 22 | longname : 'InlinePopups', | ||
| 23 | author : 'Moxiecode Systems AB', | ||
| 24 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 25 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', | ||
| 26 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 27 | }; | ||
| 28 | } | ||
| 29 | }); | ||
| 30 | |||
| 31 | tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { | ||
| 32 | InlineWindowManager : function(ed) { | ||
| 33 | var t = this; | ||
| 34 | |||
| 35 | t.parent(ed); | ||
| 36 | t.zIndex = 300000; | ||
| 37 | t.count = 0; | ||
| 38 | t.windows = {}; | ||
| 39 | }, | ||
| 40 | |||
| 41 | open : function(f, p) { | ||
| 42 | var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u; | ||
| 43 | |||
| 44 | f = f || {}; | ||
| 45 | p = p || {}; | ||
| 46 | |||
| 47 | // Run native windows | ||
| 48 | if (!f.inline) | ||
| 49 | return t.parent(f, p); | ||
| 50 | |||
| 51 | // Only store selection if the type is a normal window | ||
| 52 | if (!f.type) | ||
| 53 | t.bookmark = ed.selection.getBookmark('simple'); | ||
| 54 | |||
| 55 | id = DOM.uniqueId(); | ||
| 56 | vp = DOM.getViewPort(); | ||
| 57 | f.width = parseInt(f.width || 320); | ||
| 58 | f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); | ||
| 59 | f.min_width = parseInt(f.min_width || 150); | ||
| 60 | f.min_height = parseInt(f.min_height || 100); | ||
| 61 | f.max_width = parseInt(f.max_width || 2000); | ||
| 62 | f.max_height = parseInt(f.max_height || 2000); | ||
| 63 | f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); | ||
| 64 | f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); | ||
| 65 | f.movable = f.resizable = true; | ||
| 66 | p.mce_width = f.width; | ||
| 67 | p.mce_height = f.height; | ||
| 68 | p.mce_inline = true; | ||
| 69 | p.mce_window_id = id; | ||
| 70 | p.mce_auto_focus = f.auto_focus; | ||
| 71 | |||
| 72 | // Transpose | ||
| 73 | // po = DOM.getPos(ed.getContainer()); | ||
| 74 | // f.left -= po.x; | ||
| 75 | // f.top -= po.y; | ||
| 76 | |||
| 77 | t.features = f; | ||
| 78 | t.params = p; | ||
| 79 | t.onOpen.dispatch(t, f, p); | ||
| 80 | |||
| 81 | if (f.type) { | ||
| 82 | opt += ' mceModal'; | ||
| 83 | |||
| 84 | if (f.type) | ||
| 85 | opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); | ||
| 86 | |||
| 87 | f.resizable = false; | ||
| 88 | } | ||
| 89 | |||
| 90 | if (f.statusbar) | ||
| 91 | opt += ' mceStatusbar'; | ||
| 92 | |||
| 93 | if (f.resizable) | ||
| 94 | opt += ' mceResizable'; | ||
| 95 | |||
| 96 | if (f.minimizable) | ||
| 97 | opt += ' mceMinimizable'; | ||
| 98 | |||
| 99 | if (f.maximizable) | ||
| 100 | opt += ' mceMaximizable'; | ||
| 101 | |||
| 102 | if (f.movable) | ||
| 103 | opt += ' mceMovable'; | ||
| 104 | |||
| 105 | // Create DOM objects | ||
| 106 | t._addAll(DOM.doc.body, | ||
| 107 | ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'}, | ||
| 108 | ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, | ||
| 109 | ['div', {id : id + '_top', 'class' : 'mceTop'}, | ||
| 110 | ['div', {'class' : 'mceLeft'}], | ||
| 111 | ['div', {'class' : 'mceCenter'}], | ||
| 112 | ['div', {'class' : 'mceRight'}], | ||
| 113 | ['span', {id : id + '_title'}, f.title || ''] | ||
| 114 | ], | ||
| 115 | |||
| 116 | ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, | ||
| 117 | ['div', {id : id + '_left', 'class' : 'mceLeft'}], | ||
| 118 | ['span', {id : id + '_content'}], | ||
| 119 | ['div', {id : id + '_right', 'class' : 'mceRight'}] | ||
| 120 | ], | ||
| 121 | |||
| 122 | ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, | ||
| 123 | ['div', {'class' : 'mceLeft'}], | ||
| 124 | ['div', {'class' : 'mceCenter'}], | ||
| 125 | ['div', {'class' : 'mceRight'}], | ||
| 126 | ['span', {id : id + '_status'}, 'Content'] | ||
| 127 | ], | ||
| 128 | |||
| 129 | ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], | ||
| 130 | ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], | ||
| 131 | ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], | ||
| 132 | ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], | ||
| 133 | ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], | ||
| 134 | ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], | ||
| 135 | ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], | ||
| 136 | ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], | ||
| 137 | ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], | ||
| 138 | ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], | ||
| 139 | ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], | ||
| 140 | ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], | ||
| 141 | ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] | ||
| 142 | ] | ||
| 143 | ] | ||
| 144 | ); | ||
| 145 | |||
| 146 | DOM.setStyles(id, {top : -10000, left : -10000}); | ||
| 147 | |||
| 148 | // Fix gecko rendering bug, where the editors iframe messed with window contents | ||
| 149 | if (tinymce.isGecko) | ||
| 150 | DOM.setStyle(id, 'overflow', 'auto'); | ||
| 151 | |||
| 152 | // Measure borders | ||
| 153 | if (!f.type) { | ||
| 154 | dw += DOM.get(id + '_left').clientWidth; | ||
| 155 | dw += DOM.get(id + '_right').clientWidth; | ||
| 156 | dh += DOM.get(id + '_top').clientHeight; | ||
| 157 | dh += DOM.get(id + '_bottom').clientHeight; | ||
| 158 | } | ||
| 159 | |||
| 160 | // Resize window | ||
| 161 | DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); | ||
| 162 | |||
| 163 | u = f.url || f.file; | ||
| 164 | if (u) { | ||
| 165 | if (tinymce.relaxedDomain) | ||
| 166 | u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; | ||
| 167 | |||
| 168 | u = tinymce._addVer(u); | ||
| 169 | } | ||
| 170 | |||
| 171 | if (!f.type) { | ||
| 172 | DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); | ||
| 173 | DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); | ||
| 174 | DOM.setAttrib(id + '_ifr', 'src', u); | ||
| 175 | } else { | ||
| 176 | DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); | ||
| 177 | |||
| 178 | if (f.type == 'confirm') | ||
| 179 | DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); | ||
| 180 | |||
| 181 | DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); | ||
| 182 | DOM.setHTML(id + '_content', f.content.replace('\n', '<br />')); | ||
| 183 | } | ||
| 184 | |||
| 185 | // Register events | ||
| 186 | mdf = Event.add(id, 'mousedown', function(e) { | ||
| 187 | var n = e.target, w, vp; | ||
| 188 | |||
| 189 | w = t.windows[id]; | ||
| 190 | t.focus(id); | ||
| 191 | |||
| 192 | if (n.nodeName == 'A' || n.nodeName == 'a') { | ||
| 193 | if (n.className == 'mceMax') { | ||
| 194 | w.oldPos = w.element.getXY(); | ||
| 195 | w.oldSize = w.element.getSize(); | ||
| 196 | |||
| 197 | vp = DOM.getViewPort(); | ||
| 198 | |||
| 199 | // Reduce viewport size to avoid scrollbars | ||
| 200 | vp.w -= 2; | ||
| 201 | vp.h -= 2; | ||
| 202 | |||
| 203 | w.element.moveTo(vp.x, vp.y); | ||
| 204 | w.element.resizeTo(vp.w, vp.h); | ||
| 205 | DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); | ||
| 206 | DOM.addClass(id + '_wrapper', 'mceMaximized'); | ||
| 207 | } else if (n.className == 'mceMed') { | ||
| 208 | // Reset to old size | ||
| 209 | w.element.moveTo(w.oldPos.x, w.oldPos.y); | ||
| 210 | w.element.resizeTo(w.oldSize.w, w.oldSize.h); | ||
| 211 | w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); | ||
| 212 | |||
| 213 | DOM.removeClass(id + '_wrapper', 'mceMaximized'); | ||
| 214 | } else if (n.className == 'mceMove') | ||
| 215 | return t._startDrag(id, e, n.className); | ||
| 216 | else if (DOM.hasClass(n, 'mceResize')) | ||
| 217 | return t._startDrag(id, e, n.className.substring(13)); | ||
| 218 | } | ||
| 219 | }); | ||
| 220 | |||
| 221 | clf = Event.add(id, 'click', function(e) { | ||
| 222 | var n = e.target; | ||
| 223 | |||
| 224 | t.focus(id); | ||
| 225 | |||
| 226 | if (n.nodeName == 'A' || n.nodeName == 'a') { | ||
| 227 | switch (n.className) { | ||
| 228 | case 'mceClose': | ||
| 229 | t.close(null, id); | ||
| 230 | return Event.cancel(e); | ||
| 231 | |||
| 232 | case 'mceButton mceOk': | ||
| 233 | case 'mceButton mceCancel': | ||
| 234 | f.button_func(n.className == 'mceButton mceOk'); | ||
| 235 | return Event.cancel(e); | ||
| 236 | } | ||
| 237 | } | ||
| 238 | }); | ||
| 239 | |||
| 240 | // Add window | ||
| 241 | w = t.windows[id] = { | ||
| 242 | id : id, | ||
| 243 | mousedown_func : mdf, | ||
| 244 | click_func : clf, | ||
| 245 | element : new Element(id, {blocker : 1, container : ed.getContainer()}), | ||
| 246 | iframeElement : new Element(id + '_ifr'), | ||
| 247 | features : f, | ||
| 248 | deltaWidth : dw, | ||
| 249 | deltaHeight : dh | ||
| 250 | }; | ||
| 251 | |||
| 252 | w.iframeElement.on('focus', function() { | ||
| 253 | t.focus(id); | ||
| 254 | }); | ||
| 255 | |||
| 256 | // Setup blocker | ||
| 257 | if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { | ||
| 258 | DOM.add(DOM.doc.body, 'div', { | ||
| 259 | id : 'mceModalBlocker', | ||
| 260 | 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', | ||
| 261 | style : {zIndex : t.zIndex - 1} | ||
| 262 | }); | ||
| 263 | |||
| 264 | DOM.show('mceModalBlocker'); // Reduces flicker in IE | ||
| 265 | } else | ||
| 266 | DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); | ||
| 267 | |||
| 268 | if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) | ||
| 269 | DOM.setStyles('mceModalBlocker', {position : 'absolute', width : vp.w - 2, height : vp.h - 2}); | ||
| 270 | |||
| 271 | t.focus(id); | ||
| 272 | t._fixIELayout(id, 1); | ||
| 273 | |||
| 274 | // Focus ok button | ||
| 275 | if (DOM.get(id + '_ok')) | ||
| 276 | DOM.get(id + '_ok').focus(); | ||
| 277 | |||
| 278 | t.count++; | ||
| 279 | |||
| 280 | return w; | ||
| 281 | }, | ||
| 282 | |||
| 283 | focus : function(id) { | ||
| 284 | var t = this, w; | ||
| 285 | |||
| 286 | if (w = t.windows[id]) { | ||
| 287 | w.zIndex = this.zIndex++; | ||
| 288 | w.element.setStyle('zIndex', w.zIndex); | ||
| 289 | w.element.update(); | ||
| 290 | |||
| 291 | id = id + '_wrapper'; | ||
| 292 | DOM.removeClass(t.lastId, 'mceFocus'); | ||
| 293 | DOM.addClass(id, 'mceFocus'); | ||
| 294 | t.lastId = id; | ||
| 295 | } | ||
| 296 | }, | ||
| 297 | |||
| 298 | _addAll : function(te, ne) { | ||
| 299 | var i, n, t = this, dom = tinymce.DOM; | ||
| 300 | |||
| 301 | if (is(ne, 'string')) | ||
| 302 | te.appendChild(dom.doc.createTextNode(ne)); | ||
| 303 | else if (ne.length) { | ||
| 304 | te = te.appendChild(dom.create(ne[0], ne[1])); | ||
| 305 | |||
| 306 | for (i=2; i<ne.length; i++) | ||
| 307 | t._addAll(te, ne[i]); | ||
| 308 | } | ||
| 309 | }, | ||
| 310 | |||
| 311 | _startDrag : function(id, se, ac) { | ||
| 312 | var t = this, mu, mm, d = DOM.doc, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh; | ||
| 313 | |||
| 314 | // Get positons and sizes | ||
| 315 | // cp = DOM.getPos(t.editor.getContainer()); | ||
| 316 | cp = {x : 0, y : 0}; | ||
| 317 | vp = DOM.getViewPort(); | ||
| 318 | |||
| 319 | // Reduce viewport size to avoid scrollbars while dragging | ||
| 320 | vp.w -= 2; | ||
| 321 | vp.h -= 2; | ||
| 322 | |||
| 323 | sex = se.screenX; | ||
| 324 | sey = se.screenY; | ||
| 325 | dx = dy = dw = dh = 0; | ||
| 326 | |||
| 327 | // Handle mouse up | ||
| 328 | mu = Event.add(d, 'mouseup', function(e) { | ||
| 329 | Event.remove(d, 'mouseup', mu); | ||
| 330 | Event.remove(d, 'mousemove', mm); | ||
| 331 | |||
| 332 | if (eb) | ||
| 333 | eb.remove(); | ||
| 334 | |||
| 335 | we.moveBy(dx, dy); | ||
| 336 | we.resizeBy(dw, dh); | ||
| 337 | sz = we.getSize(); | ||
| 338 | DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight}); | ||
| 339 | t._fixIELayout(id, 1); | ||
| 340 | |||
| 341 | return Event.cancel(e); | ||
| 342 | }); | ||
| 343 | |||
| 344 | if (ac != 'Move') | ||
| 345 | startMove(); | ||
| 346 | |||
| 347 | function startMove() { | ||
| 348 | if (eb) | ||
| 349 | return; | ||
| 350 | |||
| 351 | t._fixIELayout(id, 0); | ||
| 352 | |||
| 353 | // Setup event blocker | ||
| 354 | DOM.add(d.body, 'div', { | ||
| 355 | id : 'mceEventBlocker', | ||
| 356 | 'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'), | ||
| 357 | style : {zIndex : t.zIndex + 1} | ||
| 358 | }); | ||
| 359 | |||
| 360 | if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel)) | ||
| 361 | DOM.setStyles('mceEventBlocker', {position : 'absolute', width : vp.w - 2, height : vp.h - 2}); | ||
| 362 | |||
| 363 | eb = new Element('mceEventBlocker'); | ||
| 364 | eb.update(); | ||
| 365 | |||
| 366 | // Setup placeholder | ||
| 367 | p = we.getXY(); | ||
| 368 | sz = we.getSize(); | ||
| 369 | sx = cp.x + p.x - vp.x; | ||
| 370 | sy = cp.y + p.y - vp.y; | ||
| 371 | DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}}); | ||
| 372 | ph = new Element('mcePlaceHolder'); | ||
| 373 | }; | ||
| 374 | |||
| 375 | // Handle mouse move/drag | ||
| 376 | mm = Event.add(d, 'mousemove', function(e) { | ||
| 377 | var x, y, v; | ||
| 378 | |||
| 379 | startMove(); | ||
| 380 | |||
| 381 | x = e.screenX - sex; | ||
| 382 | y = e.screenY - sey; | ||
| 383 | |||
| 384 | switch (ac) { | ||
| 385 | case 'ResizeW': | ||
| 386 | dx = x; | ||
| 387 | dw = 0 - x; | ||
| 388 | break; | ||
| 389 | |||
| 390 | case 'ResizeE': | ||
| 391 | dw = x; | ||
| 392 | break; | ||
| 393 | |||
| 394 | case 'ResizeN': | ||
| 395 | case 'ResizeNW': | ||
| 396 | case 'ResizeNE': | ||
| 397 | if (ac == "ResizeNW") { | ||
| 398 | dx = x; | ||
| 399 | dw = 0 - x; | ||
| 400 | } else if (ac == "ResizeNE") | ||
| 401 | dw = x; | ||
| 402 | |||
| 403 | dy = y; | ||
| 404 | dh = 0 - y; | ||
| 405 | break; | ||
| 406 | |||
| 407 | case 'ResizeS': | ||
| 408 | case 'ResizeSW': | ||
| 409 | case 'ResizeSE': | ||
| 410 | if (ac == "ResizeSW") { | ||
| 411 | dx = x; | ||
| 412 | dw = 0 - x; | ||
| 413 | } else if (ac == "ResizeSE") | ||
| 414 | dw = x; | ||
| 415 | |||
| 416 | dh = y; | ||
| 417 | break; | ||
| 418 | |||
| 419 | case 'mceMove': | ||
| 420 | dx = x; | ||
| 421 | dy = y; | ||
| 422 | break; | ||
| 423 | } | ||
| 424 | |||
| 425 | // Boundary check | ||
| 426 | if (dw < (v = w.features.min_width - sz.w)) { | ||
| 427 | if (dx !== 0) | ||
| 428 | dx += dw - v; | ||
| 429 | |||
| 430 | dw = v; | ||
| 431 | } | ||
| 432 | |||
| 433 | if (dh < (v = w.features.min_height - sz.h)) { | ||
| 434 | if (dy !== 0) | ||
| 435 | dy += dh - v; | ||
| 436 | |||
| 437 | dh = v; | ||
| 438 | } | ||
| 439 | |||
| 440 | dw = Math.min(dw, w.features.max_width - sz.w); | ||
| 441 | dh = Math.min(dh, w.features.max_height - sz.h); | ||
| 442 | dx = Math.max(dx, vp.x - (sx + vp.x)); | ||
| 443 | dy = Math.max(dy, vp.y - (sy + vp.y)); | ||
| 444 | dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x)); | ||
| 445 | dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y)); | ||
| 446 | |||
| 447 | // Move if needed | ||
| 448 | if (dx + dy !== 0) { | ||
| 449 | if (sx + dx < 0) | ||
| 450 | dx = 0; | ||
| 451 | |||
| 452 | if (sy + dy < 0) | ||
| 453 | dy = 0; | ||
| 454 | |||
| 455 | ph.moveTo(sx + dx, sy + dy); | ||
| 456 | } | ||
| 457 | |||
| 458 | // Resize if needed | ||
| 459 | if (dw + dh !== 0) | ||
| 460 | ph.resizeTo(sz.w + dw, sz.h + dh); | ||
| 461 | |||
| 462 | return Event.cancel(e); | ||
| 463 | }); | ||
| 464 | |||
| 465 | return Event.cancel(se); | ||
| 466 | }, | ||
| 467 | |||
| 468 | resizeBy : function(dw, dh, id) { | ||
| 469 | var w = this.windows[id]; | ||
| 470 | |||
| 471 | if (w) { | ||
| 472 | w.element.resizeBy(dw, dh); | ||
| 473 | w.iframeElement.resizeBy(dw, dh); | ||
| 474 | } | ||
| 475 | }, | ||
| 476 | |||
| 477 | close : function(win, id) { | ||
| 478 | var t = this, w, d = DOM.doc, ix = 0, fw, id; | ||
| 479 | |||
| 480 | id = t._findId(id || win); | ||
| 481 | |||
| 482 | // Probably not inline | ||
| 483 | if (!t.windows[id]) { | ||
| 484 | t.parent(win); | ||
| 485 | return; | ||
| 486 | } | ||
| 487 | |||
| 488 | t.count--; | ||
| 489 | |||
| 490 | if (t.count == 0) | ||
| 491 | DOM.remove('mceModalBlocker'); | ||
| 492 | |||
| 493 | if (w = t.windows[id]) { | ||
| 494 | t.onClose.dispatch(t); | ||
| 495 | Event.remove(d, 'mousedown', w.mousedownFunc); | ||
| 496 | Event.remove(d, 'click', w.clickFunc); | ||
| 497 | Event.clear(id); | ||
| 498 | Event.clear(id + '_ifr'); | ||
| 499 | |||
| 500 | DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak | ||
| 501 | w.element.remove(); | ||
| 502 | delete t.windows[id]; | ||
| 503 | |||
| 504 | // Find front most window and focus that | ||
| 505 | each (t.windows, function(w) { | ||
| 506 | if (w.zIndex > ix) { | ||
| 507 | fw = w; | ||
| 508 | ix = w.zIndex; | ||
| 509 | } | ||
| 510 | }); | ||
| 511 | |||
| 512 | if (fw) | ||
| 513 | t.focus(fw.id); | ||
| 514 | } | ||
| 515 | }, | ||
| 516 | |||
| 517 | setTitle : function(w, ti) { | ||
| 518 | var e; | ||
| 519 | |||
| 520 | w = this._findId(w); | ||
| 521 | |||
| 522 | if (e = DOM.get(w + '_title')) | ||
| 523 | e.innerHTML = DOM.encode(ti); | ||
| 524 | }, | ||
| 525 | |||
| 526 | alert : function(txt, cb, s) { | ||
| 527 | var t = this, w; | ||
| 528 | |||
| 529 | w = t.open({ | ||
| 530 | title : t, | ||
| 531 | type : 'alert', | ||
| 532 | button_func : function(s) { | ||
| 533 | if (cb) | ||
| 534 | cb.call(s || t, s); | ||
| 535 | |||
| 536 | t.close(null, w.id); | ||
| 537 | }, | ||
| 538 | content : DOM.encode(t.editor.getLang(txt, txt)), | ||
| 539 | inline : 1, | ||
| 540 | width : 400, | ||
| 541 | height : 130 | ||
| 542 | }); | ||
| 543 | }, | ||
| 544 | |||
| 545 | confirm : function(txt, cb, s) { | ||
| 546 | var t = this, w; | ||
| 547 | |||
| 548 | w = t.open({ | ||
| 549 | title : t, | ||
| 550 | type : 'confirm', | ||
| 551 | button_func : function(s) { | ||
| 552 | if (cb) | ||
| 553 | cb.call(s || t, s); | ||
| 554 | |||
| 555 | t.close(null, w.id); | ||
| 556 | }, | ||
| 557 | content : DOM.encode(t.editor.getLang(txt, txt)), | ||
| 558 | inline : 1, | ||
| 559 | width : 400, | ||
| 560 | height : 130 | ||
| 561 | }); | ||
| 562 | }, | ||
| 563 | |||
| 564 | // Internal functions | ||
| 565 | |||
| 566 | _findId : function(w) { | ||
| 567 | var t = this; | ||
| 568 | |||
| 569 | if (typeof(w) == 'string') | ||
| 570 | return w; | ||
| 571 | |||
| 572 | each(t.windows, function(wo) { | ||
| 573 | var ifr = DOM.get(wo.id + '_ifr'); | ||
| 574 | |||
| 575 | if (ifr && w == ifr.contentWindow) { | ||
| 576 | w = wo.id; | ||
| 577 | return false; | ||
| 578 | } | ||
| 579 | }); | ||
| 580 | |||
| 581 | return w; | ||
| 582 | }, | ||
| 583 | |||
| 584 | _fixIELayout : function(id, s) { | ||
| 585 | var w, img; | ||
| 586 | |||
| 587 | if (!tinymce.isIE6) | ||
| 588 | return; | ||
| 589 | |||
| 590 | // Fixes the bug where hover flickers and does odd things in IE6 | ||
| 591 | each(['n','s','w','e','nw','ne','sw','se'], function(v) { | ||
| 592 | var e = DOM.get(id + '_resize_' + v); | ||
| 593 | |||
| 594 | DOM.setStyles(e, { | ||
| 595 | width : s ? e.clientWidth : '', | ||
| 596 | height : s ? e.clientHeight : '', | ||
| 597 | cursor : DOM.getStyle(e, 'cursor', 1) | ||
| 598 | }); | ||
| 599 | |||
| 600 | DOM.setStyle(id + "_bottom", 'bottom', '-1px'); | ||
| 601 | |||
| 602 | e = 0; | ||
| 603 | }); | ||
| 604 | |||
| 605 | // Fixes graphics glitch | ||
| 606 | if (w = this.windows[id]) { | ||
| 607 | // Fixes rendering bug after resize | ||
| 608 | w.element.hide(); | ||
| 609 | w.element.show(); | ||
| 610 | |||
| 611 | // Forced a repaint of the window | ||
| 612 | //DOM.get(id).style.filter = ''; | ||
| 613 | |||
| 614 | // IE has a bug where images used in CSS won't get loaded | ||
| 615 | // sometimes when the cache in the browser is disabled | ||
| 616 | // This fix tries to solve it by loading the images using the image object | ||
| 617 | each(DOM.select('div,a', id), function(e, i) { | ||
| 618 | if (e.currentStyle.backgroundImage != 'none') { | ||
| 619 | img = new Image(); | ||
| 620 | img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); | ||
| 621 | } | ||
| 622 | }); | ||
| 623 | |||
| 624 | DOM.get(id).style.filter = ''; | ||
| 625 | } | ||
| 626 | } | ||
| 627 | }); | ||
| 628 | |||
| 629 | // Register plugin | ||
| 630 | tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); | ||
| 631 | })(); | ||
| 632 | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif new file mode 100755 index 0000000..94abd08 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif new file mode 100755 index 0000000..e671094 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif new file mode 100755 index 0000000..6baf64a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif new file mode 100755 index 0000000..497307a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif new file mode 100755 index 0000000..c894b2e --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif new file mode 100755 index 0000000..c2a2ad4 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif new file mode 100755 index 0000000..43a735f --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css new file mode 100755 index 0000000..5e6fd7d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | /* Clearlooks 2 */ | ||
| 2 | |||
| 3 | /* Reset */ | ||
| 4 | .clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} | ||
| 5 | |||
| 6 | /* General */ | ||
| 7 | .clearlooks2 {position:absolute; direction:ltr} | ||
| 8 | .clearlooks2 .mceWrapper {position:static} | ||
| 9 | .mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} | ||
| 10 | .clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} | ||
| 11 | .clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} | ||
| 12 | |||
| 13 | /* Top */ | ||
| 14 | .clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} | ||
| 15 | .clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} | ||
| 16 | .clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} | ||
| 17 | .clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} | ||
| 18 | .clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} | ||
| 19 | .clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} | ||
| 20 | .clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} | ||
| 21 | .clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} | ||
| 22 | .clearlooks2 .mceFocus .mceTop span {color:#FFF} | ||
| 23 | |||
| 24 | /* Middle */ | ||
| 25 | .clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} | ||
| 26 | .clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} | ||
| 27 | .clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} | ||
| 28 | .clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} | ||
| 29 | .clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} | ||
| 30 | |||
| 31 | /* Bottom */ | ||
| 32 | .clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} | ||
| 33 | .clearlooks2 .mceBottom {left:0; bottom:0; width:100%} | ||
| 34 | .clearlooks2 .mceBottom div {top:0} | ||
| 35 | .clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} | ||
| 36 | .clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} | ||
| 37 | .clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} | ||
| 38 | .clearlooks2 .mceBottom span {display:none} | ||
| 39 | .clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} | ||
| 40 | .clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} | ||
| 41 | .clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} | ||
| 42 | .clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} | ||
| 43 | .clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} | ||
| 44 | |||
| 45 | /* Actions */ | ||
| 46 | .clearlooks2 a {width:29px; height:16px; top:3px;} | ||
| 47 | .clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} | ||
| 48 | .clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} | ||
| 49 | .clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} | ||
| 50 | .clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} | ||
| 51 | .clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} | ||
| 52 | .clearlooks2 .mceMovable .mceMove {display:block} | ||
| 53 | .clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} | ||
| 54 | .clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} | ||
| 55 | .clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} | ||
| 56 | .clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} | ||
| 57 | .clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} | ||
| 58 | .clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} | ||
| 59 | .clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} | ||
| 60 | .clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} | ||
| 61 | .clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} | ||
| 62 | |||
| 63 | /* Resize */ | ||
| 64 | .clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} | ||
| 65 | .clearlooks2 .mceResizable .mceResize {display:block} | ||
| 66 | .clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} | ||
| 67 | .clearlooks2 .mceMinimizable .mceMin {display:block} | ||
| 68 | .clearlooks2 .mceMaximizable .mceMax {display:block} | ||
| 69 | .clearlooks2 .mceMaximized .mceMed {display:block} | ||
| 70 | .clearlooks2 .mceMaximized .mceMax {display:none} | ||
| 71 | .clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} | ||
| 72 | .clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} | ||
| 73 | .clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} | ||
| 74 | .clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} | ||
| 75 | .clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} | ||
| 76 | .clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} | ||
| 77 | .clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} | ||
| 78 | .clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} | ||
| 79 | |||
| 80 | /* Alert/Confirm */ | ||
| 81 | .clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} | ||
| 82 | .clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} | ||
| 83 | .clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} | ||
| 84 | .clearlooks2 a:hover {font-weight:bold;} | ||
| 85 | .clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} | ||
| 86 | .clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} | ||
| 87 | .clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} | ||
| 88 | .clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} | ||
| 89 | .clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} | ||
| 90 | .clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm b/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm new file mode 100755 index 0000000..f9ec642 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm | |||
| @@ -0,0 +1,387 @@ | |||
| 1 | <!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> --> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>Template for dialogs</title> | ||
| 5 | <link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css" /> | ||
| 6 | </head> | ||
| 7 | <body> | ||
| 8 | |||
| 9 | <div class="mceEditor"> | ||
| 10 | <div class="clearlooks2" style="width:400px; height:100px; left:10px;"> | ||
| 11 | <div class="mceWrapper"> | ||
| 12 | <div class="mceTop"> | ||
| 13 | <div class="mceLeft"></div> | ||
| 14 | <div class="mceCenter"></div> | ||
| 15 | <div class="mceRight"></div> | ||
| 16 | <span>Blured</span> | ||
| 17 | </div> | ||
| 18 | |||
| 19 | <div class="mceMiddle"> | ||
| 20 | <div class="mceLeft"></div> | ||
| 21 | <span>Content</span> | ||
| 22 | <div class="mceRight"></div> | ||
| 23 | </div> | ||
| 24 | |||
| 25 | <div class="mceBottom"> | ||
| 26 | <div class="mceLeft"></div> | ||
| 27 | <div class="mceCenter"></div> | ||
| 28 | <div class="mceRight"></div> | ||
| 29 | <span>Statusbar text.</span> | ||
| 30 | </div> | ||
| 31 | |||
| 32 | <a class="mceMove" href="#"></a> | ||
| 33 | <a class="mceMin" href="#"></a> | ||
| 34 | <a class="mceMax" href="#"></a> | ||
| 35 | <a class="mceMed" href="#"></a> | ||
| 36 | <a class="mceClose" href="#"></a> | ||
| 37 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 38 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 39 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 40 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 41 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 42 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 43 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 44 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 45 | </div> | ||
| 46 | </div> | ||
| 47 | |||
| 48 | <div class="clearlooks2" style="width:400px; height:100px; left:420px;"> | ||
| 49 | <div class="mceWrapper mceMovable mceFocus"> | ||
| 50 | <div class="mceTop"> | ||
| 51 | <div class="mceLeft"></div> | ||
| 52 | <div class="mceCenter"></div> | ||
| 53 | <div class="mceRight"></div> | ||
| 54 | <span>Focused</span> | ||
| 55 | </div> | ||
| 56 | |||
| 57 | <div class="mceMiddle"> | ||
| 58 | <div class="mceLeft"></div> | ||
| 59 | <span>Content</span> | ||
| 60 | <div class="mceRight"></div> | ||
| 61 | </div> | ||
| 62 | |||
| 63 | <div class="mceBottom"> | ||
| 64 | <div class="mceLeft"></div> | ||
| 65 | <div class="mceCenter"></div> | ||
| 66 | <div class="mceRight"></div> | ||
| 67 | <span>Statusbar text.</span> | ||
| 68 | </div> | ||
| 69 | |||
| 70 | <a class="mceMove" href="#"></a> | ||
| 71 | <a class="mceMin" href="#"></a> | ||
| 72 | <a class="mceMax" href="#"></a> | ||
| 73 | <a class="mceMed" href="#"></a> | ||
| 74 | <a class="mceClose" href="#"></a> | ||
| 75 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 76 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 77 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 78 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 79 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 80 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 81 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 82 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 83 | </div> | ||
| 84 | </div> | ||
| 85 | |||
| 86 | <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:120px;"> | ||
| 87 | <div class="mceWrapper mceMovable mceFocus mceStatusbar"> | ||
| 88 | <div class="mceTop"> | ||
| 89 | <div class="mceLeft"></div> | ||
| 90 | <div class="mceCenter"></div> | ||
| 91 | <div class="mceRight"></div> | ||
| 92 | <span>Statusbar</span> | ||
| 93 | </div> | ||
| 94 | |||
| 95 | <div class="mceMiddle"> | ||
| 96 | <div class="mceLeft"></div> | ||
| 97 | <span>Content</span> | ||
| 98 | <div class="mceRight"></div> | ||
| 99 | </div> | ||
| 100 | |||
| 101 | <div class="mceBottom"> | ||
| 102 | <div class="mceLeft"></div> | ||
| 103 | <div class="mceCenter"></div> | ||
| 104 | <div class="mceRight"></div> | ||
| 105 | <span>Statusbar text.</span> | ||
| 106 | </div> | ||
| 107 | |||
| 108 | <a class="mceMove" href="#"></a> | ||
| 109 | <a class="mceMin" href="#"></a> | ||
| 110 | <a class="mceMax" href="#"></a> | ||
| 111 | <a class="mceMed" href="#"></a> | ||
| 112 | <a class="mceClose" href="#"></a> | ||
| 113 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 114 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 115 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 116 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 117 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 118 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 119 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 120 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 121 | </div> | ||
| 122 | </div> | ||
| 123 | |||
| 124 | <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:120px;"> | ||
| 125 | <div class="mceWrapper mceMovable mceFocus mceStatusbar mceResizable"> | ||
| 126 | <div class="mceTop"> | ||
| 127 | <div class="mceLeft"></div> | ||
| 128 | <div class="mceCenter"></div> | ||
| 129 | <div class="mceRight"></div> | ||
| 130 | <span>Statusbar, Resizable</span> | ||
| 131 | </div> | ||
| 132 | |||
| 133 | <div class="mceMiddle"> | ||
| 134 | <div class="mceLeft"></div> | ||
| 135 | <span>Content</span> | ||
| 136 | <div class="mceRight"></div> | ||
| 137 | </div> | ||
| 138 | |||
| 139 | <div class="mceBottom"> | ||
| 140 | <div class="mceLeft"></div> | ||
| 141 | <div class="mceCenter"></div> | ||
| 142 | <div class="mceRight"></div> | ||
| 143 | <span>Statusbar text.</span> | ||
| 144 | </div> | ||
| 145 | |||
| 146 | <a class="mceMove" href="#"></a> | ||
| 147 | <a class="mceMin" href="#"></a> | ||
| 148 | <a class="mceMax" href="#"></a> | ||
| 149 | <a class="mceMed" href="#"></a> | ||
| 150 | <a class="mceClose" href="#"></a> | ||
| 151 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 152 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 153 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 154 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 155 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 156 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 157 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 158 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 159 | </div> | ||
| 160 | </div> | ||
| 161 | |||
| 162 | <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:230px;"> | ||
| 163 | <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximizable"> | ||
| 164 | <div class="mceTop"> | ||
| 165 | <div class="mceLeft"></div> | ||
| 166 | <div class="mceCenter"></div> | ||
| 167 | <div class="mceRight"></div> | ||
| 168 | <span>Resizable, Maximizable</span> | ||
| 169 | </div> | ||
| 170 | |||
| 171 | <div class="mceMiddle"> | ||
| 172 | <div class="mceLeft"></div> | ||
| 173 | <span>Content</span> | ||
| 174 | <div class="mceRight"></div> | ||
| 175 | </div> | ||
| 176 | |||
| 177 | <div class="mceBottom"> | ||
| 178 | <div class="mceLeft"></div> | ||
| 179 | <div class="mceCenter"></div> | ||
| 180 | <div class="mceRight"></div> | ||
| 181 | <span>Statusbar text.</span> | ||
| 182 | </div> | ||
| 183 | |||
| 184 | <a class="mceMove" href="#"></a> | ||
| 185 | <a class="mceMin" href="#"></a> | ||
| 186 | <a class="mceMax" href="#"></a> | ||
| 187 | <a class="mceMed" href="#"></a> | ||
| 188 | <a class="mceClose" href="#"></a> | ||
| 189 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 190 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 191 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 192 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 193 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 194 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 195 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 196 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 197 | </div> | ||
| 198 | </div> | ||
| 199 | |||
| 200 | <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:230px;"> | ||
| 201 | <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximizable"> | ||
| 202 | <div class="mceTop"> | ||
| 203 | <div class="mceLeft"></div> | ||
| 204 | <div class="mceCenter"></div> | ||
| 205 | <div class="mceRight"></div> | ||
| 206 | <span>Blurred, Maximizable, Statusbar, Resizable</span> | ||
| 207 | </div> | ||
| 208 | |||
| 209 | <div class="mceMiddle"> | ||
| 210 | <div class="mceLeft"></div> | ||
| 211 | <span>Content</span> | ||
| 212 | <div class="mceRight"></div> | ||
| 213 | </div> | ||
| 214 | |||
| 215 | <div class="mceBottom"> | ||
| 216 | <div class="mceLeft"></div> | ||
| 217 | <div class="mceCenter"></div> | ||
| 218 | <div class="mceRight"></div> | ||
| 219 | <span>Statusbar text.</span> | ||
| 220 | </div> | ||
| 221 | |||
| 222 | <a class="mceMove" href="#"></a> | ||
| 223 | <a class="mceMin" href="#"></a> | ||
| 224 | <a class="mceMax" href="#"></a> | ||
| 225 | <a class="mceMed" href="#"></a> | ||
| 226 | <a class="mceClose" href="#"></a> | ||
| 227 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 228 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 229 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 230 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 231 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 232 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 233 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 234 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 235 | </div> | ||
| 236 | </div> | ||
| 237 | |||
| 238 | <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:340px;"> | ||
| 239 | <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximized mceMinimizable mceMaximizable"> | ||
| 240 | <div class="mceTop"> | ||
| 241 | <div class="mceLeft"></div> | ||
| 242 | <div class="mceCenter"></div> | ||
| 243 | <div class="mceRight"></div> | ||
| 244 | <span>Maximized, Maximizable, Minimizable</span> | ||
| 245 | </div> | ||
| 246 | |||
| 247 | <div class="mceMiddle"> | ||
| 248 | <div class="mceLeft"></div> | ||
| 249 | <span>Content</span> | ||
| 250 | <div class="mceRight"></div> | ||
| 251 | </div> | ||
| 252 | |||
| 253 | <div class="mceBottom"> | ||
| 254 | <div class="mceLeft"></div> | ||
| 255 | <div class="mceCenter"></div> | ||
| 256 | <div class="mceRight"></div> | ||
| 257 | <span>Statusbar text.</span> | ||
| 258 | </div> | ||
| 259 | |||
| 260 | <a class="mceMove" href="#"></a> | ||
| 261 | <a class="mceMin" href="#"></a> | ||
| 262 | <a class="mceMax" href="#"></a> | ||
| 263 | <a class="mceMed" href="#"></a> | ||
| 264 | <a class="mceClose" href="#"></a> | ||
| 265 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 266 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 267 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 268 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 269 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 270 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 271 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 272 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 273 | </div> | ||
| 274 | </div> | ||
| 275 | |||
| 276 | <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:340px;"> | ||
| 277 | <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximized mceMinimizable mceMaximizable"> | ||
| 278 | <div class="mceTop"> | ||
| 279 | <div class="mceLeft"></div> | ||
| 280 | <div class="mceCenter"></div> | ||
| 281 | <div class="mceRight"></div> | ||
| 282 | <span>Blured</span> | ||
| 283 | </div> | ||
| 284 | |||
| 285 | <div class="mceMiddle"> | ||
| 286 | <div class="mceLeft"></div> | ||
| 287 | <span>Content</span> | ||
| 288 | <div class="mceRight"></div> | ||
| 289 | </div> | ||
| 290 | |||
| 291 | <div class="mceBottom"> | ||
| 292 | <div class="mceLeft"></div> | ||
| 293 | <div class="mceCenter"></div> | ||
| 294 | <div class="mceRight"></div> | ||
| 295 | <span>Statusbar text.</span> | ||
| 296 | </div> | ||
| 297 | |||
| 298 | <a class="mceMove" href="#"></a> | ||
| 299 | <a class="mceMin" href="#"></a> | ||
| 300 | <a class="mceMax" href="#"></a> | ||
| 301 | <a class="mceMed" href="#"></a> | ||
| 302 | <a class="mceClose" href="#"></a> | ||
| 303 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 304 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 305 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 306 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 307 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 308 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 309 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 310 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 311 | </div> | ||
| 312 | </div> | ||
| 313 | |||
| 314 | <div class="clearlooks2" style="width:400px; height:130px; left:10px; top:450px;"> | ||
| 315 | <div class="mceWrapper mceMovable mceFocus mceModal mceAlert"> | ||
| 316 | <div class="mceTop"> | ||
| 317 | <div class="mceLeft"></div> | ||
| 318 | <div class="mceCenter"></div> | ||
| 319 | <div class="mceRight"></div> | ||
| 320 | <span>Alert</span> | ||
| 321 | </div> | ||
| 322 | |||
| 323 | <div class="mceMiddle"> | ||
| 324 | <div class="mceLeft"></div> | ||
| 325 | <span> | ||
| 326 | This is a very long error message. This is a very long error message. | ||
| 327 | This is a very long error message. This is a very long error message. | ||
| 328 | This is a very long error message. This is a very long error message. | ||
| 329 | This is a very long error message. This is a very long error message. | ||
| 330 | This is a very long error message. This is a very long error message. | ||
| 331 | This is a very long error message. This is a very long error message. | ||
| 332 | </span> | ||
| 333 | <div class="mceRight"></div> | ||
| 334 | <div class="mceIcon"></div> | ||
| 335 | </div> | ||
| 336 | |||
| 337 | <div class="mceBottom"> | ||
| 338 | <div class="mceLeft"></div> | ||
| 339 | <div class="mceCenter"></div> | ||
| 340 | <div class="mceRight"></div> | ||
| 341 | </div> | ||
| 342 | |||
| 343 | <a class="mceMove" href="#"></a> | ||
| 344 | <a class="mceButton mceOk" href="#">Ok</a> | ||
| 345 | <a class="mceClose" href="#"></a> | ||
| 346 | </div> | ||
| 347 | </div> | ||
| 348 | |||
| 349 | <div class="clearlooks2" style="width:400px; height:130px; left:420px; top:450px;"> | ||
| 350 | <div class="mceWrapper mceMovable mceFocus mceModal mceConfirm"> | ||
| 351 | <div class="mceTop"> | ||
| 352 | <div class="mceLeft"></div> | ||
| 353 | <div class="mceCenter"></div> | ||
| 354 | <div class="mceRight"></div> | ||
| 355 | <span>Confirm</span> | ||
| 356 | </div> | ||
| 357 | |||
| 358 | <div class="mceMiddle"> | ||
| 359 | <div class="mceLeft"></div> | ||
| 360 | <span> | ||
| 361 | This is a very long error message. This is a very long error message. | ||
| 362 | This is a very long error message. This is a very long error message. | ||
| 363 | This is a very long error message. This is a very long error message. | ||
| 364 | This is a very long error message. This is a very long error message. | ||
| 365 | This is a very long error message. This is a very long error message. | ||
| 366 | This is a very long error message. This is a very long error message. | ||
| 367 | </span> | ||
| 368 | <div class="mceRight"></div> | ||
| 369 | <div class="mceIcon"></div> | ||
| 370 | </div> | ||
| 371 | |||
| 372 | <div class="mceBottom"> | ||
| 373 | <div class="mceLeft"></div> | ||
| 374 | <div class="mceCenter"></div> | ||
| 375 | <div class="mceRight"></div> | ||
| 376 | </div> | ||
| 377 | |||
| 378 | <a class="mceMove" href="#"></a> | ||
| 379 | <a class="mceButton mceOk" href="#">Ok</a> | ||
| 380 | <a class="mceButton mceCancel" href="#">Cancel</a> | ||
| 381 | <a class="mceClose" href="#"></a> | ||
| 382 | </div> | ||
| 383 | </div> | ||
| 384 | </div> | ||
| 385 | |||
| 386 | </body> | ||
| 387 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js b/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js new file mode 100755 index 0000000..34d4cec --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.InsertDateTime',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceInsertDate',function(){var str=t._getDateTime(new Date(),ed.getParam("plugin_insertdate_dateFormat",ed.getLang('insertdatetime.date_fmt')));ed.execCommand('mceInsertContent',false,str);});ed.addCommand('mceInsertTime',function(){var str=t._getDateTime(new Date(),ed.getParam("plugin_insertdate_timeFormat",ed.getLang('insertdatetime.time_fmt')));ed.execCommand('mceInsertContent',false,str);});ed.addButton('insertdate',{title:'insertdatetime.insertdate_desc',cmd:'mceInsertDate'});ed.addButton('inserttime',{title:'insertdatetime.inserttime_desc',cmd:'mceInsertTime'});},getInfo:function(){return{longname:'Insert date/time',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_getDateTime:function(d,fmt){var ed=this.editor;function addZeros(value,len){value=""+value;if(value.length<len){for(var i=0;i<(len-value.length);i++)value="0"+value;}return value;};fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt.replace("%y",""+d.getYear());fmt=fmt.replace("%m",addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%B",""+ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);fmt=fmt.replace("%b",""+ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);fmt=fmt.replace("%A",""+ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);fmt=fmt.replace("%a",""+ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);fmt=fmt.replace("%%","%");return fmt;}});tinymce.PluginManager.add('insertdatetime',tinymce.plugins.InsertDateTime);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js new file mode 100755 index 0000000..9ab3135 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.InsertDateTime', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | ed.addCommand('mceInsertDate', function() { | ||
| 16 | var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt'))); | ||
| 17 | |||
| 18 | ed.execCommand('mceInsertContent', false, str); | ||
| 19 | }); | ||
| 20 | |||
| 21 | ed.addCommand('mceInsertTime', function() { | ||
| 22 | var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt'))); | ||
| 23 | |||
| 24 | ed.execCommand('mceInsertContent', false, str); | ||
| 25 | }); | ||
| 26 | |||
| 27 | ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'}); | ||
| 28 | ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'}); | ||
| 29 | }, | ||
| 30 | |||
| 31 | getInfo : function() { | ||
| 32 | return { | ||
| 33 | longname : 'Insert date/time', | ||
| 34 | author : 'Moxiecode Systems AB', | ||
| 35 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 36 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime', | ||
| 37 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 38 | }; | ||
| 39 | }, | ||
| 40 | |||
| 41 | // Private methods | ||
| 42 | |||
| 43 | _getDateTime : function(d, fmt) { | ||
| 44 | var ed = this.editor; | ||
| 45 | |||
| 46 | function addZeros(value, len) { | ||
| 47 | value = "" + value; | ||
| 48 | |||
| 49 | if (value.length < len) { | ||
| 50 | for (var i=0; i<(len-value.length); i++) | ||
| 51 | value = "0" + value; | ||
| 52 | } | ||
| 53 | |||
| 54 | return value; | ||
| 55 | }; | ||
| 56 | |||
| 57 | fmt = fmt.replace("%D", "%m/%d/%y"); | ||
| 58 | fmt = fmt.replace("%r", "%I:%M:%S %p"); | ||
| 59 | fmt = fmt.replace("%Y", "" + d.getFullYear()); | ||
| 60 | fmt = fmt.replace("%y", "" + d.getYear()); | ||
| 61 | fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); | ||
| 62 | fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); | ||
| 63 | fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); | ||
| 64 | fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); | ||
| 65 | fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); | ||
| 66 | fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); | ||
| 67 | fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); | ||
| 68 | fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]); | ||
| 69 | fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]); | ||
| 70 | fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]); | ||
| 71 | fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]); | ||
| 72 | fmt = fmt.replace("%%", "%"); | ||
| 73 | |||
| 74 | return fmt; | ||
| 75 | } | ||
| 76 | }); | ||
| 77 | |||
| 78 | // Register plugin | ||
| 79 | tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime); | ||
| 80 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js b/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js new file mode 100755 index 0000000..4cd9427 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.Layer',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceInsertLayer',t._insertLayer,t);ed.addCommand('mceMoveForward',function(){t._move(1);});ed.addCommand('mceMoveBackward',function(){t._move(-1);});ed.addCommand('mceMakeAbsolute',function(){t._toggleAbsolute();});ed.addButton('moveforward',{title:'layer.forward_desc',cmd:'mceMoveForward'});ed.addButton('movebackward',{title:'layer.backward_desc',cmd:'mceMoveBackward'});ed.addButton('absolute',{title:'layer.absolute_desc',cmd:'mceMakeAbsolute'});ed.addButton('insertlayer',{title:'layer.insertlayer_desc',cmd:'mceInsertLayer'});ed.onInit.add(function(){if(tinymce.isIE)ed.getDoc().execCommand('2D-Position',false,true);});ed.onNodeChange.add(t._nodeChange,t);ed.onVisualAid.add(t._visualAid,t);},getInfo:function(){return{longname:'Layer',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var le,p;le=this._getParentLayer(n);p=ed.dom.getParent(n,'DIV,P,IMG');if(!p){cm.setDisabled('absolute',1);cm.setDisabled('moveforward',1);cm.setDisabled('movebackward',1);}else{cm.setDisabled('absolute',0);cm.setDisabled('moveforward',!le);cm.setDisabled('movebackward',!le);cm.setActive('absolute',le&&le.style.position.toLowerCase()=="absolute");}},_visualAid:function(ed,e,s){var dom=ed.dom;tinymce.each(dom.select('div,p',e),function(e){if(/^(absolute|relative|static)$/i.test(e.style.position)){if(s)dom.addClass(e,'mceItemVisualAid');else dom.removeClass(e,'mceItemVisualAid');}});},_move:function(d){var ed=this.editor,i,z=[],le=this._getParentLayer(ed.selection.getNode()),ci=-1,fi=-1,nl;nl=[];tinymce.walk(ed.getBody(),function(n){if(n.nodeType==1&&/^(absolute|relative|static)$/i.test(n.style.position))nl.push(n);},'childNodes');for(i=0;i<nl.length;i++){z[i]=nl[i].style.zIndex?parseInt(nl[i].style.zIndex):0;if(ci<0&&nl[i]==le)ci=i;}if(d<0){for(i=0;i<z.length;i++){if(z[i]<z[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else{if(z[ci]>0)nl[ci].style.zIndex=z[ci]-1;}}else{for(i=0;i<z.length;i++){if(z[i]>z[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else nl[ci].style.zIndex=z[ci]+1;}ed.execCommand('mceRepaint');},_getParentLayer:function(n){return this.editor.dom.getParent(n,function(n){return n.nodeType==1&&/^(absolute|relative|static)$/i.test(n.style.position);});},_insertLayer:function(){var ed=this.editor,p=ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(),'*'));ed.dom.add(ed.getBody(),'div',{style:{position:'absolute',left:p.x,top:(p.y>20?p.y:20),width:100,height:100},'class':'mceItemVisualAid'},ed.selection.getContent()||ed.getLang('layer.content'));},_toggleAbsolute:function(){var ed=this.editor,le=this._getParentLayer(ed.selection.getNode());if(!le)le=ed.dom.getParent(ed.selection.getNode(),'DIV,P,IMG');if(le){if(le.style.position.toLowerCase()=="absolute"){ed.dom.setStyles(le,{position:'',left:'',top:'',width:'',height:''});ed.dom.removeClass(le,'mceItemVisualAid');}else{if(le.style.left=="")le.style.left=20+'px';if(le.style.top=="")le.style.top=20+'px';if(le.style.width=="")le.style.width=le.width?(le.width+'px'):'100px';if(le.style.height=="")le.style.height=le.height?(le.height+'px'):'100px';le.style.position="absolute";ed.addVisual(ed.getBody());}ed.execCommand('mceRepaint');ed.nodeChanged();}}});tinymce.PluginManager.add('layer',tinymce.plugins.Layer);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js new file mode 100755 index 0000000..a72f6c3 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js | |||
| @@ -0,0 +1,209 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 652 2008-02-29 13:09:46Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Layer', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mceInsertLayer', t._insertLayer, t); | ||
| 17 | |||
| 18 | ed.addCommand('mceMoveForward', function() { | ||
| 19 | t._move(1); | ||
| 20 | }); | ||
| 21 | |||
| 22 | ed.addCommand('mceMoveBackward', function() { | ||
| 23 | t._move(-1); | ||
| 24 | }); | ||
| 25 | |||
| 26 | ed.addCommand('mceMakeAbsolute', function() { | ||
| 27 | t._toggleAbsolute(); | ||
| 28 | }); | ||
| 29 | |||
| 30 | // Register buttons | ||
| 31 | ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); | ||
| 32 | ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); | ||
| 33 | ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); | ||
| 34 | ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); | ||
| 35 | |||
| 36 | ed.onInit.add(function() { | ||
| 37 | if (tinymce.isIE) | ||
| 38 | ed.getDoc().execCommand('2D-Position', false, true); | ||
| 39 | }); | ||
| 40 | |||
| 41 | ed.onNodeChange.add(t._nodeChange, t); | ||
| 42 | ed.onVisualAid.add(t._visualAid, t); | ||
| 43 | }, | ||
| 44 | |||
| 45 | getInfo : function() { | ||
| 46 | return { | ||
| 47 | longname : 'Layer', | ||
| 48 | author : 'Moxiecode Systems AB', | ||
| 49 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 50 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', | ||
| 51 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 52 | }; | ||
| 53 | }, | ||
| 54 | |||
| 55 | // Private methods | ||
| 56 | |||
| 57 | _nodeChange : function(ed, cm, n) { | ||
| 58 | var le, p; | ||
| 59 | |||
| 60 | le = this._getParentLayer(n); | ||
| 61 | p = ed.dom.getParent(n, 'DIV,P,IMG'); | ||
| 62 | |||
| 63 | if (!p) { | ||
| 64 | cm.setDisabled('absolute', 1); | ||
| 65 | cm.setDisabled('moveforward', 1); | ||
| 66 | cm.setDisabled('movebackward', 1); | ||
| 67 | } else { | ||
| 68 | cm.setDisabled('absolute', 0); | ||
| 69 | cm.setDisabled('moveforward', !le); | ||
| 70 | cm.setDisabled('movebackward', !le); | ||
| 71 | cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); | ||
| 72 | } | ||
| 73 | }, | ||
| 74 | |||
| 75 | // Private methods | ||
| 76 | |||
| 77 | _visualAid : function(ed, e, s) { | ||
| 78 | var dom = ed.dom; | ||
| 79 | |||
| 80 | tinymce.each(dom.select('div,p', e), function(e) { | ||
| 81 | if (/^(absolute|relative|static)$/i.test(e.style.position)) { | ||
| 82 | if (s) | ||
| 83 | dom.addClass(e, 'mceItemVisualAid'); | ||
| 84 | else | ||
| 85 | dom.removeClass(e, 'mceItemVisualAid'); | ||
| 86 | } | ||
| 87 | }); | ||
| 88 | }, | ||
| 89 | |||
| 90 | _move : function(d) { | ||
| 91 | var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; | ||
| 92 | |||
| 93 | nl = []; | ||
| 94 | tinymce.walk(ed.getBody(), function(n) { | ||
| 95 | if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) | ||
| 96 | nl.push(n); | ||
| 97 | }, 'childNodes'); | ||
| 98 | |||
| 99 | // Find z-indexes | ||
| 100 | for (i=0; i<nl.length; i++) { | ||
| 101 | z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0; | ||
| 102 | |||
| 103 | if (ci < 0 && nl[i] == le) | ||
| 104 | ci = i; | ||
| 105 | } | ||
| 106 | |||
| 107 | if (d < 0) { | ||
| 108 | // Move back | ||
| 109 | |||
| 110 | // Try find a lower one | ||
| 111 | for (i=0; i<z.length; i++) { | ||
| 112 | if (z[i] < z[ci]) { | ||
| 113 | fi = i; | ||
| 114 | break; | ||
| 115 | } | ||
| 116 | } | ||
| 117 | |||
| 118 | if (fi > -1) { | ||
| 119 | nl[ci].style.zIndex = z[fi]; | ||
| 120 | nl[fi].style.zIndex = z[ci]; | ||
| 121 | } else { | ||
| 122 | if (z[ci] > 0) | ||
| 123 | nl[ci].style.zIndex = z[ci] - 1; | ||
| 124 | } | ||
| 125 | } else { | ||
| 126 | // Move forward | ||
| 127 | |||
| 128 | // Try find a higher one | ||
| 129 | for (i=0; i<z.length; i++) { | ||
| 130 | if (z[i] > z[ci]) { | ||
| 131 | fi = i; | ||
| 132 | break; | ||
| 133 | } | ||
| 134 | } | ||
| 135 | |||
| 136 | if (fi > -1) { | ||
| 137 | nl[ci].style.zIndex = z[fi]; | ||
| 138 | nl[fi].style.zIndex = z[ci]; | ||
| 139 | } else | ||
| 140 | nl[ci].style.zIndex = z[ci] + 1; | ||
| 141 | } | ||
| 142 | |||
| 143 | ed.execCommand('mceRepaint'); | ||
| 144 | }, | ||
| 145 | |||
| 146 | _getParentLayer : function(n) { | ||
| 147 | return this.editor.dom.getParent(n, function(n) { | ||
| 148 | return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); | ||
| 149 | }); | ||
| 150 | }, | ||
| 151 | |||
| 152 | _insertLayer : function() { | ||
| 153 | var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*')); | ||
| 154 | |||
| 155 | ed.dom.add(ed.getBody(), 'div', { | ||
| 156 | style : { | ||
| 157 | position : 'absolute', | ||
| 158 | left : p.x, | ||
| 159 | top : (p.y > 20 ? p.y : 20), | ||
| 160 | width : 100, | ||
| 161 | height : 100 | ||
| 162 | }, | ||
| 163 | 'class' : 'mceItemVisualAid' | ||
| 164 | }, ed.selection.getContent() || ed.getLang('layer.content')); | ||
| 165 | }, | ||
| 166 | |||
| 167 | _toggleAbsolute : function() { | ||
| 168 | var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); | ||
| 169 | |||
| 170 | if (!le) | ||
| 171 | le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); | ||
| 172 | |||
| 173 | if (le) { | ||
| 174 | if (le.style.position.toLowerCase() == "absolute") { | ||
| 175 | ed.dom.setStyles(le, { | ||
| 176 | position : '', | ||
| 177 | left : '', | ||
| 178 | top : '', | ||
| 179 | width : '', | ||
| 180 | height : '' | ||
| 181 | }); | ||
| 182 | |||
| 183 | ed.dom.removeClass(le, 'mceItemVisualAid'); | ||
| 184 | } else { | ||
| 185 | if (le.style.left == "") | ||
| 186 | le.style.left = 20 + 'px'; | ||
| 187 | |||
| 188 | if (le.style.top == "") | ||
| 189 | le.style.top = 20 + 'px'; | ||
| 190 | |||
| 191 | if (le.style.width == "") | ||
| 192 | le.style.width = le.width ? (le.width + 'px') : '100px'; | ||
| 193 | |||
| 194 | if (le.style.height == "") | ||
| 195 | le.style.height = le.height ? (le.height + 'px') : '100px'; | ||
| 196 | |||
| 197 | le.style.position = "absolute"; | ||
| 198 | ed.addVisual(ed.getBody()); | ||
| 199 | } | ||
| 200 | |||
| 201 | ed.execCommand('mceRepaint'); | ||
| 202 | ed.nodeChanged(); | ||
| 203 | } | ||
| 204 | } | ||
| 205 | }); | ||
| 206 | |||
| 207 | // Register plugin | ||
| 208 | tinymce.PluginManager.add('layer', tinymce.plugins.Layer); | ||
| 209 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/css/content.css b/public/javascripts/tiny_mce/plugins/media/css/content.css new file mode 100755 index 0000000..1bf6a75 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/css/content.css | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | .mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;} | ||
| 2 | .mceItemShockWave {background-image: url(../img/shockwave.gif);} | ||
| 3 | .mceItemFlash {background-image:url(../img/flash.gif);} | ||
| 4 | .mceItemQuickTime {background-image:url(../img/quicktime.gif);} | ||
| 5 | .mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);} | ||
| 6 | .mceItemRealMedia {background-image:url(../img/realmedia.gif);} | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/css/media.css b/public/javascripts/tiny_mce/plugins/media/css/media.css new file mode 100755 index 0000000..2d08794 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/css/media.css | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #id, #name, #hspace, #vspace, #class_name, #align { width: 100px } | ||
| 2 | #hspace, #vspace { width: 50px } | ||
| 3 | #flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } | ||
| 4 | #flash_base, #flash_flashvars { width: 240px } | ||
| 5 | #width, #height { width: 40px } | ||
| 6 | #src, #media_type { width: 250px } | ||
| 7 | #class { width: 120px } | ||
| 8 | #prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto } | ||
| 9 | .panel_wrapper div.current { height: 390px; overflow: auto } | ||
| 10 | #flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } | ||
| 11 | .mceAddSelectValue { background-color: #DDDDDD } | ||
| 12 | #qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } | ||
| 13 | #wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } | ||
| 14 | #rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } | ||
| 15 | #shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } | ||
| 16 | #qt_qtsrc { width: 200px } | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/editor_plugin.js b/public/javascripts/tiny_mce/plugins/media/editor_plugin.js new file mode 100755 index 0000000..b226b00 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var each=tinymce.each;tinymce.create('tinymce.plugins.MediaPlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;function isMediaElm(n){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);};ed.onPreInit.add(function(){ed.serializer.addRules('param[name|value|_mce_value]');});ed.addCommand('mceMedia',function(){ed.windowManager.open({file:url+'/media.htm',width:430+parseInt(ed.getLang('media.delta_width',0)),height:470+parseInt(ed.getLang('media.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('media',{title:'media.desc',cmd:'mceMedia'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('media',n.nodeName=='IMG'&&isMediaElm(n));});ed.onInit.add(function(){var lo={mceItemFlash:'flash',mceItemShockWave:'shockwave',mceItemWindowsMedia:'windowsmedia',mceItemQuickTime:'quicktime',mceItemRealMedia:'realmedia'};ed.selection.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.selection.onBeforeSetContent.add(t._objectsToSpans,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.name=='img'){each(lo,function(v,k){if(ed.dom.hasClass(o.node,k)){o.name=v;o.title=ed.dom.getAttrib(o.node,'title');return false;}});}});}if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(e.nodeName=='IMG'&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)){m.add({title:'media.edit',icon:'media',cmd:'mceMedia'});}});}});ed.onBeforeSetContent.add(t._objectsToSpans,t);ed.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;if(o.set){t._spansToImgs(o.node);each(dom.select('IMG',o.node),function(n){var p;if(isMediaElm(n)){p=t._parse(n.title);dom.setAttrib(n,'width',dom.getAttrib(n,'width',p.width||100));dom.setAttrib(n,'height',dom.getAttrib(n,'height',p.height||100));}});}if(o.get){each(dom.select('IMG',o.node),function(n){var ci,cb,mt;if(ed.getParam('media_use_script')){if(isMediaElm(n))n.className=n.className.replace(/mceItem/g,'mceTemp');return;}switch(n.className){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=ed.getParam('media_wmp6_compatible')?'05589fa1-c356-11ce-bf01-00aa0055595a':'6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break;}if(ci){dom.replace(t._buildObj({classid:ci,codebase:cb,type:mt},n),n);}});}});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/_mce_value=/g,'value=');});if(ed.getParam('media_use_script')){function getAttr(s,n){n=new RegExp(n+'=\"([^\"]+)\"','g').exec(s);return n?ed.dom.decode(n[1]):'';};ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<img[^>]+>/g,function(im){var cl=getAttr(im,'class');if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)){at=t._parse(getAttr(im,'title'));at.width=getAttr(im,'width');at.height=getAttr(im,'height');im='<script type="text/javascript">write'+cl.substring(7)+'({'+t._serialize(at)+'});</script>';}return im;});});}},getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_objectsToSpans:function(ed,o){var t=this,h=o.content;h=h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(a,b,c){var o=t._parse(c);return'<img class="mceItem'+b+'" title="'+ed.dom.encode(c)+'" src="'+t.url+'/img/trans.gif" width="'+o.width+'" height="'+o.height+'" />'});h=h.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');h=h.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');h=h.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');h=h.replace(/<\/(object)([^>]*)>/gi,'</span>');h=h.replace(/<\/embed>/gi,'');h=h.replace(/<param([^>]*)>/gi,function(a,b){return'<span '+b.replace(/value=/gi,'_mce_value=')+' class="mceItemParam"></span>'});h=h.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');o.content=h;},_buildObj:function(o,n){var ob,ed=this.editor,dom=ed.dom,p=this._parse(n.title),stc;stc=ed.getParam('media_strict',true)&&o.type=='application/x-shockwave-flash';p.width=o.width=dom.getAttrib(n,'width')||100;p.height=o.height=dom.getAttrib(n,'height')||100;if(p.src)p.src=ed.convertURL(p.src,'src',n);if(stc){ob=dom.create('span',{mce_name:'object',type:'application/x-shockwave-flash',data:p.src,width:o.width,height:o.height});}else{ob=dom.create('span',{mce_name:'object',classid:"clsid:"+o.classid,codebase:o.codebase,width:o.width,height:o.height});}each(p,function(v,k){if(!/^(width|height|codebase|classid|_cx|_cy)$/.test(k)){if(o.type=='application/x-mplayer2'&&k=='src')k='url';if(v)dom.add(ob,'span',{mce_name:'param',name:k,'_mce_value':v});}});if(!stc)dom.add(ob,'span',tinymce.extend({mce_name:'embed',type:o.type},p));return ob;},_spansToImgs:function(p){var t=this,dom=t.editor.dom,im,ci;each(dom.select('span',p),function(n){if(dom.getAttrib(n,'class')=='mceItemObject'){ci=dom.getAttrib(n,"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':dom.replace(t._createImg('mceItemFlash',n),n);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}return;}if(dom.getAttrib(n,'class')=='mceItemEmbed'){switch(dom.getAttrib(n,'type')){case'application/x-shockwave-flash':dom.replace(t._createImg('mceItemFlash',n),n);break;case'application/x-director':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'application/x-mplayer2':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'video/quicktime':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'audio/x-pn-realaudio-plugin':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}}});},_createImg:function(cl,n){var im,dom=this.editor.dom,pa={},ti='',args;args=['id','name','width','height','bgcolor','align','flashvars','src','wmode','allowfullscreen','quality'];im=dom.create('img',{src:this.url+'/img/trans.gif',width:dom.getAttrib(n,'width')||100,height:dom.getAttrib(n,'height')||100,'class':cl});each(args,function(na){var v=dom.getAttrib(n,na);if(v)pa[na]=v;});each(dom.select('span',n),function(n){if(dom.hasClass(n,'mceItemParam'))pa[dom.getAttrib(n,'name')]=dom.getAttrib(n,'_mce_value');});if(pa.movie){pa.src=pa.movie;delete pa.movie;}n=dom.select('.mceItemEmbed',n)[0];if(n){each(args,function(na){var v=dom.getAttrib(n,na);if(v&&!pa[na])pa[na]=v;});}delete pa.width;delete pa.height;im.title=this._serialize(pa);return im;},_parse:function(s){return tinymce.util.JSON.parse('{'+s+'}');},_serialize:function(o){return tinymce.util.JSON.serialize(o).replace(/[{}]/g,'');}});tinymce.PluginManager.add('media',tinymce.plugins.MediaPlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js new file mode 100755 index 0000000..beec3bf --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js | |||
| @@ -0,0 +1,400 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 952 2008-11-03 17:56:04Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var each = tinymce.each; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.MediaPlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | t.url = url; | ||
| 17 | |||
| 18 | function isMediaElm(n) { | ||
| 19 | return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className); | ||
| 20 | }; | ||
| 21 | |||
| 22 | ed.onPreInit.add(function() { | ||
| 23 | // Force in _value parameter this extra parameter is required for older Opera versions | ||
| 24 | ed.serializer.addRules('param[name|value|_mce_value]'); | ||
| 25 | }); | ||
| 26 | |||
| 27 | // Register commands | ||
| 28 | ed.addCommand('mceMedia', function() { | ||
| 29 | ed.windowManager.open({ | ||
| 30 | file : url + '/media.htm', | ||
| 31 | width : 430 + parseInt(ed.getLang('media.delta_width', 0)), | ||
| 32 | height : 470 + parseInt(ed.getLang('media.delta_height', 0)), | ||
| 33 | inline : 1 | ||
| 34 | }, { | ||
| 35 | plugin_url : url | ||
| 36 | }); | ||
| 37 | }); | ||
| 38 | |||
| 39 | // Register buttons | ||
| 40 | ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'}); | ||
| 41 | |||
| 42 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 43 | cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n)); | ||
| 44 | }); | ||
| 45 | |||
| 46 | ed.onInit.add(function() { | ||
| 47 | var lo = { | ||
| 48 | mceItemFlash : 'flash', | ||
| 49 | mceItemShockWave : 'shockwave', | ||
| 50 | mceItemWindowsMedia : 'windowsmedia', | ||
| 51 | mceItemQuickTime : 'quicktime', | ||
| 52 | mceItemRealMedia : 'realmedia' | ||
| 53 | }; | ||
| 54 | |||
| 55 | ed.selection.onSetContent.add(function() { | ||
| 56 | t._spansToImgs(ed.getBody()); | ||
| 57 | }); | ||
| 58 | |||
| 59 | ed.selection.onBeforeSetContent.add(t._objectsToSpans, t); | ||
| 60 | |||
| 61 | if (ed.settings.content_css !== false) | ||
| 62 | ed.dom.loadCSS(url + "/css/content.css"); | ||
| 63 | |||
| 64 | if (ed.theme.onResolveName) { | ||
| 65 | ed.theme.onResolveName.add(function(th, o) { | ||
| 66 | if (o.name == 'img') { | ||
| 67 | each(lo, function(v, k) { | ||
| 68 | if (ed.dom.hasClass(o.node, k)) { | ||
| 69 | o.name = v; | ||
| 70 | o.title = ed.dom.getAttrib(o.node, 'title'); | ||
| 71 | return false; | ||
| 72 | } | ||
| 73 | }); | ||
| 74 | } | ||
| 75 | }); | ||
| 76 | } | ||
| 77 | |||
| 78 | if (ed && ed.plugins.contextmenu) { | ||
| 79 | ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { | ||
| 80 | if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) { | ||
| 81 | m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'}); | ||
| 82 | } | ||
| 83 | }); | ||
| 84 | } | ||
| 85 | }); | ||
| 86 | |||
| 87 | ed.onBeforeSetContent.add(t._objectsToSpans, t); | ||
| 88 | |||
| 89 | ed.onSetContent.add(function() { | ||
| 90 | t._spansToImgs(ed.getBody()); | ||
| 91 | }); | ||
| 92 | |||
| 93 | ed.onPreProcess.add(function(ed, o) { | ||
| 94 | var dom = ed.dom; | ||
| 95 | |||
| 96 | if (o.set) { | ||
| 97 | t._spansToImgs(o.node); | ||
| 98 | |||
| 99 | each(dom.select('IMG', o.node), function(n) { | ||
| 100 | var p; | ||
| 101 | |||
| 102 | if (isMediaElm(n)) { | ||
| 103 | p = t._parse(n.title); | ||
| 104 | dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100)); | ||
| 105 | dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100)); | ||
| 106 | } | ||
| 107 | }); | ||
| 108 | } | ||
| 109 | |||
| 110 | if (o.get) { | ||
| 111 | each(dom.select('IMG', o.node), function(n) { | ||
| 112 | var ci, cb, mt; | ||
| 113 | |||
| 114 | if (ed.getParam('media_use_script')) { | ||
| 115 | if (isMediaElm(n)) | ||
| 116 | n.className = n.className.replace(/mceItem/g, 'mceTemp'); | ||
| 117 | |||
| 118 | return; | ||
| 119 | } | ||
| 120 | |||
| 121 | switch (n.className) { | ||
| 122 | case 'mceItemFlash': | ||
| 123 | ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000'; | ||
| 124 | cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; | ||
| 125 | mt = 'application/x-shockwave-flash'; | ||
| 126 | break; | ||
| 127 | |||
| 128 | case 'mceItemShockWave': | ||
| 129 | ci = '166b1bca-3f9c-11cf-8075-444553540000'; | ||
| 130 | cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; | ||
| 131 | mt = 'application/x-director'; | ||
| 132 | break; | ||
| 133 | |||
| 134 | case 'mceItemWindowsMedia': | ||
| 135 | ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6'; | ||
| 136 | cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; | ||
| 137 | mt = 'application/x-mplayer2'; | ||
| 138 | break; | ||
| 139 | |||
| 140 | case 'mceItemQuickTime': | ||
| 141 | ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b'; | ||
| 142 | cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; | ||
| 143 | mt = 'video/quicktime'; | ||
| 144 | break; | ||
| 145 | |||
| 146 | case 'mceItemRealMedia': | ||
| 147 | ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa'; | ||
| 148 | cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; | ||
| 149 | mt = 'audio/x-pn-realaudio-plugin'; | ||
| 150 | break; | ||
| 151 | } | ||
| 152 | |||
| 153 | if (ci) { | ||
| 154 | dom.replace(t._buildObj({ | ||
| 155 | classid : ci, | ||
| 156 | codebase : cb, | ||
| 157 | type : mt | ||
| 158 | }, n), n); | ||
| 159 | } | ||
| 160 | }); | ||
| 161 | } | ||
| 162 | }); | ||
| 163 | |||
| 164 | ed.onPostProcess.add(function(ed, o) { | ||
| 165 | o.content = o.content.replace(/_mce_value=/g, 'value='); | ||
| 166 | }); | ||
| 167 | |||
| 168 | if (ed.getParam('media_use_script')) { | ||
| 169 | function getAttr(s, n) { | ||
| 170 | n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s); | ||
| 171 | |||
| 172 | return n ? ed.dom.decode(n[1]) : ''; | ||
| 173 | }; | ||
| 174 | |||
| 175 | ed.onPostProcess.add(function(ed, o) { | ||
| 176 | o.content = o.content.replace(/<img[^>]+>/g, function(im) { | ||
| 177 | var cl = getAttr(im, 'class'); | ||
| 178 | |||
| 179 | if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) { | ||
| 180 | at = t._parse(getAttr(im, 'title')); | ||
| 181 | at.width = getAttr(im, 'width'); | ||
| 182 | at.height = getAttr(im, 'height'); | ||
| 183 | im = '<script type="text/javascript">write' + cl.substring(7) + '({' + t._serialize(at) + '});</script>'; | ||
| 184 | } | ||
| 185 | |||
| 186 | return im; | ||
| 187 | }); | ||
| 188 | }); | ||
| 189 | } | ||
| 190 | }, | ||
| 191 | |||
| 192 | getInfo : function() { | ||
| 193 | return { | ||
| 194 | longname : 'Media', | ||
| 195 | author : 'Moxiecode Systems AB', | ||
| 196 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 197 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', | ||
| 198 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 199 | }; | ||
| 200 | }, | ||
| 201 | |||
| 202 | // Private methods | ||
| 203 | _objectsToSpans : function(ed, o) { | ||
| 204 | var t = this, h = o.content; | ||
| 205 | |||
| 206 | h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) { | ||
| 207 | var o = t._parse(c); | ||
| 208 | |||
| 209 | return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + t.url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />' | ||
| 210 | }); | ||
| 211 | |||
| 212 | h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>'); | ||
| 213 | h = h.replace(/<embed([^>]*)\/?>/gi, '<span class="mceItemEmbed" $1></span>'); | ||
| 214 | h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>'); | ||
| 215 | h = h.replace(/<\/(object)([^>]*)>/gi, '</span>'); | ||
| 216 | h = h.replace(/<\/embed>/gi, ''); | ||
| 217 | h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_mce_value=') + ' class="mceItemParam"></span>'}); | ||
| 218 | h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>'); | ||
| 219 | |||
| 220 | o.content = h; | ||
| 221 | }, | ||
| 222 | |||
| 223 | _buildObj : function(o, n) { | ||
| 224 | var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc; | ||
| 225 | |||
| 226 | stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash'; | ||
| 227 | |||
| 228 | p.width = o.width = dom.getAttrib(n, 'width') || 100; | ||
| 229 | p.height = o.height = dom.getAttrib(n, 'height') || 100; | ||
| 230 | |||
| 231 | if (p.src) | ||
| 232 | p.src = ed.convertURL(p.src, 'src', n); | ||
| 233 | |||
| 234 | if (stc) { | ||
| 235 | ob = dom.create('span', { | ||
| 236 | mce_name : 'object', | ||
| 237 | type : 'application/x-shockwave-flash', | ||
| 238 | data : p.src, | ||
| 239 | width : o.width, | ||
| 240 | height : o.height | ||
| 241 | }); | ||
| 242 | } else { | ||
| 243 | ob = dom.create('span', { | ||
| 244 | mce_name : 'object', | ||
| 245 | classid : "clsid:" + o.classid, | ||
| 246 | codebase : o.codebase, | ||
| 247 | width : o.width, | ||
| 248 | height : o.height | ||
| 249 | }); | ||
| 250 | } | ||
| 251 | |||
| 252 | each (p, function(v, k) { | ||
| 253 | if (!/^(width|height|codebase|classid|_cx|_cy)$/.test(k)) { | ||
| 254 | // Use url instead of src in IE for Windows media | ||
| 255 | if (o.type == 'application/x-mplayer2' && k == 'src') | ||
| 256 | k = 'url'; | ||
| 257 | |||
| 258 | if (v) | ||
| 259 | dom.add(ob, 'span', {mce_name : 'param', name : k, '_mce_value' : v}); | ||
| 260 | } | ||
| 261 | }); | ||
| 262 | |||
| 263 | if (!stc) | ||
| 264 | dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type}, p)); | ||
| 265 | |||
| 266 | return ob; | ||
| 267 | }, | ||
| 268 | |||
| 269 | _spansToImgs : function(p) { | ||
| 270 | var t = this, dom = t.editor.dom, im, ci; | ||
| 271 | |||
| 272 | each(dom.select('span', p), function(n) { | ||
| 273 | // Convert object into image | ||
| 274 | if (dom.getAttrib(n, 'class') == 'mceItemObject') { | ||
| 275 | ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, ''); | ||
| 276 | |||
| 277 | switch (ci) { | ||
| 278 | case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000': | ||
| 279 | dom.replace(t._createImg('mceItemFlash', n), n); | ||
| 280 | break; | ||
| 281 | |||
| 282 | case 'clsid:166b1bca-3f9c-11cf-8075-444553540000': | ||
| 283 | dom.replace(t._createImg('mceItemShockWave', n), n); | ||
| 284 | break; | ||
| 285 | |||
| 286 | case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6': | ||
| 287 | case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': | ||
| 288 | case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': | ||
| 289 | dom.replace(t._createImg('mceItemWindowsMedia', n), n); | ||
| 290 | break; | ||
| 291 | |||
| 292 | case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b': | ||
| 293 | dom.replace(t._createImg('mceItemQuickTime', n), n); | ||
| 294 | break; | ||
| 295 | |||
| 296 | case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa': | ||
| 297 | dom.replace(t._createImg('mceItemRealMedia', n), n); | ||
| 298 | break; | ||
| 299 | |||
| 300 | default: | ||
| 301 | dom.replace(t._createImg('mceItemFlash', n), n); | ||
| 302 | } | ||
| 303 | |||
| 304 | return; | ||
| 305 | } | ||
| 306 | |||
| 307 | // Convert embed into image | ||
| 308 | if (dom.getAttrib(n, 'class') == 'mceItemEmbed') { | ||
| 309 | switch (dom.getAttrib(n, 'type')) { | ||
| 310 | case 'application/x-shockwave-flash': | ||
| 311 | dom.replace(t._createImg('mceItemFlash', n), n); | ||
| 312 | break; | ||
| 313 | |||
| 314 | case 'application/x-director': | ||
| 315 | dom.replace(t._createImg('mceItemShockWave', n), n); | ||
| 316 | break; | ||
| 317 | |||
| 318 | case 'application/x-mplayer2': | ||
| 319 | dom.replace(t._createImg('mceItemWindowsMedia', n), n); | ||
| 320 | break; | ||
| 321 | |||
| 322 | case 'video/quicktime': | ||
| 323 | dom.replace(t._createImg('mceItemQuickTime', n), n); | ||
| 324 | break; | ||
| 325 | |||
| 326 | case 'audio/x-pn-realaudio-plugin': | ||
| 327 | dom.replace(t._createImg('mceItemRealMedia', n), n); | ||
| 328 | break; | ||
| 329 | |||
| 330 | default: | ||
| 331 | dom.replace(t._createImg('mceItemFlash', n), n); | ||
| 332 | } | ||
| 333 | } | ||
| 334 | }); | ||
| 335 | }, | ||
| 336 | |||
| 337 | _createImg : function(cl, n) { | ||
| 338 | var im, dom = this.editor.dom, pa = {}, ti = '', args; | ||
| 339 | |||
| 340 | args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality']; | ||
| 341 | |||
| 342 | // Create image | ||
| 343 | im = dom.create('img', { | ||
| 344 | src : this.url + '/img/trans.gif', | ||
| 345 | width : dom.getAttrib(n, 'width') || 100, | ||
| 346 | height : dom.getAttrib(n, 'height') || 100, | ||
| 347 | 'class' : cl | ||
| 348 | }); | ||
| 349 | |||
| 350 | // Setup base parameters | ||
| 351 | each(args, function(na) { | ||
| 352 | var v = dom.getAttrib(n, na); | ||
| 353 | |||
| 354 | if (v) | ||
| 355 | pa[na] = v; | ||
| 356 | }); | ||
| 357 | |||
| 358 | // Add optional parameters | ||
| 359 | each(dom.select('span', n), function(n) { | ||
| 360 | if (dom.hasClass(n, 'mceItemParam')) | ||
| 361 | pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value'); | ||
| 362 | }); | ||
| 363 | |||
| 364 | // Use src not movie | ||
| 365 | if (pa.movie) { | ||
| 366 | pa.src = pa.movie; | ||
| 367 | delete pa.movie; | ||
| 368 | } | ||
| 369 | |||
| 370 | // Merge with embed args | ||
| 371 | n = dom.select('.mceItemEmbed', n)[0]; | ||
| 372 | if (n) { | ||
| 373 | each(args, function(na) { | ||
| 374 | var v = dom.getAttrib(n, na); | ||
| 375 | |||
| 376 | if (v && !pa[na]) | ||
| 377 | pa[na] = v; | ||
| 378 | }); | ||
| 379 | } | ||
| 380 | |||
| 381 | delete pa.width; | ||
| 382 | delete pa.height; | ||
| 383 | |||
| 384 | im.title = this._serialize(pa); | ||
| 385 | |||
| 386 | return im; | ||
| 387 | }, | ||
| 388 | |||
| 389 | _parse : function(s) { | ||
| 390 | return tinymce.util.JSON.parse('{' + s + '}'); | ||
| 391 | }, | ||
| 392 | |||
| 393 | _serialize : function(o) { | ||
| 394 | return tinymce.util.JSON.serialize(o).replace(/[{}]/g, ''); | ||
| 395 | } | ||
| 396 | }); | ||
| 397 | |||
| 398 | // Register plugin | ||
| 399 | tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); | ||
| 400 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/flash.gif b/public/javascripts/tiny_mce/plugins/media/img/flash.gif new file mode 100755 index 0000000..cb192e6 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/img/flash.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf b/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf new file mode 100755 index 0000000..042c2ab --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif b/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif new file mode 100755 index 0000000..3b04991 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif b/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif new file mode 100755 index 0000000..fdfe0b9 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif b/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif new file mode 100755 index 0000000..5f235df --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/trans.gif b/public/javascripts/tiny_mce/plugins/media/img/trans.gif new file mode 100755 index 0000000..3884865 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/img/trans.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif b/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif new file mode 100755 index 0000000..ab50f2d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/js/embed.js b/public/javascripts/tiny_mce/plugins/media/js/embed.js new file mode 100755 index 0000000..f8dc810 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/js/embed.js | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | /** | ||
| 2 | * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. | ||
| 3 | */ | ||
| 4 | |||
| 5 | function writeFlash(p) { | ||
| 6 | writeEmbed( | ||
| 7 | 'D27CDB6E-AE6D-11cf-96B8-444553540000', | ||
| 8 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', | ||
| 9 | 'application/x-shockwave-flash', | ||
| 10 | p | ||
| 11 | ); | ||
| 12 | } | ||
| 13 | |||
| 14 | function writeShockWave(p) { | ||
| 15 | writeEmbed( | ||
| 16 | '166B1BCA-3F9C-11CF-8075-444553540000', | ||
| 17 | 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', | ||
| 18 | 'application/x-director', | ||
| 19 | p | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | function writeQuickTime(p) { | ||
| 24 | writeEmbed( | ||
| 25 | '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', | ||
| 26 | 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', | ||
| 27 | 'video/quicktime', | ||
| 28 | p | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | |||
| 32 | function writeRealMedia(p) { | ||
| 33 | writeEmbed( | ||
| 34 | 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', | ||
| 35 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', | ||
| 36 | 'audio/x-pn-realaudio-plugin', | ||
| 37 | p | ||
| 38 | ); | ||
| 39 | } | ||
| 40 | |||
| 41 | function writeWindowsMedia(p) { | ||
| 42 | p.url = p.src; | ||
| 43 | writeEmbed( | ||
| 44 | '6BF52A52-394A-11D3-B153-00C04F79FAA6', | ||
| 45 | 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', | ||
| 46 | 'application/x-mplayer2', | ||
| 47 | p | ||
| 48 | ); | ||
| 49 | } | ||
| 50 | |||
| 51 | function writeEmbed(cls, cb, mt, p) { | ||
| 52 | var h = '', n; | ||
| 53 | |||
| 54 | h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"'; | ||
| 55 | h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : ''; | ||
| 56 | h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : ''; | ||
| 57 | h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : ''; | ||
| 58 | h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : ''; | ||
| 59 | h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : ''; | ||
| 60 | h += '>'; | ||
| 61 | |||
| 62 | for (n in p) | ||
| 63 | h += '<param name="' + n + '" value="' + p[n] + '">'; | ||
| 64 | |||
| 65 | h += '<embed type="' + mt + '"'; | ||
| 66 | |||
| 67 | for (n in p) | ||
| 68 | h += n + '="' + p[n] + '" '; | ||
| 69 | |||
| 70 | h += '></embed></object>'; | ||
| 71 | |||
| 72 | document.write(h); | ||
| 73 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/js/media.js b/public/javascripts/tiny_mce/plugins/media/js/media.js new file mode 100755 index 0000000..fa8e142 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/js/media.js | |||
| @@ -0,0 +1,630 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var oldWidth, oldHeight, ed, url; | ||
| 4 | |||
| 5 | if (url = tinyMCEPopup.getParam("media_external_list_url")) | ||
| 6 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | var pl = "", f, val; | ||
| 10 | var type = "flash", fe, i; | ||
| 11 | |||
| 12 | ed = tinyMCEPopup.editor; | ||
| 13 | |||
| 14 | tinyMCEPopup.resizeToInnerSize(); | ||
| 15 | f = document.forms[0] | ||
| 16 | |||
| 17 | fe = ed.selection.getNode(); | ||
| 18 | if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { | ||
| 19 | pl = fe.title; | ||
| 20 | |||
| 21 | switch (ed.dom.getAttrib(fe, 'class')) { | ||
| 22 | case 'mceItemFlash': | ||
| 23 | type = 'flash'; | ||
| 24 | break; | ||
| 25 | |||
| 26 | case 'mceItemFlashVideo': | ||
| 27 | type = 'flv'; | ||
| 28 | break; | ||
| 29 | |||
| 30 | case 'mceItemShockWave': | ||
| 31 | type = 'shockwave'; | ||
| 32 | break; | ||
| 33 | |||
| 34 | case 'mceItemWindowsMedia': | ||
| 35 | type = 'wmp'; | ||
| 36 | break; | ||
| 37 | |||
| 38 | case 'mceItemQuickTime': | ||
| 39 | type = 'qt'; | ||
| 40 | break; | ||
| 41 | |||
| 42 | case 'mceItemRealMedia': | ||
| 43 | type = 'rmp'; | ||
| 44 | break; | ||
| 45 | } | ||
| 46 | |||
| 47 | document.forms[0].insert.value = ed.getLang('update', 'Insert', true); | ||
| 48 | } | ||
| 49 | |||
| 50 | document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); | ||
| 51 | document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); | ||
| 52 | document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); | ||
| 53 | |||
| 54 | var html = getMediaListHTML('medialist','src','media','media'); | ||
| 55 | if (html == "") | ||
| 56 | document.getElementById("linklistrow").style.display = 'none'; | ||
| 57 | else | ||
| 58 | document.getElementById("linklistcontainer").innerHTML = html; | ||
| 59 | |||
| 60 | // Resize some elements | ||
| 61 | if (isVisible('filebrowser')) | ||
| 62 | document.getElementById('src').style.width = '230px'; | ||
| 63 | |||
| 64 | // Setup form | ||
| 65 | if (pl != "") { | ||
| 66 | pl = tinyMCEPopup.editor.plugins.media._parse(pl); | ||
| 67 | |||
| 68 | switch (type) { | ||
| 69 | case "flash": | ||
| 70 | setBool(pl, 'flash', 'play'); | ||
| 71 | setBool(pl, 'flash', 'loop'); | ||
| 72 | setBool(pl, 'flash', 'menu'); | ||
| 73 | setBool(pl, 'flash', 'swliveconnect'); | ||
| 74 | setStr(pl, 'flash', 'quality'); | ||
| 75 | setStr(pl, 'flash', 'scale'); | ||
| 76 | setStr(pl, 'flash', 'salign'); | ||
| 77 | setStr(pl, 'flash', 'wmode'); | ||
| 78 | setStr(pl, 'flash', 'base'); | ||
| 79 | setStr(pl, 'flash', 'flashvars'); | ||
| 80 | break; | ||
| 81 | |||
| 82 | case "qt": | ||
| 83 | setBool(pl, 'qt', 'loop'); | ||
| 84 | setBool(pl, 'qt', 'autoplay'); | ||
| 85 | setBool(pl, 'qt', 'cache'); | ||
| 86 | setBool(pl, 'qt', 'controller'); | ||
| 87 | setBool(pl, 'qt', 'correction'); | ||
| 88 | setBool(pl, 'qt', 'enablejavascript'); | ||
| 89 | setBool(pl, 'qt', 'kioskmode'); | ||
| 90 | setBool(pl, 'qt', 'autohref'); | ||
| 91 | setBool(pl, 'qt', 'playeveryframe'); | ||
| 92 | setBool(pl, 'qt', 'tarsetcache'); | ||
| 93 | setStr(pl, 'qt', 'scale'); | ||
| 94 | setStr(pl, 'qt', 'starttime'); | ||
| 95 | setStr(pl, 'qt', 'endtime'); | ||
| 96 | setStr(pl, 'qt', 'tarset'); | ||
| 97 | setStr(pl, 'qt', 'qtsrcchokespeed'); | ||
| 98 | setStr(pl, 'qt', 'volume'); | ||
| 99 | setStr(pl, 'qt', 'qtsrc'); | ||
| 100 | break; | ||
| 101 | |||
| 102 | case "shockwave": | ||
| 103 | setBool(pl, 'shockwave', 'sound'); | ||
| 104 | setBool(pl, 'shockwave', 'progress'); | ||
| 105 | setBool(pl, 'shockwave', 'autostart'); | ||
| 106 | setBool(pl, 'shockwave', 'swliveconnect'); | ||
| 107 | setStr(pl, 'shockwave', 'swvolume'); | ||
| 108 | setStr(pl, 'shockwave', 'swstretchstyle'); | ||
| 109 | setStr(pl, 'shockwave', 'swstretchhalign'); | ||
| 110 | setStr(pl, 'shockwave', 'swstretchvalign'); | ||
| 111 | break; | ||
| 112 | |||
| 113 | case "wmp": | ||
| 114 | setBool(pl, 'wmp', 'autostart'); | ||
| 115 | setBool(pl, 'wmp', 'enabled'); | ||
| 116 | setBool(pl, 'wmp', 'enablecontextmenu'); | ||
| 117 | setBool(pl, 'wmp', 'fullscreen'); | ||
| 118 | setBool(pl, 'wmp', 'invokeurls'); | ||
| 119 | setBool(pl, 'wmp', 'mute'); | ||
| 120 | setBool(pl, 'wmp', 'stretchtofit'); | ||
| 121 | setBool(pl, 'wmp', 'windowlessvideo'); | ||
| 122 | setStr(pl, 'wmp', 'balance'); | ||
| 123 | setStr(pl, 'wmp', 'baseurl'); | ||
| 124 | setStr(pl, 'wmp', 'captioningid'); | ||
| 125 | setStr(pl, 'wmp', 'currentmarker'); | ||
| 126 | setStr(pl, 'wmp', 'currentposition'); | ||
| 127 | setStr(pl, 'wmp', 'defaultframe'); | ||
| 128 | setStr(pl, 'wmp', 'playcount'); | ||
| 129 | setStr(pl, 'wmp', 'rate'); | ||
| 130 | setStr(pl, 'wmp', 'uimode'); | ||
| 131 | setStr(pl, 'wmp', 'volume'); | ||
| 132 | break; | ||
| 133 | |||
| 134 | case "rmp": | ||
| 135 | setBool(pl, 'rmp', 'autostart'); | ||
| 136 | setBool(pl, 'rmp', 'loop'); | ||
| 137 | setBool(pl, 'rmp', 'autogotourl'); | ||
| 138 | setBool(pl, 'rmp', 'center'); | ||
| 139 | setBool(pl, 'rmp', 'imagestatus'); | ||
| 140 | setBool(pl, 'rmp', 'maintainaspect'); | ||
| 141 | setBool(pl, 'rmp', 'nojava'); | ||
| 142 | setBool(pl, 'rmp', 'prefetch'); | ||
| 143 | setBool(pl, 'rmp', 'shuffle'); | ||
| 144 | setStr(pl, 'rmp', 'console'); | ||
| 145 | setStr(pl, 'rmp', 'controls'); | ||
| 146 | setStr(pl, 'rmp', 'numloop'); | ||
| 147 | setStr(pl, 'rmp', 'scriptcallbacks'); | ||
| 148 | break; | ||
| 149 | } | ||
| 150 | |||
| 151 | setStr(pl, null, 'src'); | ||
| 152 | setStr(pl, null, 'id'); | ||
| 153 | setStr(pl, null, 'name'); | ||
| 154 | setStr(pl, null, 'vspace'); | ||
| 155 | setStr(pl, null, 'hspace'); | ||
| 156 | setStr(pl, null, 'bgcolor'); | ||
| 157 | setStr(pl, null, 'align'); | ||
| 158 | setStr(pl, null, 'width'); | ||
| 159 | setStr(pl, null, 'height'); | ||
| 160 | |||
| 161 | if ((val = ed.dom.getAttrib(fe, "width")) != "") | ||
| 162 | pl.width = f.width.value = val; | ||
| 163 | |||
| 164 | if ((val = ed.dom.getAttrib(fe, "height")) != "") | ||
| 165 | pl.height = f.height.value = val; | ||
| 166 | |||
| 167 | oldWidth = pl.width ? parseInt(pl.width) : 0; | ||
| 168 | oldHeight = pl.height ? parseInt(pl.height) : 0; | ||
| 169 | } else | ||
| 170 | oldWidth = oldHeight = 0; | ||
| 171 | |||
| 172 | selectByValue(f, 'media_type', type); | ||
| 173 | changedType(type); | ||
| 174 | updateColor('bgcolor_pick', 'bgcolor'); | ||
| 175 | |||
| 176 | TinyMCE_EditableSelects.init(); | ||
| 177 | generatePreview(); | ||
| 178 | } | ||
| 179 | |||
| 180 | function insertMedia() { | ||
| 181 | var fe, f = document.forms[0], h; | ||
| 182 | |||
| 183 | tinyMCEPopup.restoreSelection(); | ||
| 184 | |||
| 185 | if (!AutoValidator.validate(f)) { | ||
| 186 | tinyMCEPopup.alert(ed.getLang('invalid_data')); | ||
| 187 | return false; | ||
| 188 | } | ||
| 189 | |||
| 190 | f.width.value = f.width.value == "" ? 100 : f.width.value; | ||
| 191 | f.height.value = f.height.value == "" ? 100 : f.height.value; | ||
| 192 | |||
| 193 | fe = ed.selection.getNode(); | ||
| 194 | if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { | ||
| 195 | switch (f.media_type.options[f.media_type.selectedIndex].value) { | ||
| 196 | case "flash": | ||
| 197 | fe.className = "mceItemFlash"; | ||
| 198 | break; | ||
| 199 | |||
| 200 | case "flv": | ||
| 201 | fe.className = "mceItemFlashVideo"; | ||
| 202 | break; | ||
| 203 | |||
| 204 | case "shockwave": | ||
| 205 | fe.className = "mceItemShockWave"; | ||
| 206 | break; | ||
| 207 | |||
| 208 | case "qt": | ||
| 209 | fe.className = "mceItemQuickTime"; | ||
| 210 | break; | ||
| 211 | |||
| 212 | case "wmp": | ||
| 213 | fe.className = "mceItemWindowsMedia"; | ||
| 214 | break; | ||
| 215 | |||
| 216 | case "rmp": | ||
| 217 | fe.className = "mceItemRealMedia"; | ||
| 218 | break; | ||
| 219 | } | ||
| 220 | |||
| 221 | if (fe.width != f.width.value || fe.height != f.height.height) | ||
| 222 | ed.execCommand('mceRepaint'); | ||
| 223 | |||
| 224 | fe.title = serializeParameters(); | ||
| 225 | fe.width = f.width.value; | ||
| 226 | fe.height = f.height.value; | ||
| 227 | fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); | ||
| 228 | fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); | ||
| 229 | fe.align = f.align.options[f.align.selectedIndex].value; | ||
| 230 | } else { | ||
| 231 | h = '<img src="' + tinyMCEPopup.getWindowArg("plugin_url") + '/img/trans.gif"' ; | ||
| 232 | |||
| 233 | switch (f.media_type.options[f.media_type.selectedIndex].value) { | ||
| 234 | case "flash": | ||
| 235 | h += ' class="mceItemFlash"'; | ||
| 236 | break; | ||
| 237 | |||
| 238 | case "flv": | ||
| 239 | h += ' class="mceItemFlashVideo"'; | ||
| 240 | break; | ||
| 241 | |||
| 242 | case "shockwave": | ||
| 243 | h += ' class="mceItemShockWave"'; | ||
| 244 | break; | ||
| 245 | |||
| 246 | case "qt": | ||
| 247 | h += ' class="mceItemQuickTime"'; | ||
| 248 | break; | ||
| 249 | |||
| 250 | case "wmp": | ||
| 251 | h += ' class="mceItemWindowsMedia"'; | ||
| 252 | break; | ||
| 253 | |||
| 254 | case "rmp": | ||
| 255 | h += ' class="mceItemRealMedia"'; | ||
| 256 | break; | ||
| 257 | } | ||
| 258 | |||
| 259 | h += ' title="' + serializeParameters() + '"'; | ||
| 260 | h += ' width="' + f.width.value + '"'; | ||
| 261 | h += ' height="' + f.height.value + '"'; | ||
| 262 | h += ' align="' + f.align.options[f.align.selectedIndex].value + '"'; | ||
| 263 | |||
| 264 | h += ' />'; | ||
| 265 | |||
| 266 | ed.execCommand('mceInsertContent', false, h); | ||
| 267 | } | ||
| 268 | |||
| 269 | tinyMCEPopup.close(); | ||
| 270 | } | ||
| 271 | |||
| 272 | function updatePreview() { | ||
| 273 | var f = document.forms[0], type; | ||
| 274 | |||
| 275 | f.width.value = f.width.value || '320'; | ||
| 276 | f.height.value = f.height.value || '240'; | ||
| 277 | |||
| 278 | type = getType(f.src.value); | ||
| 279 | selectByValue(f, 'media_type', type); | ||
| 280 | changedType(type); | ||
| 281 | generatePreview(); | ||
| 282 | } | ||
| 283 | |||
| 284 | function getMediaListHTML() { | ||
| 285 | if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { | ||
| 286 | var html = ""; | ||
| 287 | |||
| 288 | html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;updatePreview();">'; | ||
| 289 | html += '<option value="">---</option>'; | ||
| 290 | |||
| 291 | for (var i=0; i<tinyMCEMediaList.length; i++) | ||
| 292 | html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>'; | ||
| 293 | |||
| 294 | html += '</select>'; | ||
| 295 | |||
| 296 | return html; | ||
| 297 | } | ||
| 298 | |||
| 299 | return ""; | ||
| 300 | } | ||
| 301 | |||
| 302 | function getType(v) { | ||
| 303 | var fo, i, c, el, x, f = document.forms[0]; | ||
| 304 | |||
| 305 | fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); | ||
| 306 | |||
| 307 | // YouTube | ||
| 308 | if (v.match(/watch\?v=(.+)(.*)/)) { | ||
| 309 | f.width.value = '425'; | ||
| 310 | f.height.value = '350'; | ||
| 311 | f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1]; | ||
| 312 | return 'flash'; | ||
| 313 | } | ||
| 314 | |||
| 315 | // Google video | ||
| 316 | if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { | ||
| 317 | f.width.value = '425'; | ||
| 318 | f.height.value = '326'; | ||
| 319 | f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; | ||
| 320 | return 'flash'; | ||
| 321 | } | ||
| 322 | |||
| 323 | for (i=0; i<fo.length; i++) { | ||
| 324 | c = fo[i].split('='); | ||
| 325 | |||
| 326 | el = c[1].split(','); | ||
| 327 | for (x=0; x<el.length; x++) | ||
| 328 | if (v.indexOf('.' + el[x]) != -1) | ||
| 329 | return c[0]; | ||
| 330 | } | ||
| 331 | |||
| 332 | return null; | ||
| 333 | } | ||
| 334 | |||
| 335 | function switchType(v) { | ||
| 336 | var t = getType(v), d = document, f = d.forms[0]; | ||
| 337 | |||
| 338 | if (!t) | ||
| 339 | return; | ||
| 340 | |||
| 341 | selectByValue(d.forms[0], 'media_type', t); | ||
| 342 | changedType(t); | ||
| 343 | |||
| 344 | // Update qtsrc also | ||
| 345 | if (t == 'qt' && f.src.value.toLowerCase().indexOf('rtsp://') != -1) { | ||
| 346 | alert(ed.getLang("media_qt_stream_warn")); | ||
| 347 | |||
| 348 | if (f.qt_qtsrc.value == '') | ||
| 349 | f.qt_qtsrc.value = f.src.value; | ||
| 350 | } | ||
| 351 | } | ||
| 352 | |||
| 353 | function changedType(t) { | ||
| 354 | var d = document; | ||
| 355 | |||
| 356 | d.getElementById('flash_options').style.display = 'none'; | ||
| 357 | d.getElementById('flv_options').style.display = 'none'; | ||
| 358 | d.getElementById('qt_options').style.display = 'none'; | ||
| 359 | d.getElementById('shockwave_options').style.display = 'none'; | ||
| 360 | d.getElementById('wmp_options').style.display = 'none'; | ||
| 361 | d.getElementById('rmp_options').style.display = 'none'; | ||
| 362 | |||
| 363 | if (t) | ||
| 364 | d.getElementById(t + '_options').style.display = 'block'; | ||
| 365 | } | ||
| 366 | |||
| 367 | function serializeParameters() { | ||
| 368 | var d = document, f = d.forms[0], s = ''; | ||
| 369 | |||
| 370 | switch (f.media_type.options[f.media_type.selectedIndex].value) { | ||
| 371 | case "flash": | ||
| 372 | s += getBool('flash', 'play', true); | ||
| 373 | s += getBool('flash', 'loop', true); | ||
| 374 | s += getBool('flash', 'menu', true); | ||
| 375 | s += getBool('flash', 'swliveconnect', false); | ||
| 376 | s += getStr('flash', 'quality'); | ||
| 377 | s += getStr('flash', 'scale'); | ||
| 378 | s += getStr('flash', 'salign'); | ||
| 379 | s += getStr('flash', 'wmode'); | ||
| 380 | s += getStr('flash', 'base'); | ||
| 381 | s += getStr('flash', 'flashvars'); | ||
| 382 | break; | ||
| 383 | |||
| 384 | case "qt": | ||
| 385 | s += getBool('qt', 'loop', false); | ||
| 386 | s += getBool('qt', 'autoplay', true); | ||
| 387 | s += getBool('qt', 'cache', false); | ||
| 388 | s += getBool('qt', 'controller', true); | ||
| 389 | s += getBool('qt', 'correction', false, 'none', 'full'); | ||
| 390 | s += getBool('qt', 'enablejavascript', false); | ||
| 391 | s += getBool('qt', 'kioskmode', false); | ||
| 392 | s += getBool('qt', 'autohref', false); | ||
| 393 | s += getBool('qt', 'playeveryframe', false); | ||
| 394 | s += getBool('qt', 'targetcache', false); | ||
| 395 | s += getStr('qt', 'scale'); | ||
| 396 | s += getStr('qt', 'starttime'); | ||
| 397 | s += getStr('qt', 'endtime'); | ||
| 398 | s += getStr('qt', 'target'); | ||
| 399 | s += getStr('qt', 'qtsrcchokespeed'); | ||
| 400 | s += getStr('qt', 'volume'); | ||
| 401 | s += getStr('qt', 'qtsrc'); | ||
| 402 | break; | ||
| 403 | |||
| 404 | case "shockwave": | ||
| 405 | s += getBool('shockwave', 'sound'); | ||
| 406 | s += getBool('shockwave', 'progress'); | ||
| 407 | s += getBool('shockwave', 'autostart'); | ||
| 408 | s += getBool('shockwave', 'swliveconnect'); | ||
| 409 | s += getStr('shockwave', 'swvolume'); | ||
| 410 | s += getStr('shockwave', 'swstretchstyle'); | ||
| 411 | s += getStr('shockwave', 'swstretchhalign'); | ||
| 412 | s += getStr('shockwave', 'swstretchvalign'); | ||
| 413 | break; | ||
| 414 | |||
| 415 | case "wmp": | ||
| 416 | s += getBool('wmp', 'autostart', true); | ||
| 417 | s += getBool('wmp', 'enabled', false); | ||
| 418 | s += getBool('wmp', 'enablecontextmenu', true); | ||
| 419 | s += getBool('wmp', 'fullscreen', false); | ||
| 420 | s += getBool('wmp', 'invokeurls', true); | ||
| 421 | s += getBool('wmp', 'mute', false); | ||
| 422 | s += getBool('wmp', 'stretchtofit', false); | ||
| 423 | s += getBool('wmp', 'windowlessvideo', false); | ||
| 424 | s += getStr('wmp', 'balance'); | ||
| 425 | s += getStr('wmp', 'baseurl'); | ||
| 426 | s += getStr('wmp', 'captioningid'); | ||
| 427 | s += getStr('wmp', 'currentmarker'); | ||
| 428 | s += getStr('wmp', 'currentposition'); | ||
| 429 | s += getStr('wmp', 'defaultframe'); | ||
| 430 | s += getStr('wmp', 'playcount'); | ||
| 431 | s += getStr('wmp', 'rate'); | ||
| 432 | s += getStr('wmp', 'uimode'); | ||
| 433 | s += getStr('wmp', 'volume'); | ||
| 434 | break; | ||
| 435 | |||
| 436 | case "rmp": | ||
| 437 | s += getBool('rmp', 'autostart', false); | ||
| 438 | s += getBool('rmp', 'loop', false); | ||
| 439 | s += getBool('rmp', 'autogotourl', true); | ||
| 440 | s += getBool('rmp', 'center', false); | ||
| 441 | s += getBool('rmp', 'imagestatus', true); | ||
| 442 | s += getBool('rmp', 'maintainaspect', false); | ||
| 443 | s += getBool('rmp', 'nojava', false); | ||
| 444 | s += getBool('rmp', 'prefetch', false); | ||
| 445 | s += getBool('rmp', 'shuffle', false); | ||
| 446 | s += getStr('rmp', 'console'); | ||
| 447 | s += getStr('rmp', 'controls'); | ||
| 448 | s += getStr('rmp', 'numloop'); | ||
| 449 | s += getStr('rmp', 'scriptcallbacks'); | ||
| 450 | break; | ||
| 451 | } | ||
| 452 | |||
| 453 | s += getStr(null, 'id'); | ||
| 454 | s += getStr(null, 'name'); | ||
| 455 | s += getStr(null, 'src'); | ||
| 456 | s += getStr(null, 'align'); | ||
| 457 | s += getStr(null, 'bgcolor'); | ||
| 458 | s += getInt(null, 'vspace'); | ||
| 459 | s += getInt(null, 'hspace'); | ||
| 460 | s += getStr(null, 'width'); | ||
| 461 | s += getStr(null, 'height'); | ||
| 462 | |||
| 463 | s = s.length > 0 ? s.substring(0, s.length - 1) : s; | ||
| 464 | |||
| 465 | return s; | ||
| 466 | } | ||
| 467 | |||
| 468 | function setBool(pl, p, n) { | ||
| 469 | if (typeof(pl[n]) == "undefined") | ||
| 470 | return; | ||
| 471 | |||
| 472 | document.forms[0].elements[p + "_" + n].checked = pl[n]; | ||
| 473 | } | ||
| 474 | |||
| 475 | function setStr(pl, p, n) { | ||
| 476 | var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; | ||
| 477 | |||
| 478 | if (typeof(pl[n]) == "undefined") | ||
| 479 | return; | ||
| 480 | |||
| 481 | if (e.type == "text") | ||
| 482 | e.value = pl[n]; | ||
| 483 | else | ||
| 484 | selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); | ||
| 485 | } | ||
| 486 | |||
| 487 | function getBool(p, n, d, tv, fv) { | ||
| 488 | var v = document.forms[0].elements[p + "_" + n].checked; | ||
| 489 | |||
| 490 | tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; | ||
| 491 | fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; | ||
| 492 | |||
| 493 | return (v == d) ? '' : n + (v ? ':' + tv + ',' : ':' + fv + ','); | ||
| 494 | } | ||
| 495 | |||
| 496 | function getStr(p, n, d) { | ||
| 497 | var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; | ||
| 498 | var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; | ||
| 499 | |||
| 500 | if (n == 'src') | ||
| 501 | v = tinyMCEPopup.editor.convertURL(v, 'src', null); | ||
| 502 | |||
| 503 | return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); | ||
| 504 | } | ||
| 505 | |||
| 506 | function getInt(p, n, d) { | ||
| 507 | var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; | ||
| 508 | var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; | ||
| 509 | |||
| 510 | return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); | ||
| 511 | } | ||
| 512 | |||
| 513 | function jsEncode(s) { | ||
| 514 | s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); | ||
| 515 | s = s.replace(new RegExp('"', 'g'), '\\"'); | ||
| 516 | s = s.replace(new RegExp("'", 'g'), "\\'"); | ||
| 517 | |||
| 518 | return s; | ||
| 519 | } | ||
| 520 | |||
| 521 | function generatePreview(c) { | ||
| 522 | var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; | ||
| 523 | |||
| 524 | p.innerHTML = '<!-- x --->'; | ||
| 525 | |||
| 526 | nw = parseInt(f.width.value); | ||
| 527 | nh = parseInt(f.height.value); | ||
| 528 | |||
| 529 | if (f.width.value != "" && f.height.value != "") { | ||
| 530 | if (f.constrain.checked) { | ||
| 531 | if (c == 'width' && oldWidth != 0) { | ||
| 532 | wp = nw / oldWidth; | ||
| 533 | nh = Math.round(wp * nh); | ||
| 534 | f.height.value = nh; | ||
| 535 | } else if (c == 'height' && oldHeight != 0) { | ||
| 536 | hp = nh / oldHeight; | ||
| 537 | nw = Math.round(hp * nw); | ||
| 538 | f.width.value = nw; | ||
| 539 | } | ||
| 540 | } | ||
| 541 | } | ||
| 542 | |||
| 543 | if (f.width.value != "") | ||
| 544 | oldWidth = nw; | ||
| 545 | |||
| 546 | if (f.height.value != "") | ||
| 547 | oldHeight = nh; | ||
| 548 | |||
| 549 | // After constrain | ||
| 550 | pl = serializeParameters(); | ||
| 551 | |||
| 552 | switch (f.media_type.options[f.media_type.selectedIndex].value) { | ||
| 553 | case "flash": | ||
| 554 | cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; | ||
| 555 | codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; | ||
| 556 | type = 'application/x-shockwave-flash'; | ||
| 557 | break; | ||
| 558 | |||
| 559 | case "shockwave": | ||
| 560 | cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; | ||
| 561 | codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; | ||
| 562 | type = 'application/x-director'; | ||
| 563 | break; | ||
| 564 | |||
| 565 | case "qt": | ||
| 566 | cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; | ||
| 567 | codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; | ||
| 568 | type = 'video/quicktime'; | ||
| 569 | break; | ||
| 570 | |||
| 571 | case "wmp": | ||
| 572 | cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; | ||
| 573 | codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; | ||
| 574 | type = 'application/x-mplayer2'; | ||
| 575 | break; | ||
| 576 | |||
| 577 | case "rmp": | ||
| 578 | cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; | ||
| 579 | codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; | ||
| 580 | type = 'audio/x-pn-realaudio-plugin'; | ||
| 581 | break; | ||
| 582 | } | ||
| 583 | |||
| 584 | if (pl == '') { | ||
| 585 | p.innerHTML = ''; | ||
| 586 | return; | ||
| 587 | } | ||
| 588 | |||
| 589 | pl = tinyMCEPopup.editor.plugins.media._parse(pl); | ||
| 590 | |||
| 591 | if (!pl.src) { | ||
| 592 | p.innerHTML = ''; | ||
| 593 | return; | ||
| 594 | } | ||
| 595 | |||
| 596 | pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src); | ||
| 597 | pl.width = !pl.width ? 100 : pl.width; | ||
| 598 | pl.height = !pl.height ? 100 : pl.height; | ||
| 599 | pl.id = !pl.id ? 'obj' : pl.id; | ||
| 600 | pl.name = !pl.name ? 'eobj' : pl.name; | ||
| 601 | pl.align = !pl.align ? '' : pl.align; | ||
| 602 | |||
| 603 | // Avoid annoying warning about insecure items | ||
| 604 | if (!tinymce.isIE || document.location.protocol != 'https:') { | ||
| 605 | h += '<object classid="' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">'; | ||
| 606 | |||
| 607 | for (n in pl) { | ||
| 608 | h += '<param name="' + n + '" value="' + pl[n] + '">'; | ||
| 609 | |||
| 610 | // Add extra url parameter if it's an absolute URL | ||
| 611 | if (n == 'src' && pl[n].indexOf('://') != -1) | ||
| 612 | h += '<param name="url" value="' + pl[n] + '" />'; | ||
| 613 | } | ||
| 614 | } | ||
| 615 | |||
| 616 | h += '<embed type="' + type + '" '; | ||
| 617 | |||
| 618 | for (n in pl) | ||
| 619 | h += n + '="' + pl[n] + '" '; | ||
| 620 | |||
| 621 | h += '></embed>'; | ||
| 622 | |||
| 623 | // Avoid annoying warning about insecure items | ||
| 624 | if (!tinymce.isIE || document.location.protocol != 'https:') | ||
| 625 | h += '</object>'; | ||
| 626 | |||
| 627 | p.innerHTML = "<!-- x --->" + h; | ||
| 628 | } | ||
| 629 | |||
| 630 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js new file mode 100755 index 0000000..6d0a996 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | tinyMCE.addI18n('en.media_dlg',{ | ||
| 2 | title:"Insert / edit embedded media", | ||
| 3 | general:"General", | ||
| 4 | advanced:"Advanced", | ||
| 5 | file:"File/URL", | ||
| 6 | list:"List", | ||
| 7 | size:"Dimensions", | ||
| 8 | preview:"Preview", | ||
| 9 | constrain_proportions:"Constrain proportions", | ||
| 10 | type:"Type", | ||
| 11 | id:"Id", | ||
| 12 | name:"Name", | ||
| 13 | class_name:"Class", | ||
| 14 | vspace:"V-Space", | ||
| 15 | hspace:"H-Space", | ||
| 16 | play:"Auto play", | ||
| 17 | loop:"Loop", | ||
| 18 | menu:"Show menu", | ||
| 19 | quality:"Quality", | ||
| 20 | scale:"Scale", | ||
| 21 | align:"Align", | ||
| 22 | salign:"SAlign", | ||
| 23 | wmode:"WMode", | ||
| 24 | bgcolor:"Background", | ||
| 25 | base:"Base", | ||
| 26 | flashvars:"Flashvars", | ||
| 27 | liveconnect:"SWLiveConnect", | ||
| 28 | autohref:"AutoHREF", | ||
| 29 | cache:"Cache", | ||
| 30 | hidden:"Hidden", | ||
| 31 | controller:"Controller", | ||
| 32 | kioskmode:"Kiosk mode", | ||
| 33 | playeveryframe:"Play every frame", | ||
| 34 | targetcache:"Target cache", | ||
| 35 | correction:"No correction", | ||
| 36 | enablejavascript:"Enable JavaScript", | ||
| 37 | starttime:"Start time", | ||
| 38 | endtime:"End time", | ||
| 39 | href:"Href", | ||
| 40 | qtsrcchokespeed:"Choke speed", | ||
| 41 | target:"Target", | ||
| 42 | volume:"Volume", | ||
| 43 | autostart:"Auto start", | ||
| 44 | enabled:"Enabled", | ||
| 45 | fullscreen:"Fullscreen", | ||
| 46 | invokeurls:"Invoke URLs", | ||
| 47 | mute:"Mute", | ||
| 48 | stretchtofit:"Stretch to fit", | ||
| 49 | windowlessvideo:"Windowless video", | ||
| 50 | balance:"Balance", | ||
| 51 | baseurl:"Base URL", | ||
| 52 | captioningid:"Captioning id", | ||
| 53 | currentmarker:"Current marker", | ||
| 54 | currentposition:"Current position", | ||
| 55 | defaultframe:"Default frame", | ||
| 56 | playcount:"Play count", | ||
| 57 | rate:"Rate", | ||
| 58 | uimode:"UI Mode", | ||
| 59 | flash_options:"Flash options", | ||
| 60 | qt_options:"Quicktime options", | ||
| 61 | wmp_options:"Windows media player options", | ||
| 62 | rmp_options:"Real media player options", | ||
| 63 | shockwave_options:"Shockwave options", | ||
| 64 | autogotourl:"Auto goto URL", | ||
| 65 | center:"Center", | ||
| 66 | imagestatus:"Image status", | ||
| 67 | maintainaspect:"Maintain aspect", | ||
| 68 | nojava:"No java", | ||
| 69 | prefetch:"Prefetch", | ||
| 70 | shuffle:"Shuffle", | ||
| 71 | console:"Console", | ||
| 72 | numloop:"Num loops", | ||
| 73 | controls:"Controls", | ||
| 74 | scriptcallbacks:"Script callbacks", | ||
| 75 | swstretchstyle:"Stretch style", | ||
| 76 | swstretchhalign:"Stretch H-Align", | ||
| 77 | swstretchvalign:"Stretch V-Align", | ||
| 78 | sound:"Sound", | ||
| 79 | progress:"Progress", | ||
| 80 | qtsrc:"QT Src", | ||
| 81 | qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..", | ||
| 82 | align_top:"Top", | ||
| 83 | align_right:"Right", | ||
| 84 | align_bottom:"Bottom", | ||
| 85 | align_left:"Left", | ||
| 86 | align_center:"Center", | ||
| 87 | align_top_left:"Top left", | ||
| 88 | align_top_right:"Top right", | ||
| 89 | align_bottom_left:"Bottom left", | ||
| 90 | align_bottom_right:"Bottom right", | ||
| 91 | flv_options:"Flash video options", | ||
| 92 | flv_scalemode:"Scale mode", | ||
| 93 | flv_buffer:"Buffer", | ||
| 94 | flv_startimage:"Start image", | ||
| 95 | flv_starttime:"Start time", | ||
| 96 | flv_defaultvolume:"Default volumne", | ||
| 97 | flv_hiddengui:"Hidden GUI", | ||
| 98 | flv_autostart:"Auto start", | ||
| 99 | flv_loop:"Loop", | ||
| 100 | flv_showscalemodes:"Show scale modes", | ||
| 101 | flv_smoothvideo:"Smooth video", | ||
| 102 | flv_jscallback:"JS Callback" | ||
| 103 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/media.htm b/public/javascripts/tiny_mce/plugins/media/media.htm new file mode 100755 index 0000000..8b3bc1d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/media/media.htm | |||
| @@ -0,0 +1,824 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#media_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/media.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 9 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 10 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 11 | <link href="css/media.css" rel="stylesheet" type="text/css" /> | ||
| 12 | <base target="_self" /> | ||
| 13 | </head> | ||
| 14 | <body style="display: none"> | ||
| 15 | <form onsubmit="insertMedia();return false;" action="#"> | ||
| 16 | <div class="tabs"> | ||
| 17 | <ul> | ||
| 18 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{#media_dlg.general}</a></span></li> | ||
| 19 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#media_dlg.advanced}</a></span></li> | ||
| 20 | </ul> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div class="panel_wrapper"> | ||
| 24 | <div id="general_panel" class="panel current"> | ||
| 25 | <fieldset> | ||
| 26 | <legend>{#media_dlg.general}</legend> | ||
| 27 | |||
| 28 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 29 | <tr> | ||
| 30 | <td><label for="media_type">{#media_dlg.type}</label></td> | ||
| 31 | <td> | ||
| 32 | <select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();"> | ||
| 33 | <option value="flash">Flash</option> | ||
| 34 | <!-- <option value="flv">Flash video (FLV)</option> --> | ||
| 35 | <option value="qt">Quicktime</option> | ||
| 36 | <option value="shockwave">Shockwave</option> | ||
| 37 | <option value="wmp">Windows Media</option> | ||
| 38 | <option value="rmp">Real Media</option> | ||
| 39 | </select> | ||
| 40 | </td> | ||
| 41 | </tr> | ||
| 42 | <tr> | ||
| 43 | <td><label for="src">{#media_dlg.file}</label></td> | ||
| 44 | <td> | ||
| 45 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 46 | <tr> | ||
| 47 | <td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="switchType(this.value);generatePreview();" /></td> | ||
| 48 | <td id="filebrowsercontainer"> </td> | ||
| 49 | </tr> | ||
| 50 | </table> | ||
| 51 | </td> | ||
| 52 | </tr> | ||
| 53 | <tr id="linklistrow"> | ||
| 54 | <td><label for="linklist">{#media_dlg.list}</label></td> | ||
| 55 | <td id="linklistcontainer"> </td> | ||
| 56 | </tr> | ||
| 57 | <tr> | ||
| 58 | <td><label for="width">{#media_dlg.size}</label></td> | ||
| 59 | <td> | ||
| 60 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 61 | <tr> | ||
| 62 | <td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size" onchange="generatePreview('height');" /></td> | ||
| 63 | <td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td> | ||
| 64 | <td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td> | ||
| 65 | </tr> | ||
| 66 | </table> | ||
| 67 | </td> | ||
| 68 | </tr> | ||
| 69 | </table> | ||
| 70 | </fieldset> | ||
| 71 | |||
| 72 | <fieldset> | ||
| 73 | <legend>{#media_dlg.preview}</legend> | ||
| 74 | <div id="prev"></div> | ||
| 75 | </fieldset> | ||
| 76 | </div> | ||
| 77 | |||
| 78 | <div id="advanced_panel" class="panel"> | ||
| 79 | <fieldset> | ||
| 80 | <legend>{#media_dlg.advanced}</legend> | ||
| 81 | |||
| 82 | <table border="0" cellpadding="4" cellspacing="0" width="100%"> | ||
| 83 | <tr> | ||
| 84 | <td><label for="id">{#media_dlg.id}</label></td> | ||
| 85 | <td><input type="text" id="id" name="id" onchange="generatePreview();" /></td> | ||
| 86 | <td><label for="name">{#media_dlg.name}</label></td> | ||
| 87 | <td><input type="text" id="name" name="name" onchange="generatePreview();" /></td> | ||
| 88 | </tr> | ||
| 89 | |||
| 90 | <tr> | ||
| 91 | <td><label for="align">{#media_dlg.align}</label></td> | ||
| 92 | <td> | ||
| 93 | <select id="align" name="align" onchange="generatePreview();"> | ||
| 94 | <option value="">{#not_set}</option> | ||
| 95 | <option value="top">{#media_dlg.align_top}</option> | ||
| 96 | <option value="right">{#media_dlg.align_right}</option> | ||
| 97 | <option value="bottom">{#media_dlg.align_bottom}</option> | ||
| 98 | <option value="left">{#media_dlg.align_left}</option> | ||
| 99 | </select> | ||
| 100 | </td> | ||
| 101 | |||
| 102 | <td><label for="bgcolor">{#media_dlg.bgcolor}</label></td> | ||
| 103 | <td> | ||
| 104 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 105 | <tr> | ||
| 106 | <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');generatePreview();" /></td> | ||
| 107 | <td id="bgcolor_pickcontainer"> </td> | ||
| 108 | </tr> | ||
| 109 | </table> | ||
| 110 | </td> | ||
| 111 | </tr> | ||
| 112 | |||
| 113 | <tr> | ||
| 114 | <td><label for="vspace">{#media_dlg.vspace}</label></td> | ||
| 115 | <td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td> | ||
| 116 | <td><label for="hspace">{#media_dlg.hspace}</label></td> | ||
| 117 | <td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td> | ||
| 118 | </tr> | ||
| 119 | </table> | ||
| 120 | </fieldset> | ||
| 121 | |||
| 122 | <fieldset id="flash_options"> | ||
| 123 | <legend>{#media_dlg.flash_options}</legend> | ||
| 124 | |||
| 125 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 126 | <tr> | ||
| 127 | <td><label for="flash_quality">{#media_dlg.quality}</label></td> | ||
| 128 | <td> | ||
| 129 | <select id="flash_quality" name="flash_quality" onchange="generatePreview();"> | ||
| 130 | <option value="">{#not_set}</option> | ||
| 131 | <option value="high">high</option> | ||
| 132 | <option value="low">low</option> | ||
| 133 | <option value="autolow">autolow</option> | ||
| 134 | <option value="autohigh">autohigh</option> | ||
| 135 | <option value="best">best</option> | ||
| 136 | </select> | ||
| 137 | </td> | ||
| 138 | |||
| 139 | <td><label for="flash_scale">{#media_dlg.scale}</label></td> | ||
| 140 | <td> | ||
| 141 | <select id="flash_scale" name="flash_scale" onchange="generatePreview();"> | ||
| 142 | <option value="">{#not_set}</option> | ||
| 143 | <option value="showall">showall</option> | ||
| 144 | <option value="noborder">noborder</option> | ||
| 145 | <option value="exactfit">exactfit</option> | ||
| 146 | <option value="noscale">noscale</option> | ||
| 147 | </select> | ||
| 148 | </td> | ||
| 149 | </tr> | ||
| 150 | |||
| 151 | <tr> | ||
| 152 | <td><label for="flash_wmode">{#media_dlg.wmode}</label></td> | ||
| 153 | <td> | ||
| 154 | <select id="flash_wmode" name="flash_wmode" onchange="generatePreview();"> | ||
| 155 | <option value="">{#not_set}</option> | ||
| 156 | <option value="window">window</option> | ||
| 157 | <option value="opaque">opaque</option> | ||
| 158 | <option value="transparent">transparent</option> | ||
| 159 | </select> | ||
| 160 | </td> | ||
| 161 | |||
| 162 | <td><label for="flash_salign">{#media_dlg.salign}</label></td> | ||
| 163 | <td> | ||
| 164 | <select id="flash_salign" name="flash_salign" onchange="generatePreview();"> | ||
| 165 | <option value="">{#not_set}</option> | ||
| 166 | <option value="l">{#media_dlg.align_left}</option> | ||
| 167 | <option value="t">{#media_dlg.align_top}</option> | ||
| 168 | <option value="r">{#media_dlg.align_right}</option> | ||
| 169 | <option value="b">{#media_dlg.align_bottom}</option> | ||
| 170 | <option value="tl">{#media_dlg.align_top_left}</option> | ||
| 171 | <option value="tr">{#media_dlg.align_top_right}</option> | ||
| 172 | <option value="bl">{#media_dlg.align_bottom_left}</option> | ||
| 173 | <option value="br">{#media_dlg.align_bottom_right}</option> | ||
| 174 | </select> | ||
| 175 | </td> | ||
| 176 | </tr> | ||
| 177 | |||
| 178 | <tr> | ||
| 179 | <td colspan="2"> | ||
| 180 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 181 | <tr> | ||
| 182 | <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td> | ||
| 183 | <td><label for="flash_play">{#media_dlg.play}</label></td> | ||
| 184 | </tr> | ||
| 185 | </table> | ||
| 186 | </td> | ||
| 187 | |||
| 188 | <td colspan="2"> | ||
| 189 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 190 | <tr> | ||
| 191 | <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td> | ||
| 192 | <td><label for="flash_loop">{#media_dlg.loop}</label></td> | ||
| 193 | </tr> | ||
| 194 | </table> | ||
| 195 | </td> | ||
| 196 | </tr> | ||
| 197 | |||
| 198 | <tr> | ||
| 199 | <td colspan="2"> | ||
| 200 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 201 | <tr> | ||
| 202 | <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td> | ||
| 203 | <td><label for="flash_menu">{#media_dlg.menu}</label></td> | ||
| 204 | </tr> | ||
| 205 | </table> | ||
| 206 | </td> | ||
| 207 | |||
| 208 | <td colspan="2"> | ||
| 209 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 210 | <tr> | ||
| 211 | <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td> | ||
| 212 | <td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td> | ||
| 213 | </tr> | ||
| 214 | </table> | ||
| 215 | </td> | ||
| 216 | </tr> | ||
| 217 | </table> | ||
| 218 | |||
| 219 | <table> | ||
| 220 | <tr> | ||
| 221 | <td><label for="flash_base">{#media_dlg.base}</label></td> | ||
| 222 | <td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td> | ||
| 223 | </tr> | ||
| 224 | |||
| 225 | <tr> | ||
| 226 | <td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td> | ||
| 227 | <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td> | ||
| 228 | </tr> | ||
| 229 | </table> | ||
| 230 | </fieldset> | ||
| 231 | |||
| 232 | <fieldset id="flv_options"> | ||
| 233 | <legend>{#media_dlg.flv_options}</legend> | ||
| 234 | |||
| 235 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 236 | <tr> | ||
| 237 | <td><label for="flv_scalemode">{#media_dlg.flv_scalemode}</label></td> | ||
| 238 | <td> | ||
| 239 | <select id="flv_scalemode" name="flv_scalemode" onchange="generatePreview();"> | ||
| 240 | <option value="">{#not_set}</option> | ||
| 241 | <option value="none">none</option> | ||
| 242 | <option value="double">double</option> | ||
| 243 | <option value="full">full</option> | ||
| 244 | </select> | ||
| 245 | </td> | ||
| 246 | |||
| 247 | <td><label for="flv_buffer">{#media_dlg.flv_buffer}</label></td> | ||
| 248 | <td><input type="text" id="flv_buffer" name="flv_buffer" onchange="generatePreview();" /></td> | ||
| 249 | </tr> | ||
| 250 | |||
| 251 | <tr> | ||
| 252 | <td><label for="flv_startimage">{#media_dlg.flv_startimage}</label></td> | ||
| 253 | <td><input type="text" id="flv_startimage" name="flv_startimage" onchange="generatePreview();" /></td> | ||
| 254 | |||
| 255 | <td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td> | ||
| 256 | <td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td> | ||
| 257 | </tr> | ||
| 258 | |||
| 259 | <tr> | ||
| 260 | <td><label for="flv_defaultvolume">{#media_dlg.flv_defaultvolume}</label></td> | ||
| 261 | <td><input type="text" id="flv_defaultvolume" name="flv_defaultvolume" onchange="generatePreview();" /></td> | ||
| 262 | |||
| 263 | <td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td> | ||
| 264 | <td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td> | ||
| 265 | </tr> | ||
| 266 | |||
| 267 | <tr> | ||
| 268 | <td colspan="2"> | ||
| 269 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 270 | <tr> | ||
| 271 | <td><input type="checkbox" class="checkbox" id="flv_hiddengui" name="flv_hiddengui" checked="checked" onchange="generatePreview();" /></td> | ||
| 272 | <td><label for="flv_hiddengui">{#media_dlg.flv_hiddengui}</label></td> | ||
| 273 | </tr> | ||
| 274 | </table> | ||
| 275 | </td> | ||
| 276 | |||
| 277 | <td colspan="2"> | ||
| 278 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 279 | <tr> | ||
| 280 | <td><input type="checkbox" class="checkbox" id="flv_autostart" name="flv_autostart" checked="checked" onchange="generatePreview();" /></td> | ||
| 281 | <td><label for="flv_autostart">{#media_dlg.flv_autostart}</label></td> | ||
| 282 | </tr> | ||
| 283 | </table> | ||
| 284 | </td> | ||
| 285 | </tr> | ||
| 286 | |||
| 287 | <tr> | ||
| 288 | <td colspan="2"> | ||
| 289 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 290 | <tr> | ||
| 291 | <td><input type="checkbox" class="checkbox" id="flv_loop" name="flv_loop" checked="checked" onchange="generatePreview();" /></td> | ||
| 292 | <td><label for="flv_loop">{#media_dlg.flv_loop}</label></td> | ||
| 293 | </tr> | ||
| 294 | </table> | ||
| 295 | </td> | ||
| 296 | |||
| 297 | <td colspan="2"> | ||
| 298 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 299 | <tr> | ||
| 300 | <td><input type="checkbox" class="checkbox" id="flv_showscalemodes" name="flv_showscalemodes" onchange="generatePreview();" /></td> | ||
| 301 | <td><label for="flv_showscalemodes">{#media_dlg.flv_showscalemodes}</label></td> | ||
| 302 | </tr> | ||
| 303 | </table> | ||
| 304 | </td> | ||
| 305 | </tr> | ||
| 306 | |||
| 307 | <tr> | ||
| 308 | <td colspan="2"> | ||
| 309 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 310 | <tr> | ||
| 311 | <td><input type="checkbox" class="checkbox" id="flv_smoothvideo" name="flash_flv_flv_smoothvideosmoothvideo" checked="checked" onchange="generatePreview();" /></td> | ||
| 312 | <td><label for="flv_smoothvideo">{#media_dlg.flv_smoothvideo}</label></td> | ||
| 313 | </tr> | ||
| 314 | </table> | ||
| 315 | </td> | ||
| 316 | |||
| 317 | <td colspan="2"> | ||
| 318 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 319 | <tr> | ||
| 320 | <td><input type="checkbox" class="checkbox" id="flv_jscallback" name="flv_jscallback" onchange="generatePreview();" /></td> | ||
| 321 | <td><label for="flv_jscallback">{#media_dlg.flv_jscallback}</label></td> | ||
| 322 | </tr> | ||
| 323 | </table> | ||
| 324 | </td> | ||
| 325 | </tr> | ||
| 326 | </table> | ||
| 327 | </fieldset> | ||
| 328 | |||
| 329 | <fieldset id="qt_options"> | ||
| 330 | <legend>{#media_dlg.qt_options}</legend> | ||
| 331 | |||
| 332 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 333 | <tr> | ||
| 334 | <td colspan="2"> | ||
| 335 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 336 | <tr> | ||
| 337 | <td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td> | ||
| 338 | <td><label for="qt_loop">{#media_dlg.loop}</label></td> | ||
| 339 | </tr> | ||
| 340 | </table> | ||
| 341 | </td> | ||
| 342 | |||
| 343 | <td colspan="2"> | ||
| 344 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 345 | <tr> | ||
| 346 | <td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td> | ||
| 347 | <td><label for="qt_autoplay">{#media_dlg.play}</label></td> | ||
| 348 | </tr> | ||
| 349 | </table> | ||
| 350 | </td> | ||
| 351 | </tr> | ||
| 352 | |||
| 353 | <tr> | ||
| 354 | <td colspan="2"> | ||
| 355 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 356 | <tr> | ||
| 357 | <td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td> | ||
| 358 | <td><label for="qt_cache">{#media_dlg.cache}</label></td> | ||
| 359 | </tr> | ||
| 360 | </table> | ||
| 361 | </td> | ||
| 362 | |||
| 363 | <td colspan="2"> | ||
| 364 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 365 | <tr> | ||
| 366 | <td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td> | ||
| 367 | <td><label for="qt_controller">{#media_dlg.controller}</label></td> | ||
| 368 | </tr> | ||
| 369 | </table> | ||
| 370 | </td> | ||
| 371 | </tr> | ||
| 372 | |||
| 373 | <tr> | ||
| 374 | <td colspan="2"> | ||
| 375 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 376 | <tr> | ||
| 377 | <td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td> | ||
| 378 | <td><label for="qt_correction">{#media_dlg.correction}</label></td> | ||
| 379 | </tr> | ||
| 380 | </table> | ||
| 381 | </td> | ||
| 382 | |||
| 383 | <td colspan="2"> | ||
| 384 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 385 | <tr> | ||
| 386 | <td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td> | ||
| 387 | <td><label for="qt_enablejavascript">{#media_dlg.enablejavascript}</label></td> | ||
| 388 | </tr> | ||
| 389 | </table> | ||
| 390 | </td> | ||
| 391 | </tr> | ||
| 392 | |||
| 393 | <tr> | ||
| 394 | <td colspan="2"> | ||
| 395 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 396 | <tr> | ||
| 397 | <td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td> | ||
| 398 | <td><label for="qt_kioskmode">{#media_dlg.kioskmode}</label></td> | ||
| 399 | </tr> | ||
| 400 | </table> | ||
| 401 | </td> | ||
| 402 | |||
| 403 | <td colspan="2"> | ||
| 404 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 405 | <tr> | ||
| 406 | <td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td> | ||
| 407 | <td><label for="qt_autohref">{#media_dlg.autohref}</label></td> | ||
| 408 | </tr> | ||
| 409 | </table> | ||
| 410 | </td> | ||
| 411 | </tr> | ||
| 412 | |||
| 413 | <tr> | ||
| 414 | <td colspan="2"> | ||
| 415 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 416 | <tr> | ||
| 417 | <td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td> | ||
| 418 | <td><label for="qt_playeveryframe">{#media_dlg.playeveryframe}</label></td> | ||
| 419 | </tr> | ||
| 420 | </table> | ||
| 421 | </td> | ||
| 422 | |||
| 423 | <td colspan="2"> | ||
| 424 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 425 | <tr> | ||
| 426 | <td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td> | ||
| 427 | <td><label for="qt_targetcache">{#media_dlg.targetcache}</label></td> | ||
| 428 | </tr> | ||
| 429 | </table> | ||
| 430 | </td> | ||
| 431 | </tr> | ||
| 432 | |||
| 433 | <tr> | ||
| 434 | <td><label for="qt_scale">{#media_dlg.scale}</label></td> | ||
| 435 | <td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();"> | ||
| 436 | <option value="">{#not_set}</option> | ||
| 437 | <option value="tofit">tofit</option> | ||
| 438 | <option value="aspect">aspect</option> | ||
| 439 | </select> | ||
| 440 | </td> | ||
| 441 | |||
| 442 | <td colspan="2"> </td> | ||
| 443 | </tr> | ||
| 444 | |||
| 445 | <tr> | ||
| 446 | <td><label for="qt_starttime">{#media_dlg.starttime}</label></td> | ||
| 447 | <td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td> | ||
| 448 | |||
| 449 | <td><label for="qt_endtime">{#media_dlg.endtime}</label></td> | ||
| 450 | <td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td> | ||
| 451 | </tr> | ||
| 452 | |||
| 453 | <tr> | ||
| 454 | <td><label for="qt_target">{#media_dlg.target}</label></td> | ||
| 455 | <td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td> | ||
| 456 | |||
| 457 | <td><label for="qt_href">{#media_dlg.href}</label></td> | ||
| 458 | <td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td> | ||
| 459 | </tr> | ||
| 460 | |||
| 461 | <tr> | ||
| 462 | <td><label for="qt_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td> | ||
| 463 | <td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td> | ||
| 464 | |||
| 465 | <td><label for="qt_volume">{#media_dlg.volume}</label></td> | ||
| 466 | <td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td> | ||
| 467 | </tr> | ||
| 468 | |||
| 469 | <tr> | ||
| 470 | <td><label for="qt_qtsrc">{#media_dlg.qtsrc}</label></td> | ||
| 471 | <td colspan="4"> | ||
| 472 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 473 | <tr> | ||
| 474 | <td><input type="text" id="qt_qtsrc" name="qt_qtsrc" onchange="generatePreview();" /></td> | ||
| 475 | <td id="qtsrcfilebrowsercontainer"> </td> | ||
| 476 | </tr> | ||
| 477 | </table> | ||
| 478 | </td> | ||
| 479 | </tr> | ||
| 480 | </table> | ||
| 481 | </fieldset> | ||
| 482 | |||
| 483 | <fieldset id="wmp_options"> | ||
| 484 | <legend>{#media_dlg.wmp_options}</legend> | ||
| 485 | |||
| 486 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 487 | <tr> | ||
| 488 | <td colspan="2"> | ||
| 489 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 490 | <tr> | ||
| 491 | <td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td> | ||
| 492 | <td><label for="wmp_autostart">{#media_dlg.autostart}</label></td> | ||
| 493 | </tr> | ||
| 494 | </table> | ||
| 495 | </td> | ||
| 496 | |||
| 497 | <td colspan="2"> | ||
| 498 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 499 | <tr> | ||
| 500 | <td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td> | ||
| 501 | <td><label for="wmp_enabled">{#media_dlg.enabled}</label></td> | ||
| 502 | </tr> | ||
| 503 | </table> | ||
| 504 | </td> | ||
| 505 | </tr> | ||
| 506 | |||
| 507 | <tr> | ||
| 508 | <td colspan="2"> | ||
| 509 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 510 | <tr> | ||
| 511 | <td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td> | ||
| 512 | <td><label for="wmp_enablecontextmenu">{#media_dlg.menu}</label></td> | ||
| 513 | </tr> | ||
| 514 | </table> | ||
| 515 | </td> | ||
| 516 | |||
| 517 | <td colspan="2"> | ||
| 518 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 519 | <tr> | ||
| 520 | <td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td> | ||
| 521 | <td><label for="wmp_fullscreen">{#media_dlg.fullscreen}</label></td> | ||
| 522 | </tr> | ||
| 523 | </table> | ||
| 524 | </td> | ||
| 525 | </tr> | ||
| 526 | |||
| 527 | <tr> | ||
| 528 | <td colspan="2"> | ||
| 529 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 530 | <tr> | ||
| 531 | <td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td> | ||
| 532 | <td><label for="wmp_invokeurls">{#media_dlg.invokeurls}</label></td> | ||
| 533 | </tr> | ||
| 534 | </table> | ||
| 535 | </td> | ||
| 536 | |||
| 537 | <td colspan="2"> | ||
| 538 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 539 | <tr> | ||
| 540 | <td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td> | ||
| 541 | <td><label for="wmp_mute">{#media_dlg.mute}</label></td> | ||
| 542 | </tr> | ||
| 543 | </table> | ||
| 544 | </td> | ||
| 545 | </tr> | ||
| 546 | |||
| 547 | <tr> | ||
| 548 | <td colspan="2"> | ||
| 549 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 550 | <tr> | ||
| 551 | <td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td> | ||
| 552 | <td><label for="wmp_stretchtofit">{#media_dlg.stretchtofit}</label></td> | ||
| 553 | </tr> | ||
| 554 | </table> | ||
| 555 | </td> | ||
| 556 | |||
| 557 | <td colspan="2"> | ||
| 558 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 559 | <tr> | ||
| 560 | <td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td> | ||
| 561 | <td><label for="wmp_windowlessvideo">{#media_dlg.windowlessvideo}</label></td> | ||
| 562 | </tr> | ||
| 563 | </table> | ||
| 564 | </td> | ||
| 565 | </tr> | ||
| 566 | |||
| 567 | <tr> | ||
| 568 | <td><label for="wmp_balance">{#media_dlg.balance}</label></td> | ||
| 569 | <td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td> | ||
| 570 | |||
| 571 | <td><label for="wmp_baseurl">{#media_dlg.baseurl}</label></td> | ||
| 572 | <td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td> | ||
| 573 | </tr> | ||
| 574 | |||
| 575 | <tr> | ||
| 576 | <td><label for="wmp_captioningid">{#media_dlg.captioningid}</label></td> | ||
| 577 | <td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td> | ||
| 578 | |||
| 579 | <td><label for="wmp_currentmarker">{#media_dlg.currentmarker}</label></td> | ||
| 580 | <td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td> | ||
| 581 | </tr> | ||
| 582 | |||
| 583 | <tr> | ||
| 584 | <td><label for="wmp_currentposition">{#media_dlg.currentposition}</label></td> | ||
| 585 | <td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td> | ||
| 586 | |||
| 587 | <td><label for="wmp_defaultframe">{#media_dlg.defaultframe}</label></td> | ||
| 588 | <td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td> | ||
| 589 | </tr> | ||
| 590 | |||
| 591 | <tr> | ||
| 592 | <td><label for="wmp_playcount">{#media_dlg.playcount}</label></td> | ||
| 593 | <td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td> | ||
| 594 | |||
| 595 | <td><label for="wmp_rate">{#media_dlg.rate}</label></td> | ||
| 596 | <td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td> | ||
| 597 | </tr> | ||
| 598 | |||
| 599 | <tr> | ||
| 600 | <td><label for="wmp_uimode">{#media_dlg.uimode}</label></td> | ||
| 601 | <td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td> | ||
| 602 | |||
| 603 | <td><label for="wmp_volume">{#media_dlg.volume}</label></td> | ||
| 604 | <td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td> | ||
| 605 | </tr> | ||
| 606 | |||
| 607 | </table> | ||
| 608 | </fieldset> | ||
| 609 | |||
| 610 | <fieldset id="rmp_options"> | ||
| 611 | <legend>{#media_dlg.rmp_options}</legend> | ||
| 612 | |||
| 613 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 614 | <tr> | ||
| 615 | <td colspan="2"> | ||
| 616 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 617 | <tr> | ||
| 618 | <td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td> | ||
| 619 | <td><label for="rmp_autostart">{#media_dlg.autostart}</label></td> | ||
| 620 | </tr> | ||
| 621 | </table> | ||
| 622 | </td> | ||
| 623 | |||
| 624 | <td colspan="2"> | ||
| 625 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 626 | <tr> | ||
| 627 | <td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td> | ||
| 628 | <td><label for="rmp_loop">{#media_dlg.loop}</label></td> | ||
| 629 | </tr> | ||
| 630 | </table> | ||
| 631 | </td> | ||
| 632 | </tr> | ||
| 633 | |||
| 634 | <tr> | ||
| 635 | <td colspan="2"> | ||
| 636 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 637 | <tr> | ||
| 638 | <td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td> | ||
| 639 | <td><label for="rmp_autogotourl">{#media_dlg.autogotourl}</label></td> | ||
| 640 | </tr> | ||
| 641 | </table> | ||
| 642 | </td> | ||
| 643 | |||
| 644 | <td colspan="2"> | ||
| 645 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 646 | <tr> | ||
| 647 | <td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td> | ||
| 648 | <td><label for="rmp_center">{#media_dlg.center}</label></td> | ||
| 649 | </tr> | ||
| 650 | </table> | ||
| 651 | </td> | ||
| 652 | </tr> | ||
| 653 | |||
| 654 | <tr> | ||
| 655 | <td colspan="2"> | ||
| 656 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 657 | <tr> | ||
| 658 | <td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td> | ||
| 659 | <td><label for="rmp_imagestatus">{#media_dlg.imagestatus}</label></td> | ||
| 660 | </tr> | ||
| 661 | </table> | ||
| 662 | </td> | ||
| 663 | |||
| 664 | <td colspan="2"> | ||
| 665 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 666 | <tr> | ||
| 667 | <td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td> | ||
| 668 | <td><label for="rmp_maintainaspect">{#media_dlg.maintainaspect}</label></td> | ||
| 669 | </tr> | ||
| 670 | </table> | ||
| 671 | </td> | ||
| 672 | </tr> | ||
| 673 | |||
| 674 | <tr> | ||
| 675 | <td colspan="2"> | ||
| 676 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 677 | <tr> | ||
| 678 | <td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td> | ||
| 679 | <td><label for="rmp_nojava">{#media_dlg.nojava}</label></td> | ||
| 680 | </tr> | ||
| 681 | </table> | ||
| 682 | </td> | ||
| 683 | |||
| 684 | <td colspan="2"> | ||
| 685 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 686 | <tr> | ||
| 687 | <td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td> | ||
| 688 | <td><label for="rmp_prefetch">{#media_dlg.prefetch}</label></td> | ||
| 689 | </tr> | ||
| 690 | </table> | ||
| 691 | </td> | ||
| 692 | </tr> | ||
| 693 | |||
| 694 | <tr> | ||
| 695 | <td colspan="2"> | ||
| 696 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 697 | <tr> | ||
| 698 | <td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td> | ||
| 699 | <td><label for="rmp_shuffle">{#media_dlg.shuffle}</label></td> | ||
| 700 | </tr> | ||
| 701 | </table> | ||
| 702 | </td> | ||
| 703 | |||
| 704 | <td colspan="2"> | ||
| 705 | | ||
| 706 | </td> | ||
| 707 | </tr> | ||
| 708 | |||
| 709 | <tr> | ||
| 710 | <td><label for="rmp_console">{#media_dlg.console}</label></td> | ||
| 711 | <td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td> | ||
| 712 | |||
| 713 | <td><label for="rmp_controls">{#media_dlg.controls}</label></td> | ||
| 714 | <td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td> | ||
| 715 | </tr> | ||
| 716 | |||
| 717 | <tr> | ||
| 718 | <td><label for="rmp_numloop">{#media_dlg.numloop}</label></td> | ||
| 719 | <td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td> | ||
| 720 | |||
| 721 | <td><label for="rmp_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td> | ||
| 722 | <td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td> | ||
| 723 | </tr> | ||
| 724 | </table> | ||
| 725 | </fieldset> | ||
| 726 | |||
| 727 | <fieldset id="shockwave_options"> | ||
| 728 | <legend>{#media_dlg.shockwave_options}</legend> | ||
| 729 | |||
| 730 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 731 | <tr> | ||
| 732 | <td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td> | ||
| 733 | <td> | ||
| 734 | <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();"> | ||
| 735 | <option value="none">{#not_set}</option> | ||
| 736 | <option value="meet">Meet</option> | ||
| 737 | <option value="fill">Fill</option> | ||
| 738 | <option value="stage">Stage</option> | ||
| 739 | </select> | ||
| 740 | </td> | ||
| 741 | |||
| 742 | <td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td> | ||
| 743 | <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td> | ||
| 744 | </tr> | ||
| 745 | |||
| 746 | <tr> | ||
| 747 | <td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td> | ||
| 748 | <td> | ||
| 749 | <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();"> | ||
| 750 | <option value="none">{#not_set}</option> | ||
| 751 | <option value="left">{#media_dlg.align_left}</option> | ||
| 752 | <option value="center">{#media_dlg.align_center}</option> | ||
| 753 | <option value="right">{#media_dlg.align_right}</option> | ||
| 754 | </select> | ||
| 755 | </td> | ||
| 756 | |||
| 757 | <td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td> | ||
| 758 | <td> | ||
| 759 | <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();"> | ||
| 760 | <option value="none">{#not_set}</option> | ||
| 761 | <option value="meet">Meet</option> | ||
| 762 | <option value="fill">Fill</option> | ||
| 763 | <option value="stage">Stage</option> | ||
| 764 | </select> | ||
| 765 | </td> | ||
| 766 | </tr> | ||
| 767 | |||
| 768 | <tr> | ||
| 769 | <td colspan="2"> | ||
| 770 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 771 | <tr> | ||
| 772 | <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td> | ||
| 773 | <td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td> | ||
| 774 | </tr> | ||
| 775 | </table> | ||
| 776 | </td> | ||
| 777 | |||
| 778 | <td colspan="2"> | ||
| 779 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 780 | <tr> | ||
| 781 | <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td> | ||
| 782 | <td><label for="shockwave_sound">{#media_dlg.sound}</label></td> | ||
| 783 | </tr> | ||
| 784 | </table> | ||
| 785 | </td> | ||
| 786 | </tr> | ||
| 787 | |||
| 788 | |||
| 789 | <tr> | ||
| 790 | <td colspan="2"> | ||
| 791 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 792 | <tr> | ||
| 793 | <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td> | ||
| 794 | <td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td> | ||
| 795 | </tr> | ||
| 796 | </table> | ||
| 797 | </td> | ||
| 798 | |||
| 799 | <td colspan="2"> | ||
| 800 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 801 | <tr> | ||
| 802 | <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td> | ||
| 803 | <td><label for="shockwave_progress">{#media_dlg.progress}</label></td> | ||
| 804 | </tr> | ||
| 805 | </table> | ||
| 806 | </td> | ||
| 807 | </tr> | ||
| 808 | </table> | ||
| 809 | </fieldset> | ||
| 810 | </div> | ||
| 811 | </div> | ||
| 812 | |||
| 813 | <div class="mceActionPanel"> | ||
| 814 | <div style="float: left"> | ||
| 815 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 816 | </div> | ||
| 817 | |||
| 818 | <div style="float: right"> | ||
| 819 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 820 | </div> | ||
| 821 | </div> | ||
| 822 | </form> | ||
| 823 | </body> | ||
| 824 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js b/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js new file mode 100755 index 0000000..4fce503 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.Nonbreaking',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceNonBreaking',function(){ed.execCommand('mceInsertContent',false,(ed.plugins.visualchars&&ed.plugins.visualchars.state)?'<span class="mceItemHidden mceVisualNbsp">·</span>':' ');});ed.addButton('nonbreaking',{title:'nonbreaking.nonbreaking_desc',cmd:'mceNonBreaking'});if(ed.getParam('nonbreaking_force_tab')){ed.onKeyDown.add(function(ed,e){if(tinymce.isIE&&e.keyCode==9){ed.execCommand('mceNonBreaking');ed.execCommand('mceNonBreaking');ed.execCommand('mceNonBreaking');tinymce.dom.Event.cancel(e);}});}},getInfo:function(){return{longname:'Nonbreaking space',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('nonbreaking',tinymce.plugins.Nonbreaking);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js new file mode 100755 index 0000000..b723756 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Nonbreaking', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mceNonBreaking', function() { | ||
| 17 | ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span class="mceItemHidden mceVisualNbsp">·</span>' : ' '); | ||
| 18 | }); | ||
| 19 | |||
| 20 | // Register buttons | ||
| 21 | ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); | ||
| 22 | |||
| 23 | if (ed.getParam('nonbreaking_force_tab')) { | ||
| 24 | ed.onKeyDown.add(function(ed, e) { | ||
| 25 | if (tinymce.isIE && e.keyCode == 9) { | ||
| 26 | ed.execCommand('mceNonBreaking'); | ||
| 27 | ed.execCommand('mceNonBreaking'); | ||
| 28 | ed.execCommand('mceNonBreaking'); | ||
| 29 | tinymce.dom.Event.cancel(e); | ||
| 30 | } | ||
| 31 | }); | ||
| 32 | } | ||
| 33 | }, | ||
| 34 | |||
| 35 | getInfo : function() { | ||
| 36 | return { | ||
| 37 | longname : 'Nonbreaking space', | ||
| 38 | author : 'Moxiecode Systems AB', | ||
| 39 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 40 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', | ||
| 41 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 42 | }; | ||
| 43 | } | ||
| 44 | |||
| 45 | // Private methods | ||
| 46 | }); | ||
| 47 | |||
| 48 | // Register plugin | ||
| 49 | tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); | ||
| 50 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js new file mode 100755 index 0000000..8a1b8f0 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.NonEditablePlugin',{init:function(ed,url){var t=this,editClass,nonEditClass;t.editor=ed;editClass=ed.getParam("noneditable_editable_class","mceEditable");nonEditClass=ed.getParam("noneditable_noneditable_class","mceNonEditable");ed.onNodeChange.addToTop(function(ed,cm,n){var sc,ec;sc=ed.dom.getParent(ed.selection.getStart(),function(n){return ed.dom.hasClass(n,nonEditClass);});ec=ed.dom.getParent(ed.selection.getEnd(),function(n){return ed.dom.hasClass(n,nonEditClass);});if(sc||ec){t._setDisabled(1);return false;}else t._setDisabled(0);});},getInfo:function(){return{longname:'Non editable elements',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_block:function(ed,e){var k=e.keyCode;if((k>32&&k<41)||(k>111&&k<124))return;return Event.cancel(e);},_setDisabled:function(s){var t=this,ed=t.editor;tinymce.each(ed.controlManager.controls,function(c){c.setDisabled(s);});if(s!==t.disabled){if(s){ed.onKeyDown.addToTop(t._block);ed.onKeyPress.addToTop(t._block);ed.onKeyUp.addToTop(t._block);ed.onPaste.addToTop(t._block);}else{ed.onKeyDown.remove(t._block);ed.onKeyPress.remove(t._block);ed.onKeyUp.remove(t._block);ed.onPaste.remove(t._block);}t.disabled=s;}}});tinymce.PluginManager.add('noneditable',tinymce.plugins.NonEditablePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js new file mode 100755 index 0000000..77db577 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 743 2008-03-23 17:47:33Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var Event = tinymce.dom.Event; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.NonEditablePlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this, editClass, nonEditClass; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | editClass = ed.getParam("noneditable_editable_class", "mceEditable"); | ||
| 17 | nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable"); | ||
| 18 | |||
| 19 | ed.onNodeChange.addToTop(function(ed, cm, n) { | ||
| 20 | var sc, ec; | ||
| 21 | |||
| 22 | // Block if start or end is inside a non editable element | ||
| 23 | sc = ed.dom.getParent(ed.selection.getStart(), function(n) { | ||
| 24 | return ed.dom.hasClass(n, nonEditClass); | ||
| 25 | }); | ||
| 26 | |||
| 27 | ec = ed.dom.getParent(ed.selection.getEnd(), function(n) { | ||
| 28 | return ed.dom.hasClass(n, nonEditClass); | ||
| 29 | }); | ||
| 30 | |||
| 31 | // Block or unblock | ||
| 32 | if (sc || ec) { | ||
| 33 | t._setDisabled(1); | ||
| 34 | return false; | ||
| 35 | } else | ||
| 36 | t._setDisabled(0); | ||
| 37 | }); | ||
| 38 | }, | ||
| 39 | |||
| 40 | getInfo : function() { | ||
| 41 | return { | ||
| 42 | longname : 'Non editable elements', | ||
| 43 | author : 'Moxiecode Systems AB', | ||
| 44 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 45 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', | ||
| 46 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 47 | }; | ||
| 48 | }, | ||
| 49 | |||
| 50 | _block : function(ed, e) { | ||
| 51 | var k = e.keyCode; | ||
| 52 | |||
| 53 | // Don't block arrow keys, pg up/down, and F1-F12 | ||
| 54 | if ((k > 32 && k < 41) || (k > 111 && k < 124)) | ||
| 55 | return; | ||
| 56 | |||
| 57 | return Event.cancel(e); | ||
| 58 | }, | ||
| 59 | |||
| 60 | _setDisabled : function(s) { | ||
| 61 | var t = this, ed = t.editor; | ||
| 62 | |||
| 63 | tinymce.each(ed.controlManager.controls, function(c) { | ||
| 64 | c.setDisabled(s); | ||
| 65 | }); | ||
| 66 | |||
| 67 | if (s !== t.disabled) { | ||
| 68 | if (s) { | ||
| 69 | ed.onKeyDown.addToTop(t._block); | ||
| 70 | ed.onKeyPress.addToTop(t._block); | ||
| 71 | ed.onKeyUp.addToTop(t._block); | ||
| 72 | ed.onPaste.addToTop(t._block); | ||
| 73 | } else { | ||
| 74 | ed.onKeyDown.remove(t._block); | ||
| 75 | ed.onKeyPress.remove(t._block); | ||
| 76 | ed.onKeyUp.remove(t._block); | ||
| 77 | ed.onPaste.remove(t._block); | ||
| 78 | } | ||
| 79 | |||
| 80 | t.disabled = s; | ||
| 81 | } | ||
| 82 | } | ||
| 83 | }); | ||
| 84 | |||
| 85 | // Register plugin | ||
| 86 | tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); | ||
| 87 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css b/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css new file mode 100755 index 0000000..c949d58 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css | |||
| @@ -0,0 +1 @@ | |||
| .mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../img/pagebreak.gif) no-repeat center top;} | |||
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js b/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js new file mode 100755 index 0000000..177ea95 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.PageBreakPlugin',{init:function(ed,url){var pb='<img src="'+url+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',cls='mcePageBreak',sep=ed.getParam('pagebreak_separator','<!-- pagebreak -->'),pbRE;pbRE=new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return'\\'+a;}),'g');ed.addCommand('mcePageBreak',function(){ed.execCommand('mceInsertContent',0,pb);});ed.addButton('pagebreak',{title:'pagebreak.desc',cmd:cls});ed.onInit.add(function(){if(ed.settings.content_css!==false)ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.node.nodeName=='IMG'&&ed.dom.hasClass(o.node,cls))o.name='pagebreak';});}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='IMG'&&ed.dom.hasClass(e,cls))ed.selection.select(e);});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('pagebreak',n.nodeName==='IMG'&&ed.dom.hasClass(n,cls));});ed.onBeforeSetContent.add(function(ed,o){o.content=o.content.replace(pbRE,pb);});ed.onPostProcess.add(function(ed,o){if(o.get)o.content=o.content.replace(/<img[^>]+>/g,function(im){if(im.indexOf('class="mcePageBreak')!==-1)im=sep;return im;});});},getInfo:function(){return{longname:'PageBreak',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('pagebreak',tinymce.plugins.PageBreakPlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js new file mode 100755 index 0000000..16f5748 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.PageBreakPlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var pb = '<img src="' + url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE; | ||
| 12 | |||
| 13 | pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mcePageBreak', function() { | ||
| 17 | ed.execCommand('mceInsertContent', 0, pb); | ||
| 18 | }); | ||
| 19 | |||
| 20 | // Register buttons | ||
| 21 | ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); | ||
| 22 | |||
| 23 | ed.onInit.add(function() { | ||
| 24 | if (ed.settings.content_css !== false) | ||
| 25 | ed.dom.loadCSS(url + "/css/content.css"); | ||
| 26 | |||
| 27 | if (ed.theme.onResolveName) { | ||
| 28 | ed.theme.onResolveName.add(function(th, o) { | ||
| 29 | if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) | ||
| 30 | o.name = 'pagebreak'; | ||
| 31 | }); | ||
| 32 | } | ||
| 33 | }); | ||
| 34 | |||
| 35 | ed.onClick.add(function(ed, e) { | ||
| 36 | e = e.target; | ||
| 37 | |||
| 38 | if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) | ||
| 39 | ed.selection.select(e); | ||
| 40 | }); | ||
| 41 | |||
| 42 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 43 | cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); | ||
| 44 | }); | ||
| 45 | |||
| 46 | ed.onBeforeSetContent.add(function(ed, o) { | ||
| 47 | o.content = o.content.replace(pbRE, pb); | ||
| 48 | }); | ||
| 49 | |||
| 50 | ed.onPostProcess.add(function(ed, o) { | ||
| 51 | if (o.get) | ||
| 52 | o.content = o.content.replace(/<img[^>]+>/g, function(im) { | ||
| 53 | if (im.indexOf('class="mcePageBreak') !== -1) | ||
| 54 | im = sep; | ||
| 55 | |||
| 56 | return im; | ||
| 57 | }); | ||
| 58 | }); | ||
| 59 | }, | ||
| 60 | |||
| 61 | getInfo : function() { | ||
| 62 | return { | ||
| 63 | longname : 'PageBreak', | ||
| 64 | author : 'Moxiecode Systems AB', | ||
| 65 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 66 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', | ||
| 67 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 68 | }; | ||
| 69 | } | ||
| 70 | }); | ||
| 71 | |||
| 72 | // Register plugin | ||
| 73 | tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); | ||
| 74 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif b/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif new file mode 100755 index 0000000..acdf408 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif b/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif new file mode 100755 index 0000000..3884865 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/paste/blank.htm b/public/javascripts/tiny_mce/plugins/paste/blank.htm new file mode 100755 index 0000000..7ba26bd --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/blank.htm | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <title>blank_page</title> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
| 5 | <link href="css/blank.css" rel="stylesheet" type="text/css" /> | ||
| 6 | <base target="_self" /> | ||
| 7 | <script type="text/javascript"> | ||
| 8 | function init() { | ||
| 9 | if (parent.tinymce.isIE) | ||
| 10 | document.body.contentEditable = true; | ||
| 11 | else | ||
| 12 | document.designMode = 'on'; | ||
| 13 | |||
| 14 | parent.initIframe(document); | ||
| 15 | window.focus(); | ||
| 16 | } | ||
| 17 | </script> | ||
| 18 | </head> | ||
| 19 | <body onload="init();"> | ||
| 20 | |||
| 21 | </body> | ||
| 22 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/css/blank.css b/public/javascripts/tiny_mce/plugins/paste/css/blank.css new file mode 100755 index 0000000..6b16bac --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/css/blank.css | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | html, body {height:98%} | ||
| 2 | body { | ||
| 3 | background-color: #FFFFFF; | ||
| 4 | font-family: Verdana, Arial, Helvetica, sans-serif; | ||
| 5 | font-size: 10px; | ||
| 6 | scrollbar-3dlight-color: #F0F0EE; | ||
| 7 | scrollbar-arrow-color: #676662; | ||
| 8 | scrollbar-base-color: #F0F0EE; | ||
| 9 | scrollbar-darkshadow-color: #DDDDDD; | ||
| 10 | scrollbar-face-color: #E0E0DD; | ||
| 11 | scrollbar-highlight-color: #F0F0EE; | ||
| 12 | scrollbar-shadow-color: #F0F0EE; | ||
| 13 | scrollbar-track-color: #F5F5F5; | ||
| 14 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/css/pasteword.css b/public/javascripts/tiny_mce/plugins/paste/css/pasteword.css new file mode 100755 index 0000000..b3be627 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/css/pasteword.css | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | .sourceIframe { | ||
| 2 | border: 1px solid #808080; | ||
| 3 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js b/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js new file mode 100755 index 0000000..eeeebd5 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.PastePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePasteText',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pastetext.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(clipboardData.getData("Text"),true);}else t._insertText(v.html,v.linebreaks);});ed.addCommand('mcePasteWord',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pasteword.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(t._clipboardHTML());}else t._insertWordContent(v);});ed.addCommand('mceSelectAll',function(){ed.execCommand('selectall');});ed.addButton('pastetext',{title:'paste.paste_text_desc',cmd:'mcePasteText',ui:true});ed.addButton('pasteword',{title:'paste.paste_word_desc',cmd:'mcePasteWord',ui:true});ed.addButton('selectall',{title:'paste.selectall_desc',cmd:'mceSelectAll'});if(ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onPaste.add(function(ed,e){return t._handlePasteEvent(e)});}if(!tinymce.isIE&&ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onKeyDown.add(function(ed,e){if(e.ctrlKey&&e.keyCode==86){window.setTimeout(function(){ed.execCommand("mcePasteText",true);},1);Event.cancel(e);}});}},getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_handlePasteEvent:function(e){var html=this._clipboardHTML(),ed=this.editor,sel=ed.selection,r;if(ed&&(r=sel.getRng())&&r.text.length>0)ed.execCommand('delete');if(html&&html.length>0)ed.execCommand('mcePasteWord',false,html);return Event.cancel(e);},_insertText:function(content,bLinebreaks){content=this.editor.dom.encode(content);if(content&&content.length>0){if(!this.editor.selection.isCollapsed())this.editor.execCommand("Delete");if(bLinebreaks){if(this.editor.getParam("paste_create_paragraphs",true)){var rl=this.editor.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);content=content.replace(/\r\n\r\n/g,'</p><p>');content=content.replace(/\r\r/g,'</p><p>');content=content.replace(/\n\n/g,'</p><p>');if((pos=content.indexOf('</p><p>'))!=-1){this.editor.execCommand("Delete");var node=this.editor.selection.getNode();var breakElms=[];do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="</p>";before+=content.substring(0,pos);for(var i=0;i<breakElms.length;i++){before+="</"+breakElms[i].nodeName+">";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="<p>";content=before+content.substring(pos+7)+after;}}if(this.editor.getParam("paste_create_linebreaks",true)){content=content.replace(/\r\n/g,'<br />');content=content.replace(/\r/g,'<br />');content=content.replace(/\n/g,'<br />');}}this.editor.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){var t=this,ed=t.editor;if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','before',content);var rl=ed.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\x93|\x94|\u201c|\u201d,",\x60|\x91|\x92|\u2018|\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>','gi'),'<p><b>$1</b></p>');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)<BR>","gi"),"<p>"+middot+"$1</p>");content=content.replace(new RegExp('<SPAN style="mso-list: Ignore">','gi'),"<span>"+bull);content=content.replace(/<o:p><\/o:p>/gi,"");content=content.replace(new RegExp('<br style="page-break-before: always;.*>','gi'),'-- page break --');content=content.replace(/<!--([\s\S]*?)-->|<style>[\s\S]*?<\/style>/g,"");content=content.replace(/<(meta|link)[^>]+>/g,"");if(this.editor.getParam("paste_remove_spans",true))content=content.replace(/<\/?span[^>]*>/gi,"");if(this.editor.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(this.editor.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+this._reEscape(""+document.location)+'','gi'),'href="'+this.editor.documentBaseURI.getURI());content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*<p> <\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!this.editor.getParam('force_p_newlines')){content=content.replace('','','gi');content=content.replace('</p>','<br /><br />','gi');}if(!tinymce.isIE&&!this.editor.getParam('force_p_newlines')){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(this.editor.getParam("paste_convert_middot_lists",true)){var div=ed.dom.create("div",null,content);var className=this.editor.getParam("paste_unindented_list_class","unIndentedList");while(this._convertMiddots(div,"--list--"));while(this._convertMiddots(div,middot,className));while(this._convertMiddots(div,bull));content=div.innerHTML;}if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/<h[1-6]> <\/h[1-6]>/gi,'<p> </p>');content=content.replace(/<h[1-6]>/gi,'<p><b>');content=content.replace(/<\/h[1-6]>/gi,'</b></p>');content=content.replace(/<b> <\/b>/gi,'<b> </b>');content=content.replace(/^( )*/gi,'');}content=content.replace(/--list--/gi,"");if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','after',content);this.editor.execCommand("mceInsertContent",false,content);if(this.editor.getParam('paste_force_cleanup_wordpaste',true)){var ed=this.editor;window.setTimeout(function(){ed.execCommand("mceCleanup");},1);}}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i<s.length;i++){var c=s.charAt(i);if(l.indexOf(c)!=-1)o+='\\'+c;else o+=c;}return o;},_convertMiddots:function(div,search,class_name){var ed=this.editor,mdot=String.fromCharCode(183),bull=String.fromCharCode(8226);var nodes,prevul,i,p,ul,li,np,cp,li;nodes=div.getElementsByTagName("p");for(i=0;i<nodes.length;i++){p=nodes[i];if(p.innerHTML.indexOf(search)==0){ul=ed.dom.create("ul");if(class_name)ul.className=class_name;li=ed.dom.create("li");li.innerHTML=p.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--| ',"gi"),'');ul.appendChild(li);np=p.nextSibling;while(np){if(np.nodeType==3&&new RegExp('^\\s$','m').test(np.nodeValue)){np=np.nextSibling;continue;}if(search==mdot){if(np.nodeType==1&&new RegExp('^o(\\s+| )').test(np.innerHTML)){if(!prevul){prevul=ul;ul=ed.dom.create("ul");prevul.appendChild(ul);}np.innerHTML=np.innerHTML.replace(/^o/,'');}else{if(prevul){ul=prevul;prevul=null;}if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}}else{if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}cp=np.nextSibling;li=ed.dom.create("li");li.innerHTML=np.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--| ',"gi"),'');np.parentNode.removeChild(np);ul.appendChild(li);np=cp;}p.parentNode.replaceChild(ul,p);return true;}}return false;},_clipboardHTML:function(){var div=document.getElementById('_TinyMCE_clipboardHTML');if(!div){var div=document.createElement('DIV');div.id='_TinyMCE_clipboardHTML';with(div.style){visibility='hidden';overflow='hidden';position='absolute';width=1;height=1;}document.body.appendChild(div);}div.innerHTML='';var rng=document.body.createTextRange();rng.moveToElementText(div);rng.execCommand('Paste');var html=div.innerHTML;div.innerHTML='';return html;}});tinymce.PluginManager.add('paste',tinymce.plugins.PastePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js new file mode 100755 index 0000000..bb5f5aa --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js | |||
| @@ -0,0 +1,394 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 919 2008-09-08 20:31:23Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var Event = tinymce.dom.Event; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.PastePlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | |||
| 17 | // Register commands | ||
| 18 | ed.addCommand('mcePasteText', function(ui, v) { | ||
| 19 | if (ui) { | ||
| 20 | if ((ed.getParam('paste_use_dialog', true)) || (!tinymce.isIE)) { | ||
| 21 | ed.windowManager.open({ | ||
| 22 | file : url + '/pastetext.htm', | ||
| 23 | width : 450, | ||
| 24 | height : 400, | ||
| 25 | inline : 1 | ||
| 26 | }, { | ||
| 27 | plugin_url : url | ||
| 28 | }); | ||
| 29 | } else | ||
| 30 | t._insertText(clipboardData.getData("Text"), true); | ||
| 31 | } else | ||
| 32 | t._insertText(v.html, v.linebreaks); | ||
| 33 | }); | ||
| 34 | |||
| 35 | ed.addCommand('mcePasteWord', function(ui, v) { | ||
| 36 | if (ui) { | ||
| 37 | if ((ed.getParam('paste_use_dialog', true)) || (!tinymce.isIE)) { | ||
| 38 | ed.windowManager.open({ | ||
| 39 | file : url + '/pasteword.htm', | ||
| 40 | width : 450, | ||
| 41 | height : 400, | ||
| 42 | inline : 1 | ||
| 43 | }, { | ||
| 44 | plugin_url : url | ||
| 45 | }); | ||
| 46 | } else | ||
| 47 | t._insertText(t._clipboardHTML()); | ||
| 48 | } else | ||
| 49 | t._insertWordContent(v); | ||
| 50 | }); | ||
| 51 | |||
| 52 | ed.addCommand('mceSelectAll', function() { | ||
| 53 | ed.execCommand('selectall'); | ||
| 54 | }); | ||
| 55 | |||
| 56 | // Register buttons | ||
| 57 | ed.addButton('pastetext', {title : 'paste.paste_text_desc', cmd : 'mcePasteText', ui : true}); | ||
| 58 | ed.addButton('pasteword', {title : 'paste.paste_word_desc', cmd : 'mcePasteWord', ui : true}); | ||
| 59 | ed.addButton('selectall', {title : 'paste.selectall_desc', cmd : 'mceSelectAll'}); | ||
| 60 | |||
| 61 | if (ed.getParam("paste_auto_cleanup_on_paste", false)) { | ||
| 62 | ed.onPaste.add(function(ed, e) { | ||
| 63 | return t._handlePasteEvent(e) | ||
| 64 | }); | ||
| 65 | } | ||
| 66 | |||
| 67 | if (!tinymce.isIE && ed.getParam("paste_auto_cleanup_on_paste", false)) { | ||
| 68 | // Force paste dialog if non IE browser | ||
| 69 | ed.onKeyDown.add(function(ed, e) { | ||
| 70 | if (e.ctrlKey && e.keyCode == 86) { | ||
| 71 | window.setTimeout(function() { | ||
| 72 | ed.execCommand("mcePasteText", true); | ||
| 73 | }, 1); | ||
| 74 | |||
| 75 | Event.cancel(e); | ||
| 76 | } | ||
| 77 | }); | ||
| 78 | } | ||
| 79 | }, | ||
| 80 | |||
| 81 | getInfo : function() { | ||
| 82 | return { | ||
| 83 | longname : 'Paste text/word', | ||
| 84 | author : 'Moxiecode Systems AB', | ||
| 85 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 86 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', | ||
| 87 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 88 | }; | ||
| 89 | }, | ||
| 90 | |||
| 91 | // Private methods | ||
| 92 | |||
| 93 | _handlePasteEvent : function(e) { | ||
| 94 | var html = this._clipboardHTML(), ed = this.editor, sel = ed.selection, r; | ||
| 95 | |||
| 96 | // Removes italic, strong etc, the if was needed due to bug #1437114 | ||
| 97 | if (ed && (r = sel.getRng()) && r.text.length > 0) | ||
| 98 | ed.execCommand('delete'); | ||
| 99 | |||
| 100 | if (html && html.length > 0) | ||
| 101 | ed.execCommand('mcePasteWord', false, html); | ||
| 102 | |||
| 103 | return Event.cancel(e); | ||
| 104 | }, | ||
| 105 | |||
| 106 | _insertText : function(content, bLinebreaks) { | ||
| 107 | content = this.editor.dom.encode(content); | ||
| 108 | |||
| 109 | if (content && content.length > 0) { | ||
| 110 | // Delete any highlighted text before pasting | ||
| 111 | if (!this.editor.selection.isCollapsed()) | ||
| 112 | this.editor.execCommand("Delete"); | ||
| 113 | |||
| 114 | if (bLinebreaks) { | ||
| 115 | // Special paragraph treatment | ||
| 116 | if (this.editor.getParam("paste_create_paragraphs", true)) { | ||
| 117 | var rl = this.editor.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); | ||
| 118 | for (var i=0; i<rl.length; i+=2) | ||
| 119 | content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]); | ||
| 120 | |||
| 121 | content = content.replace(/\r\n\r\n/g, '</p><p>'); | ||
| 122 | content = content.replace(/\r\r/g, '</p><p>'); | ||
| 123 | content = content.replace(/\n\n/g, '</p><p>'); | ||
| 124 | |||
| 125 | // Has paragraphs | ||
| 126 | if ((pos = content.indexOf('</p><p>')) != -1) { | ||
| 127 | this.editor.execCommand("Delete"); | ||
| 128 | |||
| 129 | var node = this.editor.selection.getNode(); | ||
| 130 | |||
| 131 | // Get list of elements to break | ||
| 132 | var breakElms = []; | ||
| 133 | |||
| 134 | do { | ||
| 135 | if (node.nodeType == 1) { | ||
| 136 | // Don't break tables and break at body | ||
| 137 | if (node.nodeName == "TD" || node.nodeName == "BODY") | ||
| 138 | break; | ||
| 139 | |||
| 140 | breakElms[breakElms.length] = node; | ||
| 141 | } | ||
| 142 | } while(node = node.parentNode); | ||
| 143 | |||
| 144 | var before = "", after = "</p>"; | ||
| 145 | before += content.substring(0, pos); | ||
| 146 | |||
| 147 | for (var i=0; i<breakElms.length; i++) { | ||
| 148 | before += "</" + breakElms[i].nodeName + ">"; | ||
| 149 | after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">"; | ||
| 150 | } | ||
| 151 | |||
| 152 | before += "<p>"; | ||
| 153 | content = before + content.substring(pos+7) + after; | ||
| 154 | } | ||
| 155 | } | ||
| 156 | |||
| 157 | if (this.editor.getParam("paste_create_linebreaks", true)) { | ||
| 158 | content = content.replace(/\r\n/g, '<br />'); | ||
| 159 | content = content.replace(/\r/g, '<br />'); | ||
| 160 | content = content.replace(/\n/g, '<br />'); | ||
| 161 | } | ||
| 162 | } | ||
| 163 | |||
| 164 | this.editor.execCommand("mceInsertRawHTML", false, content); | ||
| 165 | } | ||
| 166 | }, | ||
| 167 | |||
| 168 | _insertWordContent : function(content) { | ||
| 169 | var t = this, ed = t.editor; | ||
| 170 | |||
| 171 | if (content && content.length > 0) { | ||
| 172 | // Cleanup Word content | ||
| 173 | var bull = String.fromCharCode(8226); | ||
| 174 | var middot = String.fromCharCode(183); | ||
| 175 | |||
| 176 | if (ed.getParam('paste_insert_word_content_callback')) | ||
| 177 | content = ed.execCallback('paste_insert_word_content_callback', 'before', content); | ||
| 178 | |||
| 179 | var rl = ed.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\x93|\x94|\u201c|\u201d,",\x60|\x91|\x92|\u2018|\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); | ||
| 180 | for (var i=0; i<rl.length; i+=2) | ||
| 181 | content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]); | ||
| 182 | |||
| 183 | if (this.editor.getParam("paste_convert_headers_to_strong", false)) { | ||
| 184 | content = content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>', 'gi'), '<p><b>$1</b></p>'); | ||
| 185 | } | ||
| 186 | |||
| 187 | content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--"); | ||
| 188 | content = content.replace(new RegExp(bull + "(.*?)<BR>", "gi"), "<p>" + middot + "$1</p>"); | ||
| 189 | content = content.replace(new RegExp('<SPAN style="mso-list: Ignore">', 'gi'), "<span>" + bull); // Covert to bull list | ||
| 190 | content = content.replace(/<o:p><\/o:p>/gi, ""); | ||
| 191 | content = content.replace(new RegExp('<br style="page-break-before: always;.*>', 'gi'), '-- page break --'); // Replace pagebreaks | ||
| 192 | content = content.replace(/<!--([\s\S]*?)-->|<style>[\s\S]*?<\/style>/g, ""); // Word comments | ||
| 193 | content = content.replace(/<(meta|link)[^>]+>/g, ""); // Header elements | ||
| 194 | |||
| 195 | if (this.editor.getParam("paste_remove_spans", true)) | ||
| 196 | content = content.replace(/<\/?span[^>]*>/gi, ""); | ||
| 197 | |||
| 198 | if (this.editor.getParam("paste_remove_styles", true)) | ||
| 199 | content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3"); | ||
| 200 | |||
| 201 | content = content.replace(/<\/?font[^>]*>/gi, ""); | ||
| 202 | |||
| 203 | // Strips class attributes. | ||
| 204 | switch (this.editor.getParam("paste_strip_class_attributes", "all")) { | ||
| 205 | case "all": | ||
| 206 | content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3"); | ||
| 207 | break; | ||
| 208 | |||
| 209 | case "mso": | ||
| 210 | content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3"); | ||
| 211 | break; | ||
| 212 | } | ||
| 213 | |||
| 214 | content = content.replace(new RegExp('href="?' + this._reEscape("" + document.location) + '', 'gi'), 'href="' + this.editor.documentBaseURI.getURI()); | ||
| 215 | content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); | ||
| 216 | content = content.replace(/<\\?\?xml[^>]*>/gi, ""); | ||
| 217 | content = content.replace(/<\/?\w+:[^>]*>/gi, ""); | ||
| 218 | content = content.replace(/-- page break --\s*<p> <\/p>/gi, ""); // Remove pagebreaks | ||
| 219 | content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks | ||
| 220 | |||
| 221 | // content = content.replace(/\/? */gi, ""); | ||
| 222 | // content = content.replace(/<p> <\/p>/gi, ''); | ||
| 223 | |||
| 224 | if (!this.editor.getParam('force_p_newlines')) { | ||
| 225 | content = content.replace('', '' ,'gi'); | ||
| 226 | content = content.replace('</p>', '<br /><br />' ,'gi'); | ||
| 227 | } | ||
| 228 | |||
| 229 | if (!tinymce.isIE && !this.editor.getParam('force_p_newlines')) { | ||
| 230 | content = content.replace(/<\/?p[^>]*>/gi, ""); | ||
| 231 | } | ||
| 232 | |||
| 233 | content = content.replace(/<\/?div[^>]*>/gi, ""); | ||
| 234 | |||
| 235 | // Convert all middlot lists to UL lists | ||
| 236 | if (this.editor.getParam("paste_convert_middot_lists", true)) { | ||
| 237 | var div = ed.dom.create("div", null, content); | ||
| 238 | |||
| 239 | // Convert all middot paragraphs to li elements | ||
| 240 | var className = this.editor.getParam("paste_unindented_list_class", "unIndentedList"); | ||
| 241 | |||
| 242 | while (this._convertMiddots(div, "--list--")) ; // bull | ||
| 243 | while (this._convertMiddots(div, middot, className)) ; // Middot | ||
| 244 | while (this._convertMiddots(div, bull)) ; // bull | ||
| 245 | |||
| 246 | content = div.innerHTML; | ||
| 247 | } | ||
| 248 | |||
| 249 | // Replace all headers with strong and fix some other issues | ||
| 250 | if (this.editor.getParam("paste_convert_headers_to_strong", false)) { | ||
| 251 | content = content.replace(/<h[1-6]> <\/h[1-6]>/gi, '<p> </p>'); | ||
| 252 | content = content.replace(/<h[1-6]>/gi, '<p><b>'); | ||
| 253 | content = content.replace(/<\/h[1-6]>/gi, '</b></p>'); | ||
| 254 | content = content.replace(/<b> <\/b>/gi, '<b> </b>'); | ||
| 255 | content = content.replace(/^( )*/gi, ''); | ||
| 256 | } | ||
| 257 | |||
| 258 | content = content.replace(/--list--/gi, ""); // Remove --list-- | ||
| 259 | |||
| 260 | if (ed.getParam('paste_insert_word_content_callback')) | ||
| 261 | content = ed.execCallback('paste_insert_word_content_callback', 'after', content); | ||
| 262 | |||
| 263 | // Insert cleaned content | ||
| 264 | this.editor.execCommand("mceInsertContent", false, content); | ||
| 265 | |||
| 266 | if (this.editor.getParam('paste_force_cleanup_wordpaste', true)) { | ||
| 267 | var ed = this.editor; | ||
| 268 | |||
| 269 | window.setTimeout(function() { | ||
| 270 | ed.execCommand("mceCleanup"); | ||
| 271 | }, 1); // Do normal cleanup detached from this thread | ||
| 272 | } | ||
| 273 | } | ||
| 274 | }, | ||
| 275 | |||
| 276 | _reEscape : function(s) { | ||
| 277 | var l = "?.\\*[](){}+^$:"; | ||
| 278 | var o = ""; | ||
| 279 | |||
| 280 | for (var i=0; i<s.length; i++) { | ||
| 281 | var c = s.charAt(i); | ||
| 282 | |||
| 283 | if (l.indexOf(c) != -1) | ||
| 284 | o += '\\' + c; | ||
| 285 | else | ||
| 286 | o += c; | ||
| 287 | } | ||
| 288 | |||
| 289 | return o; | ||
| 290 | }, | ||
| 291 | |||
| 292 | _convertMiddots : function(div, search, class_name) { | ||
| 293 | var ed = this.editor, mdot = String.fromCharCode(183), bull = String.fromCharCode(8226); | ||
| 294 | var nodes, prevul, i, p, ul, li, np, cp, li; | ||
| 295 | |||
| 296 | nodes = div.getElementsByTagName("p"); | ||
| 297 | for (i=0; i<nodes.length; i++) { | ||
| 298 | p = nodes[i]; | ||
| 299 | |||
| 300 | // Is middot | ||
| 301 | if (p.innerHTML.indexOf(search) == 0) { | ||
| 302 | ul = ed.dom.create("ul"); | ||
| 303 | |||
| 304 | if (class_name) | ||
| 305 | ul.className = class_name; | ||
| 306 | |||
| 307 | // Add the first one | ||
| 308 | li = ed.dom.create("li"); | ||
| 309 | li.innerHTML = p.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--| ', "gi"), ''); | ||
| 310 | ul.appendChild(li); | ||
| 311 | |||
| 312 | // Add the rest | ||
| 313 | np = p.nextSibling; | ||
| 314 | while (np) { | ||
| 315 | // If the node is whitespace, then | ||
| 316 | // ignore it and continue on. | ||
| 317 | if (np.nodeType == 3 && new RegExp('^\\s$', 'm').test(np.nodeValue)) { | ||
| 318 | np = np.nextSibling; | ||
| 319 | continue; | ||
| 320 | } | ||
| 321 | |||
| 322 | if (search == mdot) { | ||
| 323 | if (np.nodeType == 1 && new RegExp('^o(\\s+| )').test(np.innerHTML)) { | ||
| 324 | // Second level of nesting | ||
| 325 | if (!prevul) { | ||
| 326 | prevul = ul; | ||
| 327 | ul = ed.dom.create("ul"); | ||
| 328 | prevul.appendChild(ul); | ||
| 329 | } | ||
| 330 | np.innerHTML = np.innerHTML.replace(/^o/, ''); | ||
| 331 | } else { | ||
| 332 | // Pop the stack if we're going back up to the first level | ||
| 333 | if (prevul) { | ||
| 334 | ul = prevul; | ||
| 335 | prevul = null; | ||
| 336 | } | ||
| 337 | // Not element or middot paragraph | ||
| 338 | if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0) | ||
| 339 | break; | ||
| 340 | } | ||
| 341 | } else { | ||
| 342 | // Not element or middot paragraph | ||
| 343 | if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0) | ||
| 344 | break; | ||
| 345 | } | ||
| 346 | |||
| 347 | cp = np.nextSibling; | ||
| 348 | li = ed.dom.create("li"); | ||
| 349 | li.innerHTML = np.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--| ', "gi"), ''); | ||
| 350 | np.parentNode.removeChild(np); | ||
| 351 | ul.appendChild(li); | ||
| 352 | np = cp; | ||
| 353 | } | ||
| 354 | |||
| 355 | p.parentNode.replaceChild(ul, p); | ||
| 356 | |||
| 357 | return true; | ||
| 358 | } | ||
| 359 | } | ||
| 360 | |||
| 361 | return false; | ||
| 362 | }, | ||
| 363 | |||
| 364 | _clipboardHTML : function() { | ||
| 365 | var div = document.getElementById('_TinyMCE_clipboardHTML'); | ||
| 366 | |||
| 367 | if (!div) { | ||
| 368 | var div = document.createElement('DIV'); | ||
| 369 | div.id = '_TinyMCE_clipboardHTML'; | ||
| 370 | |||
| 371 | with (div.style) { | ||
| 372 | visibility = 'hidden'; | ||
| 373 | overflow = 'hidden'; | ||
| 374 | position = 'absolute'; | ||
| 375 | width = 1; | ||
| 376 | height = 1; | ||
| 377 | } | ||
| 378 | |||
| 379 | document.body.appendChild(div); | ||
| 380 | } | ||
| 381 | |||
| 382 | div.innerHTML = ''; | ||
| 383 | var rng = document.body.createTextRange(); | ||
| 384 | rng.moveToElementText(div); | ||
| 385 | rng.execCommand('Paste'); | ||
| 386 | var html = div.innerHTML; | ||
| 387 | div.innerHTML = ''; | ||
| 388 | return html; | ||
| 389 | } | ||
| 390 | }); | ||
| 391 | |||
| 392 | // Register plugin | ||
| 393 | tinymce.PluginManager.add('paste', tinymce.plugins.PastePlugin); | ||
| 394 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js b/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js new file mode 100755 index 0000000..326bb16 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | function saveContent() { | ||
| 4 | if (document.forms[0].htmlSource.value == '') { | ||
| 5 | tinyMCEPopup.close(); | ||
| 6 | return false; | ||
| 7 | } | ||
| 8 | |||
| 9 | tinyMCEPopup.execCommand('mcePasteText', false, { | ||
| 10 | html : document.forms[0].htmlSource.value, | ||
| 11 | linebreaks : document.forms[0].linebreaks.checked | ||
| 12 | }); | ||
| 13 | |||
| 14 | tinyMCEPopup.close(); | ||
| 15 | } | ||
| 16 | |||
| 17 | function onLoadInit() { | ||
| 18 | tinyMCEPopup.resizeToInnerSize(); | ||
| 19 | |||
| 20 | // Remove Gecko spellchecking | ||
| 21 | if (tinymce.isGecko) | ||
| 22 | document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck"); | ||
| 23 | |||
| 24 | resizeInputs(); | ||
| 25 | } | ||
| 26 | |||
| 27 | var wHeight=0, wWidth=0, owHeight=0, owWidth=0; | ||
| 28 | |||
| 29 | function resizeInputs() { | ||
| 30 | if (!tinymce.isIE) { | ||
| 31 | wHeight = self.innerHeight-80; | ||
| 32 | wWidth = self.innerWidth-17; | ||
| 33 | } else { | ||
| 34 | wHeight = document.body.clientHeight-80; | ||
| 35 | wWidth = document.body.clientWidth-17; | ||
| 36 | } | ||
| 37 | |||
| 38 | document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px'; | ||
| 39 | document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px'; | ||
| 40 | } | ||
| 41 | |||
| 42 | tinyMCEPopup.onInit.add(onLoadInit); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js b/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js new file mode 100755 index 0000000..6701b99 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | function saveContent() { | ||
| 4 | var html = document.getElementById("frmData").contentWindow.document.body.innerHTML; | ||
| 5 | |||
| 6 | if (html == ''){ | ||
| 7 | tinyMCEPopup.close(); | ||
| 8 | return false; | ||
| 9 | } | ||
| 10 | |||
| 11 | tinyMCEPopup.execCommand('mcePasteWord', false, html); | ||
| 12 | tinyMCEPopup.close(); | ||
| 13 | } | ||
| 14 | |||
| 15 | function onLoadInit() { | ||
| 16 | tinyMCEPopup.resizeToInnerSize(); | ||
| 17 | |||
| 18 | // Fix for endless reloading in FF | ||
| 19 | window.setTimeout(createIFrame, 10); | ||
| 20 | } | ||
| 21 | |||
| 22 | function createIFrame() { | ||
| 23 | document.getElementById('iframecontainer').innerHTML = '<iframe id="frmData" name="frmData" class="sourceIframe" src="blank.htm" height="280" width="400" frameborder="0" style="background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>'; | ||
| 24 | } | ||
| 25 | |||
| 26 | var wHeight=0, wWidth=0, owHeight=0, owWidth=0; | ||
| 27 | |||
| 28 | function initIframe(doc) { | ||
| 29 | var dir = tinyMCEPopup.editor.settings.directionality; | ||
| 30 | |||
| 31 | doc.body.dir = dir; | ||
| 32 | |||
| 33 | // Remove Gecko spellchecking | ||
| 34 | if (tinymce.isGecko) | ||
| 35 | doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck"); | ||
| 36 | |||
| 37 | resizeInputs(); | ||
| 38 | } | ||
| 39 | |||
| 40 | function resizeInputs() { | ||
| 41 | if (!tinymce.isIE) { | ||
| 42 | wHeight = self.innerHeight - 80; | ||
| 43 | wWidth = self.innerWidth - 18; | ||
| 44 | } else { | ||
| 45 | wHeight = document.body.clientHeight - 80; | ||
| 46 | wWidth = document.body.clientWidth - 18; | ||
| 47 | } | ||
| 48 | |||
| 49 | var elm = document.getElementById('frmData'); | ||
| 50 | if (elm) { | ||
| 51 | elm.style.height = Math.abs(wHeight) + 'px'; | ||
| 52 | elm.style.width = Math.abs(wWidth) + 'px'; | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | tinyMCEPopup.onInit.add(onLoadInit); | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js new file mode 100755 index 0000000..eeac778 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | tinyMCE.addI18n('en.paste_dlg',{ | ||
| 2 | text_title:"Use CTRL+V on your keyboard to paste the text into the window.", | ||
| 3 | text_linebreaks:"Keep linebreaks", | ||
| 4 | word_title:"Use CTRL+V on your keyboard to paste the text into the window." | ||
| 5 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/pastetext.htm b/public/javascripts/tiny_mce/plugins/paste/pastetext.htm new file mode 100755 index 0000000..2f2b341 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/pastetext.htm | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <title>{#paste.paste_text_desc}</title> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/pastetext.js"></script> | ||
| 7 | <base target="_self" /> | ||
| 8 | </head> | ||
| 9 | <body onresize="resizeInputs();" style="display:none; overflow:hidden;"> | ||
| 10 | <form name="source" onsubmit="saveContent();return false;" action="#"> | ||
| 11 | <div style="float: left" class="title">{#paste.paste_text_desc}</div> | ||
| 12 | |||
| 13 | <div style="float: right"> | ||
| 14 | <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label> | ||
| 15 | </div> | ||
| 16 | |||
| 17 | <br style="clear: both" /> | ||
| 18 | |||
| 19 | <div>{#paste_dlg.text_title}</div> | ||
| 20 | |||
| 21 | <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea> | ||
| 22 | |||
| 23 | <div class="mceActionPanel"> | ||
| 24 | <div style="float: left"> | ||
| 25 | <input type="submit" name="insert" value="{#insert}" id="insert" /> | ||
| 26 | </div> | ||
| 27 | |||
| 28 | <div style="float: right"> | ||
| 29 | <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" /> | ||
| 30 | </div> | ||
| 31 | </div> | ||
| 32 | </form> | ||
| 33 | </body> | ||
| 34 | </html> \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/pasteword.htm b/public/javascripts/tiny_mce/plugins/paste/pasteword.htm new file mode 100755 index 0000000..9e5ab1b --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/paste/pasteword.htm | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
| 4 | <title>{#paste.paste_word_desc}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/pasteword.js"></script> | ||
| 7 | <link href="css/pasteword.css" rel="stylesheet" type="text/css" /> | ||
| 8 | <base target="_self" /> | ||
| 9 | </head> | ||
| 10 | <body onresize="resizeInputs();" style="display:none; overflow:hidden;"> | ||
| 11 | <form name="source" onsubmit="saveContent();" action="#"> | ||
| 12 | <div class="title">{#paste.paste_word_desc}</div> | ||
| 13 | |||
| 14 | <div>{#paste_dlg.word_title}</div> | ||
| 15 | |||
| 16 | <div id="iframecontainer"></div> | ||
| 17 | |||
| 18 | <div class="mceActionPanel"> | ||
| 19 | <div style="float: left"> | ||
| 20 | <input type="button" id="insert" name="insert" value="{#insert}" onclick="saveContent();" /> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div style="float: right"> | ||
| 24 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 25 | </div> | ||
| 26 | </div> | ||
| 27 | </form> | ||
| 28 | </body> | ||
| 29 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js b/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js new file mode 100755 index 0000000..deb4bce --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.Preview',{init:function(ed,url){var t=this,css=tinymce.explode(ed.settings.content_css);t.editor=ed;tinymce.each(css,function(u,k){css[k]=ed.documentBaseURI.toAbsolute(u);});ed.addCommand('mcePreview',function(){ed.windowManager.open({file:ed.getParam("plugin_preview_pageurl",url+"/preview.html"),width:parseInt(ed.getParam("plugin_preview_width","550")),height:parseInt(ed.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:css.join(','),inline:ed.getParam("plugin_preview_inline",1)},{base:ed.documentBaseURI.getURI()});});ed.addButton('preview',{title:'preview.preview_desc',cmd:'mcePreview'});},getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('preview',tinymce.plugins.Preview);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js new file mode 100755 index 0000000..b2d27f7 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 895 2008-07-10 14:34:23Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Preview', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this, css = tinymce.explode(ed.settings.content_css); | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Force absolute CSS urls | ||
| 16 | tinymce.each(css, function(u, k) { | ||
| 17 | css[k] = ed.documentBaseURI.toAbsolute(u); | ||
| 18 | }); | ||
| 19 | |||
| 20 | ed.addCommand('mcePreview', function() { | ||
| 21 | ed.windowManager.open({ | ||
| 22 | file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), | ||
| 23 | width : parseInt(ed.getParam("plugin_preview_width", "550")), | ||
| 24 | height : parseInt(ed.getParam("plugin_preview_height", "600")), | ||
| 25 | resizable : "yes", | ||
| 26 | scrollbars : "yes", | ||
| 27 | popup_css : css.join(','), | ||
| 28 | inline : ed.getParam("plugin_preview_inline", 1) | ||
| 29 | }, { | ||
| 30 | base : ed.documentBaseURI.getURI() | ||
| 31 | }); | ||
| 32 | }); | ||
| 33 | |||
| 34 | ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); | ||
| 35 | }, | ||
| 36 | |||
| 37 | getInfo : function() { | ||
| 38 | return { | ||
| 39 | longname : 'Preview', | ||
| 40 | author : 'Moxiecode Systems AB', | ||
| 41 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 42 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', | ||
| 43 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 44 | }; | ||
| 45 | } | ||
| 46 | }); | ||
| 47 | |||
| 48 | // Register plugin | ||
| 49 | tinymce.PluginManager.add('preview', tinymce.plugins.Preview); | ||
| 50 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/preview/example.html b/public/javascripts/tiny_mce/plugins/preview/example.html new file mode 100755 index 0000000..b2c3d90 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/preview/example.html | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <script language="javascript" src="../../tiny_mce_popup.js"></script> | ||
| 4 | <script type="text/javascript" src="jscripts/embed.js"></script> | ||
| 5 | <script type="text/javascript"> | ||
| 6 | tinyMCEPopup.onInit.add(function(ed) { | ||
| 7 | var dom = tinyMCEPopup.dom; | ||
| 8 | |||
| 9 | // Load editor content_css | ||
| 10 | tinymce.each(ed.settings.content_css.split(','), function(u) { | ||
| 11 | dom.loadCSS(ed.documentBaseURI.toAbsolute(u)); | ||
| 12 | }); | ||
| 13 | |||
| 14 | // Place contents inside div container | ||
| 15 | dom.setHTML('content', ed.getContent()); | ||
| 16 | }); | ||
| 17 | </script> | ||
| 18 | <title>Example of a custom preview page</title> | ||
| 19 | </head> | ||
| 20 | <body> | ||
| 21 | |||
| 22 | Editor contents: <br /> | ||
| 23 | <div id="content"> | ||
| 24 | <!-- Gets filled with editor contents --> | ||
| 25 | </div> | ||
| 26 | |||
| 27 | </body> | ||
| 28 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js b/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js new file mode 100755 index 0000000..f8dc810 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | /** | ||
| 2 | * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. | ||
| 3 | */ | ||
| 4 | |||
| 5 | function writeFlash(p) { | ||
| 6 | writeEmbed( | ||
| 7 | 'D27CDB6E-AE6D-11cf-96B8-444553540000', | ||
| 8 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', | ||
| 9 | 'application/x-shockwave-flash', | ||
| 10 | p | ||
| 11 | ); | ||
| 12 | } | ||
| 13 | |||
| 14 | function writeShockWave(p) { | ||
| 15 | writeEmbed( | ||
| 16 | '166B1BCA-3F9C-11CF-8075-444553540000', | ||
| 17 | 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', | ||
| 18 | 'application/x-director', | ||
| 19 | p | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | function writeQuickTime(p) { | ||
| 24 | writeEmbed( | ||
| 25 | '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', | ||
| 26 | 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', | ||
| 27 | 'video/quicktime', | ||
| 28 | p | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | |||
| 32 | function writeRealMedia(p) { | ||
| 33 | writeEmbed( | ||
| 34 | 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', | ||
| 35 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', | ||
| 36 | 'audio/x-pn-realaudio-plugin', | ||
| 37 | p | ||
| 38 | ); | ||
| 39 | } | ||
| 40 | |||
| 41 | function writeWindowsMedia(p) { | ||
| 42 | p.url = p.src; | ||
| 43 | writeEmbed( | ||
| 44 | '6BF52A52-394A-11D3-B153-00C04F79FAA6', | ||
| 45 | 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', | ||
| 46 | 'application/x-mplayer2', | ||
| 47 | p | ||
| 48 | ); | ||
| 49 | } | ||
| 50 | |||
| 51 | function writeEmbed(cls, cb, mt, p) { | ||
| 52 | var h = '', n; | ||
| 53 | |||
| 54 | h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"'; | ||
| 55 | h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : ''; | ||
| 56 | h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : ''; | ||
| 57 | h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : ''; | ||
| 58 | h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : ''; | ||
| 59 | h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : ''; | ||
| 60 | h += '>'; | ||
| 61 | |||
| 62 | for (n in p) | ||
| 63 | h += '<param name="' + n + '" value="' + p[n] + '">'; | ||
| 64 | |||
| 65 | h += '<embed type="' + mt + '"'; | ||
| 66 | |||
| 67 | for (n in p) | ||
| 68 | h += n + '="' + p[n] + '" '; | ||
| 69 | |||
| 70 | h += '></embed></object>'; | ||
| 71 | |||
| 72 | document.write(h); | ||
| 73 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/preview/preview.html b/public/javascripts/tiny_mce/plugins/preview/preview.html new file mode 100755 index 0000000..7960f78 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/preview/preview.html | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <script language="javascript" src="../../tiny_mce_popup.js"></script> | ||
| 4 | <script type="text/javascript" src="jscripts/embed.js"></script> | ||
| 5 | <script type="text/javascript"> | ||
| 6 | tinyMCEPopup.onInit.add(function(ed) { | ||
| 7 | var dom = tinyMCEPopup.dom; | ||
| 8 | |||
| 9 | dom.setHTML('content', ed.getContent()); | ||
| 10 | }); | ||
| 11 | |||
| 12 | document.write('<base href="' + tinyMCEPopup.getWindowArg("base") + '">'); | ||
| 13 | </script> | ||
| 14 | <title>{#preview.preview_desc}</title> | ||
| 15 | </head> | ||
| 16 | <body id="content"> | ||
| 17 | <!-- Gets filled with editor contents --> | ||
| 18 | </body> | ||
| 19 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/print/editor_plugin.js b/public/javascripts/tiny_mce/plugins/print/editor_plugin.js new file mode 100755 index 0000000..7d09a87 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/print/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.Print',{init:function(ed,url){ed.addCommand('mcePrint',function(){ed.getWin().print();});ed.addButton('print',{title:'print.print_desc',cmd:'mcePrint'});},getInfo:function(){return{longname:'Print',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('print',tinymce.plugins.Print);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js new file mode 100755 index 0000000..51fe156 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Print', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | ed.addCommand('mcePrint', function() { | ||
| 12 | ed.getWin().print(); | ||
| 13 | }); | ||
| 14 | |||
| 15 | ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); | ||
| 16 | }, | ||
| 17 | |||
| 18 | getInfo : function() { | ||
| 19 | return { | ||
| 20 | longname : 'Print', | ||
| 21 | author : 'Moxiecode Systems AB', | ||
| 22 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 23 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', | ||
| 24 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 25 | }; | ||
| 26 | } | ||
| 27 | }); | ||
| 28 | |||
| 29 | // Register plugin | ||
| 30 | tinymce.PluginManager.add('print', tinymce.plugins.Print); | ||
| 31 | })(); | ||
diff --git a/public/javascripts/tiny_mce/plugins/safari/blank.htm b/public/javascripts/tiny_mce/plugins/safari/blank.htm new file mode 100755 index 0000000..266808c --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/safari/blank.htm | |||
| @@ -0,0 +1 @@ | |||
| <!-- WebKit --> \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/safari/editor_plugin.js b/public/javascripts/tiny_mce/plugins/safari/editor_plugin.js new file mode 100755 index 0000000..4daac19 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/safari/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;function isEmpty(d,e,f){var w,n;w=d.createTreeWalker(e,NodeFilter.SHOW_ALL,null,false);while(n=w.nextNode()){if(f){if(!f(n))return false;}if(n.nodeType==3&&n.nodeValue&&/[^\s\u00a0]+/.test(n.nodeValue))return false;if(n.nodeType==1&&/^(HR|IMG|TABLE)$/.test(n.nodeName))return false;}return true;};tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.addCommand('CreateLink',function(u,v){var n=ed.selection.getNode(),dom=ed.dom,a;if(n&&(/^(left|right)$/i.test(dom.getStyle(n,'float',1))||/^(left|right)$/i.test(dom.getAttrib(n,'align')))){a=dom.create('a',{href:v},n.cloneNode());n.parentNode.replaceChild(a,n);ed.selection.select(a);}else ed.getDoc().execCommand("CreateLink",false,v);});ed.onPaste.add(function(ed,e){function removeStyles(e){e=e.target;if(e.nodeType==1){e.style.cssText='';each(ed.dom.select('*',e),function(e){e.style.cssText='';});}};Event.add(ed.getDoc(),'DOMNodeInserted',removeStyles);window.setTimeout(function(){Event.remove(ed.getDoc(),'DOMNodeInserted',removeStyles);},0);});ed.onKeyUp.add(function(ed,e){var h,b,r,n,s;if(e.keyCode==46||e.keyCode==8){b=ed.getBody();h=b.innerHTML;s=ed.selection;if(b.childNodes.length==1&&!/<(img|hr)/.test(h)&&tinymce.trim(h.replace(/<[^>]+>/g,'')).length==0){ed.setContent('<p><br mce_bogus="1" /></p>',{format:'raw'});n=b.firstChild;r=s.getRng();r.setStart(n,0);r.setEnd(n,0);s.setRng(r);}}});ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,ed.dom.processHTML(v)+'<span id="_mce_tmp">XX</span>');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){var se,li,lic,r1,r2,n,sel,doc,be,af,pa;if(e.keyCode==13){sel=ed.selection;se=sel.getNode();if(e.shiftKey||ed.settings.force_br_newlines&&se.nodeName!='LI'){t._insertBR(ed);Event.cancel(e);}if(li=dom.getParent(se,'LI')){lic=dom.getParent(li,'OL,UL');doc=ed.getDoc();pa=dom.create('p');dom.add(pa,'br',{mce_bogus:"1"});if(isEmpty(doc,li)){if(n=dom.getParent(lic.parentNode,'LI,OL,UL'))return;n=dom.getParent(lic,'p,h1,h2,h3,h4,h5,h6,div')||lic;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(li);r2=doc.createRange();r2.setStartAfter(li);r2.setEndAfter(n);be=r1.cloneContents();af=r2.cloneContents();if(!isEmpty(doc,af))dom.insertAfter(af,n);dom.insertAfter(pa,n);if(!isEmpty(doc,be))dom.insertAfter(be,n);dom.remove(n);n=pa.firstChild;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(n);sel.setRng(r1);return Event.cancel(e);}}}});ed.onExecCommand.add(function(ed,cmd){var sel,dom,bl,bm;if(cmd=='InsertUnorderedList'||cmd=='InsertOrderedList'){sel=ed.selection;dom=ed.dom;if(bl=dom.getParent(sel.getNode(),function(n){return/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})){bm=sel.getBookmark();dom.remove(bl,1);sel.moveToBookmark(bm);}}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onInit.add(function(){t._fixWebKitSpans();if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,'</$1>');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},getInfo:function(){return{longname:'Safari compatibility',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js new file mode 100755 index 0000000..642d659 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js | |||
| @@ -0,0 +1,514 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray, isOldWebKit = tinymce.isOldWebKit; | ||
| 10 | |||
| 11 | function isEmpty(d, e, f) { | ||
| 12 | var w, n; | ||
| 13 | |||
| 14 | w = d.createTreeWalker(e, NodeFilter.SHOW_ALL, null, false); | ||
| 15 | while (n = w.nextNode()) { | ||
| 16 | // Filter func | ||
| 17 | if (f) { | ||
| 18 | if (!f(n)) | ||
| 19 | return false; | ||
| 20 | } | ||
| 21 | |||
| 22 | // Non whitespace text node | ||
| 23 | if (n.nodeType == 3 && n.nodeValue && /[^\s\u00a0]+/.test(n.nodeValue)) | ||
| 24 | return false; | ||
| 25 | |||
| 26 | // Is non text element byt still content | ||
| 27 | if (n.nodeType == 1 && /^(HR|IMG|TABLE)$/.test(n.nodeName)) | ||
| 28 | return false; | ||
| 29 | } | ||
| 30 | |||
| 31 | return true; | ||
| 32 | }; | ||
| 33 | |||
| 34 | tinymce.create('tinymce.plugins.Safari', { | ||
| 35 | init : function(ed) { | ||
| 36 | var t = this, dom; | ||
| 37 | |||
| 38 | // Ignore on non webkit | ||
| 39 | if (!tinymce.isWebKit) | ||
| 40 | return; | ||
| 41 | |||
| 42 | t.editor = ed; | ||
| 43 | t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large']; | ||
| 44 | t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large']; | ||
| 45 | |||
| 46 | // Safari CreateLink command will not work correctly on images that is aligned | ||
| 47 | ed.addCommand('CreateLink', function(u, v) { | ||
| 48 | var n = ed.selection.getNode(), dom = ed.dom, a; | ||
| 49 | |||
| 50 | if (n && (/^(left|right)$/i.test(dom.getStyle(n, 'float', 1)) || /^(left|right)$/i.test(dom.getAttrib(n, 'align')))) { | ||
| 51 | a = dom.create('a', {href : v}, n.cloneNode()); | ||
| 52 | n.parentNode.replaceChild(a, n); | ||
| 53 | ed.selection.select(a); | ||
| 54 | } else | ||
| 55 | ed.getDoc().execCommand("CreateLink", false, v); | ||
| 56 | }); | ||
| 57 | |||
| 58 | ed.onPaste.add(function(ed, e) { | ||
| 59 | function removeStyles(e) { | ||
| 60 | e = e.target; | ||
| 61 | |||
| 62 | if (e.nodeType == 1) { | ||
| 63 | e.style.cssText = ''; | ||
| 64 | |||
| 65 | each(ed.dom.select('*', e), function(e) { | ||
| 66 | e.style.cssText = ''; | ||
| 67 | }); | ||
| 68 | } | ||
| 69 | }; | ||
| 70 | |||
| 71 | Event.add(ed.getDoc(), 'DOMNodeInserted', removeStyles); | ||
| 72 | |||
| 73 | window.setTimeout(function() { | ||
| 74 | Event.remove(ed.getDoc(), 'DOMNodeInserted', removeStyles); | ||
| 75 | }, 0); | ||
| 76 | }); | ||
| 77 | |||
| 78 | ed.onKeyUp.add(function(ed, e) { | ||
| 79 | var h, b, r, n, s; | ||
| 80 | |||
| 81 | // If backspace or delete key | ||
| 82 | if (e.keyCode == 46 || e.keyCode == 8) { | ||
| 83 | b = ed.getBody(); | ||
| 84 | h = b.innerHTML; | ||
| 85 | s = ed.selection; | ||
| 86 | |||
| 87 | // If there is no text content or images or hr elements then remove everything | ||
| 88 | if (b.childNodes.length == 1 && !/<(img|hr)/.test(h) && tinymce.trim(h.replace(/<[^>]+>/g, '')).length == 0) { | ||
| 89 | // Inject paragrah and bogus br | ||
| 90 | ed.setContent('<p><br mce_bogus="1" /></p>', {format : 'raw'}); | ||
| 91 | |||
| 92 | // Move caret before bogus br | ||
| 93 | n = b.firstChild; | ||
| 94 | r = s.getRng(); | ||
| 95 | r.setStart(n, 0); | ||
| 96 | r.setEnd(n, 0); | ||
| 97 | s.setRng(r); | ||
| 98 | } | ||
| 99 | } | ||
| 100 | }); | ||
| 101 | |||
| 102 | // Workaround for FormatBlock bug, http://bugs.webkit.org/show_bug.cgi?id=16004 | ||
| 103 | ed.addCommand('FormatBlock', function(u, v) { | ||
| 104 | var dom = ed.dom, e = dom.getParent(ed.selection.getNode(), dom.isBlock); | ||
| 105 | |||
| 106 | if (e) | ||
| 107 | dom.replace(dom.create(v), e, 1); | ||
| 108 | else | ||
| 109 | ed.getDoc().execCommand("FormatBlock", false, v); | ||
| 110 | }); | ||
| 111 | |||
| 112 | // Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382 | ||
| 113 | ed.addCommand('mceInsertContent', function(u, v) { | ||
| 114 | ed.getDoc().execCommand("InsertText", false, 'mce_marker'); | ||
| 115 | ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, ed.dom.processHTML(v) + '<span id="_mce_tmp">XX</span>'); | ||
| 116 | ed.selection.select(ed.dom.get('_mce_tmp')); | ||
| 117 | ed.getDoc().execCommand("Delete", false, ' '); | ||
| 118 | }); | ||
| 119 | |||
| 120 | ed.onKeyPress.add(function(ed, e) { | ||
| 121 | var se, li, lic, r1, r2, n, sel, doc, be, af, pa; | ||
| 122 | |||
| 123 | if (e.keyCode == 13) { | ||
| 124 | sel = ed.selection; | ||
| 125 | se = sel.getNode(); | ||
| 126 | |||
| 127 | // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973 | ||
| 128 | if (e.shiftKey || ed.settings.force_br_newlines && se.nodeName != 'LI') { | ||
| 129 | t._insertBR(ed); | ||
| 130 | Event.cancel(e); | ||
| 131 | } | ||
| 132 | |||
| 133 | // Workaround for DIV elements produced by Safari | ||
| 134 | if (li = dom.getParent(se, 'LI')) { | ||
| 135 | lic = dom.getParent(li, 'OL,UL'); | ||
| 136 | doc = ed.getDoc(); | ||
| 137 | |||
| 138 | pa = dom.create('p'); | ||
| 139 | dom.add(pa, 'br', {mce_bogus : "1"}); | ||
| 140 | |||
| 141 | if (isEmpty(doc, li)) { | ||
| 142 | // If list in list then use browser default behavior | ||
| 143 | if (n = dom.getParent(lic.parentNode, 'LI,OL,UL')) | ||
| 144 | return; | ||
| 145 | |||
| 146 | n = dom.getParent(lic, 'p,h1,h2,h3,h4,h5,h6,div') || lic; | ||
| 147 | |||
| 148 | // Create range from the start of block element to the list item | ||
| 149 | r1 = doc.createRange(); | ||
| 150 | r1.setStartBefore(n); | ||
| 151 | r1.setEndBefore(li); | ||
| 152 | |||
| 153 | // Create range after the list to the end of block element | ||
| 154 | r2 = doc.createRange(); | ||
| 155 | r2.setStartAfter(li); | ||
| 156 | r2.setEndAfter(n); | ||
| 157 | |||
| 158 | be = r1.cloneContents(); | ||
| 159 | af = r2.cloneContents(); | ||
| 160 | |||
| 161 | if (!isEmpty(doc, af)) | ||
| 162 | dom.insertAfter(af, n); | ||
| 163 | |||
| 164 | dom.insertAfter(pa, n); | ||
| 165 | |||
| 166 | if (!isEmpty(doc, be)) | ||
| 167 | dom.insertAfter(be, n); | ||
| 168 | |||
| 169 | dom.remove(n); | ||
| 170 | |||
| 171 | n = pa.firstChild; | ||
| 172 | r1 = doc.createRange(); | ||
| 173 | r1.setStartBefore(n); | ||
| 174 | r1.setEndBefore(n); | ||
| 175 | sel.setRng(r1); | ||
| 176 | |||
| 177 | return Event.cancel(e); | ||
| 178 | } | ||
| 179 | } | ||
| 180 | } | ||
| 181 | }); | ||
| 182 | |||
| 183 | // Safari doesn't place lists outside block elements | ||
| 184 | ed.onExecCommand.add(function(ed, cmd) { | ||
| 185 | var sel, dom, bl, bm; | ||
| 186 | |||
| 187 | if (cmd == 'InsertUnorderedList' || cmd == 'InsertOrderedList') { | ||
| 188 | sel = ed.selection; | ||
| 189 | dom = ed.dom; | ||
| 190 | |||
| 191 | if (bl = dom.getParent(sel.getNode(), function(n) {return /^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})) { | ||
| 192 | bm = sel.getBookmark(); | ||
| 193 | dom.remove(bl, 1); | ||
| 194 | sel.moveToBookmark(bm); | ||
| 195 | } | ||
| 196 | } | ||
| 197 | }); | ||
| 198 | |||
| 199 | // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 | ||
| 200 | ed.onClick.add(function(ed, e) { | ||
| 201 | e = e.target; | ||
| 202 | |||
| 203 | if (e.nodeName == 'IMG') { | ||
| 204 | t.selElm = e; | ||
| 205 | ed.selection.select(e); | ||
| 206 | } else | ||
| 207 | t.selElm = null; | ||
| 208 | }); | ||
| 209 | |||
| 210 | ed.onInit.add(function() { | ||
| 211 | t._fixWebKitSpans(); | ||
| 212 | |||
| 213 | if (isOldWebKit) | ||
| 214 | t._patchSafari2x(ed); | ||
| 215 | }); | ||
| 216 | |||
| 217 | ed.onSetContent.add(function() { | ||
| 218 | dom = ed.dom; | ||
| 219 | |||
| 220 | // Convert strong,b,em,u,strike to spans | ||
| 221 | each(['strong','b','em','u','strike','sub','sup','a'], function(v) { | ||
| 222 | each(grep(dom.select(v)).reverse(), function(n) { | ||
| 223 | var nn = n.nodeName.toLowerCase(), st; | ||
| 224 | |||
| 225 | // Convert anchors into images | ||
| 226 | if (nn == 'a') { | ||
| 227 | if (n.name) | ||
| 228 | dom.replace(dom.create('img', {mce_name : 'a', name : n.name, 'class' : 'mceItemAnchor'}), n); | ||
| 229 | |||
| 230 | return; | ||
| 231 | } | ||
| 232 | |||
| 233 | switch (nn) { | ||
| 234 | case 'b': | ||
| 235 | case 'strong': | ||
| 236 | if (nn == 'b') | ||
| 237 | nn = 'strong'; | ||
| 238 | |||
| 239 | st = 'font-weight: bold;'; | ||
| 240 | break; | ||
| 241 | |||
| 242 | case 'em': | ||
| 243 | st = 'font-style: italic;'; | ||
| 244 | break; | ||
| 245 | |||
| 246 | case 'u': | ||
| 247 | st = 'text-decoration: underline;'; | ||
| 248 | break; | ||
| 249 | |||
| 250 | case 'sub': | ||
| 251 | st = 'vertical-align: sub;'; | ||
| 252 | break; | ||
| 253 | |||
| 254 | case 'sup': | ||
| 255 | st = 'vertical-align: super;'; | ||
| 256 | break; | ||
| 257 | |||
| 258 | case 'strike': | ||
| 259 | st = 'text-decoration: line-through;'; | ||
| 260 | break; | ||
| 261 | } | ||
| 262 | |||
| 263 | dom.replace(dom.create('span', {mce_name : nn, style : st, 'class' : 'Apple-style-span'}), n, 1); | ||
| 264 | }); | ||
| 265 | }); | ||
| 266 | }); | ||
| 267 | |||
| 268 | ed.onPreProcess.add(function(ed, o) { | ||
| 269 | dom = ed.dom; | ||
| 270 | |||
| 271 | each(grep(o.node.getElementsByTagName('span')).reverse(), function(n) { | ||
| 272 | var v, bg; | ||
| 273 | |||
| 274 | if (o.get) { | ||
| 275 | if (dom.hasClass(n, 'Apple-style-span')) { | ||
| 276 | bg = n.style.backgroundColor; | ||
| 277 | |||
| 278 | switch (dom.getAttrib(n, 'mce_name')) { | ||
| 279 | case 'font': | ||
| 280 | if (!ed.settings.convert_fonts_to_spans) | ||
| 281 | dom.setAttrib(n, 'style', ''); | ||
| 282 | break; | ||
| 283 | |||
| 284 | case 'strong': | ||
| 285 | case 'em': | ||
| 286 | case 'sub': | ||
| 287 | case 'sup': | ||
| 288 | dom.setAttrib(n, 'style', ''); | ||
| 289 | break; | ||
| 290 | |||
| 291 | case 'strike': | ||
| 292 | case 'u': | ||
| 293 | if (!ed.settings.inline_styles) | ||
| 294 | dom.setAttrib(n, 'style', ''); | ||
| 295 | else | ||
| 296 | dom.setAttrib(n, 'mce_name', ''); | ||
| 297 | |||
| 298 | break; | ||
| 299 | |||
| 300 | default: | ||
| 301 | if (!ed.settings.inline_styles) | ||
| 302 | dom.setAttrib(n, 'style', ''); | ||
| 303 | } | ||
| 304 | |||
| 305 | |||
| 306 | if (bg) | ||
| 307 | n.style.backgroundColor = bg; | ||
| 308 | } | ||
| 309 | } | ||
| 310 | |||
| 311 | if (dom.hasClass(n, 'mceItemRemoved')) | ||
| 312 | dom.remove(n, 1); | ||
| 313 | }); | ||
| 314 | }); | ||
| 315 | |||
| 316 | ed.onPostProcess.add(function(ed, o) { | ||
| 317 | // Safari adds BR at end of all block elements | ||
| 318 | o.content = o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g, '</$1>'); | ||
| 319 | |||
| 320 | // Safari adds id="undefined" to HR elements | ||
| 321 | o.content = o.content.replace(/ id=\"undefined\"/g, ''); | ||
| 322 | }); | ||
| 323 | }, | ||
| 324 | |||
| 325 | getInfo : function() { | ||
| 326 | return { | ||
| 327 | longname : 'Safari compatibility', | ||
| 328 | author : 'Moxiecode Systems AB', | ||
| 329 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 330 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari', | ||
| 331 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 332 | }; | ||
| 333 | }, | ||
| 334 | |||
| 335 | // Internal methods | ||
| 336 | |||
| 337 | _fixWebKitSpans : function() { | ||
| 338 | var t = this, ed = t.editor; | ||
| 339 | |||
| 340 | if (!isOldWebKit) { | ||
| 341 | // Use mutator events on new WebKit | ||
| 342 | Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) { | ||
| 343 | e = e.target; | ||
| 344 | |||
| 345 | if (e && e.nodeType == 1) | ||
| 346 | t._fixAppleSpan(e); | ||
| 347 | }); | ||
| 348 | } else { | ||
| 349 | // Do post command processing in old WebKit since the browser crashes on Mutator events :( | ||
| 350 | ed.onExecCommand.add(function() { | ||
| 351 | each(ed.dom.select('span'), function(n) { | ||
| 352 | t._fixAppleSpan(n); | ||
| 353 | }); | ||
| 354 | |||
| 355 | ed.nodeChanged(); | ||
| 356 | }); | ||
| 357 | } | ||
| 358 | }, | ||
| 359 | |||
| 360 | _fixAppleSpan : function(e) { | ||
| 361 | var ed = this.editor, dom = ed.dom, fz = this.webKitFontSizes, fzn = this.namedFontSizes, s = ed.settings, st, p; | ||
| 362 | |||
| 363 | if (dom.getAttrib(e, 'mce_fixed')) | ||
| 364 | return; | ||
| 365 | |||
| 366 | // Handle Apple style spans | ||
| 367 | if (e.nodeName == 'SPAN' && e.className == 'Apple-style-span') { | ||
| 368 | st = e.style; | ||
| 369 | |||
| 370 | if (!s.convert_fonts_to_spans) { | ||
| 371 | if (st.fontSize) { | ||
| 372 | dom.setAttrib(e, 'mce_name', 'font'); | ||
| 373 | dom.setAttrib(e, 'size', inArray(fz, st.fontSize) + 1); | ||
| 374 | } | ||
| 375 | |||
| 376 | if (st.fontFamily) { | ||
| 377 | dom.setAttrib(e, 'mce_name', 'font'); | ||
| 378 | dom.setAttrib(e, 'face', st.fontFamily); | ||
| 379 | } | ||
| 380 | |||
| 381 | if (st.color) { | ||
| 382 | dom.setAttrib(e, 'mce_name', 'font'); | ||
| 383 | dom.setAttrib(e, 'color', dom.toHex(st.color)); | ||
| 384 | } | ||
| 385 | |||
| 386 | if (st.backgroundColor) { | ||
| 387 | dom.setAttrib(e, 'mce_name', 'font'); | ||
| 388 | dom.setStyle(e, 'background-color', st.backgroundColor); | ||
| 389 | } | ||
| 390 | } else { | ||
| 391 | if (st.fontSize) | ||
| 392 | dom.setStyle(e, 'fontSize', fzn[inArray(fz, st.fontSize)]); | ||
| 393 | } | ||
| 394 | |||
| 395 | if (st.fontWeight == 'bold') | ||
| 396 | dom.setAttrib(e, 'mce_name', 'strong'); | ||
| 397 | |||
| 398 | if (st.fontStyle == 'italic') | ||
| 399 | dom.setAttrib(e, 'mce_name', 'em'); | ||
| 400 | |||
| 401 | if (st.textDecoration == 'underline') | ||
| 402 | dom.setAttrib(e, 'mce_name', 'u'); | ||
| 403 | |||
| 404 | if (st.textDecoration == 'line-through') | ||
| 405 | dom.setAttrib(e, 'mce_name', 'strike'); | ||
| 406 | |||
| 407 | if (st.verticalAlign == 'super') | ||
| 408 | dom.setAttrib(e, 'mce_name', 'sup'); | ||
| 409 | |||
| 410 | if (st.verticalAlign == 'sub') | ||
| 411 | dom.setAttrib(e, 'mce_name', 'sub'); | ||
| 412 | |||
| 413 | dom.setAttrib(e, 'mce_fixed', '1'); | ||
| 414 | } | ||
| 415 | }, | ||
| 416 | |||
| 417 | _patchSafari2x : function(ed) { | ||
| 418 | var t = this, setContent, getNode, dom = ed.dom, lr; | ||
| 419 | |||
| 420 | // Inline dialogs | ||
| 421 | if (ed.windowManager.onBeforeOpen) { | ||
| 422 | ed.windowManager.onBeforeOpen.add(function() { | ||
| 423 | r = ed.selection.getRng(); | ||
| 424 | }); | ||
| 425 | } | ||
| 426 | |||
| 427 | // Fake select on 2.x | ||
| 428 | ed.selection.select = function(n) { | ||
| 429 | this.getSel().setBaseAndExtent(n, 0, n, 1); | ||
| 430 | }; | ||
| 431 | |||
| 432 | getNode = ed.selection.getNode; | ||
| 433 | ed.selection.getNode = function() { | ||
| 434 | return t.selElm || getNode.call(this); | ||
| 435 | }; | ||
| 436 | |||
| 437 | // Fake range on Safari 2.x | ||
| 438 | ed.selection.getRng = function() { | ||
| 439 | var t = this, s = t.getSel(), d = ed.getDoc(), r, rb, ra, di; | ||
| 440 | |||
| 441 | // Fake range on Safari 2.x | ||
| 442 | if (s.anchorNode) { | ||
| 443 | r = d.createRange(); | ||
| 444 | |||
| 445 | try { | ||
| 446 | // Setup before range | ||
| 447 | rb = d.createRange(); | ||
| 448 | rb.setStart(s.anchorNode, s.anchorOffset); | ||
| 449 | rb.collapse(1); | ||
| 450 | |||
| 451 | // Setup after range | ||
| 452 | ra = d.createRange(); | ||
| 453 | ra.setStart(s.focusNode, s.focusOffset); | ||
| 454 | ra.collapse(1); | ||
| 455 | |||
| 456 | // Setup start/end points by comparing locations | ||
| 457 | di = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; | ||
| 458 | r.setStart(di ? s.anchorNode : s.focusNode, di ? s.anchorOffset : s.focusOffset); | ||
| 459 | r.setEnd(di ? s.focusNode : s.anchorNode, di ? s.focusOffset : s.anchorOffset); | ||
| 460 | |||
| 461 | lr = r; | ||
| 462 | } catch (ex) { | ||
| 463 | // Sometimes fails, at least we tried to do it by the book. I hope Safari 2.x will go disappear soooon!!! | ||
| 464 | } | ||
| 465 | } | ||
| 466 | |||
| 467 | return r || lr; | ||
| 468 | }; | ||
| 469 | |||
| 470 | // Fix setContent so it works | ||
| 471 | setContent = ed.selection.setContent; | ||
| 472 | ed.selection.setContent = function(h, s) { | ||
| 473 | var r = this.getRng(), b; | ||
| 474 | |||
| 475 | try { | ||
| 476 | setContent.call(this, h, s); | ||
| 477 | } catch (ex) { | ||
| 478 | // Workaround for Safari 2.x | ||
| 479 | b = dom.create('body'); | ||
| 480 | b.innerHTML = h; | ||
| 481 | |||
| 482 | each(b.childNodes, function(n) { | ||
| 483 | r.insertNode(n.cloneNode(true)); | ||
| 484 | }); | ||
| 485 | } | ||
| 486 | }; | ||
| 487 | }, | ||
| 488 | |||
| 489 | _insertBR : function(ed) { | ||
| 490 | var dom = ed.dom, s = ed.selection, r = s.getRng(), br; | ||
| 491 | |||
| 492 | // Insert BR element | ||
| 493 | r.insertNode(br = dom.create('br')); | ||
| 494 | |||
| 495 | // Place caret after BR | ||
| 496 | r.setStartAfter(br); | ||
| 497 | r.setEndAfter(br); | ||
| 498 | s.setRng(r); | ||
| 499 | |||
| 500 | // Could not place caret after BR then insert an nbsp entity and move the caret | ||
| 501 | if (s.getSel().focusNode == br.previousSibling) { | ||
| 502 | s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br)); | ||
| 503 | s.collapse(1); | ||
| 504 | } | ||
| 505 | |||
| 506 | // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 | ||
| 507 | ed.getWin().scrollTo(0, dom.getPos(s.getRng().startContainer).y); | ||
| 508 | } | ||
| 509 | }); | ||
| 510 | |||
| 511 | // Register plugin | ||
| 512 | tinymce.PluginManager.add('safari', tinymce.plugins.Safari); | ||
| 513 | })(); | ||
| 514 | |||
diff --git a/public/javascripts/tiny_mce/plugins/save/editor_plugin.js b/public/javascripts/tiny_mce/plugins/save/editor_plugin.js new file mode 100755 index 0000000..8a13e7d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/save/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.Save',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceSave',t._save,t);ed.addCommand('mceCancel',t._cancel,t);ed.addButton('save',{title:'save.save_desc',cmd:'mceSave'});ed.addButton('cancel',{title:'save.cancel_desc',cmd:'mceCancel'});ed.onNodeChange.add(t._nodeChange,t);ed.addShortcut('ctrl+s',ed.getLang('save.save_desc'),'mceSave');},getInfo:function(){return{longname:'Save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var ed=this.editor;if(ed.getParam('save_enablewhendirty')){cm.setDisabled('save',!ed.isDirty());cm.setDisabled('cancel',!ed.isDirty());}},_save:function(){var ed=this.editor,formObj,os,i,elementId;formObj=tinymce.DOM.get(ed.id).form||tinymce.DOM.getParent(ed.id,'form');if(ed.getParam("save_enablewhendirty")&&!ed.isDirty())return;tinyMCE.triggerSave();if(os=ed.getParam("save_onsavecallback")){if(ed.execCallback('save_onsavecallback',ed)){ed.startContent=tinymce.trim(ed.getContent({format:'raw'}));ed.nodeChanged();}return;}if(formObj){ed.isNotDirty=true;if(formObj.onsubmit==null||formObj.onsubmit()!=false)formObj.submit();ed.nodeChanged();}else ed.windowManager.alert("Error: No form element found.");},_cancel:function(){var ed=this.editor,os,h=tinymce.trim(ed.startContent);if(os=ed.getParam("save_oncancelcallback")){ed.execCallback('save_oncancelcallback',ed);return;}ed.setContent(h);ed.undoManager.clear();ed.nodeChanged();}});tinymce.PluginManager.add('save',tinymce.plugins.Save);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js new file mode 100755 index 0000000..b38be4d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js | |||
| @@ -0,0 +1,98 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 851 2008-05-26 15:38:49Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Save', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mceSave', t._save, t); | ||
| 17 | ed.addCommand('mceCancel', t._cancel, t); | ||
| 18 | |||
| 19 | // Register buttons | ||
| 20 | ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); | ||
| 21 | ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); | ||
| 22 | |||
| 23 | ed.onNodeChange.add(t._nodeChange, t); | ||
| 24 | ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); | ||
| 25 | }, | ||
| 26 | |||
| 27 | getInfo : function() { | ||
| 28 | return { | ||
| 29 | longname : 'Save', | ||
| 30 | author : 'Moxiecode Systems AB', | ||
| 31 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 32 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', | ||
| 33 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 34 | }; | ||
| 35 | }, | ||
| 36 | |||
| 37 | // Private methods | ||
| 38 | |||
| 39 | _nodeChange : function(ed, cm, n) { | ||
| 40 | var ed = this.editor; | ||
| 41 | |||
| 42 | if (ed.getParam('save_enablewhendirty')) { | ||
| 43 | cm.setDisabled('save', !ed.isDirty()); | ||
| 44 | cm.setDisabled('cancel', !ed.isDirty()); | ||
| 45 | } | ||
| 46 | }, | ||
| 47 | |||
| 48 | // Private methods | ||
| 49 | |||
| 50 | _save : function() { | ||
| 51 | var ed = this.editor, formObj, os, i, elementId; | ||
| 52 | |||
| 53 | formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); | ||
| 54 | |||
| 55 | if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) | ||
| 56 | return; | ||
| 57 | |||
| 58 | tinyMCE.triggerSave(); | ||
| 59 | |||
| 60 | // Use callback instead | ||
| 61 | if (os = ed.getParam("save_onsavecallback")) { | ||
| 62 | if (ed.execCallback('save_onsavecallback', ed)) { | ||
| 63 | ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); | ||
| 64 | ed.nodeChanged(); | ||
| 65 | } | ||
| 66 | |||
| 67 | return; | ||
| 68 | } | ||
| 69 | |||
| 70 | if (formObj) { | ||
| 71 | ed.isNotDirty = true; | ||
| 72 | |||
| 73 | if (formObj.onsubmit == null || formObj.onsubmit() != false) | ||
| 74 | formObj.submit(); | ||
| 75 | |||
| 76 | ed.nodeChanged(); | ||
| 77 | } else | ||
| 78 | ed.windowManager.alert("Error: No form element found."); | ||
| 79 | }, | ||
| 80 | |||
| 81 | _cancel : function() { | ||
| 82 | var ed = this.editor, os, h = tinymce.trim(ed.startContent); | ||
| 83 | |||
| 84 | // Use callback instead | ||
| 85 | if (os = ed.getParam("save_oncancelcallback")) { | ||
| 86 | ed.execCallback('save_oncancelcallback', ed); | ||
| 87 | return; | ||
| 88 | } | ||
| 89 | |||
| 90 | ed.setContent(h); | ||
| 91 | ed.undoManager.clear(); | ||
| 92 | ed.nodeChanged(); | ||
| 93 | } | ||
| 94 | }); | ||
| 95 | |||
| 96 | // Register plugin | ||
| 97 | tinymce.PluginManager.add('save', tinymce.plugins.Save); | ||
| 98 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css b/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css new file mode 100755 index 0000000..ecdf58c --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | .panel_wrapper {height:85px;} | ||
| 2 | .panel_wrapper div.current {height:85px;} | ||
| 3 | |||
| 4 | /* IE */ | ||
| 5 | * html .panel_wrapper {height:100px;} | ||
| 6 | * html .panel_wrapper div.current {height:100px;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js b/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js new file mode 100755 index 0000000..7fd913b --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.SearchReplacePlugin',{init:function(ed,url){function open(m){ed.windowManager.open({file:url+'/searchreplace.htm',width:420+parseInt(ed.getLang('searchreplace.delta_width',0)),height:160+parseInt(ed.getLang('searchreplace.delta_height',0)),inline:1,auto_focus:0},{mode:m,search_string:ed.selection.getContent({format:'text'}),plugin_url:url});};ed.addCommand('mceSearch',function(){open('search');});ed.addCommand('mceReplace',function(){open('replace');});ed.addButton('search',{title:'searchreplace.search_desc',cmd:'mceSearch'});ed.addButton('replace',{title:'searchreplace.replace_desc',cmd:'mceReplace'});ed.addShortcut('ctrl+f','searchreplace.search_desc','mceSearch');},getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('searchreplace',tinymce.plugins.SearchReplacePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js new file mode 100755 index 0000000..59edc3b --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 686 2008-03-09 18:13:49Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.SearchReplacePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | function open(m) { | ||
| 12 | ed.windowManager.open({ | ||
| 13 | file : url + '/searchreplace.htm', | ||
| 14 | width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), | ||
| 15 | height : 160 + parseInt(ed.getLang('searchreplace.delta_height', 0)), | ||
| 16 | inline : 1, | ||
| 17 | auto_focus : 0 | ||
| 18 | }, { | ||
| 19 | mode : m, | ||
| 20 | search_string : ed.selection.getContent({format : 'text'}), | ||
| 21 | plugin_url : url | ||
| 22 | }); | ||
| 23 | }; | ||
| 24 | |||
| 25 | // Register commands | ||
| 26 | ed.addCommand('mceSearch', function() { | ||
| 27 | open('search'); | ||
| 28 | }); | ||
| 29 | |||
| 30 | ed.addCommand('mceReplace', function() { | ||
| 31 | open('replace'); | ||
| 32 | }); | ||
| 33 | |||
| 34 | // Register buttons | ||
| 35 | ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); | ||
| 36 | ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); | ||
| 37 | |||
| 38 | ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); | ||
| 39 | }, | ||
| 40 | |||
| 41 | getInfo : function() { | ||
| 42 | return { | ||
| 43 | longname : 'Search/Replace', | ||
| 44 | author : 'Moxiecode Systems AB', | ||
| 45 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 46 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', | ||
| 47 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 48 | }; | ||
| 49 | } | ||
| 50 | }); | ||
| 51 | |||
| 52 | // Register plugin | ||
| 53 | tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); | ||
| 54 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js new file mode 100755 index 0000000..a8585cc --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var SearchReplaceDialog = { | ||
| 4 | init : function(ed) { | ||
| 5 | var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); | ||
| 6 | |||
| 7 | this.switchMode(m); | ||
| 8 | |||
| 9 | f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); | ||
| 10 | |||
| 11 | // Focus input field | ||
| 12 | f[m + '_panel_searchstring'].focus(); | ||
| 13 | }, | ||
| 14 | |||
| 15 | switchMode : function(m) { | ||
| 16 | var f, lm = this.lastMode; | ||
| 17 | |||
| 18 | if (lm != m) { | ||
| 19 | f = document.forms[0]; | ||
| 20 | |||
| 21 | if (lm) { | ||
| 22 | f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; | ||
| 23 | f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; | ||
| 24 | f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; | ||
| 25 | f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; | ||
| 26 | } | ||
| 27 | |||
| 28 | mcTabs.displayTab(m + '_tab', m + '_panel'); | ||
| 29 | document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; | ||
| 30 | document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; | ||
| 31 | this.lastMode = m; | ||
| 32 | } | ||
| 33 | }, | ||
| 34 | |||
| 35 | searchNext : function(a) { | ||
| 36 | var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; | ||
| 37 | |||
| 38 | // Get input | ||
| 39 | f = document.forms[0]; | ||
| 40 | s = f[m + '_panel_searchstring'].value; | ||
| 41 | b = f[m + '_panel_backwardsu'].checked; | ||
| 42 | ca = f[m + '_panel_casesensitivebox'].checked; | ||
| 43 | rs = f['replace_panel_replacestring'].value; | ||
| 44 | |||
| 45 | if (s == '') | ||
| 46 | return; | ||
| 47 | |||
| 48 | function fix() { | ||
| 49 | // Correct Firefox graphics glitches | ||
| 50 | r = se.getRng().cloneRange(); | ||
| 51 | ed.getDoc().execCommand('SelectAll', false, null); | ||
| 52 | se.setRng(r); | ||
| 53 | }; | ||
| 54 | |||
| 55 | function replace() { | ||
| 56 | if (tinymce.isIE) | ||
| 57 | ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE | ||
| 58 | else | ||
| 59 | ed.getDoc().execCommand('InsertHTML', false, rs); | ||
| 60 | }; | ||
| 61 | |||
| 62 | // IE flags | ||
| 63 | if (ca) | ||
| 64 | fl = fl | 4; | ||
| 65 | |||
| 66 | switch (a) { | ||
| 67 | case 'all': | ||
| 68 | // Move caret to beginning of text | ||
| 69 | ed.execCommand('SelectAll'); | ||
| 70 | ed.selection.collapse(true); | ||
| 71 | |||
| 72 | if (tinymce.isIE) { | ||
| 73 | while (r.findText(s, b ? -1 : 1, fl)) { | ||
| 74 | r.scrollIntoView(); | ||
| 75 | r.select(); | ||
| 76 | replace(); | ||
| 77 | fo = 1; | ||
| 78 | } | ||
| 79 | |||
| 80 | tinyMCEPopup.storeSelection(); | ||
| 81 | } else { | ||
| 82 | while (w.find(s, ca, b, false, false, false, false)) { | ||
| 83 | replace(); | ||
| 84 | fo = 1; | ||
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 88 | if (fo) | ||
| 89 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); | ||
| 90 | else | ||
| 91 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); | ||
| 92 | |||
| 93 | return; | ||
| 94 | |||
| 95 | case 'current': | ||
| 96 | if (!ed.selection.isCollapsed()) | ||
| 97 | replace(); | ||
| 98 | |||
| 99 | break; | ||
| 100 | } | ||
| 101 | |||
| 102 | se.collapse(b); | ||
| 103 | r = se.getRng(); | ||
| 104 | |||
| 105 | // Whats the point | ||
| 106 | if (!s) | ||
| 107 | return; | ||
| 108 | |||
| 109 | if (tinymce.isIE) { | ||
| 110 | if (r.findText(s, b ? -1 : 1, fl)) { | ||
| 111 | r.scrollIntoView(); | ||
| 112 | r.select(); | ||
| 113 | } else | ||
| 114 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); | ||
| 115 | |||
| 116 | tinyMCEPopup.storeSelection(); | ||
| 117 | } else { | ||
| 118 | if (!w.find(s, ca, b, false, false, false, false)) | ||
| 119 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); | ||
| 120 | else | ||
| 121 | fix(); | ||
| 122 | } | ||
| 123 | } | ||
| 124 | }; | ||
| 125 | |||
| 126 | tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js new file mode 100755 index 0000000..370959a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | tinyMCE.addI18n('en.searchreplace_dlg',{ | ||
| 2 | searchnext_desc:"Find again", | ||
| 3 | notfound:"The search has been completed. The search string could not be found.", | ||
| 4 | search_title:"Find", | ||
| 5 | replace_title:"Find/Replace", | ||
| 6 | allreplaced:"All occurrences of the search string were replaced.", | ||
| 7 | findwhat:"Find what", | ||
| 8 | replacewith:"Replace with", | ||
| 9 | direction:"Direction", | ||
| 10 | up:"Up", | ||
| 11 | down:"Down", | ||
| 12 | mcase:"Match case", | ||
| 13 | findnext:"Find next", | ||
| 14 | replace:"Replace", | ||
| 15 | replaceall:"Replace all" | ||
| 16 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm b/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm new file mode 100755 index 0000000..9c95a6a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm | |||
| @@ -0,0 +1,105 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#searchreplace_dlg.replace_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="js/searchreplace.js"></script> | ||
| 9 | <link rel="stylesheet" type="text/css" href="css/searchreplace.css" /> | ||
| 10 | <base target="_self" /> | ||
| 11 | </head> | ||
| 12 | <body style="display:none;"> | ||
| 13 | <form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#"> | ||
| 14 | <div class="tabs"> | ||
| 15 | <ul> | ||
| 16 | <li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li> | ||
| 17 | <li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li> | ||
| 18 | </ul> | ||
| 19 | </div> | ||
| 20 | |||
| 21 | <div class="panel_wrapper"> | ||
| 22 | <div id="search_panel" class="panel"> | ||
| 23 | <table border="0" cellspacing="0" cellpadding="2"> | ||
| 24 | <tr> | ||
| 25 | <td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td> | ||
| 26 | <td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td> | ||
| 27 | </tr> | ||
| 28 | <tr> | ||
| 29 | <td colspan="2"> | ||
| 30 | <table border="0" cellspacing="0" cellpadding="0" class="direction"> | ||
| 31 | <tr> | ||
| 32 | <td><label>{#searchreplace_dlg.direction}</label></td> | ||
| 33 | <td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td> | ||
| 34 | <td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td> | ||
| 35 | <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td> | ||
| 36 | <td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td> | ||
| 37 | </tr> | ||
| 38 | </table> | ||
| 39 | </td> | ||
| 40 | </tr> | ||
| 41 | <tr> | ||
| 42 | <td colspan="2"> | ||
| 43 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 44 | <tr> | ||
| 45 | <td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td> | ||
| 46 | <td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td> | ||
| 47 | </tr> | ||
| 48 | </table> | ||
| 49 | </td> | ||
| 50 | </tr> | ||
| 51 | </table> | ||
| 52 | </div> | ||
| 53 | |||
| 54 | <div id="replace_panel" class="panel"> | ||
| 55 | <table border="0" cellspacing="0" cellpadding="2"> | ||
| 56 | <tr> | ||
| 57 | <td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td> | ||
| 58 | <td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td> | ||
| 59 | </tr> | ||
| 60 | <tr> | ||
| 61 | <td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td> | ||
| 62 | <td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td> | ||
| 63 | </tr> | ||
| 64 | <tr> | ||
| 65 | <td colspan="2"> | ||
| 66 | <table border="0" cellspacing="0" cellpadding="0" class="direction"> | ||
| 67 | <tr> | ||
| 68 | <td><label>{#searchreplace_dlg.direction}</label></td> | ||
| 69 | <td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td> | ||
| 70 | <td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td> | ||
| 71 | <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td> | ||
| 72 | <td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td> | ||
| 73 | </tr> | ||
| 74 | </table> | ||
| 75 | </td> | ||
| 76 | </tr> | ||
| 77 | <tr> | ||
| 78 | <td colspan="2"> | ||
| 79 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 80 | <tr> | ||
| 81 | <td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td> | ||
| 82 | <td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td> | ||
| 83 | </tr> | ||
| 84 | </table> | ||
| 85 | </td> | ||
| 86 | </tr> | ||
| 87 | </table> | ||
| 88 | </div> | ||
| 89 | |||
| 90 | </div> | ||
| 91 | |||
| 92 | <div class="mceActionPanel"> | ||
| 93 | <div style="float: left"> | ||
| 94 | <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" /> | ||
| 95 | <input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" /> | ||
| 96 | <input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" /> | ||
| 97 | </div> | ||
| 98 | |||
| 99 | <div style="float: right"> | ||
| 100 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 101 | </div> | ||
| 102 | </div> | ||
| 103 | </form> | ||
| 104 | </body> | ||
| 105 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css b/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css new file mode 100755 index 0000000..24efa02 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css | |||
| @@ -0,0 +1 @@ | |||
| .mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} | |||
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js b/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js new file mode 100755 index 0000000..9cb6799 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var JSONRequest=tinymce.util.JSONRequest,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.SpellcheckerPlugin',{getInfo:function(){return{longname:'Spellchecker',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker',version:tinymce.majorVersion+"."+tinymce.minorVersion};},init:function(ed,url){var t=this,cm;t.url=url;t.editor=ed;ed.addCommand('mceSpellCheck',function(){if(!t.active){ed.setProgressState(1);t._sendRPC('checkWords',[t.selectedLang,t._getWords()],function(r){if(r.length>0){t.active=1;t._markWords(r);ed.setProgressState(0);ed.nodeChanged();}else{ed.setProgressState(0);ed.windowManager.alert('spellchecker.no_mpell');}});}else t._done();});ed.onInit.add(function(){if(ed.settings.content_css!==false)ed.dom.loadCSS(url+'/css/content.css');});ed.onClick.add(t._showMenu,t);ed.onContextMenu.add(t._showMenu,t);ed.onBeforeGetContent.add(function(){if(t.active)t._removeWords();});ed.onNodeChange.add(function(ed,cm){cm.setActive('spellchecker',t.active);});ed.onSetContent.add(function(){t._done();});ed.onBeforeGetContent.add(function(){t._done();});ed.onBeforeExecCommand.add(function(ed,cmd){if(cmd=='mceFullScreen')t._done();});t.languages={};each(ed.getParam('spellchecker_languages','+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv','hash'),function(v,k){if(k.indexOf('+')===0){k=k.substring(1);t.selectedLang=v;}t.languages[k]=v;});},createControl:function(n,cm){var t=this,c,ed=t.editor;if(n=='spellchecker'){c=cm.createSplitButton(n,{title:'spellchecker.desc',cmd:'mceSpellCheck',scope:t});c.onRenderMenu.add(function(c,m){m.add({title:'spellchecker.langs','class':'mceMenuItemTitle'}).setDisabled(1);each(t.languages,function(v,k){var o={icon:1},mi;o.onclick=function(){mi.setSelected(1);t.selectedItem.setSelected(0);t.selectedItem=mi;t.selectedLang=v;};o.title=k;mi=m.add(o);mi.setSelected(v==t.selectedLang);if(v==t.selectedLang)t.selectedItem=mi;})});return c;}},_walk:function(n,f){var d=this.editor.getDoc(),w;if(d.createTreeWalker){w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while((n=w.nextNode())!=null)f.call(this,n);}else tinymce.walk(n,f,'childNodes');},_getSeparators:function(){var re='',i,str=this.editor.getParam('spellchecker_word_separator_chars','\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}����������������\u201d\u201c');for(i=0;i<str.length;i++)re+='\\'+str.charAt(i);return re;},_getWords:function(){var ed=this.editor,wl=[],tx='',lo={};this._walk(ed.getBody(),function(n){if(n.nodeType==3)tx+=n.nodeValue+' ';});tx=tx.replace(new RegExp('([0-9]|['+this._getSeparators()+'])','g'),' ');tx=tinymce.trim(tx.replace(/(\s+)/g,' '));each(tx.split(' '),function(v){if(!lo[v]){wl.push(v);lo[v]=1;}});return wl;},_removeWords:function(w){var ed=this.editor,dom=ed.dom,se=ed.selection,b=se.getBookmark();each(dom.select('span').reverse(),function(n){if(n&&(dom.hasClass(n,'mceItemHiddenSpellWord')||dom.hasClass(n,'mceItemHidden'))){if(!w||dom.decode(n.innerHTML)==w)dom.remove(n,1);}});se.moveToBookmark(b);},_markWords:function(wl){var r1,r2,r3,r4,r5,w='',ed=this.editor,re=this._getSeparators(),dom=ed.dom,nl=[];var se=ed.selection,b=se.getBookmark();each(wl,function(v){w+=(w?'|':'')+v;});r1=new RegExp('(['+re+'])('+w+')(['+re+'])','g');r2=new RegExp('^('+w+')','g');r3=new RegExp('('+w+')(['+re+']?)$','g');r4=new RegExp('^('+w+')(['+re+']?)$','g');r5=new RegExp('('+w+')(['+re+'])','g');this._walk(this.editor.getBody(),function(n){if(n.nodeType==3){nl.push(n);}});each(nl,function(n){var v;if(n.nodeType==3){v=n.nodeValue;if(r1.test(v)||r2.test(v)||r3.test(v)||r4.test(v)){v=dom.encode(v);v=v.replace(r5,'<span class="mceItemHiddenSpellWord">$1</span>$2');v=v.replace(r3,'<span class="mceItemHiddenSpellWord">$1</span>$2');dom.replace(dom.create('span',{'class':'mceItemHidden'},v),n);}}});se.moveToBookmark(b);},_showMenu:function(ed,e){var t=this,ed=t.editor,m=t._menu,p1,dom=ed.dom,vp=dom.getViewPort(ed.getWin());if(!m){p1=DOM.getPos(ed.getContentAreaContainer());m=ed.controlManager.createDropMenu('spellcheckermenu',{offset_x:p1.x,offset_y:p1.y,'class':'mceNoIcons'});t._menu=m;}if(dom.hasClass(e.target,'mceItemHiddenSpellWord')){m.removeAll();m.add({title:'spellchecker.wait','class':'mceMenuItemTitle'}).setDisabled(1);t._sendRPC('getSuggestions',[t.selectedLang,dom.decode(e.target.innerHTML)],function(r){m.removeAll();if(r.length>0){m.add({title:'spellchecker.sug','class':'mceMenuItemTitle'}).setDisabled(1);each(r,function(v){m.add({title:v,onclick:function(){dom.replace(ed.getDoc().createTextNode(v),e.target);t._checkDone();}});});m.addSeparator();}else m.add({title:'spellchecker.no_sug','class':'mceMenuItemTitle'}).setDisabled(1);m.add({title:'spellchecker.ignore_word',onclick:function(){dom.remove(e.target,1);t._checkDone();}});m.add({title:'spellchecker.ignore_words',onclick:function(){t._removeWords(dom.decode(e.target.innerHTML));t._checkDone();}});m.update();});ed.selection.select(e.target);p1=dom.getPos(e.target);m.showMenu(p1.x,p1.y+e.target.offsetHeight-vp.y);return tinymce.dom.Event.cancel(e);}else m.hideMenu();},_checkDone:function(){var t=this,ed=t.editor,dom=ed.dom,o;each(dom.select('span'),function(n){if(n&&dom.hasClass(n,'mceItemHiddenSpellWord')){o=true;return false;}});if(!o)t._done();},_done:function(){var t=this,la=t.active;if(t.active){t.active=0;t._removeWords();if(t._menu)t._menu.hideMenu();if(la)t.editor.nodeChanged();}},_sendRPC:function(m,p,cb){var t=this,url=t.editor.getParam("spellchecker_rpc_url","{backend}");if(url=='{backend}'){t.editor.setProgressState(0);alert('Please specify: spellchecker_rpc_url');return;}JSONRequest.sendRPC({url:url,method:m,params:p,success:cb,error:function(e,x){t.editor.setProgressState(0);t.editor.windowManager.alert(e.errstr||('Error response: '+x.responseText));}});}});tinymce.PluginManager.add('spellchecker',tinymce.plugins.SpellcheckerPlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js new file mode 100755 index 0000000..c913c46 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js | |||
| @@ -0,0 +1,338 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 425 2007-11-21 15:17:39Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.SpellcheckerPlugin', { | ||
| 12 | getInfo : function() { | ||
| 13 | return { | ||
| 14 | longname : 'Spellchecker', | ||
| 15 | author : 'Moxiecode Systems AB', | ||
| 16 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 17 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', | ||
| 18 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 19 | }; | ||
| 20 | }, | ||
| 21 | |||
| 22 | init : function(ed, url) { | ||
| 23 | var t = this, cm; | ||
| 24 | |||
| 25 | t.url = url; | ||
| 26 | t.editor = ed; | ||
| 27 | |||
| 28 | // Register commands | ||
| 29 | ed.addCommand('mceSpellCheck', function() { | ||
| 30 | if (!t.active) { | ||
| 31 | ed.setProgressState(1); | ||
| 32 | t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { | ||
| 33 | if (r.length > 0) { | ||
| 34 | t.active = 1; | ||
| 35 | t._markWords(r); | ||
| 36 | ed.setProgressState(0); | ||
| 37 | ed.nodeChanged(); | ||
| 38 | } else { | ||
| 39 | ed.setProgressState(0); | ||
| 40 | ed.windowManager.alert('spellchecker.no_mpell'); | ||
| 41 | } | ||
| 42 | }); | ||
| 43 | } else | ||
| 44 | t._done(); | ||
| 45 | }); | ||
| 46 | |||
| 47 | ed.onInit.add(function() { | ||
| 48 | if (ed.settings.content_css !== false) | ||
| 49 | ed.dom.loadCSS(url + '/css/content.css'); | ||
| 50 | }); | ||
| 51 | |||
| 52 | ed.onClick.add(t._showMenu, t); | ||
| 53 | ed.onContextMenu.add(t._showMenu, t); | ||
| 54 | ed.onBeforeGetContent.add(function() { | ||
| 55 | if (t.active) | ||
| 56 | t._removeWords(); | ||
| 57 | }); | ||
| 58 | |||
| 59 | ed.onNodeChange.add(function(ed, cm) { | ||
| 60 | cm.setActive('spellchecker', t.active); | ||
| 61 | }); | ||
| 62 | |||
| 63 | ed.onSetContent.add(function() { | ||
| 64 | t._done(); | ||
| 65 | }); | ||
| 66 | |||
| 67 | ed.onBeforeGetContent.add(function() { | ||
| 68 | t._done(); | ||
| 69 | }); | ||
| 70 | |||
| 71 | ed.onBeforeExecCommand.add(function(ed, cmd) { | ||
| 72 | if (cmd == 'mceFullScreen') | ||
| 73 | t._done(); | ||
| 74 | }); | ||
| 75 | |||
| 76 | // Find selected language | ||
| 77 | t.languages = {}; | ||
| 78 | each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { | ||
| 79 | if (k.indexOf('+') === 0) { | ||
| 80 | k = k.substring(1); | ||
| 81 | t.selectedLang = v; | ||
| 82 | } | ||
| 83 | |||
| 84 | t.languages[k] = v; | ||
| 85 | }); | ||
| 86 | }, | ||
| 87 | |||
| 88 | createControl : function(n, cm) { | ||
| 89 | var t = this, c, ed = t.editor; | ||
| 90 | |||
| 91 | if (n == 'spellchecker') { | ||
| 92 | c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); | ||
| 93 | |||
| 94 | c.onRenderMenu.add(function(c, m) { | ||
| 95 | m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); | ||
| 96 | each(t.languages, function(v, k) { | ||
| 97 | var o = {icon : 1}, mi; | ||
| 98 | |||
| 99 | o.onclick = function() { | ||
| 100 | mi.setSelected(1); | ||
| 101 | t.selectedItem.setSelected(0); | ||
| 102 | t.selectedItem = mi; | ||
| 103 | t.selectedLang = v; | ||
| 104 | }; | ||
| 105 | |||
| 106 | o.title = k; | ||
| 107 | mi = m.add(o); | ||
| 108 | mi.setSelected(v == t.selectedLang); | ||
| 109 | |||
| 110 | if (v == t.selectedLang) | ||
| 111 | t.selectedItem = mi; | ||
| 112 | }) | ||
| 113 | }); | ||
| 114 | |||
| 115 | return c; | ||
| 116 | } | ||
| 117 | }, | ||
| 118 | |||
| 119 | // Internal functions | ||
| 120 | |||
| 121 | _walk : function(n, f) { | ||
| 122 | var d = this.editor.getDoc(), w; | ||
| 123 | |||
| 124 | if (d.createTreeWalker) { | ||
| 125 | w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); | ||
| 126 | |||
| 127 | while ((n = w.nextNode()) != null) | ||
| 128 | f.call(this, n); | ||
| 129 | } else | ||
| 130 | tinymce.walk(n, f, 'childNodes'); | ||
| 131 | }, | ||
| 132 | |||
| 133 | _getSeparators : function() { | ||
| 134 | var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c'); | ||
| 135 | |||
| 136 | // Build word separator regexp | ||
| 137 | for (i=0; i<str.length; i++) | ||
| 138 | re += '\\' + str.charAt(i); | ||
| 139 | |||
| 140 | return re; | ||
| 141 | }, | ||
| 142 | |||
| 143 | _getWords : function() { | ||
| 144 | var ed = this.editor, wl = [], tx = '', lo = {}; | ||
| 145 | |||
| 146 | // Get area text | ||
| 147 | this._walk(ed.getBody(), function(n) { | ||
| 148 | if (n.nodeType == 3) | ||
| 149 | tx += n.nodeValue + ' '; | ||
| 150 | }); | ||
| 151 | |||
| 152 | // Split words by separator | ||
| 153 | tx = tx.replace(new RegExp('([0-9]|[' + this._getSeparators() + '])', 'g'), ' '); | ||
| 154 | tx = tinymce.trim(tx.replace(/(\s+)/g, ' ')); | ||
| 155 | |||
| 156 | // Build word array and remove duplicates | ||
| 157 | each(tx.split(' '), function(v) { | ||
| 158 | if (!lo[v]) { | ||
| 159 | wl.push(v); | ||
| 160 | lo[v] = 1; | ||
| 161 | } | ||
| 162 | }); | ||
| 163 | |||
| 164 | return wl; | ||
| 165 | }, | ||
| 166 | |||
| 167 | _removeWords : function(w) { | ||
| 168 | var ed = this.editor, dom = ed.dom, se = ed.selection, b = se.getBookmark(); | ||
| 169 | |||
| 170 | each(dom.select('span').reverse(), function(n) { | ||
| 171 | if (n && (dom.hasClass(n, 'mceItemHiddenSpellWord') || dom.hasClass(n, 'mceItemHidden'))) { | ||
| 172 | if (!w || dom.decode(n.innerHTML) == w) | ||
| 173 | dom.remove(n, 1); | ||
| 174 | } | ||
| 175 | }); | ||
| 176 | |||
| 177 | se.moveToBookmark(b); | ||
| 178 | }, | ||
| 179 | |||
| 180 | _markWords : function(wl) { | ||
| 181 | var r1, r2, r3, r4, r5, w = '', ed = this.editor, re = this._getSeparators(), dom = ed.dom, nl = []; | ||
| 182 | var se = ed.selection, b = se.getBookmark(); | ||
| 183 | |||
| 184 | each(wl, function(v) { | ||
| 185 | w += (w ? '|' : '') + v; | ||
| 186 | }); | ||
| 187 | |||
| 188 | r1 = new RegExp('([' + re + '])(' + w + ')([' + re + '])', 'g'); | ||
| 189 | r2 = new RegExp('^(' + w + ')', 'g'); | ||
| 190 | r3 = new RegExp('(' + w + ')([' + re + ']?)$', 'g'); | ||
| 191 | r4 = new RegExp('^(' + w + ')([' + re + ']?)$', 'g'); | ||
| 192 | r5 = new RegExp('(' + w + ')([' + re + '])', 'g'); | ||
| 193 | |||
| 194 | // Collect all text nodes | ||
| 195 | this._walk(this.editor.getBody(), function(n) { | ||
| 196 | if (n.nodeType == 3) { | ||
| 197 | nl.push(n); | ||
| 198 | } | ||
| 199 | }); | ||
| 200 | |||
| 201 | // Wrap incorrect words in spans | ||
| 202 | each(nl, function(n) { | ||
| 203 | var v; | ||
| 204 | |||
| 205 | if (n.nodeType == 3) { | ||
| 206 | v = n.nodeValue; | ||
| 207 | |||
| 208 | if (r1.test(v) || r2.test(v) || r3.test(v) || r4.test(v)) { | ||
| 209 | v = dom.encode(v); | ||
| 210 | v = v.replace(r5, '<span class="mceItemHiddenSpellWord">$1</span>$2'); | ||
| 211 | v = v.replace(r3, '<span class="mceItemHiddenSpellWord">$1</span>$2'); | ||
| 212 | |||
| 213 | dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n); | ||
| 214 | } | ||
| 215 | } | ||
| 216 | }); | ||
| 217 | |||
| 218 | se.moveToBookmark(b); | ||
| 219 | }, | ||
| 220 | |||
| 221 | _showMenu : function(ed, e) { | ||
| 222 | var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()); | ||
| 223 | |||
| 224 | if (!m) { | ||
| 225 | p1 = DOM.getPos(ed.getContentAreaContainer()); | ||
| 226 | //p2 = DOM.getPos(ed.getContainer()); | ||
| 227 | |||
| 228 | m = ed.controlManager.createDropMenu('spellcheckermenu', { | ||
| 229 | offset_x : p1.x, | ||
| 230 | offset_y : p1.y, | ||
| 231 | 'class' : 'mceNoIcons' | ||
| 232 | }); | ||
| 233 | |||
| 234 | t._menu = m; | ||
| 235 | } | ||
| 236 | |||
| 237 | if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) { | ||
| 238 | m.removeAll(); | ||
| 239 | m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); | ||
| 240 | |||
| 241 | t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) { | ||
| 242 | m.removeAll(); | ||
| 243 | |||
| 244 | if (r.length > 0) { | ||
| 245 | m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); | ||
| 246 | each(r, function(v) { | ||
| 247 | m.add({title : v, onclick : function() { | ||
| 248 | dom.replace(ed.getDoc().createTextNode(v), e.target); | ||
| 249 | t._checkDone(); | ||
| 250 | }}); | ||
| 251 | }); | ||
| 252 | |||
| 253 | m.addSeparator(); | ||
| 254 | } else | ||
| 255 | m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); | ||
| 256 | |||
| 257 | m.add({ | ||
| 258 | title : 'spellchecker.ignore_word', | ||
| 259 | onclick : function() { | ||
| 260 | dom.remove(e.target, 1); | ||
| 261 | t._checkDone(); | ||
| 262 | } | ||
| 263 | }); | ||
| 264 | |||
| 265 | m.add({ | ||
| 266 | title : 'spellchecker.ignore_words', | ||
| 267 | onclick : function() { | ||
| 268 | t._removeWords(dom.decode(e.target.innerHTML)); | ||
| 269 | t._checkDone(); | ||
| 270 | } | ||
| 271 | }); | ||
| 272 | |||
| 273 | m.update(); | ||
| 274 | }); | ||
| 275 | |||
| 276 | ed.selection.select(e.target); | ||
| 277 | p1 = dom.getPos(e.target); | ||
| 278 | m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y); | ||
| 279 | |||
| 280 | return tinymce.dom.Event.cancel(e); | ||
| 281 | } else | ||
| 282 | m.hideMenu(); | ||
| 283 | }, | ||
| 284 | |||
| 285 | _checkDone : function() { | ||
| 286 | var t = this, ed = t.editor, dom = ed.dom, o; | ||
| 287 | |||
| 288 | each(dom.select('span'), function(n) { | ||
| 289 | if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { | ||
| 290 | o = true; | ||
| 291 | return false; | ||
| 292 | } | ||
| 293 | }); | ||
| 294 | |||
| 295 | if (!o) | ||
| 296 | t._done(); | ||
| 297 | }, | ||
| 298 | |||
| 299 | _done : function() { | ||
| 300 | var t = this, la = t.active; | ||
| 301 | |||
| 302 | if (t.active) { | ||
| 303 | t.active = 0; | ||
| 304 | t._removeWords(); | ||
| 305 | |||
| 306 | if (t._menu) | ||
| 307 | t._menu.hideMenu(); | ||
| 308 | |||
| 309 | if (la) | ||
| 310 | t.editor.nodeChanged(); | ||
| 311 | } | ||
| 312 | }, | ||
| 313 | |||
| 314 | _sendRPC : function(m, p, cb) { | ||
| 315 | var t = this, url = t.editor.getParam("spellchecker_rpc_url", "{backend}"); | ||
| 316 | |||
| 317 | if (url == '{backend}') { | ||
| 318 | t.editor.setProgressState(0); | ||
| 319 | alert('Please specify: spellchecker_rpc_url'); | ||
| 320 | return; | ||
| 321 | } | ||
| 322 | |||
| 323 | JSONRequest.sendRPC({ | ||
| 324 | url : url, | ||
| 325 | method : m, | ||
| 326 | params : p, | ||
| 327 | success : cb, | ||
| 328 | error : function(e, x) { | ||
| 329 | t.editor.setProgressState(0); | ||
| 330 | t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); | ||
| 331 | } | ||
| 332 | }); | ||
| 333 | } | ||
| 334 | }); | ||
| 335 | |||
| 336 | // Register plugin | ||
| 337 | tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); | ||
| 338 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif b/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif new file mode 100755 index 0000000..7d0a4db --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/style/css/props.css b/public/javascripts/tiny_mce/plugins/style/css/props.css new file mode 100755 index 0000000..eb1f264 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/style/css/props.css | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #text_font {width:250px;} | ||
| 2 | #text_size {width:70px;} | ||
| 3 | .mceAddSelectValue {background:#DDD;} | ||
| 4 | select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} | ||
| 5 | #box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} | ||
| 6 | #positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} | ||
| 7 | #positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} | ||
| 8 | .panel_wrapper div.current {padding-top:10px;height:230px;} | ||
| 9 | .delim {border-left:1px solid gray;} | ||
| 10 | .tdelim {border-bottom:1px solid gray;} | ||
| 11 | #block_display {width:145px;} | ||
| 12 | #list_type {width:115px;} | ||
| 13 | .disabled {background:#EEE;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/style/editor_plugin.js b/public/javascripts/tiny_mce/plugins/style/editor_plugin.js new file mode 100755 index 0000000..6ebaa91 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/style/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.StylePlugin',{init:function(ed,url){ed.addCommand('mceStyleProps',function(){ed.windowManager.open({file:url+'/props.htm',width:480+parseInt(ed.getLang('style.delta_width',0)),height:320+parseInt(ed.getLang('style.delta_height',0)),inline:1},{plugin_url:url,style_text:ed.selection.getNode().style.cssText});});ed.addCommand('mceSetElementStyle',function(ui,v){if(e=ed.selection.getNode()){ed.dom.setAttrib(e,'style',v);ed.execCommand('mceRepaint');}});ed.onNodeChange.add(function(ed,cm,n){cm.setDisabled('styleprops',n.nodeName==='BODY');});ed.addButton('styleprops',{title:'style.desc',cmd:'mceStyleProps'});},getInfo:function(){return{longname:'Style',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('style',tinymce.plugins.StylePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js new file mode 100755 index 0000000..6c817ce --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 787 2008-04-10 11:40:57Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.StylePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | // Register commands | ||
| 12 | ed.addCommand('mceStyleProps', function() { | ||
| 13 | ed.windowManager.open({ | ||
| 14 | file : url + '/props.htm', | ||
| 15 | width : 480 + parseInt(ed.getLang('style.delta_width', 0)), | ||
| 16 | height : 320 + parseInt(ed.getLang('style.delta_height', 0)), | ||
| 17 | inline : 1 | ||
| 18 | }, { | ||
| 19 | plugin_url : url, | ||
| 20 | style_text : ed.selection.getNode().style.cssText | ||
| 21 | }); | ||
| 22 | }); | ||
| 23 | |||
| 24 | ed.addCommand('mceSetElementStyle', function(ui, v) { | ||
| 25 | if (e = ed.selection.getNode()) { | ||
| 26 | ed.dom.setAttrib(e, 'style', v); | ||
| 27 | ed.execCommand('mceRepaint'); | ||
| 28 | } | ||
| 29 | }); | ||
| 30 | |||
| 31 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 32 | cm.setDisabled('styleprops', n.nodeName === 'BODY'); | ||
| 33 | }); | ||
| 34 | |||
| 35 | // Register buttons | ||
| 36 | ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); | ||
| 37 | }, | ||
| 38 | |||
| 39 | getInfo : function() { | ||
| 40 | return { | ||
| 41 | longname : 'Style', | ||
| 42 | author : 'Moxiecode Systems AB', | ||
| 43 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 44 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', | ||
| 45 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 46 | }; | ||
| 47 | } | ||
| 48 | }); | ||
| 49 | |||
| 50 | // Register plugin | ||
| 51 | tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); | ||
| 52 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/style/js/props.js b/public/javascripts/tiny_mce/plugins/style/js/props.js new file mode 100755 index 0000000..cafd6b1 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/style/js/props.js | |||
| @@ -0,0 +1,641 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var defaultFonts = "" + | ||
| 4 | "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + | ||
| 5 | "Times New Roman, Times, serif=Times New Roman, Times, serif;" + | ||
| 6 | "Courier New, Courier, mono=Courier New, Courier, mono;" + | ||
| 7 | "Times New Roman, Times, serif=Times New Roman, Times, serif;" + | ||
| 8 | "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + | ||
| 9 | "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + | ||
| 10 | "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; | ||
| 11 | |||
| 12 | var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; | ||
| 13 | var defaultMeasurement = "+pixels=px;points=pt;em;in;cm;mm;picas;ems;exs;%"; | ||
| 14 | var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%"; | ||
| 15 | var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%"; | ||
| 16 | var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; | ||
| 17 | var defaultTextStyle = "normal;italic;oblique"; | ||
| 18 | var defaultVariant = "normal;small-caps"; | ||
| 19 | var defaultLineHeight = "normal"; | ||
| 20 | var defaultAttachment = "fixed;scroll"; | ||
| 21 | var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; | ||
| 22 | var defaultPosH = "left;center;right"; | ||
| 23 | var defaultPosV = "top;center;bottom"; | ||
| 24 | var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; | ||
| 25 | var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; | ||
| 26 | var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; | ||
| 27 | var defaultBorderWidth = "thin;medium;thick"; | ||
| 28 | var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; | ||
| 29 | |||
| 30 | function init() { | ||
| 31 | var ce = document.getElementById('container'), h; | ||
| 32 | |||
| 33 | ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); | ||
| 34 | |||
| 35 | h = getBrowserHTML('background_image_browser','background_image','image','advimage'); | ||
| 36 | document.getElementById("background_image_browser").innerHTML = h; | ||
| 37 | |||
| 38 | document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); | ||
| 39 | document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); | ||
| 40 | document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); | ||
| 41 | document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); | ||
| 42 | document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); | ||
| 43 | document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); | ||
| 44 | |||
| 45 | fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); | ||
| 46 | fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); | ||
| 47 | fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); | ||
| 48 | fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); | ||
| 49 | fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); | ||
| 50 | fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); | ||
| 51 | fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); | ||
| 52 | fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); | ||
| 53 | fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); | ||
| 54 | |||
| 55 | fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); | ||
| 56 | fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); | ||
| 57 | |||
| 58 | fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); | ||
| 59 | fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); | ||
| 60 | |||
| 61 | fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); | ||
| 62 | fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); | ||
| 63 | |||
| 64 | fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); | ||
| 65 | fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); | ||
| 66 | fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); | ||
| 67 | fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); | ||
| 68 | fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); | ||
| 69 | fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); | ||
| 70 | fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); | ||
| 71 | fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); | ||
| 72 | fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); | ||
| 73 | |||
| 74 | fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); | ||
| 75 | fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); | ||
| 76 | fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); | ||
| 77 | fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); | ||
| 78 | fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); | ||
| 79 | fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); | ||
| 80 | fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); | ||
| 81 | fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); | ||
| 82 | fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); | ||
| 83 | fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); | ||
| 84 | fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); | ||
| 85 | fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); | ||
| 86 | |||
| 87 | fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); | ||
| 88 | fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); | ||
| 89 | fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); | ||
| 90 | fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); | ||
| 91 | |||
| 92 | fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); | ||
| 93 | fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); | ||
| 94 | fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); | ||
| 95 | fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); | ||
| 96 | |||
| 97 | fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); | ||
| 98 | fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); | ||
| 99 | fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); | ||
| 100 | fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); | ||
| 101 | |||
| 102 | fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); | ||
| 103 | fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); | ||
| 104 | |||
| 105 | fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); | ||
| 106 | fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); | ||
| 107 | |||
| 108 | fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); | ||
| 109 | fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); | ||
| 110 | fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); | ||
| 111 | |||
| 112 | fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); | ||
| 113 | fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); | ||
| 114 | fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); | ||
| 115 | fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); | ||
| 116 | |||
| 117 | fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); | ||
| 118 | fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); | ||
| 119 | fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); | ||
| 120 | fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); | ||
| 121 | |||
| 122 | TinyMCE_EditableSelects.init(); | ||
| 123 | setupFormData(); | ||
| 124 | showDisabledControls(); | ||
| 125 | } | ||
| 126 | |||
| 127 | function setupFormData() { | ||
| 128 | var ce = document.getElementById('container'), f = document.forms[0], s, b, i; | ||
| 129 | |||
| 130 | // Setup text fields | ||
| 131 | |||
| 132 | selectByValue(f, 'text_font', ce.style.fontFamily, true, true); | ||
| 133 | selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); | ||
| 134 | selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); | ||
| 135 | selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); | ||
| 136 | selectByValue(f, 'text_style', ce.style.fontStyle, true, true); | ||
| 137 | selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); | ||
| 138 | selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); | ||
| 139 | selectByValue(f, 'text_case', ce.style.textTransform, true, true); | ||
| 140 | selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); | ||
| 141 | f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); | ||
| 142 | updateColor('text_color_pick', 'text_color'); | ||
| 143 | f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); | ||
| 144 | f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); | ||
| 145 | f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); | ||
| 146 | f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); | ||
| 147 | |||
| 148 | // Setup background fields | ||
| 149 | |||
| 150 | f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); | ||
| 151 | updateColor('background_color_pick', 'background_color'); | ||
| 152 | f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 153 | selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); | ||
| 154 | selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); | ||
| 155 | selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); | ||
| 156 | selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); | ||
| 157 | selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); | ||
| 158 | selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); | ||
| 159 | |||
| 160 | // Setup block fields | ||
| 161 | |||
| 162 | selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); | ||
| 163 | selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); | ||
| 164 | selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); | ||
| 165 | selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); | ||
| 166 | selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); | ||
| 167 | selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); | ||
| 168 | f.block_text_indent.value = getNum(ce.style.textIndent); | ||
| 169 | selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); | ||
| 170 | selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); | ||
| 171 | selectByValue(f, 'block_display', ce.style.display, true, true); | ||
| 172 | |||
| 173 | // Setup box fields | ||
| 174 | |||
| 175 | f.box_width.value = getNum(ce.style.width); | ||
| 176 | selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); | ||
| 177 | |||
| 178 | f.box_height.value = getNum(ce.style.height); | ||
| 179 | selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); | ||
| 180 | |||
| 181 | if (tinymce.isGecko) | ||
| 182 | selectByValue(f, 'box_float', ce.style.cssFloat, true, true); | ||
| 183 | else | ||
| 184 | selectByValue(f, 'box_float', ce.style.styleFloat, true, true); | ||
| 185 | |||
| 186 | selectByValue(f, 'box_clear', ce.style.clear, true, true); | ||
| 187 | |||
| 188 | setupBox(f, ce, 'box_padding', 'padding', ''); | ||
| 189 | setupBox(f, ce, 'box_margin', 'margin', ''); | ||
| 190 | |||
| 191 | // Setup border fields | ||
| 192 | |||
| 193 | setupBox(f, ce, 'border_style', 'border', 'Style'); | ||
| 194 | setupBox(f, ce, 'border_width', 'border', 'Width'); | ||
| 195 | setupBox(f, ce, 'border_color', 'border', 'Color'); | ||
| 196 | |||
| 197 | updateColor('border_color_top_pick', 'border_color_top'); | ||
| 198 | updateColor('border_color_right_pick', 'border_color_right'); | ||
| 199 | updateColor('border_color_bottom_pick', 'border_color_bottom'); | ||
| 200 | updateColor('border_color_left_pick', 'border_color_left'); | ||
| 201 | |||
| 202 | f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); | ||
| 203 | f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); | ||
| 204 | f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); | ||
| 205 | f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); | ||
| 206 | |||
| 207 | // Setup list fields | ||
| 208 | |||
| 209 | selectByValue(f, 'list_type', ce.style.listStyleType, true, true); | ||
| 210 | selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); | ||
| 211 | f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 212 | |||
| 213 | // Setup box fields | ||
| 214 | |||
| 215 | selectByValue(f, 'positioning_type', ce.style.position, true, true); | ||
| 216 | selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); | ||
| 217 | selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); | ||
| 218 | f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; | ||
| 219 | |||
| 220 | f.positioning_width.value = getNum(ce.style.width); | ||
| 221 | selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); | ||
| 222 | |||
| 223 | f.positioning_height.value = getNum(ce.style.height); | ||
| 224 | selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); | ||
| 225 | |||
| 226 | setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); | ||
| 227 | |||
| 228 | s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 229 | s = s.replace(/,/g, ' '); | ||
| 230 | |||
| 231 | if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { | ||
| 232 | f.positioning_clip_top.value = getNum(getVal(s, 0)); | ||
| 233 | selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); | ||
| 234 | f.positioning_clip_right.value = getNum(getVal(s, 1)); | ||
| 235 | selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); | ||
| 236 | f.positioning_clip_bottom.value = getNum(getVal(s, 2)); | ||
| 237 | selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); | ||
| 238 | f.positioning_clip_left.value = getNum(getVal(s, 3)); | ||
| 239 | selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); | ||
| 240 | } else { | ||
| 241 | f.positioning_clip_top.value = getNum(getVal(s, 0)); | ||
| 242 | selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); | ||
| 243 | f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; | ||
| 244 | } | ||
| 245 | |||
| 246 | // setupBox(f, ce, '', 'border', 'Color'); | ||
| 247 | } | ||
| 248 | |||
| 249 | function getMeasurement(s) { | ||
| 250 | return s.replace(/^([0-9]+)(.*)$/, "$2"); | ||
| 251 | } | ||
| 252 | |||
| 253 | function getNum(s) { | ||
| 254 | if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s)) | ||
| 255 | return s.replace(/[^0-9]/g, ''); | ||
| 256 | |||
| 257 | return s; | ||
| 258 | } | ||
| 259 | |||
| 260 | function inStr(s, n) { | ||
| 261 | return new RegExp(n, 'gi').test(s); | ||
| 262 | } | ||
| 263 | |||
| 264 | function getVal(s, i) { | ||
| 265 | var a = s.split(' '); | ||
| 266 | |||
| 267 | if (a.length > 1) | ||
| 268 | return a[i]; | ||
| 269 | |||
| 270 | return ""; | ||
| 271 | } | ||
| 272 | |||
| 273 | function setValue(f, n, v) { | ||
| 274 | if (f.elements[n].type == "text") | ||
| 275 | f.elements[n].value = v; | ||
| 276 | else | ||
| 277 | selectByValue(f, n, v, true, true); | ||
| 278 | } | ||
| 279 | |||
| 280 | function setupBox(f, ce, fp, pr, sf, b) { | ||
| 281 | if (typeof(b) == "undefined") | ||
| 282 | b = ['Top', 'Right', 'Bottom', 'Left']; | ||
| 283 | |||
| 284 | if (isSame(ce, pr, sf, b)) { | ||
| 285 | f.elements[fp + "_same"].checked = true; | ||
| 286 | |||
| 287 | setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); | ||
| 288 | f.elements[fp + "_top"].disabled = false; | ||
| 289 | |||
| 290 | f.elements[fp + "_right"].value = ""; | ||
| 291 | f.elements[fp + "_right"].disabled = true; | ||
| 292 | f.elements[fp + "_bottom"].value = ""; | ||
| 293 | f.elements[fp + "_bottom"].disabled = true; | ||
| 294 | f.elements[fp + "_left"].value = ""; | ||
| 295 | f.elements[fp + "_left"].disabled = true; | ||
| 296 | |||
| 297 | if (f.elements[fp + "_top_measurement"]) { | ||
| 298 | selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); | ||
| 299 | f.elements[fp + "_left_measurement"].disabled = true; | ||
| 300 | f.elements[fp + "_bottom_measurement"].disabled = true; | ||
| 301 | f.elements[fp + "_right_measurement"].disabled = true; | ||
| 302 | } | ||
| 303 | } else { | ||
| 304 | f.elements[fp + "_same"].checked = false; | ||
| 305 | |||
| 306 | setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); | ||
| 307 | f.elements[fp + "_top"].disabled = false; | ||
| 308 | |||
| 309 | setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); | ||
| 310 | f.elements[fp + "_right"].disabled = false; | ||
| 311 | |||
| 312 | setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); | ||
| 313 | f.elements[fp + "_bottom"].disabled = false; | ||
| 314 | |||
| 315 | setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); | ||
| 316 | f.elements[fp + "_left"].disabled = false; | ||
| 317 | |||
| 318 | if (f.elements[fp + "_top_measurement"]) { | ||
| 319 | selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); | ||
| 320 | selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); | ||
| 321 | selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); | ||
| 322 | selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); | ||
| 323 | f.elements[fp + "_left_measurement"].disabled = false; | ||
| 324 | f.elements[fp + "_bottom_measurement"].disabled = false; | ||
| 325 | f.elements[fp + "_right_measurement"].disabled = false; | ||
| 326 | } | ||
| 327 | } | ||
| 328 | } | ||
| 329 | |||
| 330 | function isSame(e, pr, sf, b) { | ||
| 331 | var a = [], i, x; | ||
| 332 | |||
| 333 | if (typeof(b) == "undefined") | ||
| 334 | b = ['Top', 'Right', 'Bottom', 'Left']; | ||
| 335 | |||
| 336 | if (typeof(sf) == "undefined" || sf == null) | ||
| 337 | sf = ""; | ||
| 338 | |||
| 339 | a[0] = e.style[pr + b[0] + sf]; | ||
| 340 | a[1] = e.style[pr + b[1] + sf]; | ||
| 341 | a[2] = e.style[pr + b[2] + sf]; | ||
| 342 | a[3] = e.style[pr + b[3] + sf]; | ||
| 343 | |||
| 344 | for (i=0; i<a.length; i++) { | ||
| 345 | if (a[i] == null) | ||
| 346 | return false; | ||
| 347 | |||
| 348 | for (x=0; x<a.length; x++) { | ||
| 349 | if (a[x] != a[i]) | ||
| 350 | return false; | ||
| 351 | } | ||
| 352 | } | ||
| 353 | |||
| 354 | return true; | ||
| 355 | }; | ||
| 356 | |||
| 357 | function hasEqualValues(a) { | ||
| 358 | var i, x; | ||
| 359 | |||
| 360 | for (i=0; i<a.length; i++) { | ||
| 361 | if (a[i] == null) | ||
| 362 | return false; | ||
| 363 | |||
| 364 | for (x=0; x<a.length; x++) { | ||
| 365 | if (a[x] != a[i]) | ||
| 366 | return false; | ||
| 367 | } | ||
| 368 | } | ||
| 369 | |||
| 370 | return true; | ||
| 371 | } | ||
| 372 | |||
| 373 | function applyAction() { | ||
| 374 | var ce = document.getElementById('container'), ed = tinyMCEPopup.editor; | ||
| 375 | |||
| 376 | generateCSS(); | ||
| 377 | |||
| 378 | tinyMCEPopup.restoreSelection(); | ||
| 379 | ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText))); | ||
| 380 | } | ||
| 381 | |||
| 382 | function updateAction() { | ||
| 383 | applyAction(); | ||
| 384 | tinyMCEPopup.close(); | ||
| 385 | } | ||
| 386 | |||
| 387 | function generateCSS() { | ||
| 388 | var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t; | ||
| 389 | |||
| 390 | ce.style.cssText = ""; | ||
| 391 | |||
| 392 | // Build text styles | ||
| 393 | ce.style.fontFamily = f.text_font.value; | ||
| 394 | ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : ""); | ||
| 395 | ce.style.fontStyle = f.text_style.value; | ||
| 396 | ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : ""); | ||
| 397 | ce.style.textTransform = f.text_case.value; | ||
| 398 | ce.style.fontWeight = f.text_weight.value; | ||
| 399 | ce.style.fontVariant = f.text_variant.value; | ||
| 400 | ce.style.color = f.text_color.value; | ||
| 401 | |||
| 402 | s = ""; | ||
| 403 | s += f.text_underline.checked ? " underline" : ""; | ||
| 404 | s += f.text_overline.checked ? " overline" : ""; | ||
| 405 | s += f.text_linethrough.checked ? " line-through" : ""; | ||
| 406 | s += f.text_blink.checked ? " blink" : ""; | ||
| 407 | s = s.length > 0 ? s.substring(1) : s; | ||
| 408 | |||
| 409 | if (f.text_none.checked) | ||
| 410 | s = "none"; | ||
| 411 | |||
| 412 | ce.style.textDecoration = s; | ||
| 413 | |||
| 414 | // Build background styles | ||
| 415 | |||
| 416 | ce.style.backgroundColor = f.background_color.value; | ||
| 417 | ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; | ||
| 418 | ce.style.backgroundRepeat = f.background_repeat.value; | ||
| 419 | ce.style.backgroundAttachment = f.background_attachment.value; | ||
| 420 | |||
| 421 | if (f.background_hpos.value != "") { | ||
| 422 | s = ""; | ||
| 423 | s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; | ||
| 424 | s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); | ||
| 425 | ce.style.backgroundPosition = s; | ||
| 426 | } | ||
| 427 | |||
| 428 | // Build block styles | ||
| 429 | |||
| 430 | ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); | ||
| 431 | ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); | ||
| 432 | ce.style.verticalAlign = f.block_vertical_alignment.value; | ||
| 433 | ce.style.textAlign = f.block_text_align.value; | ||
| 434 | ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); | ||
| 435 | ce.style.whiteSpace = f.block_whitespace.value; | ||
| 436 | ce.style.display = f.block_display.value; | ||
| 437 | |||
| 438 | // Build box styles | ||
| 439 | |||
| 440 | ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); | ||
| 441 | ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); | ||
| 442 | ce.style.styleFloat = f.box_float.value; | ||
| 443 | |||
| 444 | if (tinymce.isGecko) | ||
| 445 | ce.style.cssFloat = f.box_float.value; | ||
| 446 | |||
| 447 | ce.style.clear = f.box_clear.value; | ||
| 448 | |||
| 449 | if (!f.box_padding_same.checked) { | ||
| 450 | ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); | ||
| 451 | ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); | ||
| 452 | ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); | ||
| 453 | ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); | ||
| 454 | } else | ||
| 455 | ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); | ||
| 456 | |||
| 457 | if (!f.box_margin_same.checked) { | ||
| 458 | ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); | ||
| 459 | ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); | ||
| 460 | ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); | ||
| 461 | ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); | ||
| 462 | } else | ||
| 463 | ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); | ||
| 464 | |||
| 465 | // Build border styles | ||
| 466 | |||
| 467 | if (!f.border_style_same.checked) { | ||
| 468 | ce.style.borderTopStyle = f.border_style_top.value; | ||
| 469 | ce.style.borderRightStyle = f.border_style_right.value; | ||
| 470 | ce.style.borderBottomStyle = f.border_style_bottom.value; | ||
| 471 | ce.style.borderLeftStyle = f.border_style_left.value; | ||
| 472 | } else | ||
| 473 | ce.style.borderStyle = f.border_style_top.value; | ||
| 474 | |||
| 475 | if (!f.border_width_same.checked) { | ||
| 476 | ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); | ||
| 477 | ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); | ||
| 478 | ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); | ||
| 479 | ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); | ||
| 480 | } else | ||
| 481 | ce.style.borderWidth = f.border_width_top.value; | ||
| 482 | |||
| 483 | if (!f.border_color_same.checked) { | ||
| 484 | ce.style.borderTopColor = f.border_color_top.value; | ||
| 485 | ce.style.borderRightColor = f.border_color_right.value; | ||
| 486 | ce.style.borderBottomColor = f.border_color_bottom.value; | ||
| 487 | ce.style.borderLeftColor = f.border_color_left.value; | ||
| 488 | } else | ||
| 489 | ce.style.borderColor = f.border_color_top.value; | ||
| 490 | |||
| 491 | // Build list styles | ||
| 492 | |||
| 493 | ce.style.listStyleType = f.list_type.value; | ||
| 494 | ce.style.listStylePosition = f.list_position.value; | ||
| 495 | ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; | ||
| 496 | |||
| 497 | // Build positioning styles | ||
| 498 | |||
| 499 | ce.style.position = f.positioning_type.value; | ||
| 500 | ce.style.visibility = f.positioning_visibility.value; | ||
| 501 | |||
| 502 | if (ce.style.width == "") | ||
| 503 | ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); | ||
| 504 | |||
| 505 | if (ce.style.height == "") | ||
| 506 | ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); | ||
| 507 | |||
| 508 | ce.style.zIndex = f.positioning_zindex.value; | ||
| 509 | ce.style.overflow = f.positioning_overflow.value; | ||
| 510 | |||
| 511 | if (!f.positioning_placement_same.checked) { | ||
| 512 | ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); | ||
| 513 | ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); | ||
| 514 | ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); | ||
| 515 | ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); | ||
| 516 | } else { | ||
| 517 | s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); | ||
| 518 | ce.style.top = s; | ||
| 519 | ce.style.right = s; | ||
| 520 | ce.style.bottom = s; | ||
| 521 | ce.style.left = s; | ||
| 522 | } | ||
| 523 | |||
| 524 | if (!f.positioning_clip_same.checked) { | ||
| 525 | s = "rect("; | ||
| 526 | s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; | ||
| 527 | s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; | ||
| 528 | s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; | ||
| 529 | s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); | ||
| 530 | s += ")"; | ||
| 531 | |||
| 532 | if (s != "rect(auto auto auto auto)") | ||
| 533 | ce.style.clip = s; | ||
| 534 | } else { | ||
| 535 | s = "rect("; | ||
| 536 | t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; | ||
| 537 | s += t + " "; | ||
| 538 | s += t + " "; | ||
| 539 | s += t + " "; | ||
| 540 | s += t + ")"; | ||
| 541 | |||
| 542 | if (s != "rect(auto auto auto auto)") | ||
| 543 | ce.style.clip = s; | ||
| 544 | } | ||
| 545 | |||
| 546 | ce.style.cssText = ce.style.cssText; | ||
| 547 | } | ||
| 548 | |||
| 549 | function isNum(s) { | ||
| 550 | return new RegExp('[0-9]+', 'g').test(s); | ||
| 551 | } | ||
| 552 | |||
| 553 | function showDisabledControls() { | ||
| 554 | var f = document.forms, i, a; | ||
| 555 | |||
| 556 | for (i=0; i<f.length; i++) { | ||
| 557 | for (a=0; a<f[i].elements.length; a++) { | ||
| 558 | if (f[i].elements[a].disabled) | ||
| 559 | tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled"); | ||
| 560 | else | ||
| 561 | tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled"); | ||
| 562 | } | ||
| 563 | } | ||
| 564 | } | ||
| 565 | |||
| 566 | function fillSelect(f, s, param, dval, sep, em) { | ||
| 567 | var i, ar, p, se; | ||
| 568 | |||
| 569 | f = document.forms[f]; | ||
| 570 | sep = typeof(sep) == "undefined" ? ";" : sep; | ||
| 571 | |||
| 572 | if (em) | ||
| 573 | addSelectValue(f, s, "", ""); | ||
| 574 | |||
| 575 | ar = tinyMCEPopup.getParam(param, dval).split(sep); | ||
| 576 | for (i=0; i<ar.length; i++) { | ||
| 577 | se = false; | ||
| 578 | |||
| 579 | if (ar[i].charAt(0) == '+') { | ||
| 580 | ar[i] = ar[i].substring(1); | ||
| 581 | se = true; | ||
| 582 | } | ||
| 583 | |||
| 584 | p = ar[i].split('='); | ||
| 585 | |||
| 586 | if (p.length > 1) { | ||
| 587 | addSelectValue(f, s, p[0], p[1]); | ||
| 588 | |||
| 589 | if (se) | ||
| 590 | selectByValue(f, s, p[1]); | ||
| 591 | } else { | ||
| 592 | addSelectValue(f, s, p[0], p[0]); | ||
| 593 | |||
| 594 | if (se) | ||
| 595 | selectByValue(f, s, p[0]); | ||
| 596 | } | ||
| 597 | } | ||
| 598 | } | ||
| 599 | |||
| 600 | function toggleSame(ce, pre) { | ||
| 601 | var el = document.forms[0].elements, i; | ||
| 602 | |||
| 603 | if (ce.checked) { | ||
| 604 | el[pre + "_top"].disabled = false; | ||
| 605 | el[pre + "_right"].disabled = true; | ||
| 606 | el[pre + "_bottom"].disabled = true; | ||
| 607 | el[pre + "_left"].disabled = true; | ||
| 608 | |||
| 609 | if (el[pre + "_top_measurement"]) { | ||
| 610 | el[pre + "_top_measurement"].disabled = false; | ||
| 611 | el[pre + "_right_measurement"].disabled = true; | ||
| 612 | el[pre + "_bottom_measurement"].disabled = true; | ||
| 613 | el[pre + "_left_measurement"].disabled = true; | ||
| 614 | } | ||
| 615 | } else { | ||
| 616 | el[pre + "_top"].disabled = false; | ||
| 617 | el[pre + "_right"].disabled = false; | ||
| 618 | el[pre + "_bottom"].disabled = false; | ||
| 619 | el[pre + "_left"].disabled = false; | ||
| 620 | |||
| 621 | if (el[pre + "_top_measurement"]) { | ||
| 622 | el[pre + "_top_measurement"].disabled = false; | ||
| 623 | el[pre + "_right_measurement"].disabled = false; | ||
| 624 | el[pre + "_bottom_measurement"].disabled = false; | ||
| 625 | el[pre + "_left_measurement"].disabled = false; | ||
| 626 | } | ||
| 627 | } | ||
| 628 | |||
| 629 | showDisabledControls(); | ||
| 630 | } | ||
| 631 | |||
| 632 | function synch(fr, to) { | ||
| 633 | var f = document.forms[0]; | ||
| 634 | |||
| 635 | f.elements[to].value = f.elements[fr].value; | ||
| 636 | |||
| 637 | if (f.elements[fr + "_measurement"]) | ||
| 638 | selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); | ||
| 639 | } | ||
| 640 | |||
| 641 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js new file mode 100755 index 0000000..5026313 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | tinyMCE.addI18n('en.style_dlg',{ | ||
| 2 | title:"Edit CSS Style", | ||
| 3 | apply:"Apply", | ||
| 4 | text_tab:"Text", | ||
| 5 | background_tab:"Background", | ||
| 6 | block_tab:"Block", | ||
| 7 | box_tab:"Box", | ||
| 8 | border_tab:"Border", | ||
| 9 | list_tab:"List", | ||
| 10 | positioning_tab:"Positioning", | ||
| 11 | text_props:"Text", | ||
| 12 | text_font:"Font", | ||
| 13 | text_size:"Size", | ||
| 14 | text_weight:"Weight", | ||
| 15 | text_style:"Style", | ||
| 16 | text_variant:"Variant", | ||
| 17 | text_lineheight:"Line height", | ||
| 18 | text_case:"Case", | ||
| 19 | text_color:"Color", | ||
| 20 | text_decoration:"Decoration", | ||
| 21 | text_overline:"overline", | ||
| 22 | text_underline:"underline", | ||
| 23 | text_striketrough:"strikethrough", | ||
| 24 | text_blink:"blink", | ||
| 25 | text_none:"none", | ||
| 26 | background_color:"Background color", | ||
| 27 | background_image:"Background image", | ||
| 28 | background_repeat:"Repeat", | ||
| 29 | background_attachment:"Attachment", | ||
| 30 | background_hpos:"Horizontal position", | ||
| 31 | background_vpos:"Vertical position", | ||
| 32 | block_wordspacing:"Word spacing", | ||
| 33 | block_letterspacing:"Letter spacing", | ||
| 34 | block_vertical_alignment:"Vertical alignment", | ||
| 35 | block_text_align:"Text align", | ||
| 36 | block_text_indent:"Text indent", | ||
| 37 | block_whitespace:"Whitespace", | ||
| 38 | block_display:"Display", | ||
| 39 | box_width:"Width", | ||
| 40 | box_height:"Height", | ||
| 41 | box_float:"Float", | ||
| 42 | box_clear:"Clear", | ||
| 43 | padding:"Padding", | ||
| 44 | same:"Same for all", | ||
| 45 | top:"Top", | ||
| 46 | right:"Right", | ||
| 47 | bottom:"Bottom", | ||
| 48 | left:"Left", | ||
| 49 | margin:"Margin", | ||
| 50 | style:"Style", | ||
| 51 | width:"Width", | ||
| 52 | height:"Height", | ||
| 53 | color:"Color", | ||
| 54 | list_type:"Type", | ||
| 55 | bullet_image:"Bullet image", | ||
| 56 | position:"Position", | ||
| 57 | positioning_type:"Type", | ||
| 58 | visibility:"Visibility", | ||
| 59 | zindex:"Z-index", | ||
| 60 | overflow:"Overflow", | ||
| 61 | placement:"Placement", | ||
| 62 | clip:"Clip" | ||
| 63 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/style/props.htm b/public/javascripts/tiny_mce/plugins/style/props.htm new file mode 100755 index 0000000..54538e3 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/style/props.htm | |||
| @@ -0,0 +1,731 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#style_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 9 | <script type="text/javascript" src="js/props.js"></script> | ||
| 10 | <link href="css/props.css" rel="stylesheet" type="text/css" /> | ||
| 11 | <base target="_self" /> | ||
| 12 | </head> | ||
| 13 | |||
| 14 | <body id="styleprops" style="display: none"> | ||
| 15 | <form onsubmit="updateAction();return false;" action="#"> | ||
| 16 | <div class="tabs"> | ||
| 17 | <ul> | ||
| 18 | <li id="text_tab" class="current"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li> | ||
| 19 | <li id="background_tab"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li> | ||
| 20 | <li id="block_tab"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li> | ||
| 21 | <li id="box_tab"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li> | ||
| 22 | <li id="border_tab"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li> | ||
| 23 | <li id="list_tab"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li> | ||
| 24 | <li id="positioning_tab"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li> | ||
| 25 | </ul> | ||
| 26 | </div> | ||
| 27 | |||
| 28 | <div class="panel_wrapper"> | ||
| 29 | <div id="text_panel" class="panel current"> | ||
| 30 | <table border="0" width="100%"> | ||
| 31 | <tr> | ||
| 32 | <td><label for="text_font">{#style_dlg.text_font}</label></td> | ||
| 33 | <td colspan="3"> | ||
| 34 | <select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select> | ||
| 35 | </td> | ||
| 36 | </tr> | ||
| 37 | <tr> | ||
| 38 | <td><label for="text_size">{#style_dlg.text_size}</label></td> | ||
| 39 | <td> | ||
| 40 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 41 | <tr> | ||
| 42 | <td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td> | ||
| 43 | <td> </td> | ||
| 44 | <td><select id="text_size_measurement" name="text_size_measurement"></select></td> | ||
| 45 | </tr> | ||
| 46 | </table> | ||
| 47 | </td> | ||
| 48 | <td><label for="text_weight">{#style_dlg.text_weight}</label></td> | ||
| 49 | <td> | ||
| 50 | <select id="text_weight" name="text_weight"></select> | ||
| 51 | </td> | ||
| 52 | </tr> | ||
| 53 | <tr> | ||
| 54 | <td><label for="text_style">{#style_dlg.text_style}</label></td> | ||
| 55 | <td> | ||
| 56 | <select id="text_style" name="text_style" class="mceEditableSelect"></select> | ||
| 57 | </td> | ||
| 58 | <td><label for="text_variant">{#style_dlg.text_variant}</label></td> | ||
| 59 | <td> | ||
| 60 | <select id="text_variant" name="text_variant"></select> | ||
| 61 | </td> | ||
| 62 | </tr> | ||
| 63 | <tr> | ||
| 64 | <td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td> | ||
| 65 | <td> | ||
| 66 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 67 | <tr> | ||
| 68 | <td> | ||
| 69 | <select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select> | ||
| 70 | </td> | ||
| 71 | <td> </td> | ||
| 72 | <td><select id="text_lineheight_measurement" name="text_lineheight_measurement"></select></td> | ||
| 73 | </tr> | ||
| 74 | </table> | ||
| 75 | </td> | ||
| 76 | <td><label for="text_case">{#style_dlg.text_case}</label></td> | ||
| 77 | <td> | ||
| 78 | <select id="text_case" name="text_case"></select> | ||
| 79 | </td> | ||
| 80 | </tr> | ||
| 81 | <tr> | ||
| 82 | <td><label for="text_color">{#style_dlg.text_color}</label></td> | ||
| 83 | <td colspan="2"> | ||
| 84 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 85 | <tr> | ||
| 86 | <td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td> | ||
| 87 | <td id="text_color_pickcontainer"> </td> | ||
| 88 | </tr> | ||
| 89 | </table> | ||
| 90 | </td> | ||
| 91 | </tr> | ||
| 92 | <tr> | ||
| 93 | <td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td> | ||
| 94 | <td colspan="2"> | ||
| 95 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 96 | <tr> | ||
| 97 | <td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td> | ||
| 98 | <td><label for="text_underline">{#style_dlg.text_underline}</label></td> | ||
| 99 | </tr> | ||
| 100 | <tr> | ||
| 101 | <td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td> | ||
| 102 | <td><label for="text_overline">{#style_dlg.text_overline}</label></td> | ||
| 103 | </tr> | ||
| 104 | <tr> | ||
| 105 | <td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td> | ||
| 106 | <td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td> | ||
| 107 | </tr> | ||
| 108 | <tr> | ||
| 109 | <td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td> | ||
| 110 | <td><label for="text_blink">{#style_dlg.text_blink}</label></td> | ||
| 111 | </tr> | ||
| 112 | <tr> | ||
| 113 | <td><input id="text_none" name="text_none" class="checkbox" type="checkbox" /></td> | ||
| 114 | <td><label for="text_none">{#style_dlg.text_none}</label></td> | ||
| 115 | </tr> | ||
| 116 | </table> | ||
| 117 | </td> | ||
| 118 | </tr> | ||
| 119 | </table> | ||
| 120 | </div> | ||
| 121 | |||
| 122 | <div id="background_panel" class="panel"> | ||
| 123 | <table border="0"> | ||
| 124 | <tr> | ||
| 125 | <td><label for="background_color">{#style_dlg.background_color}</label></td> | ||
| 126 | <td> | ||
| 127 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 128 | <tr> | ||
| 129 | <td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td> | ||
| 130 | <td id="background_color_pickcontainer"> </td> | ||
| 131 | </tr> | ||
| 132 | </table> | ||
| 133 | </td> | ||
| 134 | </tr> | ||
| 135 | |||
| 136 | <tr> | ||
| 137 | <td><label for="background_image">{#style_dlg.background_image}</label></td> | ||
| 138 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 139 | <tr> | ||
| 140 | <td><input id="background_image" name="background_image" type="text" /></td> | ||
| 141 | <td id="background_image_browser"> </td> | ||
| 142 | </tr> | ||
| 143 | </table> | ||
| 144 | </td> | ||
| 145 | </tr> | ||
| 146 | |||
| 147 | <tr> | ||
| 148 | <td><label for="background_repeat">{#style_dlg.background_repeat}</label></td> | ||
| 149 | <td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td> | ||
| 150 | </tr> | ||
| 151 | |||
| 152 | <tr> | ||
| 153 | <td><label for="background_attachment">{#style_dlg.background_attachment}</label></td> | ||
| 154 | <td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td> | ||
| 155 | </tr> | ||
| 156 | |||
| 157 | <tr> | ||
| 158 | <td><label for="background_hpos">{#style_dlg.background_hpos}</label></td> | ||
| 159 | <td> | ||
| 160 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 161 | <tr> | ||
| 162 | <td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td> | ||
| 163 | <td> </td> | ||
| 164 | <td><select id="background_hpos_measurement" name="background_hpos_measurement"></select></td> | ||
| 165 | </tr> | ||
| 166 | </table> | ||
| 167 | </td> | ||
| 168 | </tr> | ||
| 169 | |||
| 170 | <tr> | ||
| 171 | <td><label for="background_vpos">{#style_dlg.background_vpos}</label></td> | ||
| 172 | <td> | ||
| 173 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 174 | <tr> | ||
| 175 | <td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td> | ||
| 176 | <td> </td> | ||
| 177 | <td><select id="background_vpos_measurement" name="background_vpos_measurement"></select></td> | ||
| 178 | </tr> | ||
| 179 | </table> | ||
| 180 | </td> | ||
| 181 | </tr> | ||
| 182 | </table> | ||
| 183 | </div> | ||
| 184 | |||
| 185 | <div id="block_panel" class="panel"> | ||
| 186 | <table border="0"> | ||
| 187 | <tr> | ||
| 188 | <td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td> | ||
| 189 | <td> | ||
| 190 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 191 | <tr> | ||
| 192 | <td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td> | ||
| 193 | <td> </td> | ||
| 194 | <td><select id="block_wordspacing_measurement" name="block_wordspacing_measurement"></select></td> | ||
| 195 | </tr> | ||
| 196 | </table> | ||
| 197 | </td> | ||
| 198 | </tr> | ||
| 199 | |||
| 200 | <tr> | ||
| 201 | <td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td> | ||
| 202 | <td> | ||
| 203 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 204 | <tr> | ||
| 205 | <td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td> | ||
| 206 | <td> </td> | ||
| 207 | <td><select id="block_letterspacing_measurement" name="block_letterspacing_measurement"></select></td> | ||
| 208 | </tr> | ||
| 209 | </table> | ||
| 210 | </td> | ||
| 211 | </tr> | ||
| 212 | |||
| 213 | <tr> | ||
| 214 | <td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td> | ||
| 215 | <td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td> | ||
| 216 | </tr> | ||
| 217 | |||
| 218 | <tr> | ||
| 219 | <td><label for="block_text_align">{#style_dlg.block_text_align}</label></td> | ||
| 220 | <td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td> | ||
| 221 | </tr> | ||
| 222 | |||
| 223 | <tr> | ||
| 224 | <td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td> | ||
| 225 | <td> | ||
| 226 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 227 | <tr> | ||
| 228 | <td><input type="text" id="block_text_indent" name="block_text_indent" /></td> | ||
| 229 | <td> </td> | ||
| 230 | <td><select id="block_text_indent_measurement" name="block_text_indent_measurement"></select></td> | ||
| 231 | </tr> | ||
| 232 | </table> | ||
| 233 | </td> | ||
| 234 | </tr> | ||
| 235 | |||
| 236 | <tr> | ||
| 237 | <td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td> | ||
| 238 | <td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td> | ||
| 239 | </tr> | ||
| 240 | |||
| 241 | <tr> | ||
| 242 | <td><label for="block_display">{#style_dlg.block_display}</label></td> | ||
| 243 | <td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td> | ||
| 244 | </tr> | ||
| 245 | </table> | ||
| 246 | </div> | ||
| 247 | |||
| 248 | <div id="box_panel" class="panel"> | ||
| 249 | <table border="0"> | ||
| 250 | <tr> | ||
| 251 | <td><label for="box_width">{#style_dlg.box_width}</label></td> | ||
| 252 | <td> | ||
| 253 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 254 | <tr> | ||
| 255 | <td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td> | ||
| 256 | <td> </td> | ||
| 257 | <td><select id="box_width_measurement" name="box_width_measurement"></select></td> | ||
| 258 | </tr> | ||
| 259 | </table> | ||
| 260 | </td> | ||
| 261 | <td> <label for="box_float">{#style_dlg.box_float}</label></td> | ||
| 262 | <td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td> | ||
| 263 | </tr> | ||
| 264 | |||
| 265 | <tr> | ||
| 266 | <td><label for="box_height">{#style_dlg.box_height}</label></td> | ||
| 267 | <td> | ||
| 268 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 269 | <tr> | ||
| 270 | <td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td> | ||
| 271 | <td> </td> | ||
| 272 | <td><select id="box_height_measurement" name="box_height_measurement"></select></td> | ||
| 273 | </tr> | ||
| 274 | </table> | ||
| 275 | </td> | ||
| 276 | <td> <label for="box_clear">{#style_dlg.box_clear}</label></td> | ||
| 277 | <td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td> | ||
| 278 | </tr> | ||
| 279 | </table> | ||
| 280 | <div style="float: left; width: 49%"> | ||
| 281 | <fieldset> | ||
| 282 | <legend>{#style_dlg.padding}</legend> | ||
| 283 | |||
| 284 | <table border="0"> | ||
| 285 | <tr> | ||
| 286 | <td> </td> | ||
| 287 | <td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td> | ||
| 288 | </tr> | ||
| 289 | <tr> | ||
| 290 | <td><label for="box_padding_top">{#style_dlg.top}</label></td> | ||
| 291 | <td> | ||
| 292 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 293 | <tr> | ||
| 294 | <td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td> | ||
| 295 | <td> </td> | ||
| 296 | <td><select id="box_padding_top_measurement" name="box_padding_top_measurement"></select></td> | ||
| 297 | </tr> | ||
| 298 | </table> | ||
| 299 | </td> | ||
| 300 | </tr> | ||
| 301 | <tr> | ||
| 302 | <td><label for="box_padding_right">{#style_dlg.right}</label></td> | ||
| 303 | <td> | ||
| 304 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 305 | <tr> | ||
| 306 | <td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 307 | <td> </td> | ||
| 308 | <td><select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled"></select></td> | ||
| 309 | </tr> | ||
| 310 | </table> | ||
| 311 | </td> | ||
| 312 | </tr> | ||
| 313 | <tr> | ||
| 314 | <td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td> | ||
| 315 | <td> | ||
| 316 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 317 | <tr> | ||
| 318 | <td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 319 | <td> </td> | ||
| 320 | <td><select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled"></select></td> | ||
| 321 | </tr> | ||
| 322 | </table> | ||
| 323 | </td> | ||
| 324 | </tr> | ||
| 325 | <tr> | ||
| 326 | <td><label for="box_padding_left">{#style_dlg.left}</label></td> | ||
| 327 | <td> | ||
| 328 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 329 | <tr> | ||
| 330 | <td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 331 | <td> </td> | ||
| 332 | <td><select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled"></select></td> | ||
| 333 | </tr> | ||
| 334 | </table> | ||
| 335 | </td> | ||
| 336 | </tr> | ||
| 337 | </table> | ||
| 338 | </fieldset> | ||
| 339 | </div> | ||
| 340 | |||
| 341 | <div style="float: right; width: 49%"> | ||
| 342 | <fieldset> | ||
| 343 | <legend>{#style_dlg.margin}</legend> | ||
| 344 | |||
| 345 | <table border="0"> | ||
| 346 | <tr> | ||
| 347 | <td> </td> | ||
| 348 | <td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td> | ||
| 349 | </tr> | ||
| 350 | <tr> | ||
| 351 | <td><label for="box_margin_top">{#style_dlg.top}</label></td> | ||
| 352 | <td> | ||
| 353 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 354 | <tr> | ||
| 355 | <td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td> | ||
| 356 | <td> </td> | ||
| 357 | <td><select id="box_margin_top_measurement" name="box_margin_top_measurement"></select></td> | ||
| 358 | </tr> | ||
| 359 | </table> | ||
| 360 | </td> | ||
| 361 | </tr> | ||
| 362 | <tr> | ||
| 363 | <td><label for="box_margin_right">{#style_dlg.right}</label></td> | ||
| 364 | <td> | ||
| 365 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 366 | <tr> | ||
| 367 | <td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 368 | <td> </td> | ||
| 369 | <td><select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled"></select></td> | ||
| 370 | </tr> | ||
| 371 | </table> | ||
| 372 | </td> | ||
| 373 | </tr> | ||
| 374 | <tr> | ||
| 375 | <td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td> | ||
| 376 | <td> | ||
| 377 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 378 | <tr> | ||
| 379 | <td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 380 | <td> </td> | ||
| 381 | <td><select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled"></select></td> | ||
| 382 | </tr> | ||
| 383 | </table> | ||
| 384 | </td> | ||
| 385 | </tr> | ||
| 386 | <tr> | ||
| 387 | <td><label for="box_margin_left">{#style_dlg.left}</label></td> | ||
| 388 | <td> | ||
| 389 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 390 | <tr> | ||
| 391 | <td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 392 | <td> </td> | ||
| 393 | <td><select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled"></select></td> | ||
| 394 | </tr> | ||
| 395 | </table> | ||
| 396 | </td> | ||
| 397 | </tr> | ||
| 398 | </table> | ||
| 399 | </fieldset> | ||
| 400 | </div> | ||
| 401 | <br style="clear: both" /> | ||
| 402 | </div> | ||
| 403 | |||
| 404 | <div id="border_panel" class="panel"> | ||
| 405 | <table border="0" cellspacing="0" cellpadding="0" width="100%"> | ||
| 406 | <tr> | ||
| 407 | <td class="tdelim"> </td> | ||
| 408 | <td class="tdelim delim"> </td> | ||
| 409 | <td class="tdelim">{#style_dlg.style}</td> | ||
| 410 | <td class="tdelim delim"> </td> | ||
| 411 | <td class="tdelim">{#style_dlg.width}</td> | ||
| 412 | <td class="tdelim delim"> </td> | ||
| 413 | <td class="tdelim">{#style_dlg.color}</td> | ||
| 414 | </tr> | ||
| 415 | |||
| 416 | <tr> | ||
| 417 | <td> </td> | ||
| 418 | <td class="delim"> </td> | ||
| 419 | <td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td> | ||
| 420 | <td class="delim"> </td> | ||
| 421 | <td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td> | ||
| 422 | <td class="delim"> </td> | ||
| 423 | <td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td> | ||
| 424 | </tr> | ||
| 425 | |||
| 426 | <tr> | ||
| 427 | <td>{#style_dlg.top}</td> | ||
| 428 | <td class="delim"> </td> | ||
| 429 | <td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td> | ||
| 430 | <td class="delim"> </td> | ||
| 431 | <td> | ||
| 432 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 433 | <tr> | ||
| 434 | <td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td> | ||
| 435 | <td> </td> | ||
| 436 | <td><select id="border_width_top_measurement" name="border_width_top_measurement"></select></td> | ||
| 437 | </tr> | ||
| 438 | </table> | ||
| 439 | </td> | ||
| 440 | <td class="delim"> </td> | ||
| 441 | <td> | ||
| 442 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 443 | <tr> | ||
| 444 | <td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td> | ||
| 445 | <td id="border_color_top_pickcontainer"> </td> | ||
| 446 | </tr> | ||
| 447 | </table> | ||
| 448 | </td> | ||
| 449 | </tr> | ||
| 450 | |||
| 451 | <tr> | ||
| 452 | <td>{#style_dlg.right}</td> | ||
| 453 | <td class="delim"> </td> | ||
| 454 | <td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 455 | <td class="delim"> </td> | ||
| 456 | <td> | ||
| 457 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 458 | <tr> | ||
| 459 | <td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 460 | <td> </td> | ||
| 461 | <td><select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled"></select></td> | ||
| 462 | </tr> | ||
| 463 | </table> | ||
| 464 | </td> | ||
| 465 | <td class="delim"> </td> | ||
| 466 | <td> | ||
| 467 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 468 | <tr> | ||
| 469 | <td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td> | ||
| 470 | <td id="border_color_right_pickcontainer"> </td> | ||
| 471 | </tr> | ||
| 472 | </table> | ||
| 473 | </td> | ||
| 474 | </tr> | ||
| 475 | |||
| 476 | <tr> | ||
| 477 | <td>{#style_dlg.bottom}</td> | ||
| 478 | <td class="delim"> </td> | ||
| 479 | <td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 480 | <td class="delim"> </td> | ||
| 481 | <td> | ||
| 482 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 483 | <tr> | ||
| 484 | <td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 485 | <td> </td> | ||
| 486 | <td><select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled"></select></td> | ||
| 487 | </tr> | ||
| 488 | </table> | ||
| 489 | </td> | ||
| 490 | <td class="delim"> </td> | ||
| 491 | <td> | ||
| 492 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 493 | <tr> | ||
| 494 | <td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td> | ||
| 495 | <td id="border_color_bottom_pickcontainer"> </td> | ||
| 496 | </tr> | ||
| 497 | </table> | ||
| 498 | </td> | ||
| 499 | </tr> | ||
| 500 | |||
| 501 | <tr> | ||
| 502 | <td>{#style_dlg.left}</td> | ||
| 503 | <td class="delim"> </td> | ||
| 504 | <td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 505 | <td class="delim"> </td> | ||
| 506 | <td> | ||
| 507 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 508 | <tr> | ||
| 509 | <td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 510 | <td> </td> | ||
| 511 | <td><select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled"></select></td> | ||
| 512 | </tr> | ||
| 513 | </table> | ||
| 514 | </td> | ||
| 515 | <td class="delim"> </td> | ||
| 516 | <td> | ||
| 517 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 518 | <tr> | ||
| 519 | <td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td> | ||
| 520 | <td id="border_color_left_pickcontainer"> </td> | ||
| 521 | </tr> | ||
| 522 | </table> | ||
| 523 | </td> | ||
| 524 | </tr> | ||
| 525 | </table> | ||
| 526 | </div> | ||
| 527 | |||
| 528 | <div id="list_panel" class="panel"> | ||
| 529 | <table border="0"> | ||
| 530 | <tr> | ||
| 531 | <td><label for="list_type">{#style_dlg.list_type}</label></td> | ||
| 532 | <td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td> | ||
| 533 | </tr> | ||
| 534 | |||
| 535 | <tr> | ||
| 536 | <td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td> | ||
| 537 | <td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td> | ||
| 538 | </tr> | ||
| 539 | |||
| 540 | <tr> | ||
| 541 | <td><label for="list_position">{#style_dlg.position}</label></td> | ||
| 542 | <td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td> | ||
| 543 | </tr> | ||
| 544 | </table> | ||
| 545 | </div> | ||
| 546 | |||
| 547 | <div id="positioning_panel" class="panel"> | ||
| 548 | <table border="0"> | ||
| 549 | <tr> | ||
| 550 | <td><label for="positioning_type">{#style_dlg.positioning_type}</label></td> | ||
| 551 | <td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td> | ||
| 552 | <td> <label for="positioning_visibility">{#style_dlg.visibility}</label></td> | ||
| 553 | <td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td> | ||
| 554 | </tr> | ||
| 555 | |||
| 556 | <tr> | ||
| 557 | <td><label for="positioning_width">{#style_dlg.width}</label></td> | ||
| 558 | <td> | ||
| 559 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 560 | <tr> | ||
| 561 | <td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td> | ||
| 562 | <td> </td> | ||
| 563 | <td><select id="positioning_width_measurement" name="positioning_width_measurement"></select></td> | ||
| 564 | </tr> | ||
| 565 | </table> | ||
| 566 | </td> | ||
| 567 | <td> <label for="positioning_zindex">{#style_dlg.zindex}</label></td> | ||
| 568 | <td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td> | ||
| 569 | </tr> | ||
| 570 | |||
| 571 | <tr> | ||
| 572 | <td><label for="positioning_height">{#style_dlg.height}</label></td> | ||
| 573 | <td> | ||
| 574 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 575 | <tr> | ||
| 576 | <td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td> | ||
| 577 | <td> </td> | ||
| 578 | <td><select id="positioning_height_measurement" name="positioning_height_measurement"></select></td> | ||
| 579 | </tr> | ||
| 580 | </table> | ||
| 581 | </td> | ||
| 582 | <td> <label for="positioning_overflow">{#style_dlg.overflow}</label></td> | ||
| 583 | <td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td> | ||
| 584 | </tr> | ||
| 585 | </table> | ||
| 586 | |||
| 587 | <div style="float: left; width: 49%"> | ||
| 588 | <fieldset> | ||
| 589 | <legend>{#style_dlg.placement}</legend> | ||
| 590 | |||
| 591 | <table border="0"> | ||
| 592 | <tr> | ||
| 593 | <td> </td> | ||
| 594 | <td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td> | ||
| 595 | </tr> | ||
| 596 | <tr> | ||
| 597 | <td>{#style_dlg.top}</td> | ||
| 598 | <td> | ||
| 599 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 600 | <tr> | ||
| 601 | <td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td> | ||
| 602 | <td> </td> | ||
| 603 | <td><select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement"></select></td> | ||
| 604 | </tr> | ||
| 605 | </table> | ||
| 606 | </td> | ||
| 607 | </tr> | ||
| 608 | <tr> | ||
| 609 | <td>{#style_dlg.right}</td> | ||
| 610 | <td> | ||
| 611 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 612 | <tr> | ||
| 613 | <td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td> | ||
| 614 | <td> </td> | ||
| 615 | <td><select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled"></select></td> | ||
| 616 | </tr> | ||
| 617 | </table> | ||
| 618 | </td> | ||
| 619 | </tr> | ||
| 620 | <tr> | ||
| 621 | <td>{#style_dlg.bottom}</td> | ||
| 622 | <td> | ||
| 623 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 624 | <tr> | ||
| 625 | <td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td> | ||
| 626 | <td> </td> | ||
| 627 | <td><select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled"></select></td> | ||
| 628 | </tr> | ||
| 629 | </table> | ||
| 630 | </td> | ||
| 631 | </tr> | ||
| 632 | <tr> | ||
| 633 | <td>{#style_dlg.left}</td> | ||
| 634 | <td> | ||
| 635 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 636 | <tr> | ||
| 637 | <td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td> | ||
| 638 | <td> </td> | ||
| 639 | <td><select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled"></select></td> | ||
| 640 | </tr> | ||
| 641 | </table> | ||
| 642 | </td> | ||
| 643 | </tr> | ||
| 644 | </table> | ||
| 645 | </fieldset> | ||
| 646 | </div> | ||
| 647 | |||
| 648 | <div style="float: right; width: 49%"> | ||
| 649 | <fieldset> | ||
| 650 | <legend>{#style_dlg.clip}</legend> | ||
| 651 | |||
| 652 | <table border="0"> | ||
| 653 | <tr> | ||
| 654 | <td> </td> | ||
| 655 | <td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td> | ||
| 656 | </tr> | ||
| 657 | <tr> | ||
| 658 | <td>{#style_dlg.top}</td> | ||
| 659 | <td> | ||
| 660 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 661 | <tr> | ||
| 662 | <td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td> | ||
| 663 | <td> </td> | ||
| 664 | <td><select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement"></select></td> | ||
| 665 | </tr> | ||
| 666 | </table> | ||
| 667 | </td> | ||
| 668 | </tr> | ||
| 669 | <tr> | ||
| 670 | <td>{#style_dlg.right}</td> | ||
| 671 | <td> | ||
| 672 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 673 | <tr> | ||
| 674 | <td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td> | ||
| 675 | <td> </td> | ||
| 676 | <td><select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled"></select></td> | ||
| 677 | </tr> | ||
| 678 | </table> | ||
| 679 | </td> | ||
| 680 | </tr> | ||
| 681 | <tr> | ||
| 682 | <td>{#style_dlg.bottom}</td> | ||
| 683 | <td> | ||
| 684 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 685 | <tr> | ||
| 686 | <td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td> | ||
| 687 | <td> </td> | ||
| 688 | <td><select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled"></select></td> | ||
| 689 | </tr> | ||
| 690 | </table> | ||
| 691 | </td> | ||
| 692 | </tr> | ||
| 693 | <tr> | ||
| 694 | <td>{#style_dlg.left}</td> | ||
| 695 | <td> | ||
| 696 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 697 | <tr> | ||
| 698 | <td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td> | ||
| 699 | <td> </td> | ||
| 700 | <td><select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled"></select></td> | ||
| 701 | </tr> | ||
| 702 | </table> | ||
| 703 | </td> | ||
| 704 | </tr> | ||
| 705 | </table> | ||
| 706 | </fieldset> | ||
| 707 | </div> | ||
| 708 | <br style="clear: both" /> | ||
| 709 | </div> | ||
| 710 | </div> | ||
| 711 | |||
| 712 | <div class="mceActionPanel"> | ||
| 713 | <div style="float: left"> | ||
| 714 | <div style="float: left"><input type="submit" id="insert" name="insert" value="{#update}" /></div> | ||
| 715 | |||
| 716 | <div style="float: left"> <input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" /></div> | ||
| 717 | <br style="clear: both" /> | ||
| 718 | </div> | ||
| 719 | |||
| 720 | <div style="float: right"> | ||
| 721 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" /> | ||
| 722 | </div> | ||
| 723 | </div> | ||
| 724 | </form> | ||
| 725 | |||
| 726 | <div style="display: none"> | ||
| 727 | <div id="container"></div> | ||
| 728 | </div> | ||
| 729 | |||
| 730 | </body> | ||
| 731 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/cell.htm b/public/javascripts/tiny_mce/plugins/table/cell.htm new file mode 100755 index 0000000..60264db --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/cell.htm | |||
| @@ -0,0 +1,184 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#table_dlg.cell_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/cell.js"></script> | ||
| 10 | <link href="css/cell.css" rel="stylesheet" type="text/css" /> | ||
| 11 | <base target="_self" /> | ||
| 12 | </head> | ||
| 13 | <body id="tablecell" style="display: none"> | ||
| 14 | <form onsubmit="updateAction();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li> | ||
| 18 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="general_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#table_dlg.general_props}</legend> | ||
| 26 | |||
| 27 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 28 | <tr> | ||
| 29 | <td><label for="align">{#table_dlg.align}</label></td> | ||
| 30 | <td> | ||
| 31 | <select id="align" name="align" class="mceFocus"> | ||
| 32 | <option value="">{#not_set}</option> | ||
| 33 | <option value="center">{#table_dlg.align_middle}</option> | ||
| 34 | <option value="left">{#table_dlg.align_left}</option> | ||
| 35 | <option value="right">{#table_dlg.align_right}</option> | ||
| 36 | </select> | ||
| 37 | </td> | ||
| 38 | |||
| 39 | <td><label for="celltype">{#table_dlg.cell_type}</label></td> | ||
| 40 | <td> | ||
| 41 | <select id="celltype" name="celltype"> | ||
| 42 | <option value="td">{#table_dlg.td}</option> | ||
| 43 | <option value="th">{#table_dlg.th}</option> | ||
| 44 | </select> | ||
| 45 | </td> | ||
| 46 | </tr> | ||
| 47 | |||
| 48 | <tr> | ||
| 49 | <td><label for="valign">{#table_dlg.valign}</label></td> | ||
| 50 | <td> | ||
| 51 | <select id="valign" name="valign"> | ||
| 52 | <option value="">{#not_set}</option> | ||
| 53 | <option value="top">{#table_dlg.align_top}</option> | ||
| 54 | <option value="middle">{#table_dlg.align_middle}</option> | ||
| 55 | <option value="bottom">{#table_dlg.align_bottom}</option> | ||
| 56 | </select> | ||
| 57 | </td> | ||
| 58 | |||
| 59 | <td><label for="scope">{#table_dlg.scope}</label></td> | ||
| 60 | <td> | ||
| 61 | <select id="scope" name="scope"> | ||
| 62 | <option value="">{#not_set}</option> | ||
| 63 | <option value="col">{#table.col}</option> | ||
| 64 | <option value="row">{#table.row}</option> | ||
| 65 | <option value="rowgroup">{#table_dlg.rowgroup}</option> | ||
| 66 | <option value="colgroup">{#table_dlg.colgroup}</option> | ||
| 67 | </select> | ||
| 68 | </td> | ||
| 69 | |||
| 70 | </tr> | ||
| 71 | |||
| 72 | <tr> | ||
| 73 | <td><label for="width">{#table_dlg.width}</label></td> | ||
| 74 | <td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td> | ||
| 75 | |||
| 76 | <td><label for="height">{#table_dlg.height}</label></td> | ||
| 77 | <td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td> | ||
| 78 | </tr> | ||
| 79 | |||
| 80 | <tr id="styleSelectRow"> | ||
| 81 | <td><label for="class">{#class_name}</label></td> | ||
| 82 | <td colspan="3"> | ||
| 83 | <select id="class" name="class" class="mceEditableSelect"> | ||
| 84 | <option value="" selected="selected">{#not_set}</option> | ||
| 85 | </select> | ||
| 86 | </td> | ||
| 87 | </tr> | ||
| 88 | </table> | ||
| 89 | </fieldset> | ||
| 90 | </div> | ||
| 91 | |||
| 92 | <div id="advanced_panel" class="panel"> | ||
| 93 | <fieldset> | ||
| 94 | <legend>{#table_dlg.advanced_props}</legend> | ||
| 95 | |||
| 96 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 97 | <tr> | ||
| 98 | <td class="column1"><label for="id">{#table_dlg.id}</label></td> | ||
| 99 | <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> | ||
| 100 | </tr> | ||
| 101 | |||
| 102 | <tr> | ||
| 103 | <td><label for="style">{#table_dlg.style}</label></td> | ||
| 104 | <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td> | ||
| 105 | </tr> | ||
| 106 | |||
| 107 | <tr> | ||
| 108 | <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> | ||
| 109 | <td> | ||
| 110 | <select id="dir" name="dir" style="width: 200px"> | ||
| 111 | <option value="">{#not_set}</option> | ||
| 112 | <option value="ltr">{#table_dlg.ltr}</option> | ||
| 113 | <option value="rtl">{#table_dlg.rtl}</option> | ||
| 114 | </select> | ||
| 115 | </td> | ||
| 116 | </tr> | ||
| 117 | |||
| 118 | <tr> | ||
| 119 | <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> | ||
| 120 | <td> | ||
| 121 | <input id="lang" name="lang" type="text" value="" style="width: 200px" /> | ||
| 122 | </td> | ||
| 123 | </tr> | ||
| 124 | |||
| 125 | <tr> | ||
| 126 | <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> | ||
| 127 | <td> | ||
| 128 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 129 | <tr> | ||
| 130 | <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td> | ||
| 131 | <td id="backgroundimagebrowsercontainer"> </td> | ||
| 132 | </tr> | ||
| 133 | </table> | ||
| 134 | </td> | ||
| 135 | </tr> | ||
| 136 | |||
| 137 | <tr> | ||
| 138 | <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td> | ||
| 139 | <td> | ||
| 140 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 141 | <tr> | ||
| 142 | <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td> | ||
| 143 | <td id="bordercolor_pickcontainer"> </td> | ||
| 144 | </tr> | ||
| 145 | </table> | ||
| 146 | </td> | ||
| 147 | </tr> | ||
| 148 | |||
| 149 | <tr> | ||
| 150 | <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> | ||
| 151 | <td> | ||
| 152 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 153 | <tr> | ||
| 154 | <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td> | ||
| 155 | <td id="bgcolor_pickcontainer"> </td> | ||
| 156 | </tr> | ||
| 157 | </table> | ||
| 158 | </td> | ||
| 159 | </tr> | ||
| 160 | </table> | ||
| 161 | </fieldset> | ||
| 162 | </div> | ||
| 163 | </div> | ||
| 164 | |||
| 165 | <div class="mceActionPanel"> | ||
| 166 | <div> | ||
| 167 | <select id="action" name="action"> | ||
| 168 | <option value="cell">{#table_dlg.cell_cell}</option> | ||
| 169 | <option value="row">{#table_dlg.cell_row}</option> | ||
| 170 | <option value="all">{#table_dlg.cell_all}</option> | ||
| 171 | </select> | ||
| 172 | </div> | ||
| 173 | |||
| 174 | <div style="float: left"> | ||
| 175 | <div><input type="submit" id="insert" name="insert" value="{#update}" /></div> | ||
| 176 | </div> | ||
| 177 | |||
| 178 | <div style="float: right"> | ||
| 179 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 180 | </div> | ||
| 181 | </div> | ||
| 182 | </form> | ||
| 183 | </body> | ||
| 184 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/css/cell.css b/public/javascripts/tiny_mce/plugins/table/css/cell.css new file mode 100755 index 0000000..a067ecd --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/css/cell.css | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* CSS file for cell dialog in the table plugin */ | ||
| 2 | |||
| 3 | .panel_wrapper div.current { | ||
| 4 | height: 200px; | ||
| 5 | } | ||
| 6 | |||
| 7 | .advfield { | ||
| 8 | width: 200px; | ||
| 9 | } | ||
| 10 | |||
| 11 | #action { | ||
| 12 | margin-bottom: 3px; | ||
| 13 | } | ||
| 14 | |||
| 15 | #class { | ||
| 16 | width: 150px; | ||
| 17 | } \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/css/row.css b/public/javascripts/tiny_mce/plugins/table/css/row.css new file mode 100755 index 0000000..1f7755d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/css/row.css | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* CSS file for row dialog in the table plugin */ | ||
| 2 | |||
| 3 | .panel_wrapper div.current { | ||
| 4 | height: 200px; | ||
| 5 | } | ||
| 6 | |||
| 7 | .advfield { | ||
| 8 | width: 200px; | ||
| 9 | } | ||
| 10 | |||
| 11 | #action { | ||
| 12 | margin-bottom: 3px; | ||
| 13 | } | ||
| 14 | |||
| 15 | #rowtype,#align,#valign,#class,#height { | ||
| 16 | width: 150px; | ||
| 17 | } | ||
| 18 | |||
| 19 | #height { | ||
| 20 | width: 50px; | ||
| 21 | } | ||
| 22 | |||
| 23 | .col2 { | ||
| 24 | padding-left: 20px; | ||
| 25 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/css/table.css b/public/javascripts/tiny_mce/plugins/table/css/table.css new file mode 100755 index 0000000..d11c3f6 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/css/table.css | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | /* CSS file for table dialog in the table plugin */ | ||
| 2 | |||
| 3 | .panel_wrapper div.current { | ||
| 4 | height: 245px; | ||
| 5 | } | ||
| 6 | |||
| 7 | .advfield { | ||
| 8 | width: 200px; | ||
| 9 | } | ||
| 10 | |||
| 11 | #class { | ||
| 12 | width: 150px; | ||
| 13 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/editor_plugin.js b/public/javascripts/tiny_mce/plugins/table/editor_plugin.js new file mode 100755 index 0000000..97a9d25 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;each([['table','table.desc','mceInsertTable',true],['delete_table','table.del','mceTableDelete'],['delete_col','table.delete_col_desc','mceTableDeleteCol'],['delete_row','table.delete_row_desc','mceTableDeleteRow'],['col_after','table.col_after_desc','mceTableInsertColAfter'],['col_before','table.col_before_desc','mceTableInsertColBefore'],['row_after','table.row_after_desc','mceTableInsertRowAfter'],['row_before','table.row_before_desc','mceTableInsertRowBefore'],['row_props','table.row_desc','mceTableRowProps',true],['cell_props','table.cell_desc','mceTableCellProps',true],['split_cells','table.split_cells_desc','mceTableSplitCells',true],['merge_cells','table.merge_cells_desc','mceTableMergeCells',true]],function(c){ed.addButton(c[0],{title:c[1],cmd:c[2],ui:c[3]});});if(ed.getParam('inline_styles')){ed.onPreProcess.add(function(ed,o){var dom=ed.dom;each(dom.select('table',o.node),function(n){var v;if(v=dom.getAttrib(n,'width')){dom.setStyle(n,'width',v);dom.setAttrib(n,'width');}if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height');}});});}ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){var sm,se=ed.selection,el=se.getNode()||ed.getBody();if(ed.dom.getParent(e,'td')||ed.dom.getParent(e,'th')){m.removeAll();if(el.nodeName=='A'&&!ed.dom.getAttrib(el,'name')){m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});m.addSeparator();}if(el.nodeName=='IMG'&&el.className.indexOf('mceItem')==-1){m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();}m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true,value:{action:'insert'}});m.add({title:'table.props_desc',icon:'table_props',cmd:'mceInsertTable',ui:true});m.add({title:'table.del',icon:'delete_table',cmd:'mceTableDelete',ui:true});m.addSeparator();sm=m.addMenu({title:'table.cell'});sm.add({title:'table.cell_desc',icon:'cell_props',cmd:'mceTableCellProps',ui:true});sm.add({title:'table.split_cells_desc',icon:'split_cells',cmd:'mceTableSplitCells',ui:true});sm.add({title:'table.merge_cells_desc',icon:'merge_cells',cmd:'mceTableMergeCells',ui:true});sm=m.addMenu({title:'table.row'});sm.add({title:'table.row_desc',icon:'row_props',cmd:'mceTableRowProps',ui:true});sm.add({title:'table.row_before_desc',icon:'row_before',cmd:'mceTableInsertRowBefore'});sm.add({title:'table.row_after_desc',icon:'row_after',cmd:'mceTableInsertRowAfter'});sm.add({title:'table.delete_row_desc',icon:'delete_row',cmd:'mceTableDeleteRow'});sm.addSeparator();sm.add({title:'table.cut_row_desc',icon:'cut',cmd:'mceTableCutRow'});sm.add({title:'table.copy_row_desc',icon:'copy',cmd:'mceTableCopyRow'});sm.add({title:'table.paste_row_before_desc',icon:'paste',cmd:'mceTablePasteRowBefore'});sm.add({title:'table.paste_row_after_desc',icon:'paste',cmd:'mceTablePasteRowAfter'});sm=m.addMenu({title:'table.col'});sm.add({title:'table.col_before_desc',icon:'col_before',cmd:'mceTableInsertColBefore'});sm.add({title:'table.col_after_desc',icon:'col_after',cmd:'mceTableInsertColAfter'});sm.add({title:'table.delete_col_desc',icon:'delete_col',cmd:'mceTableDeleteCol'});}else m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true});});}});ed.onKeyDown.add(function(ed,e){if(e.keyCode==9&&ed.dom.getParent(ed.selection.getNode(),'TABLE')){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(ed.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(e);}ed.undoManager.add();}});if(!tinymce.isIE){if(ed.getParam('table_selection',true)){ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='TABLE')ed.selection.select(e);});}}ed.onNodeChange.add(function(ed,cm,n){var p=ed.dom.getParent(n,'td,th,caption');cm.setActive('table',n.nodeName==='TABLE'||!!p);if(p&&p.nodeName==='CAPTION')p=null;cm.setDisabled('delete_table',!p);cm.setDisabled('delete_col',!p);cm.setDisabled('delete_table',!p);cm.setDisabled('delete_row',!p);cm.setDisabled('col_after',!p);cm.setDisabled('col_before',!p);cm.setDisabled('row_after',!p);cm.setDisabled('row_before',!p);cm.setDisabled('row_props',!p);cm.setDisabled('cell_props',!p);cm.setDisabled('split_cells',!p||(parseInt(ed.dom.getAttrib(p,'colspan','1'))<2&&parseInt(ed.dom.getAttrib(p,'rowspan','1'))<2));cm.setDisabled('merge_cells',!p);});if(!tinymce.isIE){ed.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?'<$1$2> </$1>':'<$1$2><br mce_bogus="1" /></$1>');});}},execCommand:function(cmd,ui,val){var ed=this.editor,b;switch(cmd){case"mceTableMoveToNextRow":case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":ed.execCommand('mceBeginUndoLevel');this._doExecCommand(cmd,ui,val);ed.execCommand('mceEndUndoLevel');return true;}return false;},getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_doExecCommand:function(command,user_interface,value){var inst=this.editor,ed=inst,url=this.url;var focusElm=inst.selection.getNode();var trElm=inst.dom.getParent(focusElm,"tr");var tdElm=inst.dom.getParent(focusElm,"td,th");var tableElm=inst.dom.getParent(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function select(dx,dy){var td;grid=getTableGrid(tableElm);dx=dx||0;dy=dy||0;dx=Math.max(cpos.cellindex+dx,0);dy=Math.max(cpos.rowindex+dy,0);inst.execCommand('mceRepaint');td=getCell(grid,dy,dx);if(td){inst.selection.select(td.firstChild||td);inst.selection.collapse(1);}};function makeTD(){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}function getColRowSpan(td){var colspan=inst.dom.getAttrib(td,"colspan");var rowspan=inst.dom.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){var x,y;for(y=0;y<grid.length;y++){for(x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y};}}return null;}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null;}function getNextCell(table,cell){var cells=[],x=0,i,j,cell,nextCell;for(i=0;i<table.rows.length;i++)for(j=0;j<table.rows[i].cells.length;j++,x++)cells[x]=table.rows[i].cells[j];for(i=0;i<cells.length;i++)if(cells[i]==cell)if(nextCell=cells[i+1])return nextCell;}function getTableGrid(table){var grid=[],rows=table.rows,x,y,td,sd,xstart,x2,y2;for(y=0;y<rows.length;y++){for(x=0;x<rows[y].cells.length;x++){td=rows[y].cells[x];sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=[];for(x2=xstart;x2<xstart+sd['colspan'];x2++)grid[y2][x2]=td;}}}return grid;}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table),cpos=getCellPos(grid,td);var cells,lastElm;if(new_tr.cells.length!=tr.childNodes.length){cells=tr.childNodes;lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true;}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true;}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node;}}return null;}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue;}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';if(tinymce.isIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=inst.dom.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break;}}}if(newTD==null){newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableMoveToNextRow":var nextCell=getNextCell(tableElm,tdElm);if(!nextCell){inst.execCommand("mceTableInsertRowAfter",tdElm);nextCell=getNextCell(tableElm,tdElm);}inst.selection.select(nextCell);inst.selection.collapse(true);return true;case"mceTableRowProps":if(trElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/row.htm',width:400+parseInt(inst.getLang('table.rowprops_delta_width',0)),height:295+parseInt(inst.getLang('table.rowprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/cell.htm',width:400+parseInt(inst.getLang('table.cellprops_delta_width',0)),height:295+parseInt(inst.getLang('table.cellprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceInsertTable":if(user_interface){inst.windowManager.open({url:url+'/table.htm',width:400+parseInt(inst.getLang('table.table_delta_width',0)),height:320+parseInt(inst.getLang('table.table_delta_height',0)),inline:1},{plugin_url:url,action:value?value.action:0});}return true;case"mceTableDelete":var table=inst.dom.getParent(inst.selection.getNode(),"table");if(table){table.parentNode.removeChild(table);inst.execCommand('mceRepaint');}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);select(0,1);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}select(0,1);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);select(0,-1);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(inst.dom.getParent(tableElm,"table"));var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}select();break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(inst.dom.getParent(tableElm,"table"));var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}select(1);break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if((grid.length>1&&grid[0].length<=1)&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}select(-1);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");break;case"mceTableMergeCells":var rows=[];var sel=inst.selection.getSel();var grid=getTableGrid(tableElm);if(tinymce.isIE||sel.rangeCount==1){if(user_interface){var sp=getColRowSpan(tdElm);inst.windowManager.open({url:url+'/merge_cells.htm',width:240+parseInt(inst.getLang('table.merge_cells_delta_width',0)),height:110+parseInt(inst.getLang('table.merge_cells_delta_height',0)),inline:1},{action:"update",numcols:sp.colspan,numrows:sp.rowspan,plugin_url:url});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=[];for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td;}}if(rowCells.length>0)rows[rows.length]=rowCells;var td=getCell(grid,cpos.rowindex,cpos.cellindex);each(ed.dom.select('br',td),function(e,i){if(i>0&&ed.dom.getAttrib('mce_bogus'))ed.dom.remove(e);});}}}else{var cells=[];var sel=inst.selection.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD"||tdElm.nodeName=="TH")cells[cells.length]=tdElm;}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=[];for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td;}}}if(rowCells.length>0)rows[rows.length]=rowCells;}var curRow=[];var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y;}x2=x;y2=y;grid[y][x]._selected=true;}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true;}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true;}lastRowSpan=sd['rowspan'];}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true;}lastColSpan=sd['colspan'];}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=html.replace(/[ \t\r\n]/g,"");if(chk!="<br/>"&&chk!="<br>"&&chk!='<br mce_bogus="1"/>'&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}each(ed.dom.select('br',tdElm),function(e,i){if(i>0&&ed.dom.getAttrib(e,'mce_bogus'))ed.dom.remove(e);});break;}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");inst.addVisual(tableElm);inst.nodeChanged();}return true;}return false;}});tinymce.PluginManager.add('table',tinymce.plugins.TablePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js new file mode 100755 index 0000000..80cf748 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js | |||
| @@ -0,0 +1,1136 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 953 2008-11-04 10:16:50Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var each = tinymce.each; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.TablePlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | t.url = url; | ||
| 17 | |||
| 18 | // Register buttons | ||
| 19 | each([ | ||
| 20 | ['table', 'table.desc', 'mceInsertTable', true], | ||
| 21 | ['delete_table', 'table.del', 'mceTableDelete'], | ||
| 22 | ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], | ||
| 23 | ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], | ||
| 24 | ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], | ||
| 25 | ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], | ||
| 26 | ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], | ||
| 27 | ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], | ||
| 28 | ['row_props', 'table.row_desc', 'mceTableRowProps', true], | ||
| 29 | ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], | ||
| 30 | ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], | ||
| 31 | ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] | ||
| 32 | ], function(c) { | ||
| 33 | ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); | ||
| 34 | }); | ||
| 35 | |||
| 36 | if (ed.getParam('inline_styles')) { | ||
| 37 | // Force move of attribs to styles in strict mode | ||
| 38 | ed.onPreProcess.add(function(ed, o) { | ||
| 39 | var dom = ed.dom; | ||
| 40 | |||
| 41 | each(dom.select('table', o.node), function(n) { | ||
| 42 | var v; | ||
| 43 | |||
| 44 | if (v = dom.getAttrib(n, 'width')) { | ||
| 45 | dom.setStyle(n, 'width', v); | ||
| 46 | dom.setAttrib(n, 'width'); | ||
| 47 | } | ||
| 48 | |||
| 49 | if (v = dom.getAttrib(n, 'height')) { | ||
| 50 | dom.setStyle(n, 'height', v); | ||
| 51 | dom.setAttrib(n, 'height'); | ||
| 52 | } | ||
| 53 | }); | ||
| 54 | }); | ||
| 55 | } | ||
| 56 | |||
| 57 | ed.onInit.add(function() { | ||
| 58 | if (ed && ed.plugins.contextmenu) { | ||
| 59 | ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { | ||
| 60 | var sm, se = ed.selection, el = se.getNode() || ed.getBody(); | ||
| 61 | |||
| 62 | if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th')) { | ||
| 63 | m.removeAll(); | ||
| 64 | |||
| 65 | if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { | ||
| 66 | m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); | ||
| 67 | m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); | ||
| 68 | m.addSeparator(); | ||
| 69 | } | ||
| 70 | |||
| 71 | if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { | ||
| 72 | m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); | ||
| 73 | m.addSeparator(); | ||
| 74 | } | ||
| 75 | |||
| 76 | m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true, value : {action : 'insert'}}); | ||
| 77 | m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable', ui : true}); | ||
| 78 | m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete', ui : true}); | ||
| 79 | m.addSeparator(); | ||
| 80 | |||
| 81 | // Cell menu | ||
| 82 | sm = m.addMenu({title : 'table.cell'}); | ||
| 83 | sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps', ui : true}); | ||
| 84 | sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells', ui : true}); | ||
| 85 | sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells', ui : true}); | ||
| 86 | |||
| 87 | // Row menu | ||
| 88 | sm = m.addMenu({title : 'table.row'}); | ||
| 89 | sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps', ui : true}); | ||
| 90 | sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); | ||
| 91 | sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); | ||
| 92 | sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); | ||
| 93 | sm.addSeparator(); | ||
| 94 | sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); | ||
| 95 | sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); | ||
| 96 | sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}); | ||
| 97 | sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}); | ||
| 98 | |||
| 99 | // Column menu | ||
| 100 | sm = m.addMenu({title : 'table.col'}); | ||
| 101 | sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); | ||
| 102 | sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); | ||
| 103 | sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); | ||
| 104 | } else | ||
| 105 | m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true}); | ||
| 106 | }); | ||
| 107 | } | ||
| 108 | }); | ||
| 109 | |||
| 110 | // Add undo level when new rows are created using the tab key | ||
| 111 | ed.onKeyDown.add(function(ed, e) { | ||
| 112 | if (e.keyCode == 9 && ed.dom.getParent(ed.selection.getNode(), 'TABLE')) { | ||
| 113 | if (!tinymce.isGecko && !tinymce.isOpera) { | ||
| 114 | tinyMCE.execInstanceCommand(ed.editorId, "mceTableMoveToNextRow", true); | ||
| 115 | return tinymce.dom.Event.cancel(e); | ||
| 116 | } | ||
| 117 | |||
| 118 | ed.undoManager.add(); | ||
| 119 | } | ||
| 120 | }); | ||
| 121 | |||
| 122 | // Select whole table is a table border is clicked | ||
| 123 | if (!tinymce.isIE) { | ||
| 124 | if (ed.getParam('table_selection', true)) { | ||
| 125 | ed.onClick.add(function(ed, e) { | ||
| 126 | e = e.target; | ||
| 127 | |||
| 128 | if (e.nodeName === 'TABLE') | ||
| 129 | ed.selection.select(e); | ||
| 130 | }); | ||
| 131 | } | ||
| 132 | } | ||
| 133 | |||
| 134 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 135 | var p = ed.dom.getParent(n, 'td,th,caption'); | ||
| 136 | |||
| 137 | cm.setActive('table', n.nodeName === 'TABLE' || !!p); | ||
| 138 | if (p && p.nodeName === 'CAPTION') | ||
| 139 | p = null; | ||
| 140 | |||
| 141 | cm.setDisabled('delete_table', !p); | ||
| 142 | cm.setDisabled('delete_col', !p); | ||
| 143 | cm.setDisabled('delete_table', !p); | ||
| 144 | cm.setDisabled('delete_row', !p); | ||
| 145 | cm.setDisabled('col_after', !p); | ||
| 146 | cm.setDisabled('col_before', !p); | ||
| 147 | cm.setDisabled('row_after', !p); | ||
| 148 | cm.setDisabled('row_before', !p); | ||
| 149 | cm.setDisabled('row_props', !p); | ||
| 150 | cm.setDisabled('cell_props', !p); | ||
| 151 | cm.setDisabled('split_cells', !p || (parseInt(ed.dom.getAttrib(p, 'colspan', '1')) < 2 && parseInt(ed.dom.getAttrib(p, 'rowspan', '1')) < 2)); | ||
| 152 | cm.setDisabled('merge_cells', !p); | ||
| 153 | }); | ||
| 154 | |||
| 155 | // Padd empty table cells | ||
| 156 | if (!tinymce.isIE) { | ||
| 157 | ed.onBeforeSetContent.add(function(ed, o) { | ||
| 158 | if (o.initial) | ||
| 159 | o.content = o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g, tinymce.isOpera ? '<$1$2> </$1>' : '<$1$2><br mce_bogus="1" /></$1>'); | ||
| 160 | }); | ||
| 161 | } | ||
| 162 | }, | ||
| 163 | |||
| 164 | execCommand : function(cmd, ui, val) { | ||
| 165 | var ed = this.editor, b; | ||
| 166 | |||
| 167 | // Is table command | ||
| 168 | switch (cmd) { | ||
| 169 | case "mceTableMoveToNextRow": | ||
| 170 | case "mceInsertTable": | ||
| 171 | case "mceTableRowProps": | ||
| 172 | case "mceTableCellProps": | ||
| 173 | case "mceTableSplitCells": | ||
| 174 | case "mceTableMergeCells": | ||
| 175 | case "mceTableInsertRowBefore": | ||
| 176 | case "mceTableInsertRowAfter": | ||
| 177 | case "mceTableDeleteRow": | ||
| 178 | case "mceTableInsertColBefore": | ||
| 179 | case "mceTableInsertColAfter": | ||
| 180 | case "mceTableDeleteCol": | ||
| 181 | case "mceTableCutRow": | ||
| 182 | case "mceTableCopyRow": | ||
| 183 | case "mceTablePasteRowBefore": | ||
| 184 | case "mceTablePasteRowAfter": | ||
| 185 | case "mceTableDelete": | ||
| 186 | ed.execCommand('mceBeginUndoLevel'); | ||
| 187 | this._doExecCommand(cmd, ui, val); | ||
| 188 | ed.execCommand('mceEndUndoLevel'); | ||
| 189 | |||
| 190 | return true; | ||
| 191 | } | ||
| 192 | |||
| 193 | // Pass to next handler in chain | ||
| 194 | return false; | ||
| 195 | }, | ||
| 196 | |||
| 197 | getInfo : function() { | ||
| 198 | return { | ||
| 199 | longname : 'Tables', | ||
| 200 | author : 'Moxiecode Systems AB', | ||
| 201 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 202 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table', | ||
| 203 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 204 | }; | ||
| 205 | }, | ||
| 206 | |||
| 207 | // Private plugin internal methods | ||
| 208 | |||
| 209 | /** | ||
| 210 | * Executes the table commands. | ||
| 211 | */ | ||
| 212 | _doExecCommand : function(command, user_interface, value) { | ||
| 213 | var inst = this.editor, ed = inst, url = this.url; | ||
| 214 | var focusElm = inst.selection.getNode(); | ||
| 215 | var trElm = inst.dom.getParent(focusElm, "tr"); | ||
| 216 | var tdElm = inst.dom.getParent(focusElm, "td,th"); | ||
| 217 | var tableElm = inst.dom.getParent(focusElm, "table"); | ||
| 218 | var doc = inst.contentWindow.document; | ||
| 219 | var tableBorder = tableElm ? tableElm.getAttribute("border") : ""; | ||
| 220 | |||
| 221 | // Get first TD if no TD found | ||
| 222 | if (trElm && tdElm == null) | ||
| 223 | tdElm = trElm.cells[0]; | ||
| 224 | |||
| 225 | function inArray(ar, v) { | ||
| 226 | for (var i=0; i<ar.length; i++) { | ||
| 227 | // Is array | ||
| 228 | if (ar[i].length > 0 && inArray(ar[i], v)) | ||
| 229 | return true; | ||
| 230 | |||
| 231 | // Found value | ||
| 232 | if (ar[i] == v) | ||
| 233 | return true; | ||
| 234 | } | ||
| 235 | |||
| 236 | return false; | ||
| 237 | } | ||
| 238 | |||
| 239 | function select(dx, dy) { | ||
| 240 | var td; | ||
| 241 | |||
| 242 | grid = getTableGrid(tableElm); | ||
| 243 | dx = dx || 0; | ||
| 244 | dy = dy || 0; | ||
| 245 | dx = Math.max(cpos.cellindex + dx, 0); | ||
| 246 | dy = Math.max(cpos.rowindex + dy, 0); | ||
| 247 | |||
| 248 | // Recalculate grid and select | ||
| 249 | inst.execCommand('mceRepaint'); | ||
| 250 | td = getCell(grid, dy, dx); | ||
| 251 | |||
| 252 | if (td) { | ||
| 253 | inst.selection.select(td.firstChild || td); | ||
| 254 | inst.selection.collapse(1); | ||
| 255 | } | ||
| 256 | }; | ||
| 257 | |||
| 258 | function makeTD() { | ||
| 259 | var newTD = doc.createElement("td"); | ||
| 260 | |||
| 261 | if (!tinymce.isIE) | ||
| 262 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 263 | } | ||
| 264 | |||
| 265 | function getColRowSpan(td) { | ||
| 266 | var colspan = inst.dom.getAttrib(td, "colspan"); | ||
| 267 | var rowspan = inst.dom.getAttrib(td, "rowspan"); | ||
| 268 | |||
| 269 | colspan = colspan == "" ? 1 : parseInt(colspan); | ||
| 270 | rowspan = rowspan == "" ? 1 : parseInt(rowspan); | ||
| 271 | |||
| 272 | return {colspan : colspan, rowspan : rowspan}; | ||
| 273 | } | ||
| 274 | |||
| 275 | function getCellPos(grid, td) { | ||
| 276 | var x, y; | ||
| 277 | |||
| 278 | for (y=0; y<grid.length; y++) { | ||
| 279 | for (x=0; x<grid[y].length; x++) { | ||
| 280 | if (grid[y][x] == td) | ||
| 281 | return {cellindex : x, rowindex : y}; | ||
| 282 | } | ||
| 283 | } | ||
| 284 | |||
| 285 | return null; | ||
| 286 | } | ||
| 287 | |||
| 288 | function getCell(grid, row, col) { | ||
| 289 | if (grid[row] && grid[row][col]) | ||
| 290 | return grid[row][col]; | ||
| 291 | |||
| 292 | return null; | ||
| 293 | } | ||
| 294 | |||
| 295 | function getNextCell(table, cell) { | ||
| 296 | var cells = [], x = 0, i, j, cell, nextCell; | ||
| 297 | |||
| 298 | for (i = 0; i < table.rows.length; i++) | ||
| 299 | for (j = 0; j < table.rows[i].cells.length; j++, x++) | ||
| 300 | cells[x] = table.rows[i].cells[j]; | ||
| 301 | |||
| 302 | for (i = 0; i < cells.length; i++) | ||
| 303 | if (cells[i] == cell) | ||
| 304 | if (nextCell = cells[i+1]) | ||
| 305 | return nextCell; | ||
| 306 | } | ||
| 307 | |||
| 308 | function getTableGrid(table) { | ||
| 309 | var grid = [], rows = table.rows, x, y, td, sd, xstart, x2, y2; | ||
| 310 | |||
| 311 | for (y=0; y<rows.length; y++) { | ||
| 312 | for (x=0; x<rows[y].cells.length; x++) { | ||
| 313 | td = rows[y].cells[x]; | ||
| 314 | sd = getColRowSpan(td); | ||
| 315 | |||
| 316 | // All ready filled | ||
| 317 | for (xstart = x; grid[y] && grid[y][xstart]; xstart++) ; | ||
| 318 | |||
| 319 | // Fill box | ||
| 320 | for (y2=y; y2<y+sd['rowspan']; y2++) { | ||
| 321 | if (!grid[y2]) | ||
| 322 | grid[y2] = []; | ||
| 323 | |||
| 324 | for (x2=xstart; x2<xstart+sd['colspan']; x2++) | ||
| 325 | grid[y2][x2] = td; | ||
| 326 | } | ||
| 327 | } | ||
| 328 | } | ||
| 329 | |||
| 330 | return grid; | ||
| 331 | } | ||
| 332 | |||
| 333 | function trimRow(table, tr, td, new_tr) { | ||
| 334 | var grid = getTableGrid(table), cpos = getCellPos(grid, td); | ||
| 335 | var cells, lastElm; | ||
| 336 | |||
| 337 | // Time to crop away some | ||
| 338 | if (new_tr.cells.length != tr.childNodes.length) { | ||
| 339 | cells = tr.childNodes; | ||
| 340 | lastElm = null; | ||
| 341 | |||
| 342 | for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) { | ||
| 343 | var remove = true; | ||
| 344 | var sd = getColRowSpan(td); | ||
| 345 | |||
| 346 | // Remove due to rowspan | ||
| 347 | if (inArray(cells, td)) { | ||
| 348 | new_tr.childNodes[x]._delete = true; | ||
| 349 | } else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan | ||
| 350 | for (var i=x; i<x+td.colSpan; i++) | ||
| 351 | new_tr.childNodes[i]._delete = true; | ||
| 352 | } | ||
| 353 | |||
| 354 | if ((lastElm == null || td != lastElm) && sd.rowspan > 1) | ||
| 355 | td.rowSpan = sd.rowspan + 1; | ||
| 356 | |||
| 357 | lastElm = td; | ||
| 358 | } | ||
| 359 | |||
| 360 | deleteMarked(tableElm); | ||
| 361 | } | ||
| 362 | } | ||
| 363 | |||
| 364 | function prevElm(node, name) { | ||
| 365 | while ((node = node.previousSibling) != null) { | ||
| 366 | if (node.nodeName == name) | ||
| 367 | return node; | ||
| 368 | } | ||
| 369 | |||
| 370 | return null; | ||
| 371 | } | ||
| 372 | |||
| 373 | function nextElm(node, names) { | ||
| 374 | var namesAr = names.split(','); | ||
| 375 | |||
| 376 | while ((node = node.nextSibling) != null) { | ||
| 377 | for (var i=0; i<namesAr.length; i++) { | ||
| 378 | if (node.nodeName.toLowerCase() == namesAr[i].toLowerCase() ) | ||
| 379 | return node; | ||
| 380 | } | ||
| 381 | } | ||
| 382 | |||
| 383 | return null; | ||
| 384 | } | ||
| 385 | |||
| 386 | function deleteMarked(tbl) { | ||
| 387 | if (tbl.rows == 0) | ||
| 388 | return; | ||
| 389 | |||
| 390 | var tr = tbl.rows[0]; | ||
| 391 | do { | ||
| 392 | var next = nextElm(tr, "TR"); | ||
| 393 | |||
| 394 | // Delete row | ||
| 395 | if (tr._delete) { | ||
| 396 | tr.parentNode.removeChild(tr); | ||
| 397 | continue; | ||
| 398 | } | ||
| 399 | |||
| 400 | // Delete cells | ||
| 401 | var td = tr.cells[0]; | ||
| 402 | if (td.cells > 1) { | ||
| 403 | do { | ||
| 404 | var nexttd = nextElm(td, "TD,TH"); | ||
| 405 | |||
| 406 | if (td._delete) | ||
| 407 | td.parentNode.removeChild(td); | ||
| 408 | } while ((td = nexttd) != null); | ||
| 409 | } | ||
| 410 | } while ((tr = next) != null); | ||
| 411 | } | ||
| 412 | |||
| 413 | function addRows(td_elm, tr_elm, rowspan) { | ||
| 414 | // Add rows | ||
| 415 | td_elm.rowSpan = 1; | ||
| 416 | var trNext = nextElm(tr_elm, "TR"); | ||
| 417 | for (var i=1; i<rowspan && trNext; i++) { | ||
| 418 | var newTD = doc.createElement("td"); | ||
| 419 | |||
| 420 | if (!tinymce.isIE) | ||
| 421 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 422 | |||
| 423 | if (tinymce.isIE) | ||
| 424 | trNext.insertBefore(newTD, trNext.cells(td_elm.cellIndex)); | ||
| 425 | else | ||
| 426 | trNext.insertBefore(newTD, trNext.cells[td_elm.cellIndex]); | ||
| 427 | |||
| 428 | trNext = nextElm(trNext, "TR"); | ||
| 429 | } | ||
| 430 | } | ||
| 431 | |||
| 432 | function copyRow(doc, table, tr) { | ||
| 433 | var grid = getTableGrid(table); | ||
| 434 | var newTR = tr.cloneNode(false); | ||
| 435 | var cpos = getCellPos(grid, tr.cells[0]); | ||
| 436 | var lastCell = null; | ||
| 437 | var tableBorder = inst.dom.getAttrib(table, "border"); | ||
| 438 | var tdElm = null; | ||
| 439 | |||
| 440 | for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { | ||
| 441 | var newTD = null; | ||
| 442 | |||
| 443 | if (lastCell != tdElm) { | ||
| 444 | for (var i=0; i<tr.cells.length; i++) { | ||
| 445 | if (tdElm == tr.cells[i]) { | ||
| 446 | newTD = tdElm.cloneNode(true); | ||
| 447 | break; | ||
| 448 | } | ||
| 449 | } | ||
| 450 | } | ||
| 451 | |||
| 452 | if (newTD == null) { | ||
| 453 | newTD = doc.createElement("td"); | ||
| 454 | |||
| 455 | if (!tinymce.isIE) | ||
| 456 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 457 | } | ||
| 458 | |||
| 459 | // Reset col/row span | ||
| 460 | newTD.colSpan = 1; | ||
| 461 | newTD.rowSpan = 1; | ||
| 462 | |||
| 463 | newTR.appendChild(newTD); | ||
| 464 | |||
| 465 | lastCell = tdElm; | ||
| 466 | } | ||
| 467 | |||
| 468 | return newTR; | ||
| 469 | } | ||
| 470 | |||
| 471 | // ---- Commands ----- | ||
| 472 | |||
| 473 | // Handle commands | ||
| 474 | switch (command) { | ||
| 475 | case "mceTableMoveToNextRow": | ||
| 476 | var nextCell = getNextCell(tableElm, tdElm); | ||
| 477 | |||
| 478 | if (!nextCell) { | ||
| 479 | inst.execCommand("mceTableInsertRowAfter", tdElm); | ||
| 480 | nextCell = getNextCell(tableElm, tdElm); | ||
| 481 | } | ||
| 482 | |||
| 483 | inst.selection.select(nextCell); | ||
| 484 | inst.selection.collapse(true); | ||
| 485 | |||
| 486 | return true; | ||
| 487 | |||
| 488 | case "mceTableRowProps": | ||
| 489 | if (trElm == null) | ||
| 490 | return true; | ||
| 491 | |||
| 492 | if (user_interface) { | ||
| 493 | inst.windowManager.open({ | ||
| 494 | url : url + '/row.htm', | ||
| 495 | width : 400 + parseInt(inst.getLang('table.rowprops_delta_width', 0)), | ||
| 496 | height : 295 + parseInt(inst.getLang('table.rowprops_delta_height', 0)), | ||
| 497 | inline : 1 | ||
| 498 | }, { | ||
| 499 | plugin_url : url | ||
| 500 | }); | ||
| 501 | } | ||
| 502 | |||
| 503 | return true; | ||
| 504 | |||
| 505 | case "mceTableCellProps": | ||
| 506 | if (tdElm == null) | ||
| 507 | return true; | ||
| 508 | |||
| 509 | if (user_interface) { | ||
| 510 | inst.windowManager.open({ | ||
| 511 | url : url + '/cell.htm', | ||
| 512 | width : 400 + parseInt(inst.getLang('table.cellprops_delta_width', 0)), | ||
| 513 | height : 295 + parseInt(inst.getLang('table.cellprops_delta_height', 0)), | ||
| 514 | inline : 1 | ||
| 515 | }, { | ||
| 516 | plugin_url : url | ||
| 517 | }); | ||
| 518 | } | ||
| 519 | |||
| 520 | return true; | ||
| 521 | |||
| 522 | case "mceInsertTable": | ||
| 523 | if (user_interface) { | ||
| 524 | inst.windowManager.open({ | ||
| 525 | url : url + '/table.htm', | ||
| 526 | width : 400 + parseInt(inst.getLang('table.table_delta_width', 0)), | ||
| 527 | height : 320 + parseInt(inst.getLang('table.table_delta_height', 0)), | ||
| 528 | inline : 1 | ||
| 529 | }, { | ||
| 530 | plugin_url : url, | ||
| 531 | action : value ? value.action : 0 | ||
| 532 | }); | ||
| 533 | } | ||
| 534 | |||
| 535 | return true; | ||
| 536 | |||
| 537 | case "mceTableDelete": | ||
| 538 | var table = inst.dom.getParent(inst.selection.getNode(), "table"); | ||
| 539 | if (table) { | ||
| 540 | table.parentNode.removeChild(table); | ||
| 541 | inst.execCommand('mceRepaint'); | ||
| 542 | } | ||
| 543 | return true; | ||
| 544 | |||
| 545 | case "mceTableSplitCells": | ||
| 546 | case "mceTableMergeCells": | ||
| 547 | case "mceTableInsertRowBefore": | ||
| 548 | case "mceTableInsertRowAfter": | ||
| 549 | case "mceTableDeleteRow": | ||
| 550 | case "mceTableInsertColBefore": | ||
| 551 | case "mceTableInsertColAfter": | ||
| 552 | case "mceTableDeleteCol": | ||
| 553 | case "mceTableCutRow": | ||
| 554 | case "mceTableCopyRow": | ||
| 555 | case "mceTablePasteRowBefore": | ||
| 556 | case "mceTablePasteRowAfter": | ||
| 557 | // No table just return (invalid command) | ||
| 558 | if (!tableElm) | ||
| 559 | return true; | ||
| 560 | |||
| 561 | // Table has a tbody use that reference | ||
| 562 | // Changed logic by ApTest 2005.07.12 (www.aptest.com) | ||
| 563 | // Now lookk at the focused element and take its parentNode. That will be a tbody or a table. | ||
| 564 | if (trElm && tableElm != trElm.parentNode) | ||
| 565 | tableElm = trElm.parentNode; | ||
| 566 | |||
| 567 | if (tableElm && trElm) { | ||
| 568 | switch (command) { | ||
| 569 | case "mceTableCutRow": | ||
| 570 | if (!trElm || !tdElm) | ||
| 571 | return true; | ||
| 572 | |||
| 573 | inst.tableRowClipboard = copyRow(doc, tableElm, trElm); | ||
| 574 | inst.execCommand("mceTableDeleteRow"); | ||
| 575 | break; | ||
| 576 | |||
| 577 | case "mceTableCopyRow": | ||
| 578 | if (!trElm || !tdElm) | ||
| 579 | return true; | ||
| 580 | |||
| 581 | inst.tableRowClipboard = copyRow(doc, tableElm, trElm); | ||
| 582 | break; | ||
| 583 | |||
| 584 | case "mceTablePasteRowBefore": | ||
| 585 | if (!trElm || !tdElm) | ||
| 586 | return true; | ||
| 587 | |||
| 588 | var newTR = inst.tableRowClipboard.cloneNode(true); | ||
| 589 | |||
| 590 | var prevTR = prevElm(trElm, "TR"); | ||
| 591 | if (prevTR != null) | ||
| 592 | trimRow(tableElm, prevTR, prevTR.cells[0], newTR); | ||
| 593 | |||
| 594 | trElm.parentNode.insertBefore(newTR, trElm); | ||
| 595 | break; | ||
| 596 | |||
| 597 | case "mceTablePasteRowAfter": | ||
| 598 | if (!trElm || !tdElm) | ||
| 599 | return true; | ||
| 600 | |||
| 601 | var nextTR = nextElm(trElm, "TR"); | ||
| 602 | var newTR = inst.tableRowClipboard.cloneNode(true); | ||
| 603 | |||
| 604 | trimRow(tableElm, trElm, tdElm, newTR); | ||
| 605 | |||
| 606 | if (nextTR == null) | ||
| 607 | trElm.parentNode.appendChild(newTR); | ||
| 608 | else | ||
| 609 | nextTR.parentNode.insertBefore(newTR, nextTR); | ||
| 610 | |||
| 611 | break; | ||
| 612 | |||
| 613 | case "mceTableInsertRowBefore": | ||
| 614 | if (!trElm || !tdElm) | ||
| 615 | return true; | ||
| 616 | |||
| 617 | var grid = getTableGrid(tableElm); | ||
| 618 | var cpos = getCellPos(grid, tdElm); | ||
| 619 | var newTR = doc.createElement("tr"); | ||
| 620 | var lastTDElm = null; | ||
| 621 | |||
| 622 | cpos.rowindex--; | ||
| 623 | if (cpos.rowindex < 0) | ||
| 624 | cpos.rowindex = 0; | ||
| 625 | |||
| 626 | // Create cells | ||
| 627 | for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { | ||
| 628 | if (tdElm != lastTDElm) { | ||
| 629 | var sd = getColRowSpan(tdElm); | ||
| 630 | |||
| 631 | if (sd['rowspan'] == 1) { | ||
| 632 | var newTD = doc.createElement("td"); | ||
| 633 | |||
| 634 | if (!tinymce.isIE) | ||
| 635 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 636 | |||
| 637 | newTD.colSpan = tdElm.colSpan; | ||
| 638 | |||
| 639 | newTR.appendChild(newTD); | ||
| 640 | } else | ||
| 641 | tdElm.rowSpan = sd['rowspan'] + 1; | ||
| 642 | |||
| 643 | lastTDElm = tdElm; | ||
| 644 | } | ||
| 645 | } | ||
| 646 | |||
| 647 | trElm.parentNode.insertBefore(newTR, trElm); | ||
| 648 | select(0, 1); | ||
| 649 | break; | ||
| 650 | |||
| 651 | case "mceTableInsertRowAfter": | ||
| 652 | if (!trElm || !tdElm) | ||
| 653 | return true; | ||
| 654 | |||
| 655 | var grid = getTableGrid(tableElm); | ||
| 656 | var cpos = getCellPos(grid, tdElm); | ||
| 657 | var newTR = doc.createElement("tr"); | ||
| 658 | var lastTDElm = null; | ||
| 659 | |||
| 660 | // Create cells | ||
| 661 | for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { | ||
| 662 | if (tdElm != lastTDElm) { | ||
| 663 | var sd = getColRowSpan(tdElm); | ||
| 664 | |||
| 665 | if (sd['rowspan'] == 1) { | ||
| 666 | var newTD = doc.createElement("td"); | ||
| 667 | |||
| 668 | if (!tinymce.isIE) | ||
| 669 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 670 | |||
| 671 | newTD.colSpan = tdElm.colSpan; | ||
| 672 | |||
| 673 | newTR.appendChild(newTD); | ||
| 674 | } else | ||
| 675 | tdElm.rowSpan = sd['rowspan'] + 1; | ||
| 676 | |||
| 677 | lastTDElm = tdElm; | ||
| 678 | } | ||
| 679 | } | ||
| 680 | |||
| 681 | if (newTR.hasChildNodes()) { | ||
| 682 | var nextTR = nextElm(trElm, "TR"); | ||
| 683 | if (nextTR) | ||
| 684 | nextTR.parentNode.insertBefore(newTR, nextTR); | ||
| 685 | else | ||
| 686 | tableElm.appendChild(newTR); | ||
| 687 | } | ||
| 688 | |||
| 689 | select(0, 1); | ||
| 690 | break; | ||
| 691 | |||
| 692 | case "mceTableDeleteRow": | ||
| 693 | if (!trElm || !tdElm) | ||
| 694 | return true; | ||
| 695 | |||
| 696 | var grid = getTableGrid(tableElm); | ||
| 697 | var cpos = getCellPos(grid, tdElm); | ||
| 698 | |||
| 699 | // Only one row, remove whole table | ||
| 700 | if (grid.length == 1 && tableElm.nodeName == 'TBODY') { | ||
| 701 | inst.dom.remove(inst.dom.getParent(tableElm, "table")); | ||
| 702 | return true; | ||
| 703 | } | ||
| 704 | |||
| 705 | // Move down row spanned cells | ||
| 706 | var cells = trElm.cells; | ||
| 707 | var nextTR = nextElm(trElm, "TR"); | ||
| 708 | for (var x=0; x<cells.length; x++) { | ||
| 709 | if (cells[x].rowSpan > 1) { | ||
| 710 | var newTD = cells[x].cloneNode(true); | ||
| 711 | var sd = getColRowSpan(cells[x]); | ||
| 712 | |||
| 713 | newTD.rowSpan = sd.rowspan - 1; | ||
| 714 | |||
| 715 | var nextTD = nextTR.cells[x]; | ||
| 716 | |||
| 717 | if (nextTD == null) | ||
| 718 | nextTR.appendChild(newTD); | ||
| 719 | else | ||
| 720 | nextTR.insertBefore(newTD, nextTD); | ||
| 721 | } | ||
| 722 | } | ||
| 723 | |||
| 724 | // Delete cells | ||
| 725 | var lastTDElm = null; | ||
| 726 | for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { | ||
| 727 | if (tdElm != lastTDElm) { | ||
| 728 | var sd = getColRowSpan(tdElm); | ||
| 729 | |||
| 730 | if (sd.rowspan > 1) { | ||
| 731 | tdElm.rowSpan = sd.rowspan - 1; | ||
| 732 | } else { | ||
| 733 | trElm = tdElm.parentNode; | ||
| 734 | |||
| 735 | if (trElm.parentNode) | ||
| 736 | trElm._delete = true; | ||
| 737 | } | ||
| 738 | |||
| 739 | lastTDElm = tdElm; | ||
| 740 | } | ||
| 741 | } | ||
| 742 | |||
| 743 | deleteMarked(tableElm); | ||
| 744 | |||
| 745 | select(0, -1); | ||
| 746 | break; | ||
| 747 | |||
| 748 | case "mceTableInsertColBefore": | ||
| 749 | if (!trElm || !tdElm) | ||
| 750 | return true; | ||
| 751 | |||
| 752 | var grid = getTableGrid(inst.dom.getParent(tableElm, "table")); | ||
| 753 | var cpos = getCellPos(grid, tdElm); | ||
| 754 | var lastTDElm = null; | ||
| 755 | |||
| 756 | for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { | ||
| 757 | if (tdElm != lastTDElm) { | ||
| 758 | var sd = getColRowSpan(tdElm); | ||
| 759 | |||
| 760 | if (sd['colspan'] == 1) { | ||
| 761 | var newTD = doc.createElement(tdElm.nodeName); | ||
| 762 | |||
| 763 | if (!tinymce.isIE) | ||
| 764 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 765 | |||
| 766 | newTD.rowSpan = tdElm.rowSpan; | ||
| 767 | |||
| 768 | tdElm.parentNode.insertBefore(newTD, tdElm); | ||
| 769 | } else | ||
| 770 | tdElm.colSpan++; | ||
| 771 | |||
| 772 | lastTDElm = tdElm; | ||
| 773 | } | ||
| 774 | } | ||
| 775 | |||
| 776 | select(); | ||
| 777 | break; | ||
| 778 | |||
| 779 | case "mceTableInsertColAfter": | ||
| 780 | if (!trElm || !tdElm) | ||
| 781 | return true; | ||
| 782 | |||
| 783 | var grid = getTableGrid(inst.dom.getParent(tableElm, "table")); | ||
| 784 | var cpos = getCellPos(grid, tdElm); | ||
| 785 | var lastTDElm = null; | ||
| 786 | |||
| 787 | for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { | ||
| 788 | if (tdElm != lastTDElm) { | ||
| 789 | var sd = getColRowSpan(tdElm); | ||
| 790 | |||
| 791 | if (sd['colspan'] == 1) { | ||
| 792 | var newTD = doc.createElement(tdElm.nodeName); | ||
| 793 | |||
| 794 | if (!tinymce.isIE) | ||
| 795 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 796 | |||
| 797 | newTD.rowSpan = tdElm.rowSpan; | ||
| 798 | |||
| 799 | var nextTD = nextElm(tdElm, "TD,TH"); | ||
| 800 | if (nextTD == null) | ||
| 801 | tdElm.parentNode.appendChild(newTD); | ||
| 802 | else | ||
| 803 | nextTD.parentNode.insertBefore(newTD, nextTD); | ||
| 804 | } else | ||
| 805 | tdElm.colSpan++; | ||
| 806 | |||
| 807 | lastTDElm = tdElm; | ||
| 808 | } | ||
| 809 | } | ||
| 810 | |||
| 811 | select(1); | ||
| 812 | break; | ||
| 813 | |||
| 814 | case "mceTableDeleteCol": | ||
| 815 | if (!trElm || !tdElm) | ||
| 816 | return true; | ||
| 817 | |||
| 818 | var grid = getTableGrid(tableElm); | ||
| 819 | var cpos = getCellPos(grid, tdElm); | ||
| 820 | var lastTDElm = null; | ||
| 821 | |||
| 822 | // Only one col, remove whole table | ||
| 823 | if ((grid.length > 1 && grid[0].length <= 1) && tableElm.nodeName == 'TBODY') { | ||
| 824 | inst.dom.remove(inst.dom.getParent(tableElm, "table")); | ||
| 825 | return true; | ||
| 826 | } | ||
| 827 | |||
| 828 | // Delete cells | ||
| 829 | for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { | ||
| 830 | if (tdElm != lastTDElm) { | ||
| 831 | var sd = getColRowSpan(tdElm); | ||
| 832 | |||
| 833 | if (sd['colspan'] > 1) | ||
| 834 | tdElm.colSpan = sd['colspan'] - 1; | ||
| 835 | else { | ||
| 836 | if (tdElm.parentNode) | ||
| 837 | tdElm.parentNode.removeChild(tdElm); | ||
| 838 | } | ||
| 839 | |||
| 840 | lastTDElm = tdElm; | ||
| 841 | } | ||
| 842 | } | ||
| 843 | |||
| 844 | select(-1); | ||
| 845 | break; | ||
| 846 | |||
| 847 | case "mceTableSplitCells": | ||
| 848 | if (!trElm || !tdElm) | ||
| 849 | return true; | ||
| 850 | |||
| 851 | var spandata = getColRowSpan(tdElm); | ||
| 852 | |||
| 853 | var colspan = spandata["colspan"]; | ||
| 854 | var rowspan = spandata["rowspan"]; | ||
| 855 | |||
| 856 | // Needs splitting | ||
| 857 | if (colspan > 1 || rowspan > 1) { | ||
| 858 | // Generate cols | ||
| 859 | tdElm.colSpan = 1; | ||
| 860 | for (var i=1; i<colspan; i++) { | ||
| 861 | var newTD = doc.createElement("td"); | ||
| 862 | |||
| 863 | if (!tinymce.isIE) | ||
| 864 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 865 | |||
| 866 | trElm.insertBefore(newTD, nextElm(tdElm, "TD,TH")); | ||
| 867 | |||
| 868 | if (rowspan > 1) | ||
| 869 | addRows(newTD, trElm, rowspan); | ||
| 870 | } | ||
| 871 | |||
| 872 | addRows(tdElm, trElm, rowspan); | ||
| 873 | } | ||
| 874 | |||
| 875 | // Apply visual aids | ||
| 876 | tableElm = inst.dom.getParent(inst.selection.getNode(), "table"); | ||
| 877 | break; | ||
| 878 | |||
| 879 | case "mceTableMergeCells": | ||
| 880 | var rows = []; | ||
| 881 | var sel = inst.selection.getSel(); | ||
| 882 | var grid = getTableGrid(tableElm); | ||
| 883 | |||
| 884 | if (tinymce.isIE || sel.rangeCount == 1) { | ||
| 885 | if (user_interface) { | ||
| 886 | // Setup template | ||
| 887 | var sp = getColRowSpan(tdElm); | ||
| 888 | |||
| 889 | inst.windowManager.open({ | ||
| 890 | url : url + '/merge_cells.htm', | ||
| 891 | width : 240 + parseInt(inst.getLang('table.merge_cells_delta_width', 0)), | ||
| 892 | height : 110 + parseInt(inst.getLang('table.merge_cells_delta_height', 0)), | ||
| 893 | inline : 1 | ||
| 894 | }, { | ||
| 895 | action : "update", | ||
| 896 | numcols : sp.colspan, | ||
| 897 | numrows : sp.rowspan, | ||
| 898 | plugin_url : url | ||
| 899 | }); | ||
| 900 | |||
| 901 | return true; | ||
| 902 | } else { | ||
| 903 | var numRows = parseInt(value['numrows']); | ||
| 904 | var numCols = parseInt(value['numcols']); | ||
| 905 | var cpos = getCellPos(grid, tdElm); | ||
| 906 | |||
| 907 | if (("" + numRows) == "NaN") | ||
| 908 | numRows = 1; | ||
| 909 | |||
| 910 | if (("" + numCols) == "NaN") | ||
| 911 | numCols = 1; | ||
| 912 | |||
| 913 | // Get rows and cells | ||
| 914 | var tRows = tableElm.rows; | ||
| 915 | for (var y=cpos.rowindex; y<grid.length; y++) { | ||
| 916 | var rowCells = []; | ||
| 917 | |||
| 918 | for (var x=cpos.cellindex; x<grid[y].length; x++) { | ||
| 919 | var td = getCell(grid, y, x); | ||
| 920 | |||
| 921 | if (td && !inArray(rows, td) && !inArray(rowCells, td)) { | ||
| 922 | var cp = getCellPos(grid, td); | ||
| 923 | |||
| 924 | // Within range | ||
| 925 | if (cp.cellindex < cpos.cellindex+numCols && cp.rowindex < cpos.rowindex+numRows) | ||
| 926 | rowCells[rowCells.length] = td; | ||
| 927 | } | ||
| 928 | } | ||
| 929 | |||
| 930 | if (rowCells.length > 0) | ||
| 931 | rows[rows.length] = rowCells; | ||
| 932 | |||
| 933 | var td = getCell(grid, cpos.rowindex, cpos.cellindex); | ||
| 934 | each(ed.dom.select('br', td), function(e, i) { | ||
| 935 | if (i > 0 && ed.dom.getAttrib('mce_bogus')) | ||
| 936 | ed.dom.remove(e); | ||
| 937 | }); | ||
| 938 | } | ||
| 939 | |||
| 940 | //return true; | ||
| 941 | } | ||
| 942 | } else { | ||
| 943 | var cells = []; | ||
| 944 | var sel = inst.selection.getSel(); | ||
| 945 | var lastTR = null; | ||
| 946 | var curRow = null; | ||
| 947 | var x1 = -1, y1 = -1, x2, y2; | ||
| 948 | |||
| 949 | // Only one cell selected, whats the point? | ||
| 950 | if (sel.rangeCount < 2) | ||
| 951 | return true; | ||
| 952 | |||
| 953 | // Get all selected cells | ||
| 954 | for (var i=0; i<sel.rangeCount; i++) { | ||
| 955 | var rng = sel.getRangeAt(i); | ||
| 956 | var tdElm = rng.startContainer.childNodes[rng.startOffset]; | ||
| 957 | |||
| 958 | if (!tdElm) | ||
| 959 | break; | ||
| 960 | |||
| 961 | if (tdElm.nodeName == "TD" || tdElm.nodeName == "TH") | ||
| 962 | cells[cells.length] = tdElm; | ||
| 963 | } | ||
| 964 | |||
| 965 | // Get rows and cells | ||
| 966 | var tRows = tableElm.rows; | ||
| 967 | for (var y=0; y<tRows.length; y++) { | ||
| 968 | var rowCells = []; | ||
| 969 | |||
| 970 | for (var x=0; x<tRows[y].cells.length; x++) { | ||
| 971 | var td = tRows[y].cells[x]; | ||
| 972 | |||
| 973 | for (var i=0; i<cells.length; i++) { | ||
| 974 | if (td == cells[i]) { | ||
| 975 | rowCells[rowCells.length] = td; | ||
| 976 | } | ||
| 977 | } | ||
| 978 | } | ||
| 979 | |||
| 980 | if (rowCells.length > 0) | ||
| 981 | rows[rows.length] = rowCells; | ||
| 982 | } | ||
| 983 | |||
| 984 | // Find selected cells in grid and box | ||
| 985 | var curRow = []; | ||
| 986 | var lastTR = null; | ||
| 987 | for (var y=0; y<grid.length; y++) { | ||
| 988 | for (var x=0; x<grid[y].length; x++) { | ||
| 989 | grid[y][x]._selected = false; | ||
| 990 | |||
| 991 | for (var i=0; i<cells.length; i++) { | ||
| 992 | if (grid[y][x] == cells[i]) { | ||
| 993 | // Get start pos | ||
| 994 | if (x1 == -1) { | ||
| 995 | x1 = x; | ||
| 996 | y1 = y; | ||
| 997 | } | ||
| 998 | |||
| 999 | // Get end pos | ||
| 1000 | x2 = x; | ||
| 1001 | y2 = y; | ||
| 1002 | |||
| 1003 | grid[y][x]._selected = true; | ||
| 1004 | } | ||
| 1005 | } | ||
| 1006 | } | ||
| 1007 | } | ||
| 1008 | |||
| 1009 | // Is there gaps, if so deny | ||
| 1010 | for (var y=y1; y<=y2; y++) { | ||
| 1011 | for (var x=x1; x<=x2; x++) { | ||
| 1012 | if (!grid[y][x]._selected) { | ||
| 1013 | alert("Invalid selection for merge."); | ||
| 1014 | return true; | ||
| 1015 | } | ||
| 1016 | } | ||
| 1017 | } | ||
| 1018 | } | ||
| 1019 | |||
| 1020 | // Validate selection and get total rowspan and colspan | ||
| 1021 | var rowSpan = 1, colSpan = 1; | ||
| 1022 | |||
| 1023 | // Validate horizontal and get total colspan | ||
| 1024 | var lastRowSpan = -1; | ||
| 1025 | for (var y=0; y<rows.length; y++) { | ||
| 1026 | var rowColSpan = 0; | ||
| 1027 | |||
| 1028 | for (var x=0; x<rows[y].length; x++) { | ||
| 1029 | var sd = getColRowSpan(rows[y][x]); | ||
| 1030 | |||
| 1031 | rowColSpan += sd['colspan']; | ||
| 1032 | |||
| 1033 | if (lastRowSpan != -1 && sd['rowspan'] != lastRowSpan) { | ||
| 1034 | alert("Invalid selection for merge."); | ||
| 1035 | return true; | ||
| 1036 | } | ||
| 1037 | |||
| 1038 | lastRowSpan = sd['rowspan']; | ||
| 1039 | } | ||
| 1040 | |||
| 1041 | if (rowColSpan > colSpan) | ||
| 1042 | colSpan = rowColSpan; | ||
| 1043 | |||
| 1044 | lastRowSpan = -1; | ||
| 1045 | } | ||
| 1046 | |||
| 1047 | // Validate vertical and get total rowspan | ||
| 1048 | var lastColSpan = -1; | ||
| 1049 | for (var x=0; x<rows[0].length; x++) { | ||
| 1050 | var colRowSpan = 0; | ||
| 1051 | |||
| 1052 | for (var y=0; y<rows.length; y++) { | ||
| 1053 | var sd = getColRowSpan(rows[y][x]); | ||
| 1054 | |||
| 1055 | colRowSpan += sd['rowspan']; | ||
| 1056 | |||
| 1057 | if (lastColSpan != -1 && sd['colspan'] != lastColSpan) { | ||
| 1058 | alert("Invalid selection for merge."); | ||
| 1059 | return true; | ||
| 1060 | } | ||
| 1061 | |||
| 1062 | lastColSpan = sd['colspan']; | ||
| 1063 | } | ||
| 1064 | |||
| 1065 | if (colRowSpan > rowSpan) | ||
| 1066 | rowSpan = colRowSpan; | ||
| 1067 | |||
| 1068 | lastColSpan = -1; | ||
| 1069 | } | ||
| 1070 | |||
| 1071 | // Setup td | ||
| 1072 | tdElm = rows[0][0]; | ||
| 1073 | tdElm.rowSpan = rowSpan; | ||
| 1074 | tdElm.colSpan = colSpan; | ||
| 1075 | |||
| 1076 | // Merge cells | ||
| 1077 | for (var y=0; y<rows.length; y++) { | ||
| 1078 | for (var x=0; x<rows[y].length; x++) { | ||
| 1079 | var html = rows[y][x].innerHTML; | ||
| 1080 | var chk = html.replace(/[ \t\r\n]/g, ""); | ||
| 1081 | |||
| 1082 | if (chk != "<br/>" && chk != "<br>" && chk != '<br mce_bogus="1"/>' && (x+y > 0)) | ||
| 1083 | tdElm.innerHTML += html; | ||
| 1084 | |||
| 1085 | // Not current cell | ||
| 1086 | if (rows[y][x] != tdElm && !rows[y][x]._deleted) { | ||
| 1087 | var cpos = getCellPos(grid, rows[y][x]); | ||
| 1088 | var tr = rows[y][x].parentNode; | ||
| 1089 | |||
| 1090 | tr.removeChild(rows[y][x]); | ||
| 1091 | rows[y][x]._deleted = true; | ||
| 1092 | |||
| 1093 | // Empty TR, remove it | ||
| 1094 | if (!tr.hasChildNodes()) { | ||
| 1095 | tr.parentNode.removeChild(tr); | ||
| 1096 | |||
| 1097 | var lastCell = null; | ||
| 1098 | for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) { | ||
| 1099 | if (cellElm != lastCell && cellElm.rowSpan > 1) | ||
| 1100 | cellElm.rowSpan--; | ||
| 1101 | |||
| 1102 | lastCell = cellElm; | ||
| 1103 | } | ||
| 1104 | |||
| 1105 | if (tdElm.rowSpan > 1) | ||
| 1106 | tdElm.rowSpan--; | ||
| 1107 | } | ||
| 1108 | } | ||
| 1109 | } | ||
| 1110 | } | ||
| 1111 | |||
| 1112 | // Remove all but one bogus br | ||
| 1113 | each(ed.dom.select('br', tdElm), function(e, i) { | ||
| 1114 | if (i > 0 && ed.dom.getAttrib(e, 'mce_bogus')) | ||
| 1115 | ed.dom.remove(e); | ||
| 1116 | }); | ||
| 1117 | |||
| 1118 | break; | ||
| 1119 | } | ||
| 1120 | |||
| 1121 | tableElm = inst.dom.getParent(inst.selection.getNode(), "table"); | ||
| 1122 | inst.addVisual(tableElm); | ||
| 1123 | inst.nodeChanged(); | ||
| 1124 | } | ||
| 1125 | |||
| 1126 | return true; | ||
| 1127 | } | ||
| 1128 | |||
| 1129 | // Pass to next handler in chain | ||
| 1130 | return false; | ||
| 1131 | } | ||
| 1132 | }); | ||
| 1133 | |||
| 1134 | // Register plugin | ||
| 1135 | tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); | ||
| 1136 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/js/cell.js b/public/javascripts/tiny_mce/plugins/table/js/cell.js new file mode 100755 index 0000000..f23b067 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/js/cell.js | |||
| @@ -0,0 +1,269 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var ed; | ||
| 4 | |||
| 5 | function init() { | ||
| 6 | ed = tinyMCEPopup.editor; | ||
| 7 | tinyMCEPopup.resizeToInnerSize(); | ||
| 8 | |||
| 9 | document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); | ||
| 10 | document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); | ||
| 11 | document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') | ||
| 12 | |||
| 13 | var inst = ed; | ||
| 14 | var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th"); | ||
| 15 | var formObj = document.forms[0]; | ||
| 16 | var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); | ||
| 17 | |||
| 18 | // Get table cell data | ||
| 19 | var celltype = tdElm.nodeName.toLowerCase(); | ||
| 20 | var align = ed.dom.getAttrib(tdElm, 'align'); | ||
| 21 | var valign = ed.dom.getAttrib(tdElm, 'valign'); | ||
| 22 | var width = trimSize(getStyle(tdElm, 'width', 'width')); | ||
| 23 | var height = trimSize(getStyle(tdElm, 'height', 'height')); | ||
| 24 | var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); | ||
| 25 | var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); | ||
| 26 | var className = ed.dom.getAttrib(tdElm, 'class'); | ||
| 27 | var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; | ||
| 28 | var id = ed.dom.getAttrib(tdElm, 'id'); | ||
| 29 | var lang = ed.dom.getAttrib(tdElm, 'lang'); | ||
| 30 | var dir = ed.dom.getAttrib(tdElm, 'dir'); | ||
| 31 | var scope = ed.dom.getAttrib(tdElm, 'scope'); | ||
| 32 | |||
| 33 | // Setup form | ||
| 34 | addClassesToList('class', 'table_cell_styles'); | ||
| 35 | TinyMCE_EditableSelects.init(); | ||
| 36 | |||
| 37 | formObj.bordercolor.value = bordercolor; | ||
| 38 | formObj.bgcolor.value = bgcolor; | ||
| 39 | formObj.backgroundimage.value = backgroundimage; | ||
| 40 | formObj.width.value = width; | ||
| 41 | formObj.height.value = height; | ||
| 42 | formObj.id.value = id; | ||
| 43 | formObj.lang.value = lang; | ||
| 44 | formObj.style.value = ed.dom.serializeStyle(st); | ||
| 45 | selectByValue(formObj, 'align', align); | ||
| 46 | selectByValue(formObj, 'valign', valign); | ||
| 47 | selectByValue(formObj, 'class', className, true, true); | ||
| 48 | selectByValue(formObj, 'celltype', celltype); | ||
| 49 | selectByValue(formObj, 'dir', dir); | ||
| 50 | selectByValue(formObj, 'scope', scope); | ||
| 51 | |||
| 52 | // Resize some elements | ||
| 53 | if (isVisible('backgroundimagebrowser')) | ||
| 54 | document.getElementById('backgroundimage').style.width = '180px'; | ||
| 55 | |||
| 56 | updateColor('bordercolor_pick', 'bordercolor'); | ||
| 57 | updateColor('bgcolor_pick', 'bgcolor'); | ||
| 58 | } | ||
| 59 | |||
| 60 | function updateAction() { | ||
| 61 | var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; | ||
| 62 | |||
| 63 | tinyMCEPopup.restoreSelection(); | ||
| 64 | el = ed.selection.getNode(); | ||
| 65 | tdElm = ed.dom.getParent(el, "td,th"); | ||
| 66 | trElm = ed.dom.getParent(el, "tr"); | ||
| 67 | tableElm = ed.dom.getParent(el, "table"); | ||
| 68 | |||
| 69 | ed.execCommand('mceBeginUndoLevel'); | ||
| 70 | |||
| 71 | switch (getSelectValue(formObj, 'action')) { | ||
| 72 | case "cell": | ||
| 73 | var celltype = getSelectValue(formObj, 'celltype'); | ||
| 74 | var scope = getSelectValue(formObj, 'scope'); | ||
| 75 | |||
| 76 | function doUpdate(s) { | ||
| 77 | if (s) { | ||
| 78 | updateCell(tdElm); | ||
| 79 | |||
| 80 | ed.addVisual(); | ||
| 81 | ed.nodeChanged(); | ||
| 82 | inst.execCommand('mceEndUndoLevel'); | ||
| 83 | tinyMCEPopup.close(); | ||
| 84 | } | ||
| 85 | }; | ||
| 86 | |||
| 87 | if (ed.getParam("accessibility_warnings", 1)) { | ||
| 88 | if (celltype == "th" && scope == "") | ||
| 89 | tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); | ||
| 90 | else | ||
| 91 | doUpdate(1); | ||
| 92 | |||
| 93 | return; | ||
| 94 | } | ||
| 95 | |||
| 96 | updateCell(tdElm); | ||
| 97 | break; | ||
| 98 | |||
| 99 | case "row": | ||
| 100 | var cell = trElm.firstChild; | ||
| 101 | |||
| 102 | if (cell.nodeName != "TD" && cell.nodeName != "TH") | ||
| 103 | cell = nextCell(cell); | ||
| 104 | |||
| 105 | do { | ||
| 106 | cell = updateCell(cell, true); | ||
| 107 | } while ((cell = nextCell(cell)) != null); | ||
| 108 | |||
| 109 | break; | ||
| 110 | |||
| 111 | case "all": | ||
| 112 | var rows = tableElm.getElementsByTagName("tr"); | ||
| 113 | |||
| 114 | for (var i=0; i<rows.length; i++) { | ||
| 115 | var cell = rows[i].firstChild; | ||
| 116 | |||
| 117 | if (cell.nodeName != "TD" && cell.nodeName != "TH") | ||
| 118 | cell = nextCell(cell); | ||
| 119 | |||
| 120 | do { | ||
| 121 | cell = updateCell(cell, true); | ||
| 122 | } while ((cell = nextCell(cell)) != null); | ||
| 123 | } | ||
| 124 | |||
| 125 | break; | ||
| 126 | } | ||
| 127 | |||
| 128 | ed.addVisual(); | ||
| 129 | ed.nodeChanged(); | ||
| 130 | inst.execCommand('mceEndUndoLevel'); | ||
| 131 | tinyMCEPopup.close(); | ||
| 132 | } | ||
| 133 | |||
| 134 | function nextCell(elm) { | ||
| 135 | while ((elm = elm.nextSibling) != null) { | ||
| 136 | if (elm.nodeName == "TD" || elm.nodeName == "TH") | ||
| 137 | return elm; | ||
| 138 | } | ||
| 139 | |||
| 140 | return null; | ||
| 141 | } | ||
| 142 | |||
| 143 | function updateCell(td, skip_id) { | ||
| 144 | var inst = ed; | ||
| 145 | var formObj = document.forms[0]; | ||
| 146 | var curCellType = td.nodeName.toLowerCase(); | ||
| 147 | var celltype = getSelectValue(formObj, 'celltype'); | ||
| 148 | var doc = inst.getDoc(); | ||
| 149 | var dom = ed.dom; | ||
| 150 | |||
| 151 | if (!skip_id) | ||
| 152 | td.setAttribute('id', formObj.id.value); | ||
| 153 | |||
| 154 | td.setAttribute('align', formObj.align.value); | ||
| 155 | td.setAttribute('vAlign', formObj.valign.value); | ||
| 156 | td.setAttribute('lang', formObj.lang.value); | ||
| 157 | td.setAttribute('dir', getSelectValue(formObj, 'dir')); | ||
| 158 | td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value))); | ||
| 159 | td.setAttribute('scope', formObj.scope.value); | ||
| 160 | ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class')); | ||
| 161 | |||
| 162 | // Clear deprecated attributes | ||
| 163 | ed.dom.setAttrib(td, 'width', ''); | ||
| 164 | ed.dom.setAttrib(td, 'height', ''); | ||
| 165 | ed.dom.setAttrib(td, 'bgColor', ''); | ||
| 166 | ed.dom.setAttrib(td, 'borderColor', ''); | ||
| 167 | ed.dom.setAttrib(td, 'background', ''); | ||
| 168 | |||
| 169 | // Set styles | ||
| 170 | td.style.width = getCSSSize(formObj.width.value); | ||
| 171 | td.style.height = getCSSSize(formObj.height.value); | ||
| 172 | if (formObj.bordercolor.value != "") { | ||
| 173 | td.style.borderColor = formObj.bordercolor.value; | ||
| 174 | td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle; | ||
| 175 | td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth; | ||
| 176 | } else | ||
| 177 | td.style.borderColor = ''; | ||
| 178 | |||
| 179 | td.style.backgroundColor = formObj.bgcolor.value; | ||
| 180 | |||
| 181 | if (formObj.backgroundimage.value != "") | ||
| 182 | td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')"; | ||
| 183 | else | ||
| 184 | td.style.backgroundImage = ''; | ||
| 185 | |||
| 186 | if (curCellType != celltype) { | ||
| 187 | // changing to a different node type | ||
| 188 | var newCell = doc.createElement(celltype); | ||
| 189 | |||
| 190 | for (var c=0; c<td.childNodes.length; c++) | ||
| 191 | newCell.appendChild(td.childNodes[c].cloneNode(1)); | ||
| 192 | |||
| 193 | for (var a=0; a<td.attributes.length; a++) | ||
| 194 | ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name)); | ||
| 195 | |||
| 196 | td.parentNode.replaceChild(newCell, td); | ||
| 197 | td = newCell; | ||
| 198 | } | ||
| 199 | |||
| 200 | dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText))); | ||
| 201 | |||
| 202 | return td; | ||
| 203 | } | ||
| 204 | |||
| 205 | function changedBackgroundImage() { | ||
| 206 | var formObj = document.forms[0]; | ||
| 207 | var st = ed.dom.parseStyle(formObj.style.value); | ||
| 208 | |||
| 209 | st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; | ||
| 210 | |||
| 211 | formObj.style.value = ed.dom.serializeStyle(st); | ||
| 212 | } | ||
| 213 | |||
| 214 | function changedSize() { | ||
| 215 | var formObj = document.forms[0]; | ||
| 216 | var st = ed.dom.parseStyle(formObj.style.value); | ||
| 217 | |||
| 218 | var width = formObj.width.value; | ||
| 219 | if (width != "") | ||
| 220 | st['width'] = getCSSSize(width); | ||
| 221 | else | ||
| 222 | st['width'] = ""; | ||
| 223 | |||
| 224 | var height = formObj.height.value; | ||
| 225 | if (height != "") | ||
| 226 | st['height'] = getCSSSize(height); | ||
| 227 | else | ||
| 228 | st['height'] = ""; | ||
| 229 | |||
| 230 | formObj.style.value = ed.dom.serializeStyle(st); | ||
| 231 | } | ||
| 232 | |||
| 233 | function changedColor() { | ||
| 234 | var formObj = document.forms[0]; | ||
| 235 | var st = ed.dom.parseStyle(formObj.style.value); | ||
| 236 | |||
| 237 | st['background-color'] = formObj.bgcolor.value; | ||
| 238 | st['border-color'] = formObj.bordercolor.value; | ||
| 239 | |||
| 240 | formObj.style.value = ed.dom.serializeStyle(st); | ||
| 241 | } | ||
| 242 | |||
| 243 | function changedStyle() { | ||
| 244 | var formObj = document.forms[0]; | ||
| 245 | var st = ed.dom.parseStyle(formObj.style.value); | ||
| 246 | |||
| 247 | if (st['background-image']) | ||
| 248 | formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 249 | else | ||
| 250 | formObj.backgroundimage.value = ''; | ||
| 251 | |||
| 252 | if (st['width']) | ||
| 253 | formObj.width.value = trimSize(st['width']); | ||
| 254 | |||
| 255 | if (st['height']) | ||
| 256 | formObj.height.value = trimSize(st['height']); | ||
| 257 | |||
| 258 | if (st['background-color']) { | ||
| 259 | formObj.bgcolor.value = st['background-color']; | ||
| 260 | updateColor('bgcolor_pick','bgcolor'); | ||
| 261 | } | ||
| 262 | |||
| 263 | if (st['border-color']) { | ||
| 264 | formObj.bordercolor.value = st['border-color']; | ||
| 265 | updateColor('bordercolor_pick','bordercolor'); | ||
| 266 | } | ||
| 267 | } | ||
| 268 | |||
| 269 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js b/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js new file mode 100755 index 0000000..31d6df0 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | function init() { | ||
| 4 | var f = document.forms[0], v; | ||
| 5 | |||
| 6 | tinyMCEPopup.resizeToInnerSize(); | ||
| 7 | |||
| 8 | f.numcols.value = tinyMCEPopup.getWindowArg('numcols', 1); | ||
| 9 | f.numrows.value = tinyMCEPopup.getWindowArg('numrows', 1); | ||
| 10 | } | ||
| 11 | |||
| 12 | function mergeCells() { | ||
| 13 | var args = [], f = document.forms[0]; | ||
| 14 | |||
| 15 | tinyMCEPopup.restoreSelection(); | ||
| 16 | |||
| 17 | if (!AutoValidator.validate(f)) { | ||
| 18 | tinyMCEPopup.alert(tinyMCEPopup.getLang('invalid_data')); | ||
| 19 | return false; | ||
| 20 | } | ||
| 21 | |||
| 22 | args["numcols"] = f.numcols.value; | ||
| 23 | args["numrows"] = f.numrows.value; | ||
| 24 | |||
| 25 | tinyMCEPopup.execCommand("mceTableMergeCells", false, args); | ||
| 26 | tinyMCEPopup.close(); | ||
| 27 | } | ||
| 28 | |||
| 29 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/js/row.js b/public/javascripts/tiny_mce/plugins/table/js/row.js new file mode 100755 index 0000000..d25f635 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/js/row.js | |||
| @@ -0,0 +1,212 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | function init() { | ||
| 4 | tinyMCEPopup.resizeToInnerSize(); | ||
| 5 | |||
| 6 | document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); | ||
| 7 | document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); | ||
| 8 | |||
| 9 | var inst = tinyMCEPopup.editor; | ||
| 10 | var dom = inst.dom; | ||
| 11 | var trElm = dom.getParent(inst.selection.getNode(), "tr"); | ||
| 12 | var formObj = document.forms[0]; | ||
| 13 | var st = dom.parseStyle(dom.getAttrib(trElm, "style")); | ||
| 14 | |||
| 15 | // Get table row data | ||
| 16 | var rowtype = trElm.parentNode.nodeName.toLowerCase(); | ||
| 17 | var align = dom.getAttrib(trElm, 'align'); | ||
| 18 | var valign = dom.getAttrib(trElm, 'valign'); | ||
| 19 | var height = trimSize(getStyle(trElm, 'height', 'height')); | ||
| 20 | var className = dom.getAttrib(trElm, 'class'); | ||
| 21 | var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor')); | ||
| 22 | var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; | ||
| 23 | var id = dom.getAttrib(trElm, 'id'); | ||
| 24 | var lang = dom.getAttrib(trElm, 'lang'); | ||
| 25 | var dir = dom.getAttrib(trElm, 'dir'); | ||
| 26 | |||
| 27 | // Setup form | ||
| 28 | addClassesToList('class', 'table_row_styles'); | ||
| 29 | TinyMCE_EditableSelects.init(); | ||
| 30 | |||
| 31 | formObj.bgcolor.value = bgcolor; | ||
| 32 | formObj.backgroundimage.value = backgroundimage; | ||
| 33 | formObj.height.value = height; | ||
| 34 | formObj.id.value = id; | ||
| 35 | formObj.lang.value = lang; | ||
| 36 | formObj.style.value = dom.serializeStyle(st); | ||
| 37 | selectByValue(formObj, 'align', align); | ||
| 38 | selectByValue(formObj, 'valign', valign); | ||
| 39 | selectByValue(formObj, 'class', className, true, true); | ||
| 40 | selectByValue(formObj, 'rowtype', rowtype); | ||
| 41 | selectByValue(formObj, 'dir', dir); | ||
| 42 | |||
| 43 | // Resize some elements | ||
| 44 | if (isVisible('backgroundimagebrowser')) | ||
| 45 | document.getElementById('backgroundimage').style.width = '180px'; | ||
| 46 | |||
| 47 | updateColor('bgcolor_pick', 'bgcolor'); | ||
| 48 | } | ||
| 49 | |||
| 50 | function updateAction() { | ||
| 51 | var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0]; | ||
| 52 | var action = getSelectValue(formObj, 'action'); | ||
| 53 | |||
| 54 | tinyMCEPopup.restoreSelection(); | ||
| 55 | trElm = dom.getParent(inst.selection.getNode(), "tr"); | ||
| 56 | tableElm = dom.getParent(inst.selection.getNode(), "table"); | ||
| 57 | |||
| 58 | inst.execCommand('mceBeginUndoLevel'); | ||
| 59 | |||
| 60 | switch (action) { | ||
| 61 | case "row": | ||
| 62 | updateRow(trElm); | ||
| 63 | break; | ||
| 64 | |||
| 65 | case "all": | ||
| 66 | var rows = tableElm.getElementsByTagName("tr"); | ||
| 67 | |||
| 68 | for (var i=0; i<rows.length; i++) | ||
| 69 | updateRow(rows[i], true); | ||
| 70 | |||
| 71 | break; | ||
| 72 | |||
| 73 | case "odd": | ||
| 74 | case "even": | ||
| 75 | var rows = tableElm.getElementsByTagName("tr"); | ||
| 76 | |||
| 77 | for (var i=0; i<rows.length; i++) { | ||
| 78 | if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even")) | ||
| 79 | updateRow(rows[i], true, true); | ||
| 80 | } | ||
| 81 | |||
| 82 | break; | ||
| 83 | } | ||
| 84 | |||
| 85 | inst.addVisual(); | ||
| 86 | inst.nodeChanged(); | ||
| 87 | inst.execCommand('mceEndUndoLevel'); | ||
| 88 | tinyMCEPopup.close(); | ||
| 89 | } | ||
| 90 | |||
| 91 | function updateRow(tr_elm, skip_id, skip_parent) { | ||
| 92 | var inst = tinyMCEPopup.editor; | ||
| 93 | var formObj = document.forms[0]; | ||
| 94 | var dom = inst.dom; | ||
| 95 | var curRowType = tr_elm.parentNode.nodeName.toLowerCase(); | ||
| 96 | var rowtype = getSelectValue(formObj, 'rowtype'); | ||
| 97 | var doc = inst.getDoc(); | ||
| 98 | |||
| 99 | // Update row element | ||
| 100 | if (!skip_id) | ||
| 101 | tr_elm.setAttribute('id', formObj.id.value); | ||
| 102 | |||
| 103 | tr_elm.setAttribute('align', getSelectValue(formObj, 'align')); | ||
| 104 | tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign')); | ||
| 105 | tr_elm.setAttribute('lang', formObj.lang.value); | ||
| 106 | tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir')); | ||
| 107 | tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value))); | ||
| 108 | dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class')); | ||
| 109 | |||
| 110 | // Clear deprecated attributes | ||
| 111 | tr_elm.setAttribute('background', ''); | ||
| 112 | tr_elm.setAttribute('bgColor', ''); | ||
| 113 | tr_elm.setAttribute('height', ''); | ||
| 114 | |||
| 115 | // Set styles | ||
| 116 | tr_elm.style.height = getCSSSize(formObj.height.value); | ||
| 117 | tr_elm.style.backgroundColor = formObj.bgcolor.value; | ||
| 118 | |||
| 119 | if (formObj.backgroundimage.value != "") | ||
| 120 | tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')"; | ||
| 121 | else | ||
| 122 | tr_elm.style.backgroundImage = ''; | ||
| 123 | |||
| 124 | // Setup new rowtype | ||
| 125 | if (curRowType != rowtype && !skip_parent) { | ||
| 126 | // first, clone the node we are working on | ||
| 127 | var newRow = tr_elm.cloneNode(1); | ||
| 128 | |||
| 129 | // next, find the parent of its new destination (creating it if necessary) | ||
| 130 | var theTable = dom.getParent(tr_elm, "table"); | ||
| 131 | var dest = rowtype; | ||
| 132 | var newParent = null; | ||
| 133 | for (var i = 0; i < theTable.childNodes.length; i++) { | ||
| 134 | if (theTable.childNodes[i].nodeName.toLowerCase() == dest) | ||
| 135 | newParent = theTable.childNodes[i]; | ||
| 136 | } | ||
| 137 | |||
| 138 | if (newParent == null) { | ||
| 139 | newParent = doc.createElement(dest); | ||
| 140 | |||
| 141 | if (dest == "thead") { | ||
| 142 | if (theTable.firstChild.nodeName == 'CAPTION') | ||
| 143 | inst.dom.insertAfter(newParent, theTable.firstChild); | ||
| 144 | else | ||
| 145 | theTable.insertBefore(newParent, theTable.firstChild); | ||
| 146 | } else | ||
| 147 | theTable.appendChild(newParent); | ||
| 148 | } | ||
| 149 | |||
| 150 | // append the row to the new parent | ||
| 151 | newParent.appendChild(newRow); | ||
| 152 | |||
| 153 | // remove the original | ||
| 154 | tr_elm.parentNode.removeChild(tr_elm); | ||
| 155 | |||
| 156 | // set tr_elm to the new node | ||
| 157 | tr_elm = newRow; | ||
| 158 | } | ||
| 159 | |||
| 160 | dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText))); | ||
| 161 | } | ||
| 162 | |||
| 163 | function changedBackgroundImage() { | ||
| 164 | var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; | ||
| 165 | var st = dom.parseStyle(formObj.style.value); | ||
| 166 | |||
| 167 | st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; | ||
| 168 | |||
| 169 | formObj.style.value = dom.serializeStyle(st); | ||
| 170 | } | ||
| 171 | |||
| 172 | function changedStyle() { | ||
| 173 | var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; | ||
| 174 | var st = dom.parseStyle(formObj.style.value); | ||
| 175 | |||
| 176 | if (st['background-image']) | ||
| 177 | formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 178 | else | ||
| 179 | formObj.backgroundimage.value = ''; | ||
| 180 | |||
| 181 | if (st['height']) | ||
| 182 | formObj.height.value = trimSize(st['height']); | ||
| 183 | |||
| 184 | if (st['background-color']) { | ||
| 185 | formObj.bgcolor.value = st['background-color']; | ||
| 186 | updateColor('bgcolor_pick','bgcolor'); | ||
| 187 | } | ||
| 188 | } | ||
| 189 | |||
| 190 | function changedSize() { | ||
| 191 | var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; | ||
| 192 | var st = dom.parseStyle(formObj.style.value); | ||
| 193 | |||
| 194 | var height = formObj.height.value; | ||
| 195 | if (height != "") | ||
| 196 | st['height'] = getCSSSize(height); | ||
| 197 | else | ||
| 198 | st['height'] = ""; | ||
| 199 | |||
| 200 | formObj.style.value = dom.serializeStyle(st); | ||
| 201 | } | ||
| 202 | |||
| 203 | function changedColor() { | ||
| 204 | var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; | ||
| 205 | var st = dom.parseStyle(formObj.style.value); | ||
| 206 | |||
| 207 | st['background-color'] = formObj.bgcolor.value; | ||
| 208 | |||
| 209 | formObj.style.value = dom.serializeStyle(st); | ||
| 210 | } | ||
| 211 | |||
| 212 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/js/table.js b/public/javascripts/tiny_mce/plugins/table/js/table.js new file mode 100755 index 0000000..a7f3c3a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/js/table.js | |||
| @@ -0,0 +1,413 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom; | ||
| 4 | |||
| 5 | function insertTable() { | ||
| 6 | var formObj = document.forms[0]; | ||
| 7 | var inst = tinyMCEPopup.editor, dom = inst.dom; | ||
| 8 | var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules; | ||
| 9 | var html = '', capEl, elm; | ||
| 10 | var cellLimit, rowLimit, colLimit; | ||
| 11 | |||
| 12 | tinyMCEPopup.restoreSelection(); | ||
| 13 | |||
| 14 | if (!AutoValidator.validate(formObj)) { | ||
| 15 | tinyMCEPopup.alert(inst.getLang('invalid_data')); | ||
| 16 | return false; | ||
| 17 | } | ||
| 18 | |||
| 19 | elm = dom.getParent(inst.selection.getNode(), 'table'); | ||
| 20 | |||
| 21 | // Get form data | ||
| 22 | cols = formObj.elements['cols'].value; | ||
| 23 | rows = formObj.elements['rows'].value; | ||
| 24 | border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0; | ||
| 25 | cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : ""; | ||
| 26 | cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : ""; | ||
| 27 | align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value; | ||
| 28 | frame = formObj.elements['frame'].options[formObj.elements['frame'].selectedIndex].value; | ||
| 29 | rules = formObj.elements['rules'].options[formObj.elements['rules'].selectedIndex].value; | ||
| 30 | width = formObj.elements['width'].value; | ||
| 31 | height = formObj.elements['height'].value; | ||
| 32 | bordercolor = formObj.elements['bordercolor'].value; | ||
| 33 | bgcolor = formObj.elements['bgcolor'].value; | ||
| 34 | className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value; | ||
| 35 | id = formObj.elements['id'].value; | ||
| 36 | summary = formObj.elements['summary'].value; | ||
| 37 | style = formObj.elements['style'].value; | ||
| 38 | dir = formObj.elements['dir'].value; | ||
| 39 | lang = formObj.elements['lang'].value; | ||
| 40 | background = formObj.elements['backgroundimage'].value; | ||
| 41 | caption = formObj.elements['caption'].checked; | ||
| 42 | |||
| 43 | cellLimit = tinyMCEPopup.getParam('table_cell_limit', false); | ||
| 44 | rowLimit = tinyMCEPopup.getParam('table_row_limit', false); | ||
| 45 | colLimit = tinyMCEPopup.getParam('table_col_limit', false); | ||
| 46 | |||
| 47 | // Validate table size | ||
| 48 | if (colLimit && cols > colLimit) { | ||
| 49 | tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); | ||
| 50 | return false; | ||
| 51 | } else if (rowLimit && rows > rowLimit) { | ||
| 52 | tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); | ||
| 53 | return false; | ||
| 54 | } else if (cellLimit && cols * rows > cellLimit) { | ||
| 55 | tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); | ||
| 56 | return false; | ||
| 57 | } | ||
| 58 | |||
| 59 | // Update table | ||
| 60 | if (action == "update") { | ||
| 61 | inst.execCommand('mceBeginUndoLevel'); | ||
| 62 | |||
| 63 | dom.setAttrib(elm, 'cellPadding', cellpadding, true); | ||
| 64 | dom.setAttrib(elm, 'cellSpacing', cellspacing, true); | ||
| 65 | dom.setAttrib(elm, 'border', border); | ||
| 66 | dom.setAttrib(elm, 'align', align); | ||
| 67 | dom.setAttrib(elm, 'frame', frame); | ||
| 68 | dom.setAttrib(elm, 'rules', rules); | ||
| 69 | dom.setAttrib(elm, 'class', className); | ||
| 70 | dom.setAttrib(elm, 'style', style); | ||
| 71 | dom.setAttrib(elm, 'id', id); | ||
| 72 | dom.setAttrib(elm, 'summary', summary); | ||
| 73 | dom.setAttrib(elm, 'dir', dir); | ||
| 74 | dom.setAttrib(elm, 'lang', lang); | ||
| 75 | |||
| 76 | capEl = inst.dom.select('caption', elm)[0]; | ||
| 77 | |||
| 78 | if (capEl && !caption) | ||
| 79 | capEl.parentNode.removeChild(capEl); | ||
| 80 | |||
| 81 | if (!capEl && caption) { | ||
| 82 | capEl = elm.ownerDocument.createElement('caption'); | ||
| 83 | |||
| 84 | if (!tinymce.isIE) | ||
| 85 | capEl.innerHTML = '<br mce_bogus="1"/>'; | ||
| 86 | |||
| 87 | elm.insertBefore(capEl, elm.firstChild); | ||
| 88 | } | ||
| 89 | |||
| 90 | if (width && inst.settings.inline_styles) { | ||
| 91 | dom.setStyle(elm, 'width', width); | ||
| 92 | dom.setAttrib(elm, 'width', ''); | ||
| 93 | } else { | ||
| 94 | dom.setAttrib(elm, 'width', width, true); | ||
| 95 | dom.setStyle(elm, 'width', ''); | ||
| 96 | } | ||
| 97 | |||
| 98 | // Remove these since they are not valid XHTML | ||
| 99 | dom.setAttrib(elm, 'borderColor', ''); | ||
| 100 | dom.setAttrib(elm, 'bgColor', ''); | ||
| 101 | dom.setAttrib(elm, 'background', ''); | ||
| 102 | |||
| 103 | if (height && inst.settings.inline_styles) { | ||
| 104 | dom.setStyle(elm, 'height', height); | ||
| 105 | dom.setAttrib(elm, 'height', ''); | ||
| 106 | } else { | ||
| 107 | dom.setAttrib(elm, 'height', height, true); | ||
| 108 | dom.setStyle(elm, 'height', ''); | ||
| 109 | } | ||
| 110 | |||
| 111 | if (background != '') | ||
| 112 | elm.style.backgroundImage = "url('" + background + "')"; | ||
| 113 | else | ||
| 114 | elm.style.backgroundImage = ''; | ||
| 115 | |||
| 116 | /* if (tinyMCEPopup.getParam("inline_styles")) { | ||
| 117 | if (width != '') | ||
| 118 | elm.style.width = getCSSSize(width); | ||
| 119 | }*/ | ||
| 120 | |||
| 121 | if (bordercolor != "") { | ||
| 122 | elm.style.borderColor = bordercolor; | ||
| 123 | elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; | ||
| 124 | elm.style.borderWidth = border == "" ? "1px" : border; | ||
| 125 | } else | ||
| 126 | elm.style.borderColor = ''; | ||
| 127 | |||
| 128 | elm.style.backgroundColor = bgcolor; | ||
| 129 | elm.style.height = getCSSSize(height); | ||
| 130 | |||
| 131 | inst.addVisual(); | ||
| 132 | |||
| 133 | // Fix for stange MSIE align bug | ||
| 134 | //elm.outerHTML = elm.outerHTML; | ||
| 135 | |||
| 136 | inst.nodeChanged(); | ||
| 137 | inst.execCommand('mceEndUndoLevel'); | ||
| 138 | |||
| 139 | // Repaint if dimensions changed | ||
| 140 | if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) | ||
| 141 | inst.execCommand('mceRepaint'); | ||
| 142 | |||
| 143 | tinyMCEPopup.close(); | ||
| 144 | return true; | ||
| 145 | } | ||
| 146 | |||
| 147 | // Create new table | ||
| 148 | html += '<table'; | ||
| 149 | |||
| 150 | html += makeAttrib('id', id); | ||
| 151 | html += makeAttrib('border', border); | ||
| 152 | html += makeAttrib('cellpadding', cellpadding); | ||
| 153 | html += makeAttrib('cellspacing', cellspacing); | ||
| 154 | |||
| 155 | if (width && inst.settings.inline_styles) { | ||
| 156 | if (style) | ||
| 157 | style += '; '; | ||
| 158 | |||
| 159 | style += 'width: ' + width; | ||
| 160 | } else | ||
| 161 | html += makeAttrib('width', width); | ||
| 162 | |||
| 163 | /* if (height) { | ||
| 164 | if (style) | ||
| 165 | style += '; '; | ||
| 166 | |||
| 167 | style += 'height: ' + height; | ||
| 168 | }*/ | ||
| 169 | |||
| 170 | //html += makeAttrib('height', height); | ||
| 171 | //html += makeAttrib('bordercolor', bordercolor); | ||
| 172 | //html += makeAttrib('bgcolor', bgcolor); | ||
| 173 | html += makeAttrib('align', align); | ||
| 174 | html += makeAttrib('frame', frame); | ||
| 175 | html += makeAttrib('rules', rules); | ||
| 176 | html += makeAttrib('class', className); | ||
| 177 | html += makeAttrib('style', style); | ||
| 178 | html += makeAttrib('summary', summary); | ||
| 179 | html += makeAttrib('dir', dir); | ||
| 180 | html += makeAttrib('lang', lang); | ||
| 181 | html += '>'; | ||
| 182 | |||
| 183 | if (caption) { | ||
| 184 | if (!tinymce.isIE) | ||
| 185 | html += '<caption><br mce_bogus="1"/></caption>'; | ||
| 186 | else | ||
| 187 | html += '<caption></caption>'; | ||
| 188 | } | ||
| 189 | |||
| 190 | for (var y=0; y<rows; y++) { | ||
| 191 | html += "<tr>"; | ||
| 192 | |||
| 193 | for (var x=0; x<cols; x++) { | ||
| 194 | if (!tinymce.isIE) | ||
| 195 | html += '<td><br mce_bogus="1"/></td>'; | ||
| 196 | else | ||
| 197 | html += '<td></td>'; | ||
| 198 | } | ||
| 199 | |||
| 200 | html += "</tr>"; | ||
| 201 | } | ||
| 202 | |||
| 203 | html += "</table>"; | ||
| 204 | |||
| 205 | inst.execCommand('mceBeginUndoLevel'); | ||
| 206 | inst.execCommand('mceInsertContent', false, html); | ||
| 207 | inst.addVisual(); | ||
| 208 | inst.execCommand('mceEndUndoLevel'); | ||
| 209 | |||
| 210 | tinyMCEPopup.close(); | ||
| 211 | } | ||
| 212 | |||
| 213 | function makeAttrib(attrib, value) { | ||
| 214 | var formObj = document.forms[0]; | ||
| 215 | var valueElm = formObj.elements[attrib]; | ||
| 216 | |||
| 217 | if (typeof(value) == "undefined" || value == null) { | ||
| 218 | value = ""; | ||
| 219 | |||
| 220 | if (valueElm) | ||
| 221 | value = valueElm.value; | ||
| 222 | } | ||
| 223 | |||
| 224 | if (value == "") | ||
| 225 | return ""; | ||
| 226 | |||
| 227 | // XML encode it | ||
| 228 | value = value.replace(/&/g, '&'); | ||
| 229 | value = value.replace(/\"/g, '"'); | ||
| 230 | value = value.replace(/</g, '<'); | ||
| 231 | value = value.replace(/>/g, '>'); | ||
| 232 | |||
| 233 | return ' ' + attrib + '="' + value + '"'; | ||
| 234 | } | ||
| 235 | |||
| 236 | function init() { | ||
| 237 | tinyMCEPopup.resizeToInnerSize(); | ||
| 238 | |||
| 239 | document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); | ||
| 240 | document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); | ||
| 241 | document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); | ||
| 242 | document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); | ||
| 243 | |||
| 244 | var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); | ||
| 245 | var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; | ||
| 246 | var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame; | ||
| 247 | var inst = tinyMCEPopup.editor, dom = inst.dom; | ||
| 248 | var formObj = document.forms[0]; | ||
| 249 | var elm = dom.getParent(inst.selection.getNode(), "table"); | ||
| 250 | |||
| 251 | action = tinyMCEPopup.getWindowArg('action'); | ||
| 252 | |||
| 253 | if (!action) | ||
| 254 | action = elm ? "update" : "insert"; | ||
| 255 | |||
| 256 | if (elm && action != "insert") { | ||
| 257 | var rowsAr = elm.rows; | ||
| 258 | var cols = 0; | ||
| 259 | for (var i=0; i<rowsAr.length; i++) | ||
| 260 | if (rowsAr[i].cells.length > cols) | ||
| 261 | cols = rowsAr[i].cells.length; | ||
| 262 | |||
| 263 | cols = cols; | ||
| 264 | rows = rowsAr.length; | ||
| 265 | |||
| 266 | st = dom.parseStyle(dom.getAttrib(elm, "style")); | ||
| 267 | border = trimSize(getStyle(elm, 'border', 'borderWidth')); | ||
| 268 | cellpadding = dom.getAttrib(elm, 'cellpadding', ""); | ||
| 269 | cellspacing = dom.getAttrib(elm, 'cellspacing', ""); | ||
| 270 | width = trimSize(getStyle(elm, 'width', 'width')); | ||
| 271 | height = trimSize(getStyle(elm, 'height', 'height')); | ||
| 272 | bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); | ||
| 273 | bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); | ||
| 274 | align = dom.getAttrib(elm, 'align', align); | ||
| 275 | frame = dom.getAttrib(elm, 'frame'); | ||
| 276 | rules = dom.getAttrib(elm, 'rules'); | ||
| 277 | className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); | ||
| 278 | id = dom.getAttrib(elm, 'id'); | ||
| 279 | summary = dom.getAttrib(elm, 'summary'); | ||
| 280 | style = dom.serializeStyle(st); | ||
| 281 | dir = dom.getAttrib(elm, 'dir'); | ||
| 282 | lang = dom.getAttrib(elm, 'lang'); | ||
| 283 | background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 284 | formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; | ||
| 285 | |||
| 286 | orgTableWidth = width; | ||
| 287 | orgTableHeight = height; | ||
| 288 | |||
| 289 | action = "update"; | ||
| 290 | formObj.insert.value = inst.getLang('update'); | ||
| 291 | } | ||
| 292 | |||
| 293 | addClassesToList('class', "table_styles"); | ||
| 294 | TinyMCE_EditableSelects.init(); | ||
| 295 | |||
| 296 | // Update form | ||
| 297 | selectByValue(formObj, 'align', align); | ||
| 298 | selectByValue(formObj, 'frame', frame); | ||
| 299 | selectByValue(formObj, 'rules', rules); | ||
| 300 | selectByValue(formObj, 'class', className, true, true); | ||
| 301 | formObj.cols.value = cols; | ||
| 302 | formObj.rows.value = rows; | ||
| 303 | formObj.border.value = border; | ||
| 304 | formObj.cellpadding.value = cellpadding; | ||
| 305 | formObj.cellspacing.value = cellspacing; | ||
| 306 | formObj.width.value = width; | ||
| 307 | formObj.height.value = height; | ||
| 308 | formObj.bordercolor.value = bordercolor; | ||
| 309 | formObj.bgcolor.value = bgcolor; | ||
| 310 | formObj.id.value = id; | ||
| 311 | formObj.summary.value = summary; | ||
| 312 | formObj.style.value = style; | ||
| 313 | formObj.dir.value = dir; | ||
| 314 | formObj.lang.value = lang; | ||
| 315 | formObj.backgroundimage.value = background; | ||
| 316 | |||
| 317 | updateColor('bordercolor_pick', 'bordercolor'); | ||
| 318 | updateColor('bgcolor_pick', 'bgcolor'); | ||
| 319 | |||
| 320 | // Resize some elements | ||
| 321 | if (isVisible('backgroundimagebrowser')) | ||
| 322 | document.getElementById('backgroundimage').style.width = '180px'; | ||
| 323 | |||
| 324 | // Disable some fields in update mode | ||
| 325 | if (action == "update") { | ||
| 326 | formObj.cols.disabled = true; | ||
| 327 | formObj.rows.disabled = true; | ||
| 328 | } | ||
| 329 | } | ||
| 330 | |||
| 331 | function changedSize() { | ||
| 332 | var formObj = document.forms[0]; | ||
| 333 | var st = dom.parseStyle(formObj.style.value); | ||
| 334 | |||
| 335 | /* var width = formObj.width.value; | ||
| 336 | if (width != "") | ||
| 337 | st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; | ||
| 338 | else | ||
| 339 | st['width'] = "";*/ | ||
| 340 | |||
| 341 | var height = formObj.height.value; | ||
| 342 | if (height != "") | ||
| 343 | st['height'] = getCSSSize(height); | ||
| 344 | else | ||
| 345 | st['height'] = ""; | ||
| 346 | |||
| 347 | formObj.style.value = dom.serializeStyle(st); | ||
| 348 | } | ||
| 349 | |||
| 350 | function changedBackgroundImage() { | ||
| 351 | var formObj = document.forms[0]; | ||
| 352 | var st = dom.parseStyle(formObj.style.value); | ||
| 353 | |||
| 354 | st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; | ||
| 355 | |||
| 356 | formObj.style.value = dom.serializeStyle(st); | ||
| 357 | } | ||
| 358 | |||
| 359 | function changedBorder() { | ||
| 360 | var formObj = document.forms[0]; | ||
| 361 | var st = dom.parseStyle(formObj.style.value); | ||
| 362 | |||
| 363 | // Update border width if the element has a color | ||
| 364 | if (formObj.border.value != "" && formObj.bordercolor.value != "") | ||
| 365 | st['border-width'] = formObj.border.value + "px"; | ||
| 366 | |||
| 367 | formObj.style.value = dom.serializeStyle(st); | ||
| 368 | } | ||
| 369 | |||
| 370 | function changedColor() { | ||
| 371 | var formObj = document.forms[0]; | ||
| 372 | var st = dom.parseStyle(formObj.style.value); | ||
| 373 | |||
| 374 | st['background-color'] = formObj.bgcolor.value; | ||
| 375 | |||
| 376 | if (formObj.bordercolor.value != "") { | ||
| 377 | st['border-color'] = formObj.bordercolor.value; | ||
| 378 | |||
| 379 | // Add border-width if it's missing | ||
| 380 | if (!st['border-width']) | ||
| 381 | st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; | ||
| 382 | } | ||
| 383 | |||
| 384 | formObj.style.value = dom.serializeStyle(st); | ||
| 385 | } | ||
| 386 | |||
| 387 | function changedStyle() { | ||
| 388 | var formObj = document.forms[0]; | ||
| 389 | var st = dom.parseStyle(formObj.style.value); | ||
| 390 | |||
| 391 | if (st['background-image']) | ||
| 392 | formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 393 | else | ||
| 394 | formObj.backgroundimage.value = ''; | ||
| 395 | |||
| 396 | if (st['width']) | ||
| 397 | formObj.width.value = trimSize(st['width']); | ||
| 398 | |||
| 399 | if (st['height']) | ||
| 400 | formObj.height.value = trimSize(st['height']); | ||
| 401 | |||
| 402 | if (st['background-color']) { | ||
| 403 | formObj.bgcolor.value = st['background-color']; | ||
| 404 | updateColor('bgcolor_pick','bgcolor'); | ||
| 405 | } | ||
| 406 | |||
| 407 | if (st['border-color']) { | ||
| 408 | formObj.bordercolor.value = st['border-color']; | ||
| 409 | updateColor('bordercolor_pick','bordercolor'); | ||
| 410 | } | ||
| 411 | } | ||
| 412 | |||
| 413 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js new file mode 100755 index 0000000..000332a --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | tinyMCE.addI18n('en.table_dlg',{ | ||
| 2 | general_tab:"General", | ||
| 3 | advanced_tab:"Advanced", | ||
| 4 | general_props:"General properties", | ||
| 5 | advanced_props:"Advanced properties", | ||
| 6 | rowtype:"Row in table part", | ||
| 7 | title:"Insert/Modify table", | ||
| 8 | width:"Width", | ||
| 9 | height:"Height", | ||
| 10 | cols:"Cols", | ||
| 11 | rows:"Rows", | ||
| 12 | cellspacing:"Cellspacing", | ||
| 13 | cellpadding:"Cellpadding", | ||
| 14 | border:"Border", | ||
| 15 | align:"Alignment", | ||
| 16 | align_default:"Default", | ||
| 17 | align_left:"Left", | ||
| 18 | align_right:"Right", | ||
| 19 | align_middle:"Center", | ||
| 20 | row_title:"Table row properties", | ||
| 21 | cell_title:"Table cell properties", | ||
| 22 | cell_type:"Cell type", | ||
| 23 | valign:"Vertical alignment", | ||
| 24 | align_top:"Top", | ||
| 25 | align_bottom:"Bottom", | ||
| 26 | bordercolor:"Border color", | ||
| 27 | bgcolor:"Background color", | ||
| 28 | merge_cells_title:"Merge table cells", | ||
| 29 | id:"Id", | ||
| 30 | style:"Style", | ||
| 31 | langdir:"Language direction", | ||
| 32 | langcode:"Language code", | ||
| 33 | mime:"Target MIME type", | ||
| 34 | ltr:"Left to right", | ||
| 35 | rtl:"Right to left", | ||
| 36 | bgimage:"Background image", | ||
| 37 | summary:"Summary", | ||
| 38 | td:"Data", | ||
| 39 | th:"Header", | ||
| 40 | cell_cell:"Update current cell", | ||
| 41 | cell_row:"Update all cells in row", | ||
| 42 | cell_all:"Update all cells in table", | ||
| 43 | row_row:"Update current row", | ||
| 44 | row_odd:"Update odd rows in table", | ||
| 45 | row_even:"Update even rows in table", | ||
| 46 | row_all:"Update all rows in table", | ||
| 47 | thead:"Table Head", | ||
| 48 | tbody:"Table Body", | ||
| 49 | tfoot:"Table Foot", | ||
| 50 | scope:"Scope", | ||
| 51 | rowgroup:"Row Group", | ||
| 52 | colgroup:"Col Group", | ||
| 53 | col_limit:"You've exceeded the maximum number of columns of {$cols}.", | ||
| 54 | row_limit:"You've exceeded the maximum number of rows of {$rows}.", | ||
| 55 | cell_limit:"You've exceeded the maximum number of cells of {$cells}.", | ||
| 56 | missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", | ||
| 57 | caption:"Table caption", | ||
| 58 | frame:"Frame", | ||
| 59 | frame_none:"none", | ||
| 60 | frame_groups:"groups", | ||
| 61 | frame_rows:"rows", | ||
| 62 | frame_cols:"cols", | ||
| 63 | frame_all:"all", | ||
| 64 | rules:"Rules", | ||
| 65 | rules_void:"void", | ||
| 66 | rules_above:"above", | ||
| 67 | rules_below:"below", | ||
| 68 | rules_hsides:"hsides", | ||
| 69 | rules_lhs:"lhs", | ||
| 70 | rules_rhs:"rhs", | ||
| 71 | rules_vsides:"vsides", | ||
| 72 | rules_box:"box", | ||
| 73 | rules_border:"border" | ||
| 74 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/merge_cells.htm b/public/javascripts/tiny_mce/plugins/table/merge_cells.htm new file mode 100755 index 0000000..9d34a88 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/merge_cells.htm | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#table_dlg.merge_cells_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 8 | <script type="text/javascript" src="js/merge_cells.js"></script> | ||
| 9 | <base target="_self" /> | ||
| 10 | </head> | ||
| 11 | <body style="margin: 8px" style="display: none"> | ||
| 12 | <form onsubmit="mergeCells();return false;" action="#"> | ||
| 13 | <fieldset> | ||
| 14 | <legend>{#table_dlg.merge_cells_title}</legend> | ||
| 15 | <table border="0" cellpadding="0" cellspacing="3" width="100%"> | ||
| 16 | <tr> | ||
| 17 | <td>{#table_dlg.cols}:</td> | ||
| 18 | <td align="right"><input type="text" name="numcols" value="" class="number min1 mceFocus" style="width: 30px" /></td> | ||
| 19 | </tr> | ||
| 20 | <tr> | ||
| 21 | <td>{#table_dlg.rows}:</td> | ||
| 22 | <td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td> | ||
| 23 | </tr> | ||
| 24 | </table> | ||
| 25 | </fieldset> | ||
| 26 | |||
| 27 | <div class="mceActionPanel"> | ||
| 28 | <div style="float: left"> | ||
| 29 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 30 | </div> | ||
| 31 | |||
| 32 | <div style="float: right"> | ||
| 33 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 34 | </div> | ||
| 35 | </div> | ||
| 36 | </form> | ||
| 37 | </body> | ||
| 38 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/row.htm b/public/javascripts/tiny_mce/plugins/table/row.htm new file mode 100755 index 0000000..fe75bf6 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/row.htm | |||
| @@ -0,0 +1,161 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#table_dlg.row_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/row.js"></script> | ||
| 10 | <link href="css/row.css" rel="stylesheet" type="text/css" /> | ||
| 11 | <base target="_self" /> | ||
| 12 | </head> | ||
| 13 | <body id="tablerow" style="display: none"> | ||
| 14 | <form onsubmit="updateAction();return false;"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li> | ||
| 18 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="general_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#table_dlg.general_props}</legend> | ||
| 26 | |||
| 27 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 28 | <tr> | ||
| 29 | <td><label for="rowtype">{#table_dlg.rowtype}</label></td> | ||
| 30 | <td class="col2"> | ||
| 31 | <select id="rowtype" name="rowtype" class="mceFocus"> | ||
| 32 | <option value="thead">{#table_dlg.thead}</option> | ||
| 33 | <option value="tbody">{#table_dlg.tbody}</option> | ||
| 34 | <option value="tfoot">{#table_dlg.tfoot}</option> | ||
| 35 | </select> | ||
| 36 | </td> | ||
| 37 | </tr> | ||
| 38 | |||
| 39 | <tr> | ||
| 40 | <td><label for="align">{#table_dlg.align}</label></td> | ||
| 41 | <td class="col2"> | ||
| 42 | <select id="align" name="align"> | ||
| 43 | <option value="">{#not_set}</option> | ||
| 44 | <option value="center">{#table_dlg.align_middle}</option> | ||
| 45 | <option value="left">{#table_dlg.align_left}</option> | ||
| 46 | <option value="right">{#table_dlg.align_right}</option> | ||
| 47 | </select> | ||
| 48 | </td> | ||
| 49 | </tr> | ||
| 50 | |||
| 51 | <tr> | ||
| 52 | <td><label for="valign">{#table_dlg.valign}</label></td> | ||
| 53 | <td class="col2"> | ||
| 54 | <select id="valign" name="valign"> | ||
| 55 | <option value="">{#not_set}</option> | ||
| 56 | <option value="top">{#table_dlg.align_top}</option> | ||
| 57 | <option value="middle">{#table_dlg.align_middle}</option> | ||
| 58 | <option value="bottom">{#table_dlg.align_bottom}</option> | ||
| 59 | </select> | ||
| 60 | </td> | ||
| 61 | </tr> | ||
| 62 | |||
| 63 | <tr id="styleSelectRow"> | ||
| 64 | <td><label for="class">{#class_name}</label></td> | ||
| 65 | <td class="col2"> | ||
| 66 | <select id="class" name="class" class="mceEditableSelect"> | ||
| 67 | <option value="" selected="selected">{#not_set}</option> | ||
| 68 | </select> | ||
| 69 | </td> | ||
| 70 | </tr> | ||
| 71 | |||
| 72 | <tr> | ||
| 73 | <td><label for="height">{#table_dlg.height}</label></td> | ||
| 74 | <td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td> | ||
| 75 | </tr> | ||
| 76 | </table> | ||
| 77 | </fieldset> | ||
| 78 | </div> | ||
| 79 | |||
| 80 | <div id="advanced_panel" class="panel"> | ||
| 81 | <fieldset> | ||
| 82 | <legend>{#table_dlg.advanced_props}</legend> | ||
| 83 | |||
| 84 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 85 | <tr> | ||
| 86 | <td class="column1"><label for="id">{#table_dlg.id}</label></td> | ||
| 87 | <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> | ||
| 88 | </tr> | ||
| 89 | |||
| 90 | <tr> | ||
| 91 | <td><label for="style">{#table_dlg.style}</label></td> | ||
| 92 | <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td> | ||
| 93 | </tr> | ||
| 94 | |||
| 95 | <tr> | ||
| 96 | <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> | ||
| 97 | <td> | ||
| 98 | <select id="dir" name="dir" style="width: 200px"> | ||
| 99 | <option value="">{#not_set}</option> | ||
| 100 | <option value="ltr">{#table_dlg.ltr}</option> | ||
| 101 | <option value="rtl">{#table_dlg.rtl}</option> | ||
| 102 | </select> | ||
| 103 | </td> | ||
| 104 | </tr> | ||
| 105 | |||
| 106 | <tr> | ||
| 107 | <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> | ||
| 108 | <td> | ||
| 109 | <input id="lang" name="lang" type="text" value="" style="width: 200px" /> | ||
| 110 | </td> | ||
| 111 | </tr> | ||
| 112 | |||
| 113 | <tr> | ||
| 114 | <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> | ||
| 115 | <td> | ||
| 116 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 117 | <tr> | ||
| 118 | <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td> | ||
| 119 | <td id="backgroundimagebrowsercontainer"> </td> | ||
| 120 | </tr> | ||
| 121 | </table> | ||
| 122 | </td> | ||
| 123 | </tr> | ||
| 124 | |||
| 125 | <tr> | ||
| 126 | <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> | ||
| 127 | <td> | ||
| 128 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 129 | <tr> | ||
| 130 | <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td> | ||
| 131 | <td id="bgcolor_pickcontainer"> </td> | ||
| 132 | </tr> | ||
| 133 | </table> | ||
| 134 | </td> | ||
| 135 | </tr> | ||
| 136 | </table> | ||
| 137 | </fieldset> | ||
| 138 | </div> | ||
| 139 | </div> | ||
| 140 | |||
| 141 | <div class="mceActionPanel"> | ||
| 142 | <div> | ||
| 143 | <select id="action" name="action"> | ||
| 144 | <option value="row">{#table_dlg.row_row}</option> | ||
| 145 | <option value="odd">{#table_dlg.row_odd}</option> | ||
| 146 | <option value="even">{#table_dlg.row_even}</option> | ||
| 147 | <option value="all">{#table_dlg.row_all}</option> | ||
| 148 | </select> | ||
| 149 | </div> | ||
| 150 | |||
| 151 | <div style="float: left"> | ||
| 152 | <div><input type="submit" id="insert" name="insert" value="{#update}" /></div> | ||
| 153 | </div> | ||
| 154 | |||
| 155 | <div style="float: right"> | ||
| 156 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 157 | </div> | ||
| 158 | </div> | ||
| 159 | </form> | ||
| 160 | </body> | ||
| 161 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/table.htm b/public/javascripts/tiny_mce/plugins/table/table.htm new file mode 100755 index 0000000..75136e6 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/table/table.htm | |||
| @@ -0,0 +1,193 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#table_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 9 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 10 | <script type="text/javascript" src="js/table.js"></script> | ||
| 11 | <link href="css/table.css" rel="stylesheet" type="text/css" /> | ||
| 12 | <base target="_self" /> | ||
| 13 | </head> | ||
| 14 | <body id="table" style="display: none"> | ||
| 15 | <form onsubmit="insertTable();return false;" action="#"> | ||
| 16 | <div class="tabs"> | ||
| 17 | <ul> | ||
| 18 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li> | ||
| 19 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li> | ||
| 20 | </ul> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div class="panel_wrapper"> | ||
| 24 | <div id="general_panel" class="panel current"> | ||
| 25 | <fieldset> | ||
| 26 | <legend>{#table_dlg.general_props}</legend> | ||
| 27 | <table border="0" cellpadding="4" cellspacing="0" width="100%"> | ||
| 28 | <tr> | ||
| 29 | <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td> | ||
| 30 | <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" /></td> | ||
| 31 | <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td> | ||
| 32 | <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td> | ||
| 33 | </tr> | ||
| 34 | <tr> | ||
| 35 | <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td> | ||
| 36 | <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td> | ||
| 37 | <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td> | ||
| 38 | <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td> | ||
| 39 | </tr> | ||
| 40 | <tr> | ||
| 41 | <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td> | ||
| 42 | <td><select id="align" name="align"> | ||
| 43 | <option value="">{#not_set}</option> | ||
| 44 | <option value="center">{#table_dlg.align_middle}</option> | ||
| 45 | <option value="left">{#table_dlg.align_left}</option> | ||
| 46 | <option value="right">{#table_dlg.align_right}</option> | ||
| 47 | </select></td> | ||
| 48 | <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td> | ||
| 49 | <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td> | ||
| 50 | </tr> | ||
| 51 | <tr id="width_row"> | ||
| 52 | <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td> | ||
| 53 | <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td> | ||
| 54 | <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td> | ||
| 55 | <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td> | ||
| 56 | </tr> | ||
| 57 | <tr id="styleSelectRow"> | ||
| 58 | <td><label id="classlabel" for="class">{#class_name}</label></td> | ||
| 59 | <td colspan="3"> | ||
| 60 | <select id="class" name="class" class="mceEditableSelect"> | ||
| 61 | <option value="" selected>{#not_set}</option> | ||
| 62 | </select></td> | ||
| 63 | </tr> | ||
| 64 | <tr> | ||
| 65 | <td class="column1"><label for="caption">{#table_dlg.caption}</label></td> | ||
| 66 | <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td> | ||
| 67 | </tr> | ||
| 68 | </table> | ||
| 69 | </fieldset> | ||
| 70 | </div> | ||
| 71 | |||
| 72 | <div id="advanced_panel" class="panel"> | ||
| 73 | <fieldset> | ||
| 74 | <legend>{#table_dlg.advanced_props}</legend> | ||
| 75 | |||
| 76 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 77 | <tr> | ||
| 78 | <td class="column1"><label for="id">{#table_dlg.id}</label></td> | ||
| 79 | <td><input id="id" name="id" type="text" value="" class="advfield" /></td> | ||
| 80 | </tr> | ||
| 81 | |||
| 82 | <tr> | ||
| 83 | <td class="column1"><label for="summary">{#table_dlg.summary}</label></td> | ||
| 84 | <td><input id="summary" name="summary" type="text" value="" class="advfield" /></td> | ||
| 85 | </tr> | ||
| 86 | |||
| 87 | <tr> | ||
| 88 | <td><label for="style">{#table_dlg.style}</label></td> | ||
| 89 | <td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td> | ||
| 90 | </tr> | ||
| 91 | |||
| 92 | <tr> | ||
| 93 | <td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td> | ||
| 94 | <td> | ||
| 95 | <input id="lang" name="lang" type="text" value="" class="advfield" /> | ||
| 96 | </td> | ||
| 97 | </tr> | ||
| 98 | |||
| 99 | <tr> | ||
| 100 | <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> | ||
| 101 | <td> | ||
| 102 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 103 | <tr> | ||
| 104 | <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td> | ||
| 105 | <td id="backgroundimagebrowsercontainer"> </td> | ||
| 106 | </tr> | ||
| 107 | </table> | ||
| 108 | </td> | ||
| 109 | </tr> | ||
| 110 | |||
| 111 | <tr> | ||
| 112 | <td class="column1"><label for="frame">{#table_dlg.frame}</label></td> | ||
| 113 | <td> | ||
| 114 | <select id="frame" name="frame" class="advfield"> | ||
| 115 | <option value="">{#not_set}</option> | ||
| 116 | <option value="void">{#table_dlg.rules_void}</option> | ||
| 117 | <option value="above">{#table_dlg.rules_above}</option> | ||
| 118 | <option value="below">{#table_dlg.rules_below}</option> | ||
| 119 | <option value="hsides">{#table_dlg.rules_hsides}</option> | ||
| 120 | <option value="lhs">{#table_dlg.rules_lhs}</option> | ||
| 121 | <option value="rhs">{#table_dlg.rules_rhs}</option> | ||
| 122 | <option value="vsides">{#table_dlg.rules_vsides}</option> | ||
| 123 | <option value="box">{#table_dlg.rules_box}</option> | ||
| 124 | <option value="border">{#table_dlg.rules_border}</option> | ||
| 125 | </select> | ||
| 126 | </td> | ||
| 127 | </tr> | ||
| 128 | |||
| 129 | <tr> | ||
| 130 | <td class="column1"><label for="rules">{#table_dlg.rules}</label></td> | ||
| 131 | <td> | ||
| 132 | <select id="rules" name="rules" class="advfield"> | ||
| 133 | <option value="">{#not_set}</option> | ||
| 134 | <option value="none">{#table_dlg.frame_none}</option> | ||
| 135 | <option value="groups">{#table_dlg.frame_groups}</option> | ||
| 136 | <option value="rows">{#table_dlg.frame_rows}</option> | ||
| 137 | <option value="cols">{#table_dlg.frame_cols}</option> | ||
| 138 | <option value="all">{#table_dlg.frame_all}</option> | ||
| 139 | </select> | ||
| 140 | </td> | ||
| 141 | </tr> | ||
| 142 | |||
| 143 | <tr> | ||
| 144 | <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> | ||
| 145 | <td> | ||
| 146 | <select id="dir" name="dir" class="advfield"> | ||
| 147 | <option value="">{#not_set}</option> | ||
| 148 | <option value="ltr">{#table_dlg.ltr}</option> | ||
| 149 | <option value="rtl">{#table_dlg.rtl}</option> | ||
| 150 | </select> | ||
| 151 | </td> | ||
| 152 | </tr> | ||
| 153 | |||
| 154 | <tr> | ||
| 155 | <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td> | ||
| 156 | <td> | ||
| 157 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 158 | <tr> | ||
| 159 | <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td> | ||
| 160 | <td id="bordercolor_pickcontainer"> </td> | ||
| 161 | </tr> | ||
| 162 | </table> | ||
| 163 | </td> | ||
| 164 | </tr> | ||
| 165 | |||
| 166 | <tr> | ||
| 167 | <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> | ||
| 168 | <td> | ||
| 169 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 170 | <tr> | ||
| 171 | <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td> | ||
| 172 | <td id="bgcolor_pickcontainer"> </td> | ||
| 173 | </tr> | ||
| 174 | </table> | ||
| 175 | </td> | ||
| 176 | </tr> | ||
| 177 | </table> | ||
| 178 | </fieldset> | ||
| 179 | </div> | ||
| 180 | </div> | ||
| 181 | |||
| 182 | <div class="mceActionPanel"> | ||
| 183 | <div style="float: left"> | ||
| 184 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 185 | </div> | ||
| 186 | |||
| 187 | <div style="float: right"> | ||
| 188 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 189 | </div> | ||
| 190 | </div> | ||
| 191 | </form> | ||
| 192 | </body> | ||
| 193 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/blank.htm b/public/javascripts/tiny_mce/plugins/template/blank.htm new file mode 100755 index 0000000..ecde53f --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/template/blank.htm | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <title>blank_page</title> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
| 5 | <script type="text/javascript"> | ||
| 6 | parent.TemplateDialog.loadCSSFiles(document); | ||
| 7 | </script> | ||
| 8 | </head> | ||
| 9 | <body id="mceTemplatePreview" class="mceContentBody"> | ||
| 10 | |||
| 11 | </body> | ||
| 12 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/css/template.css b/public/javascripts/tiny_mce/plugins/template/css/template.css new file mode 100755 index 0000000..2d23a49 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/template/css/template.css | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #frmbody { | ||
| 2 | padding: 10px; | ||
| 3 | background-color: #FFF; | ||
| 4 | border: 1px solid #CCC; | ||
| 5 | } | ||
| 6 | |||
| 7 | .frmRow { | ||
| 8 | margin-bottom: 10px; | ||
| 9 | } | ||
| 10 | |||
| 11 | #templatesrc { | ||
| 12 | border: none; | ||
| 13 | width: 320px; | ||
| 14 | height: 240px; | ||
| 15 | } | ||
| 16 | |||
| 17 | .title { | ||
| 18 | padding-bottom: 5px; | ||
| 19 | } | ||
| 20 | |||
| 21 | .mceActionPanel { | ||
| 22 | padding-top: 5px; | ||
| 23 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/editor_plugin.js b/public/javascripts/tiny_mce/plugins/template/editor_plugin.js new file mode 100755 index 0000000..0f7fb01 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/template/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TemplatePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceTemplate',function(ui){ed.windowManager.open({file:url+'/template.htm',width:ed.getParam('template_popup_width',750),height:ed.getParam('template_popup_height',600),inline:1},{plugin_url:url});});ed.addCommand('mceInsertTemplate',t._insertTemplate,t);ed.addButton('template',{title:'template.desc',cmd:'mceTemplate'});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;each(dom.select('div',o.node),function(e){if(dom.hasClass(e,'mceTmpl')){each(dom.select('*',e),function(e){if(dom.hasClass(e,ed.getParam('template_mdate_classes','mdate').replace(/\s+/g,'|')))e.innerHTML=t._getDateTime(new Date(),ed.getParam("template_mdate_format",ed.getLang("template.mdate_format")));});t._replaceVals(e);}});});},getInfo:function(){return{longname:'Template plugin',author:'Moxiecode Systems AB',authorurl:'http://www.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_insertTemplate:function(ui,v){var t=this,ed=t.editor,h,el,dom=ed.dom,sel=ed.selection.getContent();h=v.content;each(t.editor.getParam('template_replace_values'),function(v,k){if(typeof(v)!='function')h=h.replace(new RegExp('\\{\\$'+k+'\\}','g'),v);});el=dom.create('div',null,h);n=dom.select('.mceTmpl',el);if(n&&n.length>0){el=dom.create('div',null);el.appendChild(n[0].cloneNode(true));}function hasClass(n,c){return new RegExp('\\b'+c+'\\b','g').test(n.className);};each(dom.select('*',el),function(n){if(hasClass(n,ed.getParam('template_cdate_classes','cdate').replace(/\s+/g,'|')))n.innerHTML=t._getDateTime(new Date(),ed.getParam("template_cdate_format",ed.getLang("template.cdate_format")));if(hasClass(n,ed.getParam('template_mdate_classes','mdate').replace(/\s+/g,'|')))n.innerHTML=t._getDateTime(new Date(),ed.getParam("template_mdate_format",ed.getLang("template.mdate_format")));if(hasClass(n,ed.getParam('template_selected_content_classes','selcontent').replace(/\s+/g,'|')))n.innerHTML=sel;});t._replaceVals(el);ed.execCommand('mceInsertContent',false,el.innerHTML);ed.addVisual();},_replaceVals:function(e){var dom=this.editor.dom,vl=this.editor.getParam('template_replace_values');each(dom.select('*',e),function(e){each(vl,function(v,k){if(dom.hasClass(e,k)){if(typeof(vl[k])=='function')vl[k](e);}});});},_getDateTime:function(d,fmt){if(!fmt)return"";function addZeros(value,len){var i;value=""+value;if(value.length<len){for(i=0;i<(len-value.length);i++)value="0"+value;}return value;}fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt.replace("%y",""+d.getYear());fmt=fmt.replace("%m",addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%B",""+tinyMCE.getLang("template_months_long").split(',')[d.getMonth()]);fmt=fmt.replace("%b",""+tinyMCE.getLang("template_months_short").split(',')[d.getMonth()]);fmt=fmt.replace("%A",""+tinyMCE.getLang("template_day_long").split(',')[d.getDay()]);fmt=fmt.replace("%a",""+tinyMCE.getLang("template_day_short").split(',')[d.getDay()]);fmt=fmt.replace("%%","%");return fmt;}});tinymce.PluginManager.add('template',tinymce.plugins.TemplatePlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js new file mode 100755 index 0000000..73ab39e --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js | |||
| @@ -0,0 +1,156 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var each = tinymce.each; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.TemplatePlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | |||
| 17 | // Register commands | ||
| 18 | ed.addCommand('mceTemplate', function(ui) { | ||
| 19 | ed.windowManager.open({ | ||
| 20 | file : url + '/template.htm', | ||
| 21 | width : ed.getParam('template_popup_width', 750), | ||
| 22 | height : ed.getParam('template_popup_height', 600), | ||
| 23 | inline : 1 | ||
| 24 | }, { | ||
| 25 | plugin_url : url | ||
| 26 | }); | ||
| 27 | }); | ||
| 28 | |||
| 29 | ed.addCommand('mceInsertTemplate', t._insertTemplate, t); | ||
| 30 | |||
| 31 | // Register buttons | ||
| 32 | ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'}); | ||
| 33 | |||
| 34 | ed.onPreProcess.add(function(ed, o) { | ||
| 35 | var dom = ed.dom; | ||
| 36 | |||
| 37 | each(dom.select('div', o.node), function(e) { | ||
| 38 | if (dom.hasClass(e, 'mceTmpl')) { | ||
| 39 | each(dom.select('*', e), function(e) { | ||
| 40 | if (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) | ||
| 41 | e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); | ||
| 42 | }); | ||
| 43 | |||
| 44 | t._replaceVals(e); | ||
| 45 | } | ||
| 46 | }); | ||
| 47 | }); | ||
| 48 | }, | ||
| 49 | |||
| 50 | getInfo : function() { | ||
| 51 | return { | ||
| 52 | longname : 'Template plugin', | ||
| 53 | author : 'Moxiecode Systems AB', | ||
| 54 | authorurl : 'http://www.moxiecode.com', | ||
| 55 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template', | ||
| 56 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 57 | }; | ||
| 58 | }, | ||
| 59 | |||
| 60 | _insertTemplate : function(ui, v) { | ||
| 61 | var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent(); | ||
| 62 | |||
| 63 | h = v.content; | ||
| 64 | |||
| 65 | each(t.editor.getParam('template_replace_values'), function(v, k) { | ||
| 66 | if (typeof(v) != 'function') | ||
| 67 | h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); | ||
| 68 | }); | ||
| 69 | |||
| 70 | el = dom.create('div', null, h); | ||
| 71 | |||
| 72 | // Find template element within div | ||
| 73 | n = dom.select('.mceTmpl', el); | ||
| 74 | if (n && n.length > 0) { | ||
| 75 | el = dom.create('div', null); | ||
| 76 | el.appendChild(n[0].cloneNode(true)); | ||
| 77 | } | ||
| 78 | |||
| 79 | function hasClass(n, c) { | ||
| 80 | return new RegExp('\\b' + c + '\\b', 'g').test(n.className); | ||
| 81 | }; | ||
| 82 | |||
| 83 | each(dom.select('*', el), function(n) { | ||
| 84 | // Replace cdate | ||
| 85 | if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) | ||
| 86 | n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); | ||
| 87 | |||
| 88 | // Replace mdate | ||
| 89 | if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) | ||
| 90 | n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); | ||
| 91 | |||
| 92 | // Replace selection | ||
| 93 | if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) | ||
| 94 | n.innerHTML = sel; | ||
| 95 | }); | ||
| 96 | |||
| 97 | t._replaceVals(el); | ||
| 98 | |||
| 99 | ed.execCommand('mceInsertContent', false, el.innerHTML); | ||
| 100 | ed.addVisual(); | ||
| 101 | }, | ||
| 102 | |||
| 103 | _replaceVals : function(e) { | ||
| 104 | var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); | ||
| 105 | |||
| 106 | each(dom.select('*', e), function(e) { | ||
| 107 | each(vl, function(v, k) { | ||
| 108 | if (dom.hasClass(e, k)) { | ||
| 109 | if (typeof(vl[k]) == 'function') | ||
| 110 | vl[k](e); | ||
| 111 | } | ||
| 112 | }); | ||
| 113 | }); | ||
| 114 | }, | ||
| 115 | |||
| 116 | _getDateTime : function(d, fmt) { | ||
| 117 | if (!fmt) | ||
| 118 | return ""; | ||
| 119 | |||
| 120 | function addZeros(value, len) { | ||
| 121 | var i; | ||
| 122 | |||
| 123 | value = "" + value; | ||
| 124 | |||
| 125 | if (value.length < len) { | ||
| 126 | for (i=0; i<(len-value.length); i++) | ||
| 127 | value = "0" + value; | ||
| 128 | } | ||
| 129 | |||
| 130 | return value; | ||
| 131 | } | ||
| 132 | |||
| 133 | fmt = fmt.replace("%D", "%m/%d/%y"); | ||
| 134 | fmt = fmt.replace("%r", "%I:%M:%S %p"); | ||
| 135 | fmt = fmt.replace("%Y", "" + d.getFullYear()); | ||
| 136 | fmt = fmt.replace("%y", "" + d.getYear()); | ||
| 137 | fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); | ||
| 138 | fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); | ||
| 139 | fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); | ||
| 140 | fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); | ||
| 141 | fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); | ||
| 142 | fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); | ||
| 143 | fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); | ||
| 144 | fmt = fmt.replace("%B", "" + tinyMCE.getLang("template_months_long").split(',')[d.getMonth()]); | ||
| 145 | fmt = fmt.replace("%b", "" + tinyMCE.getLang("template_months_short").split(',')[d.getMonth()]); | ||
| 146 | fmt = fmt.replace("%A", "" + tinyMCE.getLang("template_day_long").split(',')[d.getDay()]); | ||
| 147 | fmt = fmt.replace("%a", "" + tinyMCE.getLang("template_day_short").split(',')[d.getDay()]); | ||
| 148 | fmt = fmt.replace("%%", "%"); | ||
| 149 | |||
| 150 | return fmt; | ||
| 151 | } | ||
| 152 | }); | ||
| 153 | |||
| 154 | // Register plugin | ||
| 155 | tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); | ||
| 156 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/js/template.js b/public/javascripts/tiny_mce/plugins/template/js/template.js new file mode 100755 index 0000000..24045d7 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/template/js/template.js | |||
| @@ -0,0 +1,106 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var TemplateDialog = { | ||
| 4 | preInit : function() { | ||
| 5 | var url = tinyMCEPopup.getParam("template_external_list_url"); | ||
| 6 | |||
| 7 | if (url != null) | ||
| 8 | document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></sc'+'ript>'); | ||
| 9 | }, | ||
| 10 | |||
| 11 | init : function() { | ||
| 12 | var ed = tinyMCEPopup.editor, tsrc, sel, x, u; | ||
| 13 | |||
| 14 | tsrc = ed.getParam("template_templates", false); | ||
| 15 | sel = document.getElementById('tpath'); | ||
| 16 | |||
| 17 | // Setup external template list | ||
| 18 | if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { | ||
| 19 | for (x=0, tsrc = []; x<tinyMCETemplateList.length; x++) | ||
| 20 | tsrc.push({title : tinyMCETemplateList[x][0], src : tinyMCETemplateList[x][1], description : tinyMCETemplateList[x][2]}); | ||
| 21 | } | ||
| 22 | |||
| 23 | for (x=0; x<tsrc.length; x++) | ||
| 24 | sel.options[sel.options.length] = new Option(tsrc[x].title, tinyMCEPopup.editor.documentBaseURI.toAbsolute(tsrc[x].src)); | ||
| 25 | |||
| 26 | this.resize(); | ||
| 27 | this.tsrc = tsrc; | ||
| 28 | }, | ||
| 29 | |||
| 30 | resize : function() { | ||
| 31 | var w, h, e; | ||
| 32 | |||
| 33 | if (!self.innerWidth) { | ||
| 34 | w = document.body.clientWidth - 50; | ||
| 35 | h = document.body.clientHeight - 160; | ||
| 36 | } else { | ||
| 37 | w = self.innerWidth - 50; | ||
| 38 | h = self.innerHeight - 170; | ||
| 39 | } | ||
| 40 | |||
| 41 | e = document.getElementById('templatesrc'); | ||
| 42 | |||
| 43 | if (e) { | ||
| 44 | e.style.height = Math.abs(h) + 'px'; | ||
| 45 | e.style.width = Math.abs(w - 5) + 'px'; | ||
| 46 | } | ||
| 47 | }, | ||
| 48 | |||
| 49 | loadCSSFiles : function(d) { | ||
| 50 | var ed = tinyMCEPopup.editor; | ||
| 51 | |||
| 52 | tinymce.each(ed.getParam("content_css", '').split(','), function(u) { | ||
| 53 | d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />'); | ||
| 54 | }); | ||
| 55 | }, | ||
| 56 | |||
| 57 | selectTemplate : function(u, ti) { | ||
| 58 | var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; | ||
| 59 | |||
| 60 | if (!u) | ||
| 61 | return; | ||
| 62 | |||
| 63 | d.body.innerHTML = this.templateHTML = this.getFileContents(u); | ||
| 64 | |||
| 65 | for (x=0; x<tsrc.length; x++) { | ||
| 66 | if (tsrc[x].title == ti) | ||
| 67 | document.getElementById('tmpldesc').innerHTML = tsrc[x].description || ''; | ||
| 68 | } | ||
| 69 | }, | ||
| 70 | |||
| 71 | insert : function() { | ||
| 72 | tinyMCEPopup.execCommand('mceInsertTemplate', false, { | ||
| 73 | content : this.templateHTML, | ||
| 74 | selection : tinyMCEPopup.editor.selection.getContent() | ||
| 75 | }); | ||
| 76 | |||
| 77 | tinyMCEPopup.close(); | ||
| 78 | }, | ||
| 79 | |||
| 80 | getFileContents : function(u) { | ||
| 81 | var x, d, t = 'text/plain'; | ||
| 82 | |||
| 83 | function g(s) { | ||
| 84 | x = 0; | ||
| 85 | |||
| 86 | try { | ||
| 87 | x = new ActiveXObject(s); | ||
| 88 | } catch (s) { | ||
| 89 | } | ||
| 90 | |||
| 91 | return x; | ||
| 92 | }; | ||
| 93 | |||
| 94 | x = window.ActiveXObject ? g('Msxml2.XMLHTTP') || g('Microsoft.XMLHTTP') : new XMLHttpRequest(); | ||
| 95 | |||
| 96 | // Synchronous AJAX load file | ||
| 97 | x.overrideMimeType && x.overrideMimeType(t); | ||
| 98 | x.open("GET", u, false); | ||
| 99 | x.send(null); | ||
| 100 | |||
| 101 | return x.responseText; | ||
| 102 | } | ||
| 103 | }; | ||
| 104 | |||
| 105 | TemplateDialog.preInit(); | ||
| 106 | tinyMCEPopup.onInit.add(TemplateDialog.init, TemplateDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js new file mode 100755 index 0000000..2471c3f --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | tinyMCE.addI18n('en.template_dlg',{ | ||
| 2 | title:"Templates", | ||
| 3 | label:"Template", | ||
| 4 | desc_label:"Description", | ||
| 5 | desc:"Insert predefined template content", | ||
| 6 | select:"Select a template", | ||
| 7 | preview:"Preview", | ||
| 8 | warning:"Warning: Updating a template with a different one may cause data loss.", | ||
| 9 | mdate_format:"%Y-%m-%d %H:%M:%S", | ||
| 10 | cdate_format:"%Y-%m-%d %H:%M:%S", | ||
| 11 | months_long:"January,February,March,April,May,June,July,August,September,October,November,December", | ||
| 12 | months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", | ||
| 13 | day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", | ||
| 14 | day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" | ||
| 15 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/template.htm b/public/javascripts/tiny_mce/plugins/template/template.htm new file mode 100755 index 0000000..2b71c6e --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/template/template.htm | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <title>{#template_dlg.title}</title> | ||
| 4 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 5 | <script type="text/javascript" src="js/template.js"></script> | ||
| 6 | <link href="css/template.css" rel="stylesheet" type="text/css" /> | ||
| 7 | <base target="_self" /> | ||
| 8 | </head> | ||
| 9 | <body onresize="TemplateDialog.resize();"> | ||
| 10 | <form onsubmit="TemplateDialog.insert();return false;"> | ||
| 11 | <div id="frmbody"> | ||
| 12 | <div class="title">{#template_dlg.desc}</div> | ||
| 13 | <div class="frmRow"><label for="tpath" title="{#template_dlg.select}">{#template_dlg.label}:</label> | ||
| 14 | <select id="tpath" name="tpath" onchange="TemplateDialog.selectTemplate(this.options[this.selectedIndex].value, this.options[this.selectedIndex].text);" class="mceFocus"> | ||
| 15 | <option value="">{#template_dlg.select}...</option> | ||
| 16 | </select> | ||
| 17 | <span id="warning"></span></div> | ||
| 18 | <div class="frmRow"><label for="tdesc">{#template_dlg.desc_label}:</label> | ||
| 19 | <span id="tmpldesc"></span></div> | ||
| 20 | <fieldset> | ||
| 21 | <legend>{#template_dlg.preview}</legend> | ||
| 22 | <iframe id="templatesrc" name="templatesrc" src="blank.htm" width="690" height="400" frameborder="0"></iframe> | ||
| 23 | </fieldset> | ||
| 24 | </div> | ||
| 25 | |||
| 26 | <div class="mceActionPanel"> | ||
| 27 | <div style="float: left"> | ||
| 28 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 29 | </div> | ||
| 30 | |||
| 31 | <div style="float: right"> | ||
| 32 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 33 | </div> | ||
| 34 | |||
| 35 | <br style="clear:both" /> | ||
| 36 | </div> | ||
| 37 | </form> | ||
| 38 | </body> | ||
| 39 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js b/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js new file mode 100755 index 0000000..e1e4238 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.VisualChars',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceVisualChars',t._toggleVisualChars,t);ed.addButton('visualchars',{title:'visualchars.desc',cmd:'mceVisualChars'});ed.onBeforeGetContent.add(function(ed,o){if(t.state){t.state=true;t._toggleVisualChars();}});},getInfo:function(){return{longname:'Visual characters',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_toggleVisualChars:function(){var t=this,ed=t.editor,nl,i,h,d=ed.getDoc(),b=ed.getBody(),nv,s=ed.selection,bo;t.state=!t.state;ed.controlManager.setActive('visualchars',t.state);if(t.state){nl=[];tinymce.walk(b,function(n){if(n.nodeType==3&&n.nodeValue&&n.nodeValue.indexOf('\u00a0')!=-1)nl.push(n);},'childNodes');for(i=0;i<nl.length;i++){nv=nl[i].nodeValue;nv=nv.replace(/(\u00a0+)/g,'<span class="mceItemHidden mceVisualNbsp">$1</span>');nv=nv.replace(/\u00a0/g,'\u00b7');ed.dom.setOuterHTML(nl[i],nv,d);}}else{nl=tinymce.grep(ed.dom.select('span',b),function(n){return ed.dom.hasClass(n,'mceVisualNbsp');});for(i=0;i<nl.length;i++)ed.dom.setOuterHTML(nl[i],nl[i].innerHTML.replace(/(·|\u00b7)/g,' '),d);}}});tinymce.PluginManager.add('visualchars',tinymce.plugins.VisualChars);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js new file mode 100755 index 0000000..02ec4e6 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.VisualChars', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mceVisualChars', t._toggleVisualChars, t); | ||
| 17 | |||
| 18 | // Register buttons | ||
| 19 | ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); | ||
| 20 | |||
| 21 | ed.onBeforeGetContent.add(function(ed, o) { | ||
| 22 | if (t.state) { | ||
| 23 | t.state = true; | ||
| 24 | t._toggleVisualChars(); | ||
| 25 | } | ||
| 26 | }); | ||
| 27 | }, | ||
| 28 | |||
| 29 | getInfo : function() { | ||
| 30 | return { | ||
| 31 | longname : 'Visual characters', | ||
| 32 | author : 'Moxiecode Systems AB', | ||
| 33 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 34 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars', | ||
| 35 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 36 | }; | ||
| 37 | }, | ||
| 38 | |||
| 39 | // Private methods | ||
| 40 | |||
| 41 | _toggleVisualChars : function() { | ||
| 42 | var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo; | ||
| 43 | |||
| 44 | t.state = !t.state; | ||
| 45 | ed.controlManager.setActive('visualchars', t.state); | ||
| 46 | |||
| 47 | if (t.state) { | ||
| 48 | nl = []; | ||
| 49 | tinymce.walk(b, function(n) { | ||
| 50 | if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) | ||
| 51 | nl.push(n); | ||
| 52 | }, 'childNodes'); | ||
| 53 | |||
| 54 | for (i=0; i<nl.length; i++) { | ||
| 55 | nv = nl[i].nodeValue; | ||
| 56 | nv = nv.replace(/(\u00a0+)/g, '<span class="mceItemHidden mceVisualNbsp">$1</span>'); | ||
| 57 | nv = nv.replace(/\u00a0/g, '\u00b7'); | ||
| 58 | ed.dom.setOuterHTML(nl[i], nv, d); | ||
| 59 | } | ||
| 60 | } else { | ||
| 61 | nl = tinymce.grep(ed.dom.select('span', b), function(n) { | ||
| 62 | return ed.dom.hasClass(n, 'mceVisualNbsp'); | ||
| 63 | }); | ||
| 64 | |||
| 65 | for (i=0; i<nl.length; i++) | ||
| 66 | ed.dom.setOuterHTML(nl[i], nl[i].innerHTML.replace(/(·|\u00b7)/g, ' '), d); | ||
| 67 | } | ||
| 68 | } | ||
| 69 | }); | ||
| 70 | |||
| 71 | // Register plugin | ||
| 72 | tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); | ||
| 73 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm new file mode 100755 index 0000000..5800284 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm | |||
| @@ -0,0 +1,149 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.title_abbr_element}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/element_common.js"></script> | ||
| 10 | <script type="text/javascript" src="js/abbr.js"></script> | ||
| 11 | <link rel="stylesheet" type="text/css" href="css/popup.css" /> | ||
| 12 | <base target="_self" /> | ||
| 13 | </head> | ||
| 14 | <body style="display: none"> | ||
| 15 | <form onsubmit="insertAbbr();return false;" action="#"> | ||
| 16 | <div class="tabs"> | ||
| 17 | <ul> | ||
| 18 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li> | ||
| 19 | <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> --> | ||
| 20 | </ul> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div class="panel_wrapper"> | ||
| 24 | <div id="general_panel" class="panel current"> | ||
| 25 | <fieldset> | ||
| 26 | <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend> | ||
| 27 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 28 | <tr> | ||
| 29 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 30 | <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> | ||
| 31 | </tr> | ||
| 32 | <tr> | ||
| 33 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 34 | <td><input id="id" name="id" type="text" value="" class="field" /></td> | ||
| 35 | </tr> | ||
| 36 | <tr> | ||
| 37 | <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> | ||
| 38 | <td> | ||
| 39 | <select id="class" name="class" class="field mceEditableSelect"> | ||
| 40 | <option value="">{#not_set}</option> | ||
| 41 | </select> | ||
| 42 | </td> | ||
| 43 | </tr> | ||
| 44 | <tr> | ||
| 45 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 46 | <td><input id="style" name="style" type="text" value="" class="field" /></td> | ||
| 47 | </tr> | ||
| 48 | <tr> | ||
| 49 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 50 | <td> | ||
| 51 | <select id="dir" name="dir" class="field"> | ||
| 52 | <option value="">{#not_set}</option> | ||
| 53 | <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> | ||
| 54 | <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> | ||
| 55 | </select> | ||
| 56 | </td> | ||
| 57 | </tr> | ||
| 58 | <tr> | ||
| 59 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 60 | <td> | ||
| 61 | <input id="lang" name="lang" type="text" value="" class="field" /> | ||
| 62 | </td> | ||
| 63 | </tr> | ||
| 64 | </table> | ||
| 65 | </fieldset> | ||
| 66 | </div> | ||
| 67 | <div id="events_panel" class="panel"> | ||
| 68 | <fieldset> | ||
| 69 | <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend> | ||
| 70 | |||
| 71 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 72 | <tr> | ||
| 73 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 74 | <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> | ||
| 75 | </tr> | ||
| 76 | |||
| 77 | <tr> | ||
| 78 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 79 | <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> | ||
| 80 | </tr> | ||
| 81 | |||
| 82 | <tr> | ||
| 83 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 84 | <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> | ||
| 85 | </tr> | ||
| 86 | |||
| 87 | <tr> | ||
| 88 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 89 | <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> | ||
| 90 | </tr> | ||
| 91 | |||
| 92 | <tr> | ||
| 93 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 94 | <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> | ||
| 95 | </tr> | ||
| 96 | |||
| 97 | <tr> | ||
| 98 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 99 | <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> | ||
| 100 | </tr> | ||
| 101 | |||
| 102 | <tr> | ||
| 103 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 104 | <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> | ||
| 105 | </tr> | ||
| 106 | |||
| 107 | <tr> | ||
| 108 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 109 | <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> | ||
| 110 | </tr> | ||
| 111 | |||
| 112 | <tr> | ||
| 113 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 114 | <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> | ||
| 115 | </tr> | ||
| 116 | |||
| 117 | <tr> | ||
| 118 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 119 | <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> | ||
| 120 | </tr> | ||
| 121 | |||
| 122 | <tr> | ||
| 123 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 124 | <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> | ||
| 125 | </tr> | ||
| 126 | |||
| 127 | <tr> | ||
| 128 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 129 | <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> | ||
| 130 | </tr> | ||
| 131 | </table> | ||
| 132 | </fieldset> | ||
| 133 | </div> | ||
| 134 | </div> | ||
| 135 | <div class="mceActionPanel"> | ||
| 136 | <div style="float: left"> | ||
| 137 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 138 | </div> | ||
| 139 | <div style="float: left"> | ||
| 140 | <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" /> | ||
| 141 | </div> | ||
| 142 | <div style="float: right"> | ||
| 143 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 144 | </div> | ||
| 145 | </div> | ||
| 146 | |||
| 147 | </form> | ||
| 148 | </body> | ||
| 149 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm new file mode 100755 index 0000000..54e4c9d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm | |||
| @@ -0,0 +1,149 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.title_acronym_element}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/element_common.js"></script> | ||
| 10 | <script type="text/javascript" src="js/acronym.js"></script> | ||
| 11 | <link rel="stylesheet" type="text/css" href="css/popup.css" /> | ||
| 12 | <base target="_self" /> | ||
| 13 | </head> | ||
| 14 | <body style="display: none"> | ||
| 15 | <form onsubmit="insertAcronym();return false;" action="#"> | ||
| 16 | <div class="tabs"> | ||
| 17 | <ul> | ||
| 18 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li> | ||
| 19 | <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> --> | ||
| 20 | </ul> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div class="panel_wrapper"> | ||
| 24 | <div id="general_panel" class="panel current"> | ||
| 25 | <fieldset> | ||
| 26 | <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend> | ||
| 27 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 28 | <tr> | ||
| 29 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 30 | <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> | ||
| 31 | </tr> | ||
| 32 | <tr> | ||
| 33 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 34 | <td><input id="id" name="id" type="text" value="" class="field" /></td> | ||
| 35 | </tr> | ||
| 36 | <tr> | ||
| 37 | <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> | ||
| 38 | <td> | ||
| 39 | <select id="class" name="class" class="field mceEditableSelect"> | ||
| 40 | <option value="">{#not_set}</option> | ||
| 41 | </select> | ||
| 42 | </td> | ||
| 43 | </tr> | ||
| 44 | <tr> | ||
| 45 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 46 | <td><input id="style" name="style" type="text" value="" class="field" /></td> | ||
| 47 | </tr> | ||
| 48 | <tr> | ||
| 49 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 50 | <td> | ||
| 51 | <select id="dir" name="dir" class="field"> | ||
| 52 | <option value="">{#not_set}</option> | ||
| 53 | <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> | ||
| 54 | <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> | ||
| 55 | </select> | ||
| 56 | </td> | ||
| 57 | </tr> | ||
| 58 | <tr> | ||
| 59 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 60 | <td> | ||
| 61 | <input id="lang" name="lang" type="text" value="" class="field" /> | ||
| 62 | </td> | ||
| 63 | </tr> | ||
| 64 | </table> | ||
| 65 | </fieldset> | ||
| 66 | </div> | ||
| 67 | <div id="events_panel" class="panel"> | ||
| 68 | <fieldset> | ||
| 69 | <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend> | ||
| 70 | |||
| 71 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 72 | <tr> | ||
| 73 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 74 | <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> | ||
| 75 | </tr> | ||
| 76 | |||
| 77 | <tr> | ||
| 78 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 79 | <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> | ||
| 80 | </tr> | ||
| 81 | |||
| 82 | <tr> | ||
| 83 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 84 | <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> | ||
| 85 | </tr> | ||
| 86 | |||
| 87 | <tr> | ||
| 88 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 89 | <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> | ||
| 90 | </tr> | ||
| 91 | |||
| 92 | <tr> | ||
| 93 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 94 | <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> | ||
| 95 | </tr> | ||
| 96 | |||
| 97 | <tr> | ||
| 98 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 99 | <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> | ||
| 100 | </tr> | ||
| 101 | |||
| 102 | <tr> | ||
| 103 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 104 | <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> | ||
| 105 | </tr> | ||
| 106 | |||
| 107 | <tr> | ||
| 108 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 109 | <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> | ||
| 110 | </tr> | ||
| 111 | |||
| 112 | <tr> | ||
| 113 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 114 | <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> | ||
| 115 | </tr> | ||
| 116 | |||
| 117 | <tr> | ||
| 118 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 119 | <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> | ||
| 120 | </tr> | ||
| 121 | |||
| 122 | <tr> | ||
| 123 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 124 | <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> | ||
| 125 | </tr> | ||
| 126 | |||
| 127 | <tr> | ||
| 128 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 129 | <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> | ||
| 130 | </tr> | ||
| 131 | </table> | ||
| 132 | </fieldset> | ||
| 133 | </div> | ||
| 134 | </div> | ||
| 135 | <div class="mceActionPanel"> | ||
| 136 | <div style="float: left"> | ||
| 137 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 138 | </div> | ||
| 139 | <div style="float: left"> | ||
| 140 | <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" /> | ||
| 141 | </div> | ||
| 142 | <div style="float: right"> | ||
| 143 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 144 | </div> | ||
| 145 | </div> | ||
| 146 | |||
| 147 | </form> | ||
| 148 | </body> | ||
| 149 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm new file mode 100755 index 0000000..cfbb409 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm | |||
| @@ -0,0 +1,154 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.attribs_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 9 | <script type="text/javascript" src="js/attributes.js"></script> | ||
| 10 | <link rel="stylesheet" type="text/css" href="css/attributes.css" /> | ||
| 11 | <base target="_self" /> | ||
| 12 | </head> | ||
| 13 | <body style="display: none"> | ||
| 14 | <form onsubmit="insertAction();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_attrib_tab}</a></span></li> | ||
| 18 | <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_events_tab}</a></span></li> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="general_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#xhtmlxtras_dlg.attribute_attrib_tab}</legend> | ||
| 26 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 27 | <tr> | ||
| 28 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 29 | <td><input id="title" name="title" type="text" value="" class="mceFocus" /></td> | ||
| 30 | </tr> | ||
| 31 | <tr> | ||
| 32 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 33 | <td><input id="id" name="id" type="text" value="" /></td> | ||
| 34 | </tr> | ||
| 35 | <tr> | ||
| 36 | <td><label id="classlabel" for="classlist">{#class_name}</label></td> | ||
| 37 | <td> | ||
| 38 | <select id="classlist" name="classlist" class="mceEditableSelect"> | ||
| 39 | <option value="" selected>{#not_set}</option> | ||
| 40 | </select> | ||
| 41 | </td> | ||
| 42 | </tr> | ||
| 43 | <tr> | ||
| 44 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 45 | <td><input id="style" name="style" type="text" value="" /></td> | ||
| 46 | </tr> | ||
| 47 | <tr> | ||
| 48 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 49 | <td> | ||
| 50 | <select id="dir" name="dir"> | ||
| 51 | <option value="">{#not_set}</option> | ||
| 52 | <option value="ltr">{#xhtmlxtras_dlg.option_ltr}</option> | ||
| 53 | <option value="rtl">{#xhtmlxtras_dlg.option_rtl}</option> | ||
| 54 | </select> | ||
| 55 | </td> | ||
| 56 | </tr> | ||
| 57 | <tr> | ||
| 58 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 59 | <td> | ||
| 60 | <input id="lang" name="lang" type="text" value="" /> | ||
| 61 | </td> | ||
| 62 | </tr> | ||
| 63 | <tr> | ||
| 64 | <td><label id="tabindexlabel" for="tabindex">{#xhtmlxtras_dlg.attribute_label_tabindex}</label></td> | ||
| 65 | <td><input type="text" id="tabindex" name="tabindex" value="" /></td> | ||
| 66 | </tr> | ||
| 67 | |||
| 68 | <tr> | ||
| 69 | <td><label id="accesskeylabel" for="accesskey">{#xhtmlxtras_dlg.attribute_label_accesskey}</label></td> | ||
| 70 | <td><input type="text" id="accesskey" name="accesskey" value="" /></td> | ||
| 71 | </tr> | ||
| 72 | </table> | ||
| 73 | </fieldset> | ||
| 74 | </div> | ||
| 75 | <div id="events_panel" class="panel"> | ||
| 76 | <fieldset> | ||
| 77 | <legend>{#xhtmlxtras_dlg.attribute_events_tab}</legend> | ||
| 78 | |||
| 79 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 80 | <tr> | ||
| 81 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 82 | <td><input id="onfocus" name="onfocus" type="text" value="" /></td> | ||
| 83 | </tr> | ||
| 84 | |||
| 85 | <tr> | ||
| 86 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 87 | <td><input id="onblur" name="onblur" type="text" value="" /></td> | ||
| 88 | </tr> | ||
| 89 | |||
| 90 | <tr> | ||
| 91 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 92 | <td><input id="onclick" name="onclick" type="text" value="" /></td> | ||
| 93 | </tr> | ||
| 94 | |||
| 95 | <tr> | ||
| 96 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 97 | <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> | ||
| 98 | </tr> | ||
| 99 | |||
| 100 | <tr> | ||
| 101 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 102 | <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> | ||
| 103 | </tr> | ||
| 104 | |||
| 105 | <tr> | ||
| 106 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 107 | <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> | ||
| 108 | </tr> | ||
| 109 | |||
| 110 | <tr> | ||
| 111 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 112 | <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> | ||
| 113 | </tr> | ||
| 114 | |||
| 115 | <tr> | ||
| 116 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 117 | <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> | ||
| 118 | </tr> | ||
| 119 | |||
| 120 | <tr> | ||
| 121 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 122 | <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> | ||
| 123 | </tr> | ||
| 124 | |||
| 125 | <tr> | ||
| 126 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 127 | <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> | ||
| 128 | </tr> | ||
| 129 | |||
| 130 | <tr> | ||
| 131 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 132 | <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> | ||
| 133 | </tr> | ||
| 134 | |||
| 135 | <tr> | ||
| 136 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 137 | <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> | ||
| 138 | </tr> | ||
| 139 | </table> | ||
| 140 | </fieldset> | ||
| 141 | </div> | ||
| 142 | </div> | ||
| 143 | <div class="mceActionPanel"> | ||
| 144 | <div style="float: left"> | ||
| 145 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 146 | </div> | ||
| 147 | <div style="float: right"> | ||
| 148 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 149 | </div> | ||
| 150 | </div> | ||
| 151 | |||
| 152 | </form> | ||
| 153 | </body> | ||
| 154 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm new file mode 100755 index 0000000..7d9eaba --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm | |||
| @@ -0,0 +1,149 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.title_cite_element}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/element_common.js"></script> | ||
| 10 | <script type="text/javascript" src="js/cite.js"></script> | ||
| 11 | <link rel="stylesheet" type="text/css" href="css/popup.css" /> | ||
| 12 | <base target="_self" /> | ||
| 13 | </head> | ||
| 14 | <body style="display: none"> | ||
| 15 | <form onsubmit="insertCite();return false;" action="#"> | ||
| 16 | <div class="tabs"> | ||
| 17 | <ul> | ||
| 18 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li> | ||
| 19 | <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> --> | ||
| 20 | </ul> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div class="panel_wrapper"> | ||
| 24 | <div id="general_panel" class="panel current"> | ||
| 25 | <fieldset> | ||
| 26 | <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend> | ||
| 27 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 28 | <tr> | ||
| 29 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 30 | <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> | ||
| 31 | </tr> | ||
| 32 | <tr> | ||
| 33 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 34 | <td><input id="id" name="id" type="text" value="" class="field" /></td> | ||
| 35 | </tr> | ||
| 36 | <tr> | ||
| 37 | <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> | ||
| 38 | <td> | ||
| 39 | <select id="class" name="class" class="field mceEditableSelect"> | ||
| 40 | <option value="">{#not_set}</option> | ||
| 41 | </select> | ||
| 42 | </td> | ||
| 43 | </tr> | ||
| 44 | <tr> | ||
| 45 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 46 | <td><input id="style" name="style" type="text" value="" class="field" /></td> | ||
| 47 | </tr> | ||
| 48 | <tr> | ||
| 49 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 50 | <td> | ||
| 51 | <select id="dir" name="dir" class="field"> | ||
| 52 | <option value="">{#not_set}</option> | ||
| 53 | <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> | ||
| 54 | <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> | ||
| 55 | </select> | ||
| 56 | </td> | ||
| 57 | </tr> | ||
| 58 | <tr> | ||
| 59 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 60 | <td> | ||
| 61 | <input id="lang" name="lang" type="text" value="" class="field" /> | ||
| 62 | </td> | ||
| 63 | </tr> | ||
| 64 | </table> | ||
| 65 | </fieldset> | ||
| 66 | </div> | ||
| 67 | <div id="events_panel" class="panel"> | ||
| 68 | <fieldset> | ||
| 69 | <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend> | ||
| 70 | |||
| 71 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 72 | <tr> | ||
| 73 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 74 | <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> | ||
| 75 | </tr> | ||
| 76 | |||
| 77 | <tr> | ||
| 78 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 79 | <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> | ||
| 80 | </tr> | ||
| 81 | |||
| 82 | <tr> | ||
| 83 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 84 | <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> | ||
| 85 | </tr> | ||
| 86 | |||
| 87 | <tr> | ||
| 88 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 89 | <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> | ||
| 90 | </tr> | ||
| 91 | |||
| 92 | <tr> | ||
| 93 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 94 | <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> | ||
| 95 | </tr> | ||
| 96 | |||
| 97 | <tr> | ||
| 98 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 99 | <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> | ||
| 100 | </tr> | ||
| 101 | |||
| 102 | <tr> | ||
| 103 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 104 | <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> | ||
| 105 | </tr> | ||
| 106 | |||
| 107 | <tr> | ||
| 108 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 109 | <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> | ||
| 110 | </tr> | ||
| 111 | |||
| 112 | <tr> | ||
| 113 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 114 | <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> | ||
| 115 | </tr> | ||
| 116 | |||
| 117 | <tr> | ||
| 118 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 119 | <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> | ||
| 120 | </tr> | ||
| 121 | |||
| 122 | <tr> | ||
| 123 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 124 | <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> | ||
| 125 | </tr> | ||
| 126 | |||
| 127 | <tr> | ||
| 128 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 129 | <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> | ||
| 130 | </tr> | ||
| 131 | </table> | ||
| 132 | </fieldset> | ||
| 133 | </div> | ||
| 134 | </div> | ||
| 135 | <div class="mceActionPanel"> | ||
| 136 | <div style="float: left"> | ||
| 137 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 138 | </div> | ||
| 139 | <div style="float: left"> | ||
| 140 | <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" /> | ||
| 141 | </div> | ||
| 142 | <div style="float: right"> | ||
| 143 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 144 | </div> | ||
| 145 | </div> | ||
| 146 | |||
| 147 | </form> | ||
| 148 | </body> | ||
| 149 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css new file mode 100755 index 0000000..9a6a235 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | .panel_wrapper div.current { | ||
| 2 | height: 290px; | ||
| 3 | } | ||
| 4 | |||
| 5 | #id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { | ||
| 6 | width: 200px; | ||
| 7 | } | ||
| 8 | |||
| 9 | #events_panel input { | ||
| 10 | width: 200px; | ||
| 11 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css b/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css new file mode 100755 index 0000000..e67114d --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | input.field, select.field {width:200px;} | ||
| 2 | input.picker {width:179px; margin-left: 5px;} | ||
| 3 | input.disabled {border-color:#F2F2F2;} | ||
| 4 | img.picker {vertical-align:text-bottom; cursor:pointer;} | ||
| 5 | h1 {padding: 0 0 5px 0;} | ||
| 6 | .panel_wrapper div.current {height:160px;} | ||
| 7 | #xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} | ||
| 8 | a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} | ||
| 9 | #datetime {width:180px;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm new file mode 100755 index 0000000..d03c456 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm | |||
| @@ -0,0 +1,170 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.title_del_element}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/element_common.js"></script> | ||
| 10 | <script type="text/javascript" src="js/del.js"></script> | ||
| 11 | <link rel="stylesheet" type="text/css" href="css/popup.css" /> | ||
| 12 | <base target="_self" /> | ||
| 13 | </head> | ||
| 14 | <body id="xhtmlxtrasins" style="display: none"> | ||
| 15 | <form onsubmit="insertDel();return false;" action="#"> | ||
| 16 | <div class="tabs"> | ||
| 17 | <ul> | ||
| 18 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li> | ||
| 19 | <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> --> | ||
| 20 | </ul> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div class="panel_wrapper"> | ||
| 24 | <div id="general_panel" class="panel current"> | ||
| 25 | <fieldset> | ||
| 26 | <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend> | ||
| 27 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 28 | <tr> | ||
| 29 | <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td> | ||
| 30 | <td> | ||
| 31 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 32 | <tr> | ||
| 33 | <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td> | ||
| 34 | <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td> | ||
| 35 | </tr> | ||
| 36 | </table> | ||
| 37 | </td> | ||
| 38 | </tr> | ||
| 39 | <tr> | ||
| 40 | <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td> | ||
| 41 | <td><input id="cite" name="cite" type="text" value="" class="field" /></td> | ||
| 42 | </tr> | ||
| 43 | </table> | ||
| 44 | </fieldset> | ||
| 45 | <fieldset> | ||
| 46 | <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend> | ||
| 47 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 48 | <tr> | ||
| 49 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 50 | <td><input id="title" name="title" type="text" value="" class="field" /></td> | ||
| 51 | </tr> | ||
| 52 | <tr> | ||
| 53 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 54 | <td><input id="id" name="id" type="text" value="" class="field" /></td> | ||
| 55 | </tr> | ||
| 56 | <tr> | ||
| 57 | <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> | ||
| 58 | <td> | ||
| 59 | <select id="class" name="class" class="field mceEditableSelect"> | ||
| 60 | <option value="">{#not_set}</option> | ||
| 61 | </select> | ||
| 62 | </td> | ||
| 63 | </tr> | ||
| 64 | <tr> | ||
| 65 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 66 | <td><input id="style" name="style" type="text" value="" class="field" /></td> | ||
| 67 | </tr> | ||
| 68 | <tr> | ||
| 69 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 70 | <td> | ||
| 71 | <select id="dir" name="dir" class="field"> | ||
| 72 | <option value="">{#not_set}</option> | ||
| 73 | <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> | ||
| 74 | <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> | ||
| 75 | </select> | ||
| 76 | </td> | ||
| 77 | </tr> | ||
| 78 | <tr> | ||
| 79 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 80 | <td> | ||
| 81 | <input id="lang" name="lang" type="text" value="" class="field" /> | ||
| 82 | </td> | ||
| 83 | </tr> | ||
| 84 | </table> | ||
| 85 | </fieldset> | ||
| 86 | </div> | ||
| 87 | <div id="events_panel" class="panel"> | ||
| 88 | <fieldset> | ||
| 89 | <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend> | ||
| 90 | |||
| 91 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 92 | <tr> | ||
| 93 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 94 | <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> | ||
| 95 | </tr> | ||
| 96 | |||
| 97 | <tr> | ||
| 98 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 99 | <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> | ||
| 100 | </tr> | ||
| 101 | |||
| 102 | <tr> | ||
| 103 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 104 | <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> | ||
| 105 | </tr> | ||
| 106 | |||
| 107 | <tr> | ||
| 108 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 109 | <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> | ||
| 110 | </tr> | ||
| 111 | |||
| 112 | <tr> | ||
| 113 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 114 | <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> | ||
| 115 | </tr> | ||
| 116 | |||
| 117 | <tr> | ||
| 118 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 119 | <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> | ||
| 120 | </tr> | ||
| 121 | |||
| 122 | <tr> | ||
| 123 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 124 | <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> | ||
| 125 | </tr> | ||
| 126 | |||
| 127 | <tr> | ||
| 128 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 129 | <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> | ||
| 130 | </tr> | ||
| 131 | |||
| 132 | <tr> | ||
| 133 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 134 | <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> | ||
| 135 | </tr> | ||
| 136 | |||
| 137 | <tr> | ||
| 138 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 139 | <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> | ||
| 140 | </tr> | ||
| 141 | |||
| 142 | <tr> | ||
| 143 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 144 | <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> | ||
| 145 | </tr> | ||
| 146 | |||
| 147 | <tr> | ||
| 148 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 149 | <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> | ||
| 150 | </tr> | ||
| 151 | </table> | ||
| 152 | </fieldset> | ||
| 153 | </div> | ||
| 154 | </div> | ||
| 155 | <div class="mceActionPanel"> | ||
| 156 | <div style="float: left"> | ||
| 157 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 158 | </div> | ||
| 159 | <div style="float: left"> | ||
| 160 | <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" /> | ||
| 161 | </div> | ||
| 162 | <div style="float: right"> | ||
| 163 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 164 | </div> | ||
| 165 | </div> | ||
| 166 | |||
| 167 | </form> | ||
| 168 | |||
| 169 | </body> | ||
| 170 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js new file mode 100755 index 0000000..00c178e --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){tinymce.create('tinymce.plugins.XHTMLXtrasPlugin',{init:function(ed,url){ed.addCommand('mceCite',function(){ed.windowManager.open({file:url+'/cite.htm',width:350+parseInt(ed.getLang('xhtmlxtras.cite_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.cite_delta_height',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAcronym',function(){ed.windowManager.open({file:url+'/acronym.htm',width:350+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAbbr',function(){ed.windowManager.open({file:url+'/abbr.htm',width:350+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceDel',function(){ed.windowManager.open({file:url+'/del.htm',width:340+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceIns',function(){ed.windowManager.open({file:url+'/ins.htm',width:340+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAttributes',function(){ed.windowManager.open({file:url+'/attributes.htm',width:380,height:370,inline:1},{plugin_url:url});});ed.addButton('cite',{title:'xhtmlxtras.cite_desc',cmd:'mceCite'});ed.addButton('acronym',{title:'xhtmlxtras.acronym_desc',cmd:'mceAcronym'});ed.addButton('abbr',{title:'xhtmlxtras.abbr_desc',cmd:'mceAbbr'});ed.addButton('del',{title:'xhtmlxtras.del_desc',cmd:'mceDel'});ed.addButton('ins',{title:'xhtmlxtras.ins_desc',cmd:'mceIns'});ed.addButton('attribs',{title:'xhtmlxtras.attribs_desc',cmd:'mceAttributes'});if(tinymce.isIE){function fix(ed,o){if(o.set){o.content=o.content.replace(/<abbr([^>]+)>/gi,'<html:abbr $1>');o.content=o.content.replace(/<\/abbr>/gi,'</html:abbr>');}};ed.onBeforeSetContent.add(fix);ed.onPostProcess.add(fix);}ed.onNodeChange.add(function(ed,cm,n,co){n=ed.dom.getParent(n,'CITE,ACRONYM,ABBR,DEL,INS');cm.setDisabled('cite',co);cm.setDisabled('acronym',co);cm.setDisabled('abbr',co);cm.setDisabled('del',co);cm.setDisabled('ins',co);cm.setDisabled('attribs',n&&n.nodeName=='BODY');cm.setActive('cite',0);cm.setActive('acronym',0);cm.setActive('abbr',0);cm.setActive('del',0);cm.setActive('ins',0);if(n){do{cm.setDisabled(n.nodeName.toLowerCase(),0);cm.setActive(n.nodeName.toLowerCase(),1);}while(n=n.parentNode);}});},getInfo:function(){return{longname:'XHTML Xtras Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('xhtmlxtras',tinymce.plugins.XHTMLXtrasPlugin);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js new file mode 100755 index 0000000..bef06f2 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js | |||
| @@ -0,0 +1,136 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | // Register commands | ||
| 12 | ed.addCommand('mceCite', function() { | ||
| 13 | ed.windowManager.open({ | ||
| 14 | file : url + '/cite.htm', | ||
| 15 | width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), | ||
| 16 | height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), | ||
| 17 | inline : 1 | ||
| 18 | }, { | ||
| 19 | plugin_url : url | ||
| 20 | }); | ||
| 21 | }); | ||
| 22 | |||
| 23 | ed.addCommand('mceAcronym', function() { | ||
| 24 | ed.windowManager.open({ | ||
| 25 | file : url + '/acronym.htm', | ||
| 26 | width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), | ||
| 27 | height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), | ||
| 28 | inline : 1 | ||
| 29 | }, { | ||
| 30 | plugin_url : url | ||
| 31 | }); | ||
| 32 | }); | ||
| 33 | |||
| 34 | ed.addCommand('mceAbbr', function() { | ||
| 35 | ed.windowManager.open({ | ||
| 36 | file : url + '/abbr.htm', | ||
| 37 | width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), | ||
| 38 | height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), | ||
| 39 | inline : 1 | ||
| 40 | }, { | ||
| 41 | plugin_url : url | ||
| 42 | }); | ||
| 43 | }); | ||
| 44 | |||
| 45 | ed.addCommand('mceDel', function() { | ||
| 46 | ed.windowManager.open({ | ||
| 47 | file : url + '/del.htm', | ||
| 48 | width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), | ||
| 49 | height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), | ||
| 50 | inline : 1 | ||
| 51 | }, { | ||
| 52 | plugin_url : url | ||
| 53 | }); | ||
| 54 | }); | ||
| 55 | |||
| 56 | ed.addCommand('mceIns', function() { | ||
| 57 | ed.windowManager.open({ | ||
| 58 | file : url + '/ins.htm', | ||
| 59 | width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), | ||
| 60 | height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), | ||
| 61 | inline : 1 | ||
| 62 | }, { | ||
| 63 | plugin_url : url | ||
| 64 | }); | ||
| 65 | }); | ||
| 66 | |||
| 67 | ed.addCommand('mceAttributes', function() { | ||
| 68 | ed.windowManager.open({ | ||
| 69 | file : url + '/attributes.htm', | ||
| 70 | width : 380, | ||
| 71 | height : 370, | ||
| 72 | inline : 1 | ||
| 73 | }, { | ||
| 74 | plugin_url : url | ||
| 75 | }); | ||
| 76 | }); | ||
| 77 | |||
| 78 | // Register buttons | ||
| 79 | ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); | ||
| 80 | ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); | ||
| 81 | ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); | ||
| 82 | ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); | ||
| 83 | ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); | ||
| 84 | ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); | ||
| 85 | |||
| 86 | if (tinymce.isIE) { | ||
| 87 | function fix(ed, o) { | ||
| 88 | if (o.set) { | ||
| 89 | o.content = o.content.replace(/<abbr([^>]+)>/gi, '<html:abbr $1>'); | ||
| 90 | o.content = o.content.replace(/<\/abbr>/gi, '</html:abbr>'); | ||
| 91 | } | ||
| 92 | }; | ||
| 93 | |||
| 94 | ed.onBeforeSetContent.add(fix); | ||
| 95 | ed.onPostProcess.add(fix); | ||
| 96 | } | ||
| 97 | |||
| 98 | ed.onNodeChange.add(function(ed, cm, n, co) { | ||
| 99 | n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); | ||
| 100 | |||
| 101 | cm.setDisabled('cite', co); | ||
| 102 | cm.setDisabled('acronym', co); | ||
| 103 | cm.setDisabled('abbr', co); | ||
| 104 | cm.setDisabled('del', co); | ||
| 105 | cm.setDisabled('ins', co); | ||
| 106 | cm.setDisabled('attribs', n && n.nodeName == 'BODY'); | ||
| 107 | cm.setActive('cite', 0); | ||
| 108 | cm.setActive('acronym', 0); | ||
| 109 | cm.setActive('abbr', 0); | ||
| 110 | cm.setActive('del', 0); | ||
| 111 | cm.setActive('ins', 0); | ||
| 112 | |||
| 113 | // Activate all | ||
| 114 | if (n) { | ||
| 115 | do { | ||
| 116 | cm.setDisabled(n.nodeName.toLowerCase(), 0); | ||
| 117 | cm.setActive(n.nodeName.toLowerCase(), 1); | ||
| 118 | } while (n = n.parentNode); | ||
| 119 | } | ||
| 120 | }); | ||
| 121 | }, | ||
| 122 | |||
| 123 | getInfo : function() { | ||
| 124 | return { | ||
| 125 | longname : 'XHTML Xtras Plugin', | ||
| 126 | author : 'Moxiecode Systems AB', | ||
| 127 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 128 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', | ||
| 129 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 130 | }; | ||
| 131 | } | ||
| 132 | }); | ||
| 133 | |||
| 134 | // Register plugin | ||
| 135 | tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); | ||
| 136 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm new file mode 100755 index 0000000..c0f056f --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm | |||
| @@ -0,0 +1,170 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.title_ins_element}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/element_common.js"></script> | ||
| 10 | <script type="text/javascript" src="js/ins.js"></script> | ||
| 11 | <link rel="stylesheet" type="text/css" href="css/popup.css" /> | ||
| 12 | <base target="_self" /> | ||
| 13 | </head> | ||
| 14 | <body id="xhtmlxtrasins" style="display: none"> | ||
| 15 | <form onsubmit="insertIns();return false;" action="#"> | ||
| 16 | <div class="tabs"> | ||
| 17 | <ul> | ||
| 18 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li> | ||
| 19 | <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> --> | ||
| 20 | </ul> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div class="panel_wrapper"> | ||
| 24 | <div id="general_panel" class="panel current"> | ||
| 25 | <fieldset> | ||
| 26 | <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend> | ||
| 27 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 28 | <tr> | ||
| 29 | <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td> | ||
| 30 | <td> | ||
| 31 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 32 | <tr> | ||
| 33 | <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td> | ||
| 34 | <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td> | ||
| 35 | </tr> | ||
| 36 | </table> | ||
| 37 | </td> | ||
| 38 | </tr> | ||
| 39 | <tr> | ||
| 40 | <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td> | ||
| 41 | <td><input id="cite" name="cite" type="text" value="" class="field" /></td> | ||
| 42 | </tr> | ||
| 43 | </table> | ||
| 44 | </fieldset> | ||
| 45 | <fieldset> | ||
| 46 | <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend> | ||
| 47 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 48 | <tr> | ||
| 49 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 50 | <td><input id="title" name="title" type="text" value="" class="field" /></td> | ||
| 51 | </tr> | ||
| 52 | <tr> | ||
| 53 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 54 | <td><input id="id" name="id" type="text" value="" class="field" /></td> | ||
| 55 | </tr> | ||
| 56 | <tr> | ||
| 57 | <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> | ||
| 58 | <td> | ||
| 59 | <select id="class" name="class" class="field mceEditableSelect"> | ||
| 60 | <option value="">{#not_set}</option> | ||
| 61 | </select> | ||
| 62 | </td> | ||
| 63 | </tr> | ||
| 64 | <tr> | ||
| 65 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 66 | <td><input id="style" name="style" type="text" value="" class="field" /></td> | ||
| 67 | </tr> | ||
| 68 | <tr> | ||
| 69 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 70 | <td> | ||
| 71 | <select id="dir" name="dir" class="field"> | ||
| 72 | <option value="">{#not_set}</option> | ||
| 73 | <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> | ||
| 74 | <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> | ||
| 75 | </select> | ||
| 76 | </td> | ||
| 77 | </tr> | ||
| 78 | <tr> | ||
| 79 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 80 | <td> | ||
| 81 | <input id="lang" name="lang" type="text" value="" class="field" /> | ||
| 82 | </td> | ||
| 83 | </tr> | ||
| 84 | </table> | ||
| 85 | </fieldset> | ||
| 86 | </div> | ||
| 87 | <div id="events_panel" class="panel"> | ||
| 88 | <fieldset> | ||
| 89 | <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend> | ||
| 90 | |||
| 91 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 92 | <tr> | ||
| 93 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 94 | <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> | ||
| 95 | </tr> | ||
| 96 | |||
| 97 | <tr> | ||
| 98 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 99 | <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> | ||
| 100 | </tr> | ||
| 101 | |||
| 102 | <tr> | ||
| 103 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 104 | <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> | ||
| 105 | </tr> | ||
| 106 | |||
| 107 | <tr> | ||
| 108 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 109 | <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> | ||
| 110 | </tr> | ||
| 111 | |||
| 112 | <tr> | ||
| 113 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 114 | <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> | ||
| 115 | </tr> | ||
| 116 | |||
| 117 | <tr> | ||
| 118 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 119 | <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> | ||
| 120 | </tr> | ||
| 121 | |||
| 122 | <tr> | ||
| 123 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 124 | <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> | ||
| 125 | </tr> | ||
| 126 | |||
| 127 | <tr> | ||
| 128 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 129 | <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> | ||
| 130 | </tr> | ||
| 131 | |||
| 132 | <tr> | ||
| 133 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 134 | <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> | ||
| 135 | </tr> | ||
| 136 | |||
| 137 | <tr> | ||
| 138 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 139 | <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> | ||
| 140 | </tr> | ||
| 141 | |||
| 142 | <tr> | ||
| 143 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 144 | <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> | ||
| 145 | </tr> | ||
| 146 | |||
| 147 | <tr> | ||
| 148 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 149 | <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> | ||
| 150 | </tr> | ||
| 151 | </table> | ||
| 152 | </fieldset> | ||
| 153 | </div> | ||
| 154 | </div> | ||
| 155 | <div class="mceActionPanel"> | ||
| 156 | <div style="float: left"> | ||
| 157 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 158 | </div> | ||
| 159 | <div style="float: left"> | ||
| 160 | <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" /> | ||
| 161 | </div> | ||
| 162 | <div style="float: right"> | ||
| 163 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 164 | </div> | ||
| 165 | </div> | ||
| 166 | |||
| 167 | </form> | ||
| 168 | |||
| 169 | </body> | ||
| 170 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js new file mode 100755 index 0000000..e84b6a8 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | SXE.initElementDialog('abbr'); | ||
| 10 | if (SXE.currentAction == "update") { | ||
| 11 | SXE.showRemoveButton(); | ||
| 12 | } | ||
| 13 | } | ||
| 14 | |||
| 15 | function insertAbbr() { | ||
| 16 | SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr'); | ||
| 17 | tinyMCEPopup.close(); | ||
| 18 | } | ||
| 19 | |||
| 20 | function removeAbbr() { | ||
| 21 | SXE.removeElement('abbr'); | ||
| 22 | tinyMCEPopup.close(); | ||
| 23 | } | ||
| 24 | |||
| 25 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js new file mode 100755 index 0000000..933d122 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | SXE.initElementDialog('acronym'); | ||
| 10 | if (SXE.currentAction == "update") { | ||
| 11 | SXE.showRemoveButton(); | ||
| 12 | } | ||
| 13 | } | ||
| 14 | |||
| 15 | function insertAcronym() { | ||
| 16 | SXE.insertElement('acronym'); | ||
| 17 | tinyMCEPopup.close(); | ||
| 18 | } | ||
| 19 | |||
| 20 | function removeAcronym() { | ||
| 21 | SXE.removeElement('acronym'); | ||
| 22 | tinyMCEPopup.close(); | ||
| 23 | } | ||
| 24 | |||
| 25 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js new file mode 100755 index 0000000..23c7fa4 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js | |||
| @@ -0,0 +1,123 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | tinyMCEPopup.resizeToInnerSize(); | ||
| 10 | var inst = tinyMCEPopup.editor; | ||
| 11 | var dom = inst.dom; | ||
| 12 | var elm = inst.selection.getNode(); | ||
| 13 | var f = document.forms[0]; | ||
| 14 | var onclick = dom.getAttrib(elm, 'onclick'); | ||
| 15 | |||
| 16 | setFormValue('title', dom.getAttrib(elm, 'title')); | ||
| 17 | setFormValue('id', dom.getAttrib(elm, 'id')); | ||
| 18 | setFormValue('style', dom.getAttrib(elm, "style")); | ||
| 19 | setFormValue('dir', dom.getAttrib(elm, 'dir')); | ||
| 20 | setFormValue('lang', dom.getAttrib(elm, 'lang')); | ||
| 21 | setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); | ||
| 22 | setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); | ||
| 23 | setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); | ||
| 24 | setFormValue('onblur', dom.getAttrib(elm, 'onblur')); | ||
| 25 | setFormValue('onclick', onclick); | ||
| 26 | setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); | ||
| 27 | setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); | ||
| 28 | setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); | ||
| 29 | setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); | ||
| 30 | setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); | ||
| 31 | setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); | ||
| 32 | setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); | ||
| 33 | setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); | ||
| 34 | setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); | ||
| 35 | className = dom.getAttrib(elm, 'class'); | ||
| 36 | |||
| 37 | addClassesToList('classlist', 'advlink_styles'); | ||
| 38 | selectByValue(f, 'classlist', className, true); | ||
| 39 | |||
| 40 | TinyMCE_EditableSelects.init(); | ||
| 41 | } | ||
| 42 | |||
| 43 | function setFormValue(name, value) { | ||
| 44 | if(value && document.forms[0].elements[name]){ | ||
| 45 | document.forms[0].elements[name].value = value; | ||
| 46 | } | ||
| 47 | } | ||
| 48 | |||
| 49 | function insertAction() { | ||
| 50 | var inst = tinyMCEPopup.editor; | ||
| 51 | var elm = inst.selection.getNode(); | ||
| 52 | |||
| 53 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 54 | setAllAttribs(elm); | ||
| 55 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 56 | tinyMCEPopup.close(); | ||
| 57 | } | ||
| 58 | |||
| 59 | function setAttrib(elm, attrib, value) { | ||
| 60 | var formObj = document.forms[0]; | ||
| 61 | var valueElm = formObj.elements[attrib.toLowerCase()]; | ||
| 62 | var inst = tinyMCEPopup.editor; | ||
| 63 | var dom = inst.dom; | ||
| 64 | |||
| 65 | if (typeof(value) == "undefined" || value == null) { | ||
| 66 | value = ""; | ||
| 67 | |||
| 68 | if (valueElm) | ||
| 69 | value = valueElm.value; | ||
| 70 | } | ||
| 71 | |||
| 72 | if (value != "") { | ||
| 73 | dom.setAttrib(elm, attrib.toLowerCase(), value); | ||
| 74 | |||
| 75 | if (attrib == "style") | ||
| 76 | attrib = "style.cssText"; | ||
| 77 | |||
| 78 | if (attrib.substring(0, 2) == 'on') | ||
| 79 | value = 'return true;' + value; | ||
| 80 | |||
| 81 | if (attrib == "class") | ||
| 82 | attrib = "className"; | ||
| 83 | |||
| 84 | elm[attrib]=value; | ||
| 85 | } else | ||
| 86 | elm.removeAttribute(attrib); | ||
| 87 | } | ||
| 88 | |||
| 89 | function setAllAttribs(elm) { | ||
| 90 | var f = document.forms[0]; | ||
| 91 | |||
| 92 | setAttrib(elm, 'title'); | ||
| 93 | setAttrib(elm, 'id'); | ||
| 94 | setAttrib(elm, 'style'); | ||
| 95 | setAttrib(elm, 'class', getSelectValue(f, 'classlist')); | ||
| 96 | setAttrib(elm, 'dir'); | ||
| 97 | setAttrib(elm, 'lang'); | ||
| 98 | setAttrib(elm, 'tabindex'); | ||
| 99 | setAttrib(elm, 'accesskey'); | ||
| 100 | setAttrib(elm, 'onfocus'); | ||
| 101 | setAttrib(elm, 'onblur'); | ||
| 102 | setAttrib(elm, 'onclick'); | ||
| 103 | setAttrib(elm, 'ondblclick'); | ||
| 104 | setAttrib(elm, 'onmousedown'); | ||
| 105 | setAttrib(elm, 'onmouseup'); | ||
| 106 | setAttrib(elm, 'onmouseover'); | ||
| 107 | setAttrib(elm, 'onmousemove'); | ||
| 108 | setAttrib(elm, 'onmouseout'); | ||
| 109 | setAttrib(elm, 'onkeypress'); | ||
| 110 | setAttrib(elm, 'onkeydown'); | ||
| 111 | setAttrib(elm, 'onkeyup'); | ||
| 112 | |||
| 113 | // Refresh in old MSIE | ||
| 114 | // if (tinyMCE.isMSIE5) | ||
| 115 | // elm.outerHTML = elm.outerHTML; | ||
| 116 | } | ||
| 117 | |||
| 118 | function insertAttribute() { | ||
| 119 | tinyMCEPopup.close(); | ||
| 120 | } | ||
| 121 | |||
| 122 | tinyMCEPopup.onInit.add(init); | ||
| 123 | tinyMCEPopup.requireLangPack(); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js new file mode 100755 index 0000000..c36f7fd --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | SXE.initElementDialog('cite'); | ||
| 10 | if (SXE.currentAction == "update") { | ||
| 11 | SXE.showRemoveButton(); | ||
| 12 | } | ||
| 13 | } | ||
| 14 | |||
| 15 | function insertCite() { | ||
| 16 | SXE.insertElement('cite'); | ||
| 17 | tinyMCEPopup.close(); | ||
| 18 | } | ||
| 19 | |||
| 20 | function removeCite() { | ||
| 21 | SXE.removeElement('cite'); | ||
| 22 | tinyMCEPopup.close(); | ||
| 23 | } | ||
| 24 | |||
| 25 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js new file mode 100755 index 0000000..7049f2b --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | SXE.initElementDialog('del'); | ||
| 10 | if (SXE.currentAction == "update") { | ||
| 11 | setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); | ||
| 12 | setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); | ||
| 13 | SXE.showRemoveButton(); | ||
| 14 | } | ||
| 15 | } | ||
| 16 | |||
| 17 | function setElementAttribs(elm) { | ||
| 18 | setAllCommonAttribs(elm); | ||
| 19 | setAttrib(elm, 'datetime'); | ||
| 20 | setAttrib(elm, 'cite'); | ||
| 21 | } | ||
| 22 | |||
| 23 | function insertDel() { | ||
| 24 | var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); | ||
| 25 | |||
| 26 | tinyMCEPopup.execCommand('mceBeginUndoLevel'); | ||
| 27 | if (elm == null) { | ||
| 28 | var s = SXE.inst.selection.getContent(); | ||
| 29 | if(s.length > 0) { | ||
| 30 | insertInlineElement('del'); | ||
| 31 | var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';}); | ||
| 32 | for (var i=0; i<elementArray.length; i++) { | ||
| 33 | var elm = elementArray[i]; | ||
| 34 | setElementAttribs(elm); | ||
| 35 | } | ||
| 36 | } | ||
| 37 | } else { | ||
| 38 | setElementAttribs(elm); | ||
| 39 | } | ||
| 40 | tinyMCEPopup.editor.nodeChanged(); | ||
| 41 | tinyMCEPopup.execCommand('mceEndUndoLevel'); | ||
| 42 | tinyMCEPopup.close(); | ||
| 43 | } | ||
| 44 | |||
| 45 | function insertInlineElement(en) { | ||
| 46 | var ed = tinyMCEPopup.editor, dom = ed.dom; | ||
| 47 | |||
| 48 | ed.getDoc().execCommand('FontName', false, 'mceinline'); | ||
| 49 | tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) { | ||
| 50 | if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') | ||
| 51 | dom.replace(dom.create(en), n, 1); | ||
| 52 | }); | ||
| 53 | } | ||
| 54 | |||
| 55 | function removeDel() { | ||
| 56 | SXE.removeElement('del'); | ||
| 57 | tinyMCEPopup.close(); | ||
| 58 | } | ||
| 59 | |||
| 60 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js new file mode 100755 index 0000000..5cdeb21 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js | |||
| @@ -0,0 +1,231 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | tinyMCEPopup.requireLangPack(); | ||
| 9 | |||
| 10 | function initCommonAttributes(elm) { | ||
| 11 | var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; | ||
| 12 | |||
| 13 | // Setup form data for common element attributes | ||
| 14 | setFormValue('title', dom.getAttrib(elm, 'title')); | ||
| 15 | setFormValue('id', dom.getAttrib(elm, 'id')); | ||
| 16 | selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true); | ||
| 17 | setFormValue('style', dom.getAttrib(elm, 'style')); | ||
| 18 | selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir')); | ||
| 19 | setFormValue('lang', dom.getAttrib(elm, 'lang')); | ||
| 20 | setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); | ||
| 21 | setFormValue('onblur', dom.getAttrib(elm, 'onblur')); | ||
| 22 | setFormValue('onclick', dom.getAttrib(elm, 'onclick')); | ||
| 23 | setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); | ||
| 24 | setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); | ||
| 25 | setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); | ||
| 26 | setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); | ||
| 27 | setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); | ||
| 28 | setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); | ||
| 29 | setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); | ||
| 30 | setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); | ||
| 31 | setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); | ||
| 32 | } | ||
| 33 | |||
| 34 | function setFormValue(name, value) { | ||
| 35 | if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value; | ||
| 36 | } | ||
| 37 | |||
| 38 | function insertDateTime(id) { | ||
| 39 | document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S"); | ||
| 40 | } | ||
| 41 | |||
| 42 | function getDateTime(d, fmt) { | ||
| 43 | fmt = fmt.replace("%D", "%m/%d/%y"); | ||
| 44 | fmt = fmt.replace("%r", "%I:%M:%S %p"); | ||
| 45 | fmt = fmt.replace("%Y", "" + d.getFullYear()); | ||
| 46 | fmt = fmt.replace("%y", "" + d.getYear()); | ||
| 47 | fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); | ||
| 48 | fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); | ||
| 49 | fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); | ||
| 50 | fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); | ||
| 51 | fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); | ||
| 52 | fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); | ||
| 53 | fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); | ||
| 54 | fmt = fmt.replace("%%", "%"); | ||
| 55 | |||
| 56 | return fmt; | ||
| 57 | } | ||
| 58 | |||
| 59 | function addZeros(value, len) { | ||
| 60 | var i; | ||
| 61 | |||
| 62 | value = "" + value; | ||
| 63 | |||
| 64 | if (value.length < len) { | ||
| 65 | for (i=0; i<(len-value.length); i++) | ||
| 66 | value = "0" + value; | ||
| 67 | } | ||
| 68 | |||
| 69 | return value; | ||
| 70 | } | ||
| 71 | |||
| 72 | function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { | ||
| 73 | if (!form_obj || !form_obj.elements[field_name]) | ||
| 74 | return; | ||
| 75 | |||
| 76 | var sel = form_obj.elements[field_name]; | ||
| 77 | |||
| 78 | var found = false; | ||
| 79 | for (var i=0; i<sel.options.length; i++) { | ||
| 80 | var option = sel.options[i]; | ||
| 81 | |||
| 82 | if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) { | ||
| 83 | option.selected = true; | ||
| 84 | found = true; | ||
| 85 | } else | ||
| 86 | option.selected = false; | ||
| 87 | } | ||
| 88 | |||
| 89 | if (!found && add_custom && value != '') { | ||
| 90 | var option = new Option('Value: ' + value, value); | ||
| 91 | option.selected = true; | ||
| 92 | sel.options[sel.options.length] = option; | ||
| 93 | } | ||
| 94 | |||
| 95 | return found; | ||
| 96 | } | ||
| 97 | |||
| 98 | function setAttrib(elm, attrib, value) { | ||
| 99 | var formObj = document.forms[0]; | ||
| 100 | var valueElm = formObj.elements[attrib.toLowerCase()]; | ||
| 101 | tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value); | ||
| 102 | } | ||
| 103 | |||
| 104 | function setAllCommonAttribs(elm) { | ||
| 105 | setAttrib(elm, 'title'); | ||
| 106 | setAttrib(elm, 'id'); | ||
| 107 | setAttrib(elm, 'class'); | ||
| 108 | setAttrib(elm, 'style'); | ||
| 109 | setAttrib(elm, 'dir'); | ||
| 110 | setAttrib(elm, 'lang'); | ||
| 111 | /*setAttrib(elm, 'onfocus'); | ||
| 112 | setAttrib(elm, 'onblur'); | ||
| 113 | setAttrib(elm, 'onclick'); | ||
| 114 | setAttrib(elm, 'ondblclick'); | ||
| 115 | setAttrib(elm, 'onmousedown'); | ||
| 116 | setAttrib(elm, 'onmouseup'); | ||
| 117 | setAttrib(elm, 'onmouseover'); | ||
| 118 | setAttrib(elm, 'onmousemove'); | ||
| 119 | setAttrib(elm, 'onmouseout'); | ||
| 120 | setAttrib(elm, 'onkeypress'); | ||
| 121 | setAttrib(elm, 'onkeydown'); | ||
| 122 | setAttrib(elm, 'onkeyup');*/ | ||
| 123 | } | ||
| 124 | |||
| 125 | SXE = { | ||
| 126 | currentAction : "insert", | ||
| 127 | inst : tinyMCEPopup.editor, | ||
| 128 | updateElement : null | ||
| 129 | } | ||
| 130 | |||
| 131 | SXE.focusElement = SXE.inst.selection.getNode(); | ||
| 132 | |||
| 133 | SXE.initElementDialog = function(element_name) { | ||
| 134 | addClassesToList('class', 'xhtmlxtras_styles'); | ||
| 135 | TinyMCE_EditableSelects.init(); | ||
| 136 | |||
| 137 | element_name = element_name.toLowerCase(); | ||
| 138 | var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()); | ||
| 139 | if (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) { | ||
| 140 | SXE.currentAction = "update"; | ||
| 141 | } | ||
| 142 | |||
| 143 | if (SXE.currentAction == "update") { | ||
| 144 | initCommonAttributes(elm); | ||
| 145 | SXE.updateElement = elm; | ||
| 146 | } | ||
| 147 | |||
| 148 | document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true); | ||
| 149 | } | ||
| 150 | |||
| 151 | SXE.insertElement = function(element_name) { | ||
| 152 | var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName; | ||
| 153 | |||
| 154 | tinyMCEPopup.execCommand('mceBeginUndoLevel'); | ||
| 155 | if (elm == null) { | ||
| 156 | var s = SXE.inst.selection.getContent(); | ||
| 157 | if(s.length > 0) { | ||
| 158 | tagName = element_name; | ||
| 159 | |||
| 160 | if (tinymce.isIE && element_name.indexOf('html:') == 0) | ||
| 161 | element_name = element_name.substring(5).toLowerCase(); | ||
| 162 | |||
| 163 | insertInlineElement(element_name); | ||
| 164 | var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); | ||
| 165 | for (var i=0; i<elementArray.length; i++) { | ||
| 166 | var elm = elementArray[i]; | ||
| 167 | |||
| 168 | if (SXE.inst.dom.getAttrib(elm, '_mce_new')) { | ||
| 169 | elm.id = ''; | ||
| 170 | elm.setAttribute('id', ''); | ||
| 171 | elm.removeAttribute('id'); | ||
| 172 | elm.removeAttribute('_mce_new'); | ||
| 173 | |||
| 174 | setAllCommonAttribs(elm); | ||
| 175 | } | ||
| 176 | } | ||
| 177 | } | ||
| 178 | } else { | ||
| 179 | setAllCommonAttribs(elm); | ||
| 180 | } | ||
| 181 | SXE.inst.nodeChanged(); | ||
| 182 | tinyMCEPopup.execCommand('mceEndUndoLevel'); | ||
| 183 | } | ||
| 184 | |||
| 185 | SXE.removeElement = function(element_name){ | ||
| 186 | element_name = element_name.toLowerCase(); | ||
| 187 | elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()); | ||
| 188 | if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){ | ||
| 189 | tinyMCEPopup.execCommand('mceBeginUndoLevel'); | ||
| 190 | tinyMCE.execCommand('mceRemoveNode', false, elm); | ||
| 191 | SXE.inst.nodeChanged(); | ||
| 192 | tinyMCEPopup.execCommand('mceEndUndoLevel'); | ||
| 193 | } | ||
| 194 | } | ||
| 195 | |||
| 196 | SXE.showRemoveButton = function() { | ||
| 197 | document.getElementById("remove").style.display = 'block'; | ||
| 198 | } | ||
| 199 | |||
| 200 | SXE.containsClass = function(elm,cl) { | ||
| 201 | return (elm.className.indexOf(cl) > -1) ? true : false; | ||
| 202 | } | ||
| 203 | |||
| 204 | SXE.removeClass = function(elm,cl) { | ||
| 205 | if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { | ||
| 206 | return true; | ||
| 207 | } | ||
| 208 | var classNames = elm.className.split(" "); | ||
| 209 | var newClassNames = ""; | ||
| 210 | for (var x = 0, cnl = classNames.length; x < cnl; x++) { | ||
| 211 | if (classNames[x] != cl) { | ||
| 212 | newClassNames += (classNames[x] + " "); | ||
| 213 | } | ||
| 214 | } | ||
| 215 | elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end | ||
| 216 | } | ||
| 217 | |||
| 218 | SXE.addClass = function(elm,cl) { | ||
| 219 | if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; | ||
| 220 | return true; | ||
| 221 | } | ||
| 222 | |||
| 223 | function insertInlineElement(en) { | ||
| 224 | var ed = tinyMCEPopup.editor, dom = ed.dom; | ||
| 225 | |||
| 226 | ed.getDoc().execCommand('FontName', false, 'mceinline'); | ||
| 227 | tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) { | ||
| 228 | if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') | ||
| 229 | dom.replace(dom.create(en, {_mce_new : 1}), n, 1); | ||
| 230 | }); | ||
| 231 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js new file mode 100755 index 0000000..4fcc998 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | SXE.initElementDialog('ins'); | ||
| 10 | if (SXE.currentAction == "update") { | ||
| 11 | setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); | ||
| 12 | setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); | ||
| 13 | SXE.showRemoveButton(); | ||
| 14 | } | ||
| 15 | } | ||
| 16 | |||
| 17 | function setElementAttribs(elm) { | ||
| 18 | setAllCommonAttribs(elm); | ||
| 19 | setAttrib(elm, 'datetime'); | ||
| 20 | setAttrib(elm, 'cite'); | ||
| 21 | } | ||
| 22 | |||
| 23 | function insertIns() { | ||
| 24 | var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); | ||
| 25 | tinyMCEPopup.execCommand('mceBeginUndoLevel'); | ||
| 26 | if (elm == null) { | ||
| 27 | var s = SXE.inst.selection.getContent(); | ||
| 28 | if(s.length > 0) { | ||
| 29 | insertInlineElement('INS'); | ||
| 30 | var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';}); | ||
| 31 | for (var i=0; i<elementArray.length; i++) { | ||
| 32 | var elm = elementArray[i]; | ||
| 33 | setElementAttribs(elm); | ||
| 34 | } | ||
| 35 | } | ||
| 36 | } else { | ||
| 37 | setElementAttribs(elm); | ||
| 38 | } | ||
| 39 | tinyMCEPopup.editor.nodeChanged(); | ||
| 40 | tinyMCEPopup.execCommand('mceEndUndoLevel'); | ||
| 41 | tinyMCEPopup.close(); | ||
| 42 | } | ||
| 43 | |||
| 44 | function removeIns() { | ||
| 45 | SXE.removeElement('ins'); | ||
| 46 | tinyMCEPopup.close(); | ||
| 47 | } | ||
| 48 | |||
| 49 | function insertInlineElement(en) { | ||
| 50 | var ed = tinyMCEPopup.editor, dom = ed.dom; | ||
| 51 | |||
| 52 | ed.getDoc().execCommand('FontName', false, 'mceinline'); | ||
| 53 | tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) { | ||
| 54 | if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') | ||
| 55 | dom.replace(dom.create(en), n, 1); | ||
| 56 | }); | ||
| 57 | } | ||
| 58 | |||
| 59 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js new file mode 100755 index 0000000..45b6b26 --- /dev/null +++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | tinyMCE.addI18n('en.xhtmlxtras_dlg',{ | ||
| 2 | attribute_label_title:"Title", | ||
| 3 | attribute_label_id:"ID", | ||
| 4 | attribute_label_class:"Class", | ||
| 5 | attribute_label_style:"Style", | ||
| 6 | attribute_label_cite:"Cite", | ||
| 7 | attribute_label_datetime:"Date/Time", | ||
| 8 | attribute_label_langdir:"Text Direction", | ||
| 9 | attribute_option_ltr:"Left to right", | ||
| 10 | attribute_option_rtl:"Right to left", | ||
| 11 | attribute_label_langcode:"Language", | ||
| 12 | attribute_label_tabindex:"TabIndex", | ||
| 13 | attribute_label_accesskey:"AccessKey", | ||
| 14 | attribute_events_tab:"Events", | ||
| 15 | attribute_attrib_tab:"Attributes", | ||
| 16 | general_tab:"General", | ||
| 17 | attrib_tab:"Attributes", | ||
| 18 | events_tab:"Events", | ||
| 19 | fieldset_general_tab:"General Settings", | ||
| 20 | fieldset_attrib_tab:"Element Attributes", | ||
| 21 | fieldset_events_tab:"Element Events", | ||
| 22 | title_ins_element:"Insertion Element", | ||
| 23 | title_del_element:"Deletion Element", | ||
| 24 | title_acronym_element:"Acronym Element", | ||
| 25 | title_abbr_element:"Abbreviation Element", | ||
| 26 | title_cite_element:"Citation Element", | ||
| 27 | remove:"Remove", | ||
| 28 | insert_date:"Insert current date/time", | ||
| 29 | option_ltr:"Left to right", | ||
| 30 | option_rtl:"Right to left", | ||
| 31 | attribs_title:"Insert/Edit Attributes" | ||
| 32 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/about.htm b/public/javascripts/tiny_mce/themes/advanced/about.htm new file mode 100755 index 0000000..4ef2a29 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/about.htm | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.about_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="js/about.js"></script> | ||
| 8 | </head> | ||
| 9 | <body id="about" style="display: none"> | ||
| 10 | <div class="tabs"> | ||
| 11 | <ul> | ||
| 12 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li> | ||
| 13 | <li id="help_tab" style="display:none"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li> | ||
| 14 | <li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li> | ||
| 15 | </ul> | ||
| 16 | </div> | ||
| 17 | |||
| 18 | <div class="panel_wrapper"> | ||
| 19 | <div id="general_panel" class="panel current"> | ||
| 20 | <h3>{#advanced_dlg.about_title}</h3> | ||
| 21 | <p>Version: <span id="version"></span> (<span id="date"></span>)</p> | ||
| 22 | <p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a> | ||
| 23 | by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p> | ||
| 24 | <p>Copyright © 2003-2008, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p> | ||
| 25 | <p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p> | ||
| 26 | |||
| 27 | <div id="buttoncontainer"> | ||
| 28 | <a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a> | ||
| 29 | <a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a> | ||
| 30 | <a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a> | ||
| 31 | </div> | ||
| 32 | </div> | ||
| 33 | |||
| 34 | <div id="plugins_panel" class="panel"> | ||
| 35 | <div id="pluginscontainer"> | ||
| 36 | <h3>{#advanced_dlg.about_loaded}</h3> | ||
| 37 | |||
| 38 | <div id="plugintablecontainer"> | ||
| 39 | </div> | ||
| 40 | |||
| 41 | <p> </p> | ||
| 42 | </div> | ||
| 43 | </div> | ||
| 44 | |||
| 45 | <div id="help_panel" class="panel noscroll" style="overflow: visible;"> | ||
| 46 | <div id="iframecontainer"></div> | ||
| 47 | </div> | ||
| 48 | </div> | ||
| 49 | |||
| 50 | <div class="mceActionPanel"> | ||
| 51 | <div style="float: right"> | ||
| 52 | <input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" /> | ||
| 53 | </div> | ||
| 54 | </div> | ||
| 55 | </body> | ||
| 56 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/anchor.htm b/public/javascripts/tiny_mce/themes/advanced/anchor.htm new file mode 100755 index 0000000..9e4c0b9 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/anchor.htm | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.anchor_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/anchor.js"></script> | ||
| 7 | <base target="_self" /> | ||
| 8 | </head> | ||
| 9 | <body style="display: none"> | ||
| 10 | <form onsubmit="AnchorDialog.update();return false;" action="#"> | ||
| 11 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 12 | <tr> | ||
| 13 | <td colspan="2" class="title">{#advanced_dlg.anchor_title}</td> | ||
| 14 | </tr> | ||
| 15 | <tr> | ||
| 16 | <td nowrap="nowrap">{#advanced_dlg.anchor_name}:</td> | ||
| 17 | <td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" /></td> | ||
| 18 | </tr> | ||
| 19 | </table> | ||
| 20 | |||
| 21 | <div class="mceActionPanel"> | ||
| 22 | <div style="float: left"> | ||
| 23 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 24 | </div> | ||
| 25 | |||
| 26 | <div style="float: right"> | ||
| 27 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 28 | </div> | ||
| 29 | </div> | ||
| 30 | </form> | ||
| 31 | </body> | ||
| 32 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/charmap.htm b/public/javascripts/tiny_mce/themes/advanced/charmap.htm new file mode 100755 index 0000000..e4c7344 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/charmap.htm | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.charmap_title}</title> | ||
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> | ||
| 6 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 7 | <script type="text/javascript" src="js/charmap.js"></script> | ||
| 8 | <base target="_self" /> | ||
| 9 | </head> | ||
| 10 | <body id="charmap" style="display:none"> | ||
| 11 | <table align="center" border="0" cellspacing="0" cellpadding="2"> | ||
| 12 | <tr> | ||
| 13 | <td colspan="2" class="title">{#advanced_dlg.charmap_title}</td> | ||
| 14 | </tr> | ||
| 15 | <tr> | ||
| 16 | <td id="charmapView" rowspan="2" align="left" valign="top"> | ||
| 17 | <!-- Chars will be rendered here --> | ||
| 18 | </td> | ||
| 19 | <td width="100" align="center" valign="top"> | ||
| 20 | <table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px"> | ||
| 21 | <tr> | ||
| 22 | <td id="codeV"> </td> | ||
| 23 | </tr> | ||
| 24 | <tr> | ||
| 25 | <td id="codeN"> </td> | ||
| 26 | </tr> | ||
| 27 | </table> | ||
| 28 | </td> | ||
| 29 | </tr> | ||
| 30 | <tr> | ||
| 31 | <td valign="bottom" style="padding-bottom: 3px;"> | ||
| 32 | <table width="100" align="center" border="0" cellpadding="2" cellspacing="0"> | ||
| 33 | <tr> | ||
| 34 | <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">HTML-Code</td> | ||
| 35 | </tr> | ||
| 36 | <tr> | ||
| 37 | <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center"> </td> | ||
| 38 | </tr> | ||
| 39 | <tr> | ||
| 40 | <td style="font-size: 1px;"> </td> | ||
| 41 | </tr> | ||
| 42 | <tr> | ||
| 43 | <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">NUM-Code</td> | ||
| 44 | </tr> | ||
| 45 | <tr> | ||
| 46 | <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center"> </td> | ||
| 47 | </tr> | ||
| 48 | </table> | ||
| 49 | </td> | ||
| 50 | </tr> | ||
| 51 | </table> | ||
| 52 | |||
| 53 | </body> | ||
| 54 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/color_picker.htm b/public/javascripts/tiny_mce/themes/advanced/color_picker.htm new file mode 100755 index 0000000..a8f297c --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/color_picker.htm | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.colorpicker_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="js/color_picker.js"></script> | ||
| 8 | <base target="_self" /> | ||
| 9 | </head> | ||
| 10 | <body id="colorpicker" style="display: none"> | ||
| 11 | <form onsubmit="insertAction();return false" action="#"> | ||
| 12 | <div class="tabs"> | ||
| 13 | <ul> | ||
| 14 | <li id="picker_tab" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li> | ||
| 15 | <li id="rgb_tab"><span><a href="javascript:;" onclick="generateWebColors();mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li> | ||
| 16 | <li id="named_tab"><span><a href="javascript:;" onclick="generateNamedColors();javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li> | ||
| 17 | </ul> | ||
| 18 | </div> | ||
| 19 | |||
| 20 | <div class="panel_wrapper"> | ||
| 21 | <div id="picker_panel" class="panel current"> | ||
| 22 | <fieldset> | ||
| 23 | <legend>{#advanced_dlg.colorpicker_picker_title}</legend> | ||
| 24 | <div id="picker"> | ||
| 25 | <img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" /> | ||
| 26 | |||
| 27 | <div id="light"> | ||
| 28 | <!-- Will be filled with divs --> | ||
| 29 | </div> | ||
| 30 | |||
| 31 | <br style="clear: both" /> | ||
| 32 | </div> | ||
| 33 | </fieldset> | ||
| 34 | </div> | ||
| 35 | |||
| 36 | <div id="rgb_panel" class="panel"> | ||
| 37 | <fieldset> | ||
| 38 | <legend>{#advanced_dlg.colorpicker_palette_title}</legend> | ||
| 39 | <div id="webcolors"> | ||
| 40 | <!-- Gets filled with web safe colors--> | ||
| 41 | </div> | ||
| 42 | |||
| 43 | <br style="clear: both" /> | ||
| 44 | </fieldset> | ||
| 45 | </div> | ||
| 46 | |||
| 47 | <div id="named_panel" class="panel"> | ||
| 48 | <fieldset> | ||
| 49 | <legend>{#advanced_dlg.colorpicker_named_title}</legend> | ||
| 50 | <div id="namedcolors"> | ||
| 51 | <!-- Gets filled with named colors--> | ||
| 52 | </div> | ||
| 53 | |||
| 54 | <br style="clear: both" /> | ||
| 55 | |||
| 56 | <div id="colornamecontainer"> | ||
| 57 | {#advanced_dlg.colorpicker_name} <span id="colorname"></span> | ||
| 58 | </div> | ||
| 59 | </fieldset> | ||
| 60 | </div> | ||
| 61 | </div> | ||
| 62 | |||
| 63 | <div class="mceActionPanel"> | ||
| 64 | <div style="float: left"> | ||
| 65 | <input type="submit" id="insert" name="insert" value="{#apply}" /> | ||
| 66 | </div> | ||
| 67 | |||
| 68 | <div id="preview"></div> | ||
| 69 | |||
| 70 | <div id="previewblock"> | ||
| 71 | <label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" maxlength="8" class="text mceFocus" /> | ||
| 72 | </div> | ||
| 73 | </div> | ||
| 74 | </form> | ||
| 75 | </body> | ||
| 76 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/editor_template.js b/public/javascripts/tiny_mce/themes/advanced/editor_template.js new file mode 100755 index 0000000..d72d542 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/editor_template.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,lastExtID,explode=tinymce.explode;tinymce.ThemeManager.requireLangPack('advanced');tinymce.create('tinymce.themes.AdvancedTheme',{sizes:[8,10,12,14,18,24,36],controls:{bold:['bold_desc','Bold'],italic:['italic_desc','Italic'],underline:['underline_desc','Underline'],strikethrough:['striketrough_desc','Strikethrough'],justifyleft:['justifyleft_desc','JustifyLeft'],justifycenter:['justifycenter_desc','JustifyCenter'],justifyright:['justifyright_desc','JustifyRight'],justifyfull:['justifyfull_desc','JustifyFull'],bullist:['bullist_desc','InsertUnorderedList'],numlist:['numlist_desc','InsertOrderedList'],outdent:['outdent_desc','Outdent'],indent:['indent_desc','Indent'],cut:['cut_desc','Cut'],copy:['copy_desc','Copy'],paste:['paste_desc','Paste'],undo:['undo_desc','Undo'],redo:['redo_desc','Redo'],link:['link_desc','mceLink'],unlink:['unlink_desc','unlink'],image:['image_desc','mceImage'],cleanup:['cleanup_desc','mceCleanup'],help:['help_desc','mceHelp'],code:['code_desc','mceCodeEditor'],hr:['hr_desc','InsertHorizontalRule'],removeformat:['removeformat_desc','RemoveFormat'],sub:['sub_desc','subscript'],sup:['sup_desc','superscript'],forecolor:['forecolor_desc','ForeColor'],forecolorpicker:['forecolor_desc','mceForeColor'],backcolor:['backcolor_desc','HiliteColor'],backcolorpicker:['backcolor_desc','mceBackColor'],charmap:['charmap_desc','mceCharMap'],visualaid:['visualaid_desc','mceToggleVisualAid'],anchor:['anchor_desc','mceInsertAnchor'],newdocument:['newdocument_desc','mceNewDocument'],blockquote:['blockquote_desc','mceBlockQuote']},stateControls:['bold','italic','underline','strikethrough','bullist','numlist','justifyleft','justifycenter','justifyright','justifyfull','sub','sup','blockquote'],init:function(ed,url){var t=this,s,v,o;t.editor=ed;t.url=url;t.onResolveName=new tinymce.util.Dispatcher(this);t.settings=s=extend({theme_advanced_path:true,theme_advanced_toolbar_location:'bottom',theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:ed.settings.readonly},ed.settings);if(!s.font_size_style_values)s.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt";if(tinymce.is(s.theme_advanced_font_sizes,'string')){s.font_size_style_values=tinymce.explode(s.font_size_style_values);s.font_size_classes=tinymce.explode(s.font_size_classes||'');o={};ed.settings.theme_advanced_font_sizes=s.theme_advanced_font_sizes;each(ed.getParam('theme_advanced_font_sizes','','hash'),function(v,k){var cl;if(k==v&&v>=1&&v<=7){k=v+' ('+t.sizes[v-1]+'pt)';if(ed.settings.convert_fonts_to_spans){cl=s.font_size_classes[v-1];v=s.font_size_style_values[v-1]||(t.sizes[v-1]+'pt');}}if(/\s*\./.test(v))cl=v.replace(/\./g,'');o[k]=cl?{'class':cl}:{fontSize:v};});s.theme_advanced_font_sizes=o;}if((v=s.theme_advanced_path_location)&&v!='none')s.theme_advanced_statusbar_location=s.theme_advanced_path_location;if(s.theme_advanced_statusbar_location=='none')s.theme_advanced_statusbar_location=0;ed.onInit.add(function(){ed.onNodeChange.add(t._nodeChanged,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/"+ed.settings.skin+"/content.css"));});ed.onSetProgressState.add(function(ed,b,ti){var co,id=ed.id,tb;if(b){t.progressTimer=setTimeout(function(){co=ed.getContainer();co=co.insertBefore(DOM.create('DIV',{style:'position:relative'}),co.firstChild);tb=DOM.get(ed.id+'_tbl');DOM.add(co,'div',{id:id+'_blocker','class':'mceBlocker',style:{width:tb.clientWidth+2,height:tb.clientHeight+2}});DOM.add(co,'div',{id:id+'_progress','class':'mceProgress',style:{left:tb.clientWidth/ 2, top : tb.clientHeight /2}});},ti||0);}else{DOM.remove(id+'_blocker');DOM.remove(id+'_progress');clearTimeout(t.progressTimer);}});DOM.loadCSS(s.editor_css?ed.documentBaseURI.toAbsolute(s.editor_css):url+"/skins/"+ed.settings.skin+"/ui.css");if(s.skin_variant)DOM.loadCSS(url+"/skins/"+ed.settings.skin+"/ui_"+s.skin_variant+".css");},createControl:function(n,cf){var cd,c;if(c=cf.createControl(n))return c;switch(n){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu();}if((cd=this.controls[n]))return cf.createButton(n,{title:"advanced."+cd[0],cmd:cd[1],ui:cd[2],value:cd[3]});},execCommand:function(cmd,ui,val){var f=this['_'+cmd];if(f){f.call(this,ui,val);return true;}return false;},_importClasses:function(e){var ed=this.editor,c=ed.controlManager.get('styleselect');if(c.getLength()==0){each(ed.dom.getClasses(),function(o){c.add(o['class'],o['class']);});}},_createStyleSelect:function(n){var t=this,ed=t.editor,cf=ed.controlManager,c=cf.createListBox('styleselect',{title:'advanced.style_select',onselect:function(v){if(c.selectedValue===v){ed.execCommand('mceSetStyleInfo',0,{command:'removeformat'});c.select();return false;}else ed.execCommand('mceSetCSSClass',0,v);}});if(c){each(ed.getParam('theme_advanced_styles','','hash'),function(v,k){if(v)c.add(t.editor.translate(k),v);});c.onPostRender.add(function(ed,n){if(!c.NativeListBox){Event.add(n.id+'_text','focus',t._importClasses,t);Event.add(n.id+'_text','mousedown',t._importClasses,t);Event.add(n.id+'_open','focus',t._importClasses,t);Event.add(n.id+'_open','mousedown',t._importClasses,t);}else Event.add(n.id,'focus',t._importClasses,t);});}return c;},_createFontSelect:function(){var c,t=this,ed=t.editor;c=ed.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',cmd:'FontName'});if(c){each(ed.getParam('theme_advanced_fonts',t.settings.theme_advanced_fonts,'hash'),function(v,k){c.add(ed.translate(k),v,{style:v.indexOf('dings')==-1?'font-family:'+v:''});});}return c;},_createFontSizeSelect:function(){var t=this,ed=t.editor,c,i=0,cl=[];c=ed.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',onselect:function(v){if(v.fontSize)ed.execCommand('FontSize',false,v.fontSize);else{each(t.settings.theme_advanced_font_sizes,function(v,k){if(v['class'])cl.push(v['class']);});ed.editorCommands._applyInlineStyle('span',{'class':v['class']},{check_classes:cl});}}});if(c){each(t.settings.theme_advanced_font_sizes,function(v,k){var fz=v.fontSize;if(fz>=1&&fz<=7)fz=t.sizes[parseInt(fz)-1]+'pt';c.add(k,v,{'style':'font-size:'+fz,'class':'mceFontSize'+(i++)+(' '+(v['class']||''))});});}return c;},_createBlockFormats:function(){var c,fmts={p:'advanced.paragraph',address:'advanced.address',pre:'advanced.pre',h1:'advanced.h1',h2:'advanced.h2',h3:'advanced.h3',h4:'advanced.h4',h5:'advanced.h5',h6:'advanced.h6',div:'advanced.div',blockquote:'advanced.blockquote',code:'advanced.code',dt:'advanced.dt',dd:'advanced.dd',samp:'advanced.samp'},t=this;c=t.editor.controlManager.createListBox('formatselect',{title:'advanced.block',cmd:'FormatBlock'});if(c){each(t.editor.getParam('theme_advanced_blockformats',t.settings.theme_advanced_blockformats,'hash'),function(v,k){c.add(t.editor.translate(k!=v?k:fmts[v]),v,{'class':'mce_formatPreview mce_'+v});});}return c;},_createForeColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_text_colors)o.colors=v;if(s.theme_advanced_default_foreground_color)o.default_color=s.theme_advanced_default_foreground_color;o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_background_colors)o.colors=v;if(s.theme_advanced_default_background_color)o.default_color=s.theme_advanced_default_background_color;o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('backcolor',o);return c;},renderUI:function(o){var n,ic,tb,t=this,ed=t.editor,s=t.settings,sc,p,nl;n=p=DOM.create('span',{id:ed.id+'_parent','class':'mceEditor '+ed.settings.skin+'Skin'+(s.skin_variant?' '+ed.settings.skin+'Skin'+t._ufirst(s.skin_variant):'')});if(!DOM.boxModel)n=DOM.add(n,'div',{'class':'mceOldBoxModel'});n=sc=DOM.add(n,'table',{id:ed.id+'_tbl','class':'mceLayout',cellSpacing:0,cellPadding:0});n=tb=DOM.add(n,'tbody');switch((s.theme_advanced_layout_manager||'').toLowerCase()){case"rowlayout":ic=t._rowLayout(s,tb,o);break;case"customlayout":ic=ed.execCallback("theme_advanced_custom_layout",s,tb,o,p);break;default:ic=t._simpleLayout(s,tb,o,p);}n=o.targetNode;nl=DOM.stdMode?sc.getElementsByTagName('tr'):sc.rows;DOM.addClass(nl[0],'mceFirst');DOM.addClass(nl[nl.length-1],'mceLast');each(DOM.select('tr',tb),function(n){DOM.addClass(n.firstChild,'mceFirst');DOM.addClass(n.childNodes[n.childNodes.length-1],'mceLast');});if(DOM.get(s.theme_advanced_toolbar_container))DOM.get(s.theme_advanced_toolbar_container).appendChild(p);else DOM.insertAfter(p,n);Event.add(ed.id+'_path_row','click',function(e){e=e.target;if(e.nodeName=='A'){t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/,'$1'));return Event.cancel(e);}});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))Event.add(DOM.add(p,'a',{href:'#'},'<!-- IE -->'),'focus',function(){tinyMCE.get(ed.id).focus();});if(s.theme_advanced_toolbar_location=='external')o.deltaHeight=0;t.deltaHeight=o.deltaHeight;o.targetNode=null;return{iframeContainer:ic,editorContainer:ed.id+'_parent',sizeContainer:sc,deltaHeight:o.deltaHeight};},getInfo:function(){return{longname:'Advanced theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}},resizeBy:function(dw,dh){var e=DOM.get(this.editor.id+'_tbl');this.resizeTo(e.clientWidth+dw,e.clientHeight+dh);},resizeTo:function(w,h){var ed=this.editor,s=ed.settings,e=DOM.get(ed.id+'_tbl'),ifr=DOM.get(ed.id+'_ifr'),dh;w=Math.max(s.theme_advanced_resizing_min_width||100,w);h=Math.max(s.theme_advanced_resizing_min_height||100,h);w=Math.min(s.theme_advanced_resizing_max_width||0xFFFF,w);h=Math.min(s.theme_advanced_resizing_max_height||0xFFFF,h);dh=e.clientHeight-ifr.clientHeight;DOM.setStyle(ifr,'height',h-dh);DOM.setStyles(e,{width:w,height:h});},destroy:function(){var id=this.editor.id;Event.clear(id+'_resize');Event.clear(id+'_path_row');Event.clear(id+'_external_close');},_simpleLayout:function(s,tb,o,p){var t=this,ed=t.editor,lo=s.theme_advanced_toolbar_location,sl=s.theme_advanced_statusbar_location,n,ic,etb,c;if(s.readonly){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});return ic;}if(lo=='top')t._addToolbars(tb,o);if(lo=='external'){n=c=DOM.create('div',{style:'position:relative'});n=DOM.add(n,'div',{id:ed.id+'_external','class':'mceExternalToolbar'});DOM.add(n,'a',{id:ed.id+'_external_close',href:'javascript:;','class':'mceExternalClose'});n=DOM.add(n,'table',{id:ed.id+'_tblext',cellSpacing:0,cellPadding:0});etb=DOM.add(n,'tbody');if(p.firstChild.className=='mceOldBoxModel')p.firstChild.appendChild(c);else p.insertBefore(c,p.firstChild);t._addToolbars(etb,o);ed.onMouseUp.add(function(){var e=DOM.get(ed.id+'_external');DOM.show(e);DOM.hide(lastExtID);var f=Event.add(ed.id+'_external_close','click',function(){DOM.hide(ed.id+'_external');Event.remove(ed.id+'_external_close','click',f);});DOM.show(e);DOM.setStyle(e,'top',0-DOM.getRect(ed.id+'_tblext').h-1);DOM.hide(e);DOM.show(e);e.style.filter='';lastExtID=ed.id+'_external';e=null;});}if(sl=='top')t._addStatusBar(tb,o);if(!s.theme_advanced_toolbar_container){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});}if(lo=='bottom')t._addToolbars(tb,o);if(sl=='bottom')t._addStatusBar(tb,o);return ic;},_rowLayout:function(s,tb,o){var t=this,ed=t.editor,dc,da,cf=ed.controlManager,n,ic,to,a;dc=s.theme_advanced_containers_default_class||'';da=s.theme_advanced_containers_default_align||'center';each(explode(s.theme_advanced_containers||''),function(c,i){var v=s['theme_advanced_container_'+c]||'';switch(v.toLowerCase()){case'mceeditor':n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});break;case'mceelementpath':t._addStatusBar(tb,o);break;default:a=(s['theme_advanced_container_'+c+'_align']||da).toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(tb,'tr'),'td',{'class':'mceToolbar '+(s['theme_advanced_container_'+c+'_class']||dc)+' '+a||da});to=cf.createToolbar("toolbar"+i);t._addControls(v,to);DOM.setHTML(n,to.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}});return ic;},_addControls:function(v,tb){var t=this,s=t.settings,di,cf=t.editor.controlManager;if(s.theme_advanced_disable&&!t._disabled){di={};each(explode(s.theme_advanced_disable),function(v){di[v]=1;});t._disabled=di;}else di=t._disabled;each(explode(v),function(n){var c;if(di&&di[n])return;if(n=='tablecontrols'){each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(n){n=t.createControl(n,cf);if(n)tb.add(n);});return;}c=t.createControl(n,cf);if(c)tb.add(c);});},_addToolbars:function(c,o){var t=this,i,tb,ed=t.editor,s=t.settings,v,cf=ed.controlManager,di,n,h=[],a;a=s.theme_advanced_toolbar_align.toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(c,'tr'),'td',{'class':'mceToolbar '+a});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))h.push(DOM.createHTML('a',{href:'#',onfocus:'tinyMCE.get(\''+ed.id+'\').focus();'},'<!-- IE -->'));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},'<!-- IE -->'));for(i=1;(v=s['theme_advanced_buttons'+i]);i++){tb=cf.createToolbar("toolbar"+i,{'class':'mceToolbarRow'+i});if(s['theme_advanced_buttons'+i+'_add'])v+=','+s['theme_advanced_buttons'+i+'_add'];if(s['theme_advanced_buttons'+i+'_add_before'])v=s['theme_advanced_buttons'+i+'_add_before']+','+v;t._addControls(v,tb);h.push(tb.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}h.push(DOM.createHTML('a',{href:'#',accesskey:'z',title:ed.getLang("advanced.toolbar_focus"),onfocus:'tinyMCE.getInstanceById(\''+ed.id+'\').focus();'},'<!-- IE -->'));DOM.setHTML(n,h.join(''));},_addStatusBar:function(tb,o){var n,t=this,ed=t.editor,s=t.settings,r,mf,me,td;n=DOM.add(tb,'tr');n=td=DOM.add(n,'td',{'class':'mceStatusbar'});n=DOM.add(n,'div',{id:ed.id+'_path_row'},s.theme_advanced_path?ed.translate('advanced.path')+': ':' ');DOM.add(n,'a',{href:'#',accesskey:'x'});if(s.theme_advanced_resizing&&!tinymce.isOldWebKit){DOM.add(td,'a',{id:ed.id+'_resize',href:'javascript:;',onclick:"return false;",'class':'mceResize'});if(s.theme_advanced_resizing_use_cookie){ed.onPostRender.add(function(){var o=Cookie.getHash("TinyMCE_"+ed.id+"_size"),c=DOM.get(ed.id+'_tbl');if(!o)return;if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,o.cw)+'px';c.style.height=Math.max(10,o.ch)+'px';DOM.get(ed.id+'_ifr').style.height=Math.max(10,parseInt(o.ch)+t.deltaHeight)+'px';});}ed.onPostRender.add(function(){Event.add(ed.id+'_resize','mousedown',function(e){var c,p,w,h,n,pa;c=DOM.get(ed.id+'_tbl');w=c.clientWidth;h=c.clientHeight;miw=s.theme_advanced_resizing_min_width||100;mih=s.theme_advanced_resizing_min_height||100;maw=s.theme_advanced_resizing_max_width||0xFFFF;mah=s.theme_advanced_resizing_max_height||0xFFFF;p=DOM.add(DOM.get(ed.id+'_parent'),'div',{'class':'mcePlaceHolder'});DOM.setStyles(p,{width:w,height:h});DOM.hide(c);DOM.show(p);r={x:e.screenX,y:e.screenY,w:w,h:h,dx:null,dy:null};mf=Event.add(DOM.doc,'mousemove',function(e){var w,h;r.dx=e.screenX-r.x;r.dy=e.screenY-r.y;w=Math.max(miw,r.w+r.dx);h=Math.max(mih,r.h+r.dy);w=Math.min(maw,w);h=Math.min(mah,h);if(s.theme_advanced_resize_horizontal)p.style.width=w+'px';p.style.height=h+'px';return Event.cancel(e);});me=Event.add(DOM.doc,'mouseup',function(e){var ifr;Event.remove(DOM.doc,'mousemove',mf);Event.remove(DOM.doc,'mouseup',me);c.style.display='';DOM.remove(p);if(r.dx===null)return;ifr=DOM.get(ed.id+'_ifr');if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,r.w+r.dx)+'px';c.style.height=Math.max(10,r.h+r.dy)+'px';ifr.style.height=Math.max(10,ifr.clientHeight+r.dy)+'px';if(s.theme_advanced_resizing_use_cookie){Cookie.setHash("TinyMCE_"+ed.id+"_size",{cw:r.w+r.dx,ch:r.h+r.dy});}});return Event.cancel(e);});});}o.deltaHeight-=21;n=tb=null;},_nodeChanged:function(ed,cm,n,co){var t=this,p,de=0,v,c,s=t.settings,cl,fz,fn;if(s.readonly)return;tinymce.each(t.stateControls,function(c){cm.setActive(c,ed.queryCommandState(t.controls[c][1]));});cm.setActive('visualaid',ed.hasVisual);cm.setDisabled('undo',!ed.undoManager.hasUndo()&&!ed.typing);cm.setDisabled('redo',!ed.undoManager.hasRedo());cm.setDisabled('outdent',!ed.queryCommandState('Outdent'));p=DOM.getParent(n,'A');if(c=cm.get('link')){if(!p||!p.name){c.setDisabled(!p&&co);c.setActive(!!p);}}if(c=cm.get('unlink')){c.setDisabled(!p&&co);c.setActive(!!p&&!p.name);}if(c=cm.get('anchor')){c.setActive(!!p&&p.name);if(tinymce.isWebKit){p=DOM.getParent(n,'IMG');c.setActive(!!p&&DOM.getAttrib(p,'mce_name')=='a');}}p=DOM.getParent(n,'IMG');if(c=cm.get('image'))c.setActive(!!p&&n.className.indexOf('mceItem')==-1);if(c=cm.get('styleselect')){if(n.className){t._importClasses();c.select(n.className);}else c.select();}if(c=cm.get('formatselect')){p=DOM.getParent(n,DOM.isBlock);if(p)c.select(p.nodeName.toLowerCase());}if(ed.settings.convert_fonts_to_spans){ed.dom.getParent(n,function(n){if(n.nodeName==='SPAN'){if(!cl&&n.className)cl=n.className;if(!fz&&n.style.fontSize)fz=n.style.fontSize;if(!fn&&n.style.fontFamily)fn=n.style.fontFamily.replace(/[\"\']+/g,'').replace(/^([^,]+).*/,'$1').toLowerCase();}return false;});if(c=cm.get('fontselect')){c.select(function(v){return v.replace(/^([^,]+).*/,'$1').toLowerCase()==fn;});}if(c=cm.get('fontsizeselect')){c.select(function(v){if(v.fontSize&&v.fontSize===fz)return true;if(v['class']&&v['class']===cl)return true;});}}else{if(c=cm.get('fontselect'))c.select(ed.queryCommandValue('FontName'));if(c=cm.get('fontsizeselect')){v=ed.queryCommandValue('FontSize');c.select(function(iv){return iv.fontSize==v;});}}if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){p=DOM.get(ed.id+'_path')||DOM.add(ed.id+'_path_row','span',{id:ed.id+'_path'});DOM.setHTML(p,'');ed.dom.getParent(n,function(n){var na=n.nodeName.toLowerCase(),u,pi,ti='';if(n.nodeType!=1||n.nodeName==='BR'||(DOM.hasClass(n,'mceItemHidden')||DOM.hasClass(n,'mceItemRemoved')))return;if(v=DOM.getAttrib(n,'mce_name'))na=v;if(tinymce.isIE&&n.scopeName!=='HTML')na=n.scopeName+':'+na;na=na.replace(/mce\:/g,'');switch(na){case'b':na='strong';break;case'i':na='em';break;case'img':if(v=DOM.getAttrib(n,'src'))ti+='src: '+v+' ';break;case'a':if(v=DOM.getAttrib(n,'name')){ti+='name: '+v+' ';na+='#'+v;}if(v=DOM.getAttrib(n,'href'))ti+='href: '+v+' ';break;case'font':if(s.convert_fonts_to_spans)na='span';if(v=DOM.getAttrib(n,'face'))ti+='font: '+v+' ';if(v=DOM.getAttrib(n,'size'))ti+='size: '+v+' ';if(v=DOM.getAttrib(n,'color'))ti+='color: '+v+' ';break;case'span':if(v=DOM.getAttrib(n,'style'))ti+='style: '+v+' ';break;}if(v=DOM.getAttrib(n,'id'))ti+='id: '+v+' ';if(v=n.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,'');if(v&&v.indexOf('mceItem')==-1){ti+='class: '+v+' ';if(DOM.isBlock(n)||na=='img'||na=='span')na+='.'+v;}}na=na.replace(/(html:)/g,'');na={name:na,node:n,title:ti};t.onResolveName.dispatch(t,na);ti=na.title;na=na.name;pi=DOM.create('a',{'href':"javascript:;",onmousedown:"return false;",title:ti,'class':'mcePath_'+(de++)},na);if(p.hasChildNodes()){p.insertBefore(DOM.doc.createTextNode(' \u00bb '),p.firstChild);p.insertBefore(pi,p.firstChild);}else p.appendChild(pi);},ed.getBody());}},_sel:function(v){this.editor.execCommand('mceSelectNodeDepth',false,v);},_mceInsertAnchor:function(ui,v){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm',width:320+parseInt(ed.getLang('advanced.anchor_delta_width',0)),height:90+parseInt(ed.getLang('advanced.anchor_delta_height',0)),inline:true},{theme_url:this.url});},_mceCharMap:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/charmap.htm',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),inline:true},{theme_url:this.url});},_mceHelp:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/about.htm',width:480,height:380,inline:true},{theme_url:this.url});},_mceColorPicker:function(u,v){var ed=this.editor;v=v||{};ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/color_picker.htm',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:250+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true},{input_color:v.color,func:v.func,theme_url:this.url});},_mceCodeEditor:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/source_editor.htm',width:parseInt(ed.getParam("theme_advanced_source_editor_width",720)),height:parseInt(ed.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url});},_mceImage:function(ui,val){var ed=this.editor;if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/image.htm',width:355+parseInt(ed.getLang('advanced.image_delta_width',0)),height:275+parseInt(ed.getLang('advanced.image_delta_height',0)),inline:true},{theme_url:this.url});},_mceLink:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/link.htm',width:310+parseInt(ed.getLang('advanced.link_delta_width',0)),height:200+parseInt(ed.getLang('advanced.link_delta_height',0)),inline:true},{theme_url:this.url});},_mceNewDocument:function(){var ed=this.editor;ed.windowManager.confirm('advanced.newdocument',function(s){if(s)ed.execCommand('mceSetContent',false,'');});},_mceForeColor:function(){var t=this;this._mceColorPicker(0,{color:t.fgColor,func:function(co){t.fgColor=co;t.editor.execCommand('ForeColor',false,co);}});},_mceBackColor:function(){var t=this;this._mceColorPicker(0,{color:t.bgColor,func:function(co){t.bgColor=co;t.editor.execCommand('HiliteColor',false,co);}});},_ufirst:function(s){return s.substring(0,1).toUpperCase()+s.substring(1);}});tinymce.ThemeManager.add('advanced',tinymce.themes.AdvancedTheme);}()); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js b/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js new file mode 100755 index 0000000..b3cef01 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js | |||
| @@ -0,0 +1,1153 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_template_src.js 960 2008-11-12 18:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; | ||
| 10 | |||
| 11 | // Tell it to load theme specific language pack(s) | ||
| 12 | tinymce.ThemeManager.requireLangPack('advanced'); | ||
| 13 | |||
| 14 | tinymce.create('tinymce.themes.AdvancedTheme', { | ||
| 15 | sizes : [8, 10, 12, 14, 18, 24, 36], | ||
| 16 | |||
| 17 | // Control name lookup, format: title, command | ||
| 18 | controls : { | ||
| 19 | bold : ['bold_desc', 'Bold'], | ||
| 20 | italic : ['italic_desc', 'Italic'], | ||
| 21 | underline : ['underline_desc', 'Underline'], | ||
| 22 | strikethrough : ['striketrough_desc', 'Strikethrough'], | ||
| 23 | justifyleft : ['justifyleft_desc', 'JustifyLeft'], | ||
| 24 | justifycenter : ['justifycenter_desc', 'JustifyCenter'], | ||
| 25 | justifyright : ['justifyright_desc', 'JustifyRight'], | ||
| 26 | justifyfull : ['justifyfull_desc', 'JustifyFull'], | ||
| 27 | bullist : ['bullist_desc', 'InsertUnorderedList'], | ||
| 28 | numlist : ['numlist_desc', 'InsertOrderedList'], | ||
| 29 | outdent : ['outdent_desc', 'Outdent'], | ||
| 30 | indent : ['indent_desc', 'Indent'], | ||
| 31 | cut : ['cut_desc', 'Cut'], | ||
| 32 | copy : ['copy_desc', 'Copy'], | ||
| 33 | paste : ['paste_desc', 'Paste'], | ||
| 34 | undo : ['undo_desc', 'Undo'], | ||
| 35 | redo : ['redo_desc', 'Redo'], | ||
| 36 | link : ['link_desc', 'mceLink'], | ||
| 37 | unlink : ['unlink_desc', 'unlink'], | ||
| 38 | image : ['image_desc', 'mceImage'], | ||
| 39 | cleanup : ['cleanup_desc', 'mceCleanup'], | ||
| 40 | help : ['help_desc', 'mceHelp'], | ||
| 41 | code : ['code_desc', 'mceCodeEditor'], | ||
| 42 | hr : ['hr_desc', 'InsertHorizontalRule'], | ||
| 43 | removeformat : ['removeformat_desc', 'RemoveFormat'], | ||
| 44 | sub : ['sub_desc', 'subscript'], | ||
| 45 | sup : ['sup_desc', 'superscript'], | ||
| 46 | forecolor : ['forecolor_desc', 'ForeColor'], | ||
| 47 | forecolorpicker : ['forecolor_desc', 'mceForeColor'], | ||
| 48 | backcolor : ['backcolor_desc', 'HiliteColor'], | ||
| 49 | backcolorpicker : ['backcolor_desc', 'mceBackColor'], | ||
| 50 | charmap : ['charmap_desc', 'mceCharMap'], | ||
| 51 | visualaid : ['visualaid_desc', 'mceToggleVisualAid'], | ||
| 52 | anchor : ['anchor_desc', 'mceInsertAnchor'], | ||
| 53 | newdocument : ['newdocument_desc', 'mceNewDocument'], | ||
| 54 | blockquote : ['blockquote_desc', 'mceBlockQuote'] | ||
| 55 | }, | ||
| 56 | |||
| 57 | stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], | ||
| 58 | |||
| 59 | init : function(ed, url) { | ||
| 60 | var t = this, s, v, o; | ||
| 61 | |||
| 62 | t.editor = ed; | ||
| 63 | t.url = url; | ||
| 64 | t.onResolveName = new tinymce.util.Dispatcher(this); | ||
| 65 | |||
| 66 | // Default settings | ||
| 67 | t.settings = s = extend({ | ||
| 68 | theme_advanced_path : true, | ||
| 69 | theme_advanced_toolbar_location : 'bottom', | ||
| 70 | theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", | ||
| 71 | theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", | ||
| 72 | theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", | ||
| 73 | theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", | ||
| 74 | theme_advanced_toolbar_align : "center", | ||
| 75 | theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", | ||
| 76 | theme_advanced_more_colors : 1, | ||
| 77 | theme_advanced_row_height : 23, | ||
| 78 | theme_advanced_resize_horizontal : 1, | ||
| 79 | theme_advanced_resizing_use_cookie : 1, | ||
| 80 | theme_advanced_font_sizes : "1,2,3,4,5,6,7", | ||
| 81 | readonly : ed.settings.readonly | ||
| 82 | }, ed.settings); | ||
| 83 | |||
| 84 | // Setup default font_size_style_values | ||
| 85 | if (!s.font_size_style_values) | ||
| 86 | s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; | ||
| 87 | |||
| 88 | if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { | ||
| 89 | s.font_size_style_values = tinymce.explode(s.font_size_style_values); | ||
| 90 | s.font_size_classes = tinymce.explode(s.font_size_classes || ''); | ||
| 91 | |||
| 92 | // Parse string value | ||
| 93 | o = {}; | ||
| 94 | ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; | ||
| 95 | each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { | ||
| 96 | var cl; | ||
| 97 | |||
| 98 | if (k == v && v >= 1 && v <= 7) { | ||
| 99 | k = v + ' (' + t.sizes[v - 1] + 'pt)'; | ||
| 100 | |||
| 101 | if (ed.settings.convert_fonts_to_spans) { | ||
| 102 | cl = s.font_size_classes[v - 1]; | ||
| 103 | v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); | ||
| 104 | } | ||
| 105 | } | ||
| 106 | |||
| 107 | if (/\s*\./.test(v)) | ||
| 108 | cl = v.replace(/\./g, ''); | ||
| 109 | |||
| 110 | o[k] = cl ? {'class' : cl} : {fontSize : v}; | ||
| 111 | }); | ||
| 112 | |||
| 113 | s.theme_advanced_font_sizes = o; | ||
| 114 | } | ||
| 115 | |||
| 116 | if ((v = s.theme_advanced_path_location) && v != 'none') | ||
| 117 | s.theme_advanced_statusbar_location = s.theme_advanced_path_location; | ||
| 118 | |||
| 119 | if (s.theme_advanced_statusbar_location == 'none') | ||
| 120 | s.theme_advanced_statusbar_location = 0; | ||
| 121 | |||
| 122 | // Init editor | ||
| 123 | ed.onInit.add(function() { | ||
| 124 | ed.onNodeChange.add(t._nodeChanged, t); | ||
| 125 | |||
| 126 | if (ed.settings.content_css !== false) | ||
| 127 | ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css")); | ||
| 128 | }); | ||
| 129 | |||
| 130 | ed.onSetProgressState.add(function(ed, b, ti) { | ||
| 131 | var co, id = ed.id, tb; | ||
| 132 | |||
| 133 | if (b) { | ||
| 134 | t.progressTimer = setTimeout(function() { | ||
| 135 | co = ed.getContainer(); | ||
| 136 | co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); | ||
| 137 | tb = DOM.get(ed.id + '_tbl'); | ||
| 138 | |||
| 139 | DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); | ||
| 140 | DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); | ||
| 141 | }, ti || 0); | ||
| 142 | } else { | ||
| 143 | DOM.remove(id + '_blocker'); | ||
| 144 | DOM.remove(id + '_progress'); | ||
| 145 | clearTimeout(t.progressTimer); | ||
| 146 | } | ||
| 147 | }); | ||
| 148 | |||
| 149 | DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); | ||
| 150 | |||
| 151 | if (s.skin_variant) | ||
| 152 | DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); | ||
| 153 | }, | ||
| 154 | |||
| 155 | createControl : function(n, cf) { | ||
| 156 | var cd, c; | ||
| 157 | |||
| 158 | if (c = cf.createControl(n)) | ||
| 159 | return c; | ||
| 160 | |||
| 161 | switch (n) { | ||
| 162 | case "styleselect": | ||
| 163 | return this._createStyleSelect(); | ||
| 164 | |||
| 165 | case "formatselect": | ||
| 166 | return this._createBlockFormats(); | ||
| 167 | |||
| 168 | case "fontselect": | ||
| 169 | return this._createFontSelect(); | ||
| 170 | |||
| 171 | case "fontsizeselect": | ||
| 172 | return this._createFontSizeSelect(); | ||
| 173 | |||
| 174 | case "forecolor": | ||
| 175 | return this._createForeColorMenu(); | ||
| 176 | |||
| 177 | case "backcolor": | ||
| 178 | return this._createBackColorMenu(); | ||
| 179 | } | ||
| 180 | |||
| 181 | if ((cd = this.controls[n])) | ||
| 182 | return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); | ||
| 183 | }, | ||
| 184 | |||
| 185 | execCommand : function(cmd, ui, val) { | ||
| 186 | var f = this['_' + cmd]; | ||
| 187 | |||
| 188 | if (f) { | ||
| 189 | f.call(this, ui, val); | ||
| 190 | return true; | ||
| 191 | } | ||
| 192 | |||
| 193 | return false; | ||
| 194 | }, | ||
| 195 | |||
| 196 | _importClasses : function(e) { | ||
| 197 | var ed = this.editor, c = ed.controlManager.get('styleselect'); | ||
| 198 | |||
| 199 | if (c.getLength() == 0) { | ||
| 200 | each(ed.dom.getClasses(), function(o) { | ||
| 201 | c.add(o['class'], o['class']); | ||
| 202 | }); | ||
| 203 | } | ||
| 204 | }, | ||
| 205 | |||
| 206 | _createStyleSelect : function(n) { | ||
| 207 | var t = this, ed = t.editor, cf = ed.controlManager, c = cf.createListBox('styleselect', { | ||
| 208 | title : 'advanced.style_select', | ||
| 209 | onselect : function(v) { | ||
| 210 | if (c.selectedValue === v) { | ||
| 211 | ed.execCommand('mceSetStyleInfo', 0, {command : 'removeformat'}); | ||
| 212 | c.select(); | ||
| 213 | return false; | ||
| 214 | } else | ||
| 215 | ed.execCommand('mceSetCSSClass', 0, v); | ||
| 216 | } | ||
| 217 | }); | ||
| 218 | |||
| 219 | if (c) { | ||
| 220 | each(ed.getParam('theme_advanced_styles', '', 'hash'), function(v, k) { | ||
| 221 | if (v) | ||
| 222 | c.add(t.editor.translate(k), v); | ||
| 223 | }); | ||
| 224 | |||
| 225 | c.onPostRender.add(function(ed, n) { | ||
| 226 | if (!c.NativeListBox) { | ||
| 227 | Event.add(n.id + '_text', 'focus', t._importClasses, t); | ||
| 228 | Event.add(n.id + '_text', 'mousedown', t._importClasses, t); | ||
| 229 | Event.add(n.id + '_open', 'focus', t._importClasses, t); | ||
| 230 | Event.add(n.id + '_open', 'mousedown', t._importClasses, t); | ||
| 231 | } else | ||
| 232 | Event.add(n.id, 'focus', t._importClasses, t); | ||
| 233 | }); | ||
| 234 | } | ||
| 235 | |||
| 236 | return c; | ||
| 237 | }, | ||
| 238 | |||
| 239 | _createFontSelect : function() { | ||
| 240 | var c, t = this, ed = t.editor; | ||
| 241 | |||
| 242 | c = ed.controlManager.createListBox('fontselect', {title : 'advanced.fontdefault', cmd : 'FontName'}); | ||
| 243 | if (c) { | ||
| 244 | each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { | ||
| 245 | c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); | ||
| 246 | }); | ||
| 247 | } | ||
| 248 | |||
| 249 | return c; | ||
| 250 | }, | ||
| 251 | |||
| 252 | _createFontSizeSelect : function() { | ||
| 253 | var t = this, ed = t.editor, c, i = 0, cl = []; | ||
| 254 | |||
| 255 | c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { | ||
| 256 | if (v.fontSize) | ||
| 257 | ed.execCommand('FontSize', false, v.fontSize); | ||
| 258 | else { | ||
| 259 | each(t.settings.theme_advanced_font_sizes, function(v, k) { | ||
| 260 | if (v['class']) | ||
| 261 | cl.push(v['class']); | ||
| 262 | }); | ||
| 263 | |||
| 264 | ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl}); | ||
| 265 | } | ||
| 266 | }}); | ||
| 267 | |||
| 268 | if (c) { | ||
| 269 | each(t.settings.theme_advanced_font_sizes, function(v, k) { | ||
| 270 | var fz = v.fontSize; | ||
| 271 | |||
| 272 | if (fz >= 1 && fz <= 7) | ||
| 273 | fz = t.sizes[parseInt(fz) - 1] + 'pt'; | ||
| 274 | |||
| 275 | c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); | ||
| 276 | }); | ||
| 277 | } | ||
| 278 | |||
| 279 | return c; | ||
| 280 | }, | ||
| 281 | |||
| 282 | _createBlockFormats : function() { | ||
| 283 | var c, fmts = { | ||
| 284 | p : 'advanced.paragraph', | ||
| 285 | address : 'advanced.address', | ||
| 286 | pre : 'advanced.pre', | ||
| 287 | h1 : 'advanced.h1', | ||
| 288 | h2 : 'advanced.h2', | ||
| 289 | h3 : 'advanced.h3', | ||
| 290 | h4 : 'advanced.h4', | ||
| 291 | h5 : 'advanced.h5', | ||
| 292 | h6 : 'advanced.h6', | ||
| 293 | div : 'advanced.div', | ||
| 294 | blockquote : 'advanced.blockquote', | ||
| 295 | code : 'advanced.code', | ||
| 296 | dt : 'advanced.dt', | ||
| 297 | dd : 'advanced.dd', | ||
| 298 | samp : 'advanced.samp' | ||
| 299 | }, t = this; | ||
| 300 | |||
| 301 | c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'}); | ||
| 302 | if (c) { | ||
| 303 | each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { | ||
| 304 | c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); | ||
| 305 | }); | ||
| 306 | } | ||
| 307 | |||
| 308 | return c; | ||
| 309 | }, | ||
| 310 | |||
| 311 | _createForeColorMenu : function() { | ||
| 312 | var c, t = this, s = t.settings, o = {}, v; | ||
| 313 | |||
| 314 | if (s.theme_advanced_more_colors) { | ||
| 315 | o.more_colors_func = function() { | ||
| 316 | t._mceColorPicker(0, { | ||
| 317 | color : c.value, | ||
| 318 | func : function(co) { | ||
| 319 | c.setColor(co); | ||
| 320 | } | ||
| 321 | }); | ||
| 322 | }; | ||
| 323 | } | ||
| 324 | |||
| 325 | if (v = s.theme_advanced_text_colors) | ||
| 326 | o.colors = v; | ||
| 327 | |||
| 328 | if (s.theme_advanced_default_foreground_color) | ||
| 329 | o.default_color = s.theme_advanced_default_foreground_color; | ||
| 330 | |||
| 331 | o.title = 'advanced.forecolor_desc'; | ||
| 332 | o.cmd = 'ForeColor'; | ||
| 333 | o.scope = this; | ||
| 334 | |||
| 335 | c = t.editor.controlManager.createColorSplitButton('forecolor', o); | ||
| 336 | |||
| 337 | return c; | ||
| 338 | }, | ||
| 339 | |||
| 340 | _createBackColorMenu : function() { | ||
| 341 | var c, t = this, s = t.settings, o = {}, v; | ||
| 342 | |||
| 343 | if (s.theme_advanced_more_colors) { | ||
| 344 | o.more_colors_func = function() { | ||
| 345 | t._mceColorPicker(0, { | ||
| 346 | color : c.value, | ||
| 347 | func : function(co) { | ||
| 348 | c.setColor(co); | ||
| 349 | } | ||
| 350 | }); | ||
| 351 | }; | ||
| 352 | } | ||
| 353 | |||
| 354 | if (v = s.theme_advanced_background_colors) | ||
| 355 | o.colors = v; | ||
| 356 | |||
| 357 | if (s.theme_advanced_default_background_color) | ||
| 358 | o.default_color = s.theme_advanced_default_background_color; | ||
| 359 | |||
| 360 | o.title = 'advanced.backcolor_desc'; | ||
| 361 | o.cmd = 'HiliteColor'; | ||
| 362 | o.scope = this; | ||
| 363 | |||
| 364 | c = t.editor.controlManager.createColorSplitButton('backcolor', o); | ||
| 365 | |||
| 366 | return c; | ||
| 367 | }, | ||
| 368 | |||
| 369 | renderUI : function(o) { | ||
| 370 | var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; | ||
| 371 | |||
| 372 | n = p = DOM.create('span', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); | ||
| 373 | |||
| 374 | if (!DOM.boxModel) | ||
| 375 | n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); | ||
| 376 | |||
| 377 | n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); | ||
| 378 | n = tb = DOM.add(n, 'tbody'); | ||
| 379 | |||
| 380 | switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { | ||
| 381 | case "rowlayout": | ||
| 382 | ic = t._rowLayout(s, tb, o); | ||
| 383 | break; | ||
| 384 | |||
| 385 | case "customlayout": | ||
| 386 | ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); | ||
| 387 | break; | ||
| 388 | |||
| 389 | default: | ||
| 390 | ic = t._simpleLayout(s, tb, o, p); | ||
| 391 | } | ||
| 392 | |||
| 393 | n = o.targetNode; | ||
| 394 | |||
| 395 | // Add classes to first and last TRs | ||
| 396 | nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8 | ||
| 397 | DOM.addClass(nl[0], 'mceFirst'); | ||
| 398 | DOM.addClass(nl[nl.length - 1], 'mceLast'); | ||
| 399 | |||
| 400 | // Add classes to first and last TDs | ||
| 401 | each(DOM.select('tr', tb), function(n) { | ||
| 402 | DOM.addClass(n.firstChild, 'mceFirst'); | ||
| 403 | DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); | ||
| 404 | }); | ||
| 405 | |||
| 406 | if (DOM.get(s.theme_advanced_toolbar_container)) | ||
| 407 | DOM.get(s.theme_advanced_toolbar_container).appendChild(p); | ||
| 408 | else | ||
| 409 | DOM.insertAfter(p, n); | ||
| 410 | |||
| 411 | Event.add(ed.id + '_path_row', 'click', function(e) { | ||
| 412 | e = e.target; | ||
| 413 | |||
| 414 | if (e.nodeName == 'A') { | ||
| 415 | t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); | ||
| 416 | |||
| 417 | return Event.cancel(e); | ||
| 418 | } | ||
| 419 | }); | ||
| 420 | /* | ||
| 421 | if (DOM.get(ed.id + '_path_row')) { | ||
| 422 | Event.add(ed.id + '_tbl', 'mouseover', function(e) { | ||
| 423 | var re; | ||
| 424 | |||
| 425 | e = e.target; | ||
| 426 | |||
| 427 | if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { | ||
| 428 | re = DOM.get(ed.id + '_path_row'); | ||
| 429 | t.lastPath = re.innerHTML; | ||
| 430 | DOM.setHTML(re, e.parentNode.title); | ||
| 431 | } | ||
| 432 | }); | ||
| 433 | |||
| 434 | Event.add(ed.id + '_tbl', 'mouseout', function(e) { | ||
| 435 | if (t.lastPath) { | ||
| 436 | DOM.setHTML(ed.id + '_path_row', t.lastPath); | ||
| 437 | t.lastPath = 0; | ||
| 438 | } | ||
| 439 | }); | ||
| 440 | } | ||
| 441 | */ | ||
| 442 | |||
| 443 | if (!ed.getParam('accessibility_focus') || ed.getParam('tab_focus')) | ||
| 444 | Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();}); | ||
| 445 | |||
| 446 | if (s.theme_advanced_toolbar_location == 'external') | ||
| 447 | o.deltaHeight = 0; | ||
| 448 | |||
| 449 | t.deltaHeight = o.deltaHeight; | ||
| 450 | o.targetNode = null; | ||
| 451 | |||
| 452 | return { | ||
| 453 | iframeContainer : ic, | ||
| 454 | editorContainer : ed.id + '_parent', | ||
| 455 | sizeContainer : sc, | ||
| 456 | deltaHeight : o.deltaHeight | ||
| 457 | }; | ||
| 458 | }, | ||
| 459 | |||
| 460 | getInfo : function() { | ||
| 461 | return { | ||
| 462 | longname : 'Advanced theme', | ||
| 463 | author : 'Moxiecode Systems AB', | ||
| 464 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 465 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 466 | } | ||
| 467 | }, | ||
| 468 | |||
| 469 | resizeBy : function(dw, dh) { | ||
| 470 | var e = DOM.get(this.editor.id + '_tbl'); | ||
| 471 | |||
| 472 | this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); | ||
| 473 | }, | ||
| 474 | |||
| 475 | resizeTo : function(w, h) { | ||
| 476 | var ed = this.editor, s = ed.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'), dh; | ||
| 477 | |||
| 478 | // Boundery fix box | ||
| 479 | w = Math.max(s.theme_advanced_resizing_min_width || 100, w); | ||
| 480 | h = Math.max(s.theme_advanced_resizing_min_height || 100, h); | ||
| 481 | w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); | ||
| 482 | h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); | ||
| 483 | |||
| 484 | // Calc difference between iframe and container | ||
| 485 | dh = e.clientHeight - ifr.clientHeight; | ||
| 486 | |||
| 487 | // Resize iframe and container | ||
| 488 | DOM.setStyle(ifr, 'height', h - dh); | ||
| 489 | DOM.setStyles(e, {width : w, height : h}); | ||
| 490 | }, | ||
| 491 | |||
| 492 | destroy : function() { | ||
| 493 | var id = this.editor.id; | ||
| 494 | |||
| 495 | Event.clear(id + '_resize'); | ||
| 496 | Event.clear(id + '_path_row'); | ||
| 497 | Event.clear(id + '_external_close'); | ||
| 498 | }, | ||
| 499 | |||
| 500 | // Internal functions | ||
| 501 | |||
| 502 | _simpleLayout : function(s, tb, o, p) { | ||
| 503 | var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; | ||
| 504 | |||
| 505 | if (s.readonly) { | ||
| 506 | n = DOM.add(tb, 'tr'); | ||
| 507 | n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); | ||
| 508 | return ic; | ||
| 509 | } | ||
| 510 | |||
| 511 | // Create toolbar container at top | ||
| 512 | if (lo == 'top') | ||
| 513 | t._addToolbars(tb, o); | ||
| 514 | |||
| 515 | // Create external toolbar | ||
| 516 | if (lo == 'external') { | ||
| 517 | n = c = DOM.create('div', {style : 'position:relative'}); | ||
| 518 | n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); | ||
| 519 | DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); | ||
| 520 | n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); | ||
| 521 | etb = DOM.add(n, 'tbody'); | ||
| 522 | |||
| 523 | if (p.firstChild.className == 'mceOldBoxModel') | ||
| 524 | p.firstChild.appendChild(c); | ||
| 525 | else | ||
| 526 | p.insertBefore(c, p.firstChild); | ||
| 527 | |||
| 528 | t._addToolbars(etb, o); | ||
| 529 | |||
| 530 | ed.onMouseUp.add(function() { | ||
| 531 | var e = DOM.get(ed.id + '_external'); | ||
| 532 | DOM.show(e); | ||
| 533 | |||
| 534 | DOM.hide(lastExtID); | ||
| 535 | |||
| 536 | var f = Event.add(ed.id + '_external_close', 'click', function() { | ||
| 537 | DOM.hide(ed.id + '_external'); | ||
| 538 | Event.remove(ed.id + '_external_close', 'click', f); | ||
| 539 | }); | ||
| 540 | |||
| 541 | DOM.show(e); | ||
| 542 | DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); | ||
| 543 | |||
| 544 | // Fixes IE rendering bug | ||
| 545 | DOM.hide(e); | ||
| 546 | DOM.show(e); | ||
| 547 | e.style.filter = ''; | ||
| 548 | |||
| 549 | lastExtID = ed.id + '_external'; | ||
| 550 | |||
| 551 | e = null; | ||
| 552 | }); | ||
| 553 | } | ||
| 554 | |||
| 555 | if (sl == 'top') | ||
| 556 | t._addStatusBar(tb, o); | ||
| 557 | |||
| 558 | // Create iframe container | ||
| 559 | if (!s.theme_advanced_toolbar_container) { | ||
| 560 | n = DOM.add(tb, 'tr'); | ||
| 561 | n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); | ||
| 562 | } | ||
| 563 | |||
| 564 | // Create toolbar container at bottom | ||
| 565 | if (lo == 'bottom') | ||
| 566 | t._addToolbars(tb, o); | ||
| 567 | |||
| 568 | if (sl == 'bottom') | ||
| 569 | t._addStatusBar(tb, o); | ||
| 570 | |||
| 571 | return ic; | ||
| 572 | }, | ||
| 573 | |||
| 574 | _rowLayout : function(s, tb, o) { | ||
| 575 | var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; | ||
| 576 | |||
| 577 | dc = s.theme_advanced_containers_default_class || ''; | ||
| 578 | da = s.theme_advanced_containers_default_align || 'center'; | ||
| 579 | |||
| 580 | each(explode(s.theme_advanced_containers || ''), function(c, i) { | ||
| 581 | var v = s['theme_advanced_container_' + c] || ''; | ||
| 582 | |||
| 583 | switch (v.toLowerCase()) { | ||
| 584 | case 'mceeditor': | ||
| 585 | n = DOM.add(tb, 'tr'); | ||
| 586 | n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); | ||
| 587 | break; | ||
| 588 | |||
| 589 | case 'mceelementpath': | ||
| 590 | t._addStatusBar(tb, o); | ||
| 591 | break; | ||
| 592 | |||
| 593 | default: | ||
| 594 | a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); | ||
| 595 | a = 'mce' + t._ufirst(a); | ||
| 596 | |||
| 597 | n = DOM.add(DOM.add(tb, 'tr'), 'td', { | ||
| 598 | 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da | ||
| 599 | }); | ||
| 600 | |||
| 601 | to = cf.createToolbar("toolbar" + i); | ||
| 602 | t._addControls(v, to); | ||
| 603 | DOM.setHTML(n, to.renderHTML()); | ||
| 604 | o.deltaHeight -= s.theme_advanced_row_height; | ||
| 605 | } | ||
| 606 | }); | ||
| 607 | |||
| 608 | return ic; | ||
| 609 | }, | ||
| 610 | |||
| 611 | _addControls : function(v, tb) { | ||
| 612 | var t = this, s = t.settings, di, cf = t.editor.controlManager; | ||
| 613 | |||
| 614 | if (s.theme_advanced_disable && !t._disabled) { | ||
| 615 | di = {}; | ||
| 616 | |||
| 617 | each(explode(s.theme_advanced_disable), function(v) { | ||
| 618 | di[v] = 1; | ||
| 619 | }); | ||
| 620 | |||
| 621 | t._disabled = di; | ||
| 622 | } else | ||
| 623 | di = t._disabled; | ||
| 624 | |||
| 625 | each(explode(v), function(n) { | ||
| 626 | var c; | ||
| 627 | |||
| 628 | if (di && di[n]) | ||
| 629 | return; | ||
| 630 | |||
| 631 | // Compatiblity with 2.x | ||
| 632 | if (n == 'tablecontrols') { | ||
| 633 | each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { | ||
| 634 | n = t.createControl(n, cf); | ||
| 635 | |||
| 636 | if (n) | ||
| 637 | tb.add(n); | ||
| 638 | }); | ||
| 639 | |||
| 640 | return; | ||
| 641 | } | ||
| 642 | |||
| 643 | c = t.createControl(n, cf); | ||
| 644 | |||
| 645 | if (c) | ||
| 646 | tb.add(c); | ||
| 647 | }); | ||
| 648 | }, | ||
| 649 | |||
| 650 | _addToolbars : function(c, o) { | ||
| 651 | var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a; | ||
| 652 | |||
| 653 | a = s.theme_advanced_toolbar_align.toLowerCase(); | ||
| 654 | a = 'mce' + t._ufirst(a); | ||
| 655 | |||
| 656 | n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a}); | ||
| 657 | |||
| 658 | if (!ed.getParam('accessibility_focus') || ed.getParam('tab_focus')) | ||
| 659 | h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '<!-- IE -->')); | ||
| 660 | |||
| 661 | h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '<!-- IE -->')); | ||
| 662 | |||
| 663 | // Create toolbar and add the controls | ||
| 664 | for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { | ||
| 665 | tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); | ||
| 666 | |||
| 667 | if (s['theme_advanced_buttons' + i + '_add']) | ||
| 668 | v += ',' + s['theme_advanced_buttons' + i + '_add']; | ||
| 669 | |||
| 670 | if (s['theme_advanced_buttons' + i + '_add_before']) | ||
| 671 | v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; | ||
| 672 | |||
| 673 | t._addControls(v, tb); | ||
| 674 | |||
| 675 | //n.appendChild(n = tb.render()); | ||
| 676 | h.push(tb.renderHTML()); | ||
| 677 | |||
| 678 | o.deltaHeight -= s.theme_advanced_row_height; | ||
| 679 | } | ||
| 680 | |||
| 681 | h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->')); | ||
| 682 | DOM.setHTML(n, h.join('')); | ||
| 683 | }, | ||
| 684 | |||
| 685 | _addStatusBar : function(tb, o) { | ||
| 686 | var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; | ||
| 687 | |||
| 688 | n = DOM.add(tb, 'tr'); | ||
| 689 | n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); | ||
| 690 | n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' '); | ||
| 691 | DOM.add(n, 'a', {href : '#', accesskey : 'x'}); | ||
| 692 | |||
| 693 | if (s.theme_advanced_resizing && !tinymce.isOldWebKit) { | ||
| 694 | DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); | ||
| 695 | |||
| 696 | if (s.theme_advanced_resizing_use_cookie) { | ||
| 697 | ed.onPostRender.add(function() { | ||
| 698 | var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); | ||
| 699 | |||
| 700 | if (!o) | ||
| 701 | return; | ||
| 702 | |||
| 703 | if (s.theme_advanced_resize_horizontal) | ||
| 704 | c.style.width = Math.max(10, o.cw) + 'px'; | ||
| 705 | |||
| 706 | c.style.height = Math.max(10, o.ch) + 'px'; | ||
| 707 | DOM.get(ed.id + '_ifr').style.height = Math.max(10, parseInt(o.ch) + t.deltaHeight) + 'px'; | ||
| 708 | }); | ||
| 709 | } | ||
| 710 | |||
| 711 | ed.onPostRender.add(function() { | ||
| 712 | Event.add(ed.id + '_resize', 'mousedown', function(e) { | ||
| 713 | var c, p, w, h, n, pa; | ||
| 714 | |||
| 715 | // Measure container | ||
| 716 | c = DOM.get(ed.id + '_tbl'); | ||
| 717 | w = c.clientWidth; | ||
| 718 | h = c.clientHeight; | ||
| 719 | |||
| 720 | miw = s.theme_advanced_resizing_min_width || 100; | ||
| 721 | mih = s.theme_advanced_resizing_min_height || 100; | ||
| 722 | maw = s.theme_advanced_resizing_max_width || 0xFFFF; | ||
| 723 | mah = s.theme_advanced_resizing_max_height || 0xFFFF; | ||
| 724 | |||
| 725 | // Setup placeholder | ||
| 726 | p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'}); | ||
| 727 | DOM.setStyles(p, {width : w, height : h}); | ||
| 728 | |||
| 729 | // Replace with placeholder | ||
| 730 | DOM.hide(c); | ||
| 731 | DOM.show(p); | ||
| 732 | |||
| 733 | // Create internal resize obj | ||
| 734 | r = { | ||
| 735 | x : e.screenX, | ||
| 736 | y : e.screenY, | ||
| 737 | w : w, | ||
| 738 | h : h, | ||
| 739 | dx : null, | ||
| 740 | dy : null | ||
| 741 | }; | ||
| 742 | |||
| 743 | // Start listening | ||
| 744 | mf = Event.add(DOM.doc, 'mousemove', function(e) { | ||
| 745 | var w, h; | ||
| 746 | |||
| 747 | // Calc delta values | ||
| 748 | r.dx = e.screenX - r.x; | ||
| 749 | r.dy = e.screenY - r.y; | ||
| 750 | |||
| 751 | // Boundery fix box | ||
| 752 | w = Math.max(miw, r.w + r.dx); | ||
| 753 | h = Math.max(mih, r.h + r.dy); | ||
| 754 | w = Math.min(maw, w); | ||
| 755 | h = Math.min(mah, h); | ||
| 756 | |||
| 757 | // Resize placeholder | ||
| 758 | if (s.theme_advanced_resize_horizontal) | ||
| 759 | p.style.width = w + 'px'; | ||
| 760 | |||
| 761 | p.style.height = h + 'px'; | ||
| 762 | |||
| 763 | return Event.cancel(e); | ||
| 764 | }); | ||
| 765 | |||
| 766 | me = Event.add(DOM.doc, 'mouseup', function(e) { | ||
| 767 | var ifr; | ||
| 768 | |||
| 769 | // Stop listening | ||
| 770 | Event.remove(DOM.doc, 'mousemove', mf); | ||
| 771 | Event.remove(DOM.doc, 'mouseup', me); | ||
| 772 | |||
| 773 | c.style.display = ''; | ||
| 774 | DOM.remove(p); | ||
| 775 | |||
| 776 | if (r.dx === null) | ||
| 777 | return; | ||
| 778 | |||
| 779 | ifr = DOM.get(ed.id + '_ifr'); | ||
| 780 | |||
| 781 | if (s.theme_advanced_resize_horizontal) | ||
| 782 | c.style.width = Math.max(10, r.w + r.dx) + 'px'; | ||
| 783 | |||
| 784 | c.style.height = Math.max(10, r.h + r.dy) + 'px'; | ||
| 785 | ifr.style.height = Math.max(10, ifr.clientHeight + r.dy) + 'px'; | ||
| 786 | |||
| 787 | if (s.theme_advanced_resizing_use_cookie) { | ||
| 788 | Cookie.setHash("TinyMCE_" + ed.id + "_size", { | ||
| 789 | cw : r.w + r.dx, | ||
| 790 | ch : r.h + r.dy | ||
| 791 | }); | ||
| 792 | } | ||
| 793 | }); | ||
| 794 | |||
| 795 | return Event.cancel(e); | ||
| 796 | }); | ||
| 797 | }); | ||
| 798 | } | ||
| 799 | |||
| 800 | o.deltaHeight -= 21; | ||
| 801 | n = tb = null; | ||
| 802 | }, | ||
| 803 | |||
| 804 | _nodeChanged : function(ed, cm, n, co) { | ||
| 805 | var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn; | ||
| 806 | |||
| 807 | if (s.readonly) | ||
| 808 | return; | ||
| 809 | |||
| 810 | tinymce.each(t.stateControls, function(c) { | ||
| 811 | cm.setActive(c, ed.queryCommandState(t.controls[c][1])); | ||
| 812 | }); | ||
| 813 | |||
| 814 | cm.setActive('visualaid', ed.hasVisual); | ||
| 815 | cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); | ||
| 816 | cm.setDisabled('redo', !ed.undoManager.hasRedo()); | ||
| 817 | cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); | ||
| 818 | |||
| 819 | p = DOM.getParent(n, 'A'); | ||
| 820 | if (c = cm.get('link')) { | ||
| 821 | if (!p || !p.name) { | ||
| 822 | c.setDisabled(!p && co); | ||
| 823 | c.setActive(!!p); | ||
| 824 | } | ||
| 825 | } | ||
| 826 | |||
| 827 | if (c = cm.get('unlink')) { | ||
| 828 | c.setDisabled(!p && co); | ||
| 829 | c.setActive(!!p && !p.name); | ||
| 830 | } | ||
| 831 | |||
| 832 | if (c = cm.get('anchor')) { | ||
| 833 | c.setActive(!!p && p.name); | ||
| 834 | |||
| 835 | if (tinymce.isWebKit) { | ||
| 836 | p = DOM.getParent(n, 'IMG'); | ||
| 837 | c.setActive(!!p && DOM.getAttrib(p, 'mce_name') == 'a'); | ||
| 838 | } | ||
| 839 | } | ||
| 840 | |||
| 841 | p = DOM.getParent(n, 'IMG'); | ||
| 842 | if (c = cm.get('image')) | ||
| 843 | c.setActive(!!p && n.className.indexOf('mceItem') == -1); | ||
| 844 | |||
| 845 | if (c = cm.get('styleselect')) { | ||
| 846 | if (n.className) { | ||
| 847 | t._importClasses(); | ||
| 848 | c.select(n.className); | ||
| 849 | } else | ||
| 850 | c.select(); | ||
| 851 | } | ||
| 852 | |||
| 853 | if (c = cm.get('formatselect')) { | ||
| 854 | p = DOM.getParent(n, DOM.isBlock); | ||
| 855 | |||
| 856 | if (p) | ||
| 857 | c.select(p.nodeName.toLowerCase()); | ||
| 858 | } | ||
| 859 | |||
| 860 | if (ed.settings.convert_fonts_to_spans) { | ||
| 861 | ed.dom.getParent(n, function(n) { | ||
| 862 | if (n.nodeName === 'SPAN') { | ||
| 863 | if (!cl && n.className) | ||
| 864 | cl = n.className; | ||
| 865 | |||
| 866 | if (!fz && n.style.fontSize) | ||
| 867 | fz = n.style.fontSize; | ||
| 868 | |||
| 869 | if (!fn && n.style.fontFamily) | ||
| 870 | fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); | ||
| 871 | } | ||
| 872 | |||
| 873 | return false; | ||
| 874 | }); | ||
| 875 | |||
| 876 | if (c = cm.get('fontselect')) { | ||
| 877 | c.select(function(v) { | ||
| 878 | return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; | ||
| 879 | }); | ||
| 880 | } | ||
| 881 | |||
| 882 | if (c = cm.get('fontsizeselect')) { | ||
| 883 | c.select(function(v) { | ||
| 884 | if (v.fontSize && v.fontSize === fz) | ||
| 885 | return true; | ||
| 886 | |||
| 887 | if (v['class'] && v['class'] === cl) | ||
| 888 | return true; | ||
| 889 | }); | ||
| 890 | } | ||
| 891 | } else { | ||
| 892 | if (c = cm.get('fontselect')) | ||
| 893 | c.select(ed.queryCommandValue('FontName')); | ||
| 894 | |||
| 895 | if (c = cm.get('fontsizeselect')) { | ||
| 896 | v = ed.queryCommandValue('FontSize'); | ||
| 897 | c.select(function(iv) { | ||
| 898 | return iv.fontSize == v; | ||
| 899 | }); | ||
| 900 | } | ||
| 901 | } | ||
| 902 | |||
| 903 | if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { | ||
| 904 | p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); | ||
| 905 | DOM.setHTML(p, ''); | ||
| 906 | |||
| 907 | ed.dom.getParent(n, function(n) { | ||
| 908 | var na = n.nodeName.toLowerCase(), u, pi, ti = ''; | ||
| 909 | |||
| 910 | // Ignore non element and hidden elements | ||
| 911 | if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))) | ||
| 912 | return; | ||
| 913 | |||
| 914 | // Fake name | ||
| 915 | if (v = DOM.getAttrib(n, 'mce_name')) | ||
| 916 | na = v; | ||
| 917 | |||
| 918 | // Handle prefix | ||
| 919 | if (tinymce.isIE && n.scopeName !== 'HTML') | ||
| 920 | na = n.scopeName + ':' + na; | ||
| 921 | |||
| 922 | // Remove internal prefix | ||
| 923 | na = na.replace(/mce\:/g, ''); | ||
| 924 | |||
| 925 | // Handle node name | ||
| 926 | switch (na) { | ||
| 927 | case 'b': | ||
| 928 | na = 'strong'; | ||
| 929 | break; | ||
| 930 | |||
| 931 | case 'i': | ||
| 932 | na = 'em'; | ||
| 933 | break; | ||
| 934 | |||
| 935 | case 'img': | ||
| 936 | if (v = DOM.getAttrib(n, 'src')) | ||
| 937 | ti += 'src: ' + v + ' '; | ||
| 938 | |||
| 939 | break; | ||
| 940 | |||
| 941 | case 'a': | ||
| 942 | if (v = DOM.getAttrib(n, 'name')) { | ||
| 943 | ti += 'name: ' + v + ' '; | ||
| 944 | na += '#' + v; | ||
| 945 | } | ||
| 946 | |||
| 947 | if (v = DOM.getAttrib(n, 'href')) | ||
| 948 | ti += 'href: ' + v + ' '; | ||
| 949 | |||
| 950 | break; | ||
| 951 | |||
| 952 | case 'font': | ||
| 953 | if (s.convert_fonts_to_spans) | ||
| 954 | na = 'span'; | ||
| 955 | |||
| 956 | if (v = DOM.getAttrib(n, 'face')) | ||
| 957 | ti += 'font: ' + v + ' '; | ||
| 958 | |||
| 959 | if (v = DOM.getAttrib(n, 'size')) | ||
| 960 | ti += 'size: ' + v + ' '; | ||
| 961 | |||
| 962 | if (v = DOM.getAttrib(n, 'color')) | ||
| 963 | ti += 'color: ' + v + ' '; | ||
| 964 | |||
| 965 | break; | ||
| 966 | |||
| 967 | case 'span': | ||
| 968 | if (v = DOM.getAttrib(n, 'style')) | ||
| 969 | ti += 'style: ' + v + ' '; | ||
| 970 | |||
| 971 | break; | ||
| 972 | } | ||
| 973 | |||
| 974 | if (v = DOM.getAttrib(n, 'id')) | ||
| 975 | ti += 'id: ' + v + ' '; | ||
| 976 | |||
| 977 | if (v = n.className) { | ||
| 978 | v = v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g, ''); | ||
| 979 | |||
| 980 | if (v && v.indexOf('mceItem') == -1) { | ||
| 981 | ti += 'class: ' + v + ' '; | ||
| 982 | |||
| 983 | if (DOM.isBlock(n) || na == 'img' || na == 'span') | ||
| 984 | na += '.' + v; | ||
| 985 | } | ||
| 986 | } | ||
| 987 | |||
| 988 | na = na.replace(/(html:)/g, ''); | ||
| 989 | na = {name : na, node : n, title : ti}; | ||
| 990 | t.onResolveName.dispatch(t, na); | ||
| 991 | ti = na.title; | ||
| 992 | na = na.name; | ||
| 993 | |||
| 994 | //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; | ||
| 995 | pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); | ||
| 996 | |||
| 997 | if (p.hasChildNodes()) { | ||
| 998 | p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild); | ||
| 999 | p.insertBefore(pi, p.firstChild); | ||
| 1000 | } else | ||
| 1001 | p.appendChild(pi); | ||
| 1002 | }, ed.getBody()); | ||
| 1003 | } | ||
| 1004 | }, | ||
| 1005 | |||
| 1006 | // Commands gets called by execCommand | ||
| 1007 | |||
| 1008 | _sel : function(v) { | ||
| 1009 | this.editor.execCommand('mceSelectNodeDepth', false, v); | ||
| 1010 | }, | ||
| 1011 | |||
| 1012 | _mceInsertAnchor : function(ui, v) { | ||
| 1013 | var ed = this.editor; | ||
| 1014 | |||
| 1015 | ed.windowManager.open({ | ||
| 1016 | url : tinymce.baseURL + '/themes/advanced/anchor.htm', | ||
| 1017 | width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), | ||
| 1018 | height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), | ||
| 1019 | inline : true | ||
| 1020 | }, { | ||
| 1021 | theme_url : this.url | ||
| 1022 | }); | ||
| 1023 | }, | ||
| 1024 | |||
| 1025 | _mceCharMap : function() { | ||
| 1026 | var ed = this.editor; | ||
| 1027 | |||
| 1028 | ed.windowManager.open({ | ||
| 1029 | url : tinymce.baseURL + '/themes/advanced/charmap.htm', | ||
| 1030 | width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), | ||
| 1031 | height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), | ||
| 1032 | inline : true | ||
| 1033 | }, { | ||
| 1034 | theme_url : this.url | ||
| 1035 | }); | ||
| 1036 | }, | ||
| 1037 | |||
| 1038 | _mceHelp : function() { | ||
| 1039 | var ed = this.editor; | ||
| 1040 | |||
| 1041 | ed.windowManager.open({ | ||
| 1042 | url : tinymce.baseURL + '/themes/advanced/about.htm', | ||
| 1043 | width : 480, | ||
| 1044 | height : 380, | ||
| 1045 | inline : true | ||
| 1046 | }, { | ||
| 1047 | theme_url : this.url | ||
| 1048 | }); | ||
| 1049 | }, | ||
| 1050 | |||
| 1051 | _mceColorPicker : function(u, v) { | ||
| 1052 | var ed = this.editor; | ||
| 1053 | |||
| 1054 | v = v || {}; | ||
| 1055 | |||
| 1056 | ed.windowManager.open({ | ||
| 1057 | url : tinymce.baseURL + '/themes/advanced/color_picker.htm', | ||
| 1058 | width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), | ||
| 1059 | height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), | ||
| 1060 | close_previous : false, | ||
| 1061 | inline : true | ||
| 1062 | }, { | ||
| 1063 | input_color : v.color, | ||
| 1064 | func : v.func, | ||
| 1065 | theme_url : this.url | ||
| 1066 | }); | ||
| 1067 | }, | ||
| 1068 | |||
| 1069 | _mceCodeEditor : function(ui, val) { | ||
| 1070 | var ed = this.editor; | ||
| 1071 | |||
| 1072 | ed.windowManager.open({ | ||
| 1073 | url : tinymce.baseURL + '/themes/advanced/source_editor.htm', | ||
| 1074 | width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), | ||
| 1075 | height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), | ||
| 1076 | inline : true, | ||
| 1077 | resizable : true, | ||
| 1078 | maximizable : true | ||
| 1079 | }, { | ||
| 1080 | theme_url : this.url | ||
| 1081 | }); | ||
| 1082 | }, | ||
| 1083 | |||
| 1084 | _mceImage : function(ui, val) { | ||
| 1085 | var ed = this.editor; | ||
| 1086 | |||
| 1087 | // Internal image object like a flash placeholder | ||
| 1088 | if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) | ||
| 1089 | return; | ||
| 1090 | |||
| 1091 | ed.windowManager.open({ | ||
| 1092 | url : tinymce.baseURL + '/themes/advanced/image.htm', | ||
| 1093 | width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), | ||
| 1094 | height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), | ||
| 1095 | inline : true | ||
| 1096 | }, { | ||
| 1097 | theme_url : this.url | ||
| 1098 | }); | ||
| 1099 | }, | ||
| 1100 | |||
| 1101 | _mceLink : function(ui, val) { | ||
| 1102 | var ed = this.editor; | ||
| 1103 | |||
| 1104 | ed.windowManager.open({ | ||
| 1105 | url : tinymce.baseURL + '/themes/advanced/link.htm', | ||
| 1106 | width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), | ||
| 1107 | height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), | ||
| 1108 | inline : true | ||
| 1109 | }, { | ||
| 1110 | theme_url : this.url | ||
| 1111 | }); | ||
| 1112 | }, | ||
| 1113 | |||
| 1114 | _mceNewDocument : function() { | ||
| 1115 | var ed = this.editor; | ||
| 1116 | |||
| 1117 | ed.windowManager.confirm('advanced.newdocument', function(s) { | ||
| 1118 | if (s) | ||
| 1119 | ed.execCommand('mceSetContent', false, ''); | ||
| 1120 | }); | ||
| 1121 | }, | ||
| 1122 | |||
| 1123 | _mceForeColor : function() { | ||
| 1124 | var t = this; | ||
| 1125 | |||
| 1126 | this._mceColorPicker(0, { | ||
| 1127 | color: t.fgColor, | ||
| 1128 | func : function(co) { | ||
| 1129 | t.fgColor = co; | ||
| 1130 | t.editor.execCommand('ForeColor', false, co); | ||
| 1131 | } | ||
| 1132 | }); | ||
| 1133 | }, | ||
| 1134 | |||
| 1135 | _mceBackColor : function() { | ||
| 1136 | var t = this; | ||
| 1137 | |||
| 1138 | this._mceColorPicker(0, { | ||
| 1139 | color: t.bgColor, | ||
| 1140 | func : function(co) { | ||
| 1141 | t.bgColor = co; | ||
| 1142 | t.editor.execCommand('HiliteColor', false, co); | ||
| 1143 | } | ||
| 1144 | }); | ||
| 1145 | }, | ||
| 1146 | |||
| 1147 | _ufirst : function(s) { | ||
| 1148 | return s.substring(0, 1).toUpperCase() + s.substring(1); | ||
| 1149 | } | ||
| 1150 | }); | ||
| 1151 | |||
| 1152 | tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); | ||
| 1153 | }()); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/image.htm b/public/javascripts/tiny_mce/themes/advanced/image.htm new file mode 100755 index 0000000..6c36646 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/image.htm | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.image_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="js/image.js"></script> | ||
| 9 | <base target="_self" /> | ||
| 10 | </head> | ||
| 11 | <body id="image" style="display: none"> | ||
| 12 | <form onsubmit="ImageDialog.update();return false;" action="#"> | ||
| 13 | <div class="tabs"> | ||
| 14 | <ul> | ||
| 15 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.image_title}</a></span></li> | ||
| 16 | </ul> | ||
| 17 | </div> | ||
| 18 | |||
| 19 | <div class="panel_wrapper"> | ||
| 20 | <div id="general_panel" class="panel current"> | ||
| 21 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 22 | <tr> | ||
| 23 | <td nowrap="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td> | ||
| 24 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 25 | <tr> | ||
| 26 | <td><input id="src" name="src" type="text" class="mceFocus" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td> | ||
| 27 | <td id="srcbrowsercontainer"> </td> | ||
| 28 | </tr> | ||
| 29 | </table></td> | ||
| 30 | </tr> | ||
| 31 | <tr> | ||
| 32 | <td><label for="image_list">{#advanced_dlg.image_list}</label></td> | ||
| 33 | <td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td> | ||
| 34 | </tr> | ||
| 35 | <tr> | ||
| 36 | <td nowrap="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td> | ||
| 37 | <td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td> | ||
| 38 | </tr> | ||
| 39 | <tr> | ||
| 40 | <td nowrap="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td> | ||
| 41 | <td><select id="align" name="align" onchange="ImageDialog.updateStyle();"> | ||
| 42 | <option value="">{#not_set}</option> | ||
| 43 | <option value="baseline">{#advanced_dlg.image_align_baseline}</option> | ||
| 44 | <option value="top">{#advanced_dlg.image_align_top}</option> | ||
| 45 | <option value="middle">{#advanced_dlg.image_align_middle}</option> | ||
| 46 | <option value="bottom">{#advanced_dlg.image_align_bottom}</option> | ||
| 47 | <option value="text-top">{#advanced_dlg.image_align_texttop}</option> | ||
| 48 | <option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option> | ||
| 49 | <option value="left">{#advanced_dlg.image_align_left}</option> | ||
| 50 | <option value="right">{#advanced_dlg.image_align_right}</option> | ||
| 51 | </select></td> | ||
| 52 | </tr> | ||
| 53 | <tr> | ||
| 54 | <td nowrap="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td> | ||
| 55 | <td><input id="width" name="width" type="text" value="" size="3" maxlength="5" /> | ||
| 56 | x | ||
| 57 | <input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td> | ||
| 58 | </tr> | ||
| 59 | <tr> | ||
| 60 | <td nowrap="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td> | ||
| 61 | <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td> | ||
| 62 | </tr> | ||
| 63 | <tr> | ||
| 64 | <td nowrap="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td> | ||
| 65 | <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td> | ||
| 66 | </tr> | ||
| 67 | <tr> | ||
| 68 | <td nowrap="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td> | ||
| 69 | <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td> | ||
| 70 | </tr> | ||
| 71 | </table> | ||
| 72 | </div> | ||
| 73 | </div> | ||
| 74 | |||
| 75 | <div class="mceActionPanel"> | ||
| 76 | <div style="float: left"> | ||
| 77 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 78 | </div> | ||
| 79 | |||
| 80 | <div style="float: right"> | ||
| 81 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 82 | </div> | ||
| 83 | </div> | ||
| 84 | </form> | ||
| 85 | </body> | ||
| 86 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg b/public/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg new file mode 100755 index 0000000..b4c542d --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/img/icons.gif b/public/javascripts/tiny_mce/themes/advanced/img/icons.gif new file mode 100755 index 0000000..ccac36f --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/img/icons.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/about.js b/public/javascripts/tiny_mce/themes/advanced/js/about.js new file mode 100755 index 0000000..5cee9ed --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/js/about.js | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | function init() { | ||
| 4 | var ed, tcont; | ||
| 5 | |||
| 6 | tinyMCEPopup.resizeToInnerSize(); | ||
| 7 | ed = tinyMCEPopup.editor; | ||
| 8 | |||
| 9 | // Give FF some time | ||
| 10 | window.setTimeout(insertHelpIFrame, 10); | ||
| 11 | |||
| 12 | tcont = document.getElementById('plugintablecontainer'); | ||
| 13 | document.getElementById('plugins_tab').style.display = 'none'; | ||
| 14 | |||
| 15 | var html = ""; | ||
| 16 | html += '<table id="plugintable">'; | ||
| 17 | html += '<thead>'; | ||
| 18 | html += '<tr>'; | ||
| 19 | html += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>'; | ||
| 20 | html += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>'; | ||
| 21 | html += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>'; | ||
| 22 | html += '</tr>'; | ||
| 23 | html += '</thead>'; | ||
| 24 | html += '<tbody>'; | ||
| 25 | |||
| 26 | tinymce.each(ed.plugins, function(p, n) { | ||
| 27 | var info; | ||
| 28 | |||
| 29 | if (!p.getInfo) | ||
| 30 | return; | ||
| 31 | |||
| 32 | html += '<tr>'; | ||
| 33 | |||
| 34 | info = p.getInfo(); | ||
| 35 | |||
| 36 | if (info.infourl != null && info.infourl != '') | ||
| 37 | html += '<td width="50%" title="' + n + '"><a href="' + info.infourl + '" target="_blank">' + info.longname + '</a></td>'; | ||
| 38 | else | ||
| 39 | html += '<td width="50%" title="' + n + '">' + info.longname + '</td>'; | ||
| 40 | |||
| 41 | if (info.authorurl != null && info.authorurl != '') | ||
| 42 | html += '<td width="35%"><a href="' + info.authorurl + '" target="_blank">' + info.author + '</a></td>'; | ||
| 43 | else | ||
| 44 | html += '<td width="35%">' + info.author + '</td>'; | ||
| 45 | |||
| 46 | html += '<td width="15%">' + info.version + '</td>'; | ||
| 47 | html += '</tr>'; | ||
| 48 | |||
| 49 | document.getElementById('plugins_tab').style.display = ''; | ||
| 50 | |||
| 51 | }); | ||
| 52 | |||
| 53 | html += '</tbody>'; | ||
| 54 | html += '</table>'; | ||
| 55 | |||
| 56 | tcont.innerHTML = html; | ||
| 57 | |||
| 58 | tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; | ||
| 59 | tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; | ||
| 60 | } | ||
| 61 | |||
| 62 | function insertHelpIFrame() { | ||
| 63 | var html; | ||
| 64 | |||
| 65 | if (tinyMCEPopup.getParam('docs_url')) { | ||
| 66 | html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>'; | ||
| 67 | document.getElementById('iframecontainer').innerHTML = html; | ||
| 68 | document.getElementById('help_tab').style.display = 'block'; | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/anchor.js b/public/javascripts/tiny_mce/themes/advanced/js/anchor.js new file mode 100755 index 0000000..b5efd1e --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/js/anchor.js | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var AnchorDialog = { | ||
| 4 | init : function(ed) { | ||
| 5 | var action, elm, f = document.forms[0]; | ||
| 6 | |||
| 7 | this.editor = ed; | ||
| 8 | elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG'); | ||
| 9 | v = ed.dom.getAttrib(elm, 'name'); | ||
| 10 | |||
| 11 | if (v) { | ||
| 12 | this.action = 'update'; | ||
| 13 | f.anchorName.value = v; | ||
| 14 | } | ||
| 15 | |||
| 16 | f.insert.value = ed.getLang(elm ? 'update' : 'insert'); | ||
| 17 | }, | ||
| 18 | |||
| 19 | update : function() { | ||
| 20 | var ed = this.editor; | ||
| 21 | |||
| 22 | tinyMCEPopup.restoreSelection(); | ||
| 23 | |||
| 24 | if (this.action != 'update') | ||
| 25 | ed.selection.collapse(1); | ||
| 26 | |||
| 27 | // Webkit acts weird if empty inline element is inserted so we need to use a image instead | ||
| 28 | if (tinymce.isWebKit) | ||
| 29 | ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'})); | ||
| 30 | else | ||
| 31 | ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, '')); | ||
| 32 | |||
| 33 | tinyMCEPopup.close(); | ||
| 34 | } | ||
| 35 | }; | ||
| 36 | |||
| 37 | tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/charmap.js b/public/javascripts/tiny_mce/themes/advanced/js/charmap.js new file mode 100755 index 0000000..8467ef6 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/js/charmap.js | |||
| @@ -0,0 +1,325 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var charmap = [ | ||
| 4 | [' ', ' ', true, 'no-break space'], | ||
| 5 | ['&', '&', true, 'ampersand'], | ||
| 6 | ['"', '"', true, 'quotation mark'], | ||
| 7 | // finance | ||
| 8 | ['¢', '¢', true, 'cent sign'], | ||
| 9 | ['€', '€', true, 'euro sign'], | ||
| 10 | ['£', '£', true, 'pound sign'], | ||
| 11 | ['¥', '¥', true, 'yen sign'], | ||
| 12 | // signs | ||
| 13 | ['©', '©', true, 'copyright sign'], | ||
| 14 | ['®', '®', true, 'registered sign'], | ||
| 15 | ['™', '™', true, 'trade mark sign'], | ||
| 16 | ['‰', '‰', true, 'per mille sign'], | ||
| 17 | ['µ', 'µ', true, 'micro sign'], | ||
| 18 | ['·', '·', true, 'middle dot'], | ||
| 19 | ['•', '•', true, 'bullet'], | ||
| 20 | ['…', '…', true, 'three dot leader'], | ||
| 21 | ['′', '′', true, 'minutes / feet'], | ||
| 22 | ['″', '″', true, 'seconds / inches'], | ||
| 23 | ['§', '§', true, 'section sign'], | ||
| 24 | ['¶', '¶', true, 'paragraph sign'], | ||
| 25 | ['ß', 'ß', true, 'sharp s / ess-zed'], | ||
| 26 | // quotations | ||
| 27 | ['‹', '‹', true, 'single left-pointing angle quotation mark'], | ||
| 28 | ['›', '›', true, 'single right-pointing angle quotation mark'], | ||
| 29 | ['«', '«', true, 'left pointing guillemet'], | ||
| 30 | ['»', '»', true, 'right pointing guillemet'], | ||
| 31 | ['‘', '‘', true, 'left single quotation mark'], | ||
| 32 | ['’', '’', true, 'right single quotation mark'], | ||
| 33 | ['“', '“', true, 'left double quotation mark'], | ||
| 34 | ['”', '”', true, 'right double quotation mark'], | ||
| 35 | ['‚', '‚', true, 'single low-9 quotation mark'], | ||
| 36 | ['„', '„', true, 'double low-9 quotation mark'], | ||
| 37 | ['<', '<', true, 'less-than sign'], | ||
| 38 | ['>', '>', true, 'greater-than sign'], | ||
| 39 | ['≤', '≤', true, 'less-than or equal to'], | ||
| 40 | ['≥', '≥', true, 'greater-than or equal to'], | ||
| 41 | ['–', '–', true, 'en dash'], | ||
| 42 | ['—', '—', true, 'em dash'], | ||
| 43 | ['¯', '¯', true, 'macron'], | ||
| 44 | ['‾', '‾', true, 'overline'], | ||
| 45 | ['¤', '¤', true, 'currency sign'], | ||
| 46 | ['¦', '¦', true, 'broken bar'], | ||
| 47 | ['¨', '¨', true, 'diaeresis'], | ||
| 48 | ['¡', '¡', true, 'inverted exclamation mark'], | ||
| 49 | ['¿', '¿', true, 'turned question mark'], | ||
| 50 | ['ˆ', 'ˆ', true, 'circumflex accent'], | ||
| 51 | ['˜', '˜', true, 'small tilde'], | ||
| 52 | ['°', '°', true, 'degree sign'], | ||
| 53 | ['−', '−', true, 'minus sign'], | ||
| 54 | ['±', '±', true, 'plus-minus sign'], | ||
| 55 | ['÷', '÷', true, 'division sign'], | ||
| 56 | ['⁄', '⁄', true, 'fraction slash'], | ||
| 57 | ['×', '×', true, 'multiplication sign'], | ||
| 58 | ['¹', '¹', true, 'superscript one'], | ||
| 59 | ['²', '²', true, 'superscript two'], | ||
| 60 | ['³', '³', true, 'superscript three'], | ||
| 61 | ['¼', '¼', true, 'fraction one quarter'], | ||
| 62 | ['½', '½', true, 'fraction one half'], | ||
| 63 | ['¾', '¾', true, 'fraction three quarters'], | ||
| 64 | // math / logical | ||
| 65 | ['ƒ', 'ƒ', true, 'function / florin'], | ||
| 66 | ['∫', '∫', true, 'integral'], | ||
| 67 | ['∑', '∑', true, 'n-ary sumation'], | ||
| 68 | ['∞', '∞', true, 'infinity'], | ||
| 69 | ['√', '√', true, 'square root'], | ||
| 70 | ['∼', '∼', false,'similar to'], | ||
| 71 | ['≅', '≅', false,'approximately equal to'], | ||
| 72 | ['≈', '≈', true, 'almost equal to'], | ||
| 73 | ['≠', '≠', true, 'not equal to'], | ||
| 74 | ['≡', '≡', true, 'identical to'], | ||
| 75 | ['∈', '∈', false,'element of'], | ||
| 76 | ['∉', '∉', false,'not an element of'], | ||
| 77 | ['∋', '∋', false,'contains as member'], | ||
| 78 | ['∏', '∏', true, 'n-ary product'], | ||
| 79 | ['∧', '∧', false,'logical and'], | ||
| 80 | ['∨', '∨', false,'logical or'], | ||
| 81 | ['¬', '¬', true, 'not sign'], | ||
| 82 | ['∩', '∩', true, 'intersection'], | ||
| 83 | ['∪', '∪', false,'union'], | ||
| 84 | ['∂', '∂', true, 'partial differential'], | ||
| 85 | ['∀', '∀', false,'for all'], | ||
| 86 | ['∃', '∃', false,'there exists'], | ||
| 87 | ['∅', '∅', false,'diameter'], | ||
| 88 | ['∇', '∇', false,'backward difference'], | ||
| 89 | ['∗', '∗', false,'asterisk operator'], | ||
| 90 | ['∝', '∝', false,'proportional to'], | ||
| 91 | ['∠', '∠', false,'angle'], | ||
| 92 | // undefined | ||
| 93 | ['´', '´', true, 'acute accent'], | ||
| 94 | ['¸', '¸', true, 'cedilla'], | ||
| 95 | ['ª', 'ª', true, 'feminine ordinal indicator'], | ||
| 96 | ['º', 'º', true, 'masculine ordinal indicator'], | ||
| 97 | ['†', '†', true, 'dagger'], | ||
| 98 | ['‡', '‡', true, 'double dagger'], | ||
| 99 | // alphabetical special chars | ||
| 100 | ['À', 'À', true, 'A - grave'], | ||
| 101 | ['Á', 'Á', true, 'A - acute'], | ||
| 102 | ['Â', 'Â', true, 'A - circumflex'], | ||
| 103 | ['Ã', 'Ã', true, 'A - tilde'], | ||
| 104 | ['Ä', 'Ä', true, 'A - diaeresis'], | ||
| 105 | ['Å', 'Å', true, 'A - ring above'], | ||
| 106 | ['Æ', 'Æ', true, 'ligature AE'], | ||
| 107 | ['Ç', 'Ç', true, 'C - cedilla'], | ||
| 108 | ['È', 'È', true, 'E - grave'], | ||
| 109 | ['É', 'É', true, 'E - acute'], | ||
| 110 | ['Ê', 'Ê', true, 'E - circumflex'], | ||
| 111 | ['Ë', 'Ë', true, 'E - diaeresis'], | ||
| 112 | ['Ì', 'Ì', true, 'I - grave'], | ||
| 113 | ['Í', 'Í', true, 'I - acute'], | ||
| 114 | ['Î', 'Î', true, 'I - circumflex'], | ||
| 115 | ['Ï', 'Ï', true, 'I - diaeresis'], | ||
| 116 | ['Ð', 'Ð', true, 'ETH'], | ||
| 117 | ['Ñ', 'Ñ', true, 'N - tilde'], | ||
| 118 | ['Ò', 'Ò', true, 'O - grave'], | ||
| 119 | ['Ó', 'Ó', true, 'O - acute'], | ||
| 120 | ['Ô', 'Ô', true, 'O - circumflex'], | ||
| 121 | ['Õ', 'Õ', true, 'O - tilde'], | ||
| 122 | ['Ö', 'Ö', true, 'O - diaeresis'], | ||
| 123 | ['Ø', 'Ø', true, 'O - slash'], | ||
| 124 | ['Œ', 'Œ', true, 'ligature OE'], | ||
| 125 | ['Š', 'Š', true, 'S - caron'], | ||
| 126 | ['Ù', 'Ù', true, 'U - grave'], | ||
| 127 | ['Ú', 'Ú', true, 'U - acute'], | ||
| 128 | ['Û', 'Û', true, 'U - circumflex'], | ||
| 129 | ['Ü', 'Ü', true, 'U - diaeresis'], | ||
| 130 | ['Ý', 'Ý', true, 'Y - acute'], | ||
| 131 | ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], | ||
| 132 | ['Þ', 'Þ', true, 'THORN'], | ||
| 133 | ['à', 'à', true, 'a - grave'], | ||
| 134 | ['á', 'á', true, 'a - acute'], | ||
| 135 | ['â', 'â', true, 'a - circumflex'], | ||
| 136 | ['ã', 'ã', true, 'a - tilde'], | ||
| 137 | ['ä', 'ä', true, 'a - diaeresis'], | ||
| 138 | ['å', 'å', true, 'a - ring above'], | ||
| 139 | ['æ', 'æ', true, 'ligature ae'], | ||
| 140 | ['ç', 'ç', true, 'c - cedilla'], | ||
| 141 | ['è', 'è', true, 'e - grave'], | ||
| 142 | ['é', 'é', true, 'e - acute'], | ||
| 143 | ['ê', 'ê', true, 'e - circumflex'], | ||
| 144 | ['ë', 'ë', true, 'e - diaeresis'], | ||
| 145 | ['ì', 'ì', true, 'i - grave'], | ||
| 146 | ['í', 'í', true, 'i - acute'], | ||
| 147 | ['î', 'î', true, 'i - circumflex'], | ||
| 148 | ['ï', 'ï', true, 'i - diaeresis'], | ||
| 149 | ['ð', 'ð', true, 'eth'], | ||
| 150 | ['ñ', 'ñ', true, 'n - tilde'], | ||
| 151 | ['ò', 'ò', true, 'o - grave'], | ||
| 152 | ['ó', 'ó', true, 'o - acute'], | ||
| 153 | ['ô', 'ô', true, 'o - circumflex'], | ||
| 154 | ['õ', 'õ', true, 'o - tilde'], | ||
| 155 | ['ö', 'ö', true, 'o - diaeresis'], | ||
| 156 | ['ø', 'ø', true, 'o slash'], | ||
| 157 | ['œ', 'œ', true, 'ligature oe'], | ||
| 158 | ['š', 'š', true, 's - caron'], | ||
| 159 | ['ù', 'ù', true, 'u - grave'], | ||
| 160 | ['ú', 'ú', true, 'u - acute'], | ||
| 161 | ['û', 'û', true, 'u - circumflex'], | ||
| 162 | ['ü', 'ü', true, 'u - diaeresis'], | ||
| 163 | ['ý', 'ý', true, 'y - acute'], | ||
| 164 | ['þ', 'þ', true, 'thorn'], | ||
| 165 | ['ÿ', 'ÿ', true, 'y - diaeresis'], | ||
| 166 | ['Α', 'Α', true, 'Alpha'], | ||
| 167 | ['Β', 'Β', true, 'Beta'], | ||
| 168 | ['Γ', 'Γ', true, 'Gamma'], | ||
| 169 | ['Δ', 'Δ', true, 'Delta'], | ||
| 170 | ['Ε', 'Ε', true, 'Epsilon'], | ||
| 171 | ['Ζ', 'Ζ', true, 'Zeta'], | ||
| 172 | ['Η', 'Η', true, 'Eta'], | ||
| 173 | ['Θ', 'Θ', true, 'Theta'], | ||
| 174 | ['Ι', 'Ι', true, 'Iota'], | ||
| 175 | ['Κ', 'Κ', true, 'Kappa'], | ||
| 176 | ['Λ', 'Λ', true, 'Lambda'], | ||
| 177 | ['Μ', 'Μ', true, 'Mu'], | ||
| 178 | ['Ν', 'Ν', true, 'Nu'], | ||
| 179 | ['Ξ', 'Ξ', true, 'Xi'], | ||
| 180 | ['Ο', 'Ο', true, 'Omicron'], | ||
| 181 | ['Π', 'Π', true, 'Pi'], | ||
| 182 | ['Ρ', 'Ρ', true, 'Rho'], | ||
| 183 | ['Σ', 'Σ', true, 'Sigma'], | ||
| 184 | ['Τ', 'Τ', true, 'Tau'], | ||
| 185 | ['Υ', 'Υ', true, 'Upsilon'], | ||
| 186 | ['Φ', 'Φ', true, 'Phi'], | ||
| 187 | ['Χ', 'Χ', true, 'Chi'], | ||
| 188 | ['Ψ', 'Ψ', true, 'Psi'], | ||
| 189 | ['Ω', 'Ω', true, 'Omega'], | ||
| 190 | ['α', 'α', true, 'alpha'], | ||
| 191 | ['β', 'β', true, 'beta'], | ||
| 192 | ['γ', 'γ', true, 'gamma'], | ||
| 193 | ['δ', 'δ', true, 'delta'], | ||
| 194 | ['ε', 'ε', true, 'epsilon'], | ||
| 195 | ['ζ', 'ζ', true, 'zeta'], | ||
| 196 | ['η', 'η', true, 'eta'], | ||
| 197 | ['θ', 'θ', true, 'theta'], | ||
| 198 | ['ι', 'ι', true, 'iota'], | ||
| 199 | ['κ', 'κ', true, 'kappa'], | ||
| 200 | ['λ', 'λ', true, 'lambda'], | ||
| 201 | ['μ', 'μ', true, 'mu'], | ||
| 202 | ['ν', 'ν', true, 'nu'], | ||
| 203 | ['ξ', 'ξ', true, 'xi'], | ||
| 204 | ['ο', 'ο', true, 'omicron'], | ||
| 205 | ['π', 'π', true, 'pi'], | ||
| 206 | ['ρ', 'ρ', true, 'rho'], | ||
| 207 | ['ς', 'ς', true, 'final sigma'], | ||
| 208 | ['σ', 'σ', true, 'sigma'], | ||
| 209 | ['τ', 'τ', true, 'tau'], | ||
| 210 | ['υ', 'υ', true, 'upsilon'], | ||
| 211 | ['φ', 'φ', true, 'phi'], | ||
| 212 | ['χ', 'χ', true, 'chi'], | ||
| 213 | ['ψ', 'ψ', true, 'psi'], | ||
| 214 | ['ω', 'ω', true, 'omega'], | ||
| 215 | // symbols | ||
| 216 | ['ℵ', 'ℵ', false,'alef symbol'], | ||
| 217 | ['ϖ', 'ϖ', false,'pi symbol'], | ||
| 218 | ['ℜ', 'ℜ', false,'real part symbol'], | ||
| 219 | ['ϑ','ϑ', false,'theta symbol'], | ||
| 220 | ['ϒ', 'ϒ', false,'upsilon - hook symbol'], | ||
| 221 | ['℘', '℘', false,'Weierstrass p'], | ||
| 222 | ['ℑ', 'ℑ', false,'imaginary part'], | ||
| 223 | // arrows | ||
| 224 | ['←', '←', true, 'leftwards arrow'], | ||
| 225 | ['↑', '↑', true, 'upwards arrow'], | ||
| 226 | ['→', '→', true, 'rightwards arrow'], | ||
| 227 | ['↓', '↓', true, 'downwards arrow'], | ||
| 228 | ['↔', '↔', true, 'left right arrow'], | ||
| 229 | ['↵', '↵', false,'carriage return'], | ||
| 230 | ['⇐', '⇐', false,'leftwards double arrow'], | ||
| 231 | ['⇑', '⇑', false,'upwards double arrow'], | ||
| 232 | ['⇒', '⇒', false,'rightwards double arrow'], | ||
| 233 | ['⇓', '⇓', false,'downwards double arrow'], | ||
| 234 | ['⇔', '⇔', false,'left right double arrow'], | ||
| 235 | ['∴', '∴', false,'therefore'], | ||
| 236 | ['⊂', '⊂', false,'subset of'], | ||
| 237 | ['⊃', '⊃', false,'superset of'], | ||
| 238 | ['⊄', '⊄', false,'not a subset of'], | ||
| 239 | ['⊆', '⊆', false,'subset of or equal to'], | ||
| 240 | ['⊇', '⊇', false,'superset of or equal to'], | ||
| 241 | ['⊕', '⊕', false,'circled plus'], | ||
| 242 | ['⊗', '⊗', false,'circled times'], | ||
| 243 | ['⊥', '⊥', false,'perpendicular'], | ||
| 244 | ['⋅', '⋅', false,'dot operator'], | ||
| 245 | ['⌈', '⌈', false,'left ceiling'], | ||
| 246 | ['⌉', '⌉', false,'right ceiling'], | ||
| 247 | ['⌊', '⌊', false,'left floor'], | ||
| 248 | ['⌋', '⌋', false,'right floor'], | ||
| 249 | ['⟨', '〈', false,'left-pointing angle bracket'], | ||
| 250 | ['⟩', '〉', false,'right-pointing angle bracket'], | ||
| 251 | ['◊', '◊', true,'lozenge'], | ||
| 252 | ['♠', '♠', false,'black spade suit'], | ||
| 253 | ['♣', '♣', true, 'black club suit'], | ||
| 254 | ['♥', '♥', true, 'black heart suit'], | ||
| 255 | ['♦', '♦', true, 'black diamond suit'], | ||
| 256 | [' ', ' ', false,'en space'], | ||
| 257 | [' ', ' ', false,'em space'], | ||
| 258 | [' ', ' ', false,'thin space'], | ||
| 259 | ['‌', '‌', false,'zero width non-joiner'], | ||
| 260 | ['‍', '‍', false,'zero width joiner'], | ||
| 261 | ['‎', '‎', false,'left-to-right mark'], | ||
| 262 | ['‏', '‏', false,'right-to-left mark'], | ||
| 263 | ['­', '­', false,'soft hyphen'] | ||
| 264 | ]; | ||
| 265 | |||
| 266 | tinyMCEPopup.onInit.add(function() { | ||
| 267 | tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); | ||
| 268 | }); | ||
| 269 | |||
| 270 | function renderCharMapHTML() { | ||
| 271 | var charsPerRow = 20, tdWidth=20, tdHeight=20, i; | ||
| 272 | var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">'; | ||
| 273 | var cols=-1; | ||
| 274 | |||
| 275 | for (i=0; i<charmap.length; i++) { | ||
| 276 | if (charmap[i][2]==true) { | ||
| 277 | cols++; | ||
| 278 | html += '' | ||
| 279 | + '<td class="charmap">' | ||
| 280 | + '<a onmouseover="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">' | ||
| 281 | + charmap[i][1] | ||
| 282 | + '</a></td>'; | ||
| 283 | if ((cols+1) % charsPerRow == 0) | ||
| 284 | html += '</tr><tr height="' + tdHeight + '">'; | ||
| 285 | } | ||
| 286 | } | ||
| 287 | |||
| 288 | if (cols % charsPerRow > 0) { | ||
| 289 | var padd = charsPerRow - (cols % charsPerRow); | ||
| 290 | for (var i=0; i<padd-1; i++) | ||
| 291 | html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"> </td>'; | ||
| 292 | } | ||
| 293 | |||
| 294 | html += '</tr></table>'; | ||
| 295 | |||
| 296 | return html; | ||
| 297 | } | ||
| 298 | |||
| 299 | function insertChar(chr) { | ||
| 300 | tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); | ||
| 301 | |||
| 302 | // Refocus in window | ||
| 303 | if (tinyMCEPopup.isWindow) | ||
| 304 | window.focus(); | ||
| 305 | |||
| 306 | tinyMCEPopup.editor.focus(); | ||
| 307 | tinyMCEPopup.close(); | ||
| 308 | } | ||
| 309 | |||
| 310 | function previewChar(codeA, codeB, codeN) { | ||
| 311 | var elmA = document.getElementById('codeA'); | ||
| 312 | var elmB = document.getElementById('codeB'); | ||
| 313 | var elmV = document.getElementById('codeV'); | ||
| 314 | var elmN = document.getElementById('codeN'); | ||
| 315 | |||
| 316 | if (codeA=='#160;') { | ||
| 317 | elmV.innerHTML = '__'; | ||
| 318 | } else { | ||
| 319 | elmV.innerHTML = '&' + codeA; | ||
| 320 | } | ||
| 321 | |||
| 322 | elmB.innerHTML = '&' + codeA; | ||
| 323 | elmA.innerHTML = '&' + codeB; | ||
| 324 | elmN.innerHTML = codeN; | ||
| 325 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/color_picker.js b/public/javascripts/tiny_mce/themes/advanced/js/color_picker.js new file mode 100755 index 0000000..fd9700f --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/js/color_picker.js | |||
| @@ -0,0 +1,253 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; | ||
| 4 | |||
| 5 | var colors = [ | ||
| 6 | "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", | ||
| 7 | "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", | ||
| 8 | "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", | ||
| 9 | "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", | ||
| 10 | "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", | ||
| 11 | "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", | ||
| 12 | "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", | ||
| 13 | "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", | ||
| 14 | "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", | ||
| 15 | "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", | ||
| 16 | "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", | ||
| 17 | "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", | ||
| 18 | "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", | ||
| 19 | "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", | ||
| 20 | "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", | ||
| 21 | "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", | ||
| 22 | "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", | ||
| 23 | "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", | ||
| 24 | "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", | ||
| 25 | "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", | ||
| 26 | "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", | ||
| 27 | "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", | ||
| 28 | "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", | ||
| 29 | "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", | ||
| 30 | "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", | ||
| 31 | "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", | ||
| 32 | "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" | ||
| 33 | ]; | ||
| 34 | |||
| 35 | var named = { | ||
| 36 | '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', | ||
| 37 | '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown', | ||
| 38 | '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue', | ||
| 39 | '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod', | ||
| 40 | '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen', | ||
| 41 | '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue', | ||
| 42 | '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue', | ||
| 43 | '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen', | ||
| 44 | '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey', | ||
| 45 | '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory', | ||
| 46 | '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue', | ||
| 47 | '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen', | ||
| 48 | '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey', | ||
| 49 | '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', | ||
| 50 | '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue', | ||
| 51 | '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin', | ||
| 52 | '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid', | ||
| 53 | '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff', | ||
| 54 | '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue', | ||
| 55 | '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver', | ||
| 56 | '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen', | ||
| 57 | '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', | ||
| 58 | '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen' | ||
| 59 | }; | ||
| 60 | |||
| 61 | function init() { | ||
| 62 | var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')); | ||
| 63 | |||
| 64 | tinyMCEPopup.resizeToInnerSize(); | ||
| 65 | |||
| 66 | generatePicker(); | ||
| 67 | |||
| 68 | if (inputColor) { | ||
| 69 | changeFinalColor(inputColor); | ||
| 70 | |||
| 71 | col = convertHexToRGB(inputColor); | ||
| 72 | |||
| 73 | if (col) | ||
| 74 | updateLight(col.r, col.g, col.b); | ||
| 75 | } | ||
| 76 | } | ||
| 77 | |||
| 78 | function insertAction() { | ||
| 79 | var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); | ||
| 80 | |||
| 81 | tinyMCEPopup.restoreSelection(); | ||
| 82 | |||
| 83 | if (f) | ||
| 84 | f(color); | ||
| 85 | |||
| 86 | tinyMCEPopup.close(); | ||
| 87 | } | ||
| 88 | |||
| 89 | function showColor(color, name) { | ||
| 90 | if (name) | ||
| 91 | document.getElementById("colorname").innerHTML = name; | ||
| 92 | |||
| 93 | document.getElementById("preview").style.backgroundColor = color; | ||
| 94 | document.getElementById("color").value = color.toLowerCase(); | ||
| 95 | } | ||
| 96 | |||
| 97 | function convertRGBToHex(col) { | ||
| 98 | var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); | ||
| 99 | |||
| 100 | if (!col) | ||
| 101 | return col; | ||
| 102 | |||
| 103 | var rgb = col.replace(re, "$1,$2,$3").split(','); | ||
| 104 | if (rgb.length == 3) { | ||
| 105 | r = parseInt(rgb[0]).toString(16); | ||
| 106 | g = parseInt(rgb[1]).toString(16); | ||
| 107 | b = parseInt(rgb[2]).toString(16); | ||
| 108 | |||
| 109 | r = r.length == 1 ? '0' + r : r; | ||
| 110 | g = g.length == 1 ? '0' + g : g; | ||
| 111 | b = b.length == 1 ? '0' + b : b; | ||
| 112 | |||
| 113 | return "#" + r + g + b; | ||
| 114 | } | ||
| 115 | |||
| 116 | return col; | ||
| 117 | } | ||
| 118 | |||
| 119 | function convertHexToRGB(col) { | ||
| 120 | if (col.indexOf('#') != -1) { | ||
| 121 | col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); | ||
| 122 | |||
| 123 | r = parseInt(col.substring(0, 2), 16); | ||
| 124 | g = parseInt(col.substring(2, 4), 16); | ||
| 125 | b = parseInt(col.substring(4, 6), 16); | ||
| 126 | |||
| 127 | return {r : r, g : g, b : b}; | ||
| 128 | } | ||
| 129 | |||
| 130 | return null; | ||
| 131 | } | ||
| 132 | |||
| 133 | function generatePicker() { | ||
| 134 | var el = document.getElementById('light'), h = '', i; | ||
| 135 | |||
| 136 | for (i = 0; i < detail; i++){ | ||
| 137 | h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"' | ||
| 138 | + ' onclick="changeFinalColor(this.style.backgroundColor)"' | ||
| 139 | + ' onmousedown="isMouseDown = true; return false;"' | ||
| 140 | + ' onmouseup="isMouseDown = false;"' | ||
| 141 | + ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"' | ||
| 142 | + ' onmouseover="isMouseOver = true;"' | ||
| 143 | + ' onmouseout="isMouseOver = false;"' | ||
| 144 | + '></div>'; | ||
| 145 | } | ||
| 146 | |||
| 147 | el.innerHTML = h; | ||
| 148 | } | ||
| 149 | |||
| 150 | function generateWebColors() { | ||
| 151 | var el = document.getElementById('webcolors'), h = '', i; | ||
| 152 | |||
| 153 | if (el.className == 'generated') | ||
| 154 | return; | ||
| 155 | |||
| 156 | h += '<table border="0" cellspacing="1" cellpadding="0">' | ||
| 157 | + '<tr>'; | ||
| 158 | |||
| 159 | for (i=0; i<colors.length; i++) { | ||
| 160 | h += '<td bgcolor="' + colors[i] + '" width="10" height="10">' | ||
| 161 | + '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">' | ||
| 162 | + '</a></td>'; | ||
| 163 | if ((i+1) % 18 == 0) | ||
| 164 | h += '</tr><tr>'; | ||
| 165 | } | ||
| 166 | |||
| 167 | h += '</table>'; | ||
| 168 | |||
| 169 | el.innerHTML = h; | ||
| 170 | el.className = 'generated'; | ||
| 171 | } | ||
| 172 | |||
| 173 | function generateNamedColors() { | ||
| 174 | var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; | ||
| 175 | |||
| 176 | if (el.className == 'generated') | ||
| 177 | return; | ||
| 178 | |||
| 179 | for (n in named) { | ||
| 180 | v = named[n]; | ||
| 181 | h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>' | ||
| 182 | } | ||
| 183 | |||
| 184 | el.innerHTML = h; | ||
| 185 | el.className = 'generated'; | ||
| 186 | } | ||
| 187 | |||
| 188 | function dechex(n) { | ||
| 189 | return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); | ||
| 190 | } | ||
| 191 | |||
| 192 | function computeColor(e) { | ||
| 193 | var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; | ||
| 194 | |||
| 195 | x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); | ||
| 196 | y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); | ||
| 197 | |||
| 198 | partWidth = document.getElementById('colors').width / 6; | ||
| 199 | partDetail = detail / 2; | ||
| 200 | imHeight = document.getElementById('colors').height; | ||
| 201 | |||
| 202 | r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; | ||
| 203 | g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); | ||
| 204 | b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); | ||
| 205 | |||
| 206 | coef = (imHeight - y) / imHeight; | ||
| 207 | r = 128 + (r - 128) * coef; | ||
| 208 | g = 128 + (g - 128) * coef; | ||
| 209 | b = 128 + (b - 128) * coef; | ||
| 210 | |||
| 211 | changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); | ||
| 212 | updateLight(r, g, b); | ||
| 213 | } | ||
| 214 | |||
| 215 | function updateLight(r, g, b) { | ||
| 216 | var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; | ||
| 217 | |||
| 218 | for (i=0; i<detail; i++) { | ||
| 219 | if ((i>=0) && (i<partDetail)) { | ||
| 220 | finalCoef = i / partDetail; | ||
| 221 | finalR = dechex(255 - (255 - r) * finalCoef); | ||
| 222 | finalG = dechex(255 - (255 - g) * finalCoef); | ||
| 223 | finalB = dechex(255 - (255 - b) * finalCoef); | ||
| 224 | } else { | ||
| 225 | finalCoef = 2 - i / partDetail; | ||
| 226 | finalR = dechex(r * finalCoef); | ||
| 227 | finalG = dechex(g * finalCoef); | ||
| 228 | finalB = dechex(b * finalCoef); | ||
| 229 | } | ||
| 230 | |||
| 231 | color = finalR + finalG + finalB; | ||
| 232 | |||
| 233 | setCol('gs' + i, '#'+color); | ||
| 234 | } | ||
| 235 | } | ||
| 236 | |||
| 237 | function changeFinalColor(color) { | ||
| 238 | if (color.indexOf('#') == -1) | ||
| 239 | color = convertRGBToHex(color); | ||
| 240 | |||
| 241 | setCol('preview', color); | ||
| 242 | document.getElementById('color').value = color; | ||
| 243 | } | ||
| 244 | |||
| 245 | function setCol(e, c) { | ||
| 246 | try { | ||
| 247 | document.getElementById(e).style.backgroundColor = c; | ||
| 248 | } catch (ex) { | ||
| 249 | // Ignore IE warning | ||
| 250 | } | ||
| 251 | } | ||
| 252 | |||
| 253 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/image.js b/public/javascripts/tiny_mce/themes/advanced/js/image.js new file mode 100755 index 0000000..4982ce0 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/js/image.js | |||
| @@ -0,0 +1,245 @@ | |||
| 1 | var ImageDialog = { | ||
| 2 | preInit : function() { | ||
| 3 | var url; | ||
| 4 | |||
| 5 | tinyMCEPopup.requireLangPack(); | ||
| 6 | |||
| 7 | if (url = tinyMCEPopup.getParam("external_image_list_url")) | ||
| 8 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 9 | }, | ||
| 10 | |||
| 11 | init : function() { | ||
| 12 | var f = document.forms[0], ed = tinyMCEPopup.editor; | ||
| 13 | |||
| 14 | // Setup browse button | ||
| 15 | document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); | ||
| 16 | if (isVisible('srcbrowser')) | ||
| 17 | document.getElementById('src').style.width = '180px'; | ||
| 18 | |||
| 19 | e = ed.selection.getNode(); | ||
| 20 | |||
| 21 | this.fillFileList('image_list', 'tinyMCEImageList'); | ||
| 22 | |||
| 23 | if (e.nodeName == 'IMG') { | ||
| 24 | f.src.value = ed.dom.getAttrib(e, 'src'); | ||
| 25 | f.alt.value = ed.dom.getAttrib(e, 'alt'); | ||
| 26 | f.border.value = this.getAttrib(e, 'border'); | ||
| 27 | f.vspace.value = this.getAttrib(e, 'vspace'); | ||
| 28 | f.hspace.value = this.getAttrib(e, 'hspace'); | ||
| 29 | f.width.value = ed.dom.getAttrib(e, 'width'); | ||
| 30 | f.height.value = ed.dom.getAttrib(e, 'height'); | ||
| 31 | f.insert.value = ed.getLang('update'); | ||
| 32 | this.styleVal = ed.dom.getAttrib(e, 'style'); | ||
| 33 | selectByValue(f, 'image_list', f.src.value); | ||
| 34 | selectByValue(f, 'align', this.getAttrib(e, 'align')); | ||
| 35 | this.updateStyle(); | ||
| 36 | } | ||
| 37 | }, | ||
| 38 | |||
| 39 | fillFileList : function(id, l) { | ||
| 40 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 41 | |||
| 42 | l = window[l]; | ||
| 43 | |||
| 44 | if (l && l.length > 0) { | ||
| 45 | lst.options[lst.options.length] = new Option('', ''); | ||
| 46 | |||
| 47 | tinymce.each(l, function(o) { | ||
| 48 | lst.options[lst.options.length] = new Option(o[0], o[1]); | ||
| 49 | }); | ||
| 50 | } else | ||
| 51 | dom.remove(dom.getParent(id, 'tr')); | ||
| 52 | }, | ||
| 53 | |||
| 54 | update : function() { | ||
| 55 | var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; | ||
| 56 | |||
| 57 | tinyMCEPopup.restoreSelection(); | ||
| 58 | |||
| 59 | if (f.src.value === '') { | ||
| 60 | if (ed.selection.getNode().nodeName == 'IMG') { | ||
| 61 | ed.dom.remove(ed.selection.getNode()); | ||
| 62 | ed.execCommand('mceRepaint'); | ||
| 63 | } | ||
| 64 | |||
| 65 | tinyMCEPopup.close(); | ||
| 66 | return; | ||
| 67 | } | ||
| 68 | |||
| 69 | if (!ed.settings.inline_styles) { | ||
| 70 | args = tinymce.extend(args, { | ||
| 71 | vspace : nl.vspace.value, | ||
| 72 | hspace : nl.hspace.value, | ||
| 73 | border : nl.border.value, | ||
| 74 | align : getSelectValue(f, 'align') | ||
| 75 | }); | ||
| 76 | } else | ||
| 77 | args.style = this.styleVal; | ||
| 78 | |||
| 79 | tinymce.extend(args, { | ||
| 80 | src : f.src.value, | ||
| 81 | alt : f.alt.value, | ||
| 82 | width : f.width.value, | ||
| 83 | height : f.height.value | ||
| 84 | }); | ||
| 85 | |||
| 86 | el = ed.selection.getNode(); | ||
| 87 | |||
| 88 | if (el && el.nodeName == 'IMG') { | ||
| 89 | ed.dom.setAttribs(el, args); | ||
| 90 | } else { | ||
| 91 | ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1}); | ||
| 92 | ed.dom.setAttribs('__mce_tmp', args); | ||
| 93 | ed.dom.setAttrib('__mce_tmp', 'id', ''); | ||
| 94 | ed.undoManager.add(); | ||
| 95 | } | ||
| 96 | |||
| 97 | tinyMCEPopup.close(); | ||
| 98 | }, | ||
| 99 | |||
| 100 | updateStyle : function() { | ||
| 101 | var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; | ||
| 102 | |||
| 103 | if (tinyMCEPopup.editor.settings.inline_styles) { | ||
| 104 | st = tinyMCEPopup.dom.parseStyle(this.styleVal); | ||
| 105 | |||
| 106 | // Handle align | ||
| 107 | v = getSelectValue(f, 'align'); | ||
| 108 | if (v) { | ||
| 109 | if (v == 'left' || v == 'right') { | ||
| 110 | st['float'] = v; | ||
| 111 | delete st['vertical-align']; | ||
| 112 | } else { | ||
| 113 | st['vertical-align'] = v; | ||
| 114 | delete st['float']; | ||
| 115 | } | ||
| 116 | } else { | ||
| 117 | delete st['float']; | ||
| 118 | delete st['vertical-align']; | ||
| 119 | } | ||
| 120 | |||
| 121 | // Handle border | ||
| 122 | v = f.border.value; | ||
| 123 | if (v || v == '0') { | ||
| 124 | if (v == '0') | ||
| 125 | st['border'] = '0'; | ||
| 126 | else | ||
| 127 | st['border'] = v + 'px solid black'; | ||
| 128 | } else | ||
| 129 | delete st['border']; | ||
| 130 | |||
| 131 | // Handle hspace | ||
| 132 | v = f.hspace.value; | ||
| 133 | if (v) { | ||
| 134 | delete st['margin']; | ||
| 135 | st['margin-left'] = v + 'px'; | ||
| 136 | st['margin-right'] = v + 'px'; | ||
| 137 | } else { | ||
| 138 | delete st['margin-left']; | ||
| 139 | delete st['margin-right']; | ||
| 140 | } | ||
| 141 | |||
| 142 | // Handle vspace | ||
| 143 | v = f.vspace.value; | ||
| 144 | if (v) { | ||
| 145 | delete st['margin']; | ||
| 146 | st['margin-top'] = v + 'px'; | ||
| 147 | st['margin-bottom'] = v + 'px'; | ||
| 148 | } else { | ||
| 149 | delete st['margin-top']; | ||
| 150 | delete st['margin-bottom']; | ||
| 151 | } | ||
| 152 | |||
| 153 | // Merge | ||
| 154 | st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st)); | ||
| 155 | this.styleVal = dom.serializeStyle(st); | ||
| 156 | } | ||
| 157 | }, | ||
| 158 | |||
| 159 | getAttrib : function(e, at) { | ||
| 160 | var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; | ||
| 161 | |||
| 162 | if (ed.settings.inline_styles) { | ||
| 163 | switch (at) { | ||
| 164 | case 'align': | ||
| 165 | if (v = dom.getStyle(e, 'float')) | ||
| 166 | return v; | ||
| 167 | |||
| 168 | if (v = dom.getStyle(e, 'vertical-align')) | ||
| 169 | return v; | ||
| 170 | |||
| 171 | break; | ||
| 172 | |||
| 173 | case 'hspace': | ||
| 174 | v = dom.getStyle(e, 'margin-left') | ||
| 175 | v2 = dom.getStyle(e, 'margin-right'); | ||
| 176 | if (v && v == v2) | ||
| 177 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 178 | |||
| 179 | break; | ||
| 180 | |||
| 181 | case 'vspace': | ||
| 182 | v = dom.getStyle(e, 'margin-top') | ||
| 183 | v2 = dom.getStyle(e, 'margin-bottom'); | ||
| 184 | if (v && v == v2) | ||
| 185 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 186 | |||
| 187 | break; | ||
| 188 | |||
| 189 | case 'border': | ||
| 190 | v = 0; | ||
| 191 | |||
| 192 | tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { | ||
| 193 | sv = dom.getStyle(e, 'border-' + sv + '-width'); | ||
| 194 | |||
| 195 | // False or not the same as prev | ||
| 196 | if (!sv || (sv != v && v !== 0)) { | ||
| 197 | v = 0; | ||
| 198 | return false; | ||
| 199 | } | ||
| 200 | |||
| 201 | if (sv) | ||
| 202 | v = sv; | ||
| 203 | }); | ||
| 204 | |||
| 205 | if (v) | ||
| 206 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 207 | |||
| 208 | break; | ||
| 209 | } | ||
| 210 | } | ||
| 211 | |||
| 212 | if (v = dom.getAttrib(e, at)) | ||
| 213 | return v; | ||
| 214 | |||
| 215 | return ''; | ||
| 216 | }, | ||
| 217 | |||
| 218 | resetImageData : function() { | ||
| 219 | var f = document.forms[0]; | ||
| 220 | |||
| 221 | f.width.value = f.height.value = ""; | ||
| 222 | }, | ||
| 223 | |||
| 224 | updateImageData : function() { | ||
| 225 | var f = document.forms[0], t = ImageDialog; | ||
| 226 | |||
| 227 | if (f.width.value == "") | ||
| 228 | f.width.value = t.preloadImg.width; | ||
| 229 | |||
| 230 | if (f.height.value == "") | ||
| 231 | f.height.value = t.preloadImg.height; | ||
| 232 | }, | ||
| 233 | |||
| 234 | getImageData : function() { | ||
| 235 | var f = document.forms[0]; | ||
| 236 | |||
| 237 | this.preloadImg = new Image(); | ||
| 238 | this.preloadImg.onload = this.updateImageData; | ||
| 239 | this.preloadImg.onerror = this.resetImageData; | ||
| 240 | this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); | ||
| 241 | } | ||
| 242 | }; | ||
| 243 | |||
| 244 | ImageDialog.preInit(); | ||
| 245 | tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/link.js b/public/javascripts/tiny_mce/themes/advanced/js/link.js new file mode 100755 index 0000000..2974878 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/js/link.js | |||
| @@ -0,0 +1,155 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var LinkDialog = { | ||
| 4 | preInit : function() { | ||
| 5 | var url; | ||
| 6 | |||
| 7 | if (url = tinyMCEPopup.getParam("external_link_list_url")) | ||
| 8 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 9 | }, | ||
| 10 | |||
| 11 | init : function() { | ||
| 12 | var f = document.forms[0], ed = tinyMCEPopup.editor; | ||
| 13 | |||
| 14 | // Setup browse button | ||
| 15 | document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); | ||
| 16 | if (isVisible('hrefbrowser')) | ||
| 17 | document.getElementById('href').style.width = '180px'; | ||
| 18 | |||
| 19 | this.fillClassList('class_list'); | ||
| 20 | this.fillFileList('link_list', 'tinyMCELinkList'); | ||
| 21 | this.fillTargetList('target_list'); | ||
| 22 | |||
| 23 | if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { | ||
| 24 | f.href.value = ed.dom.getAttrib(e, 'href'); | ||
| 25 | f.linktitle.value = ed.dom.getAttrib(e, 'title'); | ||
| 26 | f.insert.value = ed.getLang('update'); | ||
| 27 | selectByValue(f, 'link_list', f.href.value); | ||
| 28 | selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); | ||
| 29 | selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); | ||
| 30 | } | ||
| 31 | }, | ||
| 32 | |||
| 33 | update : function() { | ||
| 34 | var f = document.forms[0], ed = tinyMCEPopup.editor, e, b; | ||
| 35 | |||
| 36 | tinyMCEPopup.restoreSelection(); | ||
| 37 | e = ed.dom.getParent(ed.selection.getNode(), 'A'); | ||
| 38 | |||
| 39 | // Remove element if there is no href | ||
| 40 | if (!f.href.value) { | ||
| 41 | if (e) { | ||
| 42 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 43 | b = ed.selection.getBookmark(); | ||
| 44 | ed.dom.remove(e, 1); | ||
| 45 | ed.selection.moveToBookmark(b); | ||
| 46 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 47 | tinyMCEPopup.close(); | ||
| 48 | return; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | |||
| 52 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 53 | |||
| 54 | // Create new anchor elements | ||
| 55 | if (e == null) { | ||
| 56 | tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); | ||
| 57 | |||
| 58 | tinymce.each(ed.dom.select("a"), function(n) { | ||
| 59 | if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { | ||
| 60 | e = n; | ||
| 61 | |||
| 62 | ed.dom.setAttribs(e, { | ||
| 63 | href : f.href.value, | ||
| 64 | title : f.linktitle.value, | ||
| 65 | target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, | ||
| 66 | 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null | ||
| 67 | }); | ||
| 68 | } | ||
| 69 | }); | ||
| 70 | } else { | ||
| 71 | ed.dom.setAttribs(e, { | ||
| 72 | href : f.href.value, | ||
| 73 | title : f.linktitle.value, | ||
| 74 | target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, | ||
| 75 | 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null | ||
| 76 | }); | ||
| 77 | } | ||
| 78 | |||
| 79 | // Don't move caret if selection was image | ||
| 80 | if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { | ||
| 81 | ed.focus(); | ||
| 82 | ed.selection.select(e); | ||
| 83 | ed.selection.collapse(0); | ||
| 84 | tinyMCEPopup.storeSelection(); | ||
| 85 | } | ||
| 86 | |||
| 87 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 88 | tinyMCEPopup.close(); | ||
| 89 | }, | ||
| 90 | |||
| 91 | checkPrefix : function(n) { | ||
| 92 | if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) | ||
| 93 | n.value = 'mailto:' + n.value; | ||
| 94 | |||
| 95 | if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) | ||
| 96 | n.value = 'http://' + n.value; | ||
| 97 | }, | ||
| 98 | |||
| 99 | fillFileList : function(id, l) { | ||
| 100 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 101 | |||
| 102 | l = window[l]; | ||
| 103 | |||
| 104 | if (l && l.length > 0) { | ||
| 105 | lst.options[lst.options.length] = new Option('', ''); | ||
| 106 | |||
| 107 | tinymce.each(l, function(o) { | ||
| 108 | lst.options[lst.options.length] = new Option(o[0], o[1]); | ||
| 109 | }); | ||
| 110 | } else | ||
| 111 | dom.remove(dom.getParent(id, 'tr')); | ||
| 112 | }, | ||
| 113 | |||
| 114 | fillClassList : function(id) { | ||
| 115 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 116 | |||
| 117 | if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { | ||
| 118 | cl = []; | ||
| 119 | |||
| 120 | tinymce.each(v.split(';'), function(v) { | ||
| 121 | var p = v.split('='); | ||
| 122 | |||
| 123 | cl.push({'title' : p[0], 'class' : p[1]}); | ||
| 124 | }); | ||
| 125 | } else | ||
| 126 | cl = tinyMCEPopup.editor.dom.getClasses(); | ||
| 127 | |||
| 128 | if (cl.length > 0) { | ||
| 129 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); | ||
| 130 | |||
| 131 | tinymce.each(cl, function(o) { | ||
| 132 | lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); | ||
| 133 | }); | ||
| 134 | } else | ||
| 135 | dom.remove(dom.getParent(id, 'tr')); | ||
| 136 | }, | ||
| 137 | |||
| 138 | fillTargetList : function(id) { | ||
| 139 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v; | ||
| 140 | |||
| 141 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); | ||
| 142 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); | ||
| 143 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); | ||
| 144 | |||
| 145 | if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { | ||
| 146 | tinymce.each(v.split(','), function(v) { | ||
| 147 | v = v.split('='); | ||
| 148 | lst.options[lst.options.length] = new Option(v[0], v[1]); | ||
| 149 | }); | ||
| 150 | } | ||
| 151 | } | ||
| 152 | }; | ||
| 153 | |||
| 154 | LinkDialog.preInit(); | ||
| 155 | tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/source_editor.js b/public/javascripts/tiny_mce/themes/advanced/js/source_editor.js new file mode 100755 index 0000000..af2231c --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/js/source_editor.js | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | tinyMCEPopup.onInit.add(onLoadInit); | ||
| 3 | |||
| 4 | function saveContent() { | ||
| 5 | tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value); | ||
| 6 | tinyMCEPopup.close(); | ||
| 7 | } | ||
| 8 | |||
| 9 | function onLoadInit() { | ||
| 10 | tinyMCEPopup.resizeToInnerSize(); | ||
| 11 | |||
| 12 | // Remove Gecko spellchecking | ||
| 13 | if (tinymce.isGecko) | ||
| 14 | document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); | ||
| 15 | |||
| 16 | document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent(); | ||
| 17 | |||
| 18 | if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { | ||
| 19 | setWrap('soft'); | ||
| 20 | document.getElementById('wraped').checked = true; | ||
| 21 | } | ||
| 22 | |||
| 23 | resizeInputs(); | ||
| 24 | } | ||
| 25 | |||
| 26 | function setWrap(val) { | ||
| 27 | var v, n, s = document.getElementById('htmlSource'); | ||
| 28 | |||
| 29 | s.wrap = val; | ||
| 30 | |||
| 31 | if (!tinymce.isIE) { | ||
| 32 | v = s.value; | ||
| 33 | n = s.cloneNode(false); | ||
| 34 | n.setAttribute("wrap", val); | ||
| 35 | s.parentNode.replaceChild(n, s); | ||
| 36 | n.value = v; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 40 | function toggleWordWrap(elm) { | ||
| 41 | if (elm.checked) | ||
| 42 | setWrap('soft'); | ||
| 43 | else | ||
| 44 | setWrap('off'); | ||
| 45 | } | ||
| 46 | |||
| 47 | var wHeight=0, wWidth=0, owHeight=0, owWidth=0; | ||
| 48 | |||
| 49 | function resizeInputs() { | ||
| 50 | var el = document.getElementById('htmlSource'); | ||
| 51 | |||
| 52 | if (!tinymce.isIE) { | ||
| 53 | wHeight = self.innerHeight - 65; | ||
| 54 | wWidth = self.innerWidth - 16; | ||
| 55 | } else { | ||
| 56 | wHeight = document.body.clientHeight - 70; | ||
| 57 | wWidth = document.body.clientWidth - 16; | ||
| 58 | } | ||
| 59 | |||
| 60 | el.style.height = Math.abs(wHeight) + 'px'; | ||
| 61 | el.style.width = Math.abs(wWidth) + 'px'; | ||
| 62 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/langs/en.js b/public/javascripts/tiny_mce/themes/advanced/langs/en.js new file mode 100755 index 0000000..69694b1 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/langs/en.js | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | tinyMCE.addI18n('en.advanced',{ | ||
| 2 | style_select:"Styles", | ||
| 3 | font_size:"Font size", | ||
| 4 | fontdefault:"Font family", | ||
| 5 | block:"Format", | ||
| 6 | paragraph:"Paragraph", | ||
| 7 | div:"Div", | ||
| 8 | address:"Address", | ||
| 9 | pre:"Preformatted", | ||
| 10 | h1:"Heading 1", | ||
| 11 | h2:"Heading 2", | ||
| 12 | h3:"Heading 3", | ||
| 13 | h4:"Heading 4", | ||
| 14 | h5:"Heading 5", | ||
| 15 | h6:"Heading 6", | ||
| 16 | blockquote:"Blockquote", | ||
| 17 | code:"Code", | ||
| 18 | samp:"Code sample", | ||
| 19 | dt:"Definition term ", | ||
| 20 | dd:"Definition description", | ||
| 21 | bold_desc:"Bold (Ctrl+B)", | ||
| 22 | italic_desc:"Italic (Ctrl+I)", | ||
| 23 | underline_desc:"Underline (Ctrl+U)", | ||
| 24 | striketrough_desc:"Strikethrough", | ||
| 25 | justifyleft_desc:"Align left", | ||
| 26 | justifycenter_desc:"Align center", | ||
| 27 | justifyright_desc:"Align right", | ||
| 28 | justifyfull_desc:"Align full", | ||
| 29 | bullist_desc:"Unordered list", | ||
| 30 | numlist_desc:"Ordered list", | ||
| 31 | outdent_desc:"Outdent", | ||
| 32 | indent_desc:"Indent", | ||
| 33 | undo_desc:"Undo (Ctrl+Z)", | ||
| 34 | redo_desc:"Redo (Ctrl+Y)", | ||
| 35 | link_desc:"Insert/edit link", | ||
| 36 | unlink_desc:"Unlink", | ||
| 37 | image_desc:"Insert/edit image", | ||
| 38 | cleanup_desc:"Cleanup messy code", | ||
| 39 | code_desc:"Edit HTML Source", | ||
| 40 | sub_desc:"Subscript", | ||
| 41 | sup_desc:"Superscript", | ||
| 42 | hr_desc:"Insert horizontal ruler", | ||
| 43 | removeformat_desc:"Remove formatting", | ||
| 44 | custom1_desc:"Your custom description here", | ||
| 45 | forecolor_desc:"Select text color", | ||
| 46 | backcolor_desc:"Select background color", | ||
| 47 | charmap_desc:"Insert custom character", | ||
| 48 | visualaid_desc:"Toggle guidelines/invisible elements", | ||
| 49 | anchor_desc:"Insert/edit anchor", | ||
| 50 | cut_desc:"Cut", | ||
| 51 | copy_desc:"Copy", | ||
| 52 | paste_desc:"Paste", | ||
| 53 | image_props_desc:"Image properties", | ||
| 54 | newdocument_desc:"New document", | ||
| 55 | help_desc:"Help", | ||
| 56 | blockquote_desc:"Blockquote", | ||
| 57 | clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", | ||
| 58 | path:"Path", | ||
| 59 | newdocument:"Are you sure you want clear all contents?", | ||
| 60 | toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", | ||
| 61 | more_colors:"More colors" | ||
| 62 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js b/public/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js new file mode 100755 index 0000000..9d124d7 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | tinyMCE.addI18n('en.advanced_dlg',{ | ||
| 2 | about_title:"About TinyMCE", | ||
| 3 | about_general:"About", | ||
| 4 | about_help:"Help", | ||
| 5 | about_license:"License", | ||
| 6 | about_plugins:"Plugins", | ||
| 7 | about_plugin:"Plugin", | ||
| 8 | about_author:"Author", | ||
| 9 | about_version:"Version", | ||
| 10 | about_loaded:"Loaded plugins", | ||
| 11 | anchor_title:"Insert/edit anchor", | ||
| 12 | anchor_name:"Anchor name", | ||
| 13 | code_title:"HTML Source Editor", | ||
| 14 | code_wordwrap:"Word wrap", | ||
| 15 | colorpicker_title:"Select a color", | ||
| 16 | colorpicker_picker_tab:"Picker", | ||
| 17 | colorpicker_picker_title:"Color picker", | ||
| 18 | colorpicker_palette_tab:"Palette", | ||
| 19 | colorpicker_palette_title:"Palette colors", | ||
| 20 | colorpicker_named_tab:"Named", | ||
| 21 | colorpicker_named_title:"Named colors", | ||
| 22 | colorpicker_color:"Color:", | ||
| 23 | colorpicker_name:"Name:", | ||
| 24 | charmap_title:"Select custom character", | ||
| 25 | image_title:"Insert/edit image", | ||
| 26 | image_src:"Image URL", | ||
| 27 | image_alt:"Image description", | ||
| 28 | image_list:"Image list", | ||
| 29 | image_border:"Border", | ||
| 30 | image_dimensions:"Dimensions", | ||
| 31 | image_vspace:"Vertical space", | ||
| 32 | image_hspace:"Horizontal space", | ||
| 33 | image_align:"Alignment", | ||
| 34 | image_align_baseline:"Baseline", | ||
| 35 | image_align_top:"Top", | ||
| 36 | image_align_middle:"Middle", | ||
| 37 | image_align_bottom:"Bottom", | ||
| 38 | image_align_texttop:"Text top", | ||
| 39 | image_align_textbottom:"Text bottom", | ||
| 40 | image_align_left:"Left", | ||
| 41 | image_align_right:"Right", | ||
| 42 | link_title:"Insert/edit link", | ||
| 43 | link_url:"Link URL", | ||
| 44 | link_target:"Target", | ||
| 45 | link_target_same:"Open link in the same window", | ||
| 46 | link_target_blank:"Open link in a new window", | ||
| 47 | link_titlefield:"Title", | ||
| 48 | link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", | ||
| 49 | link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", | ||
| 50 | link_list:"Link list" | ||
| 51 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/link.htm b/public/javascripts/tiny_mce/themes/advanced/link.htm new file mode 100755 index 0000000..286cc92 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/link.htm | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.link_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 9 | <script type="text/javascript" src="js/link.js"></script> | ||
| 10 | <base target="_self" /> | ||
| 11 | </head> | ||
| 12 | <body id="link" style="display: none"> | ||
| 13 | <form onsubmit="LinkDialog.update();return false;" action="#"> | ||
| 14 | <div class="tabs"> | ||
| 15 | <ul> | ||
| 16 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.link_title}</a></span></li> | ||
| 17 | </ul> | ||
| 18 | </div> | ||
| 19 | |||
| 20 | <div class="panel_wrapper"> | ||
| 21 | <div id="general_panel" class="panel current"> | ||
| 22 | |||
| 23 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 24 | <tr> | ||
| 25 | <td nowrap="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td> | ||
| 26 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 27 | <tr> | ||
| 28 | <td><input id="href" name="href" type="text" class="mceFocus" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td> | ||
| 29 | <td id="hrefbrowsercontainer"> </td> | ||
| 30 | </tr> | ||
| 31 | </table></td> | ||
| 32 | </tr> | ||
| 33 | <tr> | ||
| 34 | <td><label for="link_list">{#advanced_dlg.link_list}</label></td> | ||
| 35 | <td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td> | ||
| 36 | </tr> | ||
| 37 | <tr> | ||
| 38 | <td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td> | ||
| 39 | <td><select id="target_list" name="target_list"></select></td> | ||
| 40 | </tr> | ||
| 41 | <tr> | ||
| 42 | <td nowrap="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td> | ||
| 43 | <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td> | ||
| 44 | </tr> | ||
| 45 | <tr> | ||
| 46 | <td><label for="class_list">{#class_name}</label></td> | ||
| 47 | <td><select id="class_list" name="class_list"></select></td> | ||
| 48 | </tr> | ||
| 49 | </table> | ||
| 50 | </div> | ||
| 51 | </div> | ||
| 52 | |||
| 53 | <div class="mceActionPanel"> | ||
| 54 | <div style="float: left"> | ||
| 55 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 56 | </div> | ||
| 57 | |||
| 58 | <div style="float: right"> | ||
| 59 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 60 | </div> | ||
| 61 | </div> | ||
| 62 | </form> | ||
| 63 | </body> | ||
| 64 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/content.css b/public/javascripts/tiny_mce/themes/advanced/skins/default/content.css new file mode 100755 index 0000000..19da194 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/default/content.css | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} | ||
| 2 | body {background:#FFF;} | ||
| 3 | body.mceForceColors {background:#FFF; color:#000;} | ||
| 4 | h1 {font-size: 2em} | ||
| 5 | h2 {font-size: 1.5em} | ||
| 6 | h3 {font-size: 1.17em} | ||
| 7 | h4 {font-size: 1em} | ||
| 8 | h5 {font-size: .83em} | ||
| 9 | h6 {font-size: .75em} | ||
| 10 | .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} | ||
| 11 | a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;} | ||
| 12 | img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;} | ||
| 13 | img {border:0;} | ||
| 14 | table {cursor:default} | ||
| 15 | table td, table th {cursor:text} | ||
| 16 | ins {border-bottom:1px solid green; text-decoration: none; color:green} | ||
| 17 | del {color:red; text-decoration:line-through} | ||
| 18 | cite {border-bottom:1px dashed blue} | ||
| 19 | acronym {border-bottom:1px dotted #CCC; cursor:help} | ||
| 20 | abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} | ||
| 21 | |||
| 22 | /* IE */ | ||
| 23 | * html body { | ||
| 24 | scrollbar-3dlight-color:#F0F0EE; | ||
| 25 | scrollbar-arrow-color:#676662; | ||
| 26 | scrollbar-base-color:#F0F0EE; | ||
| 27 | scrollbar-darkshadow-color:#DDD; | ||
| 28 | scrollbar-face-color:#E0E0DD; | ||
| 29 | scrollbar-highlight-color:#F0F0EE; | ||
| 30 | scrollbar-shadow-color:#F0F0EE; | ||
| 31 | scrollbar-track-color:#F5F5F5; | ||
| 32 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css b/public/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css new file mode 100755 index 0000000..2c341aa --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | /* Generic */ | ||
| 2 | body { | ||
| 3 | font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; | ||
| 4 | scrollbar-3dlight-color:#F0F0EE; | ||
| 5 | scrollbar-arrow-color:#676662; | ||
| 6 | scrollbar-base-color:#F0F0EE; | ||
| 7 | scrollbar-darkshadow-color:#DDDDDD; | ||
| 8 | scrollbar-face-color:#E0E0DD; | ||
| 9 | scrollbar-highlight-color:#F0F0EE; | ||
| 10 | scrollbar-shadow-color:#F0F0EE; | ||
| 11 | scrollbar-track-color:#F5F5F5; | ||
| 12 | background:#F0F0EE; | ||
| 13 | padding:0; | ||
| 14 | margin:8px 8px 0 8px; | ||
| 15 | } | ||
| 16 | |||
| 17 | html {background:#F0F0EE;} | ||
| 18 | td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} | ||
| 19 | textarea {resize:none;outline:none;} | ||
| 20 | a:link, a:visited {color:black;} | ||
| 21 | a:hover {color:#2B6FB6;} | ||
| 22 | |||
| 23 | /* Forms */ | ||
| 24 | fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} | ||
| 25 | legend {color:#2B6FB6; font-weight:bold;} | ||
| 26 | label.msg {display:none;} | ||
| 27 | label.invalid {color:#EE0000; display:inline;} | ||
| 28 | input.invalid {border:1px solid #EE0000;} | ||
| 29 | input {background:#FFF; border:1px solid #CCC;} | ||
| 30 | input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} | ||
| 31 | input, select, textarea {border:1px solid #808080;} | ||
| 32 | input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} | ||
| 33 | input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} | ||
| 34 | .input_noborder {border:0;} | ||
| 35 | |||
| 36 | /* Buttons */ | ||
| 37 | #insert, #cancel, input.button, .updateButton { | ||
| 38 | border:0; margin:0; padding:0; | ||
| 39 | font-weight:bold; | ||
| 40 | width:94px; height:26px; | ||
| 41 | background:url(img/buttons.png) 0 -26px; | ||
| 42 | cursor:pointer; | ||
| 43 | padding-bottom:2px; | ||
| 44 | } | ||
| 45 | |||
| 46 | #insert {background:url(img/buttons.png) 0 -52px;} | ||
| 47 | #cancel {background:url(img/buttons.png) 0 0;} | ||
| 48 | |||
| 49 | /* Browse */ | ||
| 50 | a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} | ||
| 51 | .mceOldBoxModel a.browse span {width:22px; height:20px;} | ||
| 52 | a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} | ||
| 53 | a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 54 | a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} | ||
| 55 | a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} | ||
| 56 | .mceOldBoxModel a.pickcolor span {width:21px; height:17px;} | ||
| 57 | a.pickcolor:hover span {background-color:#B2BBD0;} | ||
| 58 | a.pickcolor:hover span.disabled {} | ||
| 59 | |||
| 60 | /* Charmap */ | ||
| 61 | table.charmap {border:1px solid #AAA; text-align:center} | ||
| 62 | td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} | ||
| 63 | #charmap a {display:block; color:#000; text-decoration:none; border:0} | ||
| 64 | #charmap a:hover {background:#CCC;color:#2B6FB6} | ||
| 65 | #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} | ||
| 66 | #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} | ||
| 67 | |||
| 68 | /* Source */ | ||
| 69 | .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} | ||
| 70 | .mceActionPanel {margin-top:5px;} | ||
| 71 | |||
| 72 | /* Tabs classes */ | ||
| 73 | .tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} | ||
| 74 | .tabs ul {margin:0; padding:0; list-style:none;} | ||
| 75 | .tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} | ||
| 76 | .tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} | ||
| 77 | .tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} | ||
| 78 | .tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} | ||
| 79 | .tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} | ||
| 80 | .tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} | ||
| 81 | |||
| 82 | /* Panels */ | ||
| 83 | .panel_wrapper div.panel {display:none;} | ||
| 84 | .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} | ||
| 85 | .panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} | ||
| 86 | |||
| 87 | /* Columns */ | ||
| 88 | .column {float:left;} | ||
| 89 | .properties {width:100%;} | ||
| 90 | .properties .column1 {} | ||
| 91 | .properties .column2 {text-align:left;} | ||
| 92 | |||
| 93 | /* Titles */ | ||
| 94 | h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} | ||
| 95 | h3 {font-size:14px;} | ||
| 96 | .title {font-size:12px; font-weight:bold; color:#2B6FB6;} | ||
| 97 | |||
| 98 | /* Dialog specific */ | ||
| 99 | #link .panel_wrapper, #link div.current {height:125px;} | ||
| 100 | #image .panel_wrapper, #image div.current {height:200px;} | ||
| 101 | #plugintable thead {font-weight:bold; background:#DDD;} | ||
| 102 | #plugintable, #about #plugintable td {border:1px solid #919B9C;} | ||
| 103 | #plugintable {width:96%; margin-top:10px;} | ||
| 104 | #pluginscontainer {height:290px; overflow:auto;} | ||
| 105 | #colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} | ||
| 106 | #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} | ||
| 107 | #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} | ||
| 108 | #colorpicker #light div {overflow:hidden;} | ||
| 109 | #colorpicker #previewblock {float:right; padding-left:10px; height:20px;} | ||
| 110 | #colorpicker .panel_wrapper div.current {height:175px;} | ||
| 111 | #colorpicker #namedcolors {width:150px;} | ||
| 112 | #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} | ||
| 113 | #colorpicker #colornamecontainer {margin-top:5px;} | ||
| 114 | #colorpicker #picker_panel fieldset {margin:auto;width:325px;} \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png new file mode 100755 index 0000000..7dd5841 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif new file mode 100755 index 0000000..2eafd79 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif new file mode 100755 index 0000000..85e31df --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif new file mode 100755 index 0000000..adfdddc --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif new file mode 100755 index 0000000..5bb90fd --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif new file mode 100755 index 0000000..ce4be63 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/ui.css b/public/javascripts/tiny_mce/themes/advanced/skins/default/ui.css new file mode 100755 index 0000000..230a2ee --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/default/ui.css | |||
| @@ -0,0 +1,214 @@ | |||
| 1 | /* Reset */ | ||
| 2 | .defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} | ||
| 3 | .defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} | ||
| 4 | .defaultSkin table td {vertical-align:middle} | ||
| 5 | |||
| 6 | /* Containers */ | ||
| 7 | .defaultSkin table {background:#F0F0EE} | ||
| 8 | .defaultSkin iframe {display:block; background:#FFF} | ||
| 9 | .defaultSkin .mceToolbar {height:26px} | ||
| 10 | .defaultSkin .mceLeft {text-align:left} | ||
| 11 | .defaultSkin .mceRight {text-align:right} | ||
| 12 | |||
| 13 | /* External */ | ||
| 14 | .defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} | ||
| 15 | .defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} | ||
| 16 | .defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} | ||
| 17 | |||
| 18 | /* Layout */ | ||
| 19 | .defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} | ||
| 20 | .defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} | ||
| 21 | .defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} | ||
| 22 | .defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} | ||
| 23 | .defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top} | ||
| 24 | .defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} | ||
| 25 | .defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} | ||
| 26 | .defaultSkin .mceStatusbar div {float:left; margin:2px} | ||
| 27 | .defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} | ||
| 28 | .defaultSkin .mceStatusbar a:hover {text-decoration:underline} | ||
| 29 | .defaultSkin table.mceToolbar {margin-left:3px} | ||
| 30 | .defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} | ||
| 31 | .defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} | ||
| 32 | .defaultSkin td.mceCenter {text-align:center;} | ||
| 33 | .defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} | ||
| 34 | .defaultSkin td.mceRight table {margin:0 0 0 auto;} | ||
| 35 | |||
| 36 | /* Button */ | ||
| 37 | .defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} | ||
| 38 | .defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} | ||
| 39 | .defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} | ||
| 40 | .defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 41 | .defaultSkin .mceButtonLabeled {width:auto} | ||
| 42 | .defaultSkin .mceButtonLabeled span.mceIcon {float:left} | ||
| 43 | .defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} | ||
| 44 | .defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} | ||
| 45 | |||
| 46 | /* Separator */ | ||
| 47 | .defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} | ||
| 48 | |||
| 49 | /* ListBox */ | ||
| 50 | .defaultSkin .mceListBox {direction:ltr} | ||
| 51 | .defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} | ||
| 52 | .defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} | ||
| 53 | .defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} | ||
| 54 | .defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} | ||
| 55 | .defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} | ||
| 56 | .defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} | ||
| 57 | .defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} | ||
| 58 | .defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} | ||
| 59 | .defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} | ||
| 60 | .defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} | ||
| 61 | |||
| 62 | /* SplitButton */ | ||
| 63 | .defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} | ||
| 64 | .defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} | ||
| 65 | .defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} | ||
| 66 | .defaultSkin .mceSplitButton span.mceAction {width:20px; background:url(../../img/icons.gif) 20px 20px;} | ||
| 67 | .defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} | ||
| 68 | .defaultSkin .mceSplitButton span.mceOpen {display:none} | ||
| 69 | .defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} | ||
| 70 | .defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} | ||
| 71 | .defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 72 | .defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} | ||
| 73 | .defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} | ||
| 74 | |||
| 75 | /* ColorSplitButton */ | ||
| 76 | .defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} | ||
| 77 | .defaultSkin .mceColorSplitMenu td {padding:2px} | ||
| 78 | .defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} | ||
| 79 | .defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} | ||
| 80 | .defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} | ||
| 81 | .defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} | ||
| 82 | .defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} | ||
| 83 | .defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} | ||
| 84 | .defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} | ||
| 85 | |||
| 86 | /* Menu */ | ||
| 87 | .defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} | ||
| 88 | .defaultSkin .mceNoIcons span.mceIcon {width:0;} | ||
| 89 | .defaultSkin .mceNoIcons a .mceText {padding-left:10px} | ||
| 90 | .defaultSkin .mceMenu table {background:#FFF} | ||
| 91 | .defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} | ||
| 92 | .defaultSkin .mceMenu td {height:20px} | ||
| 93 | .defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} | ||
| 94 | .defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} | ||
| 95 | .defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} | ||
| 96 | .defaultSkin .mceMenu pre.mceText {font-family:Monospace} | ||
| 97 | .defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} | ||
| 98 | .defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} | ||
| 99 | .defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} | ||
| 100 | .defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} | ||
| 101 | .defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} | ||
| 102 | .defaultSkin .mceMenuItemDisabled .mceText {color:#888} | ||
| 103 | .defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} | ||
| 104 | .defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} | ||
| 105 | .defaultSkin .mceMenu span.mceMenuLine {display:none} | ||
| 106 | .defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} | ||
| 107 | |||
| 108 | /* Progress,Resize */ | ||
| 109 | .defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} | ||
| 110 | .defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} | ||
| 111 | .defaultSkin .mcePlaceHolder {border:1px dotted gray} | ||
| 112 | |||
| 113 | /* Formats */ | ||
| 114 | .defaultSkin .mce_formatPreview a {font-size:10px} | ||
| 115 | .defaultSkin .mce_p span.mceText {} | ||
| 116 | .defaultSkin .mce_address span.mceText {font-style:italic} | ||
| 117 | .defaultSkin .mce_pre span.mceText {font-family:monospace} | ||
| 118 | .defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} | ||
| 119 | .defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} | ||
| 120 | .defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} | ||
| 121 | .defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} | ||
| 122 | .defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} | ||
| 123 | .defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} | ||
| 124 | |||
| 125 | /* Theme */ | ||
| 126 | .defaultSkin span.mce_bold {background-position:0 0} | ||
| 127 | .defaultSkin span.mce_italic {background-position:-60px 0} | ||
| 128 | .defaultSkin span.mce_underline {background-position:-140px 0} | ||
| 129 | .defaultSkin span.mce_strikethrough {background-position:-120px 0} | ||
| 130 | .defaultSkin span.mce_undo {background-position:-160px 0} | ||
| 131 | .defaultSkin span.mce_redo {background-position:-100px 0} | ||
| 132 | .defaultSkin span.mce_cleanup {background-position:-40px 0} | ||
| 133 | .defaultSkin span.mce_bullist {background-position:-20px 0} | ||
| 134 | .defaultSkin span.mce_numlist {background-position:-80px 0} | ||
| 135 | .defaultSkin span.mce_justifyleft {background-position:-460px 0} | ||
| 136 | .defaultSkin span.mce_justifyright {background-position:-480px 0} | ||
| 137 | .defaultSkin span.mce_justifycenter {background-position:-420px 0} | ||
| 138 | .defaultSkin span.mce_justifyfull {background-position:-440px 0} | ||
| 139 | .defaultSkin span.mce_anchor {background-position:-200px 0} | ||
| 140 | .defaultSkin span.mce_indent {background-position:-400px 0} | ||
| 141 | .defaultSkin span.mce_outdent {background-position:-540px 0} | ||
| 142 | .defaultSkin span.mce_link {background-position:-500px 0} | ||
| 143 | .defaultSkin span.mce_unlink {background-position:-640px 0} | ||
| 144 | .defaultSkin span.mce_sub {background-position:-600px 0} | ||
| 145 | .defaultSkin span.mce_sup {background-position:-620px 0} | ||
| 146 | .defaultSkin span.mce_removeformat {background-position:-580px 0} | ||
| 147 | .defaultSkin span.mce_newdocument {background-position:-520px 0} | ||
| 148 | .defaultSkin span.mce_image {background-position:-380px 0} | ||
| 149 | .defaultSkin span.mce_help {background-position:-340px 0} | ||
| 150 | .defaultSkin span.mce_code {background-position:-260px 0} | ||
| 151 | .defaultSkin span.mce_hr {background-position:-360px 0} | ||
| 152 | .defaultSkin span.mce_visualaid {background-position:-660px 0} | ||
| 153 | .defaultSkin span.mce_charmap {background-position:-240px 0} | ||
| 154 | .defaultSkin span.mce_paste {background-position:-560px 0} | ||
| 155 | .defaultSkin span.mce_copy {background-position:-700px 0} | ||
| 156 | .defaultSkin span.mce_cut {background-position:-680px 0} | ||
| 157 | .defaultSkin span.mce_blockquote {background-position:-220px 0} | ||
| 158 | .defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} | ||
| 159 | .defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} | ||
| 160 | .defaultSkin span.mce_forecolorpicker {background-position:-720px 0} | ||
| 161 | .defaultSkin span.mce_backcolorpicker {background-position:-760px 0} | ||
| 162 | |||
| 163 | /* Plugins */ | ||
| 164 | .defaultSkin span.mce_advhr {background-position:-0px -20px} | ||
| 165 | .defaultSkin span.mce_ltr {background-position:-20px -20px} | ||
| 166 | .defaultSkin span.mce_rtl {background-position:-40px -20px} | ||
| 167 | .defaultSkin span.mce_emotions {background-position:-60px -20px} | ||
| 168 | .defaultSkin span.mce_fullpage {background-position:-80px -20px} | ||
| 169 | .defaultSkin span.mce_fullscreen {background-position:-100px -20px} | ||
| 170 | .defaultSkin span.mce_iespell {background-position:-120px -20px} | ||
| 171 | .defaultSkin span.mce_insertdate {background-position:-140px -20px} | ||
| 172 | .defaultSkin span.mce_inserttime {background-position:-160px -20px} | ||
| 173 | .defaultSkin span.mce_absolute {background-position:-180px -20px} | ||
| 174 | .defaultSkin span.mce_backward {background-position:-200px -20px} | ||
| 175 | .defaultSkin span.mce_forward {background-position:-220px -20px} | ||
| 176 | .defaultSkin span.mce_insert_layer {background-position:-240px -20px} | ||
| 177 | .defaultSkin span.mce_insertlayer {background-position:-260px -20px} | ||
| 178 | .defaultSkin span.mce_movebackward {background-position:-280px -20px} | ||
| 179 | .defaultSkin span.mce_moveforward {background-position:-300px -20px} | ||
| 180 | .defaultSkin span.mce_media {background-position:-320px -20px} | ||
| 181 | .defaultSkin span.mce_nonbreaking {background-position:-340px -20px} | ||
| 182 | .defaultSkin span.mce_pastetext {background-position:-360px -20px} | ||
| 183 | .defaultSkin span.mce_pasteword {background-position:-380px -20px} | ||
| 184 | .defaultSkin span.mce_selectall {background-position:-400px -20px} | ||
| 185 | .defaultSkin span.mce_preview {background-position:-420px -20px} | ||
| 186 | .defaultSkin span.mce_print {background-position:-440px -20px} | ||
| 187 | .defaultSkin span.mce_cancel {background-position:-460px -20px} | ||
| 188 | .defaultSkin span.mce_save {background-position:-480px -20px} | ||
| 189 | .defaultSkin span.mce_replace {background-position:-500px -20px} | ||
| 190 | .defaultSkin span.mce_search {background-position:-520px -20px} | ||
| 191 | .defaultSkin span.mce_styleprops {background-position:-560px -20px} | ||
| 192 | .defaultSkin span.mce_table {background-position:-580px -20px} | ||
| 193 | .defaultSkin span.mce_cell_props {background-position:-600px -20px} | ||
| 194 | .defaultSkin span.mce_delete_table {background-position:-620px -20px} | ||
| 195 | .defaultSkin span.mce_delete_col {background-position:-640px -20px} | ||
| 196 | .defaultSkin span.mce_delete_row {background-position:-660px -20px} | ||
| 197 | .defaultSkin span.mce_col_after {background-position:-680px -20px} | ||
| 198 | .defaultSkin span.mce_col_before {background-position:-700px -20px} | ||
| 199 | .defaultSkin span.mce_row_after {background-position:-720px -20px} | ||
| 200 | .defaultSkin span.mce_row_before {background-position:-740px -20px} | ||
| 201 | .defaultSkin span.mce_merge_cells {background-position:-760px -20px} | ||
| 202 | .defaultSkin span.mce_table_props {background-position:-980px -20px} | ||
| 203 | .defaultSkin span.mce_row_props {background-position:-780px -20px} | ||
| 204 | .defaultSkin span.mce_split_cells {background-position:-800px -20px} | ||
| 205 | .defaultSkin span.mce_template {background-position:-820px -20px} | ||
| 206 | .defaultSkin span.mce_visualchars {background-position:-840px -20px} | ||
| 207 | .defaultSkin span.mce_abbr {background-position:-860px -20px} | ||
| 208 | .defaultSkin span.mce_acronym {background-position:-880px -20px} | ||
| 209 | .defaultSkin span.mce_attribs {background-position:-900px -20px} | ||
| 210 | .defaultSkin span.mce_cite {background-position:-920px -20px} | ||
| 211 | .defaultSkin span.mce_del {background-position:-940px -20px} | ||
| 212 | .defaultSkin span.mce_ins {background-position:-960px -20px} | ||
| 213 | .defaultSkin span.mce_pagebreak {background-position:0 -40px} | ||
| 214 | .defaultSkin .mce_spellchecker span.mceAction {background-position:-540px -20px} | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css new file mode 100755 index 0000000..b8431d1 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} | ||
| 2 | body {background:#FFF;} | ||
| 3 | body.mceForceColors {background:#FFF; color:#000;} | ||
| 4 | h1 {font-size: 2em} | ||
| 5 | h2 {font-size: 1.5em} | ||
| 6 | h3 {font-size: 1.17em} | ||
| 7 | h4 {font-size: 1em} | ||
| 8 | h5 {font-size: .83em} | ||
| 9 | h6 {font-size: .75em} | ||
| 10 | .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} | ||
| 11 | a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;} | ||
| 12 | img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;} | ||
| 13 | img {border:0;} | ||
| 14 | table {cursor:default} | ||
| 15 | table td, table th {cursor:text} | ||
| 16 | ins {border-bottom:1px solid green; text-decoration: none; color:green} | ||
| 17 | del {color:red; text-decoration:line-through} | ||
| 18 | cite {border-bottom:1px dashed blue} | ||
| 19 | acronym {border-bottom:1px dotted #CCC; cursor:help} | ||
| 20 | abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} | ||
| 21 | |||
| 22 | /* IE */ | ||
| 23 | * html body { | ||
| 24 | scrollbar-3dlight-color:#F0F0EE; | ||
| 25 | scrollbar-arrow-color:#676662; | ||
| 26 | scrollbar-base-color:#F0F0EE; | ||
| 27 | scrollbar-darkshadow-color:#DDD; | ||
| 28 | scrollbar-face-color:#E0E0DD; | ||
| 29 | scrollbar-highlight-color:#F0F0EE; | ||
| 30 | scrollbar-shadow-color:#F0F0EE; | ||
| 31 | scrollbar-track-color:#F5F5F5; | ||
| 32 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css new file mode 100755 index 0000000..8d288e3 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css | |||
| @@ -0,0 +1,113 @@ | |||
| 1 | /* Generic */ | ||
| 2 | body { | ||
| 3 | font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; | ||
| 4 | scrollbar-3dlight-color:#F0F0EE; | ||
| 5 | scrollbar-arrow-color:#676662; | ||
| 6 | scrollbar-base-color:#F0F0EE; | ||
| 7 | scrollbar-darkshadow-color:#DDDDDD; | ||
| 8 | scrollbar-face-color:#E0E0DD; | ||
| 9 | scrollbar-highlight-color:#F0F0EE; | ||
| 10 | scrollbar-shadow-color:#F0F0EE; | ||
| 11 | scrollbar-track-color:#F5F5F5; | ||
| 12 | background:#F0F0EE; | ||
| 13 | padding:0; | ||
| 14 | margin:8px 8px 0 8px; | ||
| 15 | } | ||
| 16 | |||
| 17 | html {background:#F0F0EE;} | ||
| 18 | td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} | ||
| 19 | textarea {resize:none;outline:none;} | ||
| 20 | a:link, a:visited {color:black;} | ||
| 21 | a:hover {color:#2B6FB6;} | ||
| 22 | |||
| 23 | /* Forms */ | ||
| 24 | fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} | ||
| 25 | legend {color:#2B6FB6; font-weight:bold;} | ||
| 26 | label.msg {display:none;} | ||
| 27 | label.invalid {color:#EE0000; display:inline;} | ||
| 28 | input.invalid {border:1px solid #EE0000;} | ||
| 29 | input {background:#FFF; border:1px solid #CCC;} | ||
| 30 | input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} | ||
| 31 | input, select, textarea {border:1px solid #808080;} | ||
| 32 | input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} | ||
| 33 | input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} | ||
| 34 | .input_noborder {border:0;} | ||
| 35 | |||
| 36 | /* Buttons */ | ||
| 37 | #insert, #cancel, input.button, .updateButton { | ||
| 38 | border:0; margin:0; padding:0; | ||
| 39 | font-weight:bold; | ||
| 40 | width:94px; height:26px; | ||
| 41 | background:url(../default/img/buttons.png) 0 -26px; | ||
| 42 | cursor:pointer; | ||
| 43 | padding-bottom:2px; | ||
| 44 | } | ||
| 45 | |||
| 46 | #insert {background:url(../default/img/buttons.png) 0 -52px;} | ||
| 47 | #cancel {background:url(../default/img/buttons.png) 0 0;} | ||
| 48 | |||
| 49 | /* Browse */ | ||
| 50 | a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} | ||
| 51 | .mceOldBoxModel a.browse span {width:22px; height:20px;} | ||
| 52 | a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} | ||
| 53 | a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 54 | a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} | ||
| 55 | a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} | ||
| 56 | .mceOldBoxModel a.pickcolor span {width:21px; height:17px;} | ||
| 57 | a.pickcolor:hover span {background-color:#B2BBD0;} | ||
| 58 | a.pickcolor:hover span.disabled {} | ||
| 59 | |||
| 60 | /* Charmap */ | ||
| 61 | table.charmap {border:1px solid #AAA; text-align:center} | ||
| 62 | td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} | ||
| 63 | #charmap a {display:block; color:#000; text-decoration:none; border:0} | ||
| 64 | #charmap a:hover {background:#CCC;color:#2B6FB6} | ||
| 65 | #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} | ||
| 66 | #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} | ||
| 67 | |||
| 68 | /* Source */ | ||
| 69 | .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} | ||
| 70 | .mceActionPanel {margin-top:5px;} | ||
| 71 | |||
| 72 | /* Tabs classes */ | ||
| 73 | .tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} | ||
| 74 | .tabs ul {margin:0; padding:0; list-style:none;} | ||
| 75 | .tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} | ||
| 76 | .tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} | ||
| 77 | .tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} | ||
| 78 | .tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} | ||
| 79 | .tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} | ||
| 80 | .tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} | ||
| 81 | |||
| 82 | /* Panels */ | ||
| 83 | .panel_wrapper div.panel {display:none;} | ||
| 84 | .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} | ||
| 85 | .panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} | ||
| 86 | |||
| 87 | /* Columns */ | ||
| 88 | .column {float:left;} | ||
| 89 | .properties {width:100%;} | ||
| 90 | .properties .column1 {} | ||
| 91 | .properties .column2 {text-align:left;} | ||
| 92 | |||
| 93 | /* Titles */ | ||
| 94 | h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} | ||
| 95 | h3 {font-size:14px;} | ||
| 96 | .title {font-size:12px; font-weight:bold; color:#2B6FB6;} | ||
| 97 | |||
| 98 | /* Dialog specific */ | ||
| 99 | #link .panel_wrapper, #link div.current {height:125px;} | ||
| 100 | #image .panel_wrapper, #image div.current {height:200px;} | ||
| 101 | #plugintable thead {font-weight:bold; background:#DDD;} | ||
| 102 | #plugintable, #about #plugintable td {border:1px solid #919B9C;} | ||
| 103 | #plugintable {width:96%; margin-top:10px;} | ||
| 104 | #pluginscontainer {height:290px; overflow:auto;} | ||
| 105 | #colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} | ||
| 106 | #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} | ||
| 107 | #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} | ||
| 108 | #colorpicker #light div {overflow:hidden;} | ||
| 109 | #colorpicker #previewblock {float:right; padding-left:10px; height:20px;} | ||
| 110 | #colorpicker .panel_wrapper div.current {height:175px;} | ||
| 111 | #colorpicker #namedcolors {width:150px;} | ||
| 112 | #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} | ||
| 113 | #colorpicker #colornamecontainer {margin-top:5px;} | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png new file mode 100755 index 0000000..12cfb41 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png new file mode 100755 index 0000000..8996c74 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png new file mode 100755 index 0000000..bd5d255 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css new file mode 100755 index 0000000..c10a3f0 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css | |||
| @@ -0,0 +1,215 @@ | |||
| 1 | /* Reset */ | ||
| 2 | .o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} | ||
| 3 | .o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} | ||
| 4 | .o2k7Skin table td {vertical-align:middle} | ||
| 5 | |||
| 6 | /* Containers */ | ||
| 7 | .o2k7Skin table {background:#E5EFFD} | ||
| 8 | .o2k7Skin iframe {display:block; background:#FFF} | ||
| 9 | .o2k7Skin .mceToolbar {height:26px} | ||
| 10 | |||
| 11 | /* External */ | ||
| 12 | .o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} | ||
| 13 | .o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} | ||
| 14 | .o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} | ||
| 15 | |||
| 16 | /* Layout */ | ||
| 17 | .o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} | ||
| 18 | .o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} | ||
| 19 | .o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} | ||
| 20 | .o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} | ||
| 21 | .o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} | ||
| 22 | .o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} | ||
| 23 | .o2k7Skin .mceStatusbar div {float:left; padding:2px} | ||
| 24 | .o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} | ||
| 25 | .o2k7Skin .mceStatusbar a:hover {text-decoration:underline} | ||
| 26 | .o2k7Skin table.mceToolbar {margin-left:3px} | ||
| 27 | .o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} | ||
| 28 | .o2k7Skin .mceToolbar td.mceFirst span {margin:0} | ||
| 29 | .o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} | ||
| 30 | .o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} | ||
| 31 | .o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} | ||
| 32 | .o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} | ||
| 33 | .o2k7Skin td.mceCenter {text-align:center;} | ||
| 34 | .o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} | ||
| 35 | .o2k7Skin td.mceRight table {margin:0 0 0 auto;} | ||
| 36 | |||
| 37 | /* Button */ | ||
| 38 | .o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} | ||
| 39 | .o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} | ||
| 40 | .o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} | ||
| 41 | .o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} | ||
| 42 | .o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} | ||
| 43 | .o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 44 | .o2k7Skin .mceButtonLabeled {width:auto} | ||
| 45 | .o2k7Skin .mceButtonLabeled span.mceIcon {float:left} | ||
| 46 | .o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} | ||
| 47 | .o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} | ||
| 48 | |||
| 49 | /* Separator */ | ||
| 50 | .o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} | ||
| 51 | |||
| 52 | /* ListBox */ | ||
| 53 | .o2k7Skin .mceListBox {margin-left:3px} | ||
| 54 | .o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} | ||
| 55 | .o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} | ||
| 56 | .o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} | ||
| 57 | .o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} | ||
| 58 | .o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} | ||
| 59 | .o2k7Skin .mceListBoxDisabled .mceText {color:gray} | ||
| 60 | .o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} | ||
| 61 | .o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} | ||
| 62 | .o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} | ||
| 63 | |||
| 64 | /* SplitButton */ | ||
| 65 | .o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px} | ||
| 66 | .o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} | ||
| 67 | .o2k7Skin .mceSplitButton a.mceAction {width:22px} | ||
| 68 | .o2k7Skin .mceSplitButton span.mceAction {width:22px; background:url(../../img/icons.gif) 20px 20px} | ||
| 69 | .o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} | ||
| 70 | .o2k7Skin .mceSplitButton span.mceOpen {display:none} | ||
| 71 | .o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} | ||
| 72 | .o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} | ||
| 73 | .o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 74 | .o2k7Skin .mceSplitButtonActive {background-position:0 -44px} | ||
| 75 | |||
| 76 | /* ColorSplitButton */ | ||
| 77 | .o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} | ||
| 78 | .o2k7Skin .mceColorSplitMenu td {padding:2px} | ||
| 79 | .o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} | ||
| 80 | .o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} | ||
| 81 | .o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} | ||
| 82 | .o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} | ||
| 83 | .o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} | ||
| 84 | .o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} | ||
| 85 | .o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} | ||
| 86 | |||
| 87 | /* Menu */ | ||
| 88 | .o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} | ||
| 89 | .o2k7Skin .mceNoIcons span.mceIcon {width:0;} | ||
| 90 | .o2k7Skin .mceNoIcons a .mceText {padding-left:10px} | ||
| 91 | .o2k7Skin .mceMenu table {background:#FFF} | ||
| 92 | .o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} | ||
| 93 | .o2k7Skin .mceMenu td {height:20px} | ||
| 94 | .o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} | ||
| 95 | .o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} | ||
| 96 | .o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} | ||
| 97 | .o2k7Skin .mceMenu pre.mceText {font-family:Monospace} | ||
| 98 | .o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} | ||
| 99 | .o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} | ||
| 100 | .o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} | ||
| 101 | .o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} | ||
| 102 | .o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} | ||
| 103 | .o2k7Skin .mceMenuItemDisabled .mceText {color:#888} | ||
| 104 | .o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} | ||
| 105 | .o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} | ||
| 106 | .o2k7Skin .mceMenu span.mceMenuLine {display:none} | ||
| 107 | .o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} | ||
| 108 | |||
| 109 | /* Progress,Resize */ | ||
| 110 | .o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} | ||
| 111 | .o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} | ||
| 112 | .o2k7Skin .mcePlaceHolder {border:1px dotted gray} | ||
| 113 | |||
| 114 | /* Formats */ | ||
| 115 | .o2k7Skin .mce_formatPreview a {font-size:10px} | ||
| 116 | .o2k7Skin .mce_p span.mceText {} | ||
| 117 | .o2k7Skin .mce_address span.mceText {font-style:italic} | ||
| 118 | .o2k7Skin .mce_pre span.mceText {font-family:monospace} | ||
| 119 | .o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} | ||
| 120 | .o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} | ||
| 121 | .o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} | ||
| 122 | .o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} | ||
| 123 | .o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} | ||
| 124 | .o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} | ||
| 125 | |||
| 126 | /* Theme */ | ||
| 127 | .o2k7Skin span.mce_bold {background-position:0 0} | ||
| 128 | .o2k7Skin span.mce_italic {background-position:-60px 0} | ||
| 129 | .o2k7Skin span.mce_underline {background-position:-140px 0} | ||
| 130 | .o2k7Skin span.mce_strikethrough {background-position:-120px 0} | ||
| 131 | .o2k7Skin span.mce_undo {background-position:-160px 0} | ||
| 132 | .o2k7Skin span.mce_redo {background-position:-100px 0} | ||
| 133 | .o2k7Skin span.mce_cleanup {background-position:-40px 0} | ||
| 134 | .o2k7Skin span.mce_bullist {background-position:-20px 0} | ||
| 135 | .o2k7Skin span.mce_numlist {background-position:-80px 0} | ||
| 136 | .o2k7Skin span.mce_justifyleft {background-position:-460px 0} | ||
| 137 | .o2k7Skin span.mce_justifyright {background-position:-480px 0} | ||
| 138 | .o2k7Skin span.mce_justifycenter {background-position:-420px 0} | ||
| 139 | .o2k7Skin span.mce_justifyfull {background-position:-440px 0} | ||
| 140 | .o2k7Skin span.mce_anchor {background-position:-200px 0} | ||
| 141 | .o2k7Skin span.mce_indent {background-position:-400px 0} | ||
| 142 | .o2k7Skin span.mce_outdent {background-position:-540px 0} | ||
| 143 | .o2k7Skin span.mce_link {background-position:-500px 0} | ||
| 144 | .o2k7Skin span.mce_unlink {background-position:-640px 0} | ||
| 145 | .o2k7Skin span.mce_sub {background-position:-600px 0} | ||
| 146 | .o2k7Skin span.mce_sup {background-position:-620px 0} | ||
| 147 | .o2k7Skin span.mce_removeformat {background-position:-580px 0} | ||
| 148 | .o2k7Skin span.mce_newdocument {background-position:-520px 0} | ||
| 149 | .o2k7Skin span.mce_image {background-position:-380px 0} | ||
| 150 | .o2k7Skin span.mce_help {background-position:-340px 0} | ||
| 151 | .o2k7Skin span.mce_code {background-position:-260px 0} | ||
| 152 | .o2k7Skin span.mce_hr {background-position:-360px 0} | ||
| 153 | .o2k7Skin span.mce_visualaid {background-position:-660px 0} | ||
| 154 | .o2k7Skin span.mce_charmap {background-position:-240px 0} | ||
| 155 | .o2k7Skin span.mce_paste {background-position:-560px 0} | ||
| 156 | .o2k7Skin span.mce_copy {background-position:-700px 0} | ||
| 157 | .o2k7Skin span.mce_cut {background-position:-680px 0} | ||
| 158 | .o2k7Skin span.mce_blockquote {background-position:-220px 0} | ||
| 159 | .o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} | ||
| 160 | .o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} | ||
| 161 | .o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} | ||
| 162 | .o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} | ||
| 163 | |||
| 164 | /* Plugins */ | ||
| 165 | .o2k7Skin span.mce_advhr {background-position:-0px -20px} | ||
| 166 | .o2k7Skin span.mce_ltr {background-position:-20px -20px} | ||
| 167 | .o2k7Skin span.mce_rtl {background-position:-40px -20px} | ||
| 168 | .o2k7Skin span.mce_emotions {background-position:-60px -20px} | ||
| 169 | .o2k7Skin span.mce_fullpage {background-position:-80px -20px} | ||
| 170 | .o2k7Skin span.mce_fullscreen {background-position:-100px -20px} | ||
| 171 | .o2k7Skin span.mce_iespell {background-position:-120px -20px} | ||
| 172 | .o2k7Skin span.mce_insertdate {background-position:-140px -20px} | ||
| 173 | .o2k7Skin span.mce_inserttime {background-position:-160px -20px} | ||
| 174 | .o2k7Skin span.mce_absolute {background-position:-180px -20px} | ||
| 175 | .o2k7Skin span.mce_backward {background-position:-200px -20px} | ||
| 176 | .o2k7Skin span.mce_forward {background-position:-220px -20px} | ||
| 177 | .o2k7Skin span.mce_insert_layer {background-position:-240px -20px} | ||
| 178 | .o2k7Skin span.mce_insertlayer {background-position:-260px -20px} | ||
| 179 | .o2k7Skin span.mce_movebackward {background-position:-280px -20px} | ||
| 180 | .o2k7Skin span.mce_moveforward {background-position:-300px -20px} | ||
| 181 | .o2k7Skin span.mce_media {background-position:-320px -20px} | ||
| 182 | .o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} | ||
| 183 | .o2k7Skin span.mce_pastetext {background-position:-360px -20px} | ||
| 184 | .o2k7Skin span.mce_pasteword {background-position:-380px -20px} | ||
| 185 | .o2k7Skin span.mce_selectall {background-position:-400px -20px} | ||
| 186 | .o2k7Skin span.mce_preview {background-position:-420px -20px} | ||
| 187 | .o2k7Skin span.mce_print {background-position:-440px -20px} | ||
| 188 | .o2k7Skin span.mce_cancel {background-position:-460px -20px} | ||
| 189 | .o2k7Skin span.mce_save {background-position:-480px -20px} | ||
| 190 | .o2k7Skin span.mce_replace {background-position:-500px -20px} | ||
| 191 | .o2k7Skin span.mce_search {background-position:-520px -20px} | ||
| 192 | .o2k7Skin span.mce_styleprops {background-position:-560px -20px} | ||
| 193 | .o2k7Skin span.mce_table {background-position:-580px -20px} | ||
| 194 | .o2k7Skin span.mce_cell_props {background-position:-600px -20px} | ||
| 195 | .o2k7Skin span.mce_delete_table {background-position:-620px -20px} | ||
| 196 | .o2k7Skin span.mce_delete_col {background-position:-640px -20px} | ||
| 197 | .o2k7Skin span.mce_delete_row {background-position:-660px -20px} | ||
| 198 | .o2k7Skin span.mce_col_after {background-position:-680px -20px} | ||
| 199 | .o2k7Skin span.mce_col_before {background-position:-700px -20px} | ||
| 200 | .o2k7Skin span.mce_row_after {background-position:-720px -20px} | ||
| 201 | .o2k7Skin span.mce_row_before {background-position:-740px -20px} | ||
| 202 | .o2k7Skin span.mce_merge_cells {background-position:-760px -20px} | ||
| 203 | .o2k7Skin span.mce_table_props {background-position:-980px -20px} | ||
| 204 | .o2k7Skin span.mce_row_props {background-position:-780px -20px} | ||
| 205 | .o2k7Skin span.mce_split_cells {background-position:-800px -20px} | ||
| 206 | .o2k7Skin span.mce_template {background-position:-820px -20px} | ||
| 207 | .o2k7Skin span.mce_visualchars {background-position:-840px -20px} | ||
| 208 | .o2k7Skin span.mce_abbr {background-position:-860px -20px} | ||
| 209 | .o2k7Skin span.mce_acronym {background-position:-880px -20px} | ||
| 210 | .o2k7Skin span.mce_attribs {background-position:-900px -20px} | ||
| 211 | .o2k7Skin span.mce_cite {background-position:-920px -20px} | ||
| 212 | .o2k7Skin span.mce_del {background-position:-940px -20px} | ||
| 213 | .o2k7Skin span.mce_ins {background-position:-960px -20px} | ||
| 214 | .o2k7Skin span.mce_pagebreak {background-position:0 -40px} | ||
| 215 | .o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px} | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css new file mode 100755 index 0000000..153f0c3 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | /* Black */ | ||
| 2 | .o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} | ||
| 3 | .o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} | ||
| 4 | .o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} | ||
| 5 | .o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} | ||
| 6 | .o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} | ||
| 7 | .o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} | ||
| 8 | .o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css new file mode 100755 index 0000000..7fe3b45 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | /* Silver */ | ||
| 2 | .o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} | ||
| 3 | .o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} | ||
| 4 | .o2k7SkinSilver .mceListBox .mceText {background:#FFF} | ||
| 5 | .o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/source_editor.htm b/public/javascripts/tiny_mce/themes/advanced/source_editor.htm new file mode 100755 index 0000000..119a913 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/advanced/source_editor.htm | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
| 4 | <title>{#advanced_dlg.code_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/source_editor.js"></script> | ||
| 7 | <base target="_self" /> | ||
| 8 | </head> | ||
| 9 | <body onresize="resizeInputs();" style="display:none; overflow:hidden;"> | ||
| 10 | <form name="source" onsubmit="saveContent();return false;" action="#"> | ||
| 11 | <div style="float: left" class="title">{#advanced_dlg.code_title}</div> | ||
| 12 | |||
| 13 | <div id="wrapline" style="float: right"> | ||
| 14 | <input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{#advanced_dlg.code_wordwrap}</label> | ||
| 15 | </div> | ||
| 16 | |||
| 17 | <br style="clear: both" /> | ||
| 18 | |||
| 19 | <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea> | ||
| 20 | |||
| 21 | <div class="mceActionPanel"> | ||
| 22 | <div style="float: left"> | ||
| 23 | <input type="submit" name="insert" value="{#update}" id="insert" /> | ||
| 24 | </div> | ||
| 25 | |||
| 26 | <div style="float: right"> | ||
| 27 | <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" /> | ||
| 28 | </div> | ||
| 29 | </div> | ||
| 30 | </form> | ||
| 31 | </body> | ||
| 32 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/editor_template.js b/public/javascripts/tiny_mce/themes/simple/editor_template.js new file mode 100755 index 0000000..d19fb53 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/simple/editor_template.js | |||
| @@ -0,0 +1 @@ | |||
| (function(){var DOM=tinymce.DOM;tinymce.ThemeManager.requireLangPack('simple');tinymce.create('tinymce.themes.SimpleTheme',{init:function(ed,url){var t=this,states=['Bold','Italic','Underline','Strikethrough','InsertUnorderedList','InsertOrderedList'],s=ed.settings;t.editor=ed;ed.onInit.add(function(){ed.onNodeChange.add(function(ed,cm){tinymce.each(states,function(c){cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));});});ed.dom.loadCSS(url+"/skins/"+s.skin+"/content.css");});DOM.loadCSS((s.editor_css?ed.documentBaseURI.toAbsolute(s.editor_css):'')||url+"/skins/"+s.skin+"/ui.css");},renderUI:function(o){var t=this,n=o.targetNode,ic,tb,ed=t.editor,cf=ed.controlManager,sc;n=DOM.insertAfter(DOM.create('span',{id:ed.id+'_container','class':'mceEditor '+ed.settings.skin+'SimpleSkin'}),n);n=sc=DOM.add(n,'table',{cellPadding:0,cellSpacing:0,'class':'mceLayout'});n=tb=DOM.add(n,'tbody');n=DOM.add(tb,'tr');n=ic=DOM.add(DOM.add(n,'td'),'div',{'class':'mceIframeContainer'});n=DOM.add(DOM.add(tb,'tr',{'class':'last'}),'td',{'class':'mceToolbar mceLast',align:'center'});tb=t.toolbar=cf.createToolbar("tools1");tb.add(cf.createButton('bold',{title:'simple.bold_desc',cmd:'Bold'}));tb.add(cf.createButton('italic',{title:'simple.italic_desc',cmd:'Italic'}));tb.add(cf.createButton('underline',{title:'simple.underline_desc',cmd:'Underline'}));tb.add(cf.createButton('strikethrough',{title:'simple.striketrough_desc',cmd:'Strikethrough'}));tb.add(cf.createSeparator());tb.add(cf.createButton('undo',{title:'simple.undo_desc',cmd:'Undo'}));tb.add(cf.createButton('redo',{title:'simple.redo_desc',cmd:'Redo'}));tb.add(cf.createSeparator());tb.add(cf.createButton('cleanup',{title:'simple.cleanup_desc',cmd:'mceCleanup'}));tb.add(cf.createSeparator());tb.add(cf.createButton('insertunorderedlist',{title:'simple.bullist_desc',cmd:'InsertUnorderedList'}));tb.add(cf.createButton('insertorderedlist',{title:'simple.numlist_desc',cmd:'InsertOrderedList'}));tb.renderTo(n);return{iframeContainer:ic,editorContainer:ed.id+'_container',sizeContainer:sc,deltaHeight:-20};},getInfo:function(){return{longname:'Simple theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add('simple',tinymce.themes.SimpleTheme);})(); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/themes/simple/editor_template_src.js b/public/javascripts/tiny_mce/themes/simple/editor_template_src.js new file mode 100755 index 0000000..fb0bd78 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/simple/editor_template_src.js | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_template_src.js 920 2008-09-09 14:05:33Z spocke $ | ||
| 3 | * | ||
| 4 | * This file is meant to showcase how to create a simple theme. The advanced | ||
| 5 | * theme is more suitable for production use. | ||
| 6 | * | ||
| 7 | * @author Moxiecode | ||
| 8 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 9 | */ | ||
| 10 | |||
| 11 | (function() { | ||
| 12 | var DOM = tinymce.DOM; | ||
| 13 | |||
| 14 | // Tell it to load theme specific language pack(s) | ||
| 15 | tinymce.ThemeManager.requireLangPack('simple'); | ||
| 16 | |||
| 17 | tinymce.create('tinymce.themes.SimpleTheme', { | ||
| 18 | init : function(ed, url) { | ||
| 19 | var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; | ||
| 20 | |||
| 21 | t.editor = ed; | ||
| 22 | |||
| 23 | ed.onInit.add(function() { | ||
| 24 | ed.onNodeChange.add(function(ed, cm) { | ||
| 25 | tinymce.each(states, function(c) { | ||
| 26 | cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); | ||
| 27 | }); | ||
| 28 | }); | ||
| 29 | |||
| 30 | ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css"); | ||
| 31 | }); | ||
| 32 | |||
| 33 | DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); | ||
| 34 | }, | ||
| 35 | |||
| 36 | renderUI : function(o) { | ||
| 37 | var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; | ||
| 38 | |||
| 39 | n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); | ||
| 40 | n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); | ||
| 41 | n = tb = DOM.add(n, 'tbody'); | ||
| 42 | |||
| 43 | // Create iframe container | ||
| 44 | n = DOM.add(tb, 'tr'); | ||
| 45 | n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); | ||
| 46 | |||
| 47 | // Create toolbar container | ||
| 48 | n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); | ||
| 49 | |||
| 50 | // Create toolbar | ||
| 51 | tb = t.toolbar = cf.createToolbar("tools1"); | ||
| 52 | tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); | ||
| 53 | tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); | ||
| 54 | tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); | ||
| 55 | tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); | ||
| 56 | tb.add(cf.createSeparator()); | ||
| 57 | tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); | ||
| 58 | tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); | ||
| 59 | tb.add(cf.createSeparator()); | ||
| 60 | tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); | ||
| 61 | tb.add(cf.createSeparator()); | ||
| 62 | tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); | ||
| 63 | tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); | ||
| 64 | tb.renderTo(n); | ||
| 65 | |||
| 66 | return { | ||
| 67 | iframeContainer : ic, | ||
| 68 | editorContainer : ed.id + '_container', | ||
| 69 | sizeContainer : sc, | ||
| 70 | deltaHeight : -20 | ||
| 71 | }; | ||
| 72 | }, | ||
| 73 | |||
| 74 | getInfo : function() { | ||
| 75 | return { | ||
| 76 | longname : 'Simple theme', | ||
| 77 | author : 'Moxiecode Systems AB', | ||
| 78 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 79 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 80 | } | ||
| 81 | } | ||
| 82 | }); | ||
| 83 | |||
| 84 | tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); | ||
| 85 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/img/icons.gif b/public/javascripts/tiny_mce/themes/simple/img/icons.gif new file mode 100755 index 0000000..16af141 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/simple/img/icons.gif | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/simple/langs/en.js b/public/javascripts/tiny_mce/themes/simple/langs/en.js new file mode 100755 index 0000000..9f08f10 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/simple/langs/en.js | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | tinyMCE.addI18n('en.simple',{ | ||
| 2 | bold_desc:"Bold (Ctrl+B)", | ||
| 3 | italic_desc:"Italic (Ctrl+I)", | ||
| 4 | underline_desc:"Underline (Ctrl+U)", | ||
| 5 | striketrough_desc:"Strikethrough", | ||
| 6 | bullist_desc:"Unordered list", | ||
| 7 | numlist_desc:"Ordered list", | ||
| 8 | undo_desc:"Undo (Ctrl+Z)", | ||
| 9 | redo_desc:"Redo (Ctrl+Y)", | ||
| 10 | cleanup_desc:"Cleanup messy code" | ||
| 11 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/skins/default/content.css b/public/javascripts/tiny_mce/themes/simple/skins/default/content.css new file mode 100755 index 0000000..2506c80 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/simple/skins/default/content.css | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | body, td, pre { | ||
| 2 | font-family: Verdana, Arial, Helvetica, sans-serif; | ||
| 3 | font-size: 10px; | ||
| 4 | } | ||
| 5 | |||
| 6 | body { | ||
| 7 | background-color: #FFFFFF; | ||
| 8 | } | ||
| 9 | |||
| 10 | .mceVisualAid { | ||
| 11 | border: 1px dashed #BBBBBB; | ||
| 12 | } | ||
| 13 | |||
| 14 | /* MSIE specific */ | ||
| 15 | |||
| 16 | * html body { | ||
| 17 | scrollbar-3dlight-color: #F0F0EE; | ||
| 18 | scrollbar-arrow-color: #676662; | ||
| 19 | scrollbar-base-color: #F0F0EE; | ||
| 20 | scrollbar-darkshadow-color: #DDDDDD; | ||
| 21 | scrollbar-face-color: #E0E0DD; | ||
| 22 | scrollbar-highlight-color: #F0F0EE; | ||
| 23 | scrollbar-shadow-color: #F0F0EE; | ||
| 24 | scrollbar-track-color: #F5F5F5; | ||
| 25 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/skins/default/ui.css b/public/javascripts/tiny_mce/themes/simple/skins/default/ui.css new file mode 100755 index 0000000..076fe84 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/simple/skins/default/ui.css | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* Reset */ | ||
| 2 | .defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} | ||
| 3 | |||
| 4 | /* Containers */ | ||
| 5 | .defaultSimpleSkin {position:relative} | ||
| 6 | .defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} | ||
| 7 | .defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} | ||
| 8 | .defaultSimpleSkin .mceToolbar {height:24px;} | ||
| 9 | |||
| 10 | /* Layout */ | ||
| 11 | .defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} | ||
| 12 | .defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} | ||
| 13 | |||
| 14 | /* Button */ | ||
| 15 | .defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} | ||
| 16 | .defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} | ||
| 17 | .defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} | ||
| 18 | .defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 19 | |||
| 20 | /* Separator */ | ||
| 21 | .defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} | ||
| 22 | |||
| 23 | /* Theme */ | ||
| 24 | .defaultSimpleSkin span.mce_bold {background-position:0 0} | ||
| 25 | .defaultSimpleSkin span.mce_italic {background-position:-60px 0} | ||
| 26 | .defaultSimpleSkin span.mce_underline {background-position:-140px 0} | ||
| 27 | .defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} | ||
| 28 | .defaultSimpleSkin span.mce_undo {background-position:-160px 0} | ||
| 29 | .defaultSimpleSkin span.mce_redo {background-position:-100px 0} | ||
| 30 | .defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} | ||
| 31 | .defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} | ||
| 32 | .defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css b/public/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css new file mode 100755 index 0000000..595809f --- /dev/null +++ b/public/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} | ||
| 2 | |||
| 3 | body {background: #FFF;} | ||
| 4 | .mceVisualAid {border: 1px dashed #BBB;} | ||
| 5 | |||
| 6 | /* IE */ | ||
| 7 | |||
| 8 | * html body { | ||
| 9 | scrollbar-3dlight-color: #F0F0EE; | ||
| 10 | scrollbar-arrow-color: #676662; | ||
| 11 | scrollbar-base-color: #F0F0EE; | ||
| 12 | scrollbar-darkshadow-color: #DDDDDD; | ||
| 13 | scrollbar-face-color: #E0E0DD; | ||
| 14 | scrollbar-highlight-color: #F0F0EE; | ||
| 15 | scrollbar-shadow-color: #F0F0EE; | ||
| 16 | scrollbar-track-color: #F5F5F5; | ||
| 17 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png b/public/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png new file mode 100755 index 0000000..527e349 --- /dev/null +++ b/public/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css b/public/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css new file mode 100755 index 0000000..cf6c35d --- /dev/null +++ b/public/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /* Reset */ | ||
| 2 | .o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} | ||
| 3 | |||
| 4 | /* Containers */ | ||
| 5 | .o2k7SimpleSkin {position:relative} | ||
| 6 | .o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} | ||
| 7 | .o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} | ||
| 8 | .o2k7SimpleSkin .mceToolbar {height:26px;} | ||
| 9 | |||
| 10 | /* Layout */ | ||
| 11 | .o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } | ||
| 12 | .o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} | ||
| 13 | .o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} | ||
| 14 | .o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} | ||
| 15 | |||
| 16 | /* Button */ | ||
| 17 | .o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} | ||
| 18 | .o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} | ||
| 19 | .o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} | ||
| 20 | .o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} | ||
| 21 | .o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 22 | |||
| 23 | /* Separator */ | ||
| 24 | .o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} | ||
| 25 | |||
| 26 | /* Theme */ | ||
| 27 | .o2k7SimpleSkin span.mce_bold {background-position:0 0} | ||
| 28 | .o2k7SimpleSkin span.mce_italic {background-position:-60px 0} | ||
| 29 | .o2k7SimpleSkin span.mce_underline {background-position:-140px 0} | ||
| 30 | .o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} | ||
| 31 | .o2k7SimpleSkin span.mce_undo {background-position:-160px 0} | ||
| 32 | .o2k7SimpleSkin span.mce_redo {background-position:-100px 0} | ||
| 33 | .o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} | ||
| 34 | .o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} | ||
| 35 | .o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} | ||
diff --git a/public/javascripts/tiny_mce/tiny_mce.js b/public/javascripts/tiny_mce/tiny_mce.js new file mode 100755 index 0000000..55aba6e --- /dev/null +++ b/public/javascripts/tiny_mce/tiny_mce.js | |||
| @@ -0,0 +1 @@ | |||
| var tinymce={majorVersion:'3',minorVersion:'2.1.1',releaseDate:'2008-11-27',_init:function(){var t=this,d=document,w=window,na=navigator,ua=na.userAgent,i,nl,n,base,p,v;t.isOpera=w.opera&&opera.buildNumber;t.isWebKit=/WebKit/.test(ua);t.isOldWebKit=t.isWebKit&&!w.getSelection().getRangeAt;t.isIE=!t.isWebKit&&!t.isOpera&&(/MSIE/gi).test(ua)&&(/Explorer/gi).test(na.appName);t.isIE6=t.isIE&&/MSIE [56]/.test(ua);t.isGecko=!t.isWebKit&&/Gecko/.test(ua);t.isMac=ua.indexOf('Mac')!=-1;t.isAir=/adobeair/i.test(ua);if(w.tinyMCEPreInit){t.suffix=tinyMCEPreInit.suffix;t.baseURL=tinyMCEPreInit.base;t.query=tinyMCEPreInit.query;return;}t.suffix='';nl=d.getElementsByTagName('base');for(i=0;i<nl.length;i++){if(v=nl[i].href){if(/^https?:\/\/[^\/]+$/.test(v))v+='/';base=v?v.match(/.*\//)[0]:'';}}function getBase(n){if(n.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(n.src)){if(/_(src|dev)\.js/g.test(n.src))t.suffix='_src';if((p=n.src.indexOf('?'))!=-1)t.query=n.src.substring(p+1);t.baseURL=n.src.substring(0,n.src.lastIndexOf('/'));if(base&&t.baseURL.indexOf('://')==-1)t.baseURL=base+t.baseURL;return t.baseURL;}return null;};nl=d.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}n=d.getElementsByTagName('head')[0];if(n){nl=n.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}}return;},is:function(o,t){var n=typeof(o);if(!t)return n!='undefined';if(t=='array'&&(o instanceof Array))return true;return n==t;},each:function(o,cb,s){var n,l;if(!o)return 0;s=s||o;if(typeof(o.length)!='undefined'){for(n=0,l=o.length;n<l;n++){if(cb.call(s,o[n],n,o)===false)return 0;}}else{for(n in o){if(o.hasOwnProperty(n)){if(cb.call(s,o[n],n,o)===false)return 0;}}}return 1;},map:function(a,f){var o=[];tinymce.each(a,function(v){o.push(f(v));});return o;},grep:function(a,f){var o=[];tinymce.each(a,function(v){if(!f||f(v))o.push(v);});return o;},inArray:function(a,v){var i,l;if(a){for(i=0,l=a.length;i<l;i++){if(a[i]===v)return i;}}return-1;},extend:function(o,e){var i,a=arguments;for(i=1;i<a.length;i++){e=a[i];tinymce.each(e,function(v,n){if(typeof(v)!=='undefined')o[n]=v;});}return o;},trim:function(s){return(s?''+s:'').replace(/^\s*|\s*$/g,'');},create:function(s,p){var t=this,sp,ns,cn,scn,c,de=0;s=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);cn=s[3].match(/(^|\.)(\w+)$/i)[2];ns=t.createNS(s[3].replace(/\.\w+$/,''));if(ns[cn])return;if(s[2]=='static'){ns[cn]=p;if(this.onCreate)this.onCreate(s[2],s[3],ns[cn]);return;}if(!p[cn]){p[cn]=function(){};de=1;}ns[cn]=p[cn];t.extend(ns[cn].prototype,p);if(s[5]){sp=t.resolve(s[5]).prototype;scn=s[5].match(/\.(\w+)$/i)[1];c=ns[cn];if(de){ns[cn]=function(){return sp[scn].apply(this,arguments);};}else{ns[cn]=function(){this.parent=sp[scn];return c.apply(this,arguments);};}ns[cn].prototype[cn]=ns[cn];t.each(sp,function(f,n){ns[cn].prototype[n]=sp[n];});t.each(p,function(f,n){if(sp[n]){ns[cn].prototype[n]=function(){this.parent=sp[n];return f.apply(this,arguments);};}else{if(n!=cn)ns[cn].prototype[n]=f;}});}t.each(p['static'],function(f,n){ns[cn][n]=f;});if(this.onCreate)this.onCreate(s[2],s[3],ns[cn].prototype);},walk:function(o,f,n,s){s=s||this;if(o){if(n)o=o[n];tinymce.each(o,function(o,i){if(f.call(s,o,i,n)===false)return false;tinymce.walk(o,f,n,s);});}},createNS:function(n,o){var i,v;o=o||window;n=n.split('.');for(i=0;i<n.length;i++){v=n[i];if(!o[v])o[v]={};o=o[v];}return o;},resolve:function(n,o){var i,l;o=o||window;n=n.split('.');for(i=0,l=n.length;i<l;i++){o=o[n[i]];if(!o)break;}return o;},addUnload:function(f,s){var t=this,w=window;f={func:f,scope:s||this};if(!t.unloads){function unload(){var li=t.unloads,o,n;if(li){for(n in li){o=li[n];if(o&&o.func)o.func.call(o.scope,1);}if(w.detachEvent){w.detachEvent('onbeforeunload',fakeUnload);w.detachEvent('onunload',unload);}else if(w.removeEventListener)w.removeEventListener('unload',unload,false);t.unloads=o=li=w=unload=null;if(window.CollectGarbage)window.CollectGarbage();}};function fakeUnload(){var d=document;if(d.readyState=='interactive'){function stop(){d.detachEvent('onstop',stop);unload();d=null;};d.attachEvent('onstop',stop);window.setTimeout(function(){d.detachEvent('onstop',stop);},0);}};if(w.attachEvent){w.attachEvent('onunload',unload);w.attachEvent('onbeforeunload',fakeUnload);}else if(w.addEventListener)w.addEventListener('unload',unload,false);t.unloads=[f];}else t.unloads.push(f);return f;},removeUnload:function(f){var u=this.unloads,r=null;tinymce.each(u,function(o,i){if(o&&o.func==f){u.splice(i,1);r=f;return false;}});return r;},explode:function(s,d){return s?tinymce.map(s.split(d||','),tinymce.trim):s;},_addVer:function(u){var v;if(!this.query)return u;v=(u.indexOf('?')==-1?'?':'&')+this.query;if(u.indexOf('#')==-1)return u+v;return u.replace('#',v+'#');}};window.tinymce=tinymce;tinymce._init();tinymce.create('tinymce.util.Dispatcher',{scope:null,listeners:null,Dispatcher:function(s){this.scope=s||this;this.listeners=[];},add:function(cb,s){this.listeners.push({cb:cb,scope:s||this.scope});return cb;},addToTop:function(cb,s){this.listeners.unshift({cb:cb,scope:s||this.scope});return cb;},remove:function(cb){var l=this.listeners,o=null;tinymce.each(l,function(c,i){if(cb==c.cb){o=cb;l.splice(i,1);return false;}});return o;},dispatch:function(){var s,a=arguments,i,li=this.listeners,c;for(i=0;i<li.length;i++){c=li[i];s=c.cb.apply(c.scope,a);if(s===false)break;}return s;}});(function(){var each=tinymce.each;tinymce.create('tinymce.util.URI',{URI:function(u,s){var t=this,o,a,b;s=t.settings=s||{};if(/^(mailto|news|javascript|about):/i.test(u)||/^\s*#/.test(u)){t.source=u;return;}if(u.indexOf('/')===0&&u.indexOf('//')!==0)u=(s.base_uri?s.base_uri.protocol||'http':'http')+'://mce_host'+u;if(u.indexOf(':/')===-1&&u.indexOf('//')!==0)u=(s.base_uri.protocol||'http')+'://mce_host'+t.toAbsPath(s.base_uri.path,u);u=u.replace(/@@/g,'(mce_at)');u=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(v,i){var s=u[i];if(s)s=s.replace(/\(mce_at\)/g,'@@');t[v]=s;});if(b=s.base_uri){if(!t.protocol)t.protocol=b.protocol;if(!t.userInfo)t.userInfo=b.userInfo;if(!t.port&&t.host=='mce_host')t.port=b.port;if(!t.host||t.host=='mce_host')t.host=b.host;t.source='';}},setPath:function(p){var t=this;p=/^(.*?)\/?(\w+)?$/.exec(p);t.path=p[0];t.directory=p[1];t.file=p[2];t.source='';t.getURI();},toRelative:function(u){var t=this,o;if(u==="./")return u;u=new tinymce.util.URI(u,{base_uri:t});if((u.host!='mce_host'&&t.host!=u.host&&u.host)||t.port!=u.port||t.protocol!=u.protocol)return u.getURI();o=t.toRelPath(t.path,u.path);if(u.query)o+='?'+u.query;if(u.anchor)o+='#'+u.anchor;return o;},toAbsolute:function(u,nh){var u=new tinymce.util.URI(u,{base_uri:this});return u.getURI(this.host==u.host?nh:0);},toRelPath:function(base,path){var items,bp=0,out='',i,l;base=base.substring(0,base.lastIndexOf('/'));base=base.split('/');items=path.split('/');if(base.length>=items.length){for(i=0,l=base.length;i<l;i++){if(i>=items.length||base[i]!=items[i]){bp=i+1;break;}}}if(base.length<items.length){for(i=0,l=items.length;i<l;i++){if(i>=base.length||base[i]!=items[i]){bp=i+1;break;}}}if(bp==1)return path;for(i=0,l=base.length-(bp-1);i<l;i++)out+="../";for(i=bp-1,l=items.length;i<l;i++){if(i!=bp-1)out+="/"+items[i];else out+=items[i];}return out;},toAbsPath:function(base,path){var i,nb=0,o=[];base=base.split('/');path=path.split('/');each(base,function(k){if(k)o.push(k);});base=o;for(i=path.length-1,o=[];i>=0;i--){if(path[i].length==0||path[i]==".")continue;if(path[i]=='..'){nb++;continue;}if(nb>0){nb--;continue;}o.push(path[i]);}i=base.length-nb;if(i<=0)return'/'+o.reverse().join('/');return'/'+base.slice(0,i).join('/')+'/'+o.reverse().join('/');},getURI:function(nh){var s,t=this;if(!t.source||nh){s='';if(!nh){if(t.protocol)s+=t.protocol+'://';if(t.userInfo)s+=t.userInfo+'@';if(t.host)s+=t.host;if(t.port)s+=':'+t.port;}if(t.path)s+=t.path;if(t.query)s+='?'+t.query;if(t.anchor)s+='#'+t.anchor;t.source=s;}return t.source;}});})();(function(){var each=tinymce.each;tinymce.create('static tinymce.util.Cookie',{getHash:function(n){var v=this.get(n),h;if(v){each(v.split('&'),function(v){v=v.split('=');h=h||{};h[unescape(v[0])]=unescape(v[1]);});}return h;},setHash:function(n,v,e,p,d,s){var o='';each(v,function(v,k){o+=(!o?'':'&')+escape(k)+'='+escape(v);});this.set(n,o,e,p,d,s);},get:function(n){var c=document.cookie,e,p=n+"=",b;if(!c)return;b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0)return null;}else b+=2;e=c.indexOf(";",b);if(e==-1)e=c.length;return unescape(c.substring(b+p.length,e));},set:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+((e)?"; expires="+e.toGMTString():"")+((p)?"; path="+escape(p):"")+((d)?"; domain="+d:"")+((s)?"; secure":"");},remove:function(n,p){var d=new Date();d.setTime(d.getTime()-1000);this.set(n,'',d,p,d);}});})();tinymce.create('static tinymce.util.JSON',{serialize:function(o){var i,v,s=tinymce.util.JSON.serialize,t;if(o==null)return'null';t=typeof o;if(t=='string'){v='\bb\tt\nn\ff\rr\""\'\'\\\\';return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(a,b){i=v.indexOf(b);if(i+1)return'\\'+v.charAt(i+1);a=b.charCodeAt().toString(16);return'\\u'+'0000'.substring(a.length)+a;})+'"';}if(t=='object'){if(o instanceof Array){for(i=0,v='[';i<o.length;i++)v+=(i>0?',':'')+s(o[i]);return v+']';}v='{';for(i in o)v+=typeof o[i]!='function'?(v.length>1?',"':'"')+i+'":'+s(o[i]):'';return v+'}';}return''+o;},parse:function(s){try{return eval('('+s+')');}catch(ex){}}});tinymce.create('static tinymce.util.XHR',{send:function(o){var x,t,w=window,c=0;o.scope=o.scope||this;o.success_scope=o.success_scope||o.scope;o.error_scope=o.error_scope||o.scope;o.async=o.async===false?false:true;o.data=o.data||'';function get(s){x=0;try{x=new ActiveXObject(s);}catch(ex){}return x;};x=w.XMLHttpRequest?new XMLHttpRequest():get('Microsoft.XMLHTTP')||get('Msxml2.XMLHTTP');if(x){if(x.overrideMimeType)x.overrideMimeType(o.content_type);x.open(o.type||(o.data?'POST':'GET'),o.url,o.async);if(o.content_type)x.setRequestHeader('Content-Type',o.content_type);x.send(o.data);function ready(){if(!o.async||x.readyState==4||c++>10000){if(o.success&&c<10000&&x.status==200)o.success.call(o.success_scope,''+x.responseText,x,o);else if(o.error)o.error.call(o.error_scope,c>10000?'TIMED_OUT':'GENERAL',x,o);x=null;}else w.setTimeout(ready,10);};if(!o.async)return ready();t=w.setTimeout(ready,10);}}});(function(){var extend=tinymce.extend,JSON=tinymce.util.JSON,XHR=tinymce.util.XHR;tinymce.create('tinymce.util.JSONRequest',{JSONRequest:function(s){this.settings=extend({},s);this.count=0;},send:function(o){var ecb=o.error,scb=o.success;o=extend(this.settings,o);o.success=function(c,x){c=JSON.parse(c);if(typeof(c)=='undefined'){c={error:'JSON Parse error.'};}if(c.error)ecb.call(o.error_scope||o.scope,c.error,x);else scb.call(o.success_scope||o.scope,c.result);};o.error=function(ty,x){ecb.call(o.error_scope||o.scope,ty,x);};o.data=JSON.serialize({id:o.id||'c'+(this.count++),method:o.method,params:o.params});o.content_type='application/json';XHR.send(o);},'static':{sendRPC:function(o){return new tinymce.util.JSONRequest().send(o);}}});}());(function(){var each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create('tinymce.dom.DOMUtils',{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(d,s){var t=this;t.doc=d;t.win=window;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";t.stdMode=d.documentMode===8;this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand('BackgroundImageCache',false,true);}catch(e){t.cssFlicker=true;}}tinymce.addUnload(t.destroy,t);},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body;},getViewPort:function(w){var d,b;w=!w?this.win:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight};},getRect:function(e){var p,t=this,sr;e=t.get(e);p=t.getPos(e);sr=t.getSize(e);return{x:p.x,y:p.y,w:sr.w,h:sr.h};},getSize:function(e){var t=this,w,h;e=t.get(e);w=t.getStyle(e,'width');h=t.getStyle(e,'height');if(w.indexOf('px')===-1)w=0;if(h.indexOf('px')===-1)h=0;return{w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight};},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root)r=r||this.getRoot();if(is(f,'string')){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==='*'){s=true;return false;}each(na.split(','),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName.toUpperCase()==v)){s=true;return false;}});return s;};}while(n){if(n==r)return null;if(f(n))return n;n=n.parentNode;}return null;},get:function(e){var n;if(e&&this.doc&&typeof(e)=='string'){n=e;e=this.doc.getElementById(e);if(e&&e.id!==n)return this.doc.getElementsByName(n)[1];}return e;},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n,xp;s=t.get(s)||t.doc;if(s.querySelectorAll){if(s!=t.doc){i=s.id;s.id='_mc_tmp';pa='#_mc_tmp '+pa;}l=tinymce.grep(s.querySelectorAll(pa));s.id=i;return l;}if(!t.selectorRe)t.selectorRe=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i;;if(tinymce.isAir){each(tinymce.explode(pa),function(v){if(!(xp=t.cache[v])){xp='';each(v.split(' '),function(v){v=t.selectorRe.exec(v);xp+=v[1]?'//'+v[1]:'//*';if(v[2])xp+="[@id='"+v[2]+"']";if(v[3]){each(v[3].split('.'),function(n){xp+="[@class = '"+n+"' or contains(concat(' ', @class, ' '), ' "+n+" ')]";});}});t.cache[v]=xp;}xp=t.doc.evaluate(xp,s,null,4,null);while(n=xp.iterateNext())o.push(n);});return o;}if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase());};}else{function get(s,n){return s.getElementsByTagName(n);};}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i<l;i++)o.push(x[i]);return o;}if(t.elmClassPattern.test(pa)){pl=t.elmClassPattern.exec(pa);x=get(s,pl[1]||'*');c=' '+pl[2]+' ';for(i=0,l=x.length;i<l;i++){n=x[i];if(n.className&&(' '+n.className+' ').indexOf(c)!==-1)o.push(n);}return o;}function collect(n){if(!n.mce_save){n.mce_save=1;o.push(n);}};function collectIE(n){if(!n.getAttribute('mce_save')){n.setAttribute('mce_save','1');o.push(n);}};function find(n,f,r){var i,l,nl=get(r,n);for(i=0,l=nl.length;i<l;i++)f(nl[i]);};each(pa.split(','),function(v,i){v=tinymce.trim(v);if(t.elmPattern.test(v)){each(get(s,v),function(n){collect(n);});return;}if(t.elmClassPattern.test(v)){x=t.elmClassPattern.exec(v);each(get(s,x[1]),function(n){if(t.hasClass(n,x[2]))collect(n);});return;}if(!(cs=t.cache[pa])){cs='x=(function(cf, s) {';pl=v.split(' ');each(pl,function(v){var p=t.selectorRe.exec(v);p[1]=p[1]||'*';cs+='find("'+p[1]+'", function(n) {';if(p[2])cs+='if (n.id !== "'+p[2]+'") return;';if(p[3]){cs+='var c = " " + n.className + " ";';cs+='if (';c='';each(p[3].split('.'),function(v){if(v)c+=(c?'||':'')+'c.indexOf(" '+v+' ") === -1';});cs+=c+') return;';}});cs+='cf(n);';for(i=pl.length-1;i>=0;i--)cs+='}, '+(i?'n':'s')+');';cs+='})';t.cache[pa]=cs=eval(cs);}cs(isIE?collectIE:collect,s);});each(o,function(n){if(isIE)n.removeAttribute('mce_save');else delete n.mce_save;});return o;},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,'string')?t.doc.createElement(n):n;t.setAttribs(e,a);if(h){if(h.nodeType)e.appendChild(h);else t.setHTML(e,h);}return!c?p.appendChild(e):e;});},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1);},createHTML:function(n,a,h){var o='',t=this,k;o+='<'+n;for(k in a){if(a.hasOwnProperty(k))o+=' '+k+'="'+t.encode(a[k])+'"';}if(tinymce.is(h))return o+'>'+h+'</'+n+'>';return o+' />';},remove:function(n,k){return this.run(n,function(n){var p,g;p=n.parentNode;if(!p)return null;if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n);});}return p.removeChild(n);});},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(t.pixelStyles.test(na)&&(tinymce.is(v,'number')||/^[\-0-9\.]+$/.test(v)))v+='px';switch(na){case'opacity':if(isIE){s.filter=v===''?'':"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout)s.display='inline-block';}s[na]=s['-moz-opacity']=s['-khtml-opacity']=v||'';break;case'float':isIE?s.styleFloat=v:s.cssFloat=v;break;default:s[na]=v||'';}if(t.settings.update_styles)t.setAttrib(e,'mce_style');});},getStyle:function(n,na,c){n=this.get(n);if(!n)return false;if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return'-'+a;});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na);}catch(ex){return null;}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(na=='float')na=isIE?'styleFloat':'cssFloat';if(n.currentStyle&&c)return n.currentStyle[na];return n.style[na];},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v);});s.update_styles=ol;if(s.update_styles)t.setAttrib(e,s.cssText);},setAttrib:function(e,n,v){var t=this;if(!e||!n)return;if(t.settings.strict)n=n.toLowerCase();return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(!is(v,'string')){each(v,function(v,n){t.setStyle(e,n,v);});return;}if(s.keep_values){if(v&&!t._isRes(v))e.setAttribute('mce_style',v,2);else e.removeAttribute('mce_style',2);}e.style.cssText=v;break;case"class":e.className=v||'';break;case"src":case"href":if(s.keep_values){if(s.url_converter)v=s.url_converter.call(s.url_converter_scope||t,v,n,e);t.setAttrib(e,'mce_'+n,v,2);}break;case"shape":e.setAttribute('mce_style',v);break;}if(is(v)&&v!==null&&v.length!==0)e.setAttribute(n,''+v,2);else e.removeAttribute(n,2);});},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v);});});},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e||e.nodeType!==1)return false;if(!is(dv))dv='';if(/^(src|href|style|coords|shape)$/.test(n)){v=e.getAttribute("mce_"+n);if(v)return v;}if(isIE&&t.props[n]){v=e[t.props[n]];v=v&&v.nodeValue?v.nodeValue:v;}if(!v)v=e.getAttribute(n,2);if(n==='style'){v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values&&!t._isRes(v))e.setAttribute('mce_style',v);}}if(isWebKit&&n==="class"&&v)v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,'');if(isIE){switch(n){case'rowspan':case'colspan':if(v===1)v='';break;case'size':if(v==='+0'||v===20)v='';break;case'width':case'height':case'vspace':case'checked':case'disabled':case'readonly':if(v===0)v='';break;case'hspace':if(v===-1)v='';break;case'maxlength':case'tabindex':if(v===32768||v===2147483647||v==='32768')v='';break;case'compact':case'noshade':case'nowrap':if(v===65535)return n;return dv;case'shape':v=v.toLowerCase();break;default:if(n.indexOf('on')===0&&v)v=(''+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1');}}return(v!==undefined&&v!==null&&v!=='')?''+v:dv;},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select('html')[0],'borderWidth');x=(x=='medium'||t.boxModel&&!t.isIE6)&&2||x;n.top+=t.win.self!=t.win.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x};}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent;}r=n;while(r){if(!/^table-row|inline.*/i.test(t.getStyle(r,"display",1))){x-=r.scrollLeft||0;y-=r.scrollTop||0;}r=r.parentNode;if(r==d.body)break;}return{x:x,y:y};},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st)return o;function compress(p,s,ot){var t,r,b,l;t=o[p+'-top'+s];if(!t)return;r=o[p+'-right'+s];if(t!=r)return;b=o[p+'-bottom'+s];if(r!=b)return;l=o[p+'-left'+s];if(b!=l)return;o[ot]=l;delete o[p+'-top'+s];delete o[p+'-right'+s];delete o[p+'-bottom'+s];delete o[p+'-left'+s];};function compress2(ta,a,b,c){var t;t=o[a];if(!t)return;t=o[b];if(!t)return;t=o[c];if(!t)return;o[ta]=o[a]+' '+o[b]+' '+o[c];delete o[a];delete o[b];delete o[c];};st=st.replace(/&(#?[a-z0-9]+);/g,'&$1_MCE_SEMI_');each(st.split(';'),function(v){var sv,ur=[];if(v){v=v.replace(/_MCE_SEMI_/g,';');v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return'url('+ur.length+')';});v=v.split(':');sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1];});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return'url('+s.url_converter.call(s.url_converter_scope||t,t.decode(c),'style',null)+')';});}o[tinymce.trim(v[0]).toLowerCase()]=sv;}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2('border','border-width','border-style','border-color');if(isIE){if(o.border=='medium none')o.border='';}return o;},serializeStyle:function(o){var s='';each(o,function(v,k){if(k&&v){if(tinymce.isGecko&&k.indexOf('-moz-')===0)return;switch(k){case'color':case'background-color':v=v.toLowerCase();break;}s+=(s?' ':'')+k+': '+v+';';}});return s;},loadCSS:function(u){var t=this,d=t.doc;if(!u)u='';each(u.split(','),function(u){if(t.files[u])return;t.files[u]=true;t.add(t.select('head')[0],'link',{rel:'stylesheet',href:tinymce._addVer(u)});});},addClass:function(e,c){return this.run(e,function(e){var o;if(!c)return 0;if(this.hasClass(e,c))return e.className;o=this.removeClass(e,c);return e.className=(o!=''?(o+' '):'')+c;});},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re)re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g");v=e.className.replace(re,' ');return e.className=tinymce.trim(v!=' '?v:'');}return e.className;});},hasClass:function(n,c){n=this.get(n);if(!n||!c)return false;return(' '+n.className+' ').indexOf(' '+c+' ')!==-1;},show:function(e){return this.setStyle(e,'display','block');},hide:function(e){return this.setStyle(e,'display','none');},isHidden:function(e){e=this.get(e);return!e||e.style.display=='none'||this.getStyle(e,'display')=='none';},uniqueId:function(p){return(!p?'mce_':p)+(this.counter++);},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x,i,nl,n,p,x;h=t.processHTML(h);if(isIE){function set(){try{e.innerHTML='<br />'+h;e.removeChild(e.firstChild);}catch(ex){while(e.firstChild)e.firstChild.removeNode();x=t.create('div');x.innerHTML='<br />'+h;each(x.childNodes,function(n,i){if(i)e.appendChild(n);});}};if(t.settings.fix_ie_paragraphs)h=h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true"> </p>');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("p");for(i=nl.length-1,x=0;i>=0;i--){n=nl[i];if(!n.hasChildNodes()){if(!n.mce_keep){x=1;break;}n.removeAttribute('mce_keep');}}}if(x){h=h.replace(/<p ([^>]+)>|<p>/g,'<div $1 mce_tmp="1">');h=h.replace(/<\/p>/g,'</div>');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("DIV");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.mce_tmp){p=t.doc.createElement('p');n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){var v;if(b!=='mce_tmp'){v=n.getAttribute(b);if(!v&&b==='class')v=n.className;p.setAttribute(b,v);}});for(x=0;x<n.childNodes.length;x++)p.appendChild(n.childNodes[x].cloneNode(true));n.swapNode(p);}}}}}else e.innerHTML=h;return h;});},processHTML:function(h){var t=this,s=t.settings;if(!s.process_html)return h;if(tinymce.isGecko){h=h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,'<$1b$2>');h=h.replace(/<(\/?)em>|<em( [^>]+)>/gi,'<$1i$2>');}else if(isIE){h=h.replace(/'/g,''');h=h.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,'');}h=h.replace(/<a( )([^>]+)\/>|<a\/>/gi,'<a$1$2></a>');if(s.keep_values){if(/<script|style/.test(h)){function trim(s){s=s.replace(/(<!--\[CDATA\[|\]\]-->)/g,'\n');s=s.replace(/^[\r\n]*|[\r\n]*$/g,'');s=s.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,'');s=s.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,'');return s;};h=h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/g,function(v,a,b){b=trim(b);if(!a)a=' type="text/javascript"';if(b)b='<!--\n'+b+'\n// -->';return'<mce:script'+a+'>'+b+'</mce:script>';});h=h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/g,function(v,a,b){b=trim(b);return'<mce:style'+a+'><!--\n'+b+'\n--></mce:style><style'+a+' mce_bogus="1">'+b+'</style>';});}h=h.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,'<!--[CDATA[$1]]-->');h=h.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf('mce_'+b)!=-1)return m;if(b=='style'){if(t._isRes(c))return m;if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+')';});}}else if(b!='coords'&&b!='shape'){if(s.url_converter)u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n));}return' '+b+'="'+c+'" mce_'+b+'="'+u+'"';};a=a.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,handle);});}return h;},getOuterHTML:function(e){var d;e=this.get(e);if(!e)return null;if(isIE)return e.outerHTML;d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML;},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1)e.outerHTML=h;else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling;}t.remove(e);}});},decode:function(s){var e,n,v;if(/&[^;]+;/.test(s)){e=this.doc.createElement("div");e.innerHTML=s;n=e.firstChild;v='';if(n){do{v+=n.nodeValue;}while(n.nextSibling);}return v||s;}return s;},encode:function(s){return s?(''+s).replace(/[<>&\"]/g,function(c,b){switch(c){case'&':return'&';case'"':return'"';case'<':return'<';case'>':return'>';}return c;}):s;},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns)p.insertBefore(n,ns);else p.appendChild(n);return n;});},isBlock:function(n){if(n.nodeType&&n.nodeType!==1)return false;n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);},replace:function(n,o,k){if(is(o,'array'))n=n.cloneNode(true);return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true));});}return o.parentNode.replaceChild(n,o);});},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:'0'+s;};if(c){s='#'+hex(c[1])+hex(c[2])+hex(c[3]);return s;}return s;},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter,ov;if(t.classes)return t.classes;function addClasses(s){each(s.imports,function(r){addClasses(r);});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(','),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v))return;ov=v;v=v.replace(/.*\.([a-z0-9_\-]+).*/i,'$1');if(f&&!(v=f(v,ov)))return;if(!lo[v]){cl.push({'class':v});lo[v]=1;}});}break;case 3:addClasses(r.styleSheet);break;}});};try{each(t.doc.styleSheets,addClasses);}catch(ex){}if(cl.length>0)t.classes=cl;return cl;},run:function(e,f,s){var t=this,o;if(t.doc&&typeof(e)==='string')e=t.get(e);if(!e)return false;s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof(e)=='string')e=t.doc.getElementById(e);o.push(f.call(s,e,i));}});return o;}return f.call(s,e);},getAttribs:function(n){var o;n=this.get(n);if(!n)return[];if(isIE){o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;}return n.attributes;},destroy:function(s){var t=this;t.win=t.doc=t.root=null;if(!s)tinymce.removeUnload(t.destroy);},_isRes:function(c){return/^(top|left|bottom|right|width|height)/i.test(c)||/;\s*(top|left|bottom|right|width|height)/i.test(c);}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0});})();(function(){var each=tinymce.each,DOM=tinymce.DOM,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit,Event;tinymce.create('static tinymce.dom.Event',{inits:[],events:[],add:function(o,n,f,s){var cb,t=this,el=t.events,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.add(o,n,f,s));});return r;}o=DOM.get(o);if(!o)return;cb=function(e){e=e||window.event;if(e&&!e.target&&isIE)e.target=e.srcElement;if(!s)return f(e);return f.call(s,e);};if(n=='unload'){tinymce.unloads.unshift({func:cb});return cb;}if(n=='init'){if(t.domLoaded)cb();else t.inits.push(cb);return cb;}el.push({obj:o,name:n,func:f,cfunc:cb,scope:s});t._add(o,n,cb);return f;},remove:function(o,n,f){var t=this,a=t.events,s=false,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.remove(o,n,f));});return r;}o=DOM.get(o);each(a,function(e,i){if(e.obj==o&&e.name==n&&(!f||(e.func==f||e.cfunc==f))){a.splice(i,1);t._remove(o,n,e.cfunc);s=true;return false;}});return s;},clear:function(o){var t=this,a=t.events,i,e;if(o){o=DOM.get(o);for(i=a.length-1;i>=0;i--){e=a[i];if(e.obj===o){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;a.splice(i,1);}}}},cancel:function(e){if(!e)return false;this.stop(e);return this.prevent(e);},stop:function(e){if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;return false;},prevent:function(e){if(e.preventDefault)e.preventDefault();else e.returnValue=false;return false;},_unload:function(){var t=Event;each(t.events,function(e,i){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;});t.events=[];t=null;},_add:function(o,n,f){if(o.attachEvent)o.attachEvent('on'+n,f);else if(o.addEventListener)o.addEventListener(n,f,false);else o['on'+n]=f;},_remove:function(o,n,f){if(o){try{if(o.detachEvent)o.detachEvent('on'+n,f);else if(o.removeEventListener)o.removeEventListener(n,f,false);else o['on'+n]=null;}catch(ex){}}},_pageInit:function(){var e=Event;if(e.domLoaded)return;e._remove(window,'DOMContentLoaded',e._pageInit);e.domLoaded=true;each(e.inits,function(c){c();});e.inits=[];},_wait:function(){var t;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded){Event.domLoaded=1;return;}if(isIE&&document.location.protocol!='https:'){document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');DOM.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){Event._pageInit();DOM.get("__ie_onload").onreadystatechange=null;}};}else{Event._add(window,'DOMContentLoaded',Event._pageInit,Event);if(isIE||isWebKit){t=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(t);Event._pageInit();}},10);}}}});Event=tinymce.dom.Event;Event._wait();tinymce.addUnload(Event._unload);})();(function(){var each=tinymce.each;tinymce.create('tinymce.dom.Element',{Element:function(id,s){var t=this,dom,el;s=s||{};t.id=id;t.dom=dom=s.dom||tinymce.DOM;t.settings=s;if(!tinymce.isIE)el=t.dom.get(t.id);each(['getPos','getRect','getParent','add','setStyle','getStyle','setStyles','setAttrib','setAttribs','getAttrib','addClass','removeClass','hasClass','getOuterHTML','setOuterHTML','remove','show','hide','isHidden','setHTML','get'],function(k){t[k]=function(){var a=arguments,o;if(tinymce.isOpera){a=[id];each(arguments,function(v){a.push(v);});}else Array.prototype.unshift.call(a,el||id);o=dom[k].apply(dom,a);t.update(k);return o;};});},on:function(n,f,s){return tinymce.dom.Event.add(this.id,n,f,s);},getXY:function(){return{x:parseInt(this.getStyle('left')),y:parseInt(this.getStyle('top'))};},getSize:function(){var n=this.dom.get(this.id);return{w:parseInt(this.getStyle('width')||n.clientWidth),h:parseInt(this.getStyle('height')||n.clientHeight)};},moveTo:function(x,y){this.setStyles({left:x,top:y});},moveBy:function(x,y){var p=this.getXY();this.moveTo(p.x+x,p.y+y);},resizeTo:function(w,h){this.setStyles({width:w,height:h});},resizeBy:function(w,h){var s=this.getSize();this.resizeTo(s.w+w,s.h+h);},update:function(k){var t=this,b,dom=t.dom;if(tinymce.isIE6&&t.settings.blocker){k=k||'';if(k.indexOf('get')===0||k.indexOf('has')===0||k.indexOf('is')===0)return;if(k=='remove'){dom.remove(t.blocker);return;}if(!t.blocker){t.blocker=dom.uniqueId();b=dom.add(t.settings.container||dom.getRoot(),'iframe',{id:t.blocker,style:'position:absolute;',frameBorder:0,src:'javascript:""'});dom.setStyle(b,'opacity',0);}else b=dom.get(t.blocker);dom.setStyle(b,'left',t.getStyle('left',1));dom.setStyle(b,'top',t.getStyle('top',1));dom.setStyle(b,'width',t.getStyle('width',1));dom.setStyle(b,'height',t.getStyle('height',1));dom.setStyle(b,'display',t.getStyle('display',1));dom.setStyle(b,'zIndex',parseInt(t.getStyle('zIndex',1)||0)-1);}}});})();(function(){function trimNl(s){return s.replace(/[\n\r]+/g,'');};var is=tinymce.is,isIE=tinymce.isIE,each=tinymce.each;tinymce.create('tinymce.dom.Selection',{Selection:function(dom,win,serializer){var t=this;t.dom=dom;t.win=win;t.serializer=serializer;each(['onBeforeSetContent','onBeforeGetContent','onSetContent','onGetContent'],function(e){t[e]=new tinymce.util.Dispatcher(t);});tinymce.addUnload(t.destroy,t);},getContent:function(s){var t=this,r=t.getRng(),e=t.dom.create("body"),se=t.getSel(),wb,wa,n;s=s||{};wb=wa='';s.get=true;s.format=s.format||'html';t.onBeforeGetContent.dispatch(t,s);if(s.format=='text')return t.isCollapsed()?'':(r.text||(se.toString?se.toString():''));if(r.cloneContents){n=r.cloneContents();if(n)e.appendChild(n);}else if(is(r.item)||is(r.htmlText))e.innerHTML=r.item?r.item(0).outerHTML:r.htmlText;else e.innerHTML=r.toString();if(/^\s/.test(e.innerHTML))wb=' ';if(/\s+$/.test(e.innerHTML))wa=' ';s.getInner=true;s.content=t.isCollapsed()?'':wb+t.serializer.serialize(e,s)+wa;t.onGetContent.dispatch(t,s);return s.content;},setContent:function(h,s){var t=this,r=t.getRng(),c,d=t.win.document;s=s||{format:'html'};s.set=true;h=s.content=t.dom.processHTML(h);t.onBeforeSetContent.dispatch(t,s);h=s.content;if(r.insertNode){h+='<span id="__caret">_</span>';r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h));c=t.dom.get('__caret');r=d.createRange();r.setStartBefore(c);r.setEndAfter(c);t.setRng(r);d.execCommand('Delete',false,null);t.dom.remove('__caret');}else{if(r.item){d.execCommand('Delete',false,null);r=t.getRng();}r.pasteHTML(h);}t.onSetContent.dispatch(t,s);},getStart:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(1);e=r.parentElement();if(e&&e.nodeName=='BODY')return e.firstChild;return e;}else{e=r.startContainer;if(e.nodeName=='BODY')return e.firstChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getEnd:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(0);e=r.parentElement();if(e&&e.nodeName=='BODY')return e.lastChild;return e;}else{e=r.endContainer;if(e.nodeName=='BODY')return e.lastChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getBookmark:function(si){var t=this,r=t.getRng(),tr,sx,sy,vp=t.dom.getViewPort(t.win),e,sp,bp,le,c=-0xFFFFFF,s,ro=t.dom.getRoot(),wb=0,wa=0,nv;sx=vp.x;sy=vp.y;if(si=='simple')return{rng:r,scrollX:sx,scrollY:sy};if(isIE){if(r.item){e=r.item(0);each(t.dom.select(e.nodeName),function(n,i){if(e==n){sp=i;return false;}});return{tag:e.nodeName,index:sp,scrollX:sx,scrollY:sy};}tr=t.dom.doc.body.createTextRange();tr.moveToElementText(ro);tr.collapse(true);bp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(true);sp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(false);le=Math.abs(tr.move('character',c))-sp;return{start:sp-bp,length:le,scrollX:sx,scrollY:sy};}e=t.getNode();s=t.getSel();if(!s)return null;if(e&&e.nodeName=='IMG'){return{scrollX:sx,scrollY:sy};}function getPos(r,sn,en){var w=t.dom.doc.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){if(n==sn)d.start=p;if(n==en){d.end=p;return d;}p+=trimNl(n.nodeValue||'').length;}return null;};if(s.anchorNode==s.focusNode&&s.anchorOffset==s.focusOffset){e=getPos(ro,s.anchorNode,s.focusNode);if(!e)return{scrollX:sx,scrollY:sy};trimNl(s.anchorNode.nodeValue||'').replace(/^\s+/,function(a){wb=a.length;});return{start:Math.max(e.start+s.anchorOffset-wb,0),end:Math.max(e.end+s.focusOffset-wb,0),scrollX:sx,scrollY:sy,beg:s.anchorOffset-wb==0};}else{e=getPos(ro,r.startContainer,r.endContainer);if(!e)return{scrollX:sx,scrollY:sy};return{start:Math.max(e.start+r.startOffset-wb,0),end:Math.max(e.end+r.endOffset-wa,0),scrollX:sx,scrollY:sy,beg:r.startOffset-wb==0};}},moveToBookmark:function(b){var t=this,r=t.getRng(),s=t.getSel(),ro=t.dom.getRoot(),sd,nvl,nv;function getPos(r,sp,ep){var w=t.dom.doc.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={},o,v,wa,wb;while((n=w.nextNode())!=null){wa=wb=0;nv=n.nodeValue||'';nvl=trimNl(nv).length;p+=nvl;if(p>=sp&&!d.startNode){o=sp-(p-nvl);if(b.beg&&o>=nvl)continue;d.startNode=n;d.startOffset=o+wb;}if(p>=ep){d.endNode=n;d.endOffset=ep-(p-nvl)+wb;return d;}}return null;};if(!b)return false;t.win.scrollTo(b.scrollX,b.scrollY);if(isIE){if(r=b.rng){try{r.select();}catch(ex){}return true;}t.win.focus();if(b.tag){r=ro.createControlRange();each(t.dom.select(b.tag),function(n,i){if(i==b.index)r.addElement(n);});}else{try{if(b.start<0)return true;r=s.createRange();r.moveToElementText(ro);r.collapse(true);r.moveStart('character',b.start);r.moveEnd('character',b.length);}catch(ex2){return true;}}try{r.select();}catch(ex){}return true;}if(!s)return false;if(b.rng){s.removeAllRanges();s.addRange(b.rng);}else{if(is(b.start)&&is(b.end)){try{sd=getPos(ro,b.start,b.end);if(sd){r=t.dom.doc.createRange();r.setStart(sd.startNode,sd.startOffset);r.setEnd(sd.endNode,sd.endOffset);s.removeAllRanges();s.addRange(r);}if(!tinymce.isOpera)t.win.focus();}catch(ex){}}}},select:function(n,c){var t=this,r=t.getRng(),s=t.getSel(),b,fn,ln,d=t.win.document;function first(n){return n?d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode():null;};function last(n){var c,o,w;if(!n)return null;w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(c=w.nextNode())o=c;return o;};if(isIE){try{b=d.body;if(/^(IMG|TABLE)$/.test(n.nodeName)){r=b.createControlRange();r.addElement(n);}else{r=b.createTextRange();r.moveToElementText(n);}r.select();}catch(ex){}}else{if(c){fn=first(n);ln=last(n);if(fn&&ln){r=d.createRange();r.setStart(fn,0);r.setEnd(ln,ln.nodeValue.length);}else r.selectNode(n);}else r.selectNode(n);t.setRng(r);}return n;},isCollapsed:function(){var t=this,r=t.getRng(),s=t.getSel();if(!r||r.item)return false;return!s||r.boundingWidth==0||r.collapsed;},collapse:function(b){var t=this,r=t.getRng(),n;if(r.item){n=r.item(0);r=this.win.document.body.createTextRange();r.moveToElementText(n);}r.collapse(!!b);t.setRng(r);},getSel:function(){var t=this,w=this.win;return w.getSelection?w.getSelection():w.document.selection;},getRng:function(){var t=this,s=t.getSel(),r;try{if(s)r=s.rangeCount>0?s.getRangeAt(0):(s.createRange?s.createRange():t.win.document.createRange());}catch(ex){}if(!r)r=isIE?t.win.document.body.createTextRange():t.win.document.createRange();return r;},setRng:function(r){var s;if(!isIE){s=this.getSel();if(s){s.removeAllRanges();s.addRange(r);}}else{try{r.select();}catch(ex){}}},setNode:function(n){var t=this;t.setContent(t.dom.getOuterHTML(n));return n;},getNode:function(){var t=this,r=t.getRng(),s=t.getSel(),e;if(!isIE){if(!r)return t.dom.getRoot();e=r.commonAncestorContainer;if(!r.collapsed){if(tinymce.isWebKit&&s.anchorNode&&s.anchorNode.nodeType==1)return s.anchorNode.childNodes[s.anchorOffset];if(r.startContainer==r.endContainer){if(r.startOffset-r.endOffset<2){if(r.startContainer.hasChildNodes())e=r.startContainer.childNodes[r.startOffset];}}}return t.dom.getParent(e,function(n){return n.nodeType==1;});}return r.item?r.item(0):r.parentElement();},destroy:function(s){var t=this;t.win=null;if(!s)tinymce.removeUnload(t.destroy);}});})();(function(){tinymce.create('tinymce.dom.XMLWriter',{node:null,XMLWriter:function(s){function getXML(){var i=document.implementation;if(!i||!i.createDocument){try{return new ActiveXObject('MSXML2.DOMDocument');}catch(ex){}try{return new ActiveXObject('Microsoft.XmlDom');}catch(ex){}}else return i.createDocument('','',null);};this.doc=getXML();this.valid=tinymce.isOpera||tinymce.isWebKit;this.reset();},reset:function(){var t=this,d=t.doc;if(d.firstChild)d.removeChild(d.firstChild);t.node=d.appendChild(d.createElement("html"));},writeStartElement:function(n){var t=this;t.node=t.node.appendChild(t.doc.createElement(n));},writeAttribute:function(n,v){if(this.valid)v=v.replace(/>/g,'%MCGT%');this.node.setAttribute(n,v);},writeEndElement:function(){this.node=this.node.parentNode;},writeFullEndElement:function(){var t=this,n=t.node;n.appendChild(t.doc.createTextNode(""));t.node=n.parentNode;},writeText:function(v){if(this.valid)v=v.replace(/>/g,'%MCGT%');this.node.appendChild(this.doc.createTextNode(v));},writeCDATA:function(v){this.node.appendChild(this.doc.createCDATA(v));},writeComment:function(v){if(tinymce.isIE)v=v.replace(/^\-|\-$/g,' ');this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g,' ')));},getContent:function(){var h;h=this.doc.xml||new XMLSerializer().serializeToString(this.doc);h=h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,'');h=h.replace(/ ?\/>/g,' />');if(this.valid)h=h.replace(/\%MCGT%/g,'>');return h;}});})();(function(){tinymce.create('tinymce.dom.StringWriter',{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(s){this.settings=tinymce.extend({indent_char:' ',indentation:1},s);this.reset();},reset:function(){this.indent='';this.str="";this.tags=[];this.count=0;},writeStartElement:function(n){this._writeAttributesEnd();this.writeRaw('<'+n);this.tags.push(n);this.inAttr=true;this.count++;this.elementCount=this.count;},writeAttribute:function(n,v){var t=this;t.writeRaw(" "+t.encode(n)+'="'+t.encode(v)+'"');},writeEndElement:function(){var n;if(this.tags.length>0){n=this.tags.pop();if(this._writeAttributesEnd(1))this.writeRaw('</'+n+'>');if(this.settings.indentation>0)this.writeRaw('\n');}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw('</'+this.tags.pop()+'>');if(this.settings.indentation>0)this.writeRaw('\n');}},writeText:function(v){this._writeAttributesEnd();this.writeRaw(this.encode(v));this.count++;},writeCDATA:function(v){this._writeAttributesEnd();this.writeRaw('<![CDATA['+v+']]>');this.count++;},writeComment:function(v){this._writeAttributesEnd();this.writeRaw('<!-- '+v+'-->');this.count++;},writeRaw:function(v){this.str+=v;},encode:function(s){return s.replace(/[<>&"]/g,function(v){switch(v){case'<':return'<';case'>':return'>';case'&':return'&';case'"':return'"';}return v;});},getContent:function(){return this.str;},_writeAttributesEnd:function(s){if(!this.inAttr)return;this.inAttr=false;if(s&&this.elementCount==this.count){this.writeRaw(' />');return false;}this.writeRaw('>');return true;}});})();(function(){var extend=tinymce.extend,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher,isIE=tinymce.isIE,isGecko=tinymce.isGecko;function getIEAtts(n){var o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;};function wildcardToRE(s){return s.replace(/([?+*])/g,'.$1');};tinymce.create('tinymce.dom.Serializer',{Serializer:function(s){var t=this;t.key=0;t.onPreProcess=new Dispatcher(t);t.onPostProcess=new Dispatcher(t);if(tinymce.relaxedDomain&&tinymce.isGecko){t.writer=new tinymce.dom.StringWriter();}else{try{t.writer=new tinymce.dom.XMLWriter();}catch(ex){t.writer=new tinymce.dom.StringWriter();}}t.settings=s=extend({dom:tinymce.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/(br|hr|input|meta|img|link|param)/,entity_encoding:'named',entities:'160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro',bool_attrs:/(checked|disabled|readonly|selected|nowrap)/,valid_elements:'*[*]',extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:0,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:'simple',indent_char:'\t',indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:'xhtml'},s);t.dom=s.dom;if(s.remove_redundant_brs){t.onPostProcess.add(function(se,o){o.content=o.content.replace(/<br \/>(\s*<\/li>)/g,'$1');});}if(s.element_format=='html'){t.onPostProcess.add(function(se,o){o.content=o.content.replace(/<([^>]+) \/>/g,'<$1>');});}if(s.fix_list_elements){t.onPreProcess.add(function(se,o){var nl,x,a=['ol','ul'],i,n,p,r=/^(OL|UL)$/,np;function prevNode(e,n){var a=n.split(','),i;while((e=e.previousSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e;}}return null;};for(x=0;x<a.length;x++){nl=t.dom.select(a[x],o.node);for(i=0;i<nl.length;i++){n=nl[i];p=n.parentNode;if(r.test(p.nodeName)){np=prevNode(n,'LI');if(!np){np=t.dom.create('li');np.innerHTML=' ';np.appendChild(n);p.insertBefore(np,p.firstChild);}else np.appendChild(n);}}}});}if(s.fix_table_elements){t.onPreProcess.add(function(se,o){each(t.dom.select('table',o.node),function(e){var pa=t.dom.getParent(e,'H1,H2,H3,H4,H5,H6,P'),pa2,n,tm,pl=[],i,ns;if(pa){pa2=pa.cloneNode(false);pl.push(e);for(n=e;n=n.parentNode;){pl.push(n);if(n==pa)break;}tm=pa2;for(i=pl.length-1;i>=0;i--){if(i==pl.length-1){while(ns=pl[i-1].nextSibling)tm.appendChild(ns.parentNode.removeChild(ns));}else{n=pl[i].cloneNode(false);if(i!=0){while(ns=pl[i-1].nextSibling)n.appendChild(ns.parentNode.removeChild(ns));}tm=tm.appendChild(n);}}e=t.dom.insertAfter(e.parentNode.removeChild(e),pa);t.dom.insertAfter(e,pa);t.dom.insertAfter(pa2,e);}});});}},setEntities:function(s){var t=this,a,i,l={},re='',v;if(t.entityLookup)return;a=s.split(',');for(i=0;i<a.length;i+=2){v=a[i];if(v==34||v==38||v==60||v==62)continue;l[String.fromCharCode(a[i])]=a[i+1];v=parseInt(a[i]).toString(16);re+='\\u'+'0000'.substring(v.length)+v;}if(!re){t.settings.entity_encoding='raw';return;}t.entitiesRE=new RegExp('['+re+']','g');t.entityLookup=l;},setValidChildRules:function(s){this.childRules=null;this.addValidChildRules(s);},addValidChildRules:function(s){var t=this,inst,intr,bloc;if(!s)return;inst='A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment';intr='A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment';bloc='H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP';each(s.split(','),function(s){var p=s.split(/\[|\]/),re;s='';each(p[1].split('|'),function(v){if(s)s+='|';switch(v){case'%itrans':v=intr;break;case'%itrans_na':v=intr.substring(2);break;case'%istrict':v=inst;break;case'%istrict_na':v=inst.substring(2);break;case'%btrans':v=bloc;break;case'%bstrict':v=bloc;break;}s+=v;});re=new RegExp('^('+s.toLowerCase()+')$','i');each(p[0].split('/'),function(s){t.childRules=t.childRules||{};t.childRules[s]=re;});});s='';each(t.childRules,function(v,k){if(s)s+='|';s+=k;});t.parentElementsRE=new RegExp('^('+s.toLowerCase()+')$','i');},setRules:function(s){var t=this;t._setup();t.rules={};t.wildRules=[];t.validElements={};return t.addRules(s);},addRules:function(s){var t=this,dr;if(!s)return;t._setup();each(s.split(','),function(s){var p=s.split(/\[|\]/),tn=p[0].split('/'),ra,at,wat,va=[];if(dr)at=tinymce.extend([],dr.attribs);if(p.length>1){each(p[1].split('|'),function(s){var ar={},i;at=at||[];s=s.replace(/::/g,'~');s=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s);s[2]=s[2].replace(/~/g,':');if(s[1]=='!'){ra=ra||[];ra.push(s[2]);}if(s[1]=='-'){for(i=0;i<at.length;i++){if(at[i].name==s[2]){at.splice(i,1);return;}}}switch(s[3]){case'=':ar.defaultVal=s[4]||'';break;case':':ar.forcedVal=s[4];break;case'<':ar.validVals=s[4].split('?');break;}if(/[*.?]/.test(s[2])){wat=wat||[];ar.nameRE=new RegExp('^'+wildcardToRE(s[2])+'$');wat.push(ar);}else{ar.name=s[2];at.push(ar);}va.push(s[2]);});}each(tn,function(s,i){var pr=s.charAt(0),x=1,ru={};if(dr){if(dr.noEmpty)ru.noEmpty=dr.noEmpty;if(dr.fullEnd)ru.fullEnd=dr.fullEnd;if(dr.padd)ru.padd=dr.padd;}switch(pr){case'-':ru.noEmpty=true;break;case'+':ru.fullEnd=true;break;case'#':ru.padd=true;break;default:x=0;}tn[i]=s=s.substring(x);t.validElements[s]=1;if(/[*.?]/.test(tn[0])){ru.nameRE=new RegExp('^'+wildcardToRE(tn[0])+'$');t.wildRules=t.wildRules||{};t.wildRules.push(ru);}else{ru.name=tn[0];if(tn[0]=='@')dr=ru;t.rules[s]=ru;}ru.attribs=at;if(ra)ru.requiredAttribs=ra;if(wat){s='';each(va,function(v){if(s)s+='|';s+='('+wildcardToRE(v)+')';});ru.validAttribsRE=new RegExp('^'+s.toLowerCase()+'$');ru.wildAttribs=wat;}});});s='';each(t.validElements,function(v,k){if(s)s+='|';if(k!='@')s+=k;});t.validElementsRE=new RegExp('^('+wildcardToRE(s.toLowerCase())+')$');},findRule:function(n){var t=this,rl=t.rules,i,r;t._setup();r=rl[n];if(r)return r;rl=t.wildRules;for(i=0;i<rl.length;i++){if(rl[i].nameRE.test(n))return rl[i];}return null;},findAttribRule:function(ru,n){var i,wa=ru.wildAttribs;for(i=0;i<wa.length;i++){if(wa[i].nameRE.test(n))return wa[i];}return null;},serialize:function(n,o){var h,t=this;t._setup();o=o||{};o.format=o.format||'html';t.processObj=o;n=n.cloneNode(true);t.key=''+(parseInt(t.key)+1);if(!o.no_events){o.node=n;t.onPreProcess.dispatch(t,o);}t.writer.reset();t._serializeNode(n,o.getInner);o.content=t.writer.getContent();if(!o.no_events)t.onPostProcess.dispatch(t,o);t._postProcess(o);o.node=null;return tinymce.trim(o.content);},_postProcess:function(o){var t=this,s=t.settings,h=o.content,sc=[],p;if(o.format=='html'){p=t._protect({content:h,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});h=p.content;if(s.entity_encoding!=='raw')h=t._encode(h);if(!o.set){h=h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,s.entity_encoding=='numeric'?'<p$1> </p>':'<p$1> </p>');if(s.remove_linebreaks){h=h.replace(/\r?\n|\r/g,' ');h=h.replace(/(<[^>]+>)\s+/g,'$1 ');h=h.replace(/\s+(<\/[^>]+>)/g,' $1');h=h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,'<$1 $2>');h=h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,'<$1>');h=h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,'</$1>');}if(s.apply_source_formatting&&s.indent_mode=='simple'){h=h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,'\n<$1$2$3>\n');h=h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,'\n<$1$2>');h=h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,'</$1>\n');h=h.replace(/\n\n/g,'\n');}}h=t._unprotect(h,p);h=h.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,'<![CDATA[$1]]>');if(s.entity_encoding=='raw')h=h.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,'<p$1>\u00a0</p>');}o.content=h;},_serializeNode:function(n,inn){var t=this,s=t.settings,w=t.writer,hc,el,cn,i,l,a,at,no,v,nn,ru,ar,iv;if(!s.node_filter||s.node_filter(n)){switch(n.nodeType){case 1:if(n.hasAttribute?n.hasAttribute('mce_bogus'):n.getAttribute('mce_bogus'))return;iv=false;hc=n.hasChildNodes();nn=n.getAttribute('mce_name')||n.nodeName.toLowerCase();if(isIE){if(n.scopeName!=='HTML'&&n.scopeName!=='html')nn=n.scopeName+':'+nn;}if(nn.indexOf('mce:')===0)nn=nn.substring(4);if(!t.validElementsRE.test(nn)||(t.invalidElementsRE&&t.invalidElementsRE.test(nn))||inn){iv=true;break;}if(isIE){if(s.fix_content_duplication){if(n.mce_serialized==t.key)return;n.mce_serialized=t.key;}if(nn.charAt(0)=='/')nn=nn.substring(1);}else if(isGecko){if(n.nodeName==='BR'&&n.getAttribute('type')=='_moz')return;}if(t.childRules){if(t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(nn)){iv=true;break;}}t.elementName=nn;}ru=t.findRule(nn);nn=ru.name||nn;if((!hc&&ru.noEmpty)||(isIE&&!nn)){iv=true;break;}if(ru.requiredAttribs){a=ru.requiredAttribs;for(i=a.length-1;i>=0;i--){if(this.dom.getAttrib(n,a[i])!=='')break;}if(i==-1){iv=true;break;}}w.writeStartElement(nn);if(ru.attribs){for(i=0,at=ru.attribs,l=at.length;i<l;i++){a=at[i];v=t._getAttrib(n,a);if(v!==null)w.writeAttribute(a.name,v);}}if(ru.validAttribsRE){at=isIE?getIEAtts(n):n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified){a=no.nodeName.toLowerCase();if(s.invalid_attrs.test(a)||!ru.validAttribsRE.test(a))continue;ar=t.findAttribRule(ru,a);v=t._getAttrib(n,ar,a);if(v!==null)w.writeAttribute(a,v);}}}if(ru.padd){if(hc&&(cn=n.firstChild)&&cn.nodeType===1&&n.childNodes.length===1){if(cn.hasAttribute?cn.hasAttribute('mce_bogus'):cn.getAttribute('mce_bogus'))w.writeText('\u00a0');}else if(!hc)w.writeText('\u00a0');}break;case 3:if(t.childRules&&t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(n.nodeName))return;}return w.writeText(n.nodeValue);case 4:return w.writeCDATA(n.nodeValue);case 8:return w.writeComment(n.nodeValue);}}else if(n.nodeType==1)hc=n.hasChildNodes();if(hc){cn=n.firstChild;while(cn){t._serializeNode(cn);t.elementName=nn;cn=cn.nextSibling;}}if(!iv){if(hc||!s.closed.test(nn))w.writeFullEndElement();else w.writeEndElement();}},_protect:function(o){var t=this;o.items=o.items||[];function enc(s){return s.replace(/[\r\n\\]/g,function(c){if(c==='\n')return'\\n';else if(c==='\\')return'\\\\';return'\\r';});};function dec(s){return s.replace(/\\[\\rn]/g,function(c){if(c==='\\n')return'\n';else if(c==='\\\\')return'\\';return'\r';});};each(o.patterns,function(p){o.content=dec(enc(o.content).replace(p.pattern,function(x,a,b,c){b=dec(b);if(p.encode)b=t._encode(b);o.items.push(b);return a+'<!--mce:'+(o.items.length-1)+'-->'+c;}));});return o;},_unprotect:function(h,o){h=h.replace(/\<!--mce:([0-9]+)--\>/g,function(a,b){return o.items[parseInt(b)];});o.items=[];return h;},_encode:function(h){var t=this,s=t.settings,l;if(s.entity_encoding!=='raw'){if(s.entity_encoding.indexOf('named')!=-1){t.setEntities(s.entities);l=t.entityLookup;h=h.replace(t.entitiesRE,function(a){var v;if(v=l[a])a='&'+v+';';return a;});}if(s.entity_encoding.indexOf('numeric')!=-1){h=h.replace(/[\u007E-\uFFFF]/g,function(a){return'&#'+a.charCodeAt(0)+';';});}}return h;},_setup:function(){var t=this,s=this.settings;if(t.done)return;t.done=1;t.setRules(s.valid_elements);t.addRules(s.extended_valid_elements);t.addValidChildRules(s.valid_child_elements);if(s.invalid_elements)t.invalidElementsRE=new RegExp('^('+wildcardToRE(s.invalid_elements.replace(/,/g,'|').toLowerCase())+')$');if(s.attrib_value_filter)t.attribValueFilter=s.attribValueFilter;},_getAttrib:function(n,a,na){var i,v;na=na||a.name;if(a.forcedVal&&(v=a.forcedVal)){if(v==='{$uid}')return this.dom.uniqueId();return v;}v=this.dom.getAttrib(n,na);if(this.settings.bool_attrs.test(na)&&v){v=(''+v).toLowerCase();if(v==='false'||v==='0')return null;v=na;}switch(na){case'rowspan':case'colspan':if(v=='1')v='';break;}if(this.attribValueFilter)v=this.attribValueFilter(na,v,n);if(a.validVals){for(i=a.validVals.length-1;i>=0;i--){if(v==a.validVals[i])break;}if(i==-1)return null;}if(v===''&&typeof(a.defaultVal)!='undefined'){v=a.defaultVal;if(v==='{$uid}')return this.dom.uniqueId();return v;}else{if(na=='class'&&this.processObj.get)v=v.replace(/\s?mceItem\w+\s?/g,'');}if(v==='')return null;return v;}});})();(function(){var each=tinymce.each,Event=tinymce.dom.Event;tinymce.create('tinymce.dom.ScriptLoader',{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={};},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0;},markDone:function(u){this.lookup[u]={state:2,url:u};},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2)cb.call(s||this);return o;}o={state:0,url:u,func:cb,scope:s||this};if(pr)t.queue.unshift(o);else t.queue.push(o);lo[u]=o;return o;},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2)cb.call(s||t);return o;}function loadScript(u){if(Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co);}});}else document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"></script>');};if(!tinymce.is(u,'string')){each(u,function(u){loadScript(u);});if(cb)cb.call(s||t);}else{loadScript(u);if(cb)cb.call(s||t);}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb)cb.call(s||t);each(t.queueCallbacks,function(o){o.func.call(o.scope);});});}else if(cb)t.queueCallbacks.push({func:cb,scope:s||t});},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co);}catch(ex){eval(co,w);}}else w.execScript(co);},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func)o.func.call(o.scope||t);};function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--;}else load(o);});if(l===0&&cb){cb.call(s||t);cb=0;}};function load(o){if(o.state>0)return;o.state=1;tinymce.dom.ScriptLoader.loadScript(o.url,function(){done(o);allDone();});};each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o);}else o=lo[u];if(o.state>0)return;if(!Event.domLoaded&&!t.settings.strict_mode){var ix,ol='';if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone();});if(tinymce.isIE)ol=' onreadystatechange="';else ol=' onload="';ol+='tinymce.dom.ScriptLoader._onLoad(this,\''+u+'\','+ix+');"';}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+'></script>');if(!o.func)done(o);}else load(o);});allDone();},'static':{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1;},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=='complete')this._funcs[ix].call(this);},loadScript:function(u,cb){var id=tinymce.DOM.uniqueId(),e;function done(){Event.clear(id);tinymce.DOM.remove(id);if(cb){cb.call(document,u);cb=0;}};if(tinymce.isIE){tinymce.util.XHR.send({url:tinymce._addVer(u),async:false,success:function(co){window.execScript(co);done();}});}else{e=tinymce.DOM.create('script',{id:id,type:'text/javascript',src:tinymce._addVer(u)});Event.add(e,'load',done);(document.getElementsByTagName('head')[0]||document.body).appendChild(e);}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader();})();(function(){var DOM=tinymce.DOM,is=tinymce.is;tinymce.create('tinymce.ui.Control',{Control:function(id,s){this.id=id;this.settings=s=s||{};this.rendered=false;this.onRender=new tinymce.util.Dispatcher(this);this.classPrefix='';this.scope=s.scope||this;this.disabled=0;this.active=0;},setDisabled:function(s){var e;if(s!=this.disabled){e=DOM.get(this.id);if(e&&this.settings.unavailable_prefix){if(s){this.prevTitle=e.title;e.title=this.settings.unavailable_prefix+": "+e.title;}else e.title=this.prevTitle;}this.setState('Disabled',s);this.setState('Enabled',!s);this.disabled=s;}},isDisabled:function(){return this.disabled;},setActive:function(s){if(s!=this.active){this.setState('Active',s);this.active=s;}},isActive:function(){return this.active;},setState:function(c,s){var n=DOM.get(this.id);c=this.classPrefix+c;if(s)DOM.addClass(n,c);else DOM.removeClass(n,c);},isRendered:function(){return this.rendered;},renderHTML:function(){},renderTo:function(n){DOM.setHTML(n,this.renderHTML());},postRender:function(){var t=this,b;if(is(t.disabled)){b=t.disabled;t.disabled=-1;t.setDisabled(b);}if(is(t.active)){b=t.active;t.active=-1;t.setActive(b);}},remove:function(){DOM.remove(this.id);this.destroy();},destroy:function(){tinymce.dom.Event.clear(this.id);}});})();tinymce.create('tinymce.ui.Container:tinymce.ui.Control',{Container:function(id,s){this.parent(id,s);this.controls=[];this.lookup={};},add:function(c){this.lookup[c.id]=c;this.controls.push(c);return c;},get:function(n){return this.lookup[n];}});tinymce.create('tinymce.ui.Separator:tinymce.ui.Control',{Separator:function(id,s){this.parent(id,s);this.classPrefix='mceSeparator';},renderHTML:function(){return tinymce.DOM.createHTML('span',{'class':this.classPrefix});}});(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control',{MenuItem:function(id,s){this.parent(id,s);this.classPrefix='mceMenuItem';},setSelected:function(s){this.setState('Selected',s);this.selected=s;},isSelected:function(){return this.selected;},postRender:function(){var t=this;t.parent();if(is(t.selected))t.setSelected(t.selected);}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem',{Menu:function(id,s){var t=this;t.parent(id,s);t.items={};t.collapsed=false;t.menuCount=0;t.onAddItem=new tinymce.util.Dispatcher(this);},expand:function(d){var t=this;if(d){walk(t,function(o){if(o.expand)o.expand();},'items',t);}t.collapsed=false;},collapse:function(d){var t=this;if(d){walk(t,function(o){if(o.collapse)o.collapse();},'items',t);}t.collapsed=true;},isCollapsed:function(){return this.collapsed;},add:function(o){if(!o.settings)o=new tinymce.ui.MenuItem(o.id||DOM.uniqueId(),o);this.onAddItem.dispatch(this,o);return this.items[o.id]=o;},addSeparator:function(){return this.add({separator:true});},addMenu:function(o){if(!o.collapse)o=this.createMenu(o);this.menuCount++;return this.add(o);},hasMenus:function(){return this.menuCount!==0;},remove:function(o){delete this.items[o.id];},removeAll:function(){var t=this;walk(t,function(o){if(o.removeAll)o.removeAll();else o.remove();o.destroy();},'items',t);t.items={};},createMenu:function(o){var m=new tinymce.ui.Menu(o.id||DOM.uniqueId(),o);m.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return m;}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,Event=tinymce.dom.Event,Element=tinymce.dom.Element;tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu',{DropMenu:function(id,s){s=s||{};s.container=s.container||DOM.doc.body;s.offset_x=s.offset_x||0;s.offset_y=s.offset_y||0;s.vp_offset_x=s.vp_offset_x||0;s.vp_offset_y=s.vp_offset_y||0;if(is(s.icons)&&!s.icons)s['class']+=' mceNoIcons';this.parent(id,s);this.onShowMenu=new tinymce.util.Dispatcher(this);this.onHideMenu=new tinymce.util.Dispatcher(this);this.classPrefix='mceMenu';},createMenu:function(s){var t=this,cs=t.settings,m;s.container=s.container||cs.container;s.parent=t;s.constrain=s.constrain||cs.constrain;s['class']=s['class']||cs['class'];s.vp_offset_x=s.vp_offset_x||cs.vp_offset_x;s.vp_offset_y=s.vp_offset_y||cs.vp_offset_y;m=new tinymce.ui.DropMenu(s.id||DOM.uniqueId(),s);m.onAddItem.add(t.onAddItem.dispatch,t.onAddItem);return m;},update:function(){var t=this,s=t.settings,tb=DOM.get('menu_'+t.id+'_tbl'),co=DOM.get('menu_'+t.id+'_co'),tw,th;tw=s.max_width?Math.min(tb.clientWidth,s.max_width):tb.clientWidth;th=s.max_height?Math.min(tb.clientHeight,s.max_height):tb.clientHeight;if(!DOM.boxModel)t.element.setStyles({width:tw+2,height:th+2});else t.element.setStyles({width:tw,height:th});if(s.max_width)DOM.setStyle(co,'width',tw);if(s.max_height){DOM.setStyle(co,'height',th);if(tb.clientHeight<s.max_height)DOM.setStyle(co,'overflow','hidden');}},showMenu:function(x,y,px){var t=this,s=t.settings,co,vp=DOM.getViewPort(),w,h,mx,my,ot=2,dm,tb,cp=t.classPrefix;t.collapse(1);if(t.isMenuVisible)return;if(!t.rendered){co=DOM.add(t.settings.container,t.renderNode());each(t.items,function(o){o.postRender();});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});}else co=DOM.get('menu_'+t.id);if(!tinymce.isOpera)DOM.setStyles(co,{left:-0xFFFF,top:-0xFFFF});DOM.show(co);t.update();x+=s.offset_x||0;y+=s.offset_y||0;vp.w-=4;vp.h-=4;if(s.constrain){w=co.clientWidth-ot;h=co.clientHeight-ot;mx=vp.x+vp.w;my=vp.y+vp.h;if((x+s.vp_offset_x+w)>mx)x=px?px-w:Math.max(0,(mx-s.vp_offset_x)-w);if((y+s.vp_offset_y+h)>my)y=Math.max(0,(my-s.vp_offset_y)-h);}DOM.setStyles(co,{left:x,top:y});t.element.update();t.isMenuVisible=1;t.mouseClickFunc=Event.add(co,'click',function(e){var m;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))&&!DOM.hasClass(e,cp+'ItemSub')){m=t.items[e.id];if(m.isDisabled())return;dm=t;while(dm){if(dm.hideMenu)dm.hideMenu();dm=dm.settings.parent;}if(m.settings.onclick)m.settings.onclick(e);return Event.cancel(e);}});if(t.hasMenus()){t.mouseOverFunc=Event.add(co,'mouseover',function(e){var m,r,mi;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))){m=t.items[e.id];if(t.lastMenu)t.lastMenu.collapse(1);if(m.isDisabled())return;if(e&&DOM.hasClass(e,cp+'ItemSub')){r=DOM.getRect(e);m.showMenu((r.x+r.w-ot),r.y-ot,r.x);t.lastMenu=m;DOM.addClass(DOM.get(m.id).firstChild,cp+'ItemActive');}}});}t.onShowMenu.dispatch(t);if(s.keyboard_focus){Event.add(co,'keydown',t._keyHandler,t);DOM.select('a','menu_'+t.id)[0].focus();t._focusIdx=0;}},hideMenu:function(c){var t=this,co=DOM.get('menu_'+t.id),e;if(!t.isMenuVisible)return;Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);Event.remove(co,'keydown',t._keyHandler);DOM.hide(co);t.isMenuVisible=0;if(!c)t.collapse(1);if(t.element)t.element.hide();if(e=DOM.get(t.id))DOM.removeClass(e.firstChild,t.classPrefix+'ItemActive');t.onHideMenu.dispatch(t);},add:function(o){var t=this,co;o=t.parent(o);if(t.isRendered&&(co=DOM.get('menu_'+t.id)))t._add(DOM.select('tbody',co)[0],o);return o;},collapse:function(d){this.parent(d);this.hideMenu(1);},remove:function(o){DOM.remove(o.id);this.destroy();return this.parent(o);},destroy:function(){var t=this,co=DOM.get('menu_'+t.id);Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);if(t.element)t.element.remove();DOM.remove(co);},renderNode:function(){var t=this,s=t.settings,n,tb,co,w;w=DOM.create('div',{id:'menu_'+t.id,'class':s['class'],'style':'position:absolute;left:0;top:0;z-index:200000'});co=DOM.add(w,'div',{id:'menu_'+t.id+'_co','class':t.classPrefix+(s['class']?' '+s['class']:'')});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});if(s.menu_line)DOM.add(co,'span',{'class':t.classPrefix+'Line'});n=DOM.add(co,'table',{id:'menu_'+t.id+'_tbl',border:0,cellPadding:0,cellSpacing:0});tb=DOM.add(n,'tbody');each(t.items,function(o){t._add(tb,o);});t.rendered=true;return w;},_keyHandler:function(e){var t=this,kc=e.keyCode;function focus(d){var i=t._focusIdx+d,e=DOM.select('a','menu_'+t.id)[i];if(e){t._focusIdx=i;e.focus();}};switch(kc){case 38:focus(-1);return;case 40:focus(1);return;case 13:return;case 27:return this.hideMenu();}},_add:function(tb,o){var n,s=o.settings,a,ro,it,cp=this.classPrefix,ic;if(s.separator){ro=DOM.add(tb,'tr',{id:o.id,'class':cp+'ItemSeparator'});DOM.add(ro,'td',{'class':cp+'ItemSeparator'});if(n=ro.previousSibling)DOM.addClass(n,'mceLast');return;}n=ro=DOM.add(tb,'tr',{id:o.id,'class':cp+'Item '+cp+'ItemEnabled'});n=it=DOM.add(n,'td');n=a=DOM.add(n,'a',{href:'javascript:;',onclick:"return false;",onmousedown:'return false;'});DOM.addClass(it,s['class']);ic=DOM.add(n,'span',{'class':'mceIcon'+(s.icon?' mce_'+s.icon:'')});if(s.icon_src)DOM.add(ic,'img',{src:s.icon_src});n=DOM.add(n,s.element||'span',{'class':'mceText',title:o.settings.title},o.settings.title);if(o.settings.style)DOM.setAttrib(n,'style',o.settings.style);if(tb.childNodes.length==1)DOM.addClass(ro,'mceFirst');if((n=ro.previousSibling)&&DOM.hasClass(n,cp+'ItemSeparator'))DOM.addClass(ro,'mceFirst');if(o.collapse)DOM.addClass(ro,cp+'ItemSub');if(n=ro.previousSibling)DOM.removeClass(n,'mceLast');DOM.addClass(ro,'mceLast');}});})();(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.ui.Button:tinymce.ui.Control',{Button:function(id,s){this.parent(id,s);this.classPrefix='mceButton';},renderHTML:function(){var cp=this.classPrefix,s=this.settings,h,l;l=DOM.encode(s.label||'');h='<a id="'+this.id+'" href="javascript:;" class="'+cp+' '+cp+'Enabled '+s['class']+(l?' '+cp+'Labeled':'')+'" onmousedown="return false;" onclick="return false;" title="'+DOM.encode(s.title)+'">';if(s.image)h+='<img class="mceIcon" src="'+s.image+'" />'+l+'</a>';else h+='<span class="mceIcon '+s['class']+'"></span>'+(l?'<span class="'+cp+'Label">'+l+'</span>':'')+'</a>';return h;},postRender:function(){var t=this,s=t.settings;tinymce.dom.Event.add(t.id,'click',function(e){if(!t.isDisabled())return s.onclick.call(s.scope,e);});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control',{ListBox:function(id,s){var t=this;t.parent(id,s);t.items=[];t.onChange=new Dispatcher(t);t.onPostRender=new Dispatcher(t);t.onAdd=new Dispatcher(t);t.onRenderMenu=new tinymce.util.Dispatcher(this);t.classPrefix='mceListBox';},select:function(va){var t=this,fv,f;if(va==undefined)return t.selectByIndex(-1);if(va&&va.call)f=va;else{f=function(v){return v==va;};}if(va!=t.selectedValue){each(t.items,function(o,i){if(f(o.value)){fv=1;t.selectByIndex(i);return false;}});if(!fv)t.selectByIndex(-1);}},selectByIndex:function(idx){var t=this,e,o;if(idx!=t.selectedIndex){e=DOM.get(t.id+'_text');o=t.items[idx];if(o){t.selectedValue=o.value;t.selectedIndex=idx;DOM.setHTML(e,DOM.encode(o.title));DOM.removeClass(e,'mceTitle');}else{DOM.setHTML(e,DOM.encode(t.settings.title));DOM.addClass(e,'mceTitle');t.selectedValue=t.selectedIndex=null;}e=0;}else t.selectedValue=t.selectedIndex=null;},add:function(n,v,o){var t=this;o=o||{};o=tinymce.extend(o,{title:n,value:v});t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return this.items.length;},renderHTML:function(){var h='',t=this,s=t.settings,cp=t.classPrefix;h='<table id="'+t.id+'" cellpadding="0" cellspacing="0" class="'+cp+' '+cp+'Enabled'+(s['class']?(' '+s['class']):'')+'"><tbody><tr>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_text',href:'javascript:;','class':'mceText',onclick:"return false;",onmousedown:'return false;'},DOM.encode(t.settings.title))+'</td>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',tabindex:-1,href:'javascript:;','class':'mceOpen',onclick:"return false;",onmousedown:'return false;'},'<span></span>')+'</td>';h+='</tr></tbody></table>';return h;},showMenu:function(){var t=this,p1,p2,e=DOM.get(this.id),m;if(t.isDisabled()||t.items.length==0)return;if(t.menu&&t.menu.isMenuVisible)return t.hideMenu();if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}p1=DOM.getPos(this.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.keyboard_focus=!tinymce.isOpera;if(t.oldID)m.items[t.oldID].setSelected(0);each(t.items,function(o){if(o.value===t.selectedValue){m.items[o.id].setSelected(1);t.oldID=o.id;}});m.showMenu(0,e.clientHeight);Event.add(DOM.doc,'mousedown',t.hideMenu,t);DOM.addClass(t.id,t.classPrefix+'Selected');},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&(e.target.id==t.id+'_text'||e.target.id==t.id+'_open'))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){DOM.removeClass(t.id,t.classPrefix+'Selected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':t.classPrefix+'Menu mceNoIcons',max_width:150,max_height:150});m.onHideMenu.add(t.hideMenu,t);m.add({title:t.settings.title,'class':'mceMenuItemTitle',onclick:function(){if(t.settings.onselect('')!==false)t.select('');}});each(t.items,function(o){o.id=DOM.uniqueId();o.onclick=function(){if(t.settings.onselect(o.value)!==false)t.select(o.value);};m.add(o);});t.onRenderMenu.dispatch(t,m);t.menu=m;},postRender:function(){var t=this,cp=t.classPrefix;Event.add(t.id,'click',t.showMenu,t);Event.add(t.id+'_text','focus',function(e){if(!t._focused){t.keyDownHandler=Event.add(t.id+'_text','keydown',function(e){var idx=-1,v,kc=e.keyCode;each(t.items,function(v,i){if(t.selectedValue==v.value)idx=i;});if(kc==38)v=t.items[idx-1];else if(kc==40)v=t.items[idx+1];else if(kc==13){v=t.selectedValue;t.selectedValue=null;t.settings.onselect(v);return Event.cancel(e);}if(v){t.hideMenu();t.select(v.value);}});}t._focused=1;});Event.add(t.id+'_text','blur',function(){Event.remove(t.id+'_text','keydown',t.keyDownHandler);t._focused=0;});if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,cp+'Disabled'))DOM.addClass(t.id,cp+'Hover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,cp+'Disabled'))DOM.removeClass(t.id,cp+'Hover');});}t.onPostRender.dispatch(t,DOM.get(t.id));},destroy:function(){this.parent();Event.clear(this.id+'_text');}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox',{NativeListBox:function(id,s){this.parent(id,s);this.classPrefix='mceNativeListBox';},setDisabled:function(s){DOM.get(this.id).disabled=s;},isDisabled:function(){return DOM.get(this.id).disabled;},select:function(va){var t=this,fv,f;if(va==undefined)return t.selectByIndex(-1);if(va&&va.call)f=va;else{f=function(v){return v==va;};}if(va!=t.selectedValue){each(t.items,function(o,i){if(f(o.value)){fv=1;t.selectByIndex(i);return false;}});if(!fv)t.selectByIndex(-1);}},selectByIndex:function(idx){DOM.get(this.id).selectedIndex=idx+1;this.selectedValue=this.items[idx]?this.items[idx].value:null;},add:function(n,v,a){var o,t=this;a=a||{};a.value=v;if(t.isRendered())DOM.add(DOM.get(this.id),'option',a,n);o={title:n,value:v,attribs:a};t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return DOM.get(this.id).options.length-1;},renderHTML:function(){var h,t=this;h=DOM.createHTML('option',{value:''},'-- '+t.settings.title+' --');each(t.items,function(it){h+=DOM.createHTML('option',{value:it.value},it.title);});h=DOM.createHTML('select',{id:t.id,'class':'mceNativeListBox'},h);return h;},postRender:function(){var t=this,ch;t.rendered=true;function onChange(e){var v=t.items[e.target.selectedIndex-1];if(v&&(v=v.value)){t.onChange.dispatch(t,v);if(t.settings.onselect)t.settings.onselect(v);}};Event.add(t.id,'change',onChange);Event.add(t.id,'keydown',function(e){var bf;Event.remove(t.id,'change',ch);bf=Event.add(t.id,'blur',function(){Event.add(t.id,'change',onChange);Event.remove(t.id,'blur',bf);});if(e.keyCode==13||e.keyCode==32){onChange(e);return Event.cancel(e);}});t.onPostRender.dispatch(t,DOM.get(t.id));}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button',{MenuButton:function(id,s){this.parent(id,s);this.onRenderMenu=new tinymce.util.Dispatcher(this);s.menu_container=s.menu_container||DOM.doc.body;},showMenu:function(){var t=this,p1,p2,e=DOM.get(t.id),m;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}if(t.isMenuVisible)return t.hideMenu();p1=DOM.getPos(t.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.vp_offset_x=p2.x;m.settings.vp_offset_y=p2.y;m.settings.keyboard_focus=t._focused;m.showMenu(0,e.clientHeight);Event.add(DOM.doc,'mousedown',t.hideMenu,t);t.setState('Selected',1);t.isMenuVisible=1;},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':this.classPrefix+'Menu',icons:t.settings.icons});m.onHideMenu.add(t.hideMenu,t);t.onRenderMenu.dispatch(t,m);t.menu=m;},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id||e.id===t.id+'_open';}))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){t.setState('Selected',0);Event.remove(DOM.doc,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}t.isMenuVisible=0;},postRender:function(){var t=this,s=t.settings;Event.add(t.id,'click',function(){if(!t.isDisabled()){if(s.onclick)s.onclick(t.value);t.showMenu();}});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton',{SplitButton:function(id,s){this.parent(id,s);this.classPrefix='mceSplitButton';},renderHTML:function(){var h,t=this,s=t.settings,h1;h='<tbody><tr>';if(s.image)h1=DOM.createHTML('img ',{src:s.image,'class':'mceAction '+s['class']});else h1=DOM.createHTML('span',{'class':'mceAction '+s['class']},'');h+='<td>'+DOM.createHTML('a',{id:t.id+'_action',href:'javascript:;','class':'mceAction '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h1=DOM.createHTML('span',{'class':'mceOpen '+s['class']});h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',href:'javascript:;','class':'mceOpen '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h+='</tr></tbody>';return DOM.createHTML('table',{id:t.id,'class':'mceSplitButton mceSplitButtonEnabled '+s['class'],cellpadding:'0',cellspacing:'0',onmousedown:'return false;',title:s.title},h);},postRender:function(){var t=this,s=t.settings;if(s.onclick){Event.add(t.id+'_action','click',function(){if(!t.isDisabled())s.onclick(t.value);});}Event.add(t.id+'_open','click',t.showMenu,t);Event.add(t.id+'_open','focus',function(){t._focused=1;});Event.add(t.id+'_open','blur',function(){t._focused=0;});if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.addClass(t.id,'mceSplitButtonHover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.removeClass(t.id,'mceSplitButtonHover');});}},destroy:function(){this.parent();Event.clear(this.id+'_action');Event.clear(this.id+'_open');}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton',{ColorSplitButton:function(id,s){var t=this;t.parent(id,s);t.settings=s=tinymce.extend({colors:'000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',grid_width:8,default_color:'#888888'},t.settings);t.onShowMenu=new tinymce.util.Dispatcher(t);t.onHideMenu=new tinymce.util.Dispatcher(t);t.value=s.default_color;},showMenu:function(){var t=this,r,p,e,p2;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}if(t.isMenuVisible)return t.hideMenu();e=DOM.get(t.id);DOM.show(t.id+'_menu');DOM.addClass(e,'mceSplitButtonSelected');p2=DOM.getPos(e);DOM.setStyles(t.id+'_menu',{left:p2.x,top:p2.y+e.clientHeight,zIndex:200000});e=0;Event.add(DOM.doc,'mousedown',t.hideMenu,t);if(t._focused){t._keyHandler=Event.add(t.id+'_menu','keydown',function(e){if(e.keyCode==27)t.hideMenu();});DOM.select('a',t.id+'_menu')[0].focus();}t.onShowMenu.dispatch(t);t.isMenuVisible=1;},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id+'_open';}))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceSplitButtonMenu');})){DOM.removeClass(t.id,'mceSplitButtonSelected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);Event.remove(t.id+'_menu','keydown',t._keyHandler);DOM.hide(t.id+'_menu');}t.onHideMenu.dispatch(t);t.isMenuVisible=0;},renderMenu:function(){var t=this,m,i=0,s=t.settings,n,tb,tr,w;w=DOM.add(s.menu_container,'div',{id:t.id+'_menu','class':s['menu_class']+' '+s['class'],style:'position:absolute;left:0;top:-1000px;'});m=DOM.add(w,'div',{'class':s['class']+' mceSplitButtonMenu'});DOM.add(m,'span',{'class':'mceMenuLine'});n=DOM.add(m,'table',{'class':'mceColorSplitMenu'});tb=DOM.add(n,'tbody');i=0;each(is(s.colors,'array')?s.colors:s.colors.split(','),function(c){c=c.replace(/^#/,'');if(!i--){tr=DOM.add(tb,'tr');i=s.grid_width-1;}n=DOM.add(tr,'td');n=DOM.add(n,'a',{href:'javascript:;',style:{backgroundColor:'#'+c},mce_color:'#'+c});});if(s.more_colors_func){n=DOM.add(tb,'tr');n=DOM.add(n,'td',{colspan:s.grid_width,'class':'mceMoreColors'});n=DOM.add(n,'a',{id:t.id+'_more',href:'javascript:;',onclick:'return false;','class':'mceMoreColors'},s.more_colors_title);Event.add(n,'click',function(e){s.more_colors_func.call(s.more_colors_scope||this);return Event.cancel(e);});}DOM.addClass(m,'mceColorSplitMenu');Event.add(t.id+'_menu','click',function(e){var c;e=e.target;if(e.nodeName=='A'&&(c=e.getAttribute('mce_color')))t.setColor(c);return Event.cancel(e);});return w;},setColor:function(c){var t=this;DOM.setStyle(t.id+'_preview','backgroundColor',c);t.value=c;t.hideMenu();t.settings.onselect(c);},postRender:function(){var t=this,id=t.id;t.parent();DOM.add(id+'_action','div',{id:id+'_preview','class':'mceColorPreview'});DOM.setStyle(t.id+'_preview','backgroundColor',t.value);},destroy:function(){this.parent();Event.clear(this.id+'_menu');Event.clear(this.id+'_more');DOM.remove(this.id+'_menu');}});})();tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container',{renderHTML:function(){var t=this,h='',c,co,dom=tinymce.DOM,s=t.settings,i,pr,nx,cl;cl=t.controls;for(i=0;i<cl.length;i++){co=cl[i];pr=cl[i-1];nx=cl[i+1];if(i===0){c='mceToolbarStart';if(co.Button)c+=' mceToolbarStartButton';else if(co.SplitButton)c+=' mceToolbarStartSplitButton';else if(co.ListBox)c+=' mceToolbarStartListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));}if(pr&&co.ListBox){if(pr.Button||pr.SplitButton)h+=dom.createHTML('td',{'class':'mceToolbarEnd'},dom.createHTML('span',null,'<!-- IE -->'));}if(dom.stdMode)h+='<td style="position: relative">'+co.renderHTML()+'</td>';else h+='<td>'+co.renderHTML()+'</td>';if(nx&&co.ListBox){if(nx.Button||nx.SplitButton)h+=dom.createHTML('td',{'class':'mceToolbarStart'},dom.createHTML('span',null,'<!-- IE -->'));}}c='mceToolbarEnd';if(co.Button)c+=' mceToolbarEndButton';else if(co.SplitButton)c+=' mceToolbarEndSplitButton';else if(co.ListBox)c+=' mceToolbarEndListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));return dom.createHTML('table',{id:t.id,'class':'mceToolbar'+(s['class']?' '+s['class']:''),cellpadding:'0',cellspacing:'0',align:t.settings.align||''},'<tbody><tr>'+h+'</tr></tbody>');}});(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each;tinymce.create('tinymce.AddOnManager',{items:[],urls:{},lookup:{},onAdd:new Dispatcher(this),get:function(n){return this.lookup[n];},requireLangPack:function(n){var u,s=tinymce.EditorManager.settings;if(s&&s.language){u=this.urls[n]+'/langs/'+s.language+'.js';if(!tinymce.dom.Event.domLoaded&&!s.strict_mode)tinymce.ScriptLoader.load(u);else tinymce.ScriptLoader.add(u);}},add:function(id,o){this.items.push(o);this.lookup[id]=o;this.onAdd.dispatch(this,id,o);return o;},load:function(n,u,cb,s){var t=this;if(t.urls[n])return;if(u.indexOf('/')!=0&&u.indexOf('://')==-1)u=tinymce.baseURL+'/'+u;t.urls[n]=u.substring(0,u.lastIndexOf('/'));tinymce.ScriptLoader.add(u,cb,s);}});tinymce.PluginManager=new tinymce.AddOnManager();tinymce.ThemeManager=new tinymce.AddOnManager();}());(function(){var each=tinymce.each,extend=tinymce.extend,DOM=tinymce.DOM,Event=tinymce.dom.Event,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,explode=tinymce.explode;tinymce.create('static tinymce.EditorManager',{editors:{},i18n:{},activeEditor:null,preInit:function(){var t=this,lo=window.location;tinymce.documentBaseURL=lo.href.replace(/[\?#].*$/,'').replace(/[\/\\][^\/]+$/,'');if(!/[\/\\]$/.test(tinymce.documentBaseURL))tinymce.documentBaseURL+='/';tinymce.baseURL=new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);tinymce.EditorManager.baseURI=new tinymce.util.URI(tinymce.baseURL);if(document.domain&&lo.hostname!=document.domain)tinymce.relaxedDomain=document.domain;if(!tinymce.relaxedDomain&&tinymce.EditorManager.baseURI.host!=lo.hostname&&lo.hostname)document.domain=tinymce.relaxedDomain=lo.hostname.replace(/.*\.(.+\..+)$/,'$1');t.onBeforeUnload=new tinymce.util.Dispatcher(t);Event.add(window,'beforeunload',function(e){t.onBeforeUnload.dispatch(t,e);});},init:function(s){var t=this,pl,sl=tinymce.ScriptLoader,c,e,el=[],ed;function execCallback(se,n,s){var f=se[n];if(!f)return;if(tinymce.is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);}return f.apply(s||this,Array.prototype.slice.call(arguments,2));};s=extend({theme:"simple",language:"en",strict_loading_mode:document.contentType=='application/xhtml+xml'},s);t.settings=s;if(!Event.domLoaded&&!s.strict_loading_mode){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme&&s.theme.charAt(0)!='-'&&!ThemeManager.urls[s.theme])ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');if(s.plugins){pl=explode(s.plugins);if(tinymce.inArray(pl,'compat2x')!=-1)PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');each(pl,function(v){if(v&&v.charAt(0)!='-'&&!PluginManager.urls[v]){if(!tinymce.isWebKit&&v=='safari')return;PluginManager.load(v,'plugins/'+v+'/editor_plugin'+tinymce.suffix+'.js');}});}sl.loadQueue();}Event.add(document,'init',function(){var l,co;execCallback(s,'onpageload');if(s.browsers){l=false;each(explode(s.browsers),function(v){switch(v){case'ie':case'msie':if(tinymce.isIE)l=true;break;case'gecko':if(tinymce.isGecko)l=true;break;case'safari':case'webkit':if(tinymce.isWebKit)l=true;break;case'opera':if(tinymce.isOpera)l=true;break;}});if(!l)return;}switch(s.mode){case"exact":l=s.elements||'';if(l.length>0){each(explode(l),function(v){if(DOM.get(v)){ed=new tinymce.Editor(v,s);el.push(ed);ed.render(1);}else{c=0;each(document.forms,function(f){each(f.elements,function(e){if(e.name===v){v='mce_editor_'+c;DOM.setAttrib(e,'id',v);ed=new tinymce.Editor(v,s);el.push(ed);ed.render(1);}});});}});}break;case"textareas":case"specific_textareas":function hasClass(n,c){return c.constructor===RegExp?c.test(n.className):DOM.hasClass(n,c);};each(DOM.select('textarea'),function(v){if(s.editor_deselector&&hasClass(v,s.editor_deselector))return;if(!s.editor_selector||hasClass(v,s.editor_selector)){e=DOM.get(v.name);if(!v.id&&!e)v.id=v.name;if(!v.id||t.get(v.id))v.id=DOM.uniqueId();ed=new tinymce.Editor(v.id,s);el.push(ed);ed.render(1);}});break;}if(s.oninit){l=co=0;each(el,function(ed){co++;if(!ed.initialized){ed.onInit.add(function(){l++;if(l==co)execCallback(s,'oninit');});}else l++;if(l==co)execCallback(s,'oninit');});}});},get:function(id){return this.editors[id];},getInstanceById:function(id){return this.get(id);},add:function(e){this.editors[e.id]=e;this._setActive(e);return e;},remove:function(e){var t=this;if(!t.editors[e.id])return null;delete t.editors[e.id];if(t.activeEditor==e){each(t.editors,function(e){t._setActive(e);return false;});}e.destroy();return e;},execCommand:function(c,u,v){var t=this,ed=t.get(v),w;switch(c){case"mceFocus":ed.focus();return true;case"mceAddEditor":case"mceAddControl":if(!t.get(v))new tinymce.Editor(v,t.settings).render();return true;case"mceAddFrameControl":w=v.window;w.tinyMCE=tinyMCE;w.tinymce=tinymce;tinymce.DOM.doc=w.document;tinymce.DOM.win=w;ed=new tinymce.Editor(v.element_id,v);ed.render();if(tinymce.isIE){function clr(){ed.destroy();w.detachEvent('onunload',clr);w=w.tinyMCE=w.tinymce=null;};w.attachEvent('onunload',clr);}v.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(ed)ed.remove();return true;case'mceToggleEditor':if(!ed){t.execCommand('mceAddControl',0,v);return true;}if(ed.isHidden())ed.show();else ed.hide();return true;}if(t.activeEditor)return t.activeEditor.execCommand(c,u,v);return false;},execInstanceCommand:function(id,c,u,v){var ed=this.get(id);if(ed)return ed.execCommand(c,u,v);return false;},triggerSave:function(){each(this.editors,function(e){e.save();});},addI18n:function(p,o){var lo,i18n=this.i18n;if(!tinymce.is(p,'string')){each(p,function(o,lc){each(o,function(o,g){each(o,function(o,k){if(g==='common')i18n[lc+'.'+k]=o;else i18n[lc+'.'+g+'.'+k]=o;});});});}else{each(o,function(o,k){i18n[p+'.'+k]=o;});}},_setActive:function(e){this.selectedInstance=this.activeEditor=e;}});tinymce.EditorManager.preInit();})();var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,Dispatcher=tinymce.util.Dispatcher;var each=tinymce.each,isGecko=tinymce.isGecko,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit;var is=tinymce.is,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,EditorManager=tinymce.EditorManager;var inArray=tinymce.inArray,grep=tinymce.grep,explode=tinymce.explode;tinymce.create('tinymce.Editor',{Editor:function(id,s){var t=this;t.id=t.editorId=id;t.execCommands={};t.queryStateCommands={};t.queryValueCommands={};t.plugins={};each(['onPreInit','onBeforeRenderUI','onPostRender','onInit','onRemove','onActivate','onDeactivate','onClick','onEvent','onMouseUp','onMouseDown','onDblClick','onKeyDown','onKeyUp','onKeyPress','onContextMenu','onSubmit','onReset','onPaste','onPreProcess','onPostProcess','onBeforeSetContent','onBeforeGetContent','onSetContent','onGetContent','onLoadContent','onSaveContent','onNodeChange','onChange','onBeforeExecCommand','onExecCommand','onUndo','onRedo','onVisualAid','onSetProgressState'],function(e){t[e]=new Dispatcher(t);});t.settings=s=extend({id:id,language:'en',docs_language:'en',theme:'simple',skin:'default',delta_width:0,delta_height:0,popup_css:'',plugins:'',document_base_url:tinymce.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:'mceItemTable',visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:'xx-small,x-small,small,medium,large,x-large,xx-large',apply_source_formatting:1,directionality:'ltr',forced_root_block:'p',valid_elements:'@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:'30px',keep_styles:1},s);t.documentBaseURI=new tinymce.util.URI(s.document_base_url||tinymce.documentBaseURL,{base_uri:tinyMCE.baseURI});t.baseURI=EditorManager.baseURI;t.execCallback('setup',t);},render:function(nst){var t=this,s=t.settings,id=t.id,sl=tinymce.ScriptLoader;if(!Event.domLoaded){Event.add(document,'init',function(){t.render();});return;}if(!nst){s.strict_loading_mode=1;tinyMCE.settings=s;}if(!t.getElement())return;if(s.strict_loading_mode){sl.settings.strict_mode=s.strict_loading_mode;tinymce.DOM.settings.strict=1;}if(!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&s.hidden_input&&DOM.getParent(id,'form'))DOM.insertAfter(DOM.create('input',{type:'hidden',name:id}),id);t.windowManager=new tinymce.WindowManager(t);if(s.encoding=='xml'){t.onGetContent.add(function(ed,o){if(o.save)o.content=DOM.encode(o.content);});}if(s.add_form_submit_trigger){t.onSubmit.addToTop(function(){if(t.initialized){t.save();t.isNotDirty=1;}});}if(s.add_unload_trigger&&!s.ask){t._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(t.initialized&&!t.destroyed&&!t.isHidden())t.save({format:'raw',no_events:true});});}tinymce.addUnload(t.destroy,t);if(s.submit_patch){t.onBeforeRenderUI.add(function(){var n=t.getElement().form;if(!n)return;if(n._mceOldSubmit)return;if(!n.submit.nodeType&&!n.submit.length){t.formElement=n;n._mceOldSubmit=n.submit;n.submit=function(){EditorManager.triggerSave();t.isNotDirty=1;return this._mceOldSubmit(this);};}n=null;});}function loadScripts(){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme.charAt(0)!='-'&&!ThemeManager.urls[s.theme])ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');each(explode(s.plugins),function(p){if(p&&p.charAt(0)!='-'&&!PluginManager.urls[p]){if(!isWebKit&&p=='safari')return;PluginManager.load(p,'plugins/'+p+'/editor_plugin'+tinymce.suffix+'.js');}});sl.loadQueue(function(){if(s.ask){function ask(){window.setTimeout(function(){Event.remove(t.id,'focus',ask);t.windowManager.confirm(t.getLang('edit_confirm'),function(s){if(s)t.init();});},0);};Event.add(t.id,'focus',ask);return;}if(!t.removed)t.init();});};if(s.plugins.indexOf('compat2x')!=-1){PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');sl.loadQueue(loadScripts);}else loadScripts();},init:function(){var n,t=this,s=t.settings,w,h,e=t.getElement(),o,ti,u,bi,bc,re;EditorManager.add(t);s.theme=s.theme.replace(/-/,'');o=ThemeManager.get(s.theme);t.theme=new o();if(t.theme.init&&s.init_theme)t.theme.init(t,ThemeManager.urls[s.theme]||tinymce.documentBaseURL.replace(/\/$/,''));each(explode(s.plugins.replace(/\-/g,'')),function(p){var c=PluginManager.get(p),u=PluginManager.urls[p]||tinymce.documentBaseURL.replace(/\/$/,''),po;if(c){po=new c(t,u);t.plugins[p]=po;if(po.init)po.init(t,u);}});if(s.popup_css!==false){if(s.popup_css)s.popup_css=t.documentBaseURI.toAbsolute(s.popup_css);else s.popup_css=t.baseURI.toAbsolute("themes/"+s.theme+"/skins/"+s.skin+"/dialog.css");}if(s.popup_css_add)s.popup_css+=','+t.documentBaseURI.toAbsolute(s.popup_css_add);t.controlManager=new tinymce.ControlManager(t);t.undoManager=new tinymce.UndoManager(t);t.undoManager.onAdd.add(function(um,l){if(!l.initial)return t.onChange.dispatch(t,l,um);});t.undoManager.onUndo.add(function(um,l){return t.onUndo.dispatch(t,l,um);});t.undoManager.onRedo.add(function(um,l){return t.onRedo.dispatch(t,l,um);});if(s.custom_undo_redo){t.onExecCommand.add(function(ed,cmd,ui,val,a){if(cmd!='Undo'&&cmd!='Redo'&&cmd!='mceRepaint'&&(!a||!a.skip_undo))t.undoManager.add();});}t.onExecCommand.add(function(ed,c){if(!/^(FontName|FontSize)$/.test(c))t.nodeChanged();});if(isGecko){function repaint(a,o){if(!o||!o.initial)t.execCommand('mceRepaint');};t.onUndo.add(repaint);t.onRedo.add(repaint);t.onSetContent.add(repaint);}t.onBeforeRenderUI.dispatch(t,t.controlManager);if(s.render_ui){w=s.width||e.style.width||e.offsetWidth;h=s.height||e.style.height||e.offsetHeight;t.orgDisplay=e.style.display;re=/^[0-9\.]+(|px)$/i;if(re.test(''+w))w=Math.max(parseInt(w)+(o.deltaWidth||0),100);if(re.test(''+h))h=Math.max(parseInt(h)+(o.deltaHeight||0),100);o=t.theme.renderUI({targetNode:e,width:w,height:h,deltaWidth:s.delta_width,deltaHeight:s.delta_height});t.editorContainer=o.editorContainer;}DOM.setStyles(o.sizeContainer||o.editorContainer,{width:w,height:h});h=(o.iframeHeight||h)+(typeof(h)=='number'?(o.deltaHeight||0):'');if(h<100)h=100;t.iframeHTML=s.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+t.documentBaseURI.getURI()+'" />';t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(tinymce.relaxedDomain)t.iframeHTML+='<script type="text/javascript">document.domain = "'+tinymce.relaxedDomain+'";</script>';bi=s.body_id||'tinymce';if(bi.indexOf('=')!=-1){bi=t.getParam('body_id','','hash');bi=bi[t.id]||bi;}bc=s.body_class||'';if(bc.indexOf('=')!=-1){bc=t.getParam('body_class','','hash');bc=bc[t.id]||'';}t.iframeHTML+='</head><body id="'+bi+'" class="mceContentBody '+bc+'"></body></html>';if(tinymce.relaxedDomain){if(isIE||(tinymce.isOpera&&parseFloat(opera.version())>=9.5))u='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';else if(tinymce.isOpera)u='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()';}n=DOM.add(o.iframeContainer,'iframe',{id:t.id+"_ifr",src:u||'javascript:""',frameBorder:'0',style:{width:'100%',height:h}});t.contentAreaContainer=o.iframeContainer;DOM.get(o.editorContainer).style.display=t.orgDisplay;DOM.get(t.id).style.display='none';if(tinymce.isOldWebKit){Event.add(n,'load',t.setupIframe,t);n.src=tinymce.baseURL+'/plugins/safari/blank.htm';}else{if(!isIE||!tinymce.relaxedDomain)t.setupIframe();e=n=o=null;}},setupIframe:function(){var t=this,s=t.settings,e=DOM.get(t.id),d=t.getDoc(),h,b;if(!isIE||!tinymce.relaxedDomain){d.open();d.write(t.iframeHTML);d.close();}if(!isIE){try{if(!s.readonly)d.designMode='On';}catch(ex){}}if(isIE){b=t.getBody();DOM.hide(b);if(!s.readonly)b.contentEditable=true;DOM.show(b);}t.dom=new tinymce.DOM.DOMUtils(t.getDoc(),{keep_values:true,url_converter:t.convertURL,url_converter_scope:t,hex_colors:s.force_hex_style_colors,class_filter:s.class_filter,update_styles:1,fix_ie_paragraphs:1});t.serializer=new tinymce.dom.Serializer({entity_encoding:s.entity_encoding,entities:s.entities,valid_elements:s.verify_html===false?'*[*]':s.valid_elements,extended_valid_elements:s.extended_valid_elements,valid_child_elements:s.valid_child_elements,invalid_elements:s.invalid_elements,fix_table_elements:s.fix_table_elements,fix_list_elements:s.fix_list_elements,fix_content_duplication:s.fix_content_duplication,convert_fonts_to_spans:s.convert_fonts_to_spans,font_size_classes:s.font_size_classes,font_size_style_values:s.font_size_style_values,apply_source_formatting:s.apply_source_formatting,remove_linebreaks:s.remove_linebreaks,element_format:s.element_format,dom:t.dom});t.selection=new tinymce.dom.Selection(t.dom,t.getWin(),t.serializer);t.forceBlocks=new tinymce.ForceBlocks(t,{forced_root_block:s.forced_root_block});t.editorCommands=new tinymce.EditorCommands(t);t.serializer.onPreProcess.add(function(se,o){return t.onPreProcess.dispatch(t,o,se);});t.serializer.onPostProcess.add(function(se,o){return t.onPostProcess.dispatch(t,o,se);});t.onPreInit.dispatch(t);if(!s.gecko_spellcheck)t.getBody().spellcheck=0;if(!s.readonly)t._addEvents();t.controlManager.onPostRender.dispatch(t,t.controlManager);t.onPostRender.dispatch(t);if(s.directionality)t.getBody().dir=s.directionality;if(s.nowrap)t.getBody().style.whiteSpace="nowrap";if(s.auto_resize)t.onNodeChange.add(t.resizeToContent,t);if(s.custom_elements){function handleCustom(ed,o){each(explode(s.custom_elements),function(v){var n;if(v.indexOf('~')===0){v=v.substring(1);n='span';}else n='div';o.content=o.content.replace(new RegExp('<('+v+')([^>]*)>','g'),'<'+n+' mce_name="$1"$2>');o.content=o.content.replace(new RegExp('</('+v+')>','g'),'</'+n+'>');});};t.onBeforeSetContent.add(handleCustom);t.onPostProcess.add(function(ed,o){if(o.set)handleCustom(ed,o)});}if(s.handle_node_change_callback){t.onNodeChange.add(function(ed,cm,n){t.execCallback('handle_node_change_callback',t.id,n,-1,-1,true,t.selection.isCollapsed());});}if(s.save_callback){t.onSaveContent.add(function(ed,o){var h=t.execCallback('save_callback',t.id,o.content,t.getBody());if(h)o.content=h;});}if(s.onchange_callback){t.onChange.add(function(ed,l){t.execCallback('onchange_callback',t,l);});}if(s.convert_newlines_to_brs){t.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/\r?\n/g,'<br />');});}if(s.fix_nesting&&isIE){t.onBeforeSetContent.add(function(ed,o){o.content=t._fixNesting(o.content);});}if(s.preformatted){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^\s*<pre.*?>/,'');o.content=o.content.replace(/<\/pre>\s*$/,'');if(o.set)o.content='<pre class="mceItemHidden">'+o.content+'</pre>';});}if(s.verify_css_classes){t.serializer.attribValueFilter=function(n,v){var s,cl;if(n=='class'){if(!t.classesRE){cl=t.dom.getClasses();if(cl.length>0){s='';each(cl,function(o){s+=(s?'|':'')+o['class'];});t.classesRE=new RegExp('('+s+')','gi');}}return!t.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v)||t.classesRE.test(v)?v:'';}return v;};}if(s.convert_fonts_to_spans)t._convertFonts();if(s.inline_styles)t._convertInlineElements();if(s.cleanup_callback){t.onBeforeSetContent.add(function(ed,o){o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);});t.onPreProcess.add(function(ed,o){if(o.set)t.execCallback('cleanup_callback','insert_to_editor_dom',o.node,o);if(o.get)t.execCallback('cleanup_callback','get_from_editor_dom',o.node,o);});t.onPostProcess.add(function(ed,o){if(o.set)o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);if(o.get)o.content=t.execCallback('cleanup_callback','get_from_editor',o.content,o);});}if(s.save_callback){t.onGetContent.add(function(ed,o){if(o.save)o.content=t.execCallback('save_callback',t.id,o.content,t.getBody());});}if(s.handle_event_callback){t.onEvent.add(function(ed,e,o){if(t.execCallback('handle_event_callback',e,ed,o)===false)Event.cancel(e);});}t.onSetContent.add(function(){t.addVisual(t.getBody());});if(s.padd_empty_editor){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,'');});}if(isGecko&&!s.readonly){try{d.designMode='Off';d.designMode='On';}catch(ex){}}setTimeout(function(){if(t.removed)return;t.load({initial:true,format:(s.cleanup_on_startup?'html':'raw')});t.startContent=t.getContent({format:'raw'});t.undoManager.add({initial:true});t.initialized=true;t.onInit.dispatch(t);t.execCallback('setupcontent_callback',t.id,t.getBody(),t.getDoc());t.execCallback('init_instance_callback',t);t.focus(true);t.nodeChanged({initial:1});if(s.content_css){tinymce.each(explode(s.content_css),function(u){t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));});}if(s.auto_focus){setTimeout(function(){var ed=EditorManager.get(s.auto_focus);ed.selection.select(ed.getBody(),1);ed.selection.collapse(1);ed.getWin().focus();},100);}},1);e=null;},focus:function(sf){var oed,t=this,ce=t.settings.content_editable;if(!sf){if(!ce&&(!isIE||t.selection.getNode().ownerDocument!=t.getDoc()))t.getWin().focus();}if(EditorManager.activeEditor!=t){if((oed=EditorManager.activeEditor)!=null)oed.onDeactivate.dispatch(oed,t);t.onActivate.dispatch(t,oed);}EditorManager._setActive(t);},execCallback:function(n){var t=this,f=t.settings[n],s;if(!f)return;if(t.callbackLookup&&(s=t.callbackLookup[n])){f=s.func;s=s.scope;}if(is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);t.callbackLookup=t.callbackLookup||{};t.callbackLookup[n]={func:f,scope:s};}return f.apply(s||t,Array.prototype.slice.call(arguments,1));},translate:function(s){var c=this.settings.language||'en',i18n=EditorManager.i18n;if(!s)return'';return i18n[c+'.'+s]||s.replace(/{\#([^}]+)\}/g,function(a,b){return i18n[c+'.'+b]||'{#'+b+'}';});},getLang:function(n,dv){return EditorManager.i18n[(this.settings.language||'en')+'.'+n]||(is(dv)?dv:'{#'+n+'}');},getParam:function(n,dv,ty){var tr=tinymce.trim,v=is(this.settings[n])?this.settings[n]:dv,o;if(ty==='hash'){o={};if(is(v,'string')){each(v.indexOf('=')>0?v.split(/[;,](?![^=;,]*(?:[;,]|$))/):v.split(','),function(v){v=v.split('=');if(v.length>1)o[tr(v[0])]=tr(v[1]);else o[tr(v[0])]=tr(v);});}else o=v;return o;}return v;},nodeChanged:function(o){var t=this,s=t.selection,n=s.getNode()||t.getBody();if(t.initialized){t.onNodeChange.dispatch(t,o?o.controlManager||t.controlManager:t.controlManager,isIE&&n.ownerDocument!=t.getDoc()?t.getBody():n,s.isCollapsed(),o);}},addButton:function(n,s){var t=this;t.buttons=t.buttons||{};t.buttons[n]=s;},addCommand:function(n,f,s){this.execCommands[n]={func:f,scope:s||this};},addQueryStateHandler:function(n,f,s){this.queryStateCommands[n]={func:f,scope:s||this};},addQueryValueHandler:function(n,f,s){this.queryValueCommands[n]={func:f,scope:s||this};},addShortcut:function(pa,desc,cmd_func,sc){var t=this,c;if(!t.settings.custom_shortcuts)return false;t.shortcuts=t.shortcuts||{};if(is(cmd_func,'string')){c=cmd_func;cmd_func=function(){t.execCommand(c,false,null);};}if(is(cmd_func,'object')){c=cmd_func;cmd_func=function(){t.execCommand(c[0],c[1],c[2]);};}each(explode(pa),function(pa){var o={func:cmd_func,scope:sc||this,desc:desc,alt:false,ctrl:false,shift:false};each(explode(pa,'+'),function(v){switch(v){case'alt':case'ctrl':case'shift':o[v]=true;break;default:o.charCode=v.charCodeAt(0);o.keyCode=v.toUpperCase().charCodeAt(0);}});t.shortcuts[(o.ctrl?'ctrl':'')+','+(o.alt?'alt':'')+','+(o.shift?'shift':'')+','+o.keyCode]=o;});return true;},execCommand:function(cmd,ui,val,a){var t=this,s=0,o,st;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd)&&(!a||!a.skip_focus))t.focus();o={};t.onBeforeExecCommand.dispatch(t,cmd,ui,val,o);if(o.terminate)return false;if(t.execCallback('execcommand_callback',t.id,t.selection.getNode(),cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(o=t.execCommands[cmd]){st=o.func.call(o.scope,ui,val);if(st!==true){t.onExecCommand.dispatch(t,cmd,ui,val,a);return st;}}each(t.plugins,function(p){if(p.execCommand&&p.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);s=1;return false;}});if(s)return true;if(t.theme.execCommand&&t.theme.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(t.editorCommands.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}t.getDoc().execCommand(cmd,ui,val);t.onExecCommand.dispatch(t,cmd,ui,val,a);},queryCommandState:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryStateCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandState(c);if(o!==-1)return o;try{return this.getDoc().queryCommandState(c);}catch(ex){}},queryCommandValue:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryValueCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandValue(c);if(is(o))return o;try{return this.getDoc().queryCommandValue(c);}catch(ex){}},show:function(){var t=this;DOM.show(t.getContainer());DOM.hide(t.id);t.load();},hide:function(){var t=this,d=t.getDoc();if(isIE&&d)d.execCommand('SelectAll');t.save();DOM.hide(t.getContainer());DOM.setStyle(t.id,'display',t.orgDisplay);},isHidden:function(){return!DOM.isHidden(this.id);},setProgressState:function(b,ti,o){this.onSetProgressState.dispatch(this,b,ti,o);return b;},resizeToContent:function(){var t=this;DOM.setStyle(t.id+"_ifr",'height',t.getBody().scrollHeight);},load:function(o){var t=this,e=t.getElement(),h;if(e){o=o||{};o.load=true;h=t.setContent(is(e.value)?e.value:e.innerHTML,o);o.element=e;if(!o.no_events)t.onLoadContent.dispatch(t,o);o.element=e=null;return h;}},save:function(o){var t=this,e=t.getElement(),h,f;if(!e||!t.initialized)return;o=o||{};o.save=true;if(!o.no_events){t.undoManager.typing=0;t.undoManager.add();}o.element=e;h=o.content=t.getContent(o);if(!o.no_events)t.onSaveContent.dispatch(t,o);h=o.content;if(!/TEXTAREA|INPUT/i.test(e.nodeName)){e.innerHTML=h;if(f=DOM.getParent(t.id,'form')){each(f.elements,function(e){if(e.name==t.id){e.value=h;return false;}});}}else e.value=h;o.element=e=null;return h;},setContent:function(h,o){var t=this;o=o||{};o.format=o.format||'html';o.set=true;o.content=h;if(!o.no_events)t.onBeforeSetContent.dispatch(t,o);if(!tinymce.isIE&&(h.length===0||/^\s+$/.test(h))){o.content=t.dom.setHTML(t.getBody(),'<br mce_bogus="1" />');o.format='raw';}o.content=t.dom.setHTML(t.getBody(),tinymce.trim(o.content));if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;o.content=t.dom.setHTML(t.getBody(),t.serializer.serialize(t.getBody(),o));}if(!o.no_events)t.onSetContent.dispatch(t,o);return o.content;},getContent:function(o){var t=this,h;o=o||{};o.format=o.format||'html';o.get=true;if(!o.no_events)t.onBeforeGetContent.dispatch(t,o);if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;h=t.serializer.serialize(t.getBody(),o);}else h=t.getBody().innerHTML;h=h.replace(/^\s*|\s*$/g,'');o.content=h;if(!o.no_events)t.onGetContent.dispatch(t,o);return o.content;},isDirty:function(){var t=this;return tinymce.trim(t.startContent)!=tinymce.trim(t.getContent({format:'raw',no_events:1}))&&!t.isNotDirty;},getContainer:function(){var t=this;if(!t.container)t.container=DOM.get(t.editorContainer||t.id+'_parent');return t.container;},getContentAreaContainer:function(){return this.contentAreaContainer;},getElement:function(){return DOM.get(this.settings.content_element||this.id);},getWin:function(){var t=this,e;if(!t.contentWindow){e=DOM.get(t.id+"_ifr");if(e)t.contentWindow=e.contentWindow;}return t.contentWindow;},getDoc:function(){var t=this,w;if(!t.contentDocument){w=t.getWin();if(w)t.contentDocument=w.document;}return t.contentDocument;},getBody:function(){return this.bodyElement||this.getDoc().body;},convertURL:function(u,n,e){var t=this,s=t.settings;if(s.urlconverter_callback)return t.execCallback('urlconverter_callback',u,e,true,n);if(!s.convert_urls||(e&&e.nodeName=='LINK')||u.indexOf('file:')===0)return u;if(s.relative_urls)return t.documentBaseURI.toRelative(u);u=t.documentBaseURI.toAbsolute(u,s.remove_script_host);return u;},addVisual:function(e){var t=this,s=t.settings;e=e||t.getBody();if(!is(t.hasVisual))t.hasVisual=s.visual;each(t.dom.select('table,a',e),function(e){var v;switch(e.nodeName){case'TABLE':v=t.dom.getAttrib(e,'border');if(!v||v=='0'){if(t.hasVisual)t.dom.addClass(e,s.visual_table_class);else t.dom.removeClass(e,s.visual_table_class);}return;case'A':v=t.dom.getAttrib(e,'name');if(v){if(t.hasVisual)t.dom.addClass(e,'mceItemAnchor');else t.dom.removeClass(e,'mceItemAnchor');}return;}});t.onVisualAid.dispatch(t,e,t.hasVisual);},remove:function(){var t=this,e=t.getContainer();t.removed=1;t.hide();t.execCallback('remove_instance_callback',t);t.onRemove.dispatch(t);t.onExecCommand.listeners=[];EditorManager.remove(t);DOM.remove(e);},destroy:function(s){var t=this;if(t.destroyed)return;if(!s){tinymce.removeUnload(t.destroy);tinyMCE.onBeforeUnload.remove(t._beforeUnload);if(t.theme.destroy)t.theme.destroy();t.controlManager.destroy();t.selection.destroy();t.dom.destroy();if(!t.settings.content_editable){Event.clear(t.getWin());Event.clear(t.getDoc());}Event.clear(t.getBody());Event.clear(t.formElement);}if(t.formElement){t.formElement.submit=t.formElement._mceOldSubmit;t.formElement._mceOldSubmit=null;}t.contentAreaContainer=t.formElement=t.container=t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null;if(t.selection)t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null;t.destroyed=1;},_addEvents:function(){var t=this,i,s=t.settings,lo={mouseup:'onMouseUp',mousedown:'onMouseDown',click:'onClick',keyup:'onKeyUp',keydown:'onKeyDown',keypress:'onKeyPress',submit:'onSubmit',reset:'onReset',contextmenu:'onContextMenu',dblclick:'onDblClick',paste:'onPaste'};function eventHandler(e,o){var ty=e.type;if(t.removed)return;if(t.onEvent.dispatch(t,e,o)!==false){t[lo[e.fakeType||e.type]].dispatch(t,e,o);}};each(lo,function(v,k){switch(k){case'contextmenu':if(tinymce.isOpera){Event.add(t.getBody(),'mousedown',function(e){if(e.ctrlKey){e.fakeType='contextmenu';eventHandler(e);}});}else Event.add(t.getBody(),k,eventHandler);break;case'paste':Event.add(t.getBody(),k,function(e){var tx,h,el,r;if(e.clipboardData)tx=e.clipboardData.getData('text/plain');else if(tinymce.isIE)tx=t.getWin().clipboardData.getData('Text');eventHandler(e,{text:tx,html:h});});break;case'submit':case'reset':Event.add(t.getElement().form||DOM.getParent(t.id,'form'),k,eventHandler);break;default:Event.add(s.content_editable?t.getBody():t.getDoc(),k,eventHandler);}});Event.add(s.content_editable?t.getBody():(isGecko?t.getDoc():t.getWin()),'focus',function(e){t.focus(true);});if(tinymce.isGecko){Event.add(t.getDoc(),'DOMNodeInserted',function(e){var v;e=e.target;if(e.nodeType===1&&e.nodeName==='IMG'&&(v=e.getAttribute('mce_src')))e.src=t.documentBaseURI.toAbsolute(v);});}if(isGecko){function setOpts(){var t=this,d=t.getDoc(),s=t.settings;if(isGecko&&!s.readonly){if(t._isHidden()){try{if(!s.content_editable)d.designMode='On';}catch(ex){}}try{d.execCommand("styleWithCSS",0,false);}catch(ex){if(!t._isHidden())try{d.execCommand("useCSS",0,true);}catch(ex){}}if(!s.table_inline_editing)try{d.execCommand('enableInlineTableEditing',false,false);}catch(ex){}if(!s.object_resizing)try{d.execCommand('enableObjectResizing',false,false);}catch(ex){}}};t.onBeforeExecCommand.add(setOpts);t.onMouseDown.add(setOpts);}t.onMouseUp.add(t.nodeChanged);t.onClick.add(t.nodeChanged);t.onKeyUp.add(function(ed,e){var c=e.keyCode;if((c>=33&&c<=36)||(c>=37&&c<=40)||c==13||c==45||c==46||c==8||(tinymce.isMac&&(c==91||c==93))||e.ctrlKey)t.nodeChanged();});t.onReset.add(function(){t.setContent(t.startContent,{format:'raw'});});if(t.getParam('tab_focus')){function tabCancel(ed,e){if(e.keyCode===9)return Event.cancel(e);};function tabHandler(ed,e){var x,i,f,el,v;function find(d){f=DOM.getParent(ed.id,'form');el=f.elements;if(f){each(el,function(e,i){if(e.id==ed.id){x=i;return false;}});if(d>0){for(i=x+1;i<el.length;i++){if(el[i].type!='hidden')return el[i];}}else{for(i=x-1;i>=0;i--){if(el[i].type!='hidden')return el[i];}}}return null;};if(e.keyCode===9){v=explode(ed.getParam('tab_focus'));if(v.length==1){v[1]=v[0];v[0]=':prev';}if(e.shiftKey){if(v[0]==':prev')el=find(-1);else el=DOM.get(v[0]);}else{if(v[1]==':next')el=find(1);else el=DOM.get(v[1]);}if(el){if(ed=EditorManager.get(el.id||el.name))ed.focus();else window.setTimeout(function(){window.focus();el.focus();},10);return Event.cancel(e);}}};t.onKeyUp.add(tabCancel);if(isGecko){t.onKeyPress.add(tabHandler);t.onKeyDown.add(tabCancel);}else t.onKeyDown.add(tabHandler);}if(s.custom_shortcuts){if(s.custom_undo_redo_keyboard_shortcuts){t.addShortcut('ctrl+z',t.getLang('undo_desc'),'Undo');t.addShortcut('ctrl+y',t.getLang('redo_desc'),'Redo');}if(isGecko){t.addShortcut('ctrl+b',t.getLang('bold_desc'),'Bold');t.addShortcut('ctrl+i',t.getLang('italic_desc'),'Italic');t.addShortcut('ctrl+u',t.getLang('underline_desc'),'Underline');}for(i=1;i<=6;i++)t.addShortcut('ctrl+'+i,'',['FormatBlock',false,'<h'+i+'>']);t.addShortcut('ctrl+7','',['FormatBlock',false,'<p>']);t.addShortcut('ctrl+8','',['FormatBlock',false,'<div>']);t.addShortcut('ctrl+9','',['FormatBlock',false,'<address>']);function find(e){var v=null;if(!e.altKey&&!e.ctrlKey&&!e.metaKey)return v;each(t.shortcuts,function(o){if(tinymce.isMac&&o.ctrl!=e.metaKey)return;else if(!tinymce.isMac&&o.ctrl!=e.ctrlKey)return;if(o.alt!=e.altKey)return;if(o.shift!=e.shiftKey)return;if(e.keyCode==o.keyCode||(e.charCode&&e.charCode==o.charCode)){v=o;return false;}});return v;};t.onKeyUp.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyPress.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyDown.add(function(ed,e){var o=find(e);if(o){o.func.call(o.scope);return Event.cancel(e);}});}if(tinymce.isIE){Event.add(t.getDoc(),'controlselect',function(e){var re=t.resizeInfo,cb;e=e.target;if(e.nodeName!=='IMG')return;if(re)Event.remove(re.node,re.ev,re.cb);if(!t.dom.hasClass(e,'mceItemNoResize')){ev='resizeend';cb=Event.add(e,ev,function(e){var v;e=e.target;if(v=t.dom.getStyle(e,'width')){t.dom.setAttrib(e,'width',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'width','');}if(v=t.dom.getStyle(e,'height')){t.dom.setAttrib(e,'height',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'height','');}});}else{ev='resizestart';cb=Event.add(e,'resizestart',Event.cancel,Event);}re=t.resizeInfo={node:e,ev:ev,cb:cb};});t.onKeyDown.add(function(ed,e){switch(e.keyCode){case 8:if(t.selection.getRng().item){t.selection.getRng().item(0).removeNode();return Event.cancel(e);}}});}if(tinymce.isOpera){t.onClick.add(function(ed,e){Event.prevent(e);});}if(s.custom_undo_redo){function addUndo(){t.undoManager.typing=0;t.undoManager.add();};if(tinymce.isIE){Event.add(t.getWin(),'blur',function(e){var n;if(t.selection){n=t.selection.getNode();if(!t.removed&&n.ownerDocument&&n.ownerDocument!=t.getDoc())addUndo();}});}else{Event.add(t.getDoc(),'blur',function(){if(t.selection&&!t.removed)addUndo();});}t.onMouseDown.add(addUndo);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.ctrlKey){t.undoManager.typing=0;t.undoManager.add();}});t.onKeyDown.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45){if(t.undoManager.typing){t.undoManager.add();t.undoManager.typing=0;}return;}if(!t.undoManager.typing){t.undoManager.add();t.undoManager.typing=1;}});}},_convertInlineElements:function(){var t=this,s=t.settings,dom=t.dom,v,e,na,st,sp;function convert(ed,o){if(!s.inline_styles)return;if(o.get){each(t.dom.select('table,u,strike',o.node),function(n){switch(n.nodeName){case'TABLE':if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height','');}break;case'U':case'STRIKE':n.style.textDecoration=n.nodeName=='U'?'underline':'line-through';dom.setAttrib(n,'mce_style','');dom.setAttrib(n,'mce_name','span');break;}});}else if(o.set){each(t.dom.select('table,span',o.node).reverse(),function(n){if(n.nodeName=='TABLE'){if(v=dom.getStyle(n,'height'))dom.setAttrib(n,'height',v.replace(/[^0-9%]+/g,''));}else{if(n.style.textDecoration=='underline')na='u';else if(n.style.textDecoration=='line-through')na='strike';else na='';if(na){n.style.textDecoration='';dom.setAttrib(n,'mce_style','');e=dom.create(na,{style:dom.getAttrib(n,'style')});dom.replace(e,n,1);}}});}};t.onPreProcess.add(convert);if(!s.cleanup_on_startup){t.onSetContent.add(function(ed,o){if(o.initial)convert(t,{node:t.getBody(),set:1});});}},_convertFonts:function(){var t=this,s=t.settings,dom=t.dom,fz,fzn,sl,cl;if(!s.inline_styles)return;fz=[8,10,12,14,18,24,36];fzn=['xx-small','x-small','small','medium','large','x-large','xx-large'];if(sl=s.font_size_style_values)sl=explode(sl);if(cl=s.font_size_classes)cl=explode(cl);function process(no){var n,sp,nl,x;if(!s.inline_styles)return;nl=t.dom.select('font',no);for(x=nl.length-1;x>=0;x--){n=nl[x];sp=dom.create('span',{style:dom.getAttrib(n,'style'),'class':dom.getAttrib(n,'class')});dom.setStyles(sp,{fontFamily:dom.getAttrib(n,'face'),color:dom.getAttrib(n,'color'),backgroundColor:n.style.backgroundColor});if(n.size){if(sl)dom.setStyle(sp,'fontSize',sl[parseInt(n.size)-1]);else dom.setAttrib(sp,'class',cl[parseInt(n.size)-1]);}dom.setAttrib(sp,'mce_style','');dom.replace(sp,n,1);}};t.onPreProcess.add(function(ed,o){if(o.get)process(o.node);});t.onSetContent.add(function(ed,o){if(o.initial)process(o.node);});},_isHidden:function(){var s;if(!isGecko)return 0;s=this.selection.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},_fixNesting:function(s){var d=[],i;s=s.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(a,b,c){var e;if(b==='/'){if(!d.length)return'';if(c!==d[d.length-1].tag){for(i=d.length-1;i>=0;i--){if(d[i].tag===c){d[i].close=1;break;}}return'';}else{d.pop();if(d.length&&d[d.length-1].close){a=a+'</'+d[d.length-1].tag+'>';d.pop();}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(c))return a;if(/\/>$/.test(a))return a;d.push({tag:c});}return a;});for(i=d.length-1;i>=0;i--)s+='</'+d[i].tag+'>';return s;}});})();(function(){var each=tinymce.each,isIE=tinymce.isIE,isGecko=tinymce.isGecko,isOpera=tinymce.isOpera,isWebKit=tinymce.isWebKit;function isBlock(n){return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n.nodeName);};tinymce.create('tinymce.EditorCommands',{EditorCommands:function(ed){this.editor=ed;},execCommand:function(cmd,ui,val){var t=this,ed=t.editor,f;switch(cmd){case'Cut':case'Copy':case'Paste':try{ed.getDoc().execCommand(cmd,ui,val);}catch(ex){if(isGecko){ed.windowManager.confirm(ed.getLang('clipboard_msg'),function(s){if(s)window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');});}else ed.windowManager.alert(ed.getLang('clipboard_no_support'));}return true;case'mceResetDesignMode':case'mceBeginUndoLevel':return true;case'unlink':t.UnLink();return true;case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':t.mceJustify(cmd,cmd.substring(7).toLowerCase());return true;case'mceEndUndoLevel':case'mceAddUndoLevel':ed.undoManager.add();return true;default:f=this[cmd];if(f){f.call(this,ui,val);return true;}}return false;},Indent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){d.setStyle(e,'paddingLeft',(parseInt(e.style.paddingLeft||0)+iv)+iu);});return;}ed.getDoc().execCommand('Indent',false,null);if(isIE){d.getParent(s.getNode(),function(n){if(n.nodeName=='BLOCKQUOTE'){n.dir=n.style.cssText='';}});}},Outdent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,v,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){v=Math.max(0,parseInt(e.style.paddingLeft||0)-iv);d.setStyle(e,'paddingLeft',v?v+iu:'');});return;}ed.getDoc().execCommand('Outdent',false,null);},mceSetAttribute:function(u,v){var ed=this.editor,d=ed.dom,e;if(e=d.getParent(ed.selection.getNode(),d.isBlock))d.setAttrib(e,v.name,v.value);},mceSetContent:function(u,v){this.editor.setContent(v);},mceToggleVisualAid:function(){var ed=this.editor;ed.hasVisual=!ed.hasVisual;ed.addVisual();},mceReplaceContent:function(u,v){var s=this.editor.selection;s.setContent(v.replace(/\{\$selection\}/g,s.getContent({format:'text'})));},mceInsertLink:function(u,v){var ed=this.editor,s=ed.selection,e=ed.dom.getParent(s.getNode(),'A');if(tinymce.is(v,'string'))v={href:v};function set(e){each(v,function(v,k){ed.dom.setAttrib(e,k,v);});};if(!e){ed.execCommand('CreateLink',false,'javascript:mctmp(0);');each(ed.dom.select('a'),function(e){if(e.href=='javascript:mctmp(0);')set(e);});}else{if(v.href)set(e);else ed.dom.remove(e,1);}},UnLink:function(){var ed=this.editor,s=ed.selection;if(s.isCollapsed())s.select(s.getNode());ed.getDoc().execCommand('unlink',false,null);s.collapse(0);},FontName:function(u,v){var t=this,ed=t.editor,s=ed.selection,e;if(!v){if(s.isCollapsed())s.select(s.getNode());t.RemoveFormat();}else{if(ed.settings.convert_fonts_to_spans)t._applyInlineStyle('span',{style:{fontFamily:v}});else ed.getDoc().execCommand('FontName',false,v);}},FontSize:function(u,v){var ed=this.editor,s=ed.settings,fc,fs;if(s.convert_fonts_to_spans&&v>=1&&v<=7){fs=tinymce.explode(s.font_size_style_values);fc=tinymce.explode(s.font_size_classes);if(fc)v=fc[v-1]||v;else v=fs[v-1]||v;}if(v>=1&&v<=7)ed.getDoc().execCommand('FontSize',false,v);else this._applyInlineStyle('span',{style:{fontSize:v}});},queryCommandValue:function(c){var f=this['queryValue'+c];if(f)return f.call(this,c);return false;},queryCommandState:function(cmd){var f;switch(cmd){case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':return this.queryStateJustify(cmd,cmd.substring(7).toLowerCase());default:if(f=this['queryState'+cmd])return f.call(this,cmd);}return-1;},_queryState:function(c){try{return this.editor.getDoc().queryCommandState(c);}catch(ex){}},_queryVal:function(c){try{return this.editor.getDoc().queryCommandValue(c);}catch(ex){}},queryValueFontSize:function(){var ed=this.editor,v=0,p;if(p=ed.dom.getParent(ed.selection.getNode(),'SPAN'))v=p.style.fontSize;if(!v&&(isOpera||isWebKit)){if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.size;return v;}return v||this._queryVal('FontSize');},queryValueFontName:function(){var ed=this.editor,v=0,p;if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.face;if(p=ed.dom.getParent(ed.selection.getNode(),'SPAN'))v=p.style.fontFamily.replace(/, /g,',').replace(/[\'\"]/g,'').toLowerCase();if(!v)v=this._queryVal('FontName');return v;},mceJustify:function(c,v){var ed=this.editor,se=ed.selection,n=se.getNode(),nn=n.nodeName,bl,nb,dom=ed.dom,rm;if(ed.settings.inline_styles&&this.queryStateJustify(c,v))rm=1;bl=dom.getParent(n,ed.dom.isBlock);if(nn=='IMG'){if(v=='full')return;if(rm){if(v=='center')dom.setStyle(bl||n.parentNode,'textAlign','');dom.setStyle(n,'float','');this.mceRepaint();return;}if(v=='center'){if(bl&&/^(TD|TH)$/.test(bl.nodeName))bl=0;if(!bl||bl.childNodes.length>1){nb=dom.create('p');nb.appendChild(n.cloneNode(false));if(bl)dom.insertAfter(nb,bl);else dom.insertAfter(nb,n);dom.remove(n);n=nb.firstChild;bl=nb;}dom.setStyle(bl,'textAlign',v);dom.setStyle(n,'float','');}else{dom.setStyle(n,'float',v);dom.setStyle(bl||n.parentNode,'textAlign','');}this.mceRepaint();return;}if(ed.settings.inline_styles&&ed.settings.forced_root_block){if(rm)v='';each(this._getSelectedBlocks(dom.getParent(se.getStart(),dom.isBlock),dom.getParent(se.getEnd(),dom.isBlock)),function(e){dom.setAttrib(e,'align','');dom.setStyle(e,'textAlign',v=='full'?'justify':v);});return;}else if(!rm)ed.getDoc().execCommand(c,false,null);if(ed.settings.inline_styles){if(rm){dom.getParent(ed.selection.getNode(),function(n){if(n.style&&n.style.textAlign)dom.setStyle(n,'textAlign','');});return;}each(dom.select('*'),function(n){var v=n.align;if(v){if(v=='full')v='justify';dom.setStyle(n,'textAlign',v);dom.setAttrib(n,'align','');}});}},mceSetCSSClass:function(u,v){this.mceSetStyleInfo(0,{command:'setattrib',name:'class',value:v});},getSelectedElement:function(){var t=this,ed=t.editor,dom=ed.dom,se=ed.selection,r=se.getRng(),r1,r2,sc,ec,so,eo,e,sp,ep,re;if(se.isCollapsed()||r.item)return se.getNode();re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(isIE){r1=r.duplicate();r1.collapse(true);sc=r1.parentElement();r2=r.duplicate();r2.collapse(false);ec=r2.parentElement();if(sc!=ec){r1.move('character',1);sc=r1.parentElement();}if(sc==ec){r1=r.duplicate();r1.moveToElementText(sc);if(r1.compareEndPoints('StartToStart',r)==0&&r1.compareEndPoints('EndToEnd',r)==0)return re&&re.test(sc.nodeName)?null:sc;}}else{function getParent(n){return dom.getParent(n,function(n){return n.nodeType==1;});};sc=r.startContainer;ec=r.endContainer;so=r.startOffset;eo=r.endOffset;if(!r.collapsed){if(sc==ec){if(so-eo<2){if(sc.hasChildNodes()){sp=sc.childNodes[so];return re&&re.test(sp.nodeName)?null:sp;}}}}if(sc.nodeType!=3||ec.nodeType!=3)return null;if(so==0){sp=getParent(sc);if(sp&&sp.firstChild!=sc)sp=null;}if(so==sc.nodeValue.length){e=sc.nextSibling;if(e&&e.nodeType==1)sp=sc.nextSibling;}if(eo==0){e=ec.previousSibling;if(e&&e.nodeType==1)ep=e;}if(eo==ec.nodeValue.length){ep=getParent(ec);if(ep&&ep.lastChild!=ec)ep=null;}if(sp==ep)return re&&sp&&re.test(sp.nodeName)?null:sp;}return null;},InsertHorizontalRule:function(){if(isGecko||isIE)this.editor.selection.setContent('<hr />');else this.editor.getDoc().execCommand('InsertHorizontalRule',false,'');},RemoveFormat:function(){var t=this,ed=t.editor,s=ed.selection,b;if(isWebKit)s.setContent(s.getContent({format:'raw'}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,''),{format:'raw'});else ed.getDoc().execCommand('RemoveFormat',false,null);t.mceSetStyleInfo(0,{command:'removeformat'});ed.addVisual();},mceSetStyleInfo:function(u,v){var t=this,ed=t.editor,d=ed.getDoc(),dom=ed.dom,e,b,s=ed.selection,nn=v.wrapper||'span',b=s.getBookmark(),re;function set(n,e){if(n.nodeType==1){switch(v.command){case'setattrib':return dom.setAttrib(n,v.name,v.value);case'setstyle':return dom.setStyle(n,v.name,v.value);case'removeformat':return dom.setAttrib(n,'class','');}}};re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if((e=t.getSelectedElement())&&!ed.settings.force_span_wrappers)set(e,1);else{d.execCommand('FontName',false,'__');each(isWebKit?dom.select('span'):dom.select('font'),function(n){var sp,e;if(dom.getAttrib(n,'face')=='__'||n.style.fontFamily==='__'){sp=dom.create(nn,{mce_new:'1'});set(sp);each(n.childNodes,function(n){sp.appendChild(n.cloneNode(true));});dom.replace(sp,n);}});}each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!dom.getAttrib(n,'mce_new')){p=dom.getParent(n,function(n){return n.nodeType==1&&dom.getAttrib(n,'mce_new');});if(p)dom.remove(n,1);}});each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!p||!dom.getAttrib(n,'mce_new'))return;if(ed.settings.force_span_wrappers&&p.nodeName!='SPAN')return;if(p.nodeName==nn.toUpperCase()&&p.childNodes.length==1)return dom.remove(p,1);if(n.nodeType==1&&(!re||!re.test(p.nodeName))&&p.childNodes.length==1){set(p);dom.setAttrib(n,'class','');}});each(dom.select(nn).reverse(),function(n){if(dom.getAttrib(n,'mce_new')||(dom.getAttribs(n).length<=1&&n.className==='')){if(!dom.getAttrib(n,'class')&&!dom.getAttrib(n,'style'))return dom.remove(n,1);dom.setAttrib(n,'mce_new','');}});s.moveToBookmark(b);},queryStateJustify:function(c,v){var ed=this.editor,n=ed.selection.getNode(),dom=ed.dom;if(n&&n.nodeName=='IMG'){if(dom.getStyle(n,'float')==v)return 1;return n.parentNode.style.textAlign==v;}n=dom.getParent(ed.selection.getStart(),function(n){return n.nodeType==1&&n.style.textAlign;});if(v=='full')v='justify';if(ed.settings.inline_styles)return(n&&n.style.textAlign==v);return this._queryState(c);},ForeColor:function(ui,v){var ed=this.editor;if(ed.settings.convert_fonts_to_spans){this._applyInlineStyle('span',{style:{color:v}});return;}else ed.getDoc().execCommand('ForeColor',false,v);},HiliteColor:function(ui,val){var t=this,ed=t.editor,d=ed.getDoc();if(ed.settings.convert_fonts_to_spans){this._applyInlineStyle('span',{style:{backgroundColor:val}});return;}function set(s){if(!isGecko)return;try{d.execCommand("styleWithCSS",0,s);}catch(ex){d.execCommand("useCSS",0,!s);}};if(isGecko||isOpera){set(true);d.execCommand('hilitecolor',false,val);set(false);}else d.execCommand('BackColor',false,val);},Undo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.undo();ed.nodeChanged();}else ed.getDoc().execCommand('Undo',false,null);},Redo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.redo();ed.nodeChanged();}else ed.getDoc().execCommand('Redo',false,null);},FormatBlock:function(ui,val){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,bl,nb,b;function isBlock(n){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(n.nodeName);};bl=dom.getParent(s.getNode(),function(n){return isBlock(n);});if(bl){if((isIE&&isBlock(bl.parentNode))||bl.nodeName=='DIV'){nb=ed.dom.create(val);each(dom.getAttribs(bl),function(v){dom.setAttrib(nb,v.nodeName,dom.getAttrib(bl,v.nodeName));});b=s.getBookmark();dom.replace(nb,bl,1);s.moveToBookmark(b);ed.nodeChanged();return;}}val=ed.settings.forced_root_block?(val||'<p>'):val;if(val.indexOf('<')==-1)val='<'+val+'>';if(tinymce.isGecko)val=val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,'$1');ed.getDoc().execCommand('FormatBlock',false,val);},mceCleanup:function(){var ed=this.editor,s=ed.selection,b=s.getBookmark();ed.setContent(ed.getContent());s.moveToBookmark(b);},mceRemoveNode:function(ui,val){var ed=this.editor,s=ed.selection,b,n=val||s.getNode();if(n==ed.getBody())return;b=s.getBookmark();ed.dom.remove(n,1);s.moveToBookmark(b);ed.nodeChanged();},mceSelectNodeDepth:function(ui,val){var ed=this.editor,s=ed.selection,c=0;ed.dom.getParent(s.getNode(),function(n){if(n.nodeType==1&&c++==val){s.select(n);ed.nodeChanged();return false;}},ed.getBody());},mceSelectNode:function(u,v){this.editor.selection.select(v);},mceInsertContent:function(ui,val){this.editor.selection.setContent(val);},mceInsertRawHTML:function(ui,val){var ed=this.editor;ed.selection.setContent('tiny_mce_marker');ed.setContent(ed.getContent().replace(/tiny_mce_marker/g,val));},mceRepaint:function(){var s,b,e=this.editor;if(tinymce.isGecko){try{s=e.selection;b=s.getBookmark(true);if(s.getSel())s.getSel().selectAllChildren(e.getBody());s.collapse(true);s.moveToBookmark(b);}catch(ex){}}},queryStateUnderline:function(){var ed=this.editor,n=ed.selection.getNode();if(n&&n.nodeName=='A')return false;return this._queryState('Underline');},queryStateOutdent:function(){var ed=this.editor,n;if(ed.settings.inline_styles){if((n=ed.dom.getParent(ed.selection.getStart(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;if((n=ed.dom.getParent(ed.selection.getEnd(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()||(!ed.settings.inline_styles&&!!ed.dom.getParent(ed.selection.getNode(),'BLOCKQUOTE'));},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'UL');},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'OL');},queryStatemceBlockQuote:function(){return!!this.editor.dom.getParent(this.editor.selection.getStart(),function(n){return n.nodeName==='BLOCKQUOTE';});},mceBlockQuote:function(){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,sb,eb,n,bm,bq,r,bq2,i,nl;function getBQ(e){return dom.getParent(e,function(n){return n.nodeName==='BLOCKQUOTE';});};sb=dom.getParent(s.getStart(),isBlock);eb=dom.getParent(s.getEnd(),isBlock);if(bq=getBQ(sb)){if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();if(getBQ(eb)){bq2=bq.cloneNode(false);while(n=eb.nextSibling)bq2.appendChild(n.parentNode.removeChild(n));}if(bq2)dom.insertAfter(bq2,bq);nl=t._getSelectedBlocks(sb,eb);for(i=nl.length-1;i>=0;i--){dom.insertAfter(nl[i],bq);}if(/^\s*$/.test(bq.innerHTML))dom.remove(bq,1);if(bq2&&/^\s*$/.test(bq2.innerHTML))dom.remove(bq2,1);if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(0);if(dom.getParent(s.getStart(),isBlock)!=sb){r=s.getRng();r.move('character',-1);r.select();}}}else t.editor.selection.moveToBookmark(bm);return;}if(isIE&&!sb&&!eb){t.editor.getDoc().execCommand('Indent');n=getBQ(s.getNode());n.style.margin=n.dir='';return;}if(!sb||!eb)return;if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();each(t._getSelectedBlocks(getBQ(s.getStart()),getBQ(s.getEnd())),function(e){if(e.nodeName=='BLOCKQUOTE'&&!bq){bq=e;return;}if(!bq){bq=dom.create('blockquote');e.parentNode.insertBefore(bq,e);}if(e.nodeName=='BLOCKQUOTE'&&bq){n=e.firstChild;while(n){bq.appendChild(n.cloneNode(true));n=n.nextSibling;}dom.remove(e);return;}bq.appendChild(dom.remove(e));});if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(1);}}else s.moveToBookmark(bm);},_applyInlineStyle:function(na,at,op){var t=this,ed=t.editor,dom=ed.dom,bm,lo={},kh;na=na.toUpperCase();if(op&&op.check_classes&&at['class'])op.check_classes.push(at['class']);function replaceFonts(){var bm;each(dom.select(tinymce.isWebKit&&!tinymce.isAir?'span':'font'),function(n){if(n.style.fontFamily=='mceinline'||n.face=='mceinline'){if(!bm)bm=ed.selection.getBookmark();at._mce_new='1';dom.replace(dom.create(na,at),n,1);}});each(dom.select(na),function(n){if(n.getAttribute('_mce_new')){function removeStyle(n){if(n.nodeType==1){each(at.style,function(v,k){dom.setStyle(n,k,'');});if(at['class']&&n.className&&op){each(op.check_classes,function(c){if(dom.hasClass(n,c))dom.removeClass(n,c);});}}};each(dom.select(na,n),removeStyle);if(n.parentNode&&n.parentNode.nodeType==1&&n.parentNode.childNodes.length==1)removeStyle(n.parentNode);dom.getParent(n.parentNode,function(pn){if(pn.nodeType==1){if(at.style){each(at.style,function(v,k){var sv;if(!lo[k]&&(sv=dom.getStyle(pn,k))){if(sv===v)dom.setStyle(n,k,'');lo[k]=1;}});}if(at['class']&&pn.className&&op){each(op.check_classes,function(c){if(dom.hasClass(pn,c))dom.removeClass(n,c);});}}return false;});n.removeAttribute('_mce_new');}});each(dom.select(na).reverse(),function(n){var c=0;each(dom.getAttribs(n),function(an){if(an.nodeName.substring(0,1)!='_'&&dom.getAttrib(n,an.nodeName)!=''){c++;}});if(c==0)dom.remove(n,1);});ed.selection.moveToBookmark(bm);return!!bm;};ed.focus();ed.getDoc().execCommand('FontName',false,'mceinline');replaceFonts();if(kh=t._applyInlineStyle.keyhandler){ed.onKeyUp.remove(kh);ed.onKeyPress.remove(kh);ed.onKeyDown.remove(kh);ed.onSetContent.remove(t._applyInlineStyle.chandler);}if(ed.selection.isCollapsed()){t._pendingStyles=tinymce.extend(t._pendingStyles||{},at.style);t._applyInlineStyle.chandler=ed.onSetContent.add(function(){delete t._pendingStyles;});t._applyInlineStyle.keyhandler=kh=function(e){if(t._pendingStyles){at.style=t._pendingStyles;delete t._pendingStyles;}if(replaceFonts()){ed.onKeyDown.remove(t._applyInlineStyle.keyhandler);ed.onKeyPress.remove(t._applyInlineStyle.keyhandler);}if(e.type=='keyup')ed.onKeyUp.remove(t._applyInlineStyle.keyhandler);};ed.onKeyDown.add(kh);ed.onKeyPress.add(kh);ed.onKeyUp.add(kh);}else t._pendingStyles=0;},_getSelectedBlocks:function(st,en){var ed=this.editor,dom=ed.dom,s=ed.selection,sb,eb,n,bl=[];sb=dom.getParent(st||s.getStart(),isBlock);eb=dom.getParent(en||s.getEnd(),isBlock);if(sb)bl.push(sb);if(sb&&eb&&sb!=eb){n=sb;while((n=n.nextSibling)&&n!=eb){if(isBlock(n))bl.push(n);}}if(eb&&sb!=eb)bl.push(eb);return bl;}});})();tinymce.create('tinymce.UndoManager',{index:0,data:null,typing:0,UndoManager:function(ed){var t=this,Dispatcher=tinymce.util.Dispatcher;t.editor=ed;t.data=[];t.onAdd=new Dispatcher(this);t.onUndo=new Dispatcher(this);t.onRedo=new Dispatcher(this);},add:function(l){var t=this,i,ed=t.editor,b,s=ed.settings,la;l=l||{};l.content=l.content||ed.getContent({format:'raw',no_events:1});l.content=l.content.replace(/^\s*|\s*$/g,'');la=t.data[t.index>0&&(t.index==0||t.index==t.data.length)?t.index-1:t.index];if(!l.initial&&la&&l.content==la.content)return null;if(s.custom_undo_redo_levels){if(t.data.length>s.custom_undo_redo_levels){for(i=0;i<t.data.length-1;i++)t.data[i]=t.data[i+1];t.data.length--;t.index=t.data.length;}}if(s.custom_undo_redo_restore_selection&&!l.initial)l.bookmark=b=l.bookmark||ed.selection.getBookmark();if(t.index<t.data.length)t.index++;if(t.data.length===0&&!l.initial)return null;t.data.length=t.index+1;t.data[t.index++]=l;if(l.initial)t.index=0;if(t.data.length==2&&t.data[0].initial)t.data[0].bookmark=b;t.onAdd.dispatch(t,l);ed.isNotDirty=0;return l;},undo:function(){var t=this,ed=t.editor,l=l,i;if(t.typing){t.add();t.typing=0;}if(t.index>0){if(t.index==t.data.length&&t.index>1){i=t.index;t.typing=0;if(!t.add())t.index=i;--t.index;}l=t.data[--t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onUndo.dispatch(t,l);}return l;},redo:function(){var t=this,ed=t.editor,l=null;if(t.index<t.data.length-1){l=t.data[++t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onRedo.dispatch(t,l);}return l;},clear:function(){var t=this;t.data=[];t.index=0;t.typing=0;t.add({initial:true});},hasUndo:function(){return this.index!=0||this.typing;},hasRedo:function(){return this.index<this.data.length-1;}});(function(){var Event,isIE,isGecko,isOpera,each,extend;Event=tinymce.dom.Event;isIE=tinymce.isIE;isGecko=tinymce.isGecko;isOpera=tinymce.isOpera;each=tinymce.each;extend=tinymce.extend;tinymce.create('tinymce.ForceBlocks',{ForceBlocks:function(ed){var t=this,s=ed.settings,elm;t.editor=ed;t.dom=ed.dom;elm=(s.forced_root_block||'p').toLowerCase();s.element=elm.toUpperCase();ed.onPreInit.add(t.setup,t);t.reOpera=new RegExp('(\\u00a0| | )<\/'+elm+'>','gi');t.rePadd=new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR1=new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR2=new RegExp('<p( )([^>]+)>( | )<\\\/p>|<p>( | )<\\\/p>'.replace(/p/g,elm),'gi');t.reBR2Nbsp=new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g,elm),'gi');t.reTrailBr=new RegExp('\\s*<br \\/>\\s*<\\\/p>'.replace(/p/g,elm),'gi');function padd(ed,o){if(isOpera)o.content=o.content.replace(t.reOpera,'</'+elm+'>');o.content=o.content.replace(t.rePadd,'<'+elm+'$1$2$3$4$5$6>\u00a0</'+elm+'>');if(!isIE&&!isOpera&&o.set){o.content=o.content.replace(t.reNbsp2BR1,'<'+elm+'$1$2><br /></'+elm+'>');o.content=o.content.replace(t.reNbsp2BR2,'<'+elm+'$1$2><br /></'+elm+'>');}else{o.content=o.content.replace(t.reBR2Nbsp,'<'+elm+'$1$2>\u00a0</'+elm+'>');o.content=o.content.replace(t.reTrailBr,'</'+elm+'>');}};ed.onBeforeSetContent.add(padd);ed.onPostProcess.add(padd);if(s.forced_root_block){ed.onInit.add(t.forceRoots,t);ed.onSetContent.add(t.forceRoots,t);ed.onBeforeGetContent.add(t.forceRoots,t);}},setup:function(){var t=this,ed=t.editor,s=ed.settings;if(s.forced_root_block){ed.onKeyUp.add(t.forceRoots,t);ed.onPreProcess.add(t.forceRoots,t);}if(s.force_br_newlines){if(isIE){ed.onKeyPress.add(function(ed,e){var n,s=ed.selection;if(e.keyCode==13&&s.getNode().nodeName!='LI'){s.setContent('<br id="__" /> ',{format:'raw'});n=ed.dom.get('__');n.removeAttribute('id');s.select(n);s.collapse();return Event.cancel(e);}});}return;}if(!isIE&&s.force_p_newlines){ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&!e.shiftKey){if(!t.insertPara(e))Event.cancel(e);}});if(isGecko){ed.onKeyDown.add(function(ed,e){if((e.keyCode==8||e.keyCode==46)&&!e.shiftKey)t.backspaceDelete(e,e.keyCode==8);});}}function ren(rn,na){var ne=ed.dom.create(na);each(rn.attributes,function(a){if(a.specified&&a.nodeValue)ne.setAttribute(a.nodeName.toLowerCase(),a.nodeValue);});each(rn.childNodes,function(n){ne.appendChild(n.cloneNode(true));});rn.parentNode.replaceChild(ne,rn);return ne;};if(isIE&&s.element!='P'){ed.onKeyPress.add(function(ed,e){t.lastElm=ed.selection.getNode().nodeName;});ed.onKeyUp.add(function(ed,e){var bl,sel=ed.selection,n=sel.getNode(),b=ed.getBody();if(b.childNodes.length===1&&n.nodeName=='P'){n=ren(n,s.element);sel.select(n);sel.collapse();ed.nodeChanged();}else if(e.keyCode==13&&!e.shiftKey&&t.lastElm!='P'){bl=ed.dom.getParent(n,'P');if(bl){ren(bl,s.element);ed.nodeChanged();}}});}},find:function(n,t,s){var ed=this.editor,w=ed.getDoc().createTreeWalker(n,4,null,false),c=-1;while(n=w.nextNode()){c++;if(t==0&&n==s)return c;if(t==1&&c==s)return n;}return-1;},forceRoots:function(ed,e){var t=this,ed=t.editor,b=ed.getBody(),d=ed.getDoc(),se=ed.selection,s=se.getSel(),r=se.getRng(),si=-2,ei,so,eo,tr,c=-0xFFFFFF;var nx,bl,bp,sp,le,nl=b.childNodes,i,n,eid;for(i=nl.length-1;i>=0;i--){nx=nl[i];if(nx.nodeType==3||(!t.dom.isBlock(nx)&&nx.nodeType!=8)){if(!bl){if(nx.nodeType!=3||/[^\s]/g.test(nx.nodeValue)){if(si==-2&&r){if(!isIE){if(r.startContainer.nodeType==1&&(n=r.startContainer.childNodes[r.startOffset])&&n.nodeType==1){eid=n.getAttribute("id");n.setAttribute("id","__mce");}else{if(ed.dom.getParent(r.startContainer,function(e){return e===b;})){so=r.startOffset;eo=r.endOffset;si=t.find(b,0,r.startContainer);ei=t.find(b,0,r.endContainer);}}}else{tr=d.body.createTextRange();tr.moveToElementText(b);tr.collapse(1);bp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(1);sp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(0);le=(tr.move('character',c)*-1)-sp;si=sp-bp;ei=le;}}bl=ed.dom.create(ed.settings.forced_root_block);bl.appendChild(nx.cloneNode(1));nx.parentNode.replaceChild(bl,nx);}}else{if(bl.hasChildNodes())bl.insertBefore(nx,bl.firstChild);else bl.appendChild(nx);}}else bl=null;}if(si!=-2){if(!isIE){bl=b.getElementsByTagName(ed.settings.element)[0];r=d.createRange();if(si!=-1)r.setStart(t.find(b,1,si),so);else r.setStart(bl,0);if(ei!=-1)r.setEnd(t.find(b,1,ei),eo);else r.setEnd(bl,0);if(s){s.removeAllRanges();s.addRange(r);}}else{try{r=s.createRange();r.moveToElementText(b);r.collapse(1);r.moveStart('character',si);r.moveEnd('character',ei);r.select();}catch(ex){}}}else if(!isIE&&(n=ed.dom.get('__mce'))){if(eid)n.setAttribute('id',eid);else n.removeAttribute('id');r=d.createRange();r.setStartBefore(n);r.setEndBefore(n);se.setRng(r);}},getParentBlock:function(n){var d=this.dom;return d.getParent(n,d.isBlock);},insertPara:function(e){var t=this,ed=t.editor,dom=ed.dom,d=ed.getDoc(),se=ed.settings,s=ed.selection.getSel(),r=s.getRangeAt(0),b=d.body;var rb,ra,dir,sn,so,en,eo,sb,eb,bn,bef,aft,sc,ec,n,vp=dom.getViewPort(ed.getWin()),y,ch,car;function isEmpty(n){n=n.innerHTML;n=n.replace(/<(img|hr|table)/gi,'-');n=n.replace(/<[^>]+>/g,'');return n.replace(/[ \t\r\n]+/g,'')=='';};rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(true);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(true);dir=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;sn=dir?s.anchorNode:s.focusNode;so=dir?s.anchorOffset:s.focusOffset;en=dir?s.focusNode:s.anchorNode;eo=dir?s.focusOffset:s.anchorOffset;if(sn===en&&/^(TD|TH)$/.test(sn.nodeName)){dom.remove(sn.firstChild);ed.dom.add(sn,se.element,null,'<br />');aft=ed.dom.add(sn,se.element,null,'<br />');r=d.createRange();r.selectNodeContents(aft);r.collapse(1);ed.selection.setRng(r);return false;}if(sn==b&&en==b&&b.firstChild&&ed.dom.isBlock(b.firstChild)){sn=en=sn.firstChild;so=eo=0;rb=d.createRange();rb.setStart(sn,0);ra=d.createRange();ra.setStart(en,0);}sn=sn.nodeName=="HTML"?d.body:sn;sn=sn.nodeName=="BODY"?sn.firstChild:sn;en=en.nodeName=="HTML"?d.body:en;en=en.nodeName=="BODY"?en.firstChild:en;sb=t.getParentBlock(sn);eb=t.getParentBlock(en);bn=sb?sb.nodeName:se.element;if(t.dom.getParent(sb,function(n){return/OL|UL|PRE/.test(n.nodeName);}))return true;if(sb&&(sb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(sb.style.position))){bn=se.element;sb=null;}if(eb&&(eb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(eb.style.position))){bn=se.element;eb=null;}if(/(TD|TABLE|TH|CAPTION)/.test(bn)||(sb&&bn=="DIV"&&/left|right/gi.test(sb.style.cssFloat))){bn=se.element;sb=eb=null;}bef=(sb&&sb.nodeName==bn)?sb.cloneNode(0):ed.dom.create(bn);aft=(eb&&eb.nodeName==bn)?eb.cloneNode(0):ed.dom.create(bn);aft.removeAttribute('id');if(/^(H[1-6])$/.test(bn)&&sn.nodeValue&&so==sn.nodeValue.length)aft=ed.dom.create(se.element);n=sc=sn;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;sc=n;}while((n=n.previousSibling?n.previousSibling:n.parentNode));n=ec=en;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;ec=n;}while((n=n.nextSibling?n.nextSibling:n.parentNode));if(sc.nodeName==bn)rb.setStart(sc,0);else rb.setStartBefore(sc);rb.setEnd(sn,so);bef.appendChild(rb.cloneContents()||d.createTextNode(''));try{ra.setEndAfter(ec);}catch(ex){}ra.setStart(en,eo);aft.appendChild(ra.cloneContents()||d.createTextNode(''));r=d.createRange();if(!sc.previousSibling&&sc.parentNode.nodeName==bn){r.setStartBefore(sc.parentNode);}else{if(rb.startContainer.nodeName==bn&&rb.startOffset==0)r.setStartBefore(rb.startContainer);else r.setStart(rb.startContainer,rb.startOffset);}if(!ec.nextSibling&&ec.parentNode.nodeName==bn)r.setEndAfter(ec.parentNode);else r.setEnd(ra.endContainer,ra.endOffset);r.deleteContents();if(isOpera)ed.getWin().scrollTo(0,vp.y);if(bef.firstChild&&bef.firstChild.nodeName==bn)bef.innerHTML=bef.firstChild.innerHTML;if(aft.firstChild&&aft.firstChild.nodeName==bn)aft.innerHTML=aft.firstChild.innerHTML;if(isEmpty(bef))bef.innerHTML='<br />';function appendStyles(e,en){var nl=[],nn,n,i;e.innerHTML='';if(se.keep_styles){n=en;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)){nn=n.cloneNode(false);dom.setAttrib(nn,'id','');nl.push(nn);}}while(n=n.parentNode);}if(nl.length>0){for(i=nl.length-1,nn=e;i>=0;i--)nn=nn.appendChild(nl[i]);nl[0].innerHTML=isOpera?' ':'<br />';return nl[0];}else e.innerHTML=isOpera?' ':'<br />';};if(isEmpty(aft))car=appendStyles(aft,en);if(isOpera&&parseFloat(opera.version())<9.5){r.insertNode(bef);r.insertNode(aft);}else{r.insertNode(aft);r.insertNode(bef);}aft.normalize();bef.normalize();function first(n){return d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode()||n;};r=d.createRange();r.selectNodeContents(isGecko?first(car||aft):car||aft);r.collapse(1);s.removeAllRanges();s.addRange(r);y=ed.dom.getPos(aft).y;ch=aft.clientHeight;if(y<vp.y||y+ch>vp.y+vp.h){ed.getWin().scrollTo(0,y<vp.y?y:y-vp.h+25);}return false;},backspaceDelete:function(e,bs){var t=this,ed=t.editor,b=ed.getBody(),n,se=ed.selection,r=se.getRng(),sc=r.startContainer,n,w,tn;if(sc&&ed.dom.isBlock(sc)&&!/^(TD|TH)$/.test(sc.nodeName)&&bs){if(sc.childNodes.length==0||(sc.childNodes.length==1&&sc.firstChild.nodeName=='BR')){n=sc;while((n=n.previousSibling)&&!ed.dom.isBlock(n));if(n){if(sc!=b.firstChild){w=ed.dom.doc.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(tn=w.nextNode())n=tn;r=ed.getDoc().createRange();r.setStart(n,n.nodeValue?n.nodeValue.length:0);r.setEnd(n,n.nodeValue?n.nodeValue.length:0);se.setRng(r);ed.dom.remove(sc);}return Event.cancel(e);}}}function handler(e){var pr;e=e.target;if(e&&e.parentNode&&e.nodeName=='BR'&&(n=t.getParentBlock(e))){pr=e.previousSibling;Event.remove(b,'DOMNodeInserted',handler);if(pr&&pr.nodeType==3&&/\s+$/.test(pr.nodeValue))return;if(e.previousSibling||e.nextSibling)ed.dom.remove(e);}};Event._add(b,'DOMNodeInserted',handler);window.setTimeout(function(){Event._remove(b,'DOMNodeInserted',handler);},1);}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,extend=tinymce.extend;tinymce.create('tinymce.ControlManager',{ControlManager:function(ed,s){var t=this,i;s=s||{};t.editor=ed;t.controls={};t.onAdd=new tinymce.util.Dispatcher(t);t.onPostRender=new tinymce.util.Dispatcher(t);t.prefix=s.prefix||ed.id+'_';t._cls={};t.onPostRender.add(function(){each(t.controls,function(c){c.postRender();});});},get:function(id){return this.controls[this.prefix+id]||this.controls[id];},setActive:function(id,s){var c=null;if(c=this.get(id))c.setActive(s);return c;},setDisabled:function(id,s){var c=null;if(c=this.get(id))c.setDisabled(s);return c;},add:function(c){var t=this;if(c){t.controls[c.id]=c;t.onAdd.dispatch(c,t);}return c;},createControl:function(n){var c,t=this,ed=t.editor;each(ed.plugins,function(p){if(p.createControl){c=p.createControl(n,t);if(c)return false;}});switch(n){case"|":case"separator":return t.createSeparator();}if(!c&&ed.buttons&&(c=ed.buttons[n]))return t.createButton(n,c);return t.add(c);},createDropMenu:function(id,s,cc){var t=this,ed=t.editor,c,bm,v,cls;s=extend({'class':'mceDropDown',constrain:ed.settings.constrain_menus},s);s['class']=s['class']+' '+ed.getParam('skin')+'Skin';if(v=ed.getParam('skin_variant'))s['class']+=' '+ed.getParam('skin')+'Skin'+v.substring(0,1).toUpperCase()+v.substring(1);id=t.prefix+id;cls=cc||t._cls.dropmenu||tinymce.ui.DropMenu;c=t.controls[id]=new cls(id,s);c.onAddItem.add(function(c,o){var s=o.settings;s.title=ed.getLang(s.title,s.title);if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,s.value);};}});ed.onRemove.add(function(){c.destroy();});if(tinymce.isIE){c.onShowMenu.add(function(){bm=ed.selection.getBookmark(1);});c.onHideMenu.add(function(){if(bm)ed.selection.moveToBookmark(bm);});}return t.add(c);},createListBox:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,scope:s.scope,control_manager:t},s);id=t.prefix+id;if(ed.settings.use_native_selects)c=new tinymce.ui.NativeListBox(id,s);else{cls=cc||t._cls.listbox||tinymce.ui.ListBox;c=new cls(id,s);}t.controls[id]=c;if(tinymce.isWebKit){c.onPostRender.add(function(c,n){Event.add(n,'mousedown',function(){ed.bookmark=ed.selection.getBookmark('simple');});Event.add(n,'focus',function(){ed.selection.moveToBookmark(ed.bookmark);ed.bookmark=null;});});}if(c.hideMenu)ed.onMouseDown.add(c.hideMenu,c);return t.add(c);},createButton:function(id,s,cc){var t=this,ed=t.editor,o,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.label=ed.translate(s.label);s.scope=s.scope||ed;if(!s.onclick&&!s.menu_button){s.onclick=function(){ed.execCommand(s.cmd,s.ui||false,s.value);};}s=extend({title:s.title,'class':'mce_'+id,unavailable_prefix:ed.getLang('unavailable',''),scope:s.scope,control_manager:t},s);id=t.prefix+id;if(s.menu_button){cls=cc||t._cls.menubutton||tinymce.ui.MenuButton;c=new cls(id,s);ed.onMouseDown.add(c.hideMenu,c);}else{cls=t._cls.button||tinymce.ui.Button;c=new cls(id,s);}return t.add(c);},createMenuButton:function(id,s,cc){s=s||{};s.menu_button=1;return this.createButton(id,s,cc);},createSplitButton:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,scope:s.scope,control_manager:t},s);id=t.prefix+id;cls=cc||t._cls.splitbutton||tinymce.ui.SplitButton;c=t.add(new cls(id,s));ed.onMouseDown.add(c.hideMenu,c);return c;},createColorSplitButton:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls,bm;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,'menu_class':ed.getParam('skin')+'Skin',scope:s.scope,more_colors_title:ed.getLang('more_colors')},s);id=t.prefix+id;cls=cc||t._cls.colorsplitbutton||tinymce.ui.ColorSplitButton;c=new cls(id,s);ed.onMouseDown.add(c.hideMenu,c);ed.onRemove.add(function(){c.destroy();});if(tinymce.isIE){c.onShowMenu.add(function(){bm=ed.selection.getBookmark(1);});c.onHideMenu.add(function(){if(bm){ed.selection.moveToBookmark(bm);bm=0;}});}return t.add(c);},createToolbar:function(id,s,cc){var c,t=this,cls;id=t.prefix+id;cls=cc||t._cls.toolbar||tinymce.ui.Toolbar;c=new cls(id,s);if(t.get(id))return null;return t.add(c);},createSeparator:function(cc){var cls=cc||this._cls.separator||tinymce.ui.Separator;return new cls();},setControlType:function(n,c){return this._cls[n.toLowerCase()]=c;},destroy:function(){each(this.controls,function(c){c.destroy();});this.controls=null;}});})();(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each,isIE=tinymce.isIE,isOpera=tinymce.isOpera;tinymce.create('tinymce.WindowManager',{WindowManager:function(ed){var t=this;t.editor=ed;t.onOpen=new Dispatcher(t);t.onClose=new Dispatcher(t);t.params={};t.features={};},open:function(s,p){var t=this,f='',x,y,mo=t.editor.settings.dialog_type=='modal',w,sw,sh,vp=tinymce.DOM.getViewPort(),u;s=s||{};p=p||{};sw=isOpera?vp.w:screen.width;sh=isOpera?vp.h:screen.height;s.name=s.name||'mc_'+new Date().getTime();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240);s.resizable=true;s.left=s.left||parseInt(sw/ 2.0) - (s.width /2.0);s.top=s.top||parseInt(sh/ 2.0) - (s.height /2.0);p.inline=false;p.mce_width=s.width;p.mce_height=s.height;p.mce_auto_focus=s.auto_focus;if(mo){if(isIE){s.center=true;s.help=false;s.dialogWidth=s.width+'px';s.dialogHeight=s.height+'px';s.scroll=s.scrollbars||false;}}each(s,function(v,k){if(tinymce.is(v,'boolean'))v=v?'yes':'no';if(!/^(name|url)$/.test(k)){if(isIE&&mo)f+=(f?';':'')+k+':'+v;else f+=(f?',':'')+k+'='+v;}});t.features=s;t.params=p;t.onOpen.dispatch(t,s,p);u=s.url||s.file;if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);try{if(isIE&&mo){w=1;window.showModalDialog(u,window,f);}else w=window.open(u,s.name,f);}catch(ex){}if(!w)alert(t.editor.getLang('popup_blocked'));},close:function(w){w.close();this.onClose.dispatch(this);},createInstance:function(cl,a,b,c,d,e){var f=tinymce.resolve(cl);return new f(a,b,c,d,e);},confirm:function(t,cb,s,w){w=w||window;cb.call(s||this,w.confirm(this._decode(this.editor.getLang(t,t))));},alert:function(tx,cb,s,w){var t=this;w=w||window;w.alert(t._decode(t.editor.getLang(tx,tx)));if(cb)cb.call(s||t);},_decode:function(s){return tinymce.DOM.decode(s).replace(/\\n/g,'\n');}});}()); \ No newline at end of file | |||
diff --git a/public/javascripts/tiny_mce/tiny_mce_popup.js b/public/javascripts/tiny_mce/tiny_mce_popup.js new file mode 100755 index 0000000..6475f39 --- /dev/null +++ b/public/javascripts/tiny_mce/tiny_mce_popup.js | |||
| @@ -0,0 +1,294 @@ | |||
| 1 | // Some global instances | ||
| 2 | var tinymce = null, tinyMCEPopup, tinyMCE; | ||
| 3 | |||
| 4 | tinyMCEPopup = { | ||
| 5 | init : function() { | ||
| 6 | var t = this, w, ti, li, q, i, it; | ||
| 7 | |||
| 8 | li = ('' + document.location.search).replace(/^\?/, '').split('&'); | ||
| 9 | q = {}; | ||
| 10 | for (i=0; i<li.length; i++) { | ||
| 11 | it = li[i].split('='); | ||
| 12 | q[unescape(it[0])] = unescape(it[1]); | ||
| 13 | } | ||
| 14 | |||
| 15 | if (q.mce_rdomain) | ||
| 16 | document.domain = q.mce_rdomain; | ||
| 17 | |||
| 18 | // Find window & API | ||
| 19 | w = t.getWin(); | ||
| 20 | tinymce = w.tinymce; | ||
| 21 | tinyMCE = w.tinyMCE; | ||
| 22 | t.editor = tinymce.EditorManager.activeEditor; | ||
| 23 | t.params = t.editor.windowManager.params; | ||
| 24 | t.features = t.editor.windowManager.features; | ||
| 25 | |||
| 26 | // Setup local DOM | ||
| 27 | t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document); | ||
| 28 | |||
| 29 | // Enables you to skip loading the default css | ||
| 30 | if (t.features.popup_css !== false) | ||
| 31 | t.dom.loadCSS(t.features.popup_css || t.editor.settings.popup_css); | ||
| 32 | |||
| 33 | // Setup on init listeners | ||
| 34 | t.listeners = []; | ||
| 35 | t.onInit = { | ||
| 36 | add : function(f, s) { | ||
| 37 | t.listeners.push({func : f, scope : s}); | ||
| 38 | } | ||
| 39 | }; | ||
| 40 | |||
| 41 | t.isWindow = !t.getWindowArg('mce_inline'); | ||
| 42 | t.id = t.getWindowArg('mce_window_id'); | ||
| 43 | t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window); | ||
| 44 | }, | ||
| 45 | |||
| 46 | getWin : function() { | ||
| 47 | return window.dialogArguments || opener || parent || top; | ||
| 48 | }, | ||
| 49 | |||
| 50 | getWindowArg : function(n, dv) { | ||
| 51 | var v = this.params[n]; | ||
| 52 | |||
| 53 | return tinymce.is(v) ? v : dv; | ||
| 54 | }, | ||
| 55 | |||
| 56 | getParam : function(n, dv) { | ||
| 57 | return this.editor.getParam(n, dv); | ||
| 58 | }, | ||
| 59 | |||
| 60 | getLang : function(n, dv) { | ||
| 61 | return this.editor.getLang(n, dv); | ||
| 62 | }, | ||
| 63 | |||
| 64 | execCommand : function(cmd, ui, val, a) { | ||
| 65 | a = a || {}; | ||
| 66 | a.skip_focus = 1; | ||
| 67 | |||
| 68 | this.restoreSelection(); | ||
| 69 | return this.editor.execCommand(cmd, ui, val, a); | ||
| 70 | }, | ||
| 71 | |||
| 72 | resizeToInnerSize : function() { | ||
| 73 | var t = this, n, b = document.body, vp = t.dom.getViewPort(window), dw, dh; | ||
| 74 | |||
| 75 | dw = t.getWindowArg('mce_width') - vp.w; | ||
| 76 | dh = t.getWindowArg('mce_height') - vp.h; | ||
| 77 | |||
| 78 | if (t.isWindow) | ||
| 79 | window.resizeBy(dw, dh); | ||
| 80 | else | ||
| 81 | t.editor.windowManager.resizeBy(dw, dh, t.id); | ||
| 82 | }, | ||
| 83 | |||
| 84 | executeOnLoad : function(s) { | ||
| 85 | this.onInit.add(function() { | ||
| 86 | eval(s); | ||
| 87 | }); | ||
| 88 | }, | ||
| 89 | |||
| 90 | storeSelection : function() { | ||
| 91 | this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark('simple'); | ||
| 92 | }, | ||
| 93 | |||
| 94 | restoreSelection : function() { | ||
| 95 | var t = tinyMCEPopup; | ||
| 96 | |||
| 97 | if (!t.isWindow && tinymce.isIE) | ||
| 98 | t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark); | ||
| 99 | }, | ||
| 100 | |||
| 101 | requireLangPack : function() { | ||
| 102 | var u = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url'); | ||
| 103 | |||
| 104 | if (u && this.editor.settings.language) { | ||
| 105 | u += '/langs/' + this.editor.settings.language + '_dlg.js'; | ||
| 106 | |||
| 107 | if (!tinymce.ScriptLoader.isDone(u)) { | ||
| 108 | document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"></script>'); | ||
| 109 | tinymce.ScriptLoader.markDone(u); | ||
| 110 | } | ||
| 111 | } | ||
| 112 | }, | ||
| 113 | |||
| 114 | pickColor : function(e, element_id) { | ||
| 115 | this.execCommand('mceColorPicker', true, { | ||
| 116 | color : document.getElementById(element_id).value, | ||
| 117 | func : function(c) { | ||
| 118 | document.getElementById(element_id).value = c; | ||
| 119 | |||
| 120 | try { | ||
| 121 | document.getElementById(element_id).onchange(); | ||
| 122 | } catch (ex) { | ||
| 123 | // Try fire event, ignore errors | ||
| 124 | } | ||
| 125 | } | ||
| 126 | }); | ||
| 127 | }, | ||
| 128 | |||
| 129 | openBrowser : function(element_id, type, option) { | ||
| 130 | tinyMCEPopup.restoreSelection(); | ||
| 131 | this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); | ||
| 132 | }, | ||
| 133 | |||
| 134 | confirm : function(t, cb, s) { | ||
| 135 | this.editor.windowManager.confirm(t, cb, s, window); | ||
| 136 | }, | ||
| 137 | |||
| 138 | alert : function(tx, cb, s) { | ||
| 139 | this.editor.windowManager.alert(tx, cb, s, window); | ||
| 140 | }, | ||
| 141 | |||
| 142 | close : function() { | ||
| 143 | var t = this; | ||
| 144 | |||
| 145 | // To avoid domain relaxing issue in Opera | ||
| 146 | function close() { | ||
| 147 | t.editor.windowManager.close(window); | ||
| 148 | tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup | ||
| 149 | }; | ||
| 150 | |||
| 151 | if (tinymce.isOpera) | ||
| 152 | t.getWin().setTimeout(close, 0); | ||
| 153 | else | ||
| 154 | close(); | ||
| 155 | }, | ||
| 156 | |||
| 157 | // Internal functions | ||
| 158 | |||
| 159 | _restoreSelection : function() { | ||
| 160 | var e = window.event.srcElement; | ||
| 161 | |||
| 162 | if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) | ||
| 163 | tinyMCEPopup.restoreSelection(); | ||
| 164 | }, | ||
| 165 | |||
| 166 | /* _restoreSelection : function() { | ||
| 167 | var e = window.event.srcElement; | ||
| 168 | |||
| 169 | // If user focus a non text input or textarea | ||
| 170 | if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text') | ||
| 171 | tinyMCEPopup.restoreSelection(); | ||
| 172 | },*/ | ||
| 173 | |||
| 174 | _onDOMLoaded : function() { | ||
| 175 | var t = this, ti = document.title, bm, h, nv; | ||
| 176 | |||
| 177 | // Translate page | ||
| 178 | if (t.features.translate_i18n !== false) { | ||
| 179 | h = document.body.innerHTML; | ||
| 180 | |||
| 181 | // Replace a=x with a="x" in IE | ||
| 182 | if (tinymce.isIE) | ||
| 183 | h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') | ||
| 184 | |||
| 185 | document.dir = t.editor.getParam('directionality',''); | ||
| 186 | |||
| 187 | if ((nv = t.editor.translate(h)) && nv != h) | ||
| 188 | document.body.innerHTML = nv; | ||
| 189 | |||
| 190 | if ((nv = t.editor.translate(ti)) && nv != ti) | ||
| 191 | document.title = ti = nv; | ||
| 192 | } | ||
| 193 | |||
| 194 | document.body.style.display = ''; | ||
| 195 | |||
| 196 | // Restore selection in IE when focus is placed on a non textarea or input element of the type text | ||
| 197 | if (tinymce.isIE) | ||
| 198 | document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection); | ||
| 199 | |||
| 200 | t.restoreSelection(); | ||
| 201 | t.resizeToInnerSize(); | ||
| 202 | |||
| 203 | // Set inline title | ||
| 204 | if (!t.isWindow) | ||
| 205 | t.editor.windowManager.setTitle(window, ti); | ||
| 206 | else | ||
| 207 | window.focus(); | ||
| 208 | |||
| 209 | if (!tinymce.isIE && !t.isWindow) { | ||
| 210 | tinymce.dom.Event._add(document, 'focus', function() { | ||
| 211 | t.editor.windowManager.focus(t.id) | ||
| 212 | }); | ||
| 213 | } | ||
| 214 | |||
| 215 | // Patch for accessibility | ||
| 216 | tinymce.each(t.dom.select('select'), function(e) { | ||
| 217 | e.onkeydown = tinyMCEPopup._accessHandler; | ||
| 218 | }); | ||
| 219 | |||
| 220 | // Call onInit | ||
| 221 | // Init must be called before focus so the selection won't get lost by the focus call | ||
| 222 | tinymce.each(t.listeners, function(o) { | ||
| 223 | o.func.call(o.scope, t.editor); | ||
| 224 | }); | ||
| 225 | |||
| 226 | // Move focus to window | ||
| 227 | if (t.getWindowArg('mce_auto_focus', true)) { | ||
| 228 | window.focus(); | ||
| 229 | |||
| 230 | // Focus element with mceFocus class | ||
| 231 | tinymce.each(document.forms, function(f) { | ||
| 232 | tinymce.each(f.elements, function(e) { | ||
| 233 | if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) { | ||
| 234 | e.focus(); | ||
| 235 | return false; // Break loop | ||
| 236 | } | ||
| 237 | }); | ||
| 238 | }); | ||
| 239 | } | ||
| 240 | |||
| 241 | document.onkeyup = tinyMCEPopup._closeWinKeyHandler; | ||
| 242 | }, | ||
| 243 | |||
| 244 | _accessHandler : function(e) { | ||
| 245 | e = e || window.event; | ||
| 246 | |||
| 247 | if (e.keyCode == 13 || e.keyCode == 32) { | ||
| 248 | e = e.target || e.srcElement; | ||
| 249 | |||
| 250 | if (e.onchange) | ||
| 251 | e.onchange(); | ||
| 252 | |||
| 253 | return tinymce.dom.Event.cancel(e); | ||
| 254 | } | ||
| 255 | }, | ||
| 256 | |||
| 257 | _closeWinKeyHandler : function(e) { | ||
| 258 | e = e || window.event; | ||
| 259 | |||
| 260 | if (e.keyCode == 27) | ||
| 261 | tinyMCEPopup.close(); | ||
| 262 | }, | ||
| 263 | |||
| 264 | _wait : function() { | ||
| 265 | var t = this, ti; | ||
| 266 | |||
| 267 | if (tinymce.isIE && document.location.protocol != 'https:') { | ||
| 268 | // Fake DOMContentLoaded on IE | ||
| 269 | document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>'); | ||
| 270 | document.getElementById("__ie_onload").onreadystatechange = function() { | ||
| 271 | if (this.readyState == "complete") { | ||
| 272 | t._onDOMLoaded(); | ||
| 273 | document.getElementById("__ie_onload").onreadystatechange = null; // Prevent leak | ||
| 274 | } | ||
| 275 | }; | ||
| 276 | } else { | ||
| 277 | if (tinymce.isIE || tinymce.isWebKit) { | ||
| 278 | ti = setInterval(function() { | ||
| 279 | if (/loaded|complete/.test(document.readyState)) { | ||
| 280 | clearInterval(ti); | ||
| 281 | t._onDOMLoaded(); | ||
| 282 | } | ||
| 283 | }, 10); | ||
| 284 | } else { | ||
| 285 | window.addEventListener('DOMContentLoaded', function() { | ||
| 286 | t._onDOMLoaded(); | ||
| 287 | }, false); | ||
| 288 | } | ||
| 289 | } | ||
| 290 | } | ||
| 291 | }; | ||
| 292 | |||
| 293 | tinyMCEPopup.init(); | ||
| 294 | tinyMCEPopup._wait(); // Wait for DOM Content Loaded | ||
diff --git a/public/javascripts/tiny_mce/tiny_mce_src.js b/public/javascripts/tiny_mce/tiny_mce_src.js new file mode 100755 index 0000000..cd83a45 --- /dev/null +++ b/public/javascripts/tiny_mce/tiny_mce_src.js | |||
| @@ -0,0 +1,11098 @@ | |||
| 1 | |||
| 2 | /* file:jscripts/tiny_mce/classes/tinymce.js */ | ||
| 3 | |||
| 4 | var tinymce = { | ||
| 5 | majorVersion : '3', | ||
| 6 | minorVersion : '2.1.1', | ||
| 7 | releaseDate : '2008-11-27', | ||
| 8 | |||
| 9 | _init : function() { | ||
| 10 | var t = this, d = document, w = window, na = navigator, ua = na.userAgent, i, nl, n, base, p, v; | ||
| 11 | |||
| 12 | // Browser checks | ||
| 13 | t.isOpera = w.opera && opera.buildNumber; | ||
| 14 | t.isWebKit = /WebKit/.test(ua); | ||
| 15 | t.isOldWebKit = t.isWebKit && !w.getSelection().getRangeAt; | ||
| 16 | t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName); | ||
| 17 | t.isIE6 = t.isIE && /MSIE [56]/.test(ua); | ||
| 18 | t.isGecko = !t.isWebKit && /Gecko/.test(ua); | ||
| 19 | t.isMac = ua.indexOf('Mac') != -1; | ||
| 20 | t.isAir = /adobeair/i.test(ua); | ||
| 21 | |||
| 22 | // TinyMCE .NET webcontrol might be setting the values for TinyMCE | ||
| 23 | if (w.tinyMCEPreInit) { | ||
| 24 | t.suffix = tinyMCEPreInit.suffix; | ||
| 25 | t.baseURL = tinyMCEPreInit.base; | ||
| 26 | t.query = tinyMCEPreInit.query; | ||
| 27 | return; | ||
| 28 | } | ||
| 29 | |||
| 30 | // Get suffix and base | ||
| 31 | t.suffix = ''; | ||
| 32 | |||
| 33 | // If base element found, add that infront of baseURL | ||
| 34 | nl = d.getElementsByTagName('base'); | ||
| 35 | for (i=0; i<nl.length; i++) { | ||
| 36 | if (v = nl[i].href) { | ||
| 37 | // Host only value like http://site.com or http://site.com:8008 | ||
| 38 | if (/^https?:\/\/[^\/]+$/.test(v)) | ||
| 39 | v += '/'; | ||
| 40 | |||
| 41 | base = v ? v.match(/.*\//)[0] : ''; // Get only directory | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | function getBase(n) { | ||
| 46 | if (n.src && /tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(n.src)) { | ||
| 47 | if (/_(src|dev)\.js/g.test(n.src)) | ||
| 48 | t.suffix = '_src'; | ||
| 49 | |||
| 50 | if ((p = n.src.indexOf('?')) != -1) | ||
| 51 | t.query = n.src.substring(p + 1); | ||
| 52 | |||
| 53 | t.baseURL = n.src.substring(0, n.src.lastIndexOf('/')); | ||
| 54 | |||
| 55 | // If path to script is relative and a base href was found add that one infront | ||
| 56 | if (base && t.baseURL.indexOf('://') == -1) | ||
| 57 | t.baseURL = base + t.baseURL; | ||
| 58 | |||
| 59 | return t.baseURL; | ||
| 60 | } | ||
| 61 | |||
| 62 | return null; | ||
| 63 | }; | ||
| 64 | |||
| 65 | // Check document | ||
| 66 | nl = d.getElementsByTagName('script'); | ||
| 67 | for (i=0; i<nl.length; i++) { | ||
| 68 | if (getBase(nl[i])) | ||
| 69 | return; | ||
| 70 | } | ||
| 71 | |||
| 72 | // Check head | ||
| 73 | n = d.getElementsByTagName('head')[0]; | ||
| 74 | if (n) { | ||
| 75 | nl = n.getElementsByTagName('script'); | ||
| 76 | for (i=0; i<nl.length; i++) { | ||
| 77 | if (getBase(nl[i])) | ||
| 78 | return; | ||
| 79 | } | ||
| 80 | } | ||
| 81 | |||
| 82 | return; | ||
| 83 | }, | ||
| 84 | |||
| 85 | is : function(o, t) { | ||
| 86 | var n = typeof(o); | ||
| 87 | |||
| 88 | if (!t) | ||
| 89 | return n != 'undefined'; | ||
| 90 | |||
| 91 | if (t == 'array' && (o instanceof Array)) | ||
| 92 | return true; | ||
| 93 | |||
| 94 | return n == t; | ||
| 95 | }, | ||
| 96 | |||
| 97 | // #if !jquery | ||
| 98 | |||
| 99 | each : function(o, cb, s) { | ||
| 100 | var n, l; | ||
| 101 | |||
| 102 | if (!o) | ||
| 103 | return 0; | ||
| 104 | |||
| 105 | s = s || o; | ||
| 106 | |||
| 107 | if (typeof(o.length) != 'undefined') { | ||
| 108 | // Indexed arrays, needed for Safari | ||
| 109 | for (n=0, l = o.length; n<l; n++) { | ||
| 110 | if (cb.call(s, o[n], n, o) === false) | ||
| 111 | return 0; | ||
| 112 | } | ||
| 113 | } else { | ||
| 114 | // Hashtables | ||
| 115 | for (n in o) { | ||
| 116 | if (o.hasOwnProperty(n)) { | ||
| 117 | if (cb.call(s, o[n], n, o) === false) | ||
| 118 | return 0; | ||
| 119 | } | ||
| 120 | } | ||
| 121 | } | ||
| 122 | |||
| 123 | return 1; | ||
| 124 | }, | ||
| 125 | |||
| 126 | map : function(a, f) { | ||
| 127 | var o = []; | ||
| 128 | |||
| 129 | tinymce.each(a, function(v) { | ||
| 130 | o.push(f(v)); | ||
| 131 | }); | ||
| 132 | |||
| 133 | return o; | ||
| 134 | }, | ||
| 135 | |||
| 136 | grep : function(a, f) { | ||
| 137 | var o = []; | ||
| 138 | |||
| 139 | tinymce.each(a, function(v) { | ||
| 140 | if (!f || f(v)) | ||
| 141 | o.push(v); | ||
| 142 | }); | ||
| 143 | |||
| 144 | return o; | ||
| 145 | }, | ||
| 146 | |||
| 147 | inArray : function(a, v) { | ||
| 148 | var i, l; | ||
| 149 | |||
| 150 | if (a) { | ||
| 151 | for (i = 0, l = a.length; i < l; i++) { | ||
| 152 | if (a[i] === v) | ||
| 153 | return i; | ||
| 154 | } | ||
| 155 | } | ||
| 156 | |||
| 157 | return -1; | ||
| 158 | }, | ||
| 159 | |||
| 160 | extend : function(o, e) { | ||
| 161 | var i, a = arguments; | ||
| 162 | |||
| 163 | for (i=1; i<a.length; i++) { | ||
| 164 | e = a[i]; | ||
| 165 | |||
| 166 | tinymce.each(e, function(v, n) { | ||
| 167 | if (typeof(v) !== 'undefined') | ||
| 168 | o[n] = v; | ||
| 169 | }); | ||
| 170 | } | ||
| 171 | |||
| 172 | return o; | ||
| 173 | }, | ||
| 174 | |||
| 175 | trim : function(s) { | ||
| 176 | return (s ? '' + s : '').replace(/^\s*|\s*$/g, ''); | ||
| 177 | }, | ||
| 178 | |||
| 179 | // #endif | ||
| 180 | |||
| 181 | create : function(s, p) { | ||
| 182 | var t = this, sp, ns, cn, scn, c, de = 0; | ||
| 183 | |||
| 184 | // Parse : <prefix> <class>:<super class> | ||
| 185 | s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); | ||
| 186 | cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name | ||
| 187 | |||
| 188 | // Create namespace for new class | ||
| 189 | ns = t.createNS(s[3].replace(/\.\w+$/, '')); | ||
| 190 | |||
| 191 | // Class already exists | ||
| 192 | if (ns[cn]) | ||
| 193 | return; | ||
| 194 | |||
| 195 | // Make pure static class | ||
| 196 | if (s[2] == 'static') { | ||
| 197 | ns[cn] = p; | ||
| 198 | |||
| 199 | if (this.onCreate) | ||
| 200 | this.onCreate(s[2], s[3], ns[cn]); | ||
| 201 | |||
| 202 | return; | ||
| 203 | } | ||
| 204 | |||
| 205 | // Create default constructor | ||
| 206 | if (!p[cn]) { | ||
| 207 | p[cn] = function() {}; | ||
| 208 | de = 1; | ||
| 209 | } | ||
| 210 | |||
| 211 | // Add constructor and methods | ||
| 212 | ns[cn] = p[cn]; | ||
| 213 | t.extend(ns[cn].prototype, p); | ||
| 214 | |||
| 215 | // Extend | ||
| 216 | if (s[5]) { | ||
| 217 | sp = t.resolve(s[5]).prototype; | ||
| 218 | scn = s[5].match(/\.(\w+)$/i)[1]; // Class name | ||
| 219 | |||
| 220 | // Extend constructor | ||
| 221 | c = ns[cn]; | ||
| 222 | if (de) { | ||
| 223 | // Add passthrough constructor | ||
| 224 | ns[cn] = function() { | ||
| 225 | return sp[scn].apply(this, arguments); | ||
| 226 | }; | ||
| 227 | } else { | ||
| 228 | // Add inherit constructor | ||
| 229 | ns[cn] = function() { | ||
| 230 | this.parent = sp[scn]; | ||
| 231 | return c.apply(this, arguments); | ||
| 232 | }; | ||
| 233 | } | ||
| 234 | ns[cn].prototype[cn] = ns[cn]; | ||
| 235 | |||
| 236 | // Add super methods | ||
| 237 | t.each(sp, function(f, n) { | ||
| 238 | ns[cn].prototype[n] = sp[n]; | ||
| 239 | }); | ||
| 240 | |||
| 241 | // Add overridden methods | ||
| 242 | t.each(p, function(f, n) { | ||
| 243 | // Extend methods if needed | ||
| 244 | if (sp[n]) { | ||
| 245 | ns[cn].prototype[n] = function() { | ||
| 246 | this.parent = sp[n]; | ||
| 247 | return f.apply(this, arguments); | ||
| 248 | }; | ||
| 249 | } else { | ||
| 250 | if (n != cn) | ||
| 251 | ns[cn].prototype[n] = f; | ||
| 252 | } | ||
| 253 | }); | ||
| 254 | } | ||
| 255 | |||
| 256 | // Add static methods | ||
| 257 | t.each(p['static'], function(f, n) { | ||
| 258 | ns[cn][n] = f; | ||
| 259 | }); | ||
| 260 | |||
| 261 | if (this.onCreate) | ||
| 262 | this.onCreate(s[2], s[3], ns[cn].prototype); | ||
| 263 | }, | ||
| 264 | |||
| 265 | walk : function(o, f, n, s) { | ||
| 266 | s = s || this; | ||
| 267 | |||
| 268 | if (o) { | ||
| 269 | if (n) | ||
| 270 | o = o[n]; | ||
| 271 | |||
| 272 | tinymce.each(o, function(o, i) { | ||
| 273 | if (f.call(s, o, i, n) === false) | ||
| 274 | return false; | ||
| 275 | |||
| 276 | tinymce.walk(o, f, n, s); | ||
| 277 | }); | ||
| 278 | } | ||
| 279 | }, | ||
| 280 | |||
| 281 | createNS : function(n, o) { | ||
| 282 | var i, v; | ||
| 283 | |||
| 284 | o = o || window; | ||
| 285 | |||
| 286 | n = n.split('.'); | ||
| 287 | for (i=0; i<n.length; i++) { | ||
| 288 | v = n[i]; | ||
| 289 | |||
| 290 | if (!o[v]) | ||
| 291 | o[v] = {}; | ||
| 292 | |||
| 293 | o = o[v]; | ||
| 294 | } | ||
| 295 | |||
| 296 | return o; | ||
| 297 | }, | ||
| 298 | |||
| 299 | resolve : function(n, o) { | ||
| 300 | var i, l; | ||
| 301 | |||
| 302 | o = o || window; | ||
| 303 | |||
| 304 | n = n.split('.'); | ||
| 305 | for (i=0, l = n.length; i<l; i++) { | ||
| 306 | o = o[n[i]]; | ||
| 307 | |||
| 308 | if (!o) | ||
| 309 | break; | ||
| 310 | } | ||
| 311 | |||
| 312 | return o; | ||
| 313 | }, | ||
| 314 | |||
| 315 | addUnload : function(f, s) { | ||
| 316 | var t = this, w = window; | ||
| 317 | |||
| 318 | f = {func : f, scope : s || this}; | ||
| 319 | |||
| 320 | if (!t.unloads) { | ||
| 321 | function unload() { | ||
| 322 | var li = t.unloads, o, n; | ||
| 323 | |||
| 324 | if (li) { | ||
| 325 | // Call unload handlers | ||
| 326 | for (n in li) { | ||
| 327 | o = li[n]; | ||
| 328 | |||
| 329 | if (o && o.func) | ||
| 330 | o.func.call(o.scope, 1); // Send in one arg to distinct unload and user destroy | ||
| 331 | } | ||
| 332 | |||
| 333 | // Detach unload function | ||
| 334 | if (w.detachEvent) { | ||
| 335 | w.detachEvent('onbeforeunload', fakeUnload); | ||
| 336 | w.detachEvent('onunload', unload); | ||
| 337 | } else if (w.removeEventListener) | ||
| 338 | w.removeEventListener('unload', unload, false); | ||
| 339 | |||
| 340 | // Destroy references | ||
| 341 | t.unloads = o = li = w = unload = null; | ||
| 342 | |||
| 343 | // Run garbarge collector on IE | ||
| 344 | if (window.CollectGarbage) | ||
| 345 | window.CollectGarbage(); | ||
| 346 | } | ||
| 347 | }; | ||
| 348 | |||
| 349 | function fakeUnload() { | ||
| 350 | var d = document; | ||
| 351 | |||
| 352 | // Is there things still loading, then do some magic | ||
| 353 | if (d.readyState == 'interactive') { | ||
| 354 | function stop() { | ||
| 355 | // Prevent memory leak | ||
| 356 | d.detachEvent('onstop', stop); | ||
| 357 | |||
| 358 | // Call unload handler | ||
| 359 | unload(); | ||
| 360 | |||
| 361 | d = null; | ||
| 362 | }; | ||
| 363 | |||
| 364 | // Fire unload when the currently loading page is stopped | ||
| 365 | d.attachEvent('onstop', stop); | ||
| 366 | |||
| 367 | // Remove onstop listener after a while to prevent the unload function | ||
| 368 | // to execute if the user presses cancel in an onbeforeunload | ||
| 369 | // confirm dialog and then presses the browser stop button | ||
| 370 | window.setTimeout(function() { | ||
| 371 | d.detachEvent('onstop', stop); | ||
| 372 | }, 0); | ||
| 373 | } | ||
| 374 | }; | ||
| 375 | |||
| 376 | // Attach unload handler | ||
| 377 | if (w.attachEvent) { | ||
| 378 | w.attachEvent('onunload', unload); | ||
| 379 | w.attachEvent('onbeforeunload', fakeUnload); | ||
| 380 | } else if (w.addEventListener) | ||
| 381 | w.addEventListener('unload', unload, false); | ||
| 382 | |||
| 383 | // Setup initial unload handler array | ||
| 384 | t.unloads = [f]; | ||
| 385 | } else | ||
| 386 | t.unloads.push(f); | ||
| 387 | |||
| 388 | return f; | ||
| 389 | }, | ||
| 390 | |||
| 391 | removeUnload : function(f) { | ||
| 392 | var u = this.unloads, r = null; | ||
| 393 | |||
| 394 | tinymce.each(u, function(o, i) { | ||
| 395 | if (o && o.func == f) { | ||
| 396 | u.splice(i, 1); | ||
| 397 | r = f; | ||
| 398 | return false; | ||
| 399 | } | ||
| 400 | }); | ||
| 401 | |||
| 402 | return r; | ||
| 403 | }, | ||
| 404 | |||
| 405 | explode : function(s, d) { | ||
| 406 | return s ? tinymce.map(s.split(d || ','), tinymce.trim) : s; | ||
| 407 | }, | ||
| 408 | |||
| 409 | _addVer : function(u) { | ||
| 410 | var v; | ||
| 411 | |||
| 412 | if (!this.query) | ||
| 413 | return u; | ||
| 414 | |||
| 415 | v = (u.indexOf('?') == -1 ? '?' : '&') + this.query; | ||
| 416 | |||
| 417 | if (u.indexOf('#') == -1) | ||
| 418 | return u + v; | ||
| 419 | |||
| 420 | return u.replace('#', v + '#'); | ||
| 421 | } | ||
| 422 | |||
| 423 | }; | ||
| 424 | |||
| 425 | // Required for GZip AJAX loading | ||
| 426 | window.tinymce = tinymce; | ||
| 427 | |||
| 428 | // Initialize the API | ||
| 429 | tinymce._init(); | ||
| 430 | |||
| 431 | /* file:jscripts/tiny_mce/classes/adapter/jquery/adapter.js */ | ||
| 432 | |||
| 433 | |||
| 434 | /* file:jscripts/tiny_mce/classes/adapter/prototype/adapter.js */ | ||
| 435 | |||
| 436 | |||
| 437 | /* file:jscripts/tiny_mce/classes/util/Dispatcher.js */ | ||
| 438 | |||
| 439 | tinymce.create('tinymce.util.Dispatcher', { | ||
| 440 | scope : null, | ||
| 441 | listeners : null, | ||
| 442 | |||
| 443 | Dispatcher : function(s) { | ||
| 444 | this.scope = s || this; | ||
| 445 | this.listeners = []; | ||
| 446 | }, | ||
| 447 | |||
| 448 | add : function(cb, s) { | ||
| 449 | this.listeners.push({cb : cb, scope : s || this.scope}); | ||
| 450 | |||
| 451 | return cb; | ||
| 452 | }, | ||
| 453 | |||
| 454 | addToTop : function(cb, s) { | ||
| 455 | this.listeners.unshift({cb : cb, scope : s || this.scope}); | ||
| 456 | |||
| 457 | return cb; | ||
| 458 | }, | ||
| 459 | |||
| 460 | remove : function(cb) { | ||
| 461 | var l = this.listeners, o = null; | ||
| 462 | |||
| 463 | tinymce.each(l, function(c, i) { | ||
| 464 | if (cb == c.cb) { | ||
| 465 | o = cb; | ||
| 466 | l.splice(i, 1); | ||
| 467 | return false; | ||
| 468 | } | ||
| 469 | }); | ||
| 470 | |||
| 471 | return o; | ||
| 472 | }, | ||
| 473 | |||
| 474 | dispatch : function() { | ||
| 475 | var s, a = arguments, i, li = this.listeners, c; | ||
| 476 | |||
| 477 | // Needs to be a real loop since the listener count might change while looping | ||
| 478 | // And this is also more efficient | ||
| 479 | for (i = 0; i<li.length; i++) { | ||
| 480 | c = li[i]; | ||
| 481 | s = c.cb.apply(c.scope, a); | ||
| 482 | |||
| 483 | if (s === false) | ||
| 484 | break; | ||
| 485 | } | ||
| 486 | |||
| 487 | return s; | ||
| 488 | } | ||
| 489 | |||
| 490 | }); | ||
| 491 | |||
| 492 | /* file:jscripts/tiny_mce/classes/util/URI.js */ | ||
| 493 | |||
| 494 | (function() { | ||
| 495 | var each = tinymce.each; | ||
| 496 | |||
| 497 | tinymce.create('tinymce.util.URI', { | ||
| 498 | URI : function(u, s) { | ||
| 499 | var t = this, o, a, b; | ||
| 500 | |||
| 501 | // Default settings | ||
| 502 | s = t.settings = s || {}; | ||
| 503 | |||
| 504 | // Strange app protocol or local anchor | ||
| 505 | if (/^(mailto|news|javascript|about):/i.test(u) || /^\s*#/.test(u)) { | ||
| 506 | t.source = u; | ||
| 507 | return; | ||
| 508 | } | ||
| 509 | |||
| 510 | // Absolute path with no host, fake host and protocol | ||
| 511 | if (u.indexOf('/') === 0 && u.indexOf('//') !== 0) | ||
| 512 | u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u; | ||
| 513 | |||
| 514 | // Relative path | ||
| 515 | if (u.indexOf(':/') === -1 && u.indexOf('//') !== 0) | ||
| 516 | u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u); | ||
| 517 | |||
| 518 | // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri) | ||
| 519 | u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something | ||
| 520 | u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u); | ||
| 521 | each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) { | ||
| 522 | var s = u[i]; | ||
| 523 | |||
| 524 | // Zope 3 workaround, they use @@something | ||
| 525 | if (s) | ||
| 526 | s = s.replace(/\(mce_at\)/g, '@@'); | ||
| 527 | |||
| 528 | t[v] = s; | ||
| 529 | }); | ||
| 530 | |||
| 531 | if (b = s.base_uri) { | ||
| 532 | if (!t.protocol) | ||
| 533 | t.protocol = b.protocol; | ||
| 534 | |||
| 535 | if (!t.userInfo) | ||
| 536 | t.userInfo = b.userInfo; | ||
| 537 | |||
| 538 | if (!t.port && t.host == 'mce_host') | ||
| 539 | t.port = b.port; | ||
| 540 | |||
| 541 | if (!t.host || t.host == 'mce_host') | ||
| 542 | t.host = b.host; | ||
| 543 | |||
| 544 | t.source = ''; | ||
| 545 | } | ||
| 546 | |||
| 547 | //t.path = t.path || '/'; | ||
| 548 | }, | ||
| 549 | |||
| 550 | setPath : function(p) { | ||
| 551 | var t = this; | ||
| 552 | |||
| 553 | p = /^(.*?)\/?(\w+)?$/.exec(p); | ||
| 554 | |||
| 555 | // Update path parts | ||
| 556 | t.path = p[0]; | ||
| 557 | t.directory = p[1]; | ||
| 558 | t.file = p[2]; | ||
| 559 | |||
| 560 | // Rebuild source | ||
| 561 | t.source = ''; | ||
| 562 | t.getURI(); | ||
| 563 | }, | ||
| 564 | |||
| 565 | toRelative : function(u) { | ||
| 566 | var t = this, o; | ||
| 567 | |||
| 568 | if (u === "./") | ||
| 569 | return u; | ||
| 570 | |||
| 571 | u = new tinymce.util.URI(u, {base_uri : t}); | ||
| 572 | |||
| 573 | // Not on same domain/port or protocol | ||
| 574 | if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol) | ||
| 575 | return u.getURI(); | ||
| 576 | |||
| 577 | o = t.toRelPath(t.path, u.path); | ||
| 578 | |||
| 579 | // Add query | ||
| 580 | if (u.query) | ||
| 581 | o += '?' + u.query; | ||
| 582 | |||
| 583 | // Add anchor | ||
| 584 | if (u.anchor) | ||
| 585 | o += '#' + u.anchor; | ||
| 586 | |||
| 587 | return o; | ||
| 588 | }, | ||
| 589 | |||
| 590 | toAbsolute : function(u, nh) { | ||
| 591 | var u = new tinymce.util.URI(u, {base_uri : this}); | ||
| 592 | |||
| 593 | return u.getURI(this.host == u.host ? nh : 0); | ||
| 594 | }, | ||
| 595 | |||
| 596 | toRelPath : function(base, path) { | ||
| 597 | var items, bp = 0, out = '', i, l; | ||
| 598 | |||
| 599 | // Split the paths | ||
| 600 | base = base.substring(0, base.lastIndexOf('/')); | ||
| 601 | base = base.split('/'); | ||
| 602 | items = path.split('/'); | ||
| 603 | |||
| 604 | if (base.length >= items.length) { | ||
| 605 | for (i = 0, l = base.length; i < l; i++) { | ||
| 606 | if (i >= items.length || base[i] != items[i]) { | ||
| 607 | bp = i + 1; | ||
| 608 | break; | ||
| 609 | } | ||
| 610 | } | ||
| 611 | } | ||
| 612 | |||
| 613 | if (base.length < items.length) { | ||
| 614 | for (i = 0, l = items.length; i < l; i++) { | ||
| 615 | if (i >= base.length || base[i] != items[i]) { | ||
| 616 | bp = i + 1; | ||
| 617 | break; | ||
| 618 | } | ||
| 619 | } | ||
| 620 | } | ||
| 621 | |||
| 622 | if (bp == 1) | ||
| 623 | return path; | ||
| 624 | |||
| 625 | for (i = 0, l = base.length - (bp - 1); i < l; i++) | ||
| 626 | out += "../"; | ||
| 627 | |||
| 628 | for (i = bp - 1, l = items.length; i < l; i++) { | ||
| 629 | if (i != bp - 1) | ||
| 630 | out += "/" + items[i]; | ||
| 631 | else | ||
| 632 | out += items[i]; | ||
| 633 | } | ||
| 634 | |||
| 635 | return out; | ||
| 636 | }, | ||
| 637 | |||
| 638 | toAbsPath : function(base, path) { | ||
| 639 | var i, nb = 0, o = []; | ||
| 640 | |||
| 641 | // Split paths | ||
| 642 | base = base.split('/'); | ||
| 643 | path = path.split('/'); | ||
| 644 | |||
| 645 | // Remove empty chunks | ||
| 646 | each(base, function(k) { | ||
| 647 | if (k) | ||
| 648 | o.push(k); | ||
| 649 | }); | ||
| 650 | |||
| 651 | base = o; | ||
| 652 | |||
| 653 | // Merge relURLParts chunks | ||
| 654 | for (i = path.length - 1, o = []; i >= 0; i--) { | ||
| 655 | // Ignore empty or . | ||
| 656 | if (path[i].length == 0 || path[i] == ".") | ||
| 657 | continue; | ||
| 658 | |||
| 659 | // Is parent | ||
| 660 | if (path[i] == '..') { | ||
| 661 | nb++; | ||
| 662 | continue; | ||
| 663 | } | ||
| 664 | |||
| 665 | // Move up | ||
| 666 | if (nb > 0) { | ||
| 667 | nb--; | ||
| 668 | continue; | ||
| 669 | } | ||
| 670 | |||
| 671 | o.push(path[i]); | ||
| 672 | } | ||
| 673 | |||
| 674 | i = base.length - nb; | ||
| 675 | |||
| 676 | // If /a/b/c or / | ||
| 677 | if (i <= 0) | ||
| 678 | return '/' + o.reverse().join('/'); | ||
| 679 | |||
| 680 | return '/' + base.slice(0, i).join('/') + '/' + o.reverse().join('/'); | ||
| 681 | }, | ||
| 682 | |||
| 683 | getURI : function(nh) { | ||
| 684 | var s, t = this; | ||
| 685 | |||
| 686 | // Rebuild source | ||
| 687 | if (!t.source || nh) { | ||
| 688 | s = ''; | ||
| 689 | |||
| 690 | if (!nh) { | ||
| 691 | if (t.protocol) | ||
| 692 | s += t.protocol + '://'; | ||
| 693 | |||
| 694 | if (t.userInfo) | ||
| 695 | s += t.userInfo + '@'; | ||
| 696 | |||
| 697 | if (t.host) | ||
| 698 | s += t.host; | ||
| 699 | |||
| 700 | if (t.port) | ||
| 701 | s += ':' + t.port; | ||
| 702 | } | ||
| 703 | |||
| 704 | if (t.path) | ||
| 705 | s += t.path; | ||
| 706 | |||
| 707 | if (t.query) | ||
| 708 | s += '?' + t.query; | ||
| 709 | |||
| 710 | if (t.anchor) | ||
| 711 | s += '#' + t.anchor; | ||
| 712 | |||
| 713 | t.source = s; | ||
| 714 | } | ||
| 715 | |||
| 716 | return t.source; | ||
| 717 | } | ||
| 718 | |||
| 719 | }); | ||
| 720 | })(); | ||
| 721 | |||
| 722 | /* file:jscripts/tiny_mce/classes/util/Cookie.js */ | ||
| 723 | |||
| 724 | (function() { | ||
| 725 | var each = tinymce.each; | ||
| 726 | |||
| 727 | tinymce.create('static tinymce.util.Cookie', { | ||
| 728 | getHash : function(n) { | ||
| 729 | var v = this.get(n), h; | ||
| 730 | |||
| 731 | if (v) { | ||
| 732 | each(v.split('&'), function(v) { | ||
| 733 | v = v.split('='); | ||
| 734 | h = h || {}; | ||
| 735 | h[unescape(v[0])] = unescape(v[1]); | ||
| 736 | }); | ||
| 737 | } | ||
| 738 | |||
| 739 | return h; | ||
| 740 | }, | ||
| 741 | |||
| 742 | setHash : function(n, v, e, p, d, s) { | ||
| 743 | var o = ''; | ||
| 744 | |||
| 745 | each(v, function(v, k) { | ||
| 746 | o += (!o ? '' : '&') + escape(k) + '=' + escape(v); | ||
| 747 | }); | ||
| 748 | |||
| 749 | this.set(n, o, e, p, d, s); | ||
| 750 | }, | ||
| 751 | |||
| 752 | get : function(n) { | ||
| 753 | var c = document.cookie, e, p = n + "=", b; | ||
| 754 | |||
| 755 | // Strict mode | ||
| 756 | if (!c) | ||
| 757 | return; | ||
| 758 | |||
| 759 | b = c.indexOf("; " + p); | ||
| 760 | |||
| 761 | if (b == -1) { | ||
| 762 | b = c.indexOf(p); | ||
| 763 | |||
| 764 | if (b != 0) | ||
| 765 | return null; | ||
| 766 | } else | ||
| 767 | b += 2; | ||
| 768 | |||
| 769 | e = c.indexOf(";", b); | ||
| 770 | |||
| 771 | if (e == -1) | ||
| 772 | e = c.length; | ||
| 773 | |||
| 774 | return unescape(c.substring(b + p.length, e)); | ||
| 775 | }, | ||
| 776 | |||
| 777 | set : function(n, v, e, p, d, s) { | ||
| 778 | document.cookie = n + "=" + escape(v) + | ||
| 779 | ((e) ? "; expires=" + e.toGMTString() : "") + | ||
| 780 | ((p) ? "; path=" + escape(p) : "") + | ||
| 781 | ((d) ? "; domain=" + d : "") + | ||
| 782 | ((s) ? "; secure" : ""); | ||
| 783 | }, | ||
| 784 | |||
| 785 | remove : function(n, p) { | ||
| 786 | var d = new Date(); | ||
| 787 | |||
| 788 | d.setTime(d.getTime() - 1000); | ||
| 789 | |||
| 790 | this.set(n, '', d, p, d); | ||
| 791 | } | ||
| 792 | |||
| 793 | }); | ||
| 794 | })(); | ||
| 795 | |||
| 796 | /* file:jscripts/tiny_mce/classes/util/JSON.js */ | ||
| 797 | |||
| 798 | tinymce.create('static tinymce.util.JSON', { | ||
| 799 | serialize : function(o) { | ||
| 800 | var i, v, s = tinymce.util.JSON.serialize, t; | ||
| 801 | |||
| 802 | if (o == null) | ||
| 803 | return 'null'; | ||
| 804 | |||
| 805 | t = typeof o; | ||
| 806 | |||
| 807 | if (t == 'string') { | ||
| 808 | v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; | ||
| 809 | |||
| 810 | return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) { | ||
| 811 | i = v.indexOf(b); | ||
| 812 | |||
| 813 | if (i + 1) | ||
| 814 | return '\\' + v.charAt(i + 1); | ||
| 815 | |||
| 816 | a = b.charCodeAt().toString(16); | ||
| 817 | |||
| 818 | return '\\u' + '0000'.substring(a.length) + a; | ||
| 819 | }) + '"'; | ||
| 820 | } | ||
| 821 | |||
| 822 | if (t == 'object') { | ||
| 823 | if (o instanceof Array) { | ||
| 824 | for (i=0, v = '['; i<o.length; i++) | ||
| 825 | v += (i > 0 ? ',' : '') + s(o[i]); | ||
| 826 | |||
| 827 | return v + ']'; | ||
| 828 | } | ||
| 829 | |||
| 830 | v = '{'; | ||
| 831 | |||
| 832 | for (i in o) | ||
| 833 | v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : ''; | ||
| 834 | |||
| 835 | return v + '}'; | ||
| 836 | } | ||
| 837 | |||
| 838 | return '' + o; | ||
| 839 | }, | ||
| 840 | |||
| 841 | parse : function(s) { | ||
| 842 | try { | ||
| 843 | return eval('(' + s + ')'); | ||
| 844 | } catch (ex) { | ||
| 845 | // Ignore | ||
| 846 | } | ||
| 847 | } | ||
| 848 | |||
| 849 | }); | ||
| 850 | |||
| 851 | /* file:jscripts/tiny_mce/classes/util/XHR.js */ | ||
| 852 | |||
| 853 | tinymce.create('static tinymce.util.XHR', { | ||
| 854 | send : function(o) { | ||
| 855 | var x, t, w = window, c = 0; | ||
| 856 | |||
| 857 | // Default settings | ||
| 858 | o.scope = o.scope || this; | ||
| 859 | o.success_scope = o.success_scope || o.scope; | ||
| 860 | o.error_scope = o.error_scope || o.scope; | ||
| 861 | o.async = o.async === false ? false : true; | ||
| 862 | o.data = o.data || ''; | ||
| 863 | |||
| 864 | function get(s) { | ||
| 865 | x = 0; | ||
| 866 | |||
| 867 | try { | ||
| 868 | x = new ActiveXObject(s); | ||
| 869 | } catch (ex) { | ||
| 870 | } | ||
| 871 | |||
| 872 | return x; | ||
| 873 | }; | ||
| 874 | |||
| 875 | x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP'); | ||
| 876 | |||
| 877 | if (x) { | ||
| 878 | if (x.overrideMimeType) | ||
| 879 | x.overrideMimeType(o.content_type); | ||
| 880 | |||
| 881 | x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async); | ||
| 882 | |||
| 883 | if (o.content_type) | ||
| 884 | x.setRequestHeader('Content-Type', o.content_type); | ||
| 885 | |||
| 886 | x.send(o.data); | ||
| 887 | |||
| 888 | function ready() { | ||
| 889 | if (!o.async || x.readyState == 4 || c++ > 10000) { | ||
| 890 | if (o.success && c < 10000 && x.status == 200) | ||
| 891 | o.success.call(o.success_scope, '' + x.responseText, x, o); | ||
| 892 | else if (o.error) | ||
| 893 | o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o); | ||
| 894 | |||
| 895 | x = null; | ||
| 896 | } else | ||
| 897 | w.setTimeout(ready, 10); | ||
| 898 | }; | ||
| 899 | |||
| 900 | // Syncronous request | ||
| 901 | if (!o.async) | ||
| 902 | return ready(); | ||
| 903 | |||
| 904 | // Wait for response, onReadyStateChange can not be used since it leaks memory in IE | ||
| 905 | t = w.setTimeout(ready, 10); | ||
| 906 | } | ||
| 907 | |||
| 908 | } | ||
| 909 | }); | ||
| 910 | |||
| 911 | /* file:jscripts/tiny_mce/classes/util/JSONRequest.js */ | ||
| 912 | |||
| 913 | (function() { | ||
| 914 | var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR; | ||
| 915 | |||
| 916 | tinymce.create('tinymce.util.JSONRequest', { | ||
| 917 | JSONRequest : function(s) { | ||
| 918 | this.settings = extend({ | ||
| 919 | }, s); | ||
| 920 | this.count = 0; | ||
| 921 | }, | ||
| 922 | |||
| 923 | send : function(o) { | ||
| 924 | var ecb = o.error, scb = o.success; | ||
| 925 | |||
| 926 | o = extend(this.settings, o); | ||
| 927 | |||
| 928 | o.success = function(c, x) { | ||
| 929 | c = JSON.parse(c); | ||
| 930 | |||
| 931 | if (typeof(c) == 'undefined') { | ||
| 932 | c = { | ||
| 933 | error : 'JSON Parse error.' | ||
| 934 | }; | ||
| 935 | } | ||
| 936 | |||
| 937 | if (c.error) | ||
| 938 | ecb.call(o.error_scope || o.scope, c.error, x); | ||
| 939 | else | ||
| 940 | scb.call(o.success_scope || o.scope, c.result); | ||
| 941 | }; | ||
| 942 | |||
| 943 | o.error = function(ty, x) { | ||
| 944 | ecb.call(o.error_scope || o.scope, ty, x); | ||
| 945 | }; | ||
| 946 | |||
| 947 | o.data = JSON.serialize({ | ||
| 948 | id : o.id || 'c' + (this.count++), | ||
| 949 | method : o.method, | ||
| 950 | params : o.params | ||
| 951 | }); | ||
| 952 | |||
| 953 | // JSON content type for Ruby on rails. Bug: #1883287 | ||
| 954 | o.content_type = 'application/json'; | ||
| 955 | |||
| 956 | XHR.send(o); | ||
| 957 | }, | ||
| 958 | |||
| 959 | 'static' : { | ||
| 960 | sendRPC : function(o) { | ||
| 961 | return new tinymce.util.JSONRequest().send(o); | ||
| 962 | } | ||
| 963 | } | ||
| 964 | |||
| 965 | }); | ||
| 966 | }()); | ||
| 967 | /* file:jscripts/tiny_mce/classes/dom/DOMUtils.js */ | ||
| 968 | |||
| 969 | (function() { | ||
| 970 | // Shorten names | ||
| 971 | var each = tinymce.each, is = tinymce.is; | ||
| 972 | var isWebKit = tinymce.isWebKit, isIE = tinymce.isIE; | ||
| 973 | |||
| 974 | tinymce.create('tinymce.dom.DOMUtils', { | ||
| 975 | doc : null, | ||
| 976 | root : null, | ||
| 977 | files : null, | ||
| 978 | listeners : {}, | ||
| 979 | pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, | ||
| 980 | cache : {}, | ||
| 981 | idPattern : /^#[\w]+$/, | ||
| 982 | elmPattern : /^[\w_*]+$/, | ||
| 983 | elmClassPattern : /^([\w_]*)\.([\w_]+)$/, | ||
| 984 | props : { | ||
| 985 | "for" : "htmlFor", | ||
| 986 | "class" : "className", | ||
| 987 | className : "className", | ||
| 988 | checked : "checked", | ||
| 989 | disabled : "disabled", | ||
| 990 | maxlength : "maxLength", | ||
| 991 | readonly : "readOnly", | ||
| 992 | selected : "selected", | ||
| 993 | value : "value", | ||
| 994 | id : "id", | ||
| 995 | name : "name", | ||
| 996 | type : "type" | ||
| 997 | }, | ||
| 998 | |||
| 999 | DOMUtils : function(d, s) { | ||
| 1000 | var t = this; | ||
| 1001 | |||
| 1002 | t.doc = d; | ||
| 1003 | t.win = window; | ||
| 1004 | t.files = {}; | ||
| 1005 | t.cssFlicker = false; | ||
| 1006 | t.counter = 0; | ||
| 1007 | t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat"; | ||
| 1008 | t.stdMode = d.documentMode === 8; | ||
| 1009 | |||
| 1010 | this.settings = s = tinymce.extend({ | ||
| 1011 | keep_values : false, | ||
| 1012 | hex_colors : 1, | ||
| 1013 | process_html : 1 | ||
| 1014 | }, s); | ||
| 1015 | |||
| 1016 | // Fix IE6SP2 flicker and check it failed for pre SP2 | ||
| 1017 | if (tinymce.isIE6) { | ||
| 1018 | try { | ||
| 1019 | d.execCommand('BackgroundImageCache', false, true); | ||
| 1020 | } catch (e) { | ||
| 1021 | t.cssFlicker = true; | ||
| 1022 | } | ||
| 1023 | } | ||
| 1024 | |||
| 1025 | tinymce.addUnload(t.destroy, t); | ||
| 1026 | }, | ||
| 1027 | |||
| 1028 | getRoot : function() { | ||
| 1029 | var t = this, s = t.settings; | ||
| 1030 | |||
| 1031 | return (s && t.get(s.root_element)) || t.doc.body; | ||
| 1032 | }, | ||
| 1033 | |||
| 1034 | getViewPort : function(w) { | ||
| 1035 | var d, b; | ||
| 1036 | |||
| 1037 | w = !w ? this.win : w; | ||
| 1038 | d = w.document; | ||
| 1039 | b = this.boxModel ? d.documentElement : d.body; | ||
| 1040 | |||
| 1041 | // Returns viewport size excluding scrollbars | ||
| 1042 | return { | ||
| 1043 | x : w.pageXOffset || b.scrollLeft, | ||
| 1044 | y : w.pageYOffset || b.scrollTop, | ||
| 1045 | w : w.innerWidth || b.clientWidth, | ||
| 1046 | h : w.innerHeight || b.clientHeight | ||
| 1047 | }; | ||
| 1048 | }, | ||
| 1049 | |||
| 1050 | getRect : function(e) { | ||
| 1051 | var p, t = this, sr; | ||
| 1052 | |||
| 1053 | e = t.get(e); | ||
| 1054 | p = t.getPos(e); | ||
| 1055 | sr = t.getSize(e); | ||
| 1056 | |||
| 1057 | return { | ||
| 1058 | x : p.x, | ||
| 1059 | y : p.y, | ||
| 1060 | w : sr.w, | ||
| 1061 | h : sr.h | ||
| 1062 | }; | ||
| 1063 | }, | ||
| 1064 | |||
| 1065 | getSize : function(e) { | ||
| 1066 | var t = this, w, h; | ||
| 1067 | |||
| 1068 | e = t.get(e); | ||
| 1069 | w = t.getStyle(e, 'width'); | ||
| 1070 | h = t.getStyle(e, 'height'); | ||
| 1071 | |||
| 1072 | // Non pixel value, then force offset/clientWidth | ||
| 1073 | if (w.indexOf('px') === -1) | ||
| 1074 | w = 0; | ||
| 1075 | |||
| 1076 | // Non pixel value, then force offset/clientWidth | ||
| 1077 | if (h.indexOf('px') === -1) | ||
| 1078 | h = 0; | ||
| 1079 | |||
| 1080 | return { | ||
| 1081 | w : parseInt(w) || e.offsetWidth || e.clientWidth, | ||
| 1082 | h : parseInt(h) || e.offsetHeight || e.clientHeight | ||
| 1083 | }; | ||
| 1084 | }, | ||
| 1085 | |||
| 1086 | getParent : function(n, f, r) { | ||
| 1087 | var na, se = this.settings; | ||
| 1088 | |||
| 1089 | n = this.get(n); | ||
| 1090 | |||
| 1091 | if (se.strict_root) | ||
| 1092 | r = r || this.getRoot(); | ||
| 1093 | |||
| 1094 | // Wrap node name as func | ||
| 1095 | if (is(f, 'string')) { | ||
| 1096 | na = f.toUpperCase(); | ||
| 1097 | |||
| 1098 | f = function(n) { | ||
| 1099 | var s = false; | ||
| 1100 | |||
| 1101 | // Any element | ||
| 1102 | if (n.nodeType == 1 && na === '*') { | ||
| 1103 | s = true; | ||
| 1104 | return false; | ||
| 1105 | } | ||
| 1106 | |||
| 1107 | each(na.split(','), function(v) { | ||
| 1108 | if (n.nodeType == 1 && ((se.strict && n.nodeName.toUpperCase() == v) || n.nodeName.toUpperCase() == v)) { | ||
| 1109 | s = true; | ||
| 1110 | return false; // Break loop | ||
| 1111 | } | ||
| 1112 | }); | ||
| 1113 | |||
| 1114 | return s; | ||
| 1115 | }; | ||
| 1116 | } | ||
| 1117 | |||
| 1118 | while (n) { | ||
| 1119 | if (n == r) | ||
| 1120 | return null; | ||
| 1121 | |||
| 1122 | if (f(n)) | ||
| 1123 | return n; | ||
| 1124 | |||
| 1125 | n = n.parentNode; | ||
| 1126 | } | ||
| 1127 | |||
| 1128 | return null; | ||
| 1129 | }, | ||
| 1130 | |||
| 1131 | get : function(e) { | ||
| 1132 | var n; | ||
| 1133 | |||
| 1134 | if (e && this.doc && typeof(e) == 'string') { | ||
| 1135 | n = e; | ||
| 1136 | e = this.doc.getElementById(e); | ||
| 1137 | |||
| 1138 | // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick | ||
| 1139 | if (e && e.id !== n) | ||
| 1140 | return this.doc.getElementsByName(n)[1]; | ||
| 1141 | } | ||
| 1142 | |||
| 1143 | return e; | ||
| 1144 | }, | ||
| 1145 | |||
| 1146 | |||
| 1147 | // #if !jquery | ||
| 1148 | |||
| 1149 | select : function(pa, s) { | ||
| 1150 | var t = this, cs, c, pl, o = [], x, i, l, n, xp; | ||
| 1151 | |||
| 1152 | s = t.get(s) || t.doc; | ||
| 1153 | |||
| 1154 | // Look for native support and use that if it's found | ||
| 1155 | if (s.querySelectorAll) { | ||
| 1156 | // Element scope then use temp id | ||
| 1157 | // We need to do this to be compatible with other implementations | ||
| 1158 | // See bug report: http://bugs.webkit.org/show_bug.cgi?id=17461 | ||
| 1159 | if (s != t.doc) { | ||
| 1160 | i = s.id; | ||
| 1161 | s.id = '_mc_tmp'; | ||
| 1162 | pa = '#_mc_tmp ' + pa; | ||
| 1163 | } | ||
| 1164 | |||
| 1165 | // Select elements | ||
| 1166 | l = tinymce.grep(s.querySelectorAll(pa)); | ||
| 1167 | |||
| 1168 | // Restore old id | ||
| 1169 | s.id = i; | ||
| 1170 | |||
| 1171 | return l; | ||
| 1172 | } | ||
| 1173 | |||
| 1174 | if (!t.selectorRe) | ||
| 1175 | t.selectorRe = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i;; | ||
| 1176 | |||
| 1177 | // Air doesn't support eval due to security sandboxing and querySelectorAll isn't supported yet | ||
| 1178 | if (tinymce.isAir) { | ||
| 1179 | each(tinymce.explode(pa), function(v) { | ||
| 1180 | if (!(xp = t.cache[v])) { | ||
| 1181 | xp = ''; | ||
| 1182 | |||
| 1183 | each(v.split(' '), function(v) { | ||
| 1184 | v = t.selectorRe.exec(v); | ||
| 1185 | |||
| 1186 | xp += v[1] ? '//' + v[1] : '//*'; | ||
| 1187 | |||
| 1188 | // Id | ||
| 1189 | if (v[2]) | ||
| 1190 | xp += "[@id='" + v[2] + "']"; | ||
| 1191 | |||
| 1192 | // Class | ||
| 1193 | if (v[3]) { | ||
| 1194 | each(v[3].split('.'), function(n) { | ||
| 1195 | xp += "[@class = '" + n + "' or contains(concat(' ', @class, ' '), ' " + n + " ')]"; | ||
| 1196 | }); | ||
| 1197 | } | ||
| 1198 | }); | ||
| 1199 | |||
| 1200 | t.cache[v] = xp; | ||
| 1201 | } | ||
| 1202 | |||
| 1203 | xp = t.doc.evaluate(xp, s, null, 4, null); | ||
| 1204 | |||
| 1205 | while (n = xp.iterateNext()) | ||
| 1206 | o.push(n); | ||
| 1207 | }); | ||
| 1208 | |||
| 1209 | return o; | ||
| 1210 | } | ||
| 1211 | |||
| 1212 | if (t.settings.strict) { | ||
| 1213 | function get(s, n) { | ||
| 1214 | return s.getElementsByTagName(n.toLowerCase()); | ||
| 1215 | }; | ||
| 1216 | } else { | ||
| 1217 | function get(s, n) { | ||
| 1218 | return s.getElementsByTagName(n); | ||
| 1219 | }; | ||
| 1220 | } | ||
| 1221 | |||
| 1222 | // Simple element pattern. For example: "p" or "*" | ||
| 1223 | if (t.elmPattern.test(pa)) { | ||
| 1224 | x = get(s, pa); | ||
| 1225 | |||
| 1226 | for (i = 0, l = x.length; i<l; i++) | ||
| 1227 | o.push(x[i]); | ||
| 1228 | |||
| 1229 | return o; | ||
| 1230 | } | ||
| 1231 | |||
| 1232 | // Simple class pattern. For example: "p.class" or ".class" | ||
| 1233 | if (t.elmClassPattern.test(pa)) { | ||
| 1234 | pl = t.elmClassPattern.exec(pa); | ||
| 1235 | x = get(s, pl[1] || '*'); | ||
| 1236 | c = ' ' + pl[2] + ' '; | ||
| 1237 | |||
| 1238 | for (i = 0, l = x.length; i<l; i++) { | ||
| 1239 | n = x[i]; | ||
| 1240 | |||
| 1241 | if (n.className && (' ' + n.className + ' ').indexOf(c) !== -1) | ||
| 1242 | o.push(n); | ||
| 1243 | } | ||
| 1244 | |||
| 1245 | return o; | ||
| 1246 | } | ||
| 1247 | |||
| 1248 | function collect(n) { | ||
| 1249 | if (!n.mce_save) { | ||
| 1250 | n.mce_save = 1; | ||
| 1251 | o.push(n); | ||
| 1252 | } | ||
| 1253 | }; | ||
| 1254 | |||
| 1255 | function collectIE(n) { | ||
| 1256 | if (!n.getAttribute('mce_save')) { | ||
| 1257 | n.setAttribute('mce_save', '1'); | ||
| 1258 | o.push(n); | ||
| 1259 | } | ||
| 1260 | }; | ||
| 1261 | |||
| 1262 | function find(n, f, r) { | ||
| 1263 | var i, l, nl = get(r, n); | ||
| 1264 | |||
| 1265 | for (i = 0, l = nl.length; i < l; i++) | ||
| 1266 | f(nl[i]); | ||
| 1267 | }; | ||
| 1268 | |||
| 1269 | each(pa.split(','), function(v, i) { | ||
| 1270 | v = tinymce.trim(v); | ||
| 1271 | |||
| 1272 | // Simple element pattern, most common in TinyMCE | ||
| 1273 | if (t.elmPattern.test(v)) { | ||
| 1274 | each(get(s, v), function(n) { | ||
| 1275 | collect(n); | ||
| 1276 | }); | ||
| 1277 | |||
| 1278 | return; | ||
| 1279 | } | ||
| 1280 | |||
| 1281 | // Simple element pattern with class, fairly common in TinyMCE | ||
| 1282 | if (t.elmClassPattern.test(v)) { | ||
| 1283 | x = t.elmClassPattern.exec(v); | ||
| 1284 | |||
| 1285 | each(get(s, x[1]), function(n) { | ||
| 1286 | if (t.hasClass(n, x[2])) | ||
| 1287 | collect(n); | ||
| 1288 | }); | ||
| 1289 | |||
| 1290 | return; | ||
| 1291 | } | ||
| 1292 | |||
| 1293 | if (!(cs = t.cache[pa])) { | ||
| 1294 | cs = 'x=(function(cf, s) {'; | ||
| 1295 | pl = v.split(' '); | ||
| 1296 | |||
| 1297 | each(pl, function(v) { | ||
| 1298 | var p = t.selectorRe.exec(v); | ||
| 1299 | |||
| 1300 | // Find elements | ||
| 1301 | p[1] = p[1] || '*'; | ||
| 1302 | cs += 'find("' + p[1] + '", function(n) {'; | ||
| 1303 | |||
| 1304 | // Check id | ||
| 1305 | if (p[2]) | ||
| 1306 | cs += 'if (n.id !== "' + p[2] + '") return;'; | ||
| 1307 | |||
| 1308 | // Check classes | ||
| 1309 | if (p[3]) { | ||
| 1310 | cs += 'var c = " " + n.className + " ";'; | ||
| 1311 | cs += 'if ('; | ||
| 1312 | c = ''; | ||
| 1313 | each(p[3].split('.'), function(v) { | ||
| 1314 | if (v) | ||
| 1315 | c += (c ? '||' : '') + 'c.indexOf(" ' + v + ' ") === -1'; | ||
| 1316 | }); | ||
| 1317 | cs += c + ') return;'; | ||
| 1318 | } | ||
| 1319 | }); | ||
| 1320 | |||
| 1321 | cs += 'cf(n);'; | ||
| 1322 | |||
| 1323 | for (i = pl.length - 1; i >= 0; i--) | ||
| 1324 | cs += '}, ' + (i ? 'n' : 's') + ');'; | ||
| 1325 | |||
| 1326 | cs += '})'; | ||
| 1327 | |||
| 1328 | // Compile CSS pattern function | ||
| 1329 | t.cache[pa] = cs = eval(cs); | ||
| 1330 | } | ||
| 1331 | |||
| 1332 | // Run selector function | ||
| 1333 | cs(isIE ? collectIE : collect, s); | ||
| 1334 | }); | ||
| 1335 | |||
| 1336 | // Cleanup | ||
| 1337 | each(o, function(n) { | ||
| 1338 | if (isIE) | ||
| 1339 | n.removeAttribute('mce_save'); | ||
| 1340 | else | ||
| 1341 | delete n.mce_save; | ||
| 1342 | }); | ||
| 1343 | |||
| 1344 | return o; | ||
| 1345 | }, | ||
| 1346 | |||
| 1347 | // #endif | ||
| 1348 | |||
| 1349 | add : function(p, n, a, h, c) { | ||
| 1350 | var t = this; | ||
| 1351 | |||
| 1352 | return this.run(p, function(p) { | ||
| 1353 | var e, k; | ||
| 1354 | |||
| 1355 | e = is(n, 'string') ? t.doc.createElement(n) : n; | ||
| 1356 | t.setAttribs(e, a); | ||
| 1357 | |||
| 1358 | if (h) { | ||
| 1359 | if (h.nodeType) | ||
| 1360 | e.appendChild(h); | ||
| 1361 | else | ||
| 1362 | t.setHTML(e, h); | ||
| 1363 | } | ||
| 1364 | |||
| 1365 | return !c ? p.appendChild(e) : e; | ||
| 1366 | }); | ||
| 1367 | }, | ||
| 1368 | |||
| 1369 | create : function(n, a, h) { | ||
| 1370 | return this.add(this.doc.createElement(n), n, a, h, 1); | ||
| 1371 | }, | ||
| 1372 | |||
| 1373 | createHTML : function(n, a, h) { | ||
| 1374 | var o = '', t = this, k; | ||
| 1375 | |||
| 1376 | o += '<' + n; | ||
| 1377 | |||
| 1378 | for (k in a) { | ||
| 1379 | if (a.hasOwnProperty(k)) | ||
| 1380 | o += ' ' + k + '="' + t.encode(a[k]) + '"'; | ||
| 1381 | } | ||
| 1382 | |||
| 1383 | if (tinymce.is(h)) | ||
| 1384 | return o + '>' + h + '</' + n + '>'; | ||
| 1385 | |||
| 1386 | return o + ' />'; | ||
| 1387 | }, | ||
| 1388 | |||
| 1389 | remove : function(n, k) { | ||
| 1390 | return this.run(n, function(n) { | ||
| 1391 | var p, g; | ||
| 1392 | |||
| 1393 | p = n.parentNode; | ||
| 1394 | |||
| 1395 | if (!p) | ||
| 1396 | return null; | ||
| 1397 | |||
| 1398 | if (k) { | ||
| 1399 | each (n.childNodes, function(c) { | ||
| 1400 | p.insertBefore(c.cloneNode(true), n); | ||
| 1401 | }); | ||
| 1402 | } | ||
| 1403 | |||
| 1404 | // Fix IE psuedo leak | ||
| 1405 | /* if (isIE) { | ||
| 1406 | p = n.cloneNode(true); | ||
| 1407 | n.outerHTML = ''; | ||
| 1408 | |||
| 1409 | return p; | ||
| 1410 | }*/ | ||
| 1411 | |||
| 1412 | return p.removeChild(n); | ||
| 1413 | }); | ||
| 1414 | }, | ||
| 1415 | |||
| 1416 | // #if !jquery | ||
| 1417 | |||
| 1418 | setStyle : function(n, na, v) { | ||
| 1419 | var t = this; | ||
| 1420 | |||
| 1421 | return t.run(n, function(e) { | ||
| 1422 | var s, i; | ||
| 1423 | |||
| 1424 | s = e.style; | ||
| 1425 | |||
| 1426 | // Camelcase it, if needed | ||
| 1427 | na = na.replace(/-(\D)/g, function(a, b){ | ||
| 1428 | return b.toUpperCase(); | ||
| 1429 | }); | ||
| 1430 | |||
| 1431 | // Default px suffix on these | ||
| 1432 | if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) | ||
| 1433 | v += 'px'; | ||
| 1434 | |||
| 1435 | switch (na) { | ||
| 1436 | case 'opacity': | ||
| 1437 | // IE specific opacity | ||
| 1438 | if (isIE) { | ||
| 1439 | s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; | ||
| 1440 | |||
| 1441 | if (!n.currentStyle || !n.currentStyle.hasLayout) | ||
| 1442 | s.display = 'inline-block'; | ||
| 1443 | } | ||
| 1444 | |||
| 1445 | // Fix for older browsers | ||
| 1446 | s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || ''; | ||
| 1447 | break; | ||
| 1448 | |||
| 1449 | case 'float': | ||
| 1450 | isIE ? s.styleFloat = v : s.cssFloat = v; | ||
| 1451 | break; | ||
| 1452 | |||
| 1453 | default: | ||
| 1454 | s[na] = v || ''; | ||
| 1455 | } | ||
| 1456 | |||
| 1457 | // Force update of the style data | ||
| 1458 | if (t.settings.update_styles) | ||
| 1459 | t.setAttrib(e, 'mce_style'); | ||
| 1460 | }); | ||
| 1461 | }, | ||
| 1462 | |||
| 1463 | getStyle : function(n, na, c) { | ||
| 1464 | n = this.get(n); | ||
| 1465 | |||
| 1466 | if (!n) | ||
| 1467 | return false; | ||
| 1468 | |||
| 1469 | // Gecko | ||
| 1470 | if (this.doc.defaultView && c) { | ||
| 1471 | // Remove camelcase | ||
| 1472 | na = na.replace(/[A-Z]/g, function(a){ | ||
| 1473 | return '-' + a; | ||
| 1474 | }); | ||
| 1475 | |||
| 1476 | try { | ||
| 1477 | return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); | ||
| 1478 | } catch (ex) { | ||
| 1479 | // Old safari might fail | ||
| 1480 | return null; | ||
| 1481 | } | ||
| 1482 | } | ||
| 1483 | |||
| 1484 | // Camelcase it, if needed | ||
| 1485 | na = na.replace(/-(\D)/g, function(a, b){ | ||
| 1486 | return b.toUpperCase(); | ||
| 1487 | }); | ||
| 1488 | |||
| 1489 | if (na == 'float') | ||
| 1490 | na = isIE ? 'styleFloat' : 'cssFloat'; | ||
| 1491 | |||
| 1492 | // IE & Opera | ||
| 1493 | if (n.currentStyle && c) | ||
| 1494 | return n.currentStyle[na]; | ||
| 1495 | |||
| 1496 | return n.style[na]; | ||
| 1497 | }, | ||
| 1498 | |||
| 1499 | setStyles : function(e, o) { | ||
| 1500 | var t = this, s = t.settings, ol; | ||
| 1501 | |||
| 1502 | ol = s.update_styles; | ||
| 1503 | s.update_styles = 0; | ||
| 1504 | |||
| 1505 | each(o, function(v, n) { | ||
| 1506 | t.setStyle(e, n, v); | ||
| 1507 | }); | ||
| 1508 | |||
| 1509 | // Update style info | ||
| 1510 | s.update_styles = ol; | ||
| 1511 | if (s.update_styles) | ||
| 1512 | t.setAttrib(e, s.cssText); | ||
| 1513 | }, | ||
| 1514 | |||
| 1515 | setAttrib : function(e, n, v) { | ||
| 1516 | var t = this; | ||
| 1517 | |||
| 1518 | // Whats the point | ||
| 1519 | if (!e || !n) | ||
| 1520 | return; | ||
| 1521 | |||
| 1522 | // Strict XML mode | ||
| 1523 | if (t.settings.strict) | ||
| 1524 | n = n.toLowerCase(); | ||
| 1525 | |||
| 1526 | return this.run(e, function(e) { | ||
| 1527 | var s = t.settings; | ||
| 1528 | |||
| 1529 | switch (n) { | ||
| 1530 | case "style": | ||
| 1531 | if (!is(v, 'string')) { | ||
| 1532 | each(v, function(v, n) { | ||
| 1533 | t.setStyle(e, n, v); | ||
| 1534 | }); | ||
| 1535 | |||
| 1536 | return; | ||
| 1537 | } | ||
| 1538 | |||
| 1539 | // No mce_style for elements with these since they might get resized by the user | ||
| 1540 | if (s.keep_values) { | ||
| 1541 | if (v && !t._isRes(v)) | ||
| 1542 | e.setAttribute('mce_style', v, 2); | ||
| 1543 | else | ||
| 1544 | e.removeAttribute('mce_style', 2); | ||
| 1545 | } | ||
| 1546 | |||
| 1547 | e.style.cssText = v; | ||
| 1548 | break; | ||
| 1549 | |||
| 1550 | case "class": | ||
| 1551 | e.className = v || ''; // Fix IE null bug | ||
| 1552 | break; | ||
| 1553 | |||
| 1554 | case "src": | ||
| 1555 | case "href": | ||
| 1556 | if (s.keep_values) { | ||
| 1557 | if (s.url_converter) | ||
| 1558 | v = s.url_converter.call(s.url_converter_scope || t, v, n, e); | ||
| 1559 | |||
| 1560 | t.setAttrib(e, 'mce_' + n, v, 2); | ||
| 1561 | } | ||
| 1562 | |||
| 1563 | break; | ||
| 1564 | |||
| 1565 | case "shape": | ||
| 1566 | e.setAttribute('mce_style', v); | ||
| 1567 | break; | ||
| 1568 | } | ||
| 1569 | |||
| 1570 | if (is(v) && v !== null && v.length !== 0) | ||
| 1571 | e.setAttribute(n, '' + v, 2); | ||
| 1572 | else | ||
| 1573 | e.removeAttribute(n, 2); | ||
| 1574 | }); | ||
| 1575 | }, | ||
| 1576 | |||
| 1577 | setAttribs : function(e, o) { | ||
| 1578 | var t = this; | ||
| 1579 | |||
| 1580 | return this.run(e, function(e) { | ||
| 1581 | each(o, function(v, n) { | ||
| 1582 | t.setAttrib(e, n, v); | ||
| 1583 | }); | ||
| 1584 | }); | ||
| 1585 | }, | ||
| 1586 | |||
| 1587 | // #endif | ||
| 1588 | |||
| 1589 | getAttrib : function(e, n, dv) { | ||
| 1590 | var v, t = this; | ||
| 1591 | |||
| 1592 | e = t.get(e); | ||
| 1593 | |||
| 1594 | if (!e || e.nodeType !== 1) | ||
| 1595 | return false; | ||
| 1596 | |||
| 1597 | if (!is(dv)) | ||
| 1598 | dv = ''; | ||
| 1599 | |||
| 1600 | // Try the mce variant for these | ||
| 1601 | if (/^(src|href|style|coords|shape)$/.test(n)) { | ||
| 1602 | v = e.getAttribute("mce_" + n); | ||
| 1603 | |||
| 1604 | if (v) | ||
| 1605 | return v; | ||
| 1606 | } | ||
| 1607 | |||
| 1608 | if (isIE && t.props[n]) { | ||
| 1609 | v = e[t.props[n]]; | ||
| 1610 | v = v && v.nodeValue ? v.nodeValue : v; | ||
| 1611 | } | ||
| 1612 | |||
| 1613 | if (!v) | ||
| 1614 | v = e.getAttribute(n, 2); | ||
| 1615 | |||
| 1616 | if (n === 'style') { | ||
| 1617 | v = v || e.style.cssText; | ||
| 1618 | |||
| 1619 | if (v) { | ||
| 1620 | v = t.serializeStyle(t.parseStyle(v)); | ||
| 1621 | |||
| 1622 | if (t.settings.keep_values && !t._isRes(v)) | ||
| 1623 | e.setAttribute('mce_style', v); | ||
| 1624 | } | ||
| 1625 | } | ||
| 1626 | |||
| 1627 | // Remove Apple and WebKit stuff | ||
| 1628 | if (isWebKit && n === "class" && v) | ||
| 1629 | v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); | ||
| 1630 | |||
| 1631 | // Handle IE issues | ||
| 1632 | if (isIE) { | ||
| 1633 | switch (n) { | ||
| 1634 | case 'rowspan': | ||
| 1635 | case 'colspan': | ||
| 1636 | // IE returns 1 as default value | ||
| 1637 | if (v === 1) | ||
| 1638 | v = ''; | ||
| 1639 | |||
| 1640 | break; | ||
| 1641 | |||
| 1642 | case 'size': | ||
| 1643 | // IE returns +0 as default value for size | ||
| 1644 | if (v === '+0' || v === 20) | ||
| 1645 | v = ''; | ||
| 1646 | |||
| 1647 | break; | ||
| 1648 | |||
| 1649 | case 'width': | ||
| 1650 | case 'height': | ||
| 1651 | case 'vspace': | ||
| 1652 | case 'checked': | ||
| 1653 | case 'disabled': | ||
| 1654 | case 'readonly': | ||
| 1655 | if (v === 0) | ||
| 1656 | v = ''; | ||
| 1657 | |||
| 1658 | break; | ||
| 1659 | |||
| 1660 | case 'hspace': | ||
| 1661 | // IE returns -1 as default value | ||
| 1662 | if (v === -1) | ||
| 1663 | v = ''; | ||
| 1664 | |||
| 1665 | break; | ||
| 1666 | |||
| 1667 | case 'maxlength': | ||
| 1668 | case 'tabindex': | ||
| 1669 | // IE returns default value | ||
| 1670 | if (v === 32768 || v === 2147483647 || v === '32768') | ||
| 1671 | v = ''; | ||
| 1672 | |||
| 1673 | break; | ||
| 1674 | |||
| 1675 | case 'compact': | ||
| 1676 | case 'noshade': | ||
| 1677 | case 'nowrap': | ||
| 1678 | if (v === 65535) | ||
| 1679 | return n; | ||
| 1680 | |||
| 1681 | return dv; | ||
| 1682 | |||
| 1683 | case 'shape': | ||
| 1684 | v = v.toLowerCase(); | ||
| 1685 | break; | ||
| 1686 | |||
| 1687 | default: | ||
| 1688 | // IE has odd anonymous function for event attributes | ||
| 1689 | if (n.indexOf('on') === 0 && v) | ||
| 1690 | v = ('' + v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/, '$1'); | ||
| 1691 | } | ||
| 1692 | } | ||
| 1693 | |||
| 1694 | return (v !== undefined && v !== null && v !== '') ? '' + v : dv; | ||
| 1695 | }, | ||
| 1696 | |||
| 1697 | getPos : function(n) { | ||
| 1698 | var t = this, x = 0, y = 0, e, d = t.doc, r; | ||
| 1699 | |||
| 1700 | n = t.get(n); | ||
| 1701 | |||
| 1702 | // Use getBoundingClientRect on IE, Opera has it but it's not perfect | ||
| 1703 | if (n && isIE) { | ||
| 1704 | n = n.getBoundingClientRect(); | ||
| 1705 | e = t.boxModel ? d.documentElement : d.body; | ||
| 1706 | x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border | ||
| 1707 | x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x; | ||
| 1708 | n.top += t.win.self != t.win.top ? 2 : 0; // IE adds some strange extra cord if used in a frameset | ||
| 1709 | |||
| 1710 | return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x}; | ||
| 1711 | } | ||
| 1712 | |||
| 1713 | r = n; | ||
| 1714 | while (r) { | ||
| 1715 | x += r.offsetLeft || 0; | ||
| 1716 | y += r.offsetTop || 0; | ||
| 1717 | r = r.offsetParent; | ||
| 1718 | } | ||
| 1719 | |||
| 1720 | r = n; | ||
| 1721 | while (r) { | ||
| 1722 | // Opera 9.25 bug fix, fixed in 9.50 | ||
| 1723 | if (!/^table-row|inline.*/i.test(t.getStyle(r, "display", 1))) { | ||
| 1724 | x -= r.scrollLeft || 0; | ||
| 1725 | y -= r.scrollTop || 0; | ||
| 1726 | } | ||
| 1727 | |||
| 1728 | r = r.parentNode; | ||
| 1729 | |||
| 1730 | if (r == d.body) | ||
| 1731 | break; | ||
| 1732 | } | ||
| 1733 | |||
| 1734 | return {x : x, y : y}; | ||
| 1735 | }, | ||
| 1736 | |||
| 1737 | parseStyle : function(st) { | ||
| 1738 | var t = this, s = t.settings, o = {}; | ||
| 1739 | |||
| 1740 | if (!st) | ||
| 1741 | return o; | ||
| 1742 | |||
| 1743 | function compress(p, s, ot) { | ||
| 1744 | var t, r, b, l; | ||
| 1745 | |||
| 1746 | // Get values and check it it needs compressing | ||
| 1747 | t = o[p + '-top' + s]; | ||
| 1748 | if (!t) | ||
| 1749 | return; | ||
| 1750 | |||
| 1751 | r = o[p + '-right' + s]; | ||
| 1752 | if (t != r) | ||
| 1753 | return; | ||
| 1754 | |||
| 1755 | b = o[p + '-bottom' + s]; | ||
| 1756 | if (r != b) | ||
| 1757 | return; | ||
| 1758 | |||
| 1759 | l = o[p + '-left' + s]; | ||
| 1760 | if (b != l) | ||
| 1761 | return; | ||
| 1762 | |||
| 1763 | // Compress | ||
| 1764 | o[ot] = l; | ||
| 1765 | delete o[p + '-top' + s]; | ||
| 1766 | delete o[p + '-right' + s]; | ||
| 1767 | delete o[p + '-bottom' + s]; | ||
| 1768 | delete o[p + '-left' + s]; | ||
| 1769 | }; | ||
| 1770 | |||
| 1771 | function compress2(ta, a, b, c) { | ||
| 1772 | var t; | ||
| 1773 | |||
| 1774 | t = o[a]; | ||
| 1775 | if (!t) | ||
| 1776 | return; | ||
| 1777 | |||
| 1778 | t = o[b]; | ||
| 1779 | if (!t) | ||
| 1780 | return; | ||
| 1781 | |||
| 1782 | t = o[c]; | ||
| 1783 | if (!t) | ||
| 1784 | return; | ||
| 1785 | |||
| 1786 | // Compress | ||
| 1787 | o[ta] = o[a] + ' ' + o[b] + ' ' + o[c]; | ||
| 1788 | delete o[a]; | ||
| 1789 | delete o[b]; | ||
| 1790 | delete o[c]; | ||
| 1791 | }; | ||
| 1792 | |||
| 1793 | st = st.replace(/&(#?[a-z0-9]+);/g, '&$1_MCE_SEMI_'); // Protect entities | ||
| 1794 | |||
| 1795 | each(st.split(';'), function(v) { | ||
| 1796 | var sv, ur = []; | ||
| 1797 | |||
| 1798 | if (v) { | ||
| 1799 | v = v.replace(/_MCE_SEMI_/g, ';'); // Restore entities | ||
| 1800 | v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';}); | ||
| 1801 | v = v.split(':'); | ||
| 1802 | sv = tinymce.trim(v[1]); | ||
| 1803 | sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];}); | ||
| 1804 | |||
| 1805 | sv = sv.replace(/rgb\([^\)]+\)/g, function(v) { | ||
| 1806 | return t.toHex(v); | ||
| 1807 | }); | ||
| 1808 | |||
| 1809 | if (s.url_converter) { | ||
| 1810 | sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) { | ||
| 1811 | return 'url(' + s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null) + ')'; | ||
| 1812 | }); | ||
| 1813 | } | ||
| 1814 | |||
| 1815 | o[tinymce.trim(v[0]).toLowerCase()] = sv; | ||
| 1816 | } | ||
| 1817 | }); | ||
| 1818 | |||
| 1819 | compress("border", "", "border"); | ||
| 1820 | compress("border", "-width", "border-width"); | ||
| 1821 | compress("border", "-color", "border-color"); | ||
| 1822 | compress("border", "-style", "border-style"); | ||
| 1823 | compress("padding", "", "padding"); | ||
| 1824 | compress("margin", "", "margin"); | ||
| 1825 | compress2('border', 'border-width', 'border-style', 'border-color'); | ||
| 1826 | |||
| 1827 | if (isIE) { | ||
| 1828 | // Remove pointless border | ||
| 1829 | if (o.border == 'medium none') | ||
| 1830 | o.border = ''; | ||
| 1831 | } | ||
| 1832 | |||
| 1833 | return o; | ||
| 1834 | }, | ||
| 1835 | |||
| 1836 | serializeStyle : function(o) { | ||
| 1837 | var s = ''; | ||
| 1838 | |||
| 1839 | each(o, function(v, k) { | ||
| 1840 | if (k && v) { | ||
| 1841 | if (tinymce.isGecko && k.indexOf('-moz-') === 0) | ||
| 1842 | return; | ||
| 1843 | |||
| 1844 | switch (k) { | ||
| 1845 | case 'color': | ||
| 1846 | case 'background-color': | ||
| 1847 | v = v.toLowerCase(); | ||
| 1848 | break; | ||
| 1849 | } | ||
| 1850 | |||
| 1851 | s += (s ? ' ' : '') + k + ': ' + v + ';'; | ||
| 1852 | } | ||
| 1853 | }); | ||
| 1854 | |||
| 1855 | return s; | ||
| 1856 | }, | ||
| 1857 | |||
| 1858 | loadCSS : function(u) { | ||
| 1859 | var t = this, d = t.doc; | ||
| 1860 | |||
| 1861 | if (!u) | ||
| 1862 | u = ''; | ||
| 1863 | |||
| 1864 | each(u.split(','), function(u) { | ||
| 1865 | if (t.files[u]) | ||
| 1866 | return; | ||
| 1867 | |||
| 1868 | t.files[u] = true; | ||
| 1869 | t.add(t.select('head')[0], 'link', {rel : 'stylesheet', href : tinymce._addVer(u)}); | ||
| 1870 | }); | ||
| 1871 | }, | ||
| 1872 | |||
| 1873 | // #if !jquery | ||
| 1874 | |||
| 1875 | addClass : function(e, c) { | ||
| 1876 | return this.run(e, function(e) { | ||
| 1877 | var o; | ||
| 1878 | |||
| 1879 | if (!c) | ||
| 1880 | return 0; | ||
| 1881 | |||
| 1882 | if (this.hasClass(e, c)) | ||
| 1883 | return e.className; | ||
| 1884 | |||
| 1885 | o = this.removeClass(e, c); | ||
| 1886 | |||
| 1887 | return e.className = (o != '' ? (o + ' ') : '') + c; | ||
| 1888 | }); | ||
| 1889 | }, | ||
| 1890 | |||
| 1891 | removeClass : function(e, c) { | ||
| 1892 | var t = this, re; | ||
| 1893 | |||
| 1894 | return t.run(e, function(e) { | ||
| 1895 | var v; | ||
| 1896 | |||
| 1897 | if (t.hasClass(e, c)) { | ||
| 1898 | if (!re) | ||
| 1899 | re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); | ||
| 1900 | |||
| 1901 | v = e.className.replace(re, ' '); | ||
| 1902 | |||
| 1903 | return e.className = tinymce.trim(v != ' ' ? v : ''); | ||
| 1904 | } | ||
| 1905 | |||
| 1906 | return e.className; | ||
| 1907 | }); | ||
| 1908 | }, | ||
| 1909 | |||
| 1910 | hasClass : function(n, c) { | ||
| 1911 | n = this.get(n); | ||
| 1912 | |||
| 1913 | if (!n || !c) | ||
| 1914 | return false; | ||
| 1915 | |||
| 1916 | return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; | ||
| 1917 | }, | ||
| 1918 | |||
| 1919 | show : function(e) { | ||
| 1920 | return this.setStyle(e, 'display', 'block'); | ||
| 1921 | }, | ||
| 1922 | |||
| 1923 | hide : function(e) { | ||
| 1924 | return this.setStyle(e, 'display', 'none'); | ||
| 1925 | }, | ||
| 1926 | |||
| 1927 | isHidden : function(e) { | ||
| 1928 | e = this.get(e); | ||
| 1929 | |||
| 1930 | return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; | ||
| 1931 | }, | ||
| 1932 | |||
| 1933 | // #endif | ||
| 1934 | |||
| 1935 | uniqueId : function(p) { | ||
| 1936 | return (!p ? 'mce_' : p) + (this.counter++); | ||
| 1937 | }, | ||
| 1938 | |||
| 1939 | setHTML : function(e, h) { | ||
| 1940 | var t = this; | ||
| 1941 | |||
| 1942 | return this.run(e, function(e) { | ||
| 1943 | var x, i, nl, n, p, x; | ||
| 1944 | |||
| 1945 | h = t.processHTML(h); | ||
| 1946 | |||
| 1947 | if (isIE) { | ||
| 1948 | function set() { | ||
| 1949 | try { | ||
| 1950 | // IE will remove comments from the beginning | ||
| 1951 | // unless you padd the contents with something | ||
| 1952 | e.innerHTML = '<br />' + h; | ||
| 1953 | e.removeChild(e.firstChild); | ||
| 1954 | } catch (ex) { | ||
| 1955 | // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p | ||
| 1956 | // This seems to fix this problem | ||
| 1957 | |||
| 1958 | // Remove all child nodes | ||
| 1959 | while (e.firstChild) | ||
| 1960 | e.firstChild.removeNode(); | ||
| 1961 | |||
| 1962 | // Create new div with HTML contents and a BR infront to keep comments | ||
| 1963 | x = t.create('div'); | ||
| 1964 | x.innerHTML = '<br />' + h; | ||
| 1965 | |||
| 1966 | // Add all children from div to target | ||
| 1967 | each (x.childNodes, function(n, i) { | ||
| 1968 | // Skip br element | ||
| 1969 | if (i) | ||
| 1970 | e.appendChild(n); | ||
| 1971 | }); | ||
| 1972 | } | ||
| 1973 | }; | ||
| 1974 | |||
| 1975 | // IE has a serious bug when it comes to paragraphs it can produce an invalid | ||
| 1976 | // DOM tree if contents like this <p><ul><li>Item 1</li></ul></p> is inserted | ||
| 1977 | // It seems to be that IE doesn't like a root block element placed inside another root block element | ||
| 1978 | if (t.settings.fix_ie_paragraphs) | ||
| 1979 | h = h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi, '<p$1 mce_keep="true"> </p>'); | ||
| 1980 | |||
| 1981 | set(); | ||
| 1982 | |||
| 1983 | if (t.settings.fix_ie_paragraphs) { | ||
| 1984 | // Check for odd paragraphs this is a sign of a broken DOM | ||
| 1985 | nl = e.getElementsByTagName("p"); | ||
| 1986 | for (i = nl.length - 1, x = 0; i >= 0; i--) { | ||
| 1987 | n = nl[i]; | ||
| 1988 | |||
| 1989 | if (!n.hasChildNodes()) { | ||
| 1990 | if (!n.mce_keep) { | ||
| 1991 | x = 1; // Is broken | ||
| 1992 | break; | ||
| 1993 | } | ||
| 1994 | |||
| 1995 | n.removeAttribute('mce_keep'); | ||
| 1996 | } | ||
| 1997 | } | ||
| 1998 | } | ||
| 1999 | |||
| 2000 | // Time to fix the madness IE left us | ||
| 2001 | if (x) { | ||
| 2002 | // So if we replace the p elements with divs and mark them and then replace them back to paragraphs | ||
| 2003 | // after we use innerHTML we can fix the DOM tree | ||
| 2004 | h = h.replace(/<p ([^>]+)>|<p>/g, '<div $1 mce_tmp="1">'); | ||
| 2005 | h = h.replace(/<\/p>/g, '</div>'); | ||
| 2006 | |||
| 2007 | // Set the new HTML with DIVs | ||
| 2008 | set(); | ||
| 2009 | |||
| 2010 | // Replace all DIV elements with he mce_tmp attibute back to paragraphs | ||
| 2011 | // This is needed since IE has a annoying bug see above for details | ||
| 2012 | // This is a slow process but it has to be done. :( | ||
| 2013 | if (t.settings.fix_ie_paragraphs) { | ||
| 2014 | nl = e.getElementsByTagName("DIV"); | ||
| 2015 | for (i = nl.length - 1; i >= 0; i--) { | ||
| 2016 | n = nl[i]; | ||
| 2017 | |||
| 2018 | // Is it a temp div | ||
| 2019 | if (n.mce_tmp) { | ||
| 2020 | // Create new paragraph | ||
| 2021 | p = t.doc.createElement('p'); | ||
| 2022 | |||
| 2023 | // Copy all attributes | ||
| 2024 | n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi, function(a, b) { | ||
| 2025 | var v; | ||
| 2026 | |||
| 2027 | if (b !== 'mce_tmp') { | ||
| 2028 | v = n.getAttribute(b); | ||
| 2029 | |||
| 2030 | if (!v && b === 'class') | ||
| 2031 | v = n.className; | ||
| 2032 | |||
| 2033 | p.setAttribute(b, v); | ||
| 2034 | } | ||
| 2035 | }); | ||
| 2036 | |||
| 2037 | // Append all children to new paragraph | ||
| 2038 | for (x = 0; x<n.childNodes.length; x++) | ||
| 2039 | p.appendChild(n.childNodes[x].cloneNode(true)); | ||
| 2040 | |||
| 2041 | // Replace div with new paragraph | ||
| 2042 | n.swapNode(p); | ||
| 2043 | } | ||
| 2044 | } | ||
| 2045 | } | ||
| 2046 | } | ||
| 2047 | } else | ||
| 2048 | e.innerHTML = h; | ||
| 2049 | |||
| 2050 | return h; | ||
| 2051 | }); | ||
| 2052 | }, | ||
| 2053 | |||
| 2054 | processHTML : function(h) { | ||
| 2055 | var t = this, s = t.settings; | ||
| 2056 | |||
| 2057 | if (!s.process_html) | ||
| 2058 | return h; | ||
| 2059 | |||
| 2060 | // Convert strong and em to b and i in FF since it can't handle them | ||
| 2061 | if (tinymce.isGecko) { | ||
| 2062 | h = h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi, '<$1b$2>'); | ||
| 2063 | h = h.replace(/<(\/?)em>|<em( [^>]+)>/gi, '<$1i$2>'); | ||
| 2064 | } else if (isIE) { | ||
| 2065 | h = h.replace(/'/g, '''); // IE can't handle apos | ||
| 2066 | h = h.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi, ''); // IE doesn't handle default values correct | ||
| 2067 | } | ||
| 2068 | |||
| 2069 | // Fix some issues | ||
| 2070 | h = h.replace(/<a( )([^>]+)\/>|<a\/>/gi, '<a$1$2></a>'); // Force open | ||
| 2071 | |||
| 2072 | // Store away src and href in mce_src and mce_href since browsers mess them up | ||
| 2073 | if (s.keep_values) { | ||
| 2074 | // Wrap scripts and styles in comments for serialization purposes | ||
| 2075 | if (/<script|style/.test(h)) { | ||
| 2076 | function trim(s) { | ||
| 2077 | // Remove prefix and suffix code for element | ||
| 2078 | s = s.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n'); | ||
| 2079 | s = s.replace(/^[\r\n]*|[\r\n]*$/g, ''); | ||
| 2080 | s = s.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g, ''); | ||
| 2081 | s = s.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g, ''); | ||
| 2082 | |||
| 2083 | return s; | ||
| 2084 | }; | ||
| 2085 | |||
| 2086 | // Preserve script elements | ||
| 2087 | h = h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/g, function(v, a, b) { | ||
| 2088 | // Remove prefix and suffix code for script element | ||
| 2089 | b = trim(b); | ||
| 2090 | |||
| 2091 | // Force type attribute | ||
| 2092 | if (!a) | ||
| 2093 | a = ' type="text/javascript"'; | ||
| 2094 | |||
| 2095 | // Wrap contents in a comment | ||
| 2096 | if (b) | ||
| 2097 | b = '<!--\n' + b + '\n// -->'; | ||
| 2098 | |||
| 2099 | // Output fake element | ||
| 2100 | return '<mce:script' + a + '>' + b + '</mce:script>'; | ||
| 2101 | }); | ||
| 2102 | |||
| 2103 | // Preserve style elements | ||
| 2104 | h = h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/g, function(v, a, b) { | ||
| 2105 | b = trim(b); | ||
| 2106 | return '<mce:style' + a + '><!--\n' + b + '\n--></mce:style><style' + a + ' mce_bogus="1">' + b + '</style>'; | ||
| 2107 | }); | ||
| 2108 | } | ||
| 2109 | |||
| 2110 | h = h.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g, '<!--[CDATA[$1]]-->'); | ||
| 2111 | |||
| 2112 | // Process all tags with src, href or style | ||
| 2113 | h = h.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi, function(a, n) { | ||
| 2114 | function handle(m, b, c) { | ||
| 2115 | var u = c; | ||
| 2116 | |||
| 2117 | // Tag already got a mce_ version | ||
| 2118 | if (a.indexOf('mce_' + b) != -1) | ||
| 2119 | return m; | ||
| 2120 | |||
| 2121 | if (b == 'style') { | ||
| 2122 | // Why did I need this one? | ||
| 2123 | //if (isIE) | ||
| 2124 | // u = t.serializeStyle(t.parseStyle(u)); | ||
| 2125 | |||
| 2126 | // No mce_style for elements with these since they might get resized by the user | ||
| 2127 | if (t._isRes(c)) | ||
| 2128 | return m; | ||
| 2129 | |||
| 2130 | if (s.hex_colors) { | ||
| 2131 | u = u.replace(/rgb\([^\)]+\)/g, function(v) { | ||
| 2132 | return t.toHex(v); | ||
| 2133 | }); | ||
| 2134 | } | ||
| 2135 | |||
| 2136 | if (s.url_converter) { | ||
| 2137 | u = u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g, function(x, c) { | ||
| 2138 | return 'url(' + t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), b, n)) + ')'; | ||
| 2139 | }); | ||
| 2140 | } | ||
| 2141 | } else if (b != 'coords' && b != 'shape') { | ||
| 2142 | if (s.url_converter) | ||
| 2143 | u = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), b, n)); | ||
| 2144 | } | ||
| 2145 | |||
| 2146 | return ' ' + b + '="' + c + '" mce_' + b + '="' + u + '"'; | ||
| 2147 | }; | ||
| 2148 | |||
| 2149 | a = a.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi, handle); // W3C | ||
| 2150 | a = a.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi, handle); // W3C | ||
| 2151 | |||
| 2152 | return a.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi, handle); // IE | ||
| 2153 | }); | ||
| 2154 | } | ||
| 2155 | |||
| 2156 | return h; | ||
| 2157 | }, | ||
| 2158 | |||
| 2159 | getOuterHTML : function(e) { | ||
| 2160 | var d; | ||
| 2161 | |||
| 2162 | e = this.get(e); | ||
| 2163 | |||
| 2164 | if (!e) | ||
| 2165 | return null; | ||
| 2166 | |||
| 2167 | if (isIE) | ||
| 2168 | return e.outerHTML; | ||
| 2169 | |||
| 2170 | d = (e.ownerDocument || this.doc).createElement("body"); | ||
| 2171 | d.appendChild(e.cloneNode(true)); | ||
| 2172 | |||
| 2173 | return d.innerHTML; | ||
| 2174 | }, | ||
| 2175 | |||
| 2176 | setOuterHTML : function(e, h, d) { | ||
| 2177 | var t = this; | ||
| 2178 | |||
| 2179 | return this.run(e, function(e) { | ||
| 2180 | var n, tp; | ||
| 2181 | |||
| 2182 | e = t.get(e); | ||
| 2183 | d = d || e.ownerDocument || t.doc; | ||
| 2184 | |||
| 2185 | if (isIE && e.nodeType == 1) | ||
| 2186 | e.outerHTML = h; | ||
| 2187 | else { | ||
| 2188 | tp = d.createElement("body"); | ||
| 2189 | tp.innerHTML = h; | ||
| 2190 | |||
| 2191 | n = tp.lastChild; | ||
| 2192 | while (n) { | ||
| 2193 | t.insertAfter(n.cloneNode(true), e); | ||
| 2194 | n = n.previousSibling; | ||
| 2195 | } | ||
| 2196 | |||
| 2197 | t.remove(e); | ||
| 2198 | } | ||
| 2199 | }); | ||
| 2200 | }, | ||
| 2201 | |||
| 2202 | decode : function(s) { | ||
| 2203 | var e, n, v; | ||
| 2204 | |||
| 2205 | // Look for entities to decode | ||
| 2206 | if (/&[^;]+;/.test(s)) { | ||
| 2207 | // Decode the entities using a div element not super efficient but less code | ||
| 2208 | e = this.doc.createElement("div"); | ||
| 2209 | e.innerHTML = s; | ||
| 2210 | n = e.firstChild; | ||
| 2211 | v = ''; | ||
| 2212 | |||
| 2213 | if (n) { | ||
| 2214 | do { | ||
| 2215 | v += n.nodeValue; | ||
| 2216 | } while (n.nextSibling); | ||
| 2217 | } | ||
| 2218 | |||
| 2219 | return v || s; | ||
| 2220 | } | ||
| 2221 | |||
| 2222 | return s; | ||
| 2223 | }, | ||
| 2224 | |||
| 2225 | encode : function(s) { | ||
| 2226 | return s ? ('' + s).replace(/[<>&\"]/g, function (c, b) { | ||
| 2227 | switch (c) { | ||
| 2228 | case '&': | ||
| 2229 | return '&'; | ||
| 2230 | |||
| 2231 | case '"': | ||
| 2232 | return '"'; | ||
| 2233 | |||
| 2234 | case '<': | ||
| 2235 | return '<'; | ||
| 2236 | |||
| 2237 | case '>': | ||
| 2238 | return '>'; | ||
| 2239 | } | ||
| 2240 | |||
| 2241 | return c; | ||
| 2242 | }) : s; | ||
| 2243 | }, | ||
| 2244 | |||
| 2245 | // #if !jquery | ||
| 2246 | |||
| 2247 | insertAfter : function(n, r) { | ||
| 2248 | var t = this; | ||
| 2249 | |||
| 2250 | r = t.get(r); | ||
| 2251 | |||
| 2252 | return this.run(n, function(n) { | ||
| 2253 | var p, ns; | ||
| 2254 | |||
| 2255 | p = r.parentNode; | ||
| 2256 | ns = r.nextSibling; | ||
| 2257 | |||
| 2258 | if (ns) | ||
| 2259 | p.insertBefore(n, ns); | ||
| 2260 | else | ||
| 2261 | p.appendChild(n); | ||
| 2262 | |||
| 2263 | return n; | ||
| 2264 | }); | ||
| 2265 | }, | ||
| 2266 | |||
| 2267 | // #endif | ||
| 2268 | |||
| 2269 | isBlock : function(n) { | ||
| 2270 | if (n.nodeType && n.nodeType !== 1) | ||
| 2271 | return false; | ||
| 2272 | |||
| 2273 | n = n.nodeName || n; | ||
| 2274 | |||
| 2275 | return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n); | ||
| 2276 | }, | ||
| 2277 | |||
| 2278 | // #if !jquery | ||
| 2279 | |||
| 2280 | replace : function(n, o, k) { | ||
| 2281 | if (is(o, 'array')) | ||
| 2282 | n = n.cloneNode(true); | ||
| 2283 | |||
| 2284 | return this.run(o, function(o) { | ||
| 2285 | if (k) { | ||
| 2286 | each(o.childNodes, function(c) { | ||
| 2287 | n.appendChild(c.cloneNode(true)); | ||
| 2288 | }); | ||
| 2289 | } | ||
| 2290 | |||
| 2291 | // Fix IE psuedo leak for elements since replacing elements if fairly common | ||
| 2292 | // Will break parentNode for some unknown reason | ||
| 2293 | /* if (isIE && o.nodeType === 1) { | ||
| 2294 | o.parentNode.insertBefore(n, o); | ||
| 2295 | o.outerHTML = ''; | ||
| 2296 | return n; | ||
| 2297 | }*/ | ||
| 2298 | |||
| 2299 | return o.parentNode.replaceChild(n, o); | ||
| 2300 | }); | ||
| 2301 | }, | ||
| 2302 | |||
| 2303 | // #endif | ||
| 2304 | |||
| 2305 | toHex : function(s) { | ||
| 2306 | var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s); | ||
| 2307 | |||
| 2308 | function hex(s) { | ||
| 2309 | s = parseInt(s).toString(16); | ||
| 2310 | |||
| 2311 | return s.length > 1 ? s : '0' + s; // 0 -> 00 | ||
| 2312 | }; | ||
| 2313 | |||
| 2314 | if (c) { | ||
| 2315 | s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]); | ||
| 2316 | |||
| 2317 | return s; | ||
| 2318 | } | ||
| 2319 | |||
| 2320 | return s; | ||
| 2321 | }, | ||
| 2322 | |||
| 2323 | getClasses : function() { | ||
| 2324 | var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov; | ||
| 2325 | |||
| 2326 | if (t.classes) | ||
| 2327 | return t.classes; | ||
| 2328 | |||
| 2329 | function addClasses(s) { | ||
| 2330 | // IE style imports | ||
| 2331 | each(s.imports, function(r) { | ||
| 2332 | addClasses(r); | ||
| 2333 | }); | ||
| 2334 | |||
| 2335 | each(s.cssRules || s.rules, function(r) { | ||
| 2336 | // Real type or fake it on IE | ||
| 2337 | switch (r.type || 1) { | ||
| 2338 | // Rule | ||
| 2339 | case 1: | ||
| 2340 | if (r.selectorText) { | ||
| 2341 | each(r.selectorText.split(','), function(v) { | ||
| 2342 | v = v.replace(/^\s*|\s*$|^\s\./g, ""); | ||
| 2343 | |||
| 2344 | // Is internal or it doesn't contain a class | ||
| 2345 | if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v)) | ||
| 2346 | return; | ||
| 2347 | |||
| 2348 | // Remove everything but class name | ||
| 2349 | ov = v; | ||
| 2350 | v = v.replace(/.*\.([a-z0-9_\-]+).*/i, '$1'); | ||
| 2351 | |||
| 2352 | // Filter classes | ||
| 2353 | if (f && !(v = f(v, ov))) | ||
| 2354 | return; | ||
| 2355 | |||
| 2356 | if (!lo[v]) { | ||
| 2357 | cl.push({'class' : v}); | ||
| 2358 | lo[v] = 1; | ||
| 2359 | } | ||
| 2360 | }); | ||
| 2361 | } | ||
| 2362 | break; | ||
| 2363 | |||
| 2364 | // Import | ||
| 2365 | case 3: | ||
| 2366 | addClasses(r.styleSheet); | ||
| 2367 | break; | ||
| 2368 | } | ||
| 2369 | }); | ||
| 2370 | }; | ||
| 2371 | |||
| 2372 | try { | ||
| 2373 | each(t.doc.styleSheets, addClasses); | ||
| 2374 | } catch (ex) { | ||
| 2375 | // Ignore | ||
| 2376 | } | ||
| 2377 | |||
| 2378 | if (cl.length > 0) | ||
| 2379 | t.classes = cl; | ||
| 2380 | |||
| 2381 | return cl; | ||
| 2382 | }, | ||
| 2383 | |||
| 2384 | run : function(e, f, s) { | ||
| 2385 | var t = this, o; | ||
| 2386 | |||
| 2387 | if (t.doc && typeof(e) === 'string') | ||
| 2388 | e = t.get(e); | ||
| 2389 | |||
| 2390 | if (!e) | ||
| 2391 | return false; | ||
| 2392 | |||
| 2393 | s = s || this; | ||
| 2394 | if (!e.nodeType && (e.length || e.length === 0)) { | ||
| 2395 | o = []; | ||
| 2396 | |||
| 2397 | each(e, function(e, i) { | ||
| 2398 | if (e) { | ||
| 2399 | if (typeof(e) == 'string') | ||
| 2400 | e = t.doc.getElementById(e); | ||
| 2401 | |||
| 2402 | o.push(f.call(s, e, i)); | ||
| 2403 | } | ||
| 2404 | }); | ||
| 2405 | |||
| 2406 | return o; | ||
| 2407 | } | ||
| 2408 | |||
| 2409 | return f.call(s, e); | ||
| 2410 | }, | ||
| 2411 | |||
| 2412 | getAttribs : function(n) { | ||
| 2413 | var o; | ||
| 2414 | |||
| 2415 | n = this.get(n); | ||
| 2416 | |||
| 2417 | if (!n) | ||
| 2418 | return []; | ||
| 2419 | |||
| 2420 | if (isIE) { | ||
| 2421 | o = []; | ||
| 2422 | |||
| 2423 | // Object will throw exception in IE | ||
| 2424 | if (n.nodeName == 'OBJECT') | ||
| 2425 | return n.attributes; | ||
| 2426 | |||
| 2427 | // It's crazy that this is faster in IE but it's because it returns all attributes all the time | ||
| 2428 | n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi, function(a, b) { | ||
| 2429 | o.push({specified : 1, nodeName : b}); | ||
| 2430 | }); | ||
| 2431 | |||
| 2432 | return o; | ||
| 2433 | } | ||
| 2434 | |||
| 2435 | return n.attributes; | ||
| 2436 | }, | ||
| 2437 | |||
| 2438 | destroy : function(s) { | ||
| 2439 | var t = this; | ||
| 2440 | |||
| 2441 | t.win = t.doc = t.root = null; | ||
| 2442 | |||
| 2443 | // Manual destroy then remove unload handler | ||
| 2444 | if (!s) | ||
| 2445 | tinymce.removeUnload(t.destroy); | ||
| 2446 | }, | ||
| 2447 | |||
| 2448 | _isRes : function(c) { | ||
| 2449 | // Is live resizble element | ||
| 2450 | return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c); | ||
| 2451 | } | ||
| 2452 | |||
| 2453 | /* | ||
| 2454 | walk : function(n, f, s) { | ||
| 2455 | var d = this.doc, w; | ||
| 2456 | |||
| 2457 | if (d.createTreeWalker) { | ||
| 2458 | w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); | ||
| 2459 | |||
| 2460 | while ((n = w.nextNode()) != null) | ||
| 2461 | f.call(s || this, n); | ||
| 2462 | } else | ||
| 2463 | tinymce.walk(n, f, 'childNodes', s); | ||
| 2464 | } | ||
| 2465 | */ | ||
| 2466 | |||
| 2467 | /* | ||
| 2468 | toRGB : function(s) { | ||
| 2469 | var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s); | ||
| 2470 | |||
| 2471 | if (c) { | ||
| 2472 | // #FFF -> #FFFFFF | ||
| 2473 | if (!is(c[3])) | ||
| 2474 | c[3] = c[2] = c[1]; | ||
| 2475 | |||
| 2476 | return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")"; | ||
| 2477 | } | ||
| 2478 | |||
| 2479 | return s; | ||
| 2480 | } | ||
| 2481 | */ | ||
| 2482 | |||
| 2483 | }); | ||
| 2484 | |||
| 2485 | // Setup page DOM | ||
| 2486 | tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0}); | ||
| 2487 | })(); | ||
| 2488 | |||
| 2489 | /* file:jscripts/tiny_mce/classes/dom/Event.js */ | ||
| 2490 | |||
| 2491 | (function() { | ||
| 2492 | // Shorten names | ||
| 2493 | var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event; | ||
| 2494 | |||
| 2495 | tinymce.create('static tinymce.dom.Event', { | ||
| 2496 | inits : [], | ||
| 2497 | events : [], | ||
| 2498 | |||
| 2499 | // #if !jquery | ||
| 2500 | |||
| 2501 | add : function(o, n, f, s) { | ||
| 2502 | var cb, t = this, el = t.events, r; | ||
| 2503 | |||
| 2504 | // Handle array | ||
| 2505 | if (o && o instanceof Array) { | ||
| 2506 | r = []; | ||
| 2507 | |||
| 2508 | each(o, function(o) { | ||
| 2509 | o = DOM.get(o); | ||
| 2510 | r.push(t.add(o, n, f, s)); | ||
| 2511 | }); | ||
| 2512 | |||
| 2513 | return r; | ||
| 2514 | } | ||
| 2515 | |||
| 2516 | o = DOM.get(o); | ||
| 2517 | |||
| 2518 | if (!o) | ||
| 2519 | return; | ||
| 2520 | |||
| 2521 | // Setup event callback | ||
| 2522 | cb = function(e) { | ||
| 2523 | e = e || window.event; | ||
| 2524 | |||
| 2525 | // Patch in target in IE it's W3C valid | ||
| 2526 | if (e && !e.target && isIE) | ||
| 2527 | e.target = e.srcElement; | ||
| 2528 | |||
| 2529 | if (!s) | ||
| 2530 | return f(e); | ||
| 2531 | |||
| 2532 | return f.call(s, e); | ||
| 2533 | }; | ||
| 2534 | |||
| 2535 | if (n == 'unload') { | ||
| 2536 | tinymce.unloads.unshift({func : cb}); | ||
| 2537 | return cb; | ||
| 2538 | } | ||
| 2539 | |||
| 2540 | if (n == 'init') { | ||
| 2541 | if (t.domLoaded) | ||
| 2542 | cb(); | ||
| 2543 | else | ||
| 2544 | t.inits.push(cb); | ||
| 2545 | |||
| 2546 | return cb; | ||
| 2547 | } | ||
| 2548 | |||
| 2549 | // Store away listener reference | ||
| 2550 | el.push({ | ||
| 2551 | obj : o, | ||
| 2552 | name : n, | ||
| 2553 | func : f, | ||
| 2554 | cfunc : cb, | ||
| 2555 | scope : s | ||
| 2556 | }); | ||
| 2557 | |||
| 2558 | t._add(o, n, cb); | ||
| 2559 | |||
| 2560 | return f; | ||
| 2561 | }, | ||
| 2562 | |||
| 2563 | remove : function(o, n, f) { | ||
| 2564 | var t = this, a = t.events, s = false, r; | ||
| 2565 | |||
| 2566 | // Handle array | ||
| 2567 | if (o && o instanceof Array) { | ||
| 2568 | r = []; | ||
| 2569 | |||
| 2570 | each(o, function(o) { | ||
| 2571 | o = DOM.get(o); | ||
| 2572 | r.push(t.remove(o, n, f)); | ||
| 2573 | }); | ||
| 2574 | |||
| 2575 | return r; | ||
| 2576 | } | ||
| 2577 | |||
| 2578 | o = DOM.get(o); | ||
| 2579 | |||
| 2580 | each(a, function(e, i) { | ||
| 2581 | if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) { | ||
| 2582 | a.splice(i, 1); | ||
| 2583 | t._remove(o, n, e.cfunc); | ||
| 2584 | s = true; | ||
| 2585 | return false; | ||
| 2586 | } | ||
| 2587 | }); | ||
| 2588 | |||
| 2589 | return s; | ||
| 2590 | }, | ||
| 2591 | |||
| 2592 | clear : function(o) { | ||
| 2593 | var t = this, a = t.events, i, e; | ||
| 2594 | |||
| 2595 | if (o) { | ||
| 2596 | o = DOM.get(o); | ||
| 2597 | |||
| 2598 | for (i = a.length - 1; i >= 0; i--) { | ||
| 2599 | e = a[i]; | ||
| 2600 | |||
| 2601 | if (e.obj === o) { | ||
| 2602 | t._remove(e.obj, e.name, e.cfunc); | ||
| 2603 | e.obj = e.cfunc = null; | ||
| 2604 | a.splice(i, 1); | ||
| 2605 | } | ||
| 2606 | } | ||
| 2607 | } | ||
| 2608 | }, | ||
| 2609 | |||
| 2610 | // #endif | ||
| 2611 | |||
| 2612 | cancel : function(e) { | ||
| 2613 | if (!e) | ||
| 2614 | return false; | ||
| 2615 | |||
| 2616 | this.stop(e); | ||
| 2617 | return this.prevent(e); | ||
| 2618 | }, | ||
| 2619 | |||
| 2620 | stop : function(e) { | ||
| 2621 | if (e.stopPropagation) | ||
| 2622 | e.stopPropagation(); | ||
| 2623 | else | ||
| 2624 | e.cancelBubble = true; | ||
| 2625 | |||
| 2626 | return false; | ||
| 2627 | }, | ||
| 2628 | |||
| 2629 | prevent : function(e) { | ||
| 2630 | if (e.preventDefault) | ||
| 2631 | e.preventDefault(); | ||
| 2632 | else | ||
| 2633 | e.returnValue = false; | ||
| 2634 | |||
| 2635 | return false; | ||
| 2636 | }, | ||
| 2637 | |||
| 2638 | _unload : function() { | ||
| 2639 | var t = Event; | ||
| 2640 | |||
| 2641 | each(t.events, function(e, i) { | ||
| 2642 | t._remove(e.obj, e.name, e.cfunc); | ||
| 2643 | e.obj = e.cfunc = null; | ||
| 2644 | }); | ||
| 2645 | |||
| 2646 | t.events = []; | ||
| 2647 | t = null; | ||
| 2648 | }, | ||
| 2649 | |||
| 2650 | _add : function(o, n, f) { | ||
| 2651 | if (o.attachEvent) | ||
| 2652 | o.attachEvent('on' + n, f); | ||
| 2653 | else if (o.addEventListener) | ||
| 2654 | o.addEventListener(n, f, false); | ||
| 2655 | else | ||
| 2656 | o['on' + n] = f; | ||
| 2657 | }, | ||
| 2658 | |||
| 2659 | _remove : function(o, n, f) { | ||
| 2660 | if (o) { | ||
| 2661 | try { | ||
| 2662 | if (o.detachEvent) | ||
| 2663 | o.detachEvent('on' + n, f); | ||
| 2664 | else if (o.removeEventListener) | ||
| 2665 | o.removeEventListener(n, f, false); | ||
| 2666 | else | ||
| 2667 | o['on' + n] = null; | ||
| 2668 | } catch (ex) { | ||
| 2669 | // Might fail with permission denined on IE so we just ignore that | ||
| 2670 | } | ||
| 2671 | } | ||
| 2672 | }, | ||
| 2673 | |||
| 2674 | _pageInit : function() { | ||
| 2675 | var e = Event; | ||
| 2676 | |||
| 2677 | // Safari on Mac fires this twice | ||
| 2678 | if (e.domLoaded) | ||
| 2679 | return; | ||
| 2680 | |||
| 2681 | e._remove(window, 'DOMContentLoaded', e._pageInit); | ||
| 2682 | e.domLoaded = true; | ||
| 2683 | |||
| 2684 | each(e.inits, function(c) { | ||
| 2685 | c(); | ||
| 2686 | }); | ||
| 2687 | |||
| 2688 | e.inits = []; | ||
| 2689 | }, | ||
| 2690 | |||
| 2691 | _wait : function() { | ||
| 2692 | var t; | ||
| 2693 | |||
| 2694 | // No need since the document is already loaded | ||
| 2695 | if (window.tinyMCE_GZ && tinyMCE_GZ.loaded) { | ||
| 2696 | Event.domLoaded = 1; | ||
| 2697 | return; | ||
| 2698 | } | ||
| 2699 | |||
| 2700 | if (isIE && document.location.protocol != 'https:') { | ||
| 2701 | // Fake DOMContentLoaded on IE | ||
| 2702 | document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>'); | ||
| 2703 | DOM.get("__ie_onload").onreadystatechange = function() { | ||
| 2704 | if (this.readyState == "complete") { | ||
| 2705 | Event._pageInit(); | ||
| 2706 | DOM.get("__ie_onload").onreadystatechange = null; // Prevent leak | ||
| 2707 | } | ||
| 2708 | }; | ||
| 2709 | } else { | ||
| 2710 | Event._add(window, 'DOMContentLoaded', Event._pageInit, Event); | ||
| 2711 | |||
| 2712 | if (isIE || isWebKit) { | ||
| 2713 | t = setInterval(function() { | ||
| 2714 | if (/loaded|complete/.test(document.readyState)) { | ||
| 2715 | clearInterval(t); | ||
| 2716 | Event._pageInit(); | ||
| 2717 | } | ||
| 2718 | }, 10); | ||
| 2719 | } | ||
| 2720 | } | ||
| 2721 | } | ||
| 2722 | |||
| 2723 | }); | ||
| 2724 | |||
| 2725 | // Shorten name | ||
| 2726 | Event = tinymce.dom.Event; | ||
| 2727 | |||
| 2728 | // Dispatch DOM content loaded event for IE and Safari | ||
| 2729 | Event._wait(); | ||
| 2730 | tinymce.addUnload(Event._unload); | ||
| 2731 | })(); | ||
| 2732 | |||
| 2733 | /* file:jscripts/tiny_mce/classes/dom/Element.js */ | ||
| 2734 | |||
| 2735 | (function() { | ||
| 2736 | var each = tinymce.each; | ||
| 2737 | |||
| 2738 | tinymce.create('tinymce.dom.Element', { | ||
| 2739 | Element : function(id, s) { | ||
| 2740 | var t = this, dom, el; | ||
| 2741 | |||
| 2742 | s = s || {}; | ||
| 2743 | t.id = id; | ||
| 2744 | t.dom = dom = s.dom || tinymce.DOM; | ||
| 2745 | t.settings = s; | ||
| 2746 | |||
| 2747 | // Only IE leaks DOM references, this is a lot faster | ||
| 2748 | if (!tinymce.isIE) | ||
| 2749 | el = t.dom.get(t.id); | ||
| 2750 | |||
| 2751 | each([ | ||
| 2752 | 'getPos', | ||
| 2753 | 'getRect', | ||
| 2754 | 'getParent', | ||
| 2755 | 'add', | ||
| 2756 | 'setStyle', | ||
| 2757 | 'getStyle', | ||
| 2758 | 'setStyles', | ||
| 2759 | 'setAttrib', | ||
| 2760 | 'setAttribs', | ||
| 2761 | 'getAttrib', | ||
| 2762 | 'addClass', | ||
| 2763 | 'removeClass', | ||
| 2764 | 'hasClass', | ||
| 2765 | 'getOuterHTML', | ||
| 2766 | 'setOuterHTML', | ||
| 2767 | 'remove', | ||
| 2768 | 'show', | ||
| 2769 | 'hide', | ||
| 2770 | 'isHidden', | ||
| 2771 | 'setHTML', | ||
| 2772 | 'get' | ||
| 2773 | ], function(k) { | ||
| 2774 | t[k] = function() { | ||
| 2775 | var a = arguments, o; | ||
| 2776 | |||
| 2777 | // Opera fails | ||
| 2778 | if (tinymce.isOpera) { | ||
| 2779 | a = [id]; | ||
| 2780 | |||
| 2781 | each(arguments, function(v) { | ||
| 2782 | a.push(v); | ||
| 2783 | }); | ||
| 2784 | } else | ||
| 2785 | Array.prototype.unshift.call(a, el || id); | ||
| 2786 | |||
| 2787 | o = dom[k].apply(dom, a); | ||
| 2788 | t.update(k); | ||
| 2789 | |||
| 2790 | return o; | ||
| 2791 | }; | ||
| 2792 | }); | ||
| 2793 | }, | ||
| 2794 | |||
| 2795 | on : function(n, f, s) { | ||
| 2796 | return tinymce.dom.Event.add(this.id, n, f, s); | ||
| 2797 | }, | ||
| 2798 | |||
| 2799 | getXY : function() { | ||
| 2800 | return { | ||
| 2801 | x : parseInt(this.getStyle('left')), | ||
| 2802 | y : parseInt(this.getStyle('top')) | ||
| 2803 | }; | ||
| 2804 | }, | ||
| 2805 | |||
| 2806 | getSize : function() { | ||
| 2807 | var n = this.dom.get(this.id); | ||
| 2808 | |||
| 2809 | return { | ||
| 2810 | w : parseInt(this.getStyle('width') || n.clientWidth), | ||
| 2811 | h : parseInt(this.getStyle('height') || n.clientHeight) | ||
| 2812 | }; | ||
| 2813 | }, | ||
| 2814 | |||
| 2815 | moveTo : function(x, y) { | ||
| 2816 | this.setStyles({left : x, top : y}); | ||
| 2817 | }, | ||
| 2818 | |||
| 2819 | moveBy : function(x, y) { | ||
| 2820 | var p = this.getXY(); | ||
| 2821 | |||
| 2822 | this.moveTo(p.x + x, p.y + y); | ||
| 2823 | }, | ||
| 2824 | |||
| 2825 | resizeTo : function(w, h) { | ||
| 2826 | this.setStyles({width : w, height : h}); | ||
| 2827 | }, | ||
| 2828 | |||
| 2829 | resizeBy : function(w, h) { | ||
| 2830 | var s = this.getSize(); | ||
| 2831 | |||
| 2832 | this.resizeTo(s.w + w, s.h + h); | ||
| 2833 | }, | ||
| 2834 | |||
| 2835 | update : function(k) { | ||
| 2836 | var t = this, b, dom = t.dom; | ||
| 2837 | |||
| 2838 | if (tinymce.isIE6 && t.settings.blocker) { | ||
| 2839 | k = k || ''; | ||
| 2840 | |||
| 2841 | // Ignore getters | ||
| 2842 | if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0) | ||
| 2843 | return; | ||
| 2844 | |||
| 2845 | // Remove blocker on remove | ||
| 2846 | if (k == 'remove') { | ||
| 2847 | dom.remove(t.blocker); | ||
| 2848 | return; | ||
| 2849 | } | ||
| 2850 | |||
| 2851 | if (!t.blocker) { | ||
| 2852 | t.blocker = dom.uniqueId(); | ||
| 2853 | b = dom.add(t.settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'}); | ||
| 2854 | dom.setStyle(b, 'opacity', 0); | ||
| 2855 | } else | ||
| 2856 | b = dom.get(t.blocker); | ||
| 2857 | |||
| 2858 | dom.setStyle(b, 'left', t.getStyle('left', 1)); | ||
| 2859 | dom.setStyle(b, 'top', t.getStyle('top', 1)); | ||
| 2860 | dom.setStyle(b, 'width', t.getStyle('width', 1)); | ||
| 2861 | dom.setStyle(b, 'height', t.getStyle('height', 1)); | ||
| 2862 | dom.setStyle(b, 'display', t.getStyle('display', 1)); | ||
| 2863 | dom.setStyle(b, 'zIndex', parseInt(t.getStyle('zIndex', 1) || 0) - 1); | ||
| 2864 | } | ||
| 2865 | } | ||
| 2866 | |||
| 2867 | }); | ||
| 2868 | })(); | ||
| 2869 | |||
| 2870 | /* file:jscripts/tiny_mce/classes/dom/Selection.js */ | ||
| 2871 | |||
| 2872 | (function() { | ||
| 2873 | function trimNl(s) { | ||
| 2874 | return s.replace(/[\n\r]+/g, ''); | ||
| 2875 | }; | ||
| 2876 | |||
| 2877 | // Shorten names | ||
| 2878 | var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; | ||
| 2879 | |||
| 2880 | tinymce.create('tinymce.dom.Selection', { | ||
| 2881 | Selection : function(dom, win, serializer) { | ||
| 2882 | var t = this; | ||
| 2883 | |||
| 2884 | t.dom = dom; | ||
| 2885 | t.win = win; | ||
| 2886 | t.serializer = serializer; | ||
| 2887 | |||
| 2888 | // Add events | ||
| 2889 | each([ | ||
| 2890 | 'onBeforeSetContent', | ||
| 2891 | 'onBeforeGetContent', | ||
| 2892 | 'onSetContent', | ||
| 2893 | 'onGetContent' | ||
| 2894 | ], function(e) { | ||
| 2895 | t[e] = new tinymce.util.Dispatcher(t); | ||
| 2896 | }); | ||
| 2897 | |||
| 2898 | // Prevent leaks | ||
| 2899 | tinymce.addUnload(t.destroy, t); | ||
| 2900 | }, | ||
| 2901 | |||
| 2902 | getContent : function(s) { | ||
| 2903 | var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; | ||
| 2904 | |||
| 2905 | s = s || {}; | ||
| 2906 | wb = wa = ''; | ||
| 2907 | s.get = true; | ||
| 2908 | s.format = s.format || 'html'; | ||
| 2909 | t.onBeforeGetContent.dispatch(t, s); | ||
| 2910 | |||
| 2911 | if (s.format == 'text') | ||
| 2912 | return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); | ||
| 2913 | |||
| 2914 | if (r.cloneContents) { | ||
| 2915 | n = r.cloneContents(); | ||
| 2916 | |||
| 2917 | if (n) | ||
| 2918 | e.appendChild(n); | ||
| 2919 | } else if (is(r.item) || is(r.htmlText)) | ||
| 2920 | e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText; | ||
| 2921 | else | ||
| 2922 | e.innerHTML = r.toString(); | ||
| 2923 | |||
| 2924 | // Keep whitespace before and after | ||
| 2925 | if (/^\s/.test(e.innerHTML)) | ||
| 2926 | wb = ' '; | ||
| 2927 | |||
| 2928 | if (/\s+$/.test(e.innerHTML)) | ||
| 2929 | wa = ' '; | ||
| 2930 | |||
| 2931 | s.getInner = true; | ||
| 2932 | |||
| 2933 | s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; | ||
| 2934 | t.onGetContent.dispatch(t, s); | ||
| 2935 | |||
| 2936 | return s.content; | ||
| 2937 | }, | ||
| 2938 | |||
| 2939 | setContent : function(h, s) { | ||
| 2940 | var t = this, r = t.getRng(), c, d = t.win.document; | ||
| 2941 | |||
| 2942 | s = s || {format : 'html'}; | ||
| 2943 | s.set = true; | ||
| 2944 | h = s.content = t.dom.processHTML(h); | ||
| 2945 | |||
| 2946 | // Dispatch before set content event | ||
| 2947 | t.onBeforeSetContent.dispatch(t, s); | ||
| 2948 | h = s.content; | ||
| 2949 | |||
| 2950 | if (r.insertNode) { | ||
| 2951 | // Make caret marker since insertNode places the caret in the beginning of text after insert | ||
| 2952 | h += '<span id="__caret">_</span>'; | ||
| 2953 | |||
| 2954 | // Delete and insert new node | ||
| 2955 | r.deleteContents(); | ||
| 2956 | r.insertNode(t.getRng().createContextualFragment(h)); | ||
| 2957 | |||
| 2958 | // Move to caret marker | ||
| 2959 | c = t.dom.get('__caret'); | ||
| 2960 | |||
| 2961 | // Make sure we wrap it compleatly, Opera fails with a simple select call | ||
| 2962 | r = d.createRange(); | ||
| 2963 | r.setStartBefore(c); | ||
| 2964 | r.setEndAfter(c); | ||
| 2965 | t.setRng(r); | ||
| 2966 | |||
| 2967 | // Delete the marker, and hopefully the caret gets placed in the right location | ||
| 2968 | d.execCommand('Delete', false, null); | ||
| 2969 | |||
| 2970 | // In case it's still there | ||
| 2971 | t.dom.remove('__caret'); | ||
| 2972 | } else { | ||
| 2973 | if (r.item) { | ||
| 2974 | // Delete content and get caret text selection | ||
| 2975 | d.execCommand('Delete', false, null); | ||
| 2976 | r = t.getRng(); | ||
| 2977 | } | ||
| 2978 | |||
| 2979 | r.pasteHTML(h); | ||
| 2980 | } | ||
| 2981 | |||
| 2982 | // Dispatch set content event | ||
| 2983 | t.onSetContent.dispatch(t, s); | ||
| 2984 | }, | ||
| 2985 | |||
| 2986 | getStart : function() { | ||
| 2987 | var t = this, r = t.getRng(), e; | ||
| 2988 | |||
| 2989 | if (isIE) { | ||
| 2990 | if (r.item) | ||
| 2991 | return r.item(0); | ||
| 2992 | |||
| 2993 | r = r.duplicate(); | ||
| 2994 | r.collapse(1); | ||
| 2995 | e = r.parentElement(); | ||
| 2996 | |||
| 2997 | if (e && e.nodeName == 'BODY') | ||
| 2998 | return e.firstChild; | ||
| 2999 | |||
| 3000 | return e; | ||
| 3001 | } else { | ||
| 3002 | e = r.startContainer; | ||
| 3003 | |||
| 3004 | if (e.nodeName == 'BODY') | ||
| 3005 | return e.firstChild; | ||
| 3006 | |||
| 3007 | return t.dom.getParent(e, function(n) {return n.nodeType == 1;}); | ||
| 3008 | } | ||
| 3009 | }, | ||
| 3010 | |||
| 3011 | getEnd : function() { | ||
| 3012 | var t = this, r = t.getRng(), e; | ||
| 3013 | |||
| 3014 | if (isIE) { | ||
| 3015 | if (r.item) | ||
| 3016 | return r.item(0); | ||
| 3017 | |||
| 3018 | r = r.duplicate(); | ||
| 3019 | r.collapse(0); | ||
| 3020 | e = r.parentElement(); | ||
| 3021 | |||
| 3022 | if (e && e.nodeName == 'BODY') | ||
| 3023 | return e.lastChild; | ||
| 3024 | |||
| 3025 | return e; | ||
| 3026 | } else { | ||
| 3027 | e = r.endContainer; | ||
| 3028 | |||
| 3029 | if (e.nodeName == 'BODY') | ||
| 3030 | return e.lastChild; | ||
| 3031 | |||
| 3032 | return t.dom.getParent(e, function(n) {return n.nodeType == 1;}); | ||
| 3033 | } | ||
| 3034 | }, | ||
| 3035 | |||
| 3036 | getBookmark : function(si) { | ||
| 3037 | var t = this, r = t.getRng(), tr, sx, sy, vp = t.dom.getViewPort(t.win), e, sp, bp, le, c = -0xFFFFFF, s, ro = t.dom.getRoot(), wb = 0, wa = 0, nv; | ||
| 3038 | sx = vp.x; | ||
| 3039 | sy = vp.y; | ||
| 3040 | |||
| 3041 | // Simple bookmark fast but not as persistent | ||
| 3042 | if (si == 'simple') | ||
| 3043 | return {rng : r, scrollX : sx, scrollY : sy}; | ||
| 3044 | |||
| 3045 | // Handle IE | ||
| 3046 | if (isIE) { | ||
| 3047 | // Control selection | ||
| 3048 | if (r.item) { | ||
| 3049 | e = r.item(0); | ||
| 3050 | |||
| 3051 | each(t.dom.select(e.nodeName), function(n, i) { | ||
| 3052 | if (e == n) { | ||
| 3053 | sp = i; | ||
| 3054 | return false; | ||
| 3055 | } | ||
| 3056 | }); | ||
| 3057 | |||
| 3058 | return { | ||
| 3059 | tag : e.nodeName, | ||
| 3060 | index : sp, | ||
| 3061 | scrollX : sx, | ||
| 3062 | scrollY : sy | ||
| 3063 | }; | ||
| 3064 | } | ||
| 3065 | |||
| 3066 | // Text selection | ||
| 3067 | tr = t.dom.doc.body.createTextRange(); | ||
| 3068 | tr.moveToElementText(ro); | ||
| 3069 | tr.collapse(true); | ||
| 3070 | bp = Math.abs(tr.move('character', c)); | ||
| 3071 | |||
| 3072 | tr = r.duplicate(); | ||
| 3073 | tr.collapse(true); | ||
| 3074 | sp = Math.abs(tr.move('character', c)); | ||
| 3075 | |||
| 3076 | tr = r.duplicate(); | ||
| 3077 | tr.collapse(false); | ||
| 3078 | le = Math.abs(tr.move('character', c)) - sp; | ||
| 3079 | |||
| 3080 | return { | ||
| 3081 | start : sp - bp, | ||
| 3082 | length : le, | ||
| 3083 | scrollX : sx, | ||
| 3084 | scrollY : sy | ||
| 3085 | }; | ||
| 3086 | } | ||
| 3087 | |||
| 3088 | // Handle W3C | ||
| 3089 | e = t.getNode(); | ||
| 3090 | s = t.getSel(); | ||
| 3091 | |||
| 3092 | if (!s) | ||
| 3093 | return null; | ||
| 3094 | |||
| 3095 | // Image selection | ||
| 3096 | if (e && e.nodeName == 'IMG') { | ||
| 3097 | return { | ||
| 3098 | scrollX : sx, | ||
| 3099 | scrollY : sy | ||
| 3100 | }; | ||
| 3101 | } | ||
| 3102 | |||
| 3103 | // Text selection | ||
| 3104 | |||
| 3105 | function getPos(r, sn, en) { | ||
| 3106 | var w = t.dom.doc.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}; | ||
| 3107 | |||
| 3108 | while ((n = w.nextNode()) != null) { | ||
| 3109 | if (n == sn) | ||
| 3110 | d.start = p; | ||
| 3111 | |||
| 3112 | if (n == en) { | ||
| 3113 | d.end = p; | ||
| 3114 | return d; | ||
| 3115 | } | ||
| 3116 | |||
| 3117 | p += trimNl(n.nodeValue || '').length; | ||
| 3118 | } | ||
| 3119 | |||
| 3120 | return null; | ||
| 3121 | }; | ||
| 3122 | |||
| 3123 | // Caret or selection | ||
| 3124 | if (s.anchorNode == s.focusNode && s.anchorOffset == s.focusOffset) { | ||
| 3125 | e = getPos(ro, s.anchorNode, s.focusNode); | ||
| 3126 | |||
| 3127 | if (!e) | ||
| 3128 | return {scrollX : sx, scrollY : sy}; | ||
| 3129 | |||
| 3130 | // Count whitespace before | ||
| 3131 | trimNl(s.anchorNode.nodeValue || '').replace(/^\s+/, function(a) {wb = a.length;}); | ||
| 3132 | |||
| 3133 | return { | ||
| 3134 | start : Math.max(e.start + s.anchorOffset - wb, 0), | ||
| 3135 | end : Math.max(e.end + s.focusOffset - wb, 0), | ||
| 3136 | scrollX : sx, | ||
| 3137 | scrollY : sy, | ||
| 3138 | beg : s.anchorOffset - wb == 0 | ||
| 3139 | }; | ||
| 3140 | } else { | ||
| 3141 | e = getPos(ro, r.startContainer, r.endContainer); | ||
| 3142 | |||
| 3143 | // Count whitespace before start and end container | ||
| 3144 | //(r.startContainer.nodeValue || '').replace(/^\s+/, function(a) {wb = a.length;}); | ||
| 3145 | //(r.endContainer.nodeValue || '').replace(/^\s+/, function(a) {wa = a.length;}); | ||
| 3146 | |||
| 3147 | if (!e) | ||
| 3148 | return {scrollX : sx, scrollY : sy}; | ||
| 3149 | |||
| 3150 | return { | ||
| 3151 | start : Math.max(e.start + r.startOffset - wb, 0), | ||
| 3152 | end : Math.max(e.end + r.endOffset - wa, 0), | ||
| 3153 | scrollX : sx, | ||
| 3154 | scrollY : sy, | ||
| 3155 | beg : r.startOffset - wb == 0 | ||
| 3156 | }; | ||
| 3157 | } | ||
| 3158 | }, | ||
| 3159 | |||
| 3160 | moveToBookmark : function(b) { | ||
| 3161 | var t = this, r = t.getRng(), s = t.getSel(), ro = t.dom.getRoot(), sd, nvl, nv; | ||
| 3162 | |||
| 3163 | function getPos(r, sp, ep) { | ||
| 3164 | var w = t.dom.doc.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}, o, v, wa, wb; | ||
| 3165 | |||
| 3166 | while ((n = w.nextNode()) != null) { | ||
| 3167 | wa = wb = 0; | ||
| 3168 | |||
| 3169 | nv = n.nodeValue || ''; | ||
| 3170 | //nv.replace(/^\s+[^\s]/, function(a) {wb = a.length - 1;}); | ||
| 3171 | //nv.replace(/[^\s]\s+$/, function(a) {wa = a.length - 1;}); | ||
| 3172 | |||
| 3173 | nvl = trimNl(nv).length; | ||
| 3174 | p += nvl; | ||
| 3175 | |||
| 3176 | if (p >= sp && !d.startNode) { | ||
| 3177 | o = sp - (p - nvl); | ||
| 3178 | |||
| 3179 | // Fix for odd quirk in FF | ||
| 3180 | if (b.beg && o >= nvl) | ||
| 3181 | continue; | ||
| 3182 | |||
| 3183 | d.startNode = n; | ||
| 3184 | d.startOffset = o + wb; | ||
| 3185 | } | ||
| 3186 | |||
| 3187 | if (p >= ep) { | ||
| 3188 | d.endNode = n; | ||
| 3189 | d.endOffset = ep - (p - nvl) + wb; | ||
| 3190 | return d; | ||
| 3191 | } | ||
| 3192 | } | ||
| 3193 | |||
| 3194 | return null; | ||
| 3195 | }; | ||
| 3196 | |||
| 3197 | if (!b) | ||
| 3198 | return false; | ||
| 3199 | |||
| 3200 | t.win.scrollTo(b.scrollX, b.scrollY); | ||
| 3201 | |||
| 3202 | // Handle explorer | ||
| 3203 | if (isIE) { | ||
| 3204 | // Handle simple | ||
| 3205 | if (r = b.rng) { | ||
| 3206 | try { | ||
| 3207 | r.select(); | ||
| 3208 | } catch (ex) { | ||
| 3209 | // Ignore | ||
| 3210 | } | ||
| 3211 | |||
| 3212 | return true; | ||
| 3213 | } | ||
| 3214 | |||
| 3215 | t.win.focus(); | ||
| 3216 | |||
| 3217 | // Handle control bookmark | ||
| 3218 | if (b.tag) { | ||
| 3219 | r = ro.createControlRange(); | ||
| 3220 | |||
| 3221 | each(t.dom.select(b.tag), function(n, i) { | ||
| 3222 | if (i == b.index) | ||
| 3223 | r.addElement(n); | ||
| 3224 | }); | ||
| 3225 | } else { | ||
| 3226 | // Try/catch needed since this operation breaks when TinyMCE is placed in hidden divs/tabs | ||
| 3227 | try { | ||
| 3228 | // Incorrect bookmark | ||
| 3229 | if (b.start < 0) | ||
| 3230 | return true; | ||
| 3231 | |||
| 3232 | r = s.createRange(); | ||
| 3233 | r.moveToElementText(ro); | ||
| 3234 | r.collapse(true); | ||
| 3235 | r.moveStart('character', b.start); | ||
| 3236 | r.moveEnd('character', b.length); | ||
| 3237 | } catch (ex2) { | ||
| 3238 | return true; | ||
| 3239 | } | ||
| 3240 | } | ||
| 3241 | |||
| 3242 | try { | ||
| 3243 | r.select(); | ||
| 3244 | } catch (ex) { | ||
| 3245 | // Needed for some odd IE bug #1843306 | ||
| 3246 | } | ||
| 3247 | |||
| 3248 | return true; | ||
| 3249 | } | ||
| 3250 | |||
| 3251 | // Handle W3C | ||
| 3252 | if (!s) | ||
| 3253 | return false; | ||
| 3254 | |||
| 3255 | // Handle simple | ||
| 3256 | if (b.rng) { | ||
| 3257 | s.removeAllRanges(); | ||
| 3258 | s.addRange(b.rng); | ||
| 3259 | } else { | ||
| 3260 | if (is(b.start) && is(b.end)) { | ||
| 3261 | try { | ||
| 3262 | sd = getPos(ro, b.start, b.end); | ||
| 3263 | |||
| 3264 | if (sd) { | ||
| 3265 | r = t.dom.doc.createRange(); | ||
| 3266 | r.setStart(sd.startNode, sd.startOffset); | ||
| 3267 | r.setEnd(sd.endNode, sd.endOffset); | ||
| 3268 | s.removeAllRanges(); | ||
| 3269 | s.addRange(r); | ||
| 3270 | } | ||
| 3271 | |||
| 3272 | if (!tinymce.isOpera) | ||
| 3273 | t.win.focus(); | ||
| 3274 | } catch (ex) { | ||
| 3275 | // Ignore | ||
| 3276 | } | ||
| 3277 | } | ||
| 3278 | } | ||
| 3279 | }, | ||
| 3280 | |||
| 3281 | select : function(n, c) { | ||
| 3282 | var t = this, r = t.getRng(), s = t.getSel(), b, fn, ln, d = t.win.document; | ||
| 3283 | |||
| 3284 | function first(n) { | ||
| 3285 | return n ? d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false).nextNode() : null; | ||
| 3286 | }; | ||
| 3287 | |||
| 3288 | function last(n) { | ||
| 3289 | var c, o, w; | ||
| 3290 | |||
| 3291 | if (!n) | ||
| 3292 | return null; | ||
| 3293 | |||
| 3294 | w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); | ||
| 3295 | while (c = w.nextNode()) | ||
| 3296 | o = c; | ||
| 3297 | |||
| 3298 | return o; | ||
| 3299 | }; | ||
| 3300 | |||
| 3301 | if (isIE) { | ||
| 3302 | try { | ||
| 3303 | b = d.body; | ||
| 3304 | |||
| 3305 | if (/^(IMG|TABLE)$/.test(n.nodeName)) { | ||
| 3306 | r = b.createControlRange(); | ||
| 3307 | r.addElement(n); | ||
| 3308 | } else { | ||
| 3309 | r = b.createTextRange(); | ||
| 3310 | r.moveToElementText(n); | ||
| 3311 | } | ||
| 3312 | |||
| 3313 | r.select(); | ||
| 3314 | } catch (ex) { | ||
| 3315 | // Throws illigal agrument in IE some times | ||
| 3316 | } | ||
| 3317 | } else { | ||
| 3318 | if (c) { | ||
| 3319 | fn = first(n); | ||
| 3320 | ln = last(n); | ||
| 3321 | |||
| 3322 | if (fn && ln) { | ||
| 3323 | //console.debug(fn, ln); | ||
| 3324 | r = d.createRange(); | ||
| 3325 | r.setStart(fn, 0); | ||
| 3326 | r.setEnd(ln, ln.nodeValue.length); | ||
| 3327 | } else | ||
| 3328 | r.selectNode(n); | ||
| 3329 | } else | ||
| 3330 | r.selectNode(n); | ||
| 3331 | |||
| 3332 | t.setRng(r); | ||
| 3333 | } | ||
| 3334 | |||
| 3335 | return n; | ||
| 3336 | }, | ||
| 3337 | |||
| 3338 | isCollapsed : function() { | ||
| 3339 | var t = this, r = t.getRng(), s = t.getSel(); | ||
| 3340 | |||
| 3341 | if (!r || r.item) | ||
| 3342 | return false; | ||
| 3343 | |||
| 3344 | return !s || r.boundingWidth == 0 || r.collapsed; | ||
| 3345 | }, | ||
| 3346 | |||
| 3347 | collapse : function(b) { | ||
| 3348 | var t = this, r = t.getRng(), n; | ||
| 3349 | |||
| 3350 | // Control range on IE | ||
| 3351 | if (r.item) { | ||
| 3352 | n = r.item(0); | ||
| 3353 | r = this.win.document.body.createTextRange(); | ||
| 3354 | r.moveToElementText(n); | ||
| 3355 | } | ||
| 3356 | |||
| 3357 | r.collapse(!!b); | ||
| 3358 | t.setRng(r); | ||
| 3359 | }, | ||
| 3360 | |||
| 3361 | getSel : function() { | ||
| 3362 | var t = this, w = this.win; | ||
| 3363 | |||
| 3364 | return w.getSelection ? w.getSelection() : w.document.selection; | ||
| 3365 | }, | ||
| 3366 | |||
| 3367 | getRng : function() { | ||
| 3368 | var t = this, s = t.getSel(), r; | ||
| 3369 | |||
| 3370 | try { | ||
| 3371 | if (s) | ||
| 3372 | r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : t.win.document.createRange()); | ||
| 3373 | } catch (ex) { | ||
| 3374 | // IE throws unspecified error here if TinyMCE is placed in a frame/iframe | ||
| 3375 | } | ||
| 3376 | |||
| 3377 | // No range found then create an empty one | ||
| 3378 | // This can occur when the editor is placed in a hidden container element on Gecko | ||
| 3379 | // Or on IE when there was an exception | ||
| 3380 | if (!r) | ||
| 3381 | r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange(); | ||
| 3382 | |||
| 3383 | return r; | ||
| 3384 | }, | ||
| 3385 | |||
| 3386 | setRng : function(r) { | ||
| 3387 | var s; | ||
| 3388 | |||
| 3389 | if (!isIE) { | ||
| 3390 | s = this.getSel(); | ||
| 3391 | |||
| 3392 | if (s) { | ||
| 3393 | s.removeAllRanges(); | ||
| 3394 | s.addRange(r); | ||
| 3395 | } | ||
| 3396 | } else { | ||
| 3397 | try { | ||
| 3398 | r.select(); | ||
| 3399 | } catch (ex) { | ||
| 3400 | // Needed for some odd IE bug #1843306 | ||
| 3401 | } | ||
| 3402 | } | ||
| 3403 | }, | ||
| 3404 | |||
| 3405 | setNode : function(n) { | ||
| 3406 | var t = this; | ||
| 3407 | |||
| 3408 | t.setContent(t.dom.getOuterHTML(n)); | ||
| 3409 | |||
| 3410 | return n; | ||
| 3411 | }, | ||
| 3412 | |||
| 3413 | getNode : function() { | ||
| 3414 | var t = this, r = t.getRng(), s = t.getSel(), e; | ||
| 3415 | |||
| 3416 | if (!isIE) { | ||
| 3417 | // Range maybe lost after the editor is made visible again | ||
| 3418 | if (!r) | ||
| 3419 | return t.dom.getRoot(); | ||
| 3420 | |||
| 3421 | e = r.commonAncestorContainer; | ||
| 3422 | |||
| 3423 | // Handle selection a image or other control like element such as anchors | ||
| 3424 | if (!r.collapsed) { | ||
| 3425 | // If the anchor node is a element instead of a text node then return this element | ||
| 3426 | if (tinymce.isWebKit && s.anchorNode && s.anchorNode.nodeType == 1) | ||
| 3427 | return s.anchorNode.childNodes[s.anchorOffset]; | ||
| 3428 | |||
| 3429 | if (r.startContainer == r.endContainer) { | ||
| 3430 | if (r.startOffset - r.endOffset < 2) { | ||
| 3431 | if (r.startContainer.hasChildNodes()) | ||
| 3432 | e = r.startContainer.childNodes[r.startOffset]; | ||
| 3433 | } | ||
| 3434 | } | ||
| 3435 | } | ||
| 3436 | |||
| 3437 | return t.dom.getParent(e, function(n) { | ||
| 3438 | return n.nodeType == 1; | ||
| 3439 | }); | ||
| 3440 | } | ||
| 3441 | |||
| 3442 | return r.item ? r.item(0) : r.parentElement(); | ||
| 3443 | }, | ||
| 3444 | |||
| 3445 | destroy : function(s) { | ||
| 3446 | var t = this; | ||
| 3447 | |||
| 3448 | t.win = null; | ||
| 3449 | |||
| 3450 | // Manual destroy then remove unload handler | ||
| 3451 | if (!s) | ||
| 3452 | tinymce.removeUnload(t.destroy); | ||
| 3453 | } | ||
| 3454 | |||
| 3455 | }); | ||
| 3456 | })(); | ||
| 3457 | |||
| 3458 | /* file:jscripts/tiny_mce/classes/dom/XMLWriter.js */ | ||
| 3459 | |||
| 3460 | (function() { | ||
| 3461 | tinymce.create('tinymce.dom.XMLWriter', { | ||
| 3462 | node : null, | ||
| 3463 | |||
| 3464 | XMLWriter : function(s) { | ||
| 3465 | // Get XML document | ||
| 3466 | function getXML() { | ||
| 3467 | var i = document.implementation; | ||
| 3468 | |||
| 3469 | if (!i || !i.createDocument) { | ||
| 3470 | // Try IE objects | ||
| 3471 | try {return new ActiveXObject('MSXML2.DOMDocument');} catch (ex) {} | ||
| 3472 | try {return new ActiveXObject('Microsoft.XmlDom');} catch (ex) {} | ||
| 3473 | } else | ||
| 3474 | return i.createDocument('', '', null); | ||
| 3475 | }; | ||
| 3476 | |||
| 3477 | this.doc = getXML(); | ||
| 3478 | |||
| 3479 | // Since Opera and WebKit doesn't escape > into > we need to do it our self to normalize the output for all browsers | ||
| 3480 | this.valid = tinymce.isOpera || tinymce.isWebKit; | ||
| 3481 | |||
| 3482 | this.reset(); | ||
| 3483 | }, | ||
| 3484 | |||
| 3485 | reset : function() { | ||
| 3486 | var t = this, d = t.doc; | ||
| 3487 | |||
| 3488 | if (d.firstChild) | ||
| 3489 | d.removeChild(d.firstChild); | ||
| 3490 | |||
| 3491 | t.node = d.appendChild(d.createElement("html")); | ||
| 3492 | }, | ||
| 3493 | |||
| 3494 | writeStartElement : function(n) { | ||
| 3495 | var t = this; | ||
| 3496 | |||
| 3497 | t.node = t.node.appendChild(t.doc.createElement(n)); | ||
| 3498 | }, | ||
| 3499 | |||
| 3500 | writeAttribute : function(n, v) { | ||
| 3501 | if (this.valid) | ||
| 3502 | v = v.replace(/>/g, '%MCGT%'); | ||
| 3503 | |||
| 3504 | this.node.setAttribute(n, v); | ||
| 3505 | }, | ||
| 3506 | |||
| 3507 | writeEndElement : function() { | ||
| 3508 | this.node = this.node.parentNode; | ||
| 3509 | }, | ||
| 3510 | |||
| 3511 | writeFullEndElement : function() { | ||
| 3512 | var t = this, n = t.node; | ||
| 3513 | |||
| 3514 | n.appendChild(t.doc.createTextNode("")); | ||
| 3515 | t.node = n.parentNode; | ||
| 3516 | }, | ||
| 3517 | |||
| 3518 | writeText : function(v) { | ||
| 3519 | if (this.valid) | ||
| 3520 | v = v.replace(/>/g, '%MCGT%'); | ||
| 3521 | |||
| 3522 | this.node.appendChild(this.doc.createTextNode(v)); | ||
| 3523 | }, | ||
| 3524 | |||
| 3525 | writeCDATA : function(v) { | ||
| 3526 | this.node.appendChild(this.doc.createCDATA(v)); | ||
| 3527 | }, | ||
| 3528 | |||
| 3529 | writeComment : function(v) { | ||
| 3530 | // Fix for bug #2035694 | ||
| 3531 | if (tinymce.isIE) | ||
| 3532 | v = v.replace(/^\-|\-$/g, ' '); | ||
| 3533 | |||
| 3534 | this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' '))); | ||
| 3535 | }, | ||
| 3536 | |||
| 3537 | getContent : function() { | ||
| 3538 | var h; | ||
| 3539 | |||
| 3540 | h = this.doc.xml || new XMLSerializer().serializeToString(this.doc); | ||
| 3541 | h = h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g, ''); | ||
| 3542 | h = h.replace(/ ?\/>/g, ' />'); | ||
| 3543 | |||
| 3544 | if (this.valid) | ||
| 3545 | h = h.replace(/\%MCGT%/g, '>'); | ||
| 3546 | |||
| 3547 | return h; | ||
| 3548 | } | ||
| 3549 | |||
| 3550 | }); | ||
| 3551 | })(); | ||
| 3552 | |||
| 3553 | /* file:jscripts/tiny_mce/classes/dom/StringWriter.js */ | ||
| 3554 | |||
| 3555 | (function() { | ||
| 3556 | tinymce.create('tinymce.dom.StringWriter', { | ||
| 3557 | str : null, | ||
| 3558 | tags : null, | ||
| 3559 | count : 0, | ||
| 3560 | settings : null, | ||
| 3561 | indent : null, | ||
| 3562 | |||
| 3563 | StringWriter : function(s) { | ||
| 3564 | this.settings = tinymce.extend({ | ||
| 3565 | indent_char : ' ', | ||
| 3566 | indentation : 1 | ||
| 3567 | }, s); | ||
| 3568 | |||
| 3569 | this.reset(); | ||
| 3570 | }, | ||
| 3571 | |||
| 3572 | reset : function() { | ||
| 3573 | this.indent = ''; | ||
| 3574 | this.str = ""; | ||
| 3575 | this.tags = []; | ||
| 3576 | this.count = 0; | ||
| 3577 | }, | ||
| 3578 | |||
| 3579 | writeStartElement : function(n) { | ||
| 3580 | this._writeAttributesEnd(); | ||
| 3581 | this.writeRaw('<' + n); | ||
| 3582 | this.tags.push(n); | ||
| 3583 | this.inAttr = true; | ||
| 3584 | this.count++; | ||
| 3585 | this.elementCount = this.count; | ||
| 3586 | }, | ||
| 3587 | |||
| 3588 | writeAttribute : function(n, v) { | ||
| 3589 | var t = this; | ||
| 3590 | |||
| 3591 | t.writeRaw(" " + t.encode(n) + '="' + t.encode(v) + '"'); | ||
| 3592 | }, | ||
| 3593 | |||
| 3594 | writeEndElement : function() { | ||
| 3595 | var n; | ||
| 3596 | |||
| 3597 | if (this.tags.length > 0) { | ||
| 3598 | n = this.tags.pop(); | ||
| 3599 | |||
| 3600 | if (this._writeAttributesEnd(1)) | ||
| 3601 | this.writeRaw('</' + n + '>'); | ||
| 3602 | |||
| 3603 | if (this.settings.indentation > 0) | ||
| 3604 | this.writeRaw('\n'); | ||
| 3605 | } | ||
| 3606 | }, | ||
| 3607 | |||
| 3608 | writeFullEndElement : function() { | ||
| 3609 | if (this.tags.length > 0) { | ||
| 3610 | this._writeAttributesEnd(); | ||
| 3611 | this.writeRaw('</' + this.tags.pop() + '>'); | ||
| 3612 | |||
| 3613 | if (this.settings.indentation > 0) | ||
| 3614 | this.writeRaw('\n'); | ||
| 3615 | } | ||
| 3616 | }, | ||
| 3617 | |||
| 3618 | writeText : function(v) { | ||
| 3619 | this._writeAttributesEnd(); | ||
| 3620 | this.writeRaw(this.encode(v)); | ||
| 3621 | this.count++; | ||
| 3622 | }, | ||
| 3623 | |||
| 3624 | writeCDATA : function(v) { | ||
| 3625 | this._writeAttributesEnd(); | ||
| 3626 | this.writeRaw('<![CDATA[' + v + ']]>'); | ||
| 3627 | this.count++; | ||
| 3628 | }, | ||
| 3629 | |||
| 3630 | writeComment : function(v) { | ||
| 3631 | this._writeAttributesEnd(); | ||
| 3632 | this.writeRaw('<!-- ' + v + '-->'); | ||
| 3633 | this.count++; | ||
| 3634 | }, | ||
| 3635 | |||
| 3636 | writeRaw : function(v) { | ||
| 3637 | this.str += v; | ||
| 3638 | }, | ||
| 3639 | |||
| 3640 | encode : function(s) { | ||
| 3641 | return s.replace(/[<>&"]/g, function(v) { | ||
| 3642 | switch (v) { | ||
| 3643 | case '<': | ||
| 3644 | return '<'; | ||
| 3645 | |||
| 3646 | case '>': | ||
| 3647 | return '>'; | ||
| 3648 | |||
| 3649 | case '&': | ||
| 3650 | return '&'; | ||
| 3651 | |||
| 3652 | case '"': | ||
| 3653 | return '"'; | ||
| 3654 | } | ||
| 3655 | |||
| 3656 | return v; | ||
| 3657 | }); | ||
| 3658 | }, | ||
| 3659 | |||
| 3660 | getContent : function() { | ||
| 3661 | return this.str; | ||
| 3662 | }, | ||
| 3663 | |||
| 3664 | _writeAttributesEnd : function(s) { | ||
| 3665 | if (!this.inAttr) | ||
| 3666 | return; | ||
| 3667 | |||
| 3668 | this.inAttr = false; | ||
| 3669 | |||
| 3670 | if (s && this.elementCount == this.count) { | ||
| 3671 | this.writeRaw(' />'); | ||
| 3672 | return false; | ||
| 3673 | } | ||
| 3674 | |||
| 3675 | this.writeRaw('>'); | ||
| 3676 | |||
| 3677 | return true; | ||
| 3678 | } | ||
| 3679 | |||
| 3680 | }); | ||
| 3681 | })(); | ||
| 3682 | |||
| 3683 | /* file:jscripts/tiny_mce/classes/dom/Serializer.js */ | ||
| 3684 | |||
| 3685 | (function() { | ||
| 3686 | // Shorten names | ||
| 3687 | var extend = tinymce.extend, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, isIE = tinymce.isIE, isGecko = tinymce.isGecko; | ||
| 3688 | |||
| 3689 | // Returns only attribites that have values not all attributes in IE | ||
| 3690 | function getIEAtts(n) { | ||
| 3691 | var o = []; | ||
| 3692 | |||
| 3693 | // Object will throw exception in IE | ||
| 3694 | if (n.nodeName == 'OBJECT') | ||
| 3695 | return n.attributes; | ||
| 3696 | |||
| 3697 | n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi, function(a, b) { | ||
| 3698 | o.push({specified : 1, nodeName : b}); | ||
| 3699 | }); | ||
| 3700 | |||
| 3701 | return o; | ||
| 3702 | }; | ||
| 3703 | |||
| 3704 | function wildcardToRE(s) { | ||
| 3705 | return s.replace(/([?+*])/g, '.$1'); | ||
| 3706 | }; | ||
| 3707 | |||
| 3708 | tinymce.create('tinymce.dom.Serializer', { | ||
| 3709 | Serializer : function(s) { | ||
| 3710 | var t = this; | ||
| 3711 | |||
| 3712 | t.key = 0; | ||
| 3713 | t.onPreProcess = new Dispatcher(t); | ||
| 3714 | t.onPostProcess = new Dispatcher(t); | ||
| 3715 | |||
| 3716 | if (tinymce.relaxedDomain && tinymce.isGecko) { | ||
| 3717 | // Gecko has a bug where we can't create a new XML document if domain relaxing is used | ||
| 3718 | t.writer = new tinymce.dom.StringWriter(); | ||
| 3719 | } else { | ||
| 3720 | try { | ||
| 3721 | t.writer = new tinymce.dom.XMLWriter(); | ||
| 3722 | } catch (ex) { | ||
| 3723 | // IE might throw exception if ActiveX is disabled so we then switch to the slightly slower StringWriter | ||
| 3724 | t.writer = new tinymce.dom.StringWriter(); | ||
| 3725 | } | ||
| 3726 | } | ||
| 3727 | |||
| 3728 | // Default settings | ||
| 3729 | t.settings = s = extend({ | ||
| 3730 | dom : tinymce.DOM, | ||
| 3731 | valid_nodes : 0, | ||
| 3732 | node_filter : 0, | ||
| 3733 | attr_filter : 0, | ||
| 3734 | invalid_attrs : /^(mce_|_moz_)/, | ||
| 3735 | closed : /(br|hr|input|meta|img|link|param)/, | ||
| 3736 | entity_encoding : 'named', | ||
| 3737 | entities : '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro', | ||
| 3738 | bool_attrs : /(checked|disabled|readonly|selected|nowrap)/, | ||
| 3739 | valid_elements : '*[*]', | ||
| 3740 | extended_valid_elements : 0, | ||
| 3741 | valid_child_elements : 0, | ||
| 3742 | invalid_elements : 0, | ||
| 3743 | fix_table_elements : 0, | ||
| 3744 | fix_list_elements : true, | ||
| 3745 | fix_content_duplication : true, | ||
| 3746 | convert_fonts_to_spans : false, | ||
| 3747 | font_size_classes : 0, | ||
| 3748 | font_size_style_values : 0, | ||
| 3749 | apply_source_formatting : 0, | ||
| 3750 | indent_mode : 'simple', | ||
| 3751 | indent_char : '\t', | ||
| 3752 | indent_levels : 1, | ||
| 3753 | remove_linebreaks : 1, | ||
| 3754 | remove_redundant_brs : 1, | ||
| 3755 | element_format : 'xhtml' | ||
| 3756 | }, s); | ||
| 3757 | |||
| 3758 | t.dom = s.dom; | ||
| 3759 | |||
| 3760 | if (s.remove_redundant_brs) { | ||
| 3761 | t.onPostProcess.add(function(se, o) { | ||
| 3762 | // Remove BR elements at end of list elements since they get rendered in IE | ||
| 3763 | o.content = o.content.replace(/<br \/>(\s*<\/li>)/g, '$1'); | ||
| 3764 | }); | ||
| 3765 | } | ||
| 3766 | |||
| 3767 | // Remove XHTML element endings i.e. produce crap :) XHTML is better | ||
| 3768 | if (s.element_format == 'html') { | ||
| 3769 | t.onPostProcess.add(function(se, o) { | ||
| 3770 | o.content = o.content.replace(/<([^>]+) \/>/g, '<$1>'); | ||
| 3771 | }); | ||
| 3772 | } | ||
| 3773 | |||
| 3774 | if (s.fix_list_elements) { | ||
| 3775 | t.onPreProcess.add(function(se, o) { | ||
| 3776 | var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np; | ||
| 3777 | |||
| 3778 | function prevNode(e, n) { | ||
| 3779 | var a = n.split(','), i; | ||
| 3780 | |||
| 3781 | while ((e = e.previousSibling) != null) { | ||
| 3782 | for (i=0; i<a.length; i++) { | ||
| 3783 | if (e.nodeName == a[i]) | ||
| 3784 | return e; | ||
| 3785 | } | ||
| 3786 | } | ||
| 3787 | |||
| 3788 | return null; | ||
| 3789 | }; | ||
| 3790 | |||
| 3791 | for (x=0; x<a.length; x++) { | ||
| 3792 | nl = t.dom.select(a[x], o.node); | ||
| 3793 | |||
| 3794 | for (i=0; i<nl.length; i++) { | ||
| 3795 | n = nl[i]; | ||
| 3796 | p = n.parentNode; | ||
| 3797 | |||
| 3798 | if (r.test(p.nodeName)) { | ||
| 3799 | np = prevNode(n, 'LI'); | ||
| 3800 | |||
| 3801 | if (!np) { | ||
| 3802 | np = t.dom.create('li'); | ||
| 3803 | np.innerHTML = ' '; | ||
| 3804 | np.appendChild(n); | ||
| 3805 | p.insertBefore(np, p.firstChild); | ||
| 3806 | } else | ||
| 3807 | np.appendChild(n); | ||
| 3808 | } | ||
| 3809 | } | ||
| 3810 | } | ||
| 3811 | }); | ||
| 3812 | } | ||
| 3813 | |||
| 3814 | if (s.fix_table_elements) { | ||
| 3815 | t.onPreProcess.add(function(se, o) { | ||
| 3816 | each(t.dom.select('table', o.node), function(e) { | ||
| 3817 | var pa = t.dom.getParent(e, 'H1,H2,H3,H4,H5,H6,P'), pa2, n, tm, pl = [], i, ns; | ||
| 3818 | |||
| 3819 | if (pa) { | ||
| 3820 | pa2 = pa.cloneNode(false); | ||
| 3821 | |||
| 3822 | pl.push(e); | ||
| 3823 | for (n = e; n = n.parentNode;) { | ||
| 3824 | pl.push(n); | ||
| 3825 | |||
| 3826 | if (n == pa) | ||
| 3827 | break; | ||
| 3828 | } | ||
| 3829 | |||
| 3830 | tm = pa2; | ||
| 3831 | for (i = pl.length - 1; i >= 0; i--) { | ||
| 3832 | if (i == pl.length - 1) { | ||
| 3833 | while (ns = pl[i - 1].nextSibling) | ||
| 3834 | tm.appendChild(ns.parentNode.removeChild(ns)); | ||
| 3835 | } else { | ||
| 3836 | n = pl[i].cloneNode(false); | ||
| 3837 | |||
| 3838 | if (i != 0) { | ||
| 3839 | while (ns = pl[i - 1].nextSibling) | ||
| 3840 | n.appendChild(ns.parentNode.removeChild(ns)); | ||
| 3841 | } | ||
| 3842 | |||
| 3843 | tm = tm.appendChild(n); | ||
| 3844 | } | ||
| 3845 | } | ||
| 3846 | |||
| 3847 | e = t.dom.insertAfter(e.parentNode.removeChild(e), pa); | ||
| 3848 | t.dom.insertAfter(e, pa); | ||
| 3849 | t.dom.insertAfter(pa2, e); | ||
| 3850 | } | ||
| 3851 | }); | ||
| 3852 | }); | ||
| 3853 | } | ||
| 3854 | }, | ||
| 3855 | |||
| 3856 | setEntities : function(s) { | ||
| 3857 | var t = this, a, i, l = {}, re = '', v; | ||
| 3858 | |||
| 3859 | // No need to setup more than once | ||
| 3860 | if (t.entityLookup) | ||
| 3861 | return; | ||
| 3862 | |||
| 3863 | // Build regex and lookup array | ||
| 3864 | a = s.split(','); | ||
| 3865 | for (i = 0; i < a.length; i += 2) { | ||
| 3866 | v = a[i]; | ||
| 3867 | |||
| 3868 | // Don't add default & " etc. | ||
| 3869 | if (v == 34 || v == 38 || v == 60 || v == 62) | ||
| 3870 | continue; | ||
| 3871 | |||
| 3872 | l[String.fromCharCode(a[i])] = a[i + 1]; | ||
| 3873 | |||
| 3874 | v = parseInt(a[i]).toString(16); | ||
| 3875 | re += '\\u' + '0000'.substring(v.length) + v; | ||
| 3876 | } | ||
| 3877 | |||
| 3878 | if (!re) { | ||
| 3879 | t.settings.entity_encoding = 'raw'; | ||
| 3880 | return; | ||
| 3881 | } | ||
| 3882 | |||
| 3883 | t.entitiesRE = new RegExp('[' + re + ']', 'g'); | ||
| 3884 | t.entityLookup = l; | ||
| 3885 | }, | ||
| 3886 | |||
| 3887 | setValidChildRules : function(s) { | ||
| 3888 | this.childRules = null; | ||
| 3889 | this.addValidChildRules(s); | ||
| 3890 | }, | ||
| 3891 | |||
| 3892 | addValidChildRules : function(s) { | ||
| 3893 | var t = this, inst, intr, bloc; | ||
| 3894 | |||
| 3895 | if (!s) | ||
| 3896 | return; | ||
| 3897 | |||
| 3898 | inst = 'A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment'; | ||
| 3899 | intr = 'A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment'; | ||
| 3900 | bloc = 'H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP'; | ||
| 3901 | |||
| 3902 | each(s.split(','), function(s) { | ||
| 3903 | var p = s.split(/\[|\]/), re; | ||
| 3904 | |||
| 3905 | s = ''; | ||
| 3906 | each(p[1].split('|'), function(v) { | ||
| 3907 | if (s) | ||
| 3908 | s += '|'; | ||
| 3909 | |||
| 3910 | switch (v) { | ||
| 3911 | case '%itrans': | ||
| 3912 | v = intr; | ||
| 3913 | break; | ||
| 3914 | |||
| 3915 | case '%itrans_na': | ||
| 3916 | v = intr.substring(2); | ||
| 3917 | break; | ||
| 3918 | |||
| 3919 | case '%istrict': | ||
| 3920 | v = inst; | ||
| 3921 | break; | ||
| 3922 | |||
| 3923 | case '%istrict_na': | ||
| 3924 | v = inst.substring(2); | ||
| 3925 | break; | ||
| 3926 | |||
| 3927 | case '%btrans': | ||
| 3928 | v = bloc; | ||
| 3929 | break; | ||
| 3930 | |||
| 3931 | case '%bstrict': | ||
| 3932 | v = bloc; | ||
| 3933 | break; | ||
| 3934 | } | ||
| 3935 | |||
| 3936 | s += v; | ||
| 3937 | }); | ||
| 3938 | re = new RegExp('^(' + s.toLowerCase() + ')$', 'i'); | ||
| 3939 | |||
| 3940 | each(p[0].split('/'), function(s) { | ||
| 3941 | t.childRules = t.childRules || {}; | ||
| 3942 | t.childRules[s] = re; | ||
| 3943 | }); | ||
| 3944 | }); | ||
| 3945 | |||
| 3946 | // Build regex | ||
| 3947 | s = ''; | ||
| 3948 | each(t.childRules, function(v, k) { | ||
| 3949 | if (s) | ||
| 3950 | s += '|'; | ||
| 3951 | |||
| 3952 | s += k; | ||
| 3953 | }); | ||
| 3954 | |||
| 3955 | t.parentElementsRE = new RegExp('^(' + s.toLowerCase() + ')$', 'i'); | ||
| 3956 | |||
| 3957 | /*console.debug(t.parentElementsRE.toString()); | ||
| 3958 | each(t.childRules, function(v) { | ||
| 3959 | console.debug(v.toString()); | ||
| 3960 | });*/ | ||
| 3961 | }, | ||
| 3962 | |||
| 3963 | setRules : function(s) { | ||
| 3964 | var t = this; | ||
| 3965 | |||
| 3966 | t._setup(); | ||
| 3967 | t.rules = {}; | ||
| 3968 | t.wildRules = []; | ||
| 3969 | t.validElements = {}; | ||
| 3970 | |||
| 3971 | return t.addRules(s); | ||
| 3972 | }, | ||
| 3973 | |||
| 3974 | addRules : function(s) { | ||
| 3975 | var t = this, dr; | ||
| 3976 | |||
| 3977 | if (!s) | ||
| 3978 | return; | ||
| 3979 | |||
| 3980 | t._setup(); | ||
| 3981 | |||
| 3982 | each(s.split(','), function(s) { | ||
| 3983 | var p = s.split(/\[|\]/), tn = p[0].split('/'), ra, at, wat, va = []; | ||
| 3984 | |||
| 3985 | // Extend with default rules | ||
| 3986 | if (dr) | ||
| 3987 | at = tinymce.extend([], dr.attribs); | ||
| 3988 | |||
| 3989 | // Parse attributes | ||
| 3990 | if (p.length > 1) { | ||
| 3991 | each(p[1].split('|'), function(s) { | ||
| 3992 | var ar = {}, i; | ||
| 3993 | |||
| 3994 | at = at || []; | ||
| 3995 | |||
| 3996 | // Parse attribute rule | ||
| 3997 | s = s.replace(/::/g, '~'); | ||
| 3998 | s = /^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s); | ||
| 3999 | s[2] = s[2].replace(/~/g, ':'); | ||
| 4000 | |||
| 4001 | // Add required attributes | ||
| 4002 | if (s[1] == '!') { | ||
| 4003 | ra = ra || []; | ||
| 4004 | ra.push(s[2]); | ||
| 4005 | } | ||
| 4006 | |||
| 4007 | // Remove inherited attributes | ||
| 4008 | if (s[1] == '-') { | ||
| 4009 | for (i = 0; i <at.length; i++) { | ||
| 4010 | if (at[i].name == s[2]) { | ||
| 4011 | at.splice(i, 1); | ||
| 4012 | return; | ||
| 4013 | } | ||
| 4014 | } | ||
| 4015 | } | ||
| 4016 | |||
| 4017 | switch (s[3]) { | ||
| 4018 | // Add default attrib values | ||
| 4019 | case '=': | ||
| 4020 | ar.defaultVal = s[4] || ''; | ||
| 4021 | break; | ||
| 4022 | |||
| 4023 | // Add forced attrib values | ||
| 4024 | case ':': | ||
| 4025 | ar.forcedVal = s[4]; | ||
| 4026 | break; | ||
| 4027 | |||
| 4028 | // Add validation values | ||
| 4029 | case '<': | ||
| 4030 | ar.validVals = s[4].split('?'); | ||
| 4031 | break; | ||
| 4032 | } | ||
| 4033 | |||
| 4034 | if (/[*.?]/.test(s[2])) { | ||
| 4035 | wat = wat || []; | ||
| 4036 | ar.nameRE = new RegExp('^' + wildcardToRE(s[2]) + '$'); | ||
| 4037 | wat.push(ar); | ||
| 4038 | } else { | ||
| 4039 | ar.name = s[2]; | ||
| 4040 | at.push(ar); | ||
| 4041 | } | ||
| 4042 | |||
| 4043 | va.push(s[2]); | ||
| 4044 | }); | ||
| 4045 | } | ||
| 4046 | |||
| 4047 | // Handle element names | ||
| 4048 | each(tn, function(s, i) { | ||
| 4049 | var pr = s.charAt(0), x = 1, ru = {}; | ||
| 4050 | |||
| 4051 | // Extend with default rule data | ||
| 4052 | if (dr) { | ||
| 4053 | if (dr.noEmpty) | ||
| 4054 | ru.noEmpty = dr.noEmpty; | ||
| 4055 | |||
| 4056 | if (dr.fullEnd) | ||
| 4057 | ru.fullEnd = dr.fullEnd; | ||
| 4058 | |||
| 4059 | if (dr.padd) | ||
| 4060 | ru.padd = dr.padd; | ||
| 4061 | } | ||
| 4062 | |||
| 4063 | // Handle prefixes | ||
| 4064 | switch (pr) { | ||
| 4065 | case '-': | ||
| 4066 | ru.noEmpty = true; | ||
| 4067 | break; | ||
| 4068 | |||
| 4069 | case '+': | ||
| 4070 | ru.fullEnd = true; | ||
| 4071 | break; | ||
| 4072 | |||
| 4073 | case '#': | ||
| 4074 | ru.padd = true; | ||
| 4075 | break; | ||
| 4076 | |||
| 4077 | default: | ||
| 4078 | x = 0; | ||
| 4079 | } | ||
| 4080 | |||
| 4081 | tn[i] = s = s.substring(x); | ||
| 4082 | t.validElements[s] = 1; | ||
| 4083 | |||
| 4084 | // Add element name or element regex | ||
| 4085 | if (/[*.?]/.test(tn[0])) { | ||
| 4086 | ru.nameRE = new RegExp('^' + wildcardToRE(tn[0]) + '$'); | ||
| 4087 | t.wildRules = t.wildRules || {}; | ||
| 4088 | t.wildRules.push(ru); | ||
| 4089 | } else { | ||
| 4090 | ru.name = tn[0]; | ||
| 4091 | |||
| 4092 | // Store away default rule | ||
| 4093 | if (tn[0] == '@') | ||
| 4094 | dr = ru; | ||
| 4095 | |||
| 4096 | t.rules[s] = ru; | ||
| 4097 | } | ||
| 4098 | |||
| 4099 | ru.attribs = at; | ||
| 4100 | |||
| 4101 | if (ra) | ||
| 4102 | ru.requiredAttribs = ra; | ||
| 4103 | |||
| 4104 | if (wat) { | ||
| 4105 | // Build valid attributes regexp | ||
| 4106 | s = ''; | ||
| 4107 | each(va, function(v) { | ||
| 4108 | if (s) | ||
| 4109 | s += '|'; | ||
| 4110 | |||
| 4111 | s += '(' + wildcardToRE(v) + ')'; | ||
| 4112 | }); | ||
| 4113 | ru.validAttribsRE = new RegExp('^' + s.toLowerCase() + '$'); | ||
| 4114 | ru.wildAttribs = wat; | ||
| 4115 | } | ||
| 4116 | }); | ||
| 4117 | }); | ||
| 4118 | |||
| 4119 | // Build valid elements regexp | ||
| 4120 | s = ''; | ||
| 4121 | each(t.validElements, function(v, k) { | ||
| 4122 | if (s) | ||
| 4123 | s += '|'; | ||
| 4124 | |||
| 4125 | if (k != '@') | ||
| 4126 | s += k; | ||
| 4127 | }); | ||
| 4128 | t.validElementsRE = new RegExp('^(' + wildcardToRE(s.toLowerCase()) + ')$'); | ||
| 4129 | |||
| 4130 | //console.debug(t.validElementsRE.toString()); | ||
| 4131 | //console.dir(t.rules); | ||
| 4132 | //console.dir(t.wildRules); | ||
| 4133 | }, | ||
| 4134 | |||
| 4135 | findRule : function(n) { | ||
| 4136 | var t = this, rl = t.rules, i, r; | ||
| 4137 | |||
| 4138 | t._setup(); | ||
| 4139 | |||
| 4140 | // Exact match | ||
| 4141 | r = rl[n]; | ||
| 4142 | if (r) | ||
| 4143 | return r; | ||
| 4144 | |||
| 4145 | // Try wildcards | ||
| 4146 | rl = t.wildRules; | ||
| 4147 | for (i = 0; i < rl.length; i++) { | ||
| 4148 | if (rl[i].nameRE.test(n)) | ||
| 4149 | return rl[i]; | ||
| 4150 | } | ||
| 4151 | |||
| 4152 | return null; | ||
| 4153 | }, | ||
| 4154 | |||
| 4155 | findAttribRule : function(ru, n) { | ||
| 4156 | var i, wa = ru.wildAttribs; | ||
| 4157 | |||
| 4158 | for (i = 0; i < wa.length; i++) { | ||
| 4159 | if (wa[i].nameRE.test(n)) | ||
| 4160 | return wa[i]; | ||
| 4161 | } | ||
| 4162 | |||
| 4163 | return null; | ||
| 4164 | }, | ||
| 4165 | |||
| 4166 | serialize : function(n, o) { | ||
| 4167 | var h, t = this; | ||
| 4168 | |||
| 4169 | t._setup(); | ||
| 4170 | o = o || {}; | ||
| 4171 | o.format = o.format || 'html'; | ||
| 4172 | t.processObj = o; | ||
| 4173 | n = n.cloneNode(true); | ||
| 4174 | t.key = '' + (parseInt(t.key) + 1); | ||
| 4175 | |||
| 4176 | // Pre process | ||
| 4177 | if (!o.no_events) { | ||
| 4178 | o.node = n; | ||
| 4179 | t.onPreProcess.dispatch(t, o); | ||
| 4180 | } | ||
| 4181 | |||
| 4182 | // Serialize HTML DOM into a string | ||
| 4183 | t.writer.reset(); | ||
| 4184 | t._serializeNode(n, o.getInner); | ||
| 4185 | |||
| 4186 | // Post process | ||
| 4187 | o.content = t.writer.getContent(); | ||
| 4188 | |||
| 4189 | if (!o.no_events) | ||
| 4190 | t.onPostProcess.dispatch(t, o); | ||
| 4191 | |||
| 4192 | t._postProcess(o); | ||
| 4193 | o.node = null; | ||
| 4194 | |||
| 4195 | return tinymce.trim(o.content); | ||
| 4196 | }, | ||
| 4197 | |||
| 4198 | // Internal functions | ||
| 4199 | |||
| 4200 | _postProcess : function(o) { | ||
| 4201 | var t = this, s = t.settings, h = o.content, sc = [], p; | ||
| 4202 | |||
| 4203 | if (o.format == 'html') { | ||
| 4204 | // Protect some elements | ||
| 4205 | p = t._protect({ | ||
| 4206 | content : h, | ||
| 4207 | patterns : [ | ||
| 4208 | {pattern : /(<script[^>]*>)(.*?)(<\/script>)/g}, | ||
| 4209 | {pattern : /(<style[^>]*>)(.*?)(<\/style>)/g}, | ||
| 4210 | {pattern : /(<pre[^>]*>)(.*?)(<\/pre>)/g, encode : 1}, | ||
| 4211 | {pattern : /(<!--\[CDATA\[)(.*?)(\]\]-->)/g} | ||
| 4212 | ] | ||
| 4213 | }); | ||
| 4214 | |||
| 4215 | h = p.content; | ||
| 4216 | |||
| 4217 | // Entity encode | ||
| 4218 | if (s.entity_encoding !== 'raw') | ||
| 4219 | h = t._encode(h); | ||
| 4220 | |||
| 4221 | // Use BR instead of padded P elements inside editor and use <p> </p> outside editor | ||
| 4222 | /* if (o.set) | ||
| 4223 | h = h.replace(/<p>\s+( | |\u00a0|<br \/>)\s+<\/p>/g, '<p><br /></p>'); | ||
| 4224 | else | ||
| 4225 | h = h.replace(/<p>\s+( | |\u00a0|<br \/>)\s+<\/p>/g, '<p>$1</p>');*/ | ||
| 4226 | |||
| 4227 | // Since Gecko and Safari keeps whitespace in the DOM we need to | ||
| 4228 | // remove it inorder to match other browsers. But I think Gecko and Safari is right. | ||
| 4229 | // This process is only done when getting contents out from the editor. | ||
| 4230 | if (!o.set) { | ||
| 4231 | // We need to replace paragraph whitespace with an nbsp before indentation to keep the \u00a0 char | ||
| 4232 | h = h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g, s.entity_encoding == 'numeric' ? '<p$1> </p>' : '<p$1> </p>'); | ||
| 4233 | |||
| 4234 | if (s.remove_linebreaks) { | ||
| 4235 | h = h.replace(/\r?\n|\r/g, ' '); | ||
| 4236 | h = h.replace(/(<[^>]+>)\s+/g, '$1 '); | ||
| 4237 | h = h.replace(/\s+(<\/[^>]+>)/g, ' $1'); | ||
| 4238 | h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g, '<$1 $2>'); // Trim block start | ||
| 4239 | h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g, '<$1>'); // Trim block start | ||
| 4240 | h = h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g, '</$1>'); // Trim block end | ||
| 4241 | } | ||
| 4242 | |||
| 4243 | // Simple indentation | ||
| 4244 | if (s.apply_source_formatting && s.indent_mode == 'simple') { | ||
| 4245 | // Add line breaks before and after block elements | ||
| 4246 | h = h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g, '\n<$1$2$3>\n'); | ||
| 4247 | h = h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g, '\n<$1$2>'); | ||
| 4248 | h = h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g, '</$1>\n'); | ||
| 4249 | h = h.replace(/\n\n/g, '\n'); | ||
| 4250 | } | ||
| 4251 | } | ||
| 4252 | |||
| 4253 | h = t._unprotect(h, p); | ||
| 4254 | |||
| 4255 | // Restore CDATA sections | ||
| 4256 | h = h.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g, '<![CDATA[$1]]>'); | ||
| 4257 | |||
| 4258 | // Restore the \u00a0 character if raw mode is enabled | ||
| 4259 | if (s.entity_encoding == 'raw') | ||
| 4260 | h = h.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g, '<p$1>\u00a0</p>'); | ||
| 4261 | } | ||
| 4262 | |||
| 4263 | o.content = h; | ||
| 4264 | }, | ||
| 4265 | |||
| 4266 | _serializeNode : function(n, inn) { | ||
| 4267 | var t = this, s = t.settings, w = t.writer, hc, el, cn, i, l, a, at, no, v, nn, ru, ar, iv; | ||
| 4268 | |||
| 4269 | if (!s.node_filter || s.node_filter(n)) { | ||
| 4270 | switch (n.nodeType) { | ||
| 4271 | case 1: // Element | ||
| 4272 | if (n.hasAttribute ? n.hasAttribute('mce_bogus') : n.getAttribute('mce_bogus')) | ||
| 4273 | return; | ||
| 4274 | |||
| 4275 | iv = false; | ||
| 4276 | hc = n.hasChildNodes(); | ||
| 4277 | nn = n.getAttribute('mce_name') || n.nodeName.toLowerCase(); | ||
| 4278 | |||
| 4279 | // Add correct prefix on IE | ||
| 4280 | if (isIE) { | ||
| 4281 | if (n.scopeName !== 'HTML' && n.scopeName !== 'html') | ||
| 4282 | nn = n.scopeName + ':' + nn; | ||
| 4283 | } | ||
| 4284 | |||
| 4285 | // Remove mce prefix on IE needed for the abbr element | ||
| 4286 | if (nn.indexOf('mce:') === 0) | ||
| 4287 | nn = nn.substring(4); | ||
| 4288 | |||
| 4289 | // Check if valid | ||
| 4290 | if (!t.validElementsRE.test(nn) || (t.invalidElementsRE && t.invalidElementsRE.test(nn)) || inn) { | ||
| 4291 | iv = true; | ||
| 4292 | break; | ||
| 4293 | } | ||
| 4294 | |||
| 4295 | if (isIE) { | ||
| 4296 | // Fix IE content duplication (DOM can have multiple copies of the same node) | ||
| 4297 | if (s.fix_content_duplication) { | ||
| 4298 | if (n.mce_serialized == t.key) | ||
| 4299 | return; | ||
| 4300 | |||
| 4301 | n.mce_serialized = t.key; | ||
| 4302 | } | ||
| 4303 | |||
| 4304 | // IE sometimes adds a / infront of the node name | ||
| 4305 | if (nn.charAt(0) == '/') | ||
| 4306 | nn = nn.substring(1); | ||
| 4307 | } else if (isGecko) { | ||
| 4308 | // Ignore br elements | ||
| 4309 | if (n.nodeName === 'BR' && n.getAttribute('type') == '_moz') | ||
| 4310 | return; | ||
| 4311 | } | ||
| 4312 | |||
| 4313 | // Check if valid child | ||
| 4314 | if (t.childRules) { | ||
| 4315 | if (t.parentElementsRE.test(t.elementName)) { | ||
| 4316 | if (!t.childRules[t.elementName].test(nn)) { | ||
| 4317 | iv = true; | ||
| 4318 | break; | ||
| 4319 | } | ||
| 4320 | } | ||
| 4321 | |||
| 4322 | t.elementName = nn; | ||
| 4323 | } | ||
| 4324 | |||
| 4325 | ru = t.findRule(nn); | ||
| 4326 | nn = ru.name || nn; | ||
| 4327 | |||
| 4328 | // Skip empty nodes or empty node name in IE | ||
| 4329 | if ((!hc && ru.noEmpty) || (isIE && !nn)) { | ||
| 4330 | iv = true; | ||
| 4331 | break; | ||
| 4332 | } | ||
| 4333 | |||
| 4334 | // Check required | ||
| 4335 | if (ru.requiredAttribs) { | ||
| 4336 | a = ru.requiredAttribs; | ||
| 4337 | |||
| 4338 | for (i = a.length - 1; i >= 0; i--) { | ||
| 4339 | if (this.dom.getAttrib(n, a[i]) !== '') | ||
| 4340 | break; | ||
| 4341 | } | ||
| 4342 | |||
| 4343 | // None of the required was there | ||
| 4344 | if (i == -1) { | ||
| 4345 | iv = true; | ||
| 4346 | break; | ||
| 4347 | } | ||
| 4348 | } | ||
| 4349 | |||
| 4350 | w.writeStartElement(nn); | ||
| 4351 | |||
| 4352 | // Add ordered attributes | ||
| 4353 | if (ru.attribs) { | ||
| 4354 | for (i=0, at = ru.attribs, l = at.length; i<l; i++) { | ||
| 4355 | a = at[i]; | ||
| 4356 | v = t._getAttrib(n, a); | ||
| 4357 | |||
| 4358 | if (v !== null) | ||
| 4359 | w.writeAttribute(a.name, v); | ||
| 4360 | } | ||
| 4361 | } | ||
| 4362 | |||
| 4363 | // Add wild attributes | ||
| 4364 | if (ru.validAttribsRE) { | ||
| 4365 | at = isIE ? getIEAtts(n) : n.attributes; | ||
| 4366 | for (i=at.length-1; i>-1; i--) { | ||
| 4367 | no = at[i]; | ||
| 4368 | |||
| 4369 | if (no.specified) { | ||
| 4370 | a = no.nodeName.toLowerCase(); | ||
| 4371 | |||
| 4372 | if (s.invalid_attrs.test(a) || !ru.validAttribsRE.test(a)) | ||
| 4373 | continue; | ||
| 4374 | |||
| 4375 | ar = t.findAttribRule(ru, a); | ||
| 4376 | v = t._getAttrib(n, ar, a); | ||
| 4377 | |||
| 4378 | if (v !== null) | ||
| 4379 | w.writeAttribute(a, v); | ||
| 4380 | } | ||
| 4381 | } | ||
| 4382 | } | ||
| 4383 | |||
| 4384 | // Padd empty nodes with a | ||
| 4385 | if (ru.padd) { | ||
| 4386 | // If it has only one bogus child, padd it anyway workaround for <td><br /></td> bug | ||
| 4387 | if (hc && (cn = n.firstChild) && cn.nodeType === 1 && n.childNodes.length === 1) { | ||
| 4388 | if (cn.hasAttribute ? cn.hasAttribute('mce_bogus') : cn.getAttribute('mce_bogus')) | ||
| 4389 | w.writeText('\u00a0'); | ||
| 4390 | } else if (!hc) | ||
| 4391 | w.writeText('\u00a0'); // No children then padd it | ||
| 4392 | } | ||
| 4393 | |||
| 4394 | break; | ||
| 4395 | |||
| 4396 | case 3: // Text | ||
| 4397 | // Check if valid child | ||
| 4398 | if (t.childRules && t.parentElementsRE.test(t.elementName)) { | ||
| 4399 | if (!t.childRules[t.elementName].test(n.nodeName)) | ||
| 4400 | return; | ||
| 4401 | } | ||
| 4402 | |||
| 4403 | return w.writeText(n.nodeValue); | ||
| 4404 | |||
| 4405 | case 4: // CDATA | ||
| 4406 | return w.writeCDATA(n.nodeValue); | ||
| 4407 | |||
| 4408 | case 8: // Comment | ||
| 4409 | return w.writeComment(n.nodeValue); | ||
| 4410 | } | ||
| 4411 | } else if (n.nodeType == 1) | ||
| 4412 | hc = n.hasChildNodes(); | ||
| 4413 | |||
| 4414 | if (hc) { | ||
| 4415 | cn = n.firstChild; | ||
| 4416 | |||
| 4417 | while (cn) { | ||
| 4418 | t._serializeNode(cn); | ||
| 4419 | t.elementName = nn; | ||
| 4420 | cn = cn.nextSibling; | ||
| 4421 | } | ||
| 4422 | } | ||
| 4423 | |||
| 4424 | // Write element end | ||
| 4425 | if (!iv) { | ||
| 4426 | if (hc || !s.closed.test(nn)) | ||
| 4427 | w.writeFullEndElement(); | ||
| 4428 | else | ||
| 4429 | w.writeEndElement(); | ||
| 4430 | } | ||
| 4431 | }, | ||
| 4432 | |||
| 4433 | _protect : function(o) { | ||
| 4434 | var t = this; | ||
| 4435 | |||
| 4436 | o.items = o.items || []; | ||
| 4437 | |||
| 4438 | function enc(s) { | ||
| 4439 | return s.replace(/[\r\n\\]/g, function(c) { | ||
| 4440 | if (c === '\n') | ||
| 4441 | return '\\n'; | ||
| 4442 | else if (c === '\\') | ||
| 4443 | return '\\\\'; | ||
| 4444 | |||
| 4445 | return '\\r'; | ||
| 4446 | }); | ||
| 4447 | }; | ||
| 4448 | |||
| 4449 | function dec(s) { | ||
| 4450 | return s.replace(/\\[\\rn]/g, function(c) { | ||
| 4451 | if (c === '\\n') | ||
| 4452 | return '\n'; | ||
| 4453 | else if (c === '\\\\') | ||
| 4454 | return '\\'; | ||
| 4455 | |||
| 4456 | return '\r'; | ||
| 4457 | }); | ||
| 4458 | }; | ||
| 4459 | |||
| 4460 | each(o.patterns, function(p) { | ||
| 4461 | o.content = dec(enc(o.content).replace(p.pattern, function(x, a, b, c) { | ||
| 4462 | b = dec(b); | ||
| 4463 | |||
| 4464 | if (p.encode) | ||
| 4465 | b = t._encode(b); | ||
| 4466 | |||
| 4467 | o.items.push(b); | ||
| 4468 | return a + '<!--mce:' + (o.items.length - 1) + '-->' + c; | ||
| 4469 | })); | ||
| 4470 | }); | ||
| 4471 | |||
| 4472 | return o; | ||
| 4473 | }, | ||
| 4474 | |||
| 4475 | _unprotect : function(h, o) { | ||
| 4476 | h = h.replace(/\<!--mce:([0-9]+)--\>/g, function(a, b) { | ||
| 4477 | return o.items[parseInt(b)]; | ||
| 4478 | }); | ||
| 4479 | |||
| 4480 | o.items = []; | ||
| 4481 | |||
| 4482 | return h; | ||
| 4483 | }, | ||
| 4484 | |||
| 4485 | _encode : function(h) { | ||
| 4486 | var t = this, s = t.settings, l; | ||
| 4487 | |||
| 4488 | // Entity encode | ||
| 4489 | if (s.entity_encoding !== 'raw') { | ||
| 4490 | if (s.entity_encoding.indexOf('named') != -1) { | ||
| 4491 | t.setEntities(s.entities); | ||
| 4492 | l = t.entityLookup; | ||
| 4493 | |||
| 4494 | h = h.replace(t.entitiesRE, function(a) { | ||
| 4495 | var v; | ||
| 4496 | |||
| 4497 | if (v = l[a]) | ||
| 4498 | a = '&' + v + ';'; | ||
| 4499 | |||
| 4500 | return a; | ||
| 4501 | }); | ||
| 4502 | } | ||
| 4503 | |||
| 4504 | if (s.entity_encoding.indexOf('numeric') != -1) { | ||
| 4505 | h = h.replace(/[\u007E-\uFFFF]/g, function(a) { | ||
| 4506 | return '&#' + a.charCodeAt(0) + ';'; | ||
| 4507 | }); | ||
| 4508 | } | ||
| 4509 | } | ||
| 4510 | |||
| 4511 | return h; | ||
| 4512 | }, | ||
| 4513 | |||
| 4514 | _setup : function() { | ||
| 4515 | var t = this, s = this.settings; | ||
| 4516 | |||
| 4517 | if (t.done) | ||
| 4518 | return; | ||
| 4519 | |||
| 4520 | t.done = 1; | ||
| 4521 | |||
| 4522 | t.setRules(s.valid_elements); | ||
| 4523 | t.addRules(s.extended_valid_elements); | ||
| 4524 | t.addValidChildRules(s.valid_child_elements); | ||
| 4525 | |||
| 4526 | if (s.invalid_elements) | ||
| 4527 | t.invalidElementsRE = new RegExp('^(' + wildcardToRE(s.invalid_elements.replace(/,/g, '|').toLowerCase()) + ')$'); | ||
| 4528 | |||
| 4529 | if (s.attrib_value_filter) | ||
| 4530 | t.attribValueFilter = s.attribValueFilter; | ||
| 4531 | }, | ||
| 4532 | |||
| 4533 | _getAttrib : function(n, a, na) { | ||
| 4534 | var i, v; | ||
| 4535 | |||
| 4536 | na = na || a.name; | ||
| 4537 | |||
| 4538 | if (a.forcedVal && (v = a.forcedVal)) { | ||
| 4539 | if (v === '{$uid}') | ||
| 4540 | return this.dom.uniqueId(); | ||
| 4541 | |||
| 4542 | return v; | ||
| 4543 | } | ||
| 4544 | |||
| 4545 | v = this.dom.getAttrib(n, na); | ||
| 4546 | |||
| 4547 | // Bool attr | ||
| 4548 | if (this.settings.bool_attrs.test(na) && v) { | ||
| 4549 | v = ('' + v).toLowerCase(); | ||
| 4550 | |||
| 4551 | if (v === 'false' || v === '0') | ||
| 4552 | return null; | ||
| 4553 | |||
| 4554 | v = na; | ||
| 4555 | } | ||
| 4556 | |||
| 4557 | switch (na) { | ||
| 4558 | case 'rowspan': | ||
| 4559 | case 'colspan': | ||
| 4560 | // Whats the point? Remove usless attribute value | ||
| 4561 | if (v == '1') | ||
| 4562 | v = ''; | ||
| 4563 | |||
| 4564 | break; | ||
| 4565 | } | ||
| 4566 | |||
| 4567 | if (this.attribValueFilter) | ||
| 4568 | v = this.attribValueFilter(na, v, n); | ||
| 4569 | |||
| 4570 | if (a.validVals) { | ||
| 4571 | for (i = a.validVals.length - 1; i >= 0; i--) { | ||
| 4572 | if (v == a.validVals[i]) | ||
| 4573 | break; | ||
| 4574 | } | ||
| 4575 | |||
| 4576 | if (i == -1) | ||
| 4577 | return null; | ||
| 4578 | } | ||
| 4579 | |||
| 4580 | if (v === '' && typeof(a.defaultVal) != 'undefined') { | ||
| 4581 | v = a.defaultVal; | ||
| 4582 | |||
| 4583 | if (v === '{$uid}') | ||
| 4584 | return this.dom.uniqueId(); | ||
| 4585 | |||
| 4586 | return v; | ||
| 4587 | } else { | ||
| 4588 | // Remove internal mceItemXX classes when content is extracted from editor | ||
| 4589 | if (na == 'class' && this.processObj.get) | ||
| 4590 | v = v.replace(/\s?mceItem\w+\s?/g, ''); | ||
| 4591 | } | ||
| 4592 | |||
| 4593 | if (v === '') | ||
| 4594 | return null; | ||
| 4595 | |||
| 4596 | |||
| 4597 | return v; | ||
| 4598 | } | ||
| 4599 | |||
| 4600 | }); | ||
| 4601 | })(); | ||
| 4602 | |||
| 4603 | /* file:jscripts/tiny_mce/classes/dom/ScriptLoader.js */ | ||
| 4604 | |||
| 4605 | (function() { | ||
| 4606 | var each = tinymce.each, Event = tinymce.dom.Event; | ||
| 4607 | |||
| 4608 | tinymce.create('tinymce.dom.ScriptLoader', { | ||
| 4609 | ScriptLoader : function(s) { | ||
| 4610 | this.settings = s || {}; | ||
| 4611 | this.queue = []; | ||
| 4612 | this.lookup = {}; | ||
| 4613 | }, | ||
| 4614 | |||
| 4615 | isDone : function(u) { | ||
| 4616 | return this.lookup[u] ? this.lookup[u].state == 2 : 0; | ||
| 4617 | }, | ||
| 4618 | |||
| 4619 | markDone : function(u) { | ||
| 4620 | this.lookup[u] = {state : 2, url : u}; | ||
| 4621 | }, | ||
| 4622 | |||
| 4623 | add : function(u, cb, s, pr) { | ||
| 4624 | var t = this, lo = t.lookup, o; | ||
| 4625 | |||
| 4626 | if (o = lo[u]) { | ||
| 4627 | // Is loaded fire callback | ||
| 4628 | if (cb && o.state == 2) | ||
| 4629 | cb.call(s || this); | ||
| 4630 | |||
| 4631 | return o; | ||
| 4632 | } | ||
| 4633 | |||
| 4634 | o = {state : 0, url : u, func : cb, scope : s || this}; | ||
| 4635 | |||
| 4636 | if (pr) | ||
| 4637 | t.queue.unshift(o); | ||
| 4638 | else | ||
| 4639 | t.queue.push(o); | ||
| 4640 | |||
| 4641 | lo[u] = o; | ||
| 4642 | |||
| 4643 | return o; | ||
| 4644 | }, | ||
| 4645 | |||
| 4646 | load : function(u, cb, s) { | ||
| 4647 | var t = this, o; | ||
| 4648 | |||
| 4649 | if (o = t.lookup[u]) { | ||
| 4650 | // Is loaded fire callback | ||
| 4651 | if (cb && o.state == 2) | ||
| 4652 | cb.call(s || t); | ||
| 4653 | |||
| 4654 | return o; | ||
| 4655 | } | ||
| 4656 | |||
| 4657 | function loadScript(u) { | ||
| 4658 | if (Event.domLoaded || t.settings.strict_mode) { | ||
| 4659 | tinymce.util.XHR.send({ | ||
| 4660 | url : tinymce._addVer(u), | ||
| 4661 | error : t.settings.error, | ||
| 4662 | async : false, | ||
| 4663 | success : function(co) { | ||
| 4664 | t.eval(co); | ||
| 4665 | } | ||
| 4666 | }); | ||
| 4667 | } else | ||
| 4668 | document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"></script>'); | ||
| 4669 | }; | ||
| 4670 | |||
| 4671 | if (!tinymce.is(u, 'string')) { | ||
| 4672 | each(u, function(u) { | ||
| 4673 | loadScript(u); | ||
| 4674 | }); | ||
| 4675 | |||
| 4676 | if (cb) | ||
| 4677 | cb.call(s || t); | ||
| 4678 | } else { | ||
| 4679 | loadScript(u); | ||
| 4680 | |||
| 4681 | if (cb) | ||
| 4682 | cb.call(s || t); | ||
| 4683 | } | ||
| 4684 | }, | ||
| 4685 | |||
| 4686 | loadQueue : function(cb, s) { | ||
| 4687 | var t = this; | ||
| 4688 | |||
| 4689 | if (!t.queueLoading) { | ||
| 4690 | t.queueLoading = 1; | ||
| 4691 | t.queueCallbacks = []; | ||
| 4692 | |||
| 4693 | t.loadScripts(t.queue, function() { | ||
| 4694 | t.queueLoading = 0; | ||
| 4695 | |||
| 4696 | if (cb) | ||
| 4697 | cb.call(s || t); | ||
| 4698 | |||
| 4699 | each(t.queueCallbacks, function(o) { | ||
| 4700 | o.func.call(o.scope); | ||
| 4701 | }); | ||
| 4702 | }); | ||
| 4703 | } else if (cb) | ||
| 4704 | t.queueCallbacks.push({func : cb, scope : s || t}); | ||
| 4705 | }, | ||
| 4706 | |||
| 4707 | eval : function(co) { | ||
| 4708 | var w = window; | ||
| 4709 | |||
| 4710 | // Evaluate script | ||
| 4711 | if (!w.execScript) { | ||
| 4712 | try { | ||
| 4713 | eval.call(w, co); | ||
| 4714 | } catch (ex) { | ||
| 4715 | eval(co, w); // Firefox 3.0a8 | ||
| 4716 | } | ||
| 4717 | } else | ||
| 4718 | w.execScript(co); // IE | ||
| 4719 | }, | ||
| 4720 | |||
| 4721 | loadScripts : function(sc, cb, s) { | ||
| 4722 | var t = this, lo = t.lookup; | ||
| 4723 | |||
| 4724 | function done(o) { | ||
| 4725 | o.state = 2; // Has been loaded | ||
| 4726 | |||
| 4727 | // Run callback | ||
| 4728 | if (o.func) | ||
| 4729 | o.func.call(o.scope || t); | ||
| 4730 | }; | ||
| 4731 | |||
| 4732 | function allDone() { | ||
| 4733 | var l; | ||
| 4734 | |||
| 4735 | // Check if all files are loaded | ||
| 4736 | l = sc.length; | ||
| 4737 | each(sc, function(o) { | ||
| 4738 | o = lo[o.url]; | ||
| 4739 | |||
| 4740 | if (o.state === 2) {// It has finished loading | ||
| 4741 | done(o); | ||
| 4742 | l--; | ||
| 4743 | } else | ||
| 4744 | load(o); | ||
| 4745 | }); | ||
| 4746 | |||
| 4747 | // They are all loaded | ||
| 4748 | if (l === 0 && cb) { | ||
| 4749 | cb.call(s || t); | ||
| 4750 | cb = 0; | ||
| 4751 | } | ||
| 4752 | }; | ||
| 4753 | |||
| 4754 | function load(o) { | ||
| 4755 | if (o.state > 0) | ||
| 4756 | return; | ||
| 4757 | |||
| 4758 | o.state = 1; // Is loading | ||
| 4759 | |||
| 4760 | tinymce.dom.ScriptLoader.loadScript(o.url, function() { | ||
| 4761 | done(o); | ||
| 4762 | allDone(); | ||
| 4763 | }); | ||
| 4764 | |||
| 4765 | /* | ||
| 4766 | tinymce.util.XHR.send({ | ||
| 4767 | url : o.url, | ||
| 4768 | error : t.settings.error, | ||
| 4769 | success : function(co) { | ||
| 4770 | t.eval(co); | ||
| 4771 | done(o); | ||
| 4772 | allDone(); | ||
| 4773 | } | ||
| 4774 | }); | ||
| 4775 | */ | ||
| 4776 | }; | ||
| 4777 | |||
| 4778 | each(sc, function(o) { | ||
| 4779 | var u = o.url; | ||
| 4780 | |||
| 4781 | // Add to queue if needed | ||
| 4782 | if (!lo[u]) { | ||
| 4783 | lo[u] = o; | ||
| 4784 | t.queue.push(o); | ||
| 4785 | } else | ||
| 4786 | o = lo[u]; | ||
| 4787 | |||
| 4788 | // Is already loading or has been loaded | ||
| 4789 | if (o.state > 0) | ||
| 4790 | return; | ||
| 4791 | |||
| 4792 | if (!Event.domLoaded && !t.settings.strict_mode) { | ||
| 4793 | var ix, ol = ''; | ||
| 4794 | |||
| 4795 | // Add onload events | ||
| 4796 | if (cb || o.func) { | ||
| 4797 | o.state = 1; // Is loading | ||
| 4798 | |||
| 4799 | ix = tinymce.dom.ScriptLoader._addOnLoad(function() { | ||
| 4800 | done(o); | ||
| 4801 | allDone(); | ||
| 4802 | }); | ||
| 4803 | |||
| 4804 | if (tinymce.isIE) | ||
| 4805 | ol = ' onreadystatechange="'; | ||
| 4806 | else | ||
| 4807 | ol = ' onload="'; | ||
| 4808 | |||
| 4809 | ol += 'tinymce.dom.ScriptLoader._onLoad(this,\'' + u + '\',' + ix + ');"'; | ||
| 4810 | } | ||
| 4811 | |||
| 4812 | document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"' + ol + '></script>'); | ||
| 4813 | |||
| 4814 | if (!o.func) | ||
| 4815 | done(o); | ||
| 4816 | } else | ||
| 4817 | load(o); | ||
| 4818 | }); | ||
| 4819 | |||
| 4820 | allDone(); | ||
| 4821 | }, | ||
| 4822 | |||
| 4823 | // Static methods | ||
| 4824 | 'static' : { | ||
| 4825 | _addOnLoad : function(f) { | ||
| 4826 | var t = this; | ||
| 4827 | |||
| 4828 | t._funcs = t._funcs || []; | ||
| 4829 | t._funcs.push(f); | ||
| 4830 | |||
| 4831 | return t._funcs.length - 1; | ||
| 4832 | }, | ||
| 4833 | |||
| 4834 | _onLoad : function(e, u, ix) { | ||
| 4835 | if (!tinymce.isIE || e.readyState == 'complete') | ||
| 4836 | this._funcs[ix].call(this); | ||
| 4837 | }, | ||
| 4838 | |||
| 4839 | loadScript : function(u, cb) { | ||
| 4840 | var id = tinymce.DOM.uniqueId(), e; | ||
| 4841 | |||
| 4842 | function done() { | ||
| 4843 | Event.clear(id); | ||
| 4844 | tinymce.DOM.remove(id); | ||
| 4845 | |||
| 4846 | if (cb) { | ||
| 4847 | cb.call(document, u); | ||
| 4848 | cb = 0; | ||
| 4849 | } | ||
| 4850 | }; | ||
| 4851 | |||
| 4852 | if (tinymce.isIE) { | ||
| 4853 | /* Event.add(e, 'readystatechange', function(e) { | ||
| 4854 | if (e.target && e.target.readyState == 'complete') | ||
| 4855 | done(); | ||
| 4856 | });*/ | ||
| 4857 | |||
| 4858 | tinymce.util.XHR.send({ | ||
| 4859 | url : tinymce._addVer(u), | ||
| 4860 | async : false, | ||
| 4861 | success : function(co) { | ||
| 4862 | window.execScript(co); | ||
| 4863 | done(); | ||
| 4864 | } | ||
| 4865 | }); | ||
| 4866 | } else { | ||
| 4867 | e = tinymce.DOM.create('script', {id : id, type : 'text/javascript', src : tinymce._addVer(u)}); | ||
| 4868 | Event.add(e, 'load', done); | ||
| 4869 | |||
| 4870 | // Check for head or body | ||
| 4871 | (document.getElementsByTagName('head')[0] || document.body).appendChild(e); | ||
| 4872 | } | ||
| 4873 | } | ||
| 4874 | } | ||
| 4875 | |||
| 4876 | }); | ||
| 4877 | |||
| 4878 | // Global script loader | ||
| 4879 | tinymce.ScriptLoader = new tinymce.dom.ScriptLoader(); | ||
| 4880 | })(); | ||
| 4881 | |||
| 4882 | /* file:jscripts/tiny_mce/classes/ui/Control.js */ | ||
| 4883 | |||
| 4884 | (function() { | ||
| 4885 | // Shorten class names | ||
| 4886 | var DOM = tinymce.DOM, is = tinymce.is; | ||
| 4887 | |||
| 4888 | tinymce.create('tinymce.ui.Control', { | ||
| 4889 | Control : function(id, s) { | ||
| 4890 | this.id = id; | ||
| 4891 | this.settings = s = s || {}; | ||
| 4892 | this.rendered = false; | ||
| 4893 | this.onRender = new tinymce.util.Dispatcher(this); | ||
| 4894 | this.classPrefix = ''; | ||
| 4895 | this.scope = s.scope || this; | ||
| 4896 | this.disabled = 0; | ||
| 4897 | this.active = 0; | ||
| 4898 | }, | ||
| 4899 | |||
| 4900 | setDisabled : function(s) { | ||
| 4901 | var e; | ||
| 4902 | |||
| 4903 | if (s != this.disabled) { | ||
| 4904 | e = DOM.get(this.id); | ||
| 4905 | |||
| 4906 | // Add accessibility title for unavailable actions | ||
| 4907 | if (e && this.settings.unavailable_prefix) { | ||
| 4908 | if (s) { | ||
| 4909 | this.prevTitle = e.title; | ||
| 4910 | e.title = this.settings.unavailable_prefix + ": " + e.title; | ||
| 4911 | } else | ||
| 4912 | e.title = this.prevTitle; | ||
| 4913 | } | ||
| 4914 | |||
| 4915 | this.setState('Disabled', s); | ||
| 4916 | this.setState('Enabled', !s); | ||
| 4917 | this.disabled = s; | ||
| 4918 | } | ||
| 4919 | }, | ||
| 4920 | |||
| 4921 | isDisabled : function() { | ||
| 4922 | return this.disabled; | ||
| 4923 | }, | ||
| 4924 | |||
| 4925 | setActive : function(s) { | ||
| 4926 | if (s != this.active) { | ||
| 4927 | this.setState('Active', s); | ||
| 4928 | this.active = s; | ||
| 4929 | } | ||
| 4930 | }, | ||
| 4931 | |||
| 4932 | isActive : function() { | ||
| 4933 | return this.active; | ||
| 4934 | }, | ||
| 4935 | |||
| 4936 | setState : function(c, s) { | ||
| 4937 | var n = DOM.get(this.id); | ||
| 4938 | |||
| 4939 | c = this.classPrefix + c; | ||
| 4940 | |||
| 4941 | if (s) | ||
| 4942 | DOM.addClass(n, c); | ||
| 4943 | else | ||
| 4944 | DOM.removeClass(n, c); | ||
| 4945 | }, | ||
| 4946 | |||
| 4947 | isRendered : function() { | ||
| 4948 | return this.rendered; | ||
| 4949 | }, | ||
| 4950 | |||
| 4951 | renderHTML : function() { | ||
| 4952 | }, | ||
| 4953 | |||
| 4954 | renderTo : function(n) { | ||
| 4955 | DOM.setHTML(n, this.renderHTML()); | ||
| 4956 | }, | ||
| 4957 | |||
| 4958 | postRender : function() { | ||
| 4959 | var t = this, b; | ||
| 4960 | |||
| 4961 | // Set pending states | ||
| 4962 | if (is(t.disabled)) { | ||
| 4963 | b = t.disabled; | ||
| 4964 | t.disabled = -1; | ||
| 4965 | t.setDisabled(b); | ||
| 4966 | } | ||
| 4967 | |||
| 4968 | if (is(t.active)) { | ||
| 4969 | b = t.active; | ||
| 4970 | t.active = -1; | ||
| 4971 | t.setActive(b); | ||
| 4972 | } | ||
| 4973 | }, | ||
| 4974 | |||
| 4975 | remove : function() { | ||
| 4976 | DOM.remove(this.id); | ||
| 4977 | this.destroy(); | ||
| 4978 | }, | ||
| 4979 | |||
| 4980 | destroy : function() { | ||
| 4981 | tinymce.dom.Event.clear(this.id); | ||
| 4982 | } | ||
| 4983 | |||
| 4984 | }); | ||
| 4985 | })(); | ||
| 4986 | /* file:jscripts/tiny_mce/classes/ui/Container.js */ | ||
| 4987 | |||
| 4988 | tinymce.create('tinymce.ui.Container:tinymce.ui.Control', { | ||
| 4989 | Container : function(id, s) { | ||
| 4990 | this.parent(id, s); | ||
| 4991 | this.controls = []; | ||
| 4992 | this.lookup = {}; | ||
| 4993 | }, | ||
| 4994 | |||
| 4995 | add : function(c) { | ||
| 4996 | this.lookup[c.id] = c; | ||
| 4997 | this.controls.push(c); | ||
| 4998 | |||
| 4999 | return c; | ||
| 5000 | }, | ||
| 5001 | |||
| 5002 | get : function(n) { | ||
| 5003 | return this.lookup[n]; | ||
| 5004 | } | ||
| 5005 | |||
| 5006 | }); | ||
| 5007 | |||
| 5008 | |||
| 5009 | /* file:jscripts/tiny_mce/classes/ui/Separator.js */ | ||
| 5010 | |||
| 5011 | tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { | ||
| 5012 | Separator : function(id, s) { | ||
| 5013 | this.parent(id, s); | ||
| 5014 | this.classPrefix = 'mceSeparator'; | ||
| 5015 | }, | ||
| 5016 | |||
| 5017 | renderHTML : function() { | ||
| 5018 | return tinymce.DOM.createHTML('span', {'class' : this.classPrefix}); | ||
| 5019 | } | ||
| 5020 | |||
| 5021 | }); | ||
| 5022 | |||
| 5023 | /* file:jscripts/tiny_mce/classes/ui/MenuItem.js */ | ||
| 5024 | |||
| 5025 | (function() { | ||
| 5026 | var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; | ||
| 5027 | |||
| 5028 | tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', { | ||
| 5029 | MenuItem : function(id, s) { | ||
| 5030 | this.parent(id, s); | ||
| 5031 | this.classPrefix = 'mceMenuItem'; | ||
| 5032 | }, | ||
| 5033 | |||
| 5034 | setSelected : function(s) { | ||
| 5035 | this.setState('Selected', s); | ||
| 5036 | this.selected = s; | ||
| 5037 | }, | ||
| 5038 | |||
| 5039 | isSelected : function() { | ||
| 5040 | return this.selected; | ||
| 5041 | }, | ||
| 5042 | |||
| 5043 | postRender : function() { | ||
| 5044 | var t = this; | ||
| 5045 | |||
| 5046 | t.parent(); | ||
| 5047 | |||
| 5048 | // Set pending state | ||
| 5049 | if (is(t.selected)) | ||
| 5050 | t.setSelected(t.selected); | ||
| 5051 | } | ||
| 5052 | |||
| 5053 | }); | ||
| 5054 | })(); | ||
| 5055 | |||
| 5056 | /* file:jscripts/tiny_mce/classes/ui/Menu.js */ | ||
| 5057 | |||
| 5058 | (function() { | ||
| 5059 | var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; | ||
| 5060 | |||
| 5061 | tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', { | ||
| 5062 | Menu : function(id, s) { | ||
| 5063 | var t = this; | ||
| 5064 | |||
| 5065 | t.parent(id, s); | ||
| 5066 | t.items = {}; | ||
| 5067 | t.collapsed = false; | ||
| 5068 | t.menuCount = 0; | ||
| 5069 | t.onAddItem = new tinymce.util.Dispatcher(this); | ||
| 5070 | }, | ||
| 5071 | |||
| 5072 | expand : function(d) { | ||
| 5073 | var t = this; | ||
| 5074 | |||
| 5075 | if (d) { | ||
| 5076 | walk(t, function(o) { | ||
| 5077 | if (o.expand) | ||
| 5078 | o.expand(); | ||
| 5079 | }, 'items', t); | ||
| 5080 | } | ||
| 5081 | |||
| 5082 | t.collapsed = false; | ||
| 5083 | }, | ||
| 5084 | |||
| 5085 | collapse : function(d) { | ||
| 5086 | var t = this; | ||
| 5087 | |||
| 5088 | if (d) { | ||
| 5089 | walk(t, function(o) { | ||
| 5090 | if (o.collapse) | ||
| 5091 | o.collapse(); | ||
| 5092 | }, 'items', t); | ||
| 5093 | } | ||
| 5094 | |||
| 5095 | t.collapsed = true; | ||
| 5096 | }, | ||
| 5097 | |||
| 5098 | isCollapsed : function() { | ||
| 5099 | return this.collapsed; | ||
| 5100 | }, | ||
| 5101 | |||
| 5102 | add : function(o) { | ||
| 5103 | if (!o.settings) | ||
| 5104 | o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o); | ||
| 5105 | |||
| 5106 | this.onAddItem.dispatch(this, o); | ||
| 5107 | |||
| 5108 | return this.items[o.id] = o; | ||
| 5109 | }, | ||
| 5110 | |||
| 5111 | addSeparator : function() { | ||
| 5112 | return this.add({separator : true}); | ||
| 5113 | }, | ||
| 5114 | |||
| 5115 | addMenu : function(o) { | ||
| 5116 | if (!o.collapse) | ||
| 5117 | o = this.createMenu(o); | ||
| 5118 | |||
| 5119 | this.menuCount++; | ||
| 5120 | |||
| 5121 | return this.add(o); | ||
| 5122 | }, | ||
| 5123 | |||
| 5124 | hasMenus : function() { | ||
| 5125 | return this.menuCount !== 0; | ||
| 5126 | }, | ||
| 5127 | |||
| 5128 | remove : function(o) { | ||
| 5129 | delete this.items[o.id]; | ||
| 5130 | }, | ||
| 5131 | |||
| 5132 | removeAll : function() { | ||
| 5133 | var t = this; | ||
| 5134 | |||
| 5135 | walk(t, function(o) { | ||
| 5136 | if (o.removeAll) | ||
| 5137 | o.removeAll(); | ||
| 5138 | else | ||
| 5139 | o.remove(); | ||
| 5140 | |||
| 5141 | o.destroy(); | ||
| 5142 | }, 'items', t); | ||
| 5143 | |||
| 5144 | t.items = {}; | ||
| 5145 | }, | ||
| 5146 | |||
| 5147 | createMenu : function(o) { | ||
| 5148 | var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o); | ||
| 5149 | |||
| 5150 | m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem); | ||
| 5151 | |||
| 5152 | return m; | ||
| 5153 | } | ||
| 5154 | |||
| 5155 | }); | ||
| 5156 | })(); | ||
| 5157 | /* file:jscripts/tiny_mce/classes/ui/DropMenu.js */ | ||
| 5158 | |||
| 5159 | (function() { | ||
| 5160 | var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element; | ||
| 5161 | |||
| 5162 | tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', { | ||
| 5163 | DropMenu : function(id, s) { | ||
| 5164 | s = s || {}; | ||
| 5165 | s.container = s.container || DOM.doc.body; | ||
| 5166 | s.offset_x = s.offset_x || 0; | ||
| 5167 | s.offset_y = s.offset_y || 0; | ||
| 5168 | s.vp_offset_x = s.vp_offset_x || 0; | ||
| 5169 | s.vp_offset_y = s.vp_offset_y || 0; | ||
| 5170 | |||
| 5171 | if (is(s.icons) && !s.icons) | ||
| 5172 | s['class'] += ' mceNoIcons'; | ||
| 5173 | |||
| 5174 | this.parent(id, s); | ||
| 5175 | this.onShowMenu = new tinymce.util.Dispatcher(this); | ||
| 5176 | this.onHideMenu = new tinymce.util.Dispatcher(this); | ||
| 5177 | this.classPrefix = 'mceMenu'; | ||
| 5178 | }, | ||
| 5179 | |||
| 5180 | createMenu : function(s) { | ||
| 5181 | var t = this, cs = t.settings, m; | ||
| 5182 | |||
| 5183 | s.container = s.container || cs.container; | ||
| 5184 | s.parent = t; | ||
| 5185 | s.constrain = s.constrain || cs.constrain; | ||
| 5186 | s['class'] = s['class'] || cs['class']; | ||
| 5187 | s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x; | ||
| 5188 | s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y; | ||
| 5189 | m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s); | ||
| 5190 | |||
| 5191 | m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem); | ||
| 5192 | |||
| 5193 | return m; | ||
| 5194 | }, | ||
| 5195 | |||
| 5196 | update : function() { | ||
| 5197 | var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th; | ||
| 5198 | |||
| 5199 | tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth; | ||
| 5200 | th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight; | ||
| 5201 | |||
| 5202 | if (!DOM.boxModel) | ||
| 5203 | t.element.setStyles({width : tw + 2, height : th + 2}); | ||
| 5204 | else | ||
| 5205 | t.element.setStyles({width : tw, height : th}); | ||
| 5206 | |||
| 5207 | if (s.max_width) | ||
| 5208 | DOM.setStyle(co, 'width', tw); | ||
| 5209 | |||
| 5210 | if (s.max_height) { | ||
| 5211 | DOM.setStyle(co, 'height', th); | ||
| 5212 | |||
| 5213 | if (tb.clientHeight < s.max_height) | ||
| 5214 | DOM.setStyle(co, 'overflow', 'hidden'); | ||
| 5215 | } | ||
| 5216 | }, | ||
| 5217 | |||
| 5218 | showMenu : function(x, y, px) { | ||
| 5219 | var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix; | ||
| 5220 | |||
| 5221 | t.collapse(1); | ||
| 5222 | |||
| 5223 | if (t.isMenuVisible) | ||
| 5224 | return; | ||
| 5225 | |||
| 5226 | if (!t.rendered) { | ||
| 5227 | co = DOM.add(t.settings.container, t.renderNode()); | ||
| 5228 | |||
| 5229 | each(t.items, function(o) { | ||
| 5230 | o.postRender(); | ||
| 5231 | }); | ||
| 5232 | |||
| 5233 | t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); | ||
| 5234 | } else | ||
| 5235 | co = DOM.get('menu_' + t.id); | ||
| 5236 | |||
| 5237 | // Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug | ||
| 5238 | if (!tinymce.isOpera) | ||
| 5239 | DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF}); | ||
| 5240 | |||
| 5241 | DOM.show(co); | ||
| 5242 | t.update(); | ||
| 5243 | |||
| 5244 | x += s.offset_x || 0; | ||
| 5245 | y += s.offset_y || 0; | ||
| 5246 | vp.w -= 4; | ||
| 5247 | vp.h -= 4; | ||
| 5248 | |||
| 5249 | // Move inside viewport if not submenu | ||
| 5250 | if (s.constrain) { | ||
| 5251 | w = co.clientWidth - ot; | ||
| 5252 | h = co.clientHeight - ot; | ||
| 5253 | mx = vp.x + vp.w; | ||
| 5254 | my = vp.y + vp.h; | ||
| 5255 | |||
| 5256 | if ((x + s.vp_offset_x + w) > mx) | ||
| 5257 | x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w); | ||
| 5258 | |||
| 5259 | if ((y + s.vp_offset_y + h) > my) | ||
| 5260 | y = Math.max(0, (my - s.vp_offset_y) - h); | ||
| 5261 | } | ||
| 5262 | |||
| 5263 | DOM.setStyles(co, {left : x , top : y}); | ||
| 5264 | t.element.update(); | ||
| 5265 | |||
| 5266 | t.isMenuVisible = 1; | ||
| 5267 | t.mouseClickFunc = Event.add(co, 'click', function(e) { | ||
| 5268 | var m; | ||
| 5269 | |||
| 5270 | e = e.target; | ||
| 5271 | |||
| 5272 | if (e && (e = DOM.getParent(e, 'TR')) && !DOM.hasClass(e, cp + 'ItemSub')) { | ||
| 5273 | m = t.items[e.id]; | ||
| 5274 | |||
| 5275 | if (m.isDisabled()) | ||
| 5276 | return; | ||
| 5277 | |||
| 5278 | dm = t; | ||
| 5279 | |||
| 5280 | while (dm) { | ||
| 5281 | if (dm.hideMenu) | ||
| 5282 | dm.hideMenu(); | ||
| 5283 | |||
| 5284 | dm = dm.settings.parent; | ||
| 5285 | } | ||
| 5286 | |||
| 5287 | if (m.settings.onclick) | ||
| 5288 | m.settings.onclick(e); | ||
| 5289 | |||
| 5290 | return Event.cancel(e); // Cancel to fix onbeforeunload problem | ||
| 5291 | } | ||
| 5292 | }); | ||
| 5293 | |||
| 5294 | if (t.hasMenus()) { | ||
| 5295 | t.mouseOverFunc = Event.add(co, 'mouseover', function(e) { | ||
| 5296 | var m, r, mi; | ||
| 5297 | |||
| 5298 | e = e.target; | ||
| 5299 | if (e && (e = DOM.getParent(e, 'TR'))) { | ||
| 5300 | m = t.items[e.id]; | ||
| 5301 | |||
| 5302 | if (t.lastMenu) | ||
| 5303 | t.lastMenu.collapse(1); | ||
| 5304 | |||
| 5305 | if (m.isDisabled()) | ||
| 5306 | return; | ||
| 5307 | |||
| 5308 | if (e && DOM.hasClass(e, cp + 'ItemSub')) { | ||
| 5309 | //p = DOM.getPos(s.container); | ||
| 5310 | r = DOM.getRect(e); | ||
| 5311 | m.showMenu((r.x + r.w - ot), r.y - ot, r.x); | ||
| 5312 | t.lastMenu = m; | ||
| 5313 | DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive'); | ||
| 5314 | } | ||
| 5315 | } | ||
| 5316 | }); | ||
| 5317 | } | ||
| 5318 | |||
| 5319 | t.onShowMenu.dispatch(t); | ||
| 5320 | |||
| 5321 | if (s.keyboard_focus) { | ||
| 5322 | Event.add(co, 'keydown', t._keyHandler, t); | ||
| 5323 | DOM.select('a', 'menu_' + t.id)[0].focus(); // Select first link | ||
| 5324 | t._focusIdx = 0; | ||
| 5325 | } | ||
| 5326 | }, | ||
| 5327 | |||
| 5328 | hideMenu : function(c) { | ||
| 5329 | var t = this, co = DOM.get('menu_' + t.id), e; | ||
| 5330 | |||
| 5331 | if (!t.isMenuVisible) | ||
| 5332 | return; | ||
| 5333 | |||
| 5334 | Event.remove(co, 'mouseover', t.mouseOverFunc); | ||
| 5335 | Event.remove(co, 'click', t.mouseClickFunc); | ||
| 5336 | Event.remove(co, 'keydown', t._keyHandler); | ||
| 5337 | DOM.hide(co); | ||
| 5338 | t.isMenuVisible = 0; | ||
| 5339 | |||
| 5340 | if (!c) | ||
| 5341 | t.collapse(1); | ||
| 5342 | |||
| 5343 | if (t.element) | ||
| 5344 | t.element.hide(); | ||
| 5345 | |||
| 5346 | if (e = DOM.get(t.id)) | ||
| 5347 | DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive'); | ||
| 5348 | |||
| 5349 | t.onHideMenu.dispatch(t); | ||
| 5350 | }, | ||
| 5351 | |||
| 5352 | add : function(o) { | ||
| 5353 | var t = this, co; | ||
| 5354 | |||
| 5355 | o = t.parent(o); | ||
| 5356 | |||
| 5357 | if (t.isRendered && (co = DOM.get('menu_' + t.id))) | ||
| 5358 | t._add(DOM.select('tbody', co)[0], o); | ||
| 5359 | |||
| 5360 | return o; | ||
| 5361 | }, | ||
| 5362 | |||
| 5363 | collapse : function(d) { | ||
| 5364 | this.parent(d); | ||
| 5365 | this.hideMenu(1); | ||
| 5366 | }, | ||
| 5367 | |||
| 5368 | remove : function(o) { | ||
| 5369 | DOM.remove(o.id); | ||
| 5370 | this.destroy(); | ||
| 5371 | |||
| 5372 | return this.parent(o); | ||
| 5373 | }, | ||
| 5374 | |||
| 5375 | destroy : function() { | ||
| 5376 | var t = this, co = DOM.get('menu_' + t.id); | ||
| 5377 | |||
| 5378 | Event.remove(co, 'mouseover', t.mouseOverFunc); | ||
| 5379 | Event.remove(co, 'click', t.mouseClickFunc); | ||
| 5380 | |||
| 5381 | if (t.element) | ||
| 5382 | t.element.remove(); | ||
| 5383 | |||
| 5384 | DOM.remove(co); | ||
| 5385 | }, | ||
| 5386 | |||
| 5387 | renderNode : function() { | ||
| 5388 | var t = this, s = t.settings, n, tb, co, w; | ||
| 5389 | |||
| 5390 | w = DOM.create('div', {id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000'}); | ||
| 5391 | co = DOM.add(w, 'div', {id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')}); | ||
| 5392 | t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); | ||
| 5393 | |||
| 5394 | if (s.menu_line) | ||
| 5395 | DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'}); | ||
| 5396 | |||
| 5397 | // n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'}); | ||
| 5398 | n = DOM.add(co, 'table', {id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0}); | ||
| 5399 | tb = DOM.add(n, 'tbody'); | ||
| 5400 | |||
| 5401 | each(t.items, function(o) { | ||
| 5402 | t._add(tb, o); | ||
| 5403 | }); | ||
| 5404 | |||
| 5405 | t.rendered = true; | ||
| 5406 | |||
| 5407 | return w; | ||
| 5408 | }, | ||
| 5409 | |||
| 5410 | // Internal functions | ||
| 5411 | |||
| 5412 | _keyHandler : function(e) { | ||
| 5413 | var t = this, kc = e.keyCode; | ||
| 5414 | |||
| 5415 | function focus(d) { | ||
| 5416 | var i = t._focusIdx + d, e = DOM.select('a', 'menu_' + t.id)[i]; | ||
| 5417 | |||
| 5418 | if (e) { | ||
| 5419 | t._focusIdx = i; | ||
| 5420 | e.focus(); | ||
| 5421 | } | ||
| 5422 | }; | ||
| 5423 | |||
| 5424 | switch (kc) { | ||
| 5425 | case 38: | ||
| 5426 | focus(-1); // Select first link | ||
| 5427 | return; | ||
| 5428 | |||
| 5429 | case 40: | ||
| 5430 | focus(1); | ||
| 5431 | return; | ||
| 5432 | |||
| 5433 | case 13: | ||
| 5434 | return; | ||
| 5435 | |||
| 5436 | case 27: | ||
| 5437 | return this.hideMenu(); | ||
| 5438 | } | ||
| 5439 | }, | ||
| 5440 | |||
| 5441 | _add : function(tb, o) { | ||
| 5442 | var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic; | ||
| 5443 | |||
| 5444 | if (s.separator) { | ||
| 5445 | ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'}); | ||
| 5446 | DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'}); | ||
| 5447 | |||
| 5448 | if (n = ro.previousSibling) | ||
| 5449 | DOM.addClass(n, 'mceLast'); | ||
| 5450 | |||
| 5451 | return; | ||
| 5452 | } | ||
| 5453 | |||
| 5454 | n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'}); | ||
| 5455 | n = it = DOM.add(n, 'td'); | ||
| 5456 | n = a = DOM.add(n, 'a', {href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'}); | ||
| 5457 | |||
| 5458 | DOM.addClass(it, s['class']); | ||
| 5459 | // n = DOM.add(n, 'span', {'class' : 'item'}); | ||
| 5460 | |||
| 5461 | ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')}); | ||
| 5462 | |||
| 5463 | if (s.icon_src) | ||
| 5464 | DOM.add(ic, 'img', {src : s.icon_src}); | ||
| 5465 | |||
| 5466 | n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title); | ||
| 5467 | |||
| 5468 | if (o.settings.style) | ||
| 5469 | DOM.setAttrib(n, 'style', o.settings.style); | ||
| 5470 | |||
| 5471 | if (tb.childNodes.length == 1) | ||
| 5472 | DOM.addClass(ro, 'mceFirst'); | ||
| 5473 | |||
| 5474 | if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator')) | ||
| 5475 | DOM.addClass(ro, 'mceFirst'); | ||
| 5476 | |||
| 5477 | if (o.collapse) | ||
| 5478 | DOM.addClass(ro, cp + 'ItemSub'); | ||
| 5479 | |||
| 5480 | if (n = ro.previousSibling) | ||
| 5481 | DOM.removeClass(n, 'mceLast'); | ||
| 5482 | |||
| 5483 | DOM.addClass(ro, 'mceLast'); | ||
| 5484 | } | ||
| 5485 | |||
| 5486 | }); | ||
| 5487 | })(); | ||
| 5488 | /* file:jscripts/tiny_mce/classes/ui/Button.js */ | ||
| 5489 | |||
| 5490 | (function() { | ||
| 5491 | var DOM = tinymce.DOM; | ||
| 5492 | |||
| 5493 | tinymce.create('tinymce.ui.Button:tinymce.ui.Control', { | ||
| 5494 | Button : function(id, s) { | ||
| 5495 | this.parent(id, s); | ||
| 5496 | this.classPrefix = 'mceButton'; | ||
| 5497 | }, | ||
| 5498 | |||
| 5499 | renderHTML : function() { | ||
| 5500 | var cp = this.classPrefix, s = this.settings, h, l; | ||
| 5501 | |||
| 5502 | l = DOM.encode(s.label || ''); | ||
| 5503 | h = '<a id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" title="' + DOM.encode(s.title) + '">'; | ||
| 5504 | |||
| 5505 | if (s.image) | ||
| 5506 | h += '<img class="mceIcon" src="' + s.image + '" />' + l + '</a>'; | ||
| 5507 | else | ||
| 5508 | h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '') + '</a>'; | ||
| 5509 | |||
| 5510 | return h; | ||
| 5511 | }, | ||
| 5512 | |||
| 5513 | postRender : function() { | ||
| 5514 | var t = this, s = t.settings; | ||
| 5515 | |||
| 5516 | tinymce.dom.Event.add(t.id, 'click', function(e) { | ||
| 5517 | if (!t.isDisabled()) | ||
| 5518 | return s.onclick.call(s.scope, e); | ||
| 5519 | }); | ||
| 5520 | } | ||
| 5521 | |||
| 5522 | }); | ||
| 5523 | })(); | ||
| 5524 | |||
| 5525 | /* file:jscripts/tiny_mce/classes/ui/ListBox.js */ | ||
| 5526 | |||
| 5527 | (function() { | ||
| 5528 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; | ||
| 5529 | |||
| 5530 | tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', { | ||
| 5531 | ListBox : function(id, s) { | ||
| 5532 | var t = this; | ||
| 5533 | |||
| 5534 | t.parent(id, s); | ||
| 5535 | t.items = []; | ||
| 5536 | t.onChange = new Dispatcher(t); | ||
| 5537 | t.onPostRender = new Dispatcher(t); | ||
| 5538 | t.onAdd = new Dispatcher(t); | ||
| 5539 | t.onRenderMenu = new tinymce.util.Dispatcher(this); | ||
| 5540 | t.classPrefix = 'mceListBox'; | ||
| 5541 | }, | ||
| 5542 | |||
| 5543 | select : function(va) { | ||
| 5544 | var t = this, fv, f; | ||
| 5545 | |||
| 5546 | if (va == undefined) | ||
| 5547 | return t.selectByIndex(-1); | ||
| 5548 | |||
| 5549 | // Is string or number make function selector | ||
| 5550 | if (va && va.call) | ||
| 5551 | f = va; | ||
| 5552 | else { | ||
| 5553 | f = function(v) { | ||
| 5554 | return v == va; | ||
| 5555 | }; | ||
| 5556 | } | ||
| 5557 | |||
| 5558 | // Do we need to do something? | ||
| 5559 | if (va != t.selectedValue) { | ||
| 5560 | // Find item | ||
| 5561 | each(t.items, function(o, i) { | ||
| 5562 | if (f(o.value)) { | ||
| 5563 | fv = 1; | ||
| 5564 | t.selectByIndex(i); | ||
| 5565 | return false; | ||
| 5566 | } | ||
| 5567 | }); | ||
| 5568 | |||
| 5569 | if (!fv) | ||
| 5570 | t.selectByIndex(-1); | ||
| 5571 | } | ||
| 5572 | }, | ||
| 5573 | |||
| 5574 | selectByIndex : function(idx) { | ||
| 5575 | var t = this, e, o; | ||
| 5576 | |||
| 5577 | if (idx != t.selectedIndex) { | ||
| 5578 | e = DOM.get(t.id + '_text'); | ||
| 5579 | o = t.items[idx]; | ||
| 5580 | |||
| 5581 | if (o) { | ||
| 5582 | t.selectedValue = o.value; | ||
| 5583 | t.selectedIndex = idx; | ||
| 5584 | DOM.setHTML(e, DOM.encode(o.title)); | ||
| 5585 | DOM.removeClass(e, 'mceTitle'); | ||
| 5586 | } else { | ||
| 5587 | DOM.setHTML(e, DOM.encode(t.settings.title)); | ||
| 5588 | DOM.addClass(e, 'mceTitle'); | ||
| 5589 | t.selectedValue = t.selectedIndex = null; | ||
| 5590 | } | ||
| 5591 | |||
| 5592 | e = 0; | ||
| 5593 | } else | ||
| 5594 | t.selectedValue = t.selectedIndex = null; | ||
| 5595 | }, | ||
| 5596 | |||
| 5597 | add : function(n, v, o) { | ||
| 5598 | var t = this; | ||
| 5599 | |||
| 5600 | o = o || {}; | ||
| 5601 | o = tinymce.extend(o, { | ||
| 5602 | title : n, | ||
| 5603 | value : v | ||
| 5604 | }); | ||
| 5605 | |||
| 5606 | t.items.push(o); | ||
| 5607 | t.onAdd.dispatch(t, o); | ||
| 5608 | }, | ||
| 5609 | |||
| 5610 | getLength : function() { | ||
| 5611 | return this.items.length; | ||
| 5612 | }, | ||
| 5613 | |||
| 5614 | renderHTML : function() { | ||
| 5615 | var h = '', t = this, s = t.settings, cp = t.classPrefix; | ||
| 5616 | |||
| 5617 | h = '<table id="' + t.id + '" cellpadding="0" cellspacing="0" class="' + cp + ' ' + cp + 'Enabled' + (s['class'] ? (' ' + s['class']) : '') + '"><tbody><tr>'; | ||
| 5618 | h += '<td>' + DOM.createHTML('a', {id : t.id + '_text', href : 'javascript:;', 'class' : 'mceText', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '</td>'; | ||
| 5619 | h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', tabindex : -1, href : 'javascript:;', 'class' : 'mceOpen', onclick : "return false;", onmousedown : 'return false;'}, '<span></span>') + '</td>'; | ||
| 5620 | h += '</tr></tbody></table>'; | ||
| 5621 | |||
| 5622 | return h; | ||
| 5623 | }, | ||
| 5624 | |||
| 5625 | showMenu : function() { | ||
| 5626 | var t = this, p1, p2, e = DOM.get(this.id), m; | ||
| 5627 | |||
| 5628 | if (t.isDisabled() || t.items.length == 0) | ||
| 5629 | return; | ||
| 5630 | |||
| 5631 | if (t.menu && t.menu.isMenuVisible) | ||
| 5632 | return t.hideMenu(); | ||
| 5633 | |||
| 5634 | if (!t.isMenuRendered) { | ||
| 5635 | t.renderMenu(); | ||
| 5636 | t.isMenuRendered = true; | ||
| 5637 | } | ||
| 5638 | |||
| 5639 | p1 = DOM.getPos(this.settings.menu_container); | ||
| 5640 | p2 = DOM.getPos(e); | ||
| 5641 | |||
| 5642 | m = t.menu; | ||
| 5643 | m.settings.offset_x = p2.x; | ||
| 5644 | m.settings.offset_y = p2.y; | ||
| 5645 | m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus | ||
| 5646 | |||
| 5647 | // Select in menu | ||
| 5648 | if (t.oldID) | ||
| 5649 | m.items[t.oldID].setSelected(0); | ||
| 5650 | |||
| 5651 | each(t.items, function(o) { | ||
| 5652 | if (o.value === t.selectedValue) { | ||
| 5653 | m.items[o.id].setSelected(1); | ||
| 5654 | t.oldID = o.id; | ||
| 5655 | } | ||
| 5656 | }); | ||
| 5657 | |||
| 5658 | m.showMenu(0, e.clientHeight); | ||
| 5659 | |||
| 5660 | Event.add(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 5661 | DOM.addClass(t.id, t.classPrefix + 'Selected'); | ||
| 5662 | |||
| 5663 | //DOM.get(t.id + '_text').focus(); | ||
| 5664 | }, | ||
| 5665 | |||
| 5666 | hideMenu : function(e) { | ||
| 5667 | var t = this; | ||
| 5668 | |||
| 5669 | // Prevent double toogles by canceling the mouse click event to the button | ||
| 5670 | if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open')) | ||
| 5671 | return; | ||
| 5672 | |||
| 5673 | if (!e || !DOM.getParent(e.target, function(n) {return DOM.hasClass(n, 'mceMenu');})) { | ||
| 5674 | DOM.removeClass(t.id, t.classPrefix + 'Selected'); | ||
| 5675 | Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 5676 | |||
| 5677 | if (t.menu) | ||
| 5678 | t.menu.hideMenu(); | ||
| 5679 | } | ||
| 5680 | }, | ||
| 5681 | |||
| 5682 | renderMenu : function() { | ||
| 5683 | var t = this, m; | ||
| 5684 | |||
| 5685 | m = t.settings.control_manager.createDropMenu(t.id + '_menu', { | ||
| 5686 | menu_line : 1, | ||
| 5687 | 'class' : t.classPrefix + 'Menu mceNoIcons', | ||
| 5688 | max_width : 150, | ||
| 5689 | max_height : 150 | ||
| 5690 | }); | ||
| 5691 | |||
| 5692 | m.onHideMenu.add(t.hideMenu, t); | ||
| 5693 | |||
| 5694 | m.add({ | ||
| 5695 | title : t.settings.title, | ||
| 5696 | 'class' : 'mceMenuItemTitle', | ||
| 5697 | onclick : function() { | ||
| 5698 | if (t.settings.onselect('') !== false) | ||
| 5699 | t.select(''); // Must be runned after | ||
| 5700 | } | ||
| 5701 | }); | ||
| 5702 | |||
| 5703 | each(t.items, function(o) { | ||
| 5704 | o.id = DOM.uniqueId(); | ||
| 5705 | o.onclick = function() { | ||
| 5706 | if (t.settings.onselect(o.value) !== false) | ||
| 5707 | t.select(o.value); // Must be runned after | ||
| 5708 | }; | ||
| 5709 | |||
| 5710 | m.add(o); | ||
| 5711 | }); | ||
| 5712 | |||
| 5713 | t.onRenderMenu.dispatch(t, m); | ||
| 5714 | t.menu = m; | ||
| 5715 | }, | ||
| 5716 | |||
| 5717 | postRender : function() { | ||
| 5718 | var t = this, cp = t.classPrefix; | ||
| 5719 | |||
| 5720 | Event.add(t.id, 'click', t.showMenu, t); | ||
| 5721 | Event.add(t.id + '_text', 'focus', function(e) { | ||
| 5722 | if (!t._focused) { | ||
| 5723 | t.keyDownHandler = Event.add(t.id + '_text', 'keydown', function(e) { | ||
| 5724 | var idx = -1, v, kc = e.keyCode; | ||
| 5725 | |||
| 5726 | // Find current index | ||
| 5727 | each(t.items, function(v, i) { | ||
| 5728 | if (t.selectedValue == v.value) | ||
| 5729 | idx = i; | ||
| 5730 | }); | ||
| 5731 | |||
| 5732 | // Move up/down | ||
| 5733 | if (kc == 38) | ||
| 5734 | v = t.items[idx - 1]; | ||
| 5735 | else if (kc == 40) | ||
| 5736 | v = t.items[idx + 1]; | ||
| 5737 | else if (kc == 13) { | ||
| 5738 | // Fake select on enter | ||
| 5739 | v = t.selectedValue; | ||
| 5740 | t.selectedValue = null; // Needs to be null to fake change | ||
| 5741 | t.settings.onselect(v); | ||
| 5742 | return Event.cancel(e); | ||
| 5743 | } | ||
| 5744 | |||
| 5745 | if (v) { | ||
| 5746 | t.hideMenu(); | ||
| 5747 | t.select(v.value); | ||
| 5748 | } | ||
| 5749 | }); | ||
| 5750 | } | ||
| 5751 | |||
| 5752 | t._focused = 1; | ||
| 5753 | }); | ||
| 5754 | Event.add(t.id + '_text', 'blur', function() {Event.remove(t.id + '_text', 'keydown', t.keyDownHandler); t._focused = 0;}); | ||
| 5755 | |||
| 5756 | // Old IE doesn't have hover on all elements | ||
| 5757 | if (tinymce.isIE6 || !DOM.boxModel) { | ||
| 5758 | Event.add(t.id, 'mouseover', function() { | ||
| 5759 | if (!DOM.hasClass(t.id, cp + 'Disabled')) | ||
| 5760 | DOM.addClass(t.id, cp + 'Hover'); | ||
| 5761 | }); | ||
| 5762 | |||
| 5763 | Event.add(t.id, 'mouseout', function() { | ||
| 5764 | if (!DOM.hasClass(t.id, cp + 'Disabled')) | ||
| 5765 | DOM.removeClass(t.id, cp + 'Hover'); | ||
| 5766 | }); | ||
| 5767 | } | ||
| 5768 | |||
| 5769 | t.onPostRender.dispatch(t, DOM.get(t.id)); | ||
| 5770 | }, | ||
| 5771 | |||
| 5772 | destroy : function() { | ||
| 5773 | this.parent(); | ||
| 5774 | |||
| 5775 | Event.clear(this.id + '_text'); | ||
| 5776 | } | ||
| 5777 | |||
| 5778 | }); | ||
| 5779 | })(); | ||
| 5780 | /* file:jscripts/tiny_mce/classes/ui/NativeListBox.js */ | ||
| 5781 | |||
| 5782 | (function() { | ||
| 5783 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; | ||
| 5784 | |||
| 5785 | tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', { | ||
| 5786 | NativeListBox : function(id, s) { | ||
| 5787 | this.parent(id, s); | ||
| 5788 | this.classPrefix = 'mceNativeListBox'; | ||
| 5789 | }, | ||
| 5790 | |||
| 5791 | setDisabled : function(s) { | ||
| 5792 | DOM.get(this.id).disabled = s; | ||
| 5793 | }, | ||
| 5794 | |||
| 5795 | isDisabled : function() { | ||
| 5796 | return DOM.get(this.id).disabled; | ||
| 5797 | }, | ||
| 5798 | |||
| 5799 | select : function(va) { | ||
| 5800 | var t = this, fv, f; | ||
| 5801 | |||
| 5802 | if (va == undefined) | ||
| 5803 | return t.selectByIndex(-1); | ||
| 5804 | |||
| 5805 | // Is string or number make function selector | ||
| 5806 | if (va && va.call) | ||
| 5807 | f = va; | ||
| 5808 | else { | ||
| 5809 | f = function(v) { | ||
| 5810 | return v == va; | ||
| 5811 | }; | ||
| 5812 | } | ||
| 5813 | |||
| 5814 | // Do we need to do something? | ||
| 5815 | if (va != t.selectedValue) { | ||
| 5816 | // Find item | ||
| 5817 | each(t.items, function(o, i) { | ||
| 5818 | if (f(o.value)) { | ||
| 5819 | fv = 1; | ||
| 5820 | t.selectByIndex(i); | ||
| 5821 | return false; | ||
| 5822 | } | ||
| 5823 | }); | ||
| 5824 | |||
| 5825 | if (!fv) | ||
| 5826 | t.selectByIndex(-1); | ||
| 5827 | } | ||
| 5828 | }, | ||
| 5829 | |||
| 5830 | selectByIndex : function(idx) { | ||
| 5831 | DOM.get(this.id).selectedIndex = idx + 1; | ||
| 5832 | this.selectedValue = this.items[idx] ? this.items[idx].value : null; | ||
| 5833 | }, | ||
| 5834 | |||
| 5835 | add : function(n, v, a) { | ||
| 5836 | var o, t = this; | ||
| 5837 | |||
| 5838 | a = a || {}; | ||
| 5839 | a.value = v; | ||
| 5840 | |||
| 5841 | if (t.isRendered()) | ||
| 5842 | DOM.add(DOM.get(this.id), 'option', a, n); | ||
| 5843 | |||
| 5844 | o = { | ||
| 5845 | title : n, | ||
| 5846 | value : v, | ||
| 5847 | attribs : a | ||
| 5848 | }; | ||
| 5849 | |||
| 5850 | t.items.push(o); | ||
| 5851 | t.onAdd.dispatch(t, o); | ||
| 5852 | }, | ||
| 5853 | |||
| 5854 | getLength : function() { | ||
| 5855 | return DOM.get(this.id).options.length - 1; | ||
| 5856 | }, | ||
| 5857 | |||
| 5858 | renderHTML : function() { | ||
| 5859 | var h, t = this; | ||
| 5860 | |||
| 5861 | h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --'); | ||
| 5862 | |||
| 5863 | each(t.items, function(it) { | ||
| 5864 | h += DOM.createHTML('option', {value : it.value}, it.title); | ||
| 5865 | }); | ||
| 5866 | |||
| 5867 | h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox'}, h); | ||
| 5868 | |||
| 5869 | return h; | ||
| 5870 | }, | ||
| 5871 | |||
| 5872 | postRender : function() { | ||
| 5873 | var t = this, ch; | ||
| 5874 | |||
| 5875 | t.rendered = true; | ||
| 5876 | |||
| 5877 | function onChange(e) { | ||
| 5878 | var v = t.items[e.target.selectedIndex - 1]; | ||
| 5879 | |||
| 5880 | if (v && (v = v.value)) { | ||
| 5881 | t.onChange.dispatch(t, v); | ||
| 5882 | |||
| 5883 | if (t.settings.onselect) | ||
| 5884 | t.settings.onselect(v); | ||
| 5885 | } | ||
| 5886 | }; | ||
| 5887 | |||
| 5888 | Event.add(t.id, 'change', onChange); | ||
| 5889 | |||
| 5890 | // Accessibility keyhandler | ||
| 5891 | Event.add(t.id, 'keydown', function(e) { | ||
| 5892 | var bf; | ||
| 5893 | |||
| 5894 | Event.remove(t.id, 'change', ch); | ||
| 5895 | |||
| 5896 | bf = Event.add(t.id, 'blur', function() { | ||
| 5897 | Event.add(t.id, 'change', onChange); | ||
| 5898 | Event.remove(t.id, 'blur', bf); | ||
| 5899 | }); | ||
| 5900 | |||
| 5901 | if (e.keyCode == 13 || e.keyCode == 32) { | ||
| 5902 | onChange(e); | ||
| 5903 | return Event.cancel(e); | ||
| 5904 | } | ||
| 5905 | }); | ||
| 5906 | |||
| 5907 | t.onPostRender.dispatch(t, DOM.get(t.id)); | ||
| 5908 | } | ||
| 5909 | |||
| 5910 | }); | ||
| 5911 | })(); | ||
| 5912 | /* file:jscripts/tiny_mce/classes/ui/MenuButton.js */ | ||
| 5913 | |||
| 5914 | (function() { | ||
| 5915 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; | ||
| 5916 | |||
| 5917 | tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', { | ||
| 5918 | MenuButton : function(id, s) { | ||
| 5919 | this.parent(id, s); | ||
| 5920 | this.onRenderMenu = new tinymce.util.Dispatcher(this); | ||
| 5921 | s.menu_container = s.menu_container || DOM.doc.body; | ||
| 5922 | }, | ||
| 5923 | |||
| 5924 | showMenu : function() { | ||
| 5925 | var t = this, p1, p2, e = DOM.get(t.id), m; | ||
| 5926 | |||
| 5927 | if (t.isDisabled()) | ||
| 5928 | return; | ||
| 5929 | |||
| 5930 | if (!t.isMenuRendered) { | ||
| 5931 | t.renderMenu(); | ||
| 5932 | t.isMenuRendered = true; | ||
| 5933 | } | ||
| 5934 | |||
| 5935 | if (t.isMenuVisible) | ||
| 5936 | return t.hideMenu(); | ||
| 5937 | |||
| 5938 | p1 = DOM.getPos(t.settings.menu_container); | ||
| 5939 | p2 = DOM.getPos(e); | ||
| 5940 | |||
| 5941 | m = t.menu; | ||
| 5942 | m.settings.offset_x = p2.x; | ||
| 5943 | m.settings.offset_y = p2.y; | ||
| 5944 | m.settings.vp_offset_x = p2.x; | ||
| 5945 | m.settings.vp_offset_y = p2.y; | ||
| 5946 | m.settings.keyboard_focus = t._focused; | ||
| 5947 | m.showMenu(0, e.clientHeight); | ||
| 5948 | |||
| 5949 | Event.add(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 5950 | t.setState('Selected', 1); | ||
| 5951 | |||
| 5952 | t.isMenuVisible = 1; | ||
| 5953 | }, | ||
| 5954 | |||
| 5955 | renderMenu : function() { | ||
| 5956 | var t = this, m; | ||
| 5957 | |||
| 5958 | m = t.settings.control_manager.createDropMenu(t.id + '_menu', { | ||
| 5959 | menu_line : 1, | ||
| 5960 | 'class' : this.classPrefix + 'Menu', | ||
| 5961 | icons : t.settings.icons | ||
| 5962 | }); | ||
| 5963 | |||
| 5964 | m.onHideMenu.add(t.hideMenu, t); | ||
| 5965 | |||
| 5966 | t.onRenderMenu.dispatch(t, m); | ||
| 5967 | t.menu = m; | ||
| 5968 | }, | ||
| 5969 | |||
| 5970 | hideMenu : function(e) { | ||
| 5971 | var t = this; | ||
| 5972 | |||
| 5973 | // Prevent double toogles by canceling the mouse click event to the button | ||
| 5974 | if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';})) | ||
| 5975 | return; | ||
| 5976 | |||
| 5977 | if (!e || !DOM.getParent(e.target, function(n) {return DOM.hasClass(n, 'mceMenu');})) { | ||
| 5978 | t.setState('Selected', 0); | ||
| 5979 | Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 5980 | if (t.menu) | ||
| 5981 | t.menu.hideMenu(); | ||
| 5982 | } | ||
| 5983 | |||
| 5984 | t.isMenuVisible = 0; | ||
| 5985 | }, | ||
| 5986 | |||
| 5987 | postRender : function() { | ||
| 5988 | var t = this, s = t.settings; | ||
| 5989 | |||
| 5990 | Event.add(t.id, 'click', function() { | ||
| 5991 | if (!t.isDisabled()) { | ||
| 5992 | if (s.onclick) | ||
| 5993 | s.onclick(t.value); | ||
| 5994 | |||
| 5995 | t.showMenu(); | ||
| 5996 | } | ||
| 5997 | }); | ||
| 5998 | } | ||
| 5999 | |||
| 6000 | }); | ||
| 6001 | })(); | ||
| 6002 | |||
| 6003 | /* file:jscripts/tiny_mce/classes/ui/SplitButton.js */ | ||
| 6004 | |||
| 6005 | (function() { | ||
| 6006 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; | ||
| 6007 | |||
| 6008 | tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', { | ||
| 6009 | SplitButton : function(id, s) { | ||
| 6010 | this.parent(id, s); | ||
| 6011 | this.classPrefix = 'mceSplitButton'; | ||
| 6012 | }, | ||
| 6013 | |||
| 6014 | renderHTML : function() { | ||
| 6015 | var h, t = this, s = t.settings, h1; | ||
| 6016 | |||
| 6017 | h = '<tbody><tr>'; | ||
| 6018 | |||
| 6019 | if (s.image) | ||
| 6020 | h1 = DOM.createHTML('img ', {src : s.image, 'class' : 'mceAction ' + s['class']}); | ||
| 6021 | else | ||
| 6022 | h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, ''); | ||
| 6023 | |||
| 6024 | h += '<td>' + DOM.createHTML('a', {id : t.id + '_action', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>'; | ||
| 6025 | |||
| 6026 | h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}); | ||
| 6027 | h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>'; | ||
| 6028 | |||
| 6029 | h += '</tr></tbody>'; | ||
| 6030 | |||
| 6031 | return DOM.createHTML('table', {id : t.id, 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', onmousedown : 'return false;', title : s.title}, h); | ||
| 6032 | }, | ||
| 6033 | |||
| 6034 | postRender : function() { | ||
| 6035 | var t = this, s = t.settings; | ||
| 6036 | |||
| 6037 | if (s.onclick) { | ||
| 6038 | Event.add(t.id + '_action', 'click', function() { | ||
| 6039 | if (!t.isDisabled()) | ||
| 6040 | s.onclick(t.value); | ||
| 6041 | }); | ||
| 6042 | } | ||
| 6043 | |||
| 6044 | Event.add(t.id + '_open', 'click', t.showMenu, t); | ||
| 6045 | Event.add(t.id + '_open', 'focus', function() {t._focused = 1;}); | ||
| 6046 | Event.add(t.id + '_open', 'blur', function() {t._focused = 0;}); | ||
| 6047 | |||
| 6048 | // Old IE doesn't have hover on all elements | ||
| 6049 | if (tinymce.isIE6 || !DOM.boxModel) { | ||
| 6050 | Event.add(t.id, 'mouseover', function() { | ||
| 6051 | if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) | ||
| 6052 | DOM.addClass(t.id, 'mceSplitButtonHover'); | ||
| 6053 | }); | ||
| 6054 | |||
| 6055 | Event.add(t.id, 'mouseout', function() { | ||
| 6056 | if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) | ||
| 6057 | DOM.removeClass(t.id, 'mceSplitButtonHover'); | ||
| 6058 | }); | ||
| 6059 | } | ||
| 6060 | }, | ||
| 6061 | |||
| 6062 | destroy : function() { | ||
| 6063 | this.parent(); | ||
| 6064 | |||
| 6065 | Event.clear(this.id + '_action'); | ||
| 6066 | Event.clear(this.id + '_open'); | ||
| 6067 | } | ||
| 6068 | |||
| 6069 | }); | ||
| 6070 | })(); | ||
| 6071 | |||
| 6072 | /* file:jscripts/tiny_mce/classes/ui/ColorSplitButton.js */ | ||
| 6073 | |||
| 6074 | (function() { | ||
| 6075 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each; | ||
| 6076 | |||
| 6077 | tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', { | ||
| 6078 | ColorSplitButton : function(id, s) { | ||
| 6079 | var t = this; | ||
| 6080 | |||
| 6081 | t.parent(id, s); | ||
| 6082 | |||
| 6083 | t.settings = s = tinymce.extend({ | ||
| 6084 | colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF', | ||
| 6085 | grid_width : 8, | ||
| 6086 | default_color : '#888888' | ||
| 6087 | }, t.settings); | ||
| 6088 | |||
| 6089 | t.onShowMenu = new tinymce.util.Dispatcher(t); | ||
| 6090 | t.onHideMenu = new tinymce.util.Dispatcher(t); | ||
| 6091 | |||
| 6092 | t.value = s.default_color; | ||
| 6093 | }, | ||
| 6094 | |||
| 6095 | showMenu : function() { | ||
| 6096 | var t = this, r, p, e, p2; | ||
| 6097 | |||
| 6098 | if (t.isDisabled()) | ||
| 6099 | return; | ||
| 6100 | |||
| 6101 | if (!t.isMenuRendered) { | ||
| 6102 | t.renderMenu(); | ||
| 6103 | t.isMenuRendered = true; | ||
| 6104 | } | ||
| 6105 | |||
| 6106 | if (t.isMenuVisible) | ||
| 6107 | return t.hideMenu(); | ||
| 6108 | |||
| 6109 | e = DOM.get(t.id); | ||
| 6110 | DOM.show(t.id + '_menu'); | ||
| 6111 | DOM.addClass(e, 'mceSplitButtonSelected'); | ||
| 6112 | p2 = DOM.getPos(e); | ||
| 6113 | DOM.setStyles(t.id + '_menu', { | ||
| 6114 | left : p2.x, | ||
| 6115 | top : p2.y + e.clientHeight, | ||
| 6116 | zIndex : 200000 | ||
| 6117 | }); | ||
| 6118 | e = 0; | ||
| 6119 | |||
| 6120 | Event.add(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 6121 | |||
| 6122 | if (t._focused) { | ||
| 6123 | t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) { | ||
| 6124 | if (e.keyCode == 27) | ||
| 6125 | t.hideMenu(); | ||
| 6126 | }); | ||
| 6127 | |||
| 6128 | DOM.select('a', t.id + '_menu')[0].focus(); // Select first link | ||
| 6129 | } | ||
| 6130 | |||
| 6131 | t.onShowMenu.dispatch(t); | ||
| 6132 | |||
| 6133 | t.isMenuVisible = 1; | ||
| 6134 | }, | ||
| 6135 | |||
| 6136 | hideMenu : function(e) { | ||
| 6137 | var t = this; | ||
| 6138 | |||
| 6139 | // Prevent double toogles by canceling the mouse click event to the button | ||
| 6140 | if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';})) | ||
| 6141 | return; | ||
| 6142 | |||
| 6143 | if (!e || !DOM.getParent(e.target, function(n) {return DOM.hasClass(n, 'mceSplitButtonMenu');})) { | ||
| 6144 | DOM.removeClass(t.id, 'mceSplitButtonSelected'); | ||
| 6145 | Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 6146 | Event.remove(t.id + '_menu', 'keydown', t._keyHandler); | ||
| 6147 | DOM.hide(t.id + '_menu'); | ||
| 6148 | } | ||
| 6149 | |||
| 6150 | t.onHideMenu.dispatch(t); | ||
| 6151 | |||
| 6152 | t.isMenuVisible = 0; | ||
| 6153 | }, | ||
| 6154 | |||
| 6155 | renderMenu : function() { | ||
| 6156 | var t = this, m, i = 0, s = t.settings, n, tb, tr, w; | ||
| 6157 | |||
| 6158 | w = DOM.add(s.menu_container, 'div', {id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'}); | ||
| 6159 | m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'}); | ||
| 6160 | DOM.add(m, 'span', {'class' : 'mceMenuLine'}); | ||
| 6161 | |||
| 6162 | n = DOM.add(m, 'table', {'class' : 'mceColorSplitMenu'}); | ||
| 6163 | tb = DOM.add(n, 'tbody'); | ||
| 6164 | |||
| 6165 | // Generate color grid | ||
| 6166 | i = 0; | ||
| 6167 | each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) { | ||
| 6168 | c = c.replace(/^#/, ''); | ||
| 6169 | |||
| 6170 | if (!i--) { | ||
| 6171 | tr = DOM.add(tb, 'tr'); | ||
| 6172 | i = s.grid_width - 1; | ||
| 6173 | } | ||
| 6174 | |||
| 6175 | n = DOM.add(tr, 'td'); | ||
| 6176 | |||
| 6177 | n = DOM.add(n, 'a', { | ||
| 6178 | href : 'javascript:;', | ||
| 6179 | style : { | ||
| 6180 | backgroundColor : '#' + c | ||
| 6181 | }, | ||
| 6182 | mce_color : '#' + c | ||
| 6183 | }); | ||
| 6184 | }); | ||
| 6185 | |||
| 6186 | if (s.more_colors_func) { | ||
| 6187 | n = DOM.add(tb, 'tr'); | ||
| 6188 | n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'}); | ||
| 6189 | n = DOM.add(n, 'a', {id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title); | ||
| 6190 | |||
| 6191 | Event.add(n, 'click', function(e) { | ||
| 6192 | s.more_colors_func.call(s.more_colors_scope || this); | ||
| 6193 | return Event.cancel(e); // Cancel to fix onbeforeunload problem | ||
| 6194 | }); | ||
| 6195 | } | ||
| 6196 | |||
| 6197 | DOM.addClass(m, 'mceColorSplitMenu'); | ||
| 6198 | |||
| 6199 | Event.add(t.id + '_menu', 'click', function(e) { | ||
| 6200 | var c; | ||
| 6201 | |||
| 6202 | e = e.target; | ||
| 6203 | |||
| 6204 | if (e.nodeName == 'A' && (c = e.getAttribute('mce_color'))) | ||
| 6205 | t.setColor(c); | ||
| 6206 | |||
| 6207 | return Event.cancel(e); // Prevent IE auto save warning | ||
| 6208 | }); | ||
| 6209 | |||
| 6210 | return w; | ||
| 6211 | }, | ||
| 6212 | |||
| 6213 | setColor : function(c) { | ||
| 6214 | var t = this; | ||
| 6215 | |||
| 6216 | DOM.setStyle(t.id + '_preview', 'backgroundColor', c); | ||
| 6217 | |||
| 6218 | t.value = c; | ||
| 6219 | t.hideMenu(); | ||
| 6220 | t.settings.onselect(c); | ||
| 6221 | }, | ||
| 6222 | |||
| 6223 | postRender : function() { | ||
| 6224 | var t = this, id = t.id; | ||
| 6225 | |||
| 6226 | t.parent(); | ||
| 6227 | DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'}); | ||
| 6228 | DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value); | ||
| 6229 | }, | ||
| 6230 | |||
| 6231 | destroy : function() { | ||
| 6232 | this.parent(); | ||
| 6233 | |||
| 6234 | Event.clear(this.id + '_menu'); | ||
| 6235 | Event.clear(this.id + '_more'); | ||
| 6236 | DOM.remove(this.id + '_menu'); | ||
| 6237 | } | ||
| 6238 | |||
| 6239 | }); | ||
| 6240 | })(); | ||
| 6241 | |||
| 6242 | /* file:jscripts/tiny_mce/classes/ui/Toolbar.js */ | ||
| 6243 | |||
| 6244 | tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { | ||
| 6245 | renderHTML : function() { | ||
| 6246 | var t = this, h = '', c, co, dom = tinymce.DOM, s = t.settings, i, pr, nx, cl; | ||
| 6247 | |||
| 6248 | cl = t.controls; | ||
| 6249 | for (i=0; i<cl.length; i++) { | ||
| 6250 | // Get current control, prev control, next control and if the control is a list box or not | ||
| 6251 | co = cl[i]; | ||
| 6252 | pr = cl[i - 1]; | ||
| 6253 | nx = cl[i + 1]; | ||
| 6254 | |||
| 6255 | // Add toolbar start | ||
| 6256 | if (i === 0) { | ||
| 6257 | c = 'mceToolbarStart'; | ||
| 6258 | |||
| 6259 | if (co.Button) | ||
| 6260 | c += ' mceToolbarStartButton'; | ||
| 6261 | else if (co.SplitButton) | ||
| 6262 | c += ' mceToolbarStartSplitButton'; | ||
| 6263 | else if (co.ListBox) | ||
| 6264 | c += ' mceToolbarStartListBox'; | ||
| 6265 | |||
| 6266 | h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->')); | ||
| 6267 | } | ||
| 6268 | |||
| 6269 | // Add toolbar end before list box and after the previous button | ||
| 6270 | // This is to fix the o2k7 editor skins | ||
| 6271 | if (pr && co.ListBox) { | ||
| 6272 | if (pr.Button || pr.SplitButton) | ||
| 6273 | h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '<!-- IE -->')); | ||
| 6274 | } | ||
| 6275 | |||
| 6276 | // Render control HTML | ||
| 6277 | |||
| 6278 | // IE 8 quick fix, needed to propertly generate a hit area for anchors | ||
| 6279 | if (dom.stdMode) | ||
| 6280 | h += '<td style="position: relative">' + co.renderHTML() + '</td>'; | ||
| 6281 | else | ||
| 6282 | h += '<td>' + co.renderHTML() + '</td>'; | ||
| 6283 | |||
| 6284 | // Add toolbar start after list box and before the next button | ||
| 6285 | // This is to fix the o2k7 editor skins | ||
| 6286 | if (nx && co.ListBox) { | ||
| 6287 | if (nx.Button || nx.SplitButton) | ||
| 6288 | h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '<!-- IE -->')); | ||
| 6289 | } | ||
| 6290 | } | ||
| 6291 | |||
| 6292 | c = 'mceToolbarEnd'; | ||
| 6293 | |||
| 6294 | if (co.Button) | ||
| 6295 | c += ' mceToolbarEndButton'; | ||
| 6296 | else if (co.SplitButton) | ||
| 6297 | c += ' mceToolbarEndSplitButton'; | ||
| 6298 | else if (co.ListBox) | ||
| 6299 | c += ' mceToolbarEndListBox'; | ||
| 6300 | |||
| 6301 | h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->')); | ||
| 6302 | |||
| 6303 | return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '<tbody><tr>' + h + '</tr></tbody>'); | ||
| 6304 | } | ||
| 6305 | |||
| 6306 | }); | ||
| 6307 | |||
| 6308 | /* file:jscripts/tiny_mce/classes/AddOnManager.js */ | ||
| 6309 | |||
| 6310 | (function() { | ||
| 6311 | var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each; | ||
| 6312 | |||
| 6313 | tinymce.create('tinymce.AddOnManager', { | ||
| 6314 | items : [], | ||
| 6315 | urls : {}, | ||
| 6316 | lookup : {}, | ||
| 6317 | onAdd : new Dispatcher(this), | ||
| 6318 | |||
| 6319 | get : function(n) { | ||
| 6320 | return this.lookup[n]; | ||
| 6321 | }, | ||
| 6322 | |||
| 6323 | requireLangPack : function(n) { | ||
| 6324 | var u, s = tinymce.EditorManager.settings; | ||
| 6325 | |||
| 6326 | if (s && s.language) { | ||
| 6327 | u = this.urls[n] + '/langs/' + s.language + '.js'; | ||
| 6328 | |||
| 6329 | if (!tinymce.dom.Event.domLoaded && !s.strict_mode) | ||
| 6330 | tinymce.ScriptLoader.load(u); | ||
| 6331 | else | ||
| 6332 | tinymce.ScriptLoader.add(u); | ||
| 6333 | } | ||
| 6334 | }, | ||
| 6335 | |||
| 6336 | add : function(id, o) { | ||
| 6337 | this.items.push(o); | ||
| 6338 | this.lookup[id] = o; | ||
| 6339 | this.onAdd.dispatch(this, id, o); | ||
| 6340 | |||
| 6341 | return o; | ||
| 6342 | }, | ||
| 6343 | |||
| 6344 | load : function(n, u, cb, s) { | ||
| 6345 | var t = this; | ||
| 6346 | |||
| 6347 | if (t.urls[n]) | ||
| 6348 | return; | ||
| 6349 | |||
| 6350 | if (u.indexOf('/') != 0 && u.indexOf('://') == -1) | ||
| 6351 | u = tinymce.baseURL + '/' + u; | ||
| 6352 | |||
| 6353 | t.urls[n] = u.substring(0, u.lastIndexOf('/')); | ||
| 6354 | tinymce.ScriptLoader.add(u, cb, s); | ||
| 6355 | } | ||
| 6356 | |||
| 6357 | }); | ||
| 6358 | |||
| 6359 | // Create plugin and theme managers | ||
| 6360 | tinymce.PluginManager = new tinymce.AddOnManager(); | ||
| 6361 | tinymce.ThemeManager = new tinymce.AddOnManager(); | ||
| 6362 | }()); | ||
| 6363 | /* file:jscripts/tiny_mce/classes/EditorManager.js */ | ||
| 6364 | |||
| 6365 | (function() { | ||
| 6366 | // Shorten names | ||
| 6367 | var each = tinymce.each, extend = tinymce.extend, DOM = tinymce.DOM, Event = tinymce.dom.Event, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, explode = tinymce.explode; | ||
| 6368 | |||
| 6369 | tinymce.create('static tinymce.EditorManager', { | ||
| 6370 | editors : {}, | ||
| 6371 | i18n : {}, | ||
| 6372 | activeEditor : null, | ||
| 6373 | |||
| 6374 | preInit : function() { | ||
| 6375 | var t = this, lo = window.location; | ||
| 6376 | |||
| 6377 | // Setup some URLs where the editor API is located and where the document is | ||
| 6378 | tinymce.documentBaseURL = lo.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); | ||
| 6379 | if (!/[\/\\]$/.test(tinymce.documentBaseURL)) | ||
| 6380 | tinymce.documentBaseURL += '/'; | ||
| 6381 | |||
| 6382 | tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL); | ||
| 6383 | tinymce.EditorManager.baseURI = new tinymce.util.URI(tinymce.baseURL); | ||
| 6384 | |||
| 6385 | // User already specified a document.domain value | ||
| 6386 | if (document.domain && lo.hostname != document.domain) | ||
| 6387 | tinymce.relaxedDomain = document.domain; | ||
| 6388 | |||
| 6389 | // Setup document domain if tinymce is loaded from other domain | ||
| 6390 | if (!tinymce.relaxedDomain && tinymce.EditorManager.baseURI.host != lo.hostname && lo.hostname) | ||
| 6391 | document.domain = tinymce.relaxedDomain = lo.hostname.replace(/.*\.(.+\..+)$/, '$1'); | ||
| 6392 | |||
| 6393 | // Add before unload listener | ||
| 6394 | // This was required since IE was leaking memory if you added and removed beforeunload listeners | ||
| 6395 | // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event | ||
| 6396 | t.onBeforeUnload = new tinymce.util.Dispatcher(t); | ||
| 6397 | |||
| 6398 | // Must be on window or IE will leak if the editor is placed in frame or iframe | ||
| 6399 | Event.add(window, 'beforeunload', function(e) { | ||
| 6400 | t.onBeforeUnload.dispatch(t, e); | ||
| 6401 | }); | ||
| 6402 | }, | ||
| 6403 | |||
| 6404 | init : function(s) { | ||
| 6405 | var t = this, pl, sl = tinymce.ScriptLoader, c, e, el = [], ed; | ||
| 6406 | |||
| 6407 | function execCallback(se, n, s) { | ||
| 6408 | var f = se[n]; | ||
| 6409 | |||
| 6410 | if (!f) | ||
| 6411 | return; | ||
| 6412 | |||
| 6413 | if (tinymce.is(f, 'string')) { | ||
| 6414 | s = f.replace(/\.\w+$/, ''); | ||
| 6415 | s = s ? tinymce.resolve(s) : 0; | ||
| 6416 | f = tinymce.resolve(f); | ||
| 6417 | } | ||
| 6418 | |||
| 6419 | return f.apply(s || this, Array.prototype.slice.call(arguments, 2)); | ||
| 6420 | }; | ||
| 6421 | |||
| 6422 | s = extend({ | ||
| 6423 | theme : "simple", | ||
| 6424 | language : "en", | ||
| 6425 | strict_loading_mode : document.contentType == 'application/xhtml+xml' | ||
| 6426 | }, s); | ||
| 6427 | |||
| 6428 | t.settings = s; | ||
| 6429 | |||
| 6430 | // If page not loaded and strict mode isn't enabled then load them | ||
| 6431 | if (!Event.domLoaded && !s.strict_loading_mode) { | ||
| 6432 | // Load language | ||
| 6433 | if (s.language) | ||
| 6434 | sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); | ||
| 6435 | |||
| 6436 | // Load theme | ||
| 6437 | if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) | ||
| 6438 | ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); | ||
| 6439 | |||
| 6440 | // Load plugins | ||
| 6441 | if (s.plugins) { | ||
| 6442 | pl = explode(s.plugins); | ||
| 6443 | |||
| 6444 | // Load compat2x first | ||
| 6445 | if (tinymce.inArray(pl, 'compat2x') != -1) | ||
| 6446 | PluginManager.load('compat2x', 'plugins/compat2x/editor_plugin' + tinymce.suffix + '.js'); | ||
| 6447 | |||
| 6448 | // Load rest if plugins | ||
| 6449 | each(pl, function(v) { | ||
| 6450 | if (v && v.charAt(0) != '-' && !PluginManager.urls[v]) { | ||
| 6451 | // Skip safari plugin for other browsers | ||
| 6452 | if (!tinymce.isWebKit && v == 'safari') | ||
| 6453 | return; | ||
| 6454 | |||
| 6455 | PluginManager.load(v, 'plugins/' + v + '/editor_plugin' + tinymce.suffix + '.js'); | ||
| 6456 | } | ||
| 6457 | }); | ||
| 6458 | } | ||
| 6459 | |||
| 6460 | sl.loadQueue(); | ||
| 6461 | } | ||
| 6462 | |||
| 6463 | // Legacy call | ||
| 6464 | Event.add(document, 'init', function() { | ||
| 6465 | var l, co; | ||
| 6466 | |||
| 6467 | execCallback(s, 'onpageload'); | ||
| 6468 | |||
| 6469 | // Verify that it's a valid browser | ||
| 6470 | if (s.browsers) { | ||
| 6471 | l = false; | ||
| 6472 | |||
| 6473 | each(explode(s.browsers), function(v) { | ||
| 6474 | switch (v) { | ||
| 6475 | case 'ie': | ||
| 6476 | case 'msie': | ||
| 6477 | if (tinymce.isIE) | ||
| 6478 | l = true; | ||
| 6479 | break; | ||
| 6480 | |||
| 6481 | case 'gecko': | ||
| 6482 | if (tinymce.isGecko) | ||
| 6483 | l = true; | ||
| 6484 | break; | ||
| 6485 | |||
| 6486 | case 'safari': | ||
| 6487 | case 'webkit': | ||
| 6488 | if (tinymce.isWebKit) | ||
| 6489 | l = true; | ||
| 6490 | break; | ||
| 6491 | |||
| 6492 | case 'opera': | ||
| 6493 | if (tinymce.isOpera) | ||
| 6494 | l = true; | ||
| 6495 | |||
| 6496 | break; | ||
| 6497 | } | ||
| 6498 | }); | ||
| 6499 | |||
| 6500 | // Not a valid one | ||
| 6501 | if (!l) | ||
| 6502 | return; | ||
| 6503 | } | ||
| 6504 | |||
| 6505 | switch (s.mode) { | ||
| 6506 | case "exact": | ||
| 6507 | l = s.elements || ''; | ||
| 6508 | |||
| 6509 | if(l.length > 0) { | ||
| 6510 | each(explode(l), function(v) { | ||
| 6511 | if (DOM.get(v)) { | ||
| 6512 | ed = new tinymce.Editor(v, s); | ||
| 6513 | el.push(ed); | ||
| 6514 | ed.render(1); | ||
| 6515 | } else { | ||
| 6516 | c = 0; | ||
| 6517 | |||
| 6518 | each(document.forms, function(f) { | ||
| 6519 | each(f.elements, function(e) { | ||
| 6520 | if (e.name === v) { | ||
| 6521 | v = 'mce_editor_' + c; | ||
| 6522 | DOM.setAttrib(e, 'id', v); | ||
| 6523 | |||
| 6524 | ed = new tinymce.Editor(v, s); | ||
| 6525 | el.push(ed); | ||
| 6526 | ed.render(1); | ||
| 6527 | } | ||
| 6528 | }); | ||
| 6529 | }); | ||
| 6530 | } | ||
| 6531 | }); | ||
| 6532 | } | ||
| 6533 | break; | ||
| 6534 | |||
| 6535 | case "textareas": | ||
| 6536 | case "specific_textareas": | ||
| 6537 | function hasClass(n, c) { | ||
| 6538 | return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c); | ||
| 6539 | }; | ||
| 6540 | |||
| 6541 | each(DOM.select('textarea'), function(v) { | ||
| 6542 | if (s.editor_deselector && hasClass(v, s.editor_deselector)) | ||
| 6543 | return; | ||
| 6544 | |||
| 6545 | if (!s.editor_selector || hasClass(v, s.editor_selector)) { | ||
| 6546 | // Can we use the name | ||
| 6547 | e = DOM.get(v.name); | ||
| 6548 | if (!v.id && !e) | ||
| 6549 | v.id = v.name; | ||
| 6550 | |||
| 6551 | // Generate unique name if missing or already exists | ||
| 6552 | if (!v.id || t.get(v.id)) | ||
| 6553 | v.id = DOM.uniqueId(); | ||
| 6554 | |||
| 6555 | ed = new tinymce.Editor(v.id, s); | ||
| 6556 | el.push(ed); | ||
| 6557 | ed.render(1); | ||
| 6558 | } | ||
| 6559 | }); | ||
| 6560 | break; | ||
| 6561 | } | ||
| 6562 | |||
| 6563 | // Call onInit when all editors are initialized | ||
| 6564 | if (s.oninit) { | ||
| 6565 | l = co = 0; | ||
| 6566 | |||
| 6567 | each (el, function(ed) { | ||
| 6568 | co++; | ||
| 6569 | |||
| 6570 | if (!ed.initialized) { | ||
| 6571 | // Wait for it | ||
| 6572 | ed.onInit.add(function() { | ||
| 6573 | l++; | ||
| 6574 | |||
| 6575 | // All done | ||
| 6576 | if (l == co) | ||
| 6577 | execCallback(s, 'oninit'); | ||
| 6578 | }); | ||
| 6579 | } else | ||
| 6580 | l++; | ||
| 6581 | |||
| 6582 | // All done | ||
| 6583 | if (l == co) | ||
| 6584 | execCallback(s, 'oninit'); | ||
| 6585 | }); | ||
| 6586 | } | ||
| 6587 | }); | ||
| 6588 | }, | ||
| 6589 | |||
| 6590 | get : function(id) { | ||
| 6591 | return this.editors[id]; | ||
| 6592 | }, | ||
| 6593 | |||
| 6594 | getInstanceById : function(id) { | ||
| 6595 | return this.get(id); | ||
| 6596 | }, | ||
| 6597 | |||
| 6598 | add : function(e) { | ||
| 6599 | this.editors[e.id] = e; | ||
| 6600 | this._setActive(e); | ||
| 6601 | |||
| 6602 | return e; | ||
| 6603 | }, | ||
| 6604 | |||
| 6605 | remove : function(e) { | ||
| 6606 | var t = this; | ||
| 6607 | |||
| 6608 | // Not in the collection | ||
| 6609 | if (!t.editors[e.id]) | ||
| 6610 | return null; | ||
| 6611 | |||
| 6612 | delete t.editors[e.id]; | ||
| 6613 | |||
| 6614 | // Select another editor since the active one was removed | ||
| 6615 | if (t.activeEditor == e) { | ||
| 6616 | each(t.editors, function(e) { | ||
| 6617 | t._setActive(e); | ||
| 6618 | return false; // Break | ||
| 6619 | }); | ||
| 6620 | } | ||
| 6621 | |||
| 6622 | e.destroy(); | ||
| 6623 | |||
| 6624 | return e; | ||
| 6625 | }, | ||
| 6626 | |||
| 6627 | execCommand : function(c, u, v) { | ||
| 6628 | var t = this, ed = t.get(v), w; | ||
| 6629 | |||
| 6630 | // Manager commands | ||
| 6631 | switch (c) { | ||
| 6632 | case "mceFocus": | ||
| 6633 | ed.focus(); | ||
| 6634 | return true; | ||
| 6635 | |||
| 6636 | case "mceAddEditor": | ||
| 6637 | case "mceAddControl": | ||
| 6638 | if (!t.get(v)) | ||
| 6639 | new tinymce.Editor(v, t.settings).render(); | ||
| 6640 | |||
| 6641 | return true; | ||
| 6642 | |||
| 6643 | case "mceAddFrameControl": | ||
| 6644 | w = v.window; | ||
| 6645 | |||
| 6646 | // Add tinyMCE global instance and tinymce namespace to specified window | ||
| 6647 | w.tinyMCE = tinyMCE; | ||
| 6648 | w.tinymce = tinymce; | ||
| 6649 | |||
| 6650 | tinymce.DOM.doc = w.document; | ||
| 6651 | tinymce.DOM.win = w; | ||
| 6652 | |||
| 6653 | ed = new tinymce.Editor(v.element_id, v); | ||
| 6654 | ed.render(); | ||
| 6655 | |||
| 6656 | // Fix IE memory leaks | ||
| 6657 | if (tinymce.isIE) { | ||
| 6658 | function clr() { | ||
| 6659 | ed.destroy(); | ||
| 6660 | w.detachEvent('onunload', clr); | ||
| 6661 | w = w.tinyMCE = w.tinymce = null; // IE leak | ||
| 6662 | }; | ||
| 6663 | |||
| 6664 | w.attachEvent('onunload', clr); | ||
| 6665 | } | ||
| 6666 | |||
| 6667 | v.page_window = null; | ||
| 6668 | |||
| 6669 | return true; | ||
| 6670 | |||
| 6671 | case "mceRemoveEditor": | ||
| 6672 | case "mceRemoveControl": | ||
| 6673 | if (ed) | ||
| 6674 | ed.remove(); | ||
| 6675 | |||
| 6676 | return true; | ||
| 6677 | |||
| 6678 | case 'mceToggleEditor': | ||
| 6679 | if (!ed) { | ||
| 6680 | t.execCommand('mceAddControl', 0, v); | ||
| 6681 | return true; | ||
| 6682 | } | ||
| 6683 | |||
| 6684 | if (ed.isHidden()) | ||
| 6685 | ed.show(); | ||
| 6686 | else | ||
| 6687 | ed.hide(); | ||
| 6688 | |||
| 6689 | return true; | ||
| 6690 | } | ||
| 6691 | |||
| 6692 | // Run command on active editor | ||
| 6693 | if (t.activeEditor) | ||
| 6694 | return t.activeEditor.execCommand(c, u, v); | ||
| 6695 | |||
| 6696 | return false; | ||
| 6697 | }, | ||
| 6698 | |||
| 6699 | execInstanceCommand : function(id, c, u, v) { | ||
| 6700 | var ed = this.get(id); | ||
| 6701 | |||
| 6702 | if (ed) | ||
| 6703 | return ed.execCommand(c, u, v); | ||
| 6704 | |||
| 6705 | return false; | ||
| 6706 | }, | ||
| 6707 | |||
| 6708 | triggerSave : function() { | ||
| 6709 | each(this.editors, function(e) { | ||
| 6710 | e.save(); | ||
| 6711 | }); | ||
| 6712 | }, | ||
| 6713 | |||
| 6714 | addI18n : function(p, o) { | ||
| 6715 | var lo, i18n = this.i18n; | ||
| 6716 | |||
| 6717 | if (!tinymce.is(p, 'string')) { | ||
| 6718 | each(p, function(o, lc) { | ||
| 6719 | each(o, function(o, g) { | ||
| 6720 | each(o, function(o, k) { | ||
| 6721 | if (g === 'common') | ||
| 6722 | i18n[lc + '.' + k] = o; | ||
| 6723 | else | ||
| 6724 | i18n[lc + '.' + g + '.' + k] = o; | ||
| 6725 | }); | ||
| 6726 | }); | ||
| 6727 | }); | ||
| 6728 | } else { | ||
| 6729 | each(o, function(o, k) { | ||
| 6730 | i18n[p + '.' + k] = o; | ||
| 6731 | }); | ||
| 6732 | } | ||
| 6733 | }, | ||
| 6734 | |||
| 6735 | // Private methods | ||
| 6736 | |||
| 6737 | _setActive : function(e) { | ||
| 6738 | this.selectedInstance = this.activeEditor = e; | ||
| 6739 | } | ||
| 6740 | |||
| 6741 | }); | ||
| 6742 | |||
| 6743 | tinymce.EditorManager.preInit(); | ||
| 6744 | })(); | ||
| 6745 | |||
| 6746 | // Short for editor manager window.tinyMCE is needed when TinyMCE gets loaded though a XHR call | ||
| 6747 | var tinyMCE = window.tinyMCE = tinymce.EditorManager; | ||
| 6748 | |||
| 6749 | /* file:jscripts/tiny_mce/classes/Editor.js */ | ||
| 6750 | |||
| 6751 | (function() { | ||
| 6752 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, Dispatcher = tinymce.util.Dispatcher; | ||
| 6753 | var each = tinymce.each, isGecko = tinymce.isGecko, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit; | ||
| 6754 | var is = tinymce.is, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, EditorManager = tinymce.EditorManager; | ||
| 6755 | var inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode; | ||
| 6756 | |||
| 6757 | tinymce.create('tinymce.Editor', { | ||
| 6758 | Editor : function(id, s) { | ||
| 6759 | var t = this; | ||
| 6760 | |||
| 6761 | t.id = t.editorId = id; | ||
| 6762 | t.execCommands = {}; | ||
| 6763 | t.queryStateCommands = {}; | ||
| 6764 | t.queryValueCommands = {}; | ||
| 6765 | t.plugins = {}; | ||
| 6766 | |||
| 6767 | // Add events to the editor | ||
| 6768 | each([ | ||
| 6769 | 'onPreInit', | ||
| 6770 | 'onBeforeRenderUI', | ||
| 6771 | 'onPostRender', | ||
| 6772 | 'onInit', | ||
| 6773 | 'onRemove', | ||
| 6774 | 'onActivate', | ||
| 6775 | 'onDeactivate', | ||
| 6776 | 'onClick', | ||
| 6777 | 'onEvent', | ||
| 6778 | 'onMouseUp', | ||
| 6779 | 'onMouseDown', | ||
| 6780 | 'onDblClick', | ||
| 6781 | 'onKeyDown', | ||
| 6782 | 'onKeyUp', | ||
| 6783 | 'onKeyPress', | ||
| 6784 | 'onContextMenu', | ||
| 6785 | 'onSubmit', | ||
| 6786 | 'onReset', | ||
| 6787 | 'onPaste', | ||
| 6788 | 'onPreProcess', | ||
| 6789 | 'onPostProcess', | ||
| 6790 | 'onBeforeSetContent', | ||
| 6791 | 'onBeforeGetContent', | ||
| 6792 | 'onSetContent', | ||
| 6793 | 'onGetContent', | ||
| 6794 | 'onLoadContent', | ||
| 6795 | 'onSaveContent', | ||
| 6796 | 'onNodeChange', | ||
| 6797 | 'onChange', | ||
| 6798 | 'onBeforeExecCommand', | ||
| 6799 | 'onExecCommand', | ||
| 6800 | 'onUndo', | ||
| 6801 | 'onRedo', | ||
| 6802 | 'onVisualAid', | ||
| 6803 | 'onSetProgressState' | ||
| 6804 | ], function(e) { | ||
| 6805 | t[e] = new Dispatcher(t); | ||
| 6806 | }); | ||
| 6807 | |||
| 6808 | // Default editor config | ||
| 6809 | t.settings = s = extend({ | ||
| 6810 | id : id, | ||
| 6811 | language : 'en', | ||
| 6812 | docs_language : 'en', | ||
| 6813 | theme : 'simple', | ||
| 6814 | skin : 'default', | ||
| 6815 | delta_width : 0, | ||
| 6816 | delta_height : 0, | ||
| 6817 | popup_css : '', | ||
| 6818 | plugins : '', | ||
| 6819 | document_base_url : tinymce.documentBaseURL, | ||
| 6820 | add_form_submit_trigger : 1, | ||
| 6821 | submit_patch : 1, | ||
| 6822 | add_unload_trigger : 1, | ||
| 6823 | convert_urls : 1, | ||
| 6824 | relative_urls : 1, | ||
| 6825 | remove_script_host : 1, | ||
| 6826 | table_inline_editing : 0, | ||
| 6827 | object_resizing : 1, | ||
| 6828 | cleanup : 1, | ||
| 6829 | accessibility_focus : 1, | ||
| 6830 | custom_shortcuts : 1, | ||
| 6831 | custom_undo_redo_keyboard_shortcuts : 1, | ||
| 6832 | custom_undo_redo_restore_selection : 1, | ||
| 6833 | custom_undo_redo : 1, | ||
| 6834 | doctype : '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', | ||
| 6835 | visual_table_class : 'mceItemTable', | ||
| 6836 | visual : 1, | ||
| 6837 | inline_styles : true, | ||
| 6838 | convert_fonts_to_spans : true, | ||
| 6839 | font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large', | ||
| 6840 | apply_source_formatting : 1, | ||
| 6841 | directionality : 'ltr', | ||
| 6842 | forced_root_block : 'p', | ||
| 6843 | valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big', | ||
| 6844 | hidden_input : 1, | ||
| 6845 | padd_empty_editor : 1, | ||
| 6846 | render_ui : 1, | ||
| 6847 | init_theme : 1, | ||
| 6848 | force_p_newlines : 1, | ||
| 6849 | indentation : '30px', | ||
| 6850 | keep_styles : 1 | ||
| 6851 | }, s); | ||
| 6852 | |||
| 6853 | // Setup URIs | ||
| 6854 | t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, { | ||
| 6855 | base_uri : tinyMCE.baseURI | ||
| 6856 | }); | ||
| 6857 | t.baseURI = EditorManager.baseURI; | ||
| 6858 | |||
| 6859 | // Call setup | ||
| 6860 | t.execCallback('setup', t); | ||
| 6861 | }, | ||
| 6862 | |||
| 6863 | render : function(nst) { | ||
| 6864 | var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader; | ||
| 6865 | |||
| 6866 | // Page is not loaded yet, wait for it | ||
| 6867 | if (!Event.domLoaded) { | ||
| 6868 | Event.add(document, 'init', function() { | ||
| 6869 | t.render(); | ||
| 6870 | }); | ||
| 6871 | return; | ||
| 6872 | } | ||
| 6873 | |||
| 6874 | // Force strict loading mode if render us called by user and not internally | ||
| 6875 | if (!nst) { | ||
| 6876 | s.strict_loading_mode = 1; | ||
| 6877 | tinyMCE.settings = s; | ||
| 6878 | } | ||
| 6879 | |||
| 6880 | // Element not found, then skip initialization | ||
| 6881 | if (!t.getElement()) | ||
| 6882 | return; | ||
| 6883 | |||
| 6884 | if (s.strict_loading_mode) { | ||
| 6885 | sl.settings.strict_mode = s.strict_loading_mode; | ||
| 6886 | tinymce.DOM.settings.strict = 1; | ||
| 6887 | } | ||
| 6888 | |||
| 6889 | // Add hidden input for non input elements inside form elements | ||
| 6890 | if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form')) | ||
| 6891 | DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id); | ||
| 6892 | |||
| 6893 | t.windowManager = new tinymce.WindowManager(t); | ||
| 6894 | |||
| 6895 | if (s.encoding == 'xml') { | ||
| 6896 | t.onGetContent.add(function(ed, o) { | ||
| 6897 | if (o.save) | ||
| 6898 | o.content = DOM.encode(o.content); | ||
| 6899 | }); | ||
| 6900 | } | ||
| 6901 | |||
| 6902 | if (s.add_form_submit_trigger) { | ||
| 6903 | t.onSubmit.addToTop(function() { | ||
| 6904 | if (t.initialized) { | ||
| 6905 | t.save(); | ||
| 6906 | t.isNotDirty = 1; | ||
| 6907 | } | ||
| 6908 | }); | ||
| 6909 | } | ||
| 6910 | |||
| 6911 | if (s.add_unload_trigger && !s.ask) { | ||
| 6912 | t._beforeUnload = tinyMCE.onBeforeUnload.add(function() { | ||
| 6913 | if (t.initialized && !t.destroyed && !t.isHidden()) | ||
| 6914 | t.save({format : 'raw', no_events : true}); | ||
| 6915 | }); | ||
| 6916 | } | ||
| 6917 | |||
| 6918 | tinymce.addUnload(t.destroy, t); | ||
| 6919 | |||
| 6920 | if (s.submit_patch) { | ||
| 6921 | t.onBeforeRenderUI.add(function() { | ||
| 6922 | var n = t.getElement().form; | ||
| 6923 | |||
| 6924 | if (!n) | ||
| 6925 | return; | ||
| 6926 | |||
| 6927 | // Already patched | ||
| 6928 | if (n._mceOldSubmit) | ||
| 6929 | return; | ||
| 6930 | |||
| 6931 | // Check page uses id="submit" or name="submit" for it's submit button | ||
| 6932 | if (!n.submit.nodeType && !n.submit.length) { | ||
| 6933 | t.formElement = n; | ||
| 6934 | n._mceOldSubmit = n.submit; | ||
| 6935 | n.submit = function() { | ||
| 6936 | // Save all instances | ||
| 6937 | EditorManager.triggerSave(); | ||
| 6938 | t.isNotDirty = 1; | ||
| 6939 | |||
| 6940 | return this._mceOldSubmit(this); | ||
| 6941 | }; | ||
| 6942 | } | ||
| 6943 | |||
| 6944 | n = null; | ||
| 6945 | }); | ||
| 6946 | } | ||
| 6947 | |||
| 6948 | // Load scripts | ||
| 6949 | function loadScripts() { | ||
| 6950 | if (s.language) | ||
| 6951 | sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); | ||
| 6952 | |||
| 6953 | if (s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) | ||
| 6954 | ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); | ||
| 6955 | |||
| 6956 | each(explode(s.plugins), function(p) { | ||
| 6957 | if (p && p.charAt(0) != '-' && !PluginManager.urls[p]) { | ||
| 6958 | // Skip safari plugin for other browsers | ||
| 6959 | if (!isWebKit && p == 'safari') | ||
| 6960 | return; | ||
| 6961 | |||
| 6962 | PluginManager.load(p, 'plugins/' + p + '/editor_plugin' + tinymce.suffix + '.js'); | ||
| 6963 | } | ||
| 6964 | }); | ||
| 6965 | |||
| 6966 | // Init when que is loaded | ||
| 6967 | sl.loadQueue(function() { | ||
| 6968 | if (s.ask) { | ||
| 6969 | function ask() { | ||
| 6970 | // Yield for awhile to avoid focus bug on FF 3 when cancel is pressed | ||
| 6971 | window.setTimeout(function() { | ||
| 6972 | Event.remove(t.id, 'focus', ask); | ||
| 6973 | |||
| 6974 | t.windowManager.confirm(t.getLang('edit_confirm'), function(s) { | ||
| 6975 | if (s) | ||
| 6976 | t.init(); | ||
| 6977 | }); | ||
| 6978 | }, 0); | ||
| 6979 | }; | ||
| 6980 | |||
| 6981 | Event.add(t.id, 'focus', ask); | ||
| 6982 | return; | ||
| 6983 | } | ||
| 6984 | |||
| 6985 | if (!t.removed) | ||
| 6986 | t.init(); | ||
| 6987 | }); | ||
| 6988 | }; | ||
| 6989 | |||
| 6990 | // Load compat2x first | ||
| 6991 | if (s.plugins.indexOf('compat2x') != -1) { | ||
| 6992 | PluginManager.load('compat2x', 'plugins/compat2x/editor_plugin' + tinymce.suffix + '.js'); | ||
| 6993 | sl.loadQueue(loadScripts); | ||
| 6994 | } else | ||
| 6995 | loadScripts(); | ||
| 6996 | }, | ||
| 6997 | |||
| 6998 | init : function() { | ||
| 6999 | var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re; | ||
| 7000 | |||
| 7001 | EditorManager.add(t); | ||
| 7002 | |||
| 7003 | // Create theme | ||
| 7004 | s.theme = s.theme.replace(/-/, ''); | ||
| 7005 | o = ThemeManager.get(s.theme); | ||
| 7006 | t.theme = new o(); | ||
| 7007 | |||
| 7008 | if (t.theme.init && s.init_theme) | ||
| 7009 | t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); | ||
| 7010 | |||
| 7011 | // Create all plugins | ||
| 7012 | each(explode(s.plugins.replace(/\-/g, '')), function(p) { | ||
| 7013 | var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po; | ||
| 7014 | |||
| 7015 | if (c) { | ||
| 7016 | po = new c(t, u); | ||
| 7017 | |||
| 7018 | t.plugins[p] = po; | ||
| 7019 | |||
| 7020 | if (po.init) | ||
| 7021 | po.init(t, u); | ||
| 7022 | } | ||
| 7023 | }); | ||
| 7024 | |||
| 7025 | // Setup popup CSS path(s) | ||
| 7026 | if (s.popup_css !== false) { | ||
| 7027 | if (s.popup_css) | ||
| 7028 | s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css); | ||
| 7029 | else | ||
| 7030 | s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css"); | ||
| 7031 | } | ||
| 7032 | |||
| 7033 | if (s.popup_css_add) | ||
| 7034 | s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add); | ||
| 7035 | |||
| 7036 | // Setup control factory | ||
| 7037 | t.controlManager = new tinymce.ControlManager(t); | ||
| 7038 | t.undoManager = new tinymce.UndoManager(t); | ||
| 7039 | |||
| 7040 | // Pass through | ||
| 7041 | t.undoManager.onAdd.add(function(um, l) { | ||
| 7042 | if (!l.initial) | ||
| 7043 | return t.onChange.dispatch(t, l, um); | ||
| 7044 | }); | ||
| 7045 | |||
| 7046 | t.undoManager.onUndo.add(function(um, l) { | ||
| 7047 | return t.onUndo.dispatch(t, l, um); | ||
| 7048 | }); | ||
| 7049 | |||
| 7050 | t.undoManager.onRedo.add(function(um, l) { | ||
| 7051 | return t.onRedo.dispatch(t, l, um); | ||
| 7052 | }); | ||
| 7053 | |||
| 7054 | if (s.custom_undo_redo) { | ||
| 7055 | t.onExecCommand.add(function(ed, cmd, ui, val, a) { | ||
| 7056 | if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) | ||
| 7057 | t.undoManager.add(); | ||
| 7058 | }); | ||
| 7059 | } | ||
| 7060 | |||
| 7061 | t.onExecCommand.add(function(ed, c) { | ||
| 7062 | // Don't refresh the select lists until caret move | ||
| 7063 | if (!/^(FontName|FontSize)$/.test(c)) | ||
| 7064 | t.nodeChanged(); | ||
| 7065 | }); | ||
| 7066 | |||
| 7067 | // Remove ghost selections on images and tables in Gecko | ||
| 7068 | if (isGecko) { | ||
| 7069 | function repaint(a, o) { | ||
| 7070 | if (!o || !o.initial) | ||
| 7071 | t.execCommand('mceRepaint'); | ||
| 7072 | }; | ||
| 7073 | |||
| 7074 | t.onUndo.add(repaint); | ||
| 7075 | t.onRedo.add(repaint); | ||
| 7076 | t.onSetContent.add(repaint); | ||
| 7077 | } | ||
| 7078 | |||
| 7079 | // Enables users to override the control factory | ||
| 7080 | t.onBeforeRenderUI.dispatch(t, t.controlManager); | ||
| 7081 | |||
| 7082 | // Measure box | ||
| 7083 | if (s.render_ui) { | ||
| 7084 | w = s.width || e.style.width || e.offsetWidth; | ||
| 7085 | h = s.height || e.style.height || e.offsetHeight; | ||
| 7086 | t.orgDisplay = e.style.display; | ||
| 7087 | re = /^[0-9\.]+(|px)$/i; | ||
| 7088 | |||
| 7089 | if (re.test('' + w)) | ||
| 7090 | w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100); | ||
| 7091 | |||
| 7092 | if (re.test('' + h)) | ||
| 7093 | h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100); | ||
| 7094 | |||
| 7095 | // Render UI | ||
| 7096 | o = t.theme.renderUI({ | ||
| 7097 | targetNode : e, | ||
| 7098 | width : w, | ||
| 7099 | height : h, | ||
| 7100 | deltaWidth : s.delta_width, | ||
| 7101 | deltaHeight : s.delta_height | ||
| 7102 | }); | ||
| 7103 | |||
| 7104 | t.editorContainer = o.editorContainer; | ||
| 7105 | } | ||
| 7106 | |||
| 7107 | |||
| 7108 | // Resize editor | ||
| 7109 | DOM.setStyles(o.sizeContainer || o.editorContainer, { | ||
| 7110 | width : w, | ||
| 7111 | height : h | ||
| 7112 | }); | ||
| 7113 | |||
| 7114 | h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); | ||
| 7115 | if (h < 100) | ||
| 7116 | h = 100; | ||
| 7117 | |||
| 7118 | t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="' + t.documentBaseURI.getURI() + '" />'; | ||
| 7119 | t.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; | ||
| 7120 | |||
| 7121 | if (tinymce.relaxedDomain) | ||
| 7122 | t.iframeHTML += '<script type="text/javascript">document.domain = "' + tinymce.relaxedDomain + '";</script>'; | ||
| 7123 | |||
| 7124 | bi = s.body_id || 'tinymce'; | ||
| 7125 | if (bi.indexOf('=') != -1) { | ||
| 7126 | bi = t.getParam('body_id', '', 'hash'); | ||
| 7127 | bi = bi[t.id] || bi; | ||
| 7128 | } | ||
| 7129 | |||
| 7130 | bc = s.body_class || ''; | ||
| 7131 | if (bc.indexOf('=') != -1) { | ||
| 7132 | bc = t.getParam('body_class', '', 'hash'); | ||
| 7133 | bc = bc[t.id] || ''; | ||
| 7134 | } | ||
| 7135 | |||
| 7136 | t.iframeHTML += '</head><body id="' + bi + '" class="mceContentBody ' + bc + '"></body></html>'; | ||
| 7137 | |||
| 7138 | // Domain relaxing enabled, then set document domain | ||
| 7139 | if (tinymce.relaxedDomain) { | ||
| 7140 | // We need to write the contents here in IE since multiple writes messes up refresh button and back button | ||
| 7141 | if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5)) | ||
| 7142 | u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; | ||
| 7143 | else if (tinymce.isOpera) | ||
| 7144 | u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()'; | ||
| 7145 | } | ||
| 7146 | |||
| 7147 | // Create iframe | ||
| 7148 | n = DOM.add(o.iframeContainer, 'iframe', { | ||
| 7149 | id : t.id + "_ifr", | ||
| 7150 | src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 | ||
| 7151 | frameBorder : '0', | ||
| 7152 | style : { | ||
| 7153 | width : '100%', | ||
| 7154 | height : h | ||
| 7155 | } | ||
| 7156 | }); | ||
| 7157 | |||
| 7158 | t.contentAreaContainer = o.iframeContainer; | ||
| 7159 | DOM.get(o.editorContainer).style.display = t.orgDisplay; | ||
| 7160 | DOM.get(t.id).style.display = 'none'; | ||
| 7161 | |||
| 7162 | // Safari 2.x requires us to wait for the load event and load a real HTML doc | ||
| 7163 | if (tinymce.isOldWebKit) { | ||
| 7164 | Event.add(n, 'load', t.setupIframe, t); | ||
| 7165 | n.src = tinymce.baseURL + '/plugins/safari/blank.htm'; | ||
| 7166 | } else { | ||
| 7167 | if (!isIE || !tinymce.relaxedDomain) | ||
| 7168 | t.setupIframe(); | ||
| 7169 | |||
| 7170 | e = n = o = null; // Cleanup | ||
| 7171 | } | ||
| 7172 | }, | ||
| 7173 | |||
| 7174 | setupIframe : function() { | ||
| 7175 | var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b; | ||
| 7176 | |||
| 7177 | // Setup iframe body | ||
| 7178 | if (!isIE || !tinymce.relaxedDomain) { | ||
| 7179 | d.open(); | ||
| 7180 | d.write(t.iframeHTML); | ||
| 7181 | d.close(); | ||
| 7182 | } | ||
| 7183 | |||
| 7184 | // Design mode needs to be added here Ctrl+A will fail otherwise | ||
| 7185 | if (!isIE) { | ||
| 7186 | try { | ||
| 7187 | if (!s.readonly) | ||
| 7188 | d.designMode = 'On'; | ||
| 7189 | } catch (ex) { | ||
| 7190 | // Will fail on Gecko if the editor is placed in an hidden container element | ||
| 7191 | // The design mode will be set ones the editor is focused | ||
| 7192 | } | ||
| 7193 | } | ||
| 7194 | |||
| 7195 | // IE needs to use contentEditable or it will display non secure items for HTTPS | ||
| 7196 | if (isIE) { | ||
| 7197 | // It will not steal focus if we hide it while setting contentEditable | ||
| 7198 | b = t.getBody(); | ||
| 7199 | DOM.hide(b); | ||
| 7200 | |||
| 7201 | if (!s.readonly) | ||
| 7202 | b.contentEditable = true; | ||
| 7203 | |||
| 7204 | DOM.show(b); | ||
| 7205 | } | ||
| 7206 | |||
| 7207 | // Setup objects | ||
| 7208 | t.dom = new tinymce.DOM.DOMUtils(t.getDoc(), { | ||
| 7209 | keep_values : true, | ||
| 7210 | url_converter : t.convertURL, | ||
| 7211 | url_converter_scope : t, | ||
| 7212 | hex_colors : s.force_hex_style_colors, | ||
| 7213 | class_filter : s.class_filter, | ||
| 7214 | update_styles : 1, | ||
| 7215 | fix_ie_paragraphs : 1 | ||
| 7216 | }); | ||
| 7217 | |||
| 7218 | t.serializer = new tinymce.dom.Serializer({ | ||
| 7219 | entity_encoding : s.entity_encoding, | ||
| 7220 | entities : s.entities, | ||
| 7221 | valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements, | ||
| 7222 | extended_valid_elements : s.extended_valid_elements, | ||
| 7223 | valid_child_elements : s.valid_child_elements, | ||
| 7224 | invalid_elements : s.invalid_elements, | ||
| 7225 | fix_table_elements : s.fix_table_elements, | ||
| 7226 | fix_list_elements : s.fix_list_elements, | ||
| 7227 | fix_content_duplication : s.fix_content_duplication, | ||
| 7228 | convert_fonts_to_spans : s.convert_fonts_to_spans, | ||
| 7229 | font_size_classes : s.font_size_classes, | ||
| 7230 | font_size_style_values : s.font_size_style_values, | ||
| 7231 | apply_source_formatting : s.apply_source_formatting, | ||
| 7232 | remove_linebreaks : s.remove_linebreaks, | ||
| 7233 | element_format : s.element_format, | ||
| 7234 | dom : t.dom | ||
| 7235 | }); | ||
| 7236 | |||
| 7237 | t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); | ||
| 7238 | t.forceBlocks = new tinymce.ForceBlocks(t, { | ||
| 7239 | forced_root_block : s.forced_root_block | ||
| 7240 | }); | ||
| 7241 | t.editorCommands = new tinymce.EditorCommands(t); | ||
| 7242 | |||
| 7243 | // Pass through | ||
| 7244 | t.serializer.onPreProcess.add(function(se, o) { | ||
| 7245 | return t.onPreProcess.dispatch(t, o, se); | ||
| 7246 | }); | ||
| 7247 | |||
| 7248 | t.serializer.onPostProcess.add(function(se, o) { | ||
| 7249 | return t.onPostProcess.dispatch(t, o, se); | ||
| 7250 | }); | ||
| 7251 | |||
| 7252 | t.onPreInit.dispatch(t); | ||
| 7253 | |||
| 7254 | if (!s.gecko_spellcheck) | ||
| 7255 | t.getBody().spellcheck = 0; | ||
| 7256 | |||
| 7257 | if (!s.readonly) | ||
| 7258 | t._addEvents(); | ||
| 7259 | |||
| 7260 | t.controlManager.onPostRender.dispatch(t, t.controlManager); | ||
| 7261 | t.onPostRender.dispatch(t); | ||
| 7262 | |||
| 7263 | if (s.directionality) | ||
| 7264 | t.getBody().dir = s.directionality; | ||
| 7265 | |||
| 7266 | if (s.nowrap) | ||
| 7267 | t.getBody().style.whiteSpace = "nowrap"; | ||
| 7268 | |||
| 7269 | if (s.auto_resize) | ||
| 7270 | t.onNodeChange.add(t.resizeToContent, t); | ||
| 7271 | |||
| 7272 | if (s.custom_elements) { | ||
| 7273 | function handleCustom(ed, o) { | ||
| 7274 | each(explode(s.custom_elements), function(v) { | ||
| 7275 | var n; | ||
| 7276 | |||
| 7277 | if (v.indexOf('~') === 0) { | ||
| 7278 | v = v.substring(1); | ||
| 7279 | n = 'span'; | ||
| 7280 | } else | ||
| 7281 | n = 'div'; | ||
| 7282 | |||
| 7283 | o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' mce_name="$1"$2>'); | ||
| 7284 | o.content = o.content.replace(new RegExp('</(' + v + ')>', 'g'), '</' + n + '>'); | ||
| 7285 | }); | ||
| 7286 | }; | ||
| 7287 | |||
| 7288 | t.onBeforeSetContent.add(handleCustom); | ||
| 7289 | t.onPostProcess.add(function(ed, o) { | ||
| 7290 | if (o.set) | ||
| 7291 | handleCustom(ed, o) | ||
| 7292 | }); | ||
| 7293 | } | ||
| 7294 | |||
| 7295 | if (s.handle_node_change_callback) { | ||
| 7296 | t.onNodeChange.add(function(ed, cm, n) { | ||
| 7297 | t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); | ||
| 7298 | }); | ||
| 7299 | } | ||
| 7300 | |||
| 7301 | if (s.save_callback) { | ||
| 7302 | t.onSaveContent.add(function(ed, o) { | ||
| 7303 | var h = t.execCallback('save_callback', t.id, o.content, t.getBody()); | ||
| 7304 | |||
| 7305 | if (h) | ||
| 7306 | o.content = h; | ||
| 7307 | }); | ||
| 7308 | } | ||
| 7309 | |||
| 7310 | if (s.onchange_callback) { | ||
| 7311 | t.onChange.add(function(ed, l) { | ||
| 7312 | t.execCallback('onchange_callback', t, l); | ||
| 7313 | }); | ||
| 7314 | } | ||
| 7315 | |||
| 7316 | if (s.convert_newlines_to_brs) { | ||
| 7317 | t.onBeforeSetContent.add(function(ed, o) { | ||
| 7318 | if (o.initial) | ||
| 7319 | o.content = o.content.replace(/\r?\n/g, '<br />'); | ||
| 7320 | }); | ||
| 7321 | } | ||
| 7322 | |||
| 7323 | if (s.fix_nesting && isIE) { | ||
| 7324 | t.onBeforeSetContent.add(function(ed, o) { | ||
| 7325 | o.content = t._fixNesting(o.content); | ||
| 7326 | }); | ||
| 7327 | } | ||
| 7328 | |||
| 7329 | if (s.preformatted) { | ||
| 7330 | t.onPostProcess.add(function(ed, o) { | ||
| 7331 | o.content = o.content.replace(/^\s*<pre.*?>/, ''); | ||
| 7332 | o.content = o.content.replace(/<\/pre>\s*$/, ''); | ||
| 7333 | |||
| 7334 | if (o.set) | ||
| 7335 | o.content = '<pre class="mceItemHidden">' + o.content + '</pre>'; | ||
| 7336 | }); | ||
| 7337 | } | ||
| 7338 | |||
| 7339 | if (s.verify_css_classes) { | ||
| 7340 | t.serializer.attribValueFilter = function(n, v) { | ||
| 7341 | var s, cl; | ||
| 7342 | |||
| 7343 | if (n == 'class') { | ||
| 7344 | // Build regexp for classes | ||
| 7345 | if (!t.classesRE) { | ||
| 7346 | cl = t.dom.getClasses(); | ||
| 7347 | |||
| 7348 | if (cl.length > 0) { | ||
| 7349 | s = ''; | ||
| 7350 | |||
| 7351 | each (cl, function(o) { | ||
| 7352 | s += (s ? '|' : '') + o['class']; | ||
| 7353 | }); | ||
| 7354 | |||
| 7355 | t.classesRE = new RegExp('(' + s + ')', 'gi'); | ||
| 7356 | } | ||
| 7357 | } | ||
| 7358 | |||
| 7359 | return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : ''; | ||
| 7360 | } | ||
| 7361 | |||
| 7362 | return v; | ||
| 7363 | }; | ||
| 7364 | } | ||
| 7365 | |||
| 7366 | if (s.convert_fonts_to_spans) | ||
| 7367 | t._convertFonts(); | ||
| 7368 | |||
| 7369 | if (s.inline_styles) | ||
| 7370 | t._convertInlineElements(); | ||
| 7371 | |||
| 7372 | if (s.cleanup_callback) { | ||
| 7373 | t.onBeforeSetContent.add(function(ed, o) { | ||
| 7374 | o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); | ||
| 7375 | }); | ||
| 7376 | |||
| 7377 | t.onPreProcess.add(function(ed, o) { | ||
| 7378 | if (o.set) | ||
| 7379 | t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o); | ||
| 7380 | |||
| 7381 | if (o.get) | ||
| 7382 | t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o); | ||
| 7383 | }); | ||
| 7384 | |||
| 7385 | t.onPostProcess.add(function(ed, o) { | ||
| 7386 | if (o.set) | ||
| 7387 | o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); | ||
| 7388 | |||
| 7389 | if (o.get) | ||
| 7390 | o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o); | ||
| 7391 | }); | ||
| 7392 | } | ||
| 7393 | |||
| 7394 | if (s.save_callback) { | ||
| 7395 | t.onGetContent.add(function(ed, o) { | ||
| 7396 | if (o.save) | ||
| 7397 | o.content = t.execCallback('save_callback', t.id, o.content, t.getBody()); | ||
| 7398 | }); | ||
| 7399 | } | ||
| 7400 | |||
| 7401 | if (s.handle_event_callback) { | ||
| 7402 | t.onEvent.add(function(ed, e, o) { | ||
| 7403 | if (t.execCallback('handle_event_callback', e, ed, o) === false) | ||
| 7404 | Event.cancel(e); | ||
| 7405 | }); | ||
| 7406 | } | ||
| 7407 | |||
| 7408 | t.onSetContent.add(function() { | ||
| 7409 | // Safari needs some time, it will crash the browser when a link is created otherwise | ||
| 7410 | // I think this crash issue is resolved in the latest 3.0.4 | ||
| 7411 | //window.setTimeout(function() { | ||
| 7412 | t.addVisual(t.getBody()); | ||
| 7413 | //}, 1); | ||
| 7414 | }); | ||
| 7415 | |||
| 7416 | // Remove empty contents | ||
| 7417 | if (s.padd_empty_editor) { | ||
| 7418 | t.onPostProcess.add(function(ed, o) { | ||
| 7419 | o.content = o.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, ''); | ||
| 7420 | }); | ||
| 7421 | } | ||
| 7422 | |||
| 7423 | if (isGecko && !s.readonly) { | ||
| 7424 | try { | ||
| 7425 | // Design mode must be set here once again to fix a bug where | ||
| 7426 | // Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again | ||
| 7427 | d.designMode = 'Off'; | ||
| 7428 | d.designMode = 'On'; | ||
| 7429 | } catch (ex) { | ||
| 7430 | // Will fail on Gecko if the editor is placed in an hidden container element | ||
| 7431 | // The design mode will be set ones the editor is focused | ||
| 7432 | } | ||
| 7433 | } | ||
| 7434 | |||
| 7435 | // A small timeout was needed since firefox will remove. Bug: #1838304 | ||
| 7436 | setTimeout(function () { | ||
| 7437 | if (t.removed) | ||
| 7438 | return; | ||
| 7439 | |||
| 7440 | t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')}); | ||
| 7441 | t.startContent = t.getContent({format : 'raw'}); | ||
| 7442 | t.undoManager.add({initial : true}); | ||
| 7443 | t.initialized = true; | ||
| 7444 | |||
| 7445 | t.onInit.dispatch(t); | ||
| 7446 | t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); | ||
| 7447 | t.execCallback('init_instance_callback', t); | ||
| 7448 | t.focus(true); | ||
| 7449 | t.nodeChanged({initial : 1}); | ||
| 7450 | |||
| 7451 | // Load specified content CSS last | ||
| 7452 | if (s.content_css) { | ||
| 7453 | tinymce.each(explode(s.content_css), function(u) { | ||
| 7454 | t.dom.loadCSS(t.documentBaseURI.toAbsolute(u)); | ||
| 7455 | }); | ||
| 7456 | } | ||
| 7457 | |||
| 7458 | // Handle auto focus | ||
| 7459 | if (s.auto_focus) { | ||
| 7460 | setTimeout(function () { | ||
| 7461 | var ed = EditorManager.get(s.auto_focus); | ||
| 7462 | |||
| 7463 | ed.selection.select(ed.getBody(), 1); | ||
| 7464 | ed.selection.collapse(1); | ||
| 7465 | ed.getWin().focus(); | ||
| 7466 | }, 100); | ||
| 7467 | } | ||
| 7468 | }, 1); | ||
| 7469 | |||
| 7470 | e = null; | ||
| 7471 | }, | ||
| 7472 | |||
| 7473 | |||
| 7474 | focus : function(sf) { | ||
| 7475 | var oed, t = this, ce = t.settings.content_editable; | ||
| 7476 | |||
| 7477 | if (!sf) { | ||
| 7478 | // Is not content editable or the selection is outside the area in IE | ||
| 7479 | // the IE statement is needed to avoid bluring if element selections inside layers since | ||
| 7480 | // the layer is like it's own document in IE | ||
| 7481 | if (!ce && (!isIE || t.selection.getNode().ownerDocument != t.getDoc())) | ||
| 7482 | t.getWin().focus(); | ||
| 7483 | |||
| 7484 | } | ||
| 7485 | |||
| 7486 | if (EditorManager.activeEditor != t) { | ||
| 7487 | if ((oed = EditorManager.activeEditor) != null) | ||
| 7488 | oed.onDeactivate.dispatch(oed, t); | ||
| 7489 | |||
| 7490 | t.onActivate.dispatch(t, oed); | ||
| 7491 | } | ||
| 7492 | |||
| 7493 | EditorManager._setActive(t); | ||
| 7494 | }, | ||
| 7495 | |||
| 7496 | execCallback : function(n) { | ||
| 7497 | var t = this, f = t.settings[n], s; | ||
| 7498 | |||
| 7499 | if (!f) | ||
| 7500 | return; | ||
| 7501 | |||
| 7502 | // Look through lookup | ||
| 7503 | if (t.callbackLookup && (s = t.callbackLookup[n])) { | ||
| 7504 | f = s.func; | ||
| 7505 | s = s.scope; | ||
| 7506 | } | ||
| 7507 | |||
| 7508 | if (is(f, 'string')) { | ||
| 7509 | s = f.replace(/\.\w+$/, ''); | ||
| 7510 | s = s ? tinymce.resolve(s) : 0; | ||
| 7511 | f = tinymce.resolve(f); | ||
| 7512 | t.callbackLookup = t.callbackLookup || {}; | ||
| 7513 | t.callbackLookup[n] = {func : f, scope : s}; | ||
| 7514 | } | ||
| 7515 | |||
| 7516 | return f.apply(s || t, Array.prototype.slice.call(arguments, 1)); | ||
| 7517 | }, | ||
| 7518 | |||
| 7519 | translate : function(s) { | ||
| 7520 | var c = this.settings.language || 'en', i18n = EditorManager.i18n; | ||
| 7521 | |||
| 7522 | if (!s) | ||
| 7523 | return ''; | ||
| 7524 | |||
| 7525 | return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) { | ||
| 7526 | return i18n[c + '.' + b] || '{#' + b + '}'; | ||
| 7527 | }); | ||
| 7528 | }, | ||
| 7529 | |||
| 7530 | getLang : function(n, dv) { | ||
| 7531 | return EditorManager.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}'); | ||
| 7532 | }, | ||
| 7533 | |||
| 7534 | getParam : function(n, dv, ty) { | ||
| 7535 | var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o; | ||
| 7536 | |||
| 7537 | if (ty === 'hash') { | ||
| 7538 | o = {}; | ||
| 7539 | |||
| 7540 | if (is(v, 'string')) { | ||
| 7541 | each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) { | ||
| 7542 | v = v.split('='); | ||
| 7543 | |||
| 7544 | if (v.length > 1) | ||
| 7545 | o[tr(v[0])] = tr(v[1]); | ||
| 7546 | else | ||
| 7547 | o[tr(v[0])] = tr(v); | ||
| 7548 | }); | ||
| 7549 | } else | ||
| 7550 | o = v; | ||
| 7551 | |||
| 7552 | return o; | ||
| 7553 | } | ||
| 7554 | |||
| 7555 | return v; | ||
| 7556 | }, | ||
| 7557 | |||
| 7558 | nodeChanged : function(o) { | ||
| 7559 | var t = this, s = t.selection, n = s.getNode() || t.getBody(); | ||
| 7560 | |||
| 7561 | // Fix for bug #1896577 it seems that this can not be fired while the editor is loading | ||
| 7562 | if (t.initialized) { | ||
| 7563 | t.onNodeChange.dispatch( | ||
| 7564 | t, | ||
| 7565 | o ? o.controlManager || t.controlManager : t.controlManager, | ||
| 7566 | isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n, // Fix for IE initial state | ||
| 7567 | s.isCollapsed(), | ||
| 7568 | o | ||
| 7569 | ); | ||
| 7570 | } | ||
| 7571 | }, | ||
| 7572 | |||
| 7573 | addButton : function(n, s) { | ||
| 7574 | var t = this; | ||
| 7575 | |||
| 7576 | t.buttons = t.buttons || {}; | ||
| 7577 | t.buttons[n] = s; | ||
| 7578 | }, | ||
| 7579 | |||
| 7580 | addCommand : function(n, f, s) { | ||
| 7581 | this.execCommands[n] = {func : f, scope : s || this}; | ||
| 7582 | }, | ||
| 7583 | |||
| 7584 | addQueryStateHandler : function(n, f, s) { | ||
| 7585 | this.queryStateCommands[n] = {func : f, scope : s || this}; | ||
| 7586 | }, | ||
| 7587 | |||
| 7588 | addQueryValueHandler : function(n, f, s) { | ||
| 7589 | this.queryValueCommands[n] = {func : f, scope : s || this}; | ||
| 7590 | }, | ||
| 7591 | |||
| 7592 | addShortcut : function(pa, desc, cmd_func, sc) { | ||
| 7593 | var t = this, c; | ||
| 7594 | |||
| 7595 | if (!t.settings.custom_shortcuts) | ||
| 7596 | return false; | ||
| 7597 | |||
| 7598 | t.shortcuts = t.shortcuts || {}; | ||
| 7599 | |||
| 7600 | if (is(cmd_func, 'string')) { | ||
| 7601 | c = cmd_func; | ||
| 7602 | |||
| 7603 | cmd_func = function() { | ||
| 7604 | t.execCommand(c, false, null); | ||
| 7605 | }; | ||
| 7606 | } | ||
| 7607 | |||
| 7608 | if (is(cmd_func, 'object')) { | ||
| 7609 | c = cmd_func; | ||
| 7610 | |||
| 7611 | cmd_func = function() { | ||
| 7612 | t.execCommand(c[0], c[1], c[2]); | ||
| 7613 | }; | ||
| 7614 | } | ||
| 7615 | |||
| 7616 | each(explode(pa), function(pa) { | ||
| 7617 | var o = { | ||
| 7618 | func : cmd_func, | ||
| 7619 | scope : sc || this, | ||
| 7620 | desc : desc, | ||
| 7621 | alt : false, | ||
| 7622 | ctrl : false, | ||
| 7623 | shift : false | ||
| 7624 | }; | ||
| 7625 | |||
| 7626 | each(explode(pa, '+'), function(v) { | ||
| 7627 | switch (v) { | ||
| 7628 | case 'alt': | ||
| 7629 | case 'ctrl': | ||
| 7630 | case 'shift': | ||
| 7631 | o[v] = true; | ||
| 7632 | break; | ||
| 7633 | |||
| 7634 | default: | ||
| 7635 | o.charCode = v.charCodeAt(0); | ||
| 7636 | o.keyCode = v.toUpperCase().charCodeAt(0); | ||
| 7637 | } | ||
| 7638 | }); | ||
| 7639 | |||
| 7640 | t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o; | ||
| 7641 | }); | ||
| 7642 | |||
| 7643 | return true; | ||
| 7644 | }, | ||
| 7645 | |||
| 7646 | execCommand : function(cmd, ui, val, a) { | ||
| 7647 | var t = this, s = 0, o, st; | ||
| 7648 | |||
| 7649 | if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus)) | ||
| 7650 | t.focus(); | ||
| 7651 | |||
| 7652 | o = {}; | ||
| 7653 | t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o); | ||
| 7654 | if (o.terminate) | ||
| 7655 | return false; | ||
| 7656 | |||
| 7657 | // Command callback | ||
| 7658 | if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) { | ||
| 7659 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 7660 | return true; | ||
| 7661 | } | ||
| 7662 | |||
| 7663 | // Registred commands | ||
| 7664 | if (o = t.execCommands[cmd]) { | ||
| 7665 | st = o.func.call(o.scope, ui, val); | ||
| 7666 | |||
| 7667 | // Fall through on true | ||
| 7668 | if (st !== true) { | ||
| 7669 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 7670 | return st; | ||
| 7671 | } | ||
| 7672 | } | ||
| 7673 | |||
| 7674 | // Plugin commands | ||
| 7675 | each(t.plugins, function(p) { | ||
| 7676 | if (p.execCommand && p.execCommand(cmd, ui, val)) { | ||
| 7677 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 7678 | s = 1; | ||
| 7679 | return false; | ||
| 7680 | } | ||
| 7681 | }); | ||
| 7682 | |||
| 7683 | if (s) | ||
| 7684 | return true; | ||
| 7685 | |||
| 7686 | // Theme commands | ||
| 7687 | if (t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) { | ||
| 7688 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 7689 | return true; | ||
| 7690 | } | ||
| 7691 | |||
| 7692 | // Editor commands | ||
| 7693 | if (t.editorCommands.execCommand(cmd, ui, val)) { | ||
| 7694 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 7695 | return true; | ||
| 7696 | } | ||
| 7697 | |||
| 7698 | // Browser commands | ||
| 7699 | t.getDoc().execCommand(cmd, ui, val); | ||
| 7700 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 7701 | }, | ||
| 7702 | |||
| 7703 | queryCommandState : function(c) { | ||
| 7704 | var t = this, o, s; | ||
| 7705 | |||
| 7706 | // Is hidden then return undefined | ||
| 7707 | if (t._isHidden()) | ||
| 7708 | return; | ||
| 7709 | |||
| 7710 | // Registred commands | ||
| 7711 | if (o = t.queryStateCommands[c]) { | ||
| 7712 | s = o.func.call(o.scope); | ||
| 7713 | |||
| 7714 | // Fall though on true | ||
| 7715 | if (s !== true) | ||
| 7716 | return s; | ||
| 7717 | } | ||
| 7718 | |||
| 7719 | // Registred commands | ||
| 7720 | o = t.editorCommands.queryCommandState(c); | ||
| 7721 | if (o !== -1) | ||
| 7722 | return o; | ||
| 7723 | |||
| 7724 | // Browser commands | ||
| 7725 | try { | ||
| 7726 | return this.getDoc().queryCommandState(c); | ||
| 7727 | } catch (ex) { | ||
| 7728 | // Fails sometimes see bug: 1896577 | ||
| 7729 | } | ||
| 7730 | }, | ||
| 7731 | |||
| 7732 | queryCommandValue : function(c) { | ||
| 7733 | var t = this, o, s; | ||
| 7734 | |||
| 7735 | // Is hidden then return undefined | ||
| 7736 | if (t._isHidden()) | ||
| 7737 | return; | ||
| 7738 | |||
| 7739 | // Registred commands | ||
| 7740 | if (o = t.queryValueCommands[c]) { | ||
| 7741 | s = o.func.call(o.scope); | ||
| 7742 | |||
| 7743 | // Fall though on true | ||
| 7744 | if (s !== true) | ||
| 7745 | return s; | ||
| 7746 | } | ||
| 7747 | |||
| 7748 | // Registred commands | ||
| 7749 | o = t.editorCommands.queryCommandValue(c); | ||
| 7750 | if (is(o)) | ||
| 7751 | return o; | ||
| 7752 | |||
| 7753 | // Browser commands | ||
| 7754 | try { | ||
| 7755 | return this.getDoc().queryCommandValue(c); | ||
| 7756 | } catch (ex) { | ||
| 7757 | // Fails sometimes see bug: 1896577 | ||
| 7758 | } | ||
| 7759 | }, | ||
| 7760 | |||
| 7761 | show : function() { | ||
| 7762 | var t = this; | ||
| 7763 | |||
| 7764 | DOM.show(t.getContainer()); | ||
| 7765 | DOM.hide(t.id); | ||
| 7766 | t.load(); | ||
| 7767 | }, | ||
| 7768 | |||
| 7769 | hide : function() { | ||
| 7770 | var t = this, d = t.getDoc(); | ||
| 7771 | |||
| 7772 | // Fixed bug where IE has a blinking cursor left from the editor | ||
| 7773 | if (isIE && d) | ||
| 7774 | d.execCommand('SelectAll'); | ||
| 7775 | |||
| 7776 | // We must save before we hide so Safari doesn't crash | ||
| 7777 | t.save(); | ||
| 7778 | DOM.hide(t.getContainer()); | ||
| 7779 | DOM.setStyle(t.id, 'display', t.orgDisplay); | ||
| 7780 | }, | ||
| 7781 | |||
| 7782 | isHidden : function() { | ||
| 7783 | return !DOM.isHidden(this.id); | ||
| 7784 | }, | ||
| 7785 | |||
| 7786 | setProgressState : function(b, ti, o) { | ||
| 7787 | this.onSetProgressState.dispatch(this, b, ti, o); | ||
| 7788 | |||
| 7789 | return b; | ||
| 7790 | }, | ||
| 7791 | |||
| 7792 | resizeToContent : function() { | ||
| 7793 | var t = this; | ||
| 7794 | |||
| 7795 | DOM.setStyle(t.id + "_ifr", 'height', t.getBody().scrollHeight); | ||
| 7796 | }, | ||
| 7797 | |||
| 7798 | load : function(o) { | ||
| 7799 | var t = this, e = t.getElement(), h; | ||
| 7800 | |||
| 7801 | if (e) { | ||
| 7802 | o = o || {}; | ||
| 7803 | o.load = true; | ||
| 7804 | |||
| 7805 | h = t.setContent(is(e.value) ? e.value : e.innerHTML, o); | ||
| 7806 | o.element = e; | ||
| 7807 | |||
| 7808 | if (!o.no_events) | ||
| 7809 | t.onLoadContent.dispatch(t, o); | ||
| 7810 | |||
| 7811 | o.element = e = null; | ||
| 7812 | |||
| 7813 | return h; | ||
| 7814 | } | ||
| 7815 | }, | ||
| 7816 | |||
| 7817 | save : function(o) { | ||
| 7818 | var t = this, e = t.getElement(), h, f; | ||
| 7819 | |||
| 7820 | if (!e || !t.initialized) | ||
| 7821 | return; | ||
| 7822 | |||
| 7823 | o = o || {}; | ||
| 7824 | o.save = true; | ||
| 7825 | |||
| 7826 | // Add undo level will trigger onchange event | ||
| 7827 | if (!o.no_events) { | ||
| 7828 | t.undoManager.typing = 0; | ||
| 7829 | t.undoManager.add(); | ||
| 7830 | } | ||
| 7831 | |||
| 7832 | o.element = e; | ||
| 7833 | h = o.content = t.getContent(o); | ||
| 7834 | |||
| 7835 | if (!o.no_events) | ||
| 7836 | t.onSaveContent.dispatch(t, o); | ||
| 7837 | |||
| 7838 | h = o.content; | ||
| 7839 | |||
| 7840 | if (!/TEXTAREA|INPUT/i.test(e.nodeName)) { | ||
| 7841 | e.innerHTML = h; | ||
| 7842 | |||
| 7843 | // Update hidden form element | ||
| 7844 | if (f = DOM.getParent(t.id, 'form')) { | ||
| 7845 | each(f.elements, function(e) { | ||
| 7846 | if (e.name == t.id) { | ||
| 7847 | e.value = h; | ||
| 7848 | return false; | ||
| 7849 | } | ||
| 7850 | }); | ||
| 7851 | } | ||
| 7852 | } else | ||
| 7853 | e.value = h; | ||
| 7854 | |||
| 7855 | o.element = e = null; | ||
| 7856 | |||
| 7857 | return h; | ||
| 7858 | }, | ||
| 7859 | |||
| 7860 | setContent : function(h, o) { | ||
| 7861 | var t = this; | ||
| 7862 | |||
| 7863 | o = o || {}; | ||
| 7864 | o.format = o.format || 'html'; | ||
| 7865 | o.set = true; | ||
| 7866 | o.content = h; | ||
| 7867 | |||
| 7868 | if (!o.no_events) | ||
| 7869 | t.onBeforeSetContent.dispatch(t, o); | ||
| 7870 | |||
| 7871 | // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content | ||
| 7872 | // It will also be impossible to place the caret in the editor unless there is a BR element present | ||
| 7873 | if (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) { | ||
| 7874 | o.content = t.dom.setHTML(t.getBody(), '<br mce_bogus="1" />'); | ||
| 7875 | o.format = 'raw'; | ||
| 7876 | } | ||
| 7877 | |||
| 7878 | o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content)); | ||
| 7879 | |||
| 7880 | if (o.format != 'raw' && t.settings.cleanup) { | ||
| 7881 | o.getInner = true; | ||
| 7882 | o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o)); | ||
| 7883 | } | ||
| 7884 | |||
| 7885 | if (!o.no_events) | ||
| 7886 | t.onSetContent.dispatch(t, o); | ||
| 7887 | |||
| 7888 | return o.content; | ||
| 7889 | }, | ||
| 7890 | |||
| 7891 | getContent : function(o) { | ||
| 7892 | var t = this, h; | ||
| 7893 | |||
| 7894 | o = o || {}; | ||
| 7895 | o.format = o.format || 'html'; | ||
| 7896 | o.get = true; | ||
| 7897 | |||
| 7898 | if (!o.no_events) | ||
| 7899 | t.onBeforeGetContent.dispatch(t, o); | ||
| 7900 | |||
| 7901 | if (o.format != 'raw' && t.settings.cleanup) { | ||
| 7902 | o.getInner = true; | ||
| 7903 | h = t.serializer.serialize(t.getBody(), o); | ||
| 7904 | } else | ||
| 7905 | h = t.getBody().innerHTML; | ||
| 7906 | |||
| 7907 | h = h.replace(/^\s*|\s*$/g, ''); | ||
| 7908 | o.content = h; | ||
| 7909 | |||
| 7910 | if (!o.no_events) | ||
| 7911 | t.onGetContent.dispatch(t, o); | ||
| 7912 | |||
| 7913 | return o.content; | ||
| 7914 | }, | ||
| 7915 | |||
| 7916 | isDirty : function() { | ||
| 7917 | var t = this; | ||
| 7918 | |||
| 7919 | return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty; | ||
| 7920 | }, | ||
| 7921 | |||
| 7922 | getContainer : function() { | ||
| 7923 | var t = this; | ||
| 7924 | |||
| 7925 | if (!t.container) | ||
| 7926 | t.container = DOM.get(t.editorContainer || t.id + '_parent'); | ||
| 7927 | |||
| 7928 | return t.container; | ||
| 7929 | }, | ||
| 7930 | |||
| 7931 | getContentAreaContainer : function() { | ||
| 7932 | return this.contentAreaContainer; | ||
| 7933 | }, | ||
| 7934 | |||
| 7935 | getElement : function() { | ||
| 7936 | return DOM.get(this.settings.content_element || this.id); | ||
| 7937 | }, | ||
| 7938 | |||
| 7939 | getWin : function() { | ||
| 7940 | var t = this, e; | ||
| 7941 | |||
| 7942 | if (!t.contentWindow) { | ||
| 7943 | e = DOM.get(t.id + "_ifr"); | ||
| 7944 | |||
| 7945 | if (e) | ||
| 7946 | t.contentWindow = e.contentWindow; | ||
| 7947 | } | ||
| 7948 | |||
| 7949 | return t.contentWindow; | ||
| 7950 | }, | ||
| 7951 | |||
| 7952 | getDoc : function() { | ||
| 7953 | var t = this, w; | ||
| 7954 | |||
| 7955 | if (!t.contentDocument) { | ||
| 7956 | w = t.getWin(); | ||
| 7957 | |||
| 7958 | if (w) | ||
| 7959 | t.contentDocument = w.document; | ||
| 7960 | } | ||
| 7961 | |||
| 7962 | return t.contentDocument; | ||
| 7963 | }, | ||
| 7964 | |||
| 7965 | getBody : function() { | ||
| 7966 | return this.bodyElement || this.getDoc().body; | ||
| 7967 | }, | ||
| 7968 | |||
| 7969 | convertURL : function(u, n, e) { | ||
| 7970 | var t = this, s = t.settings; | ||
| 7971 | |||
| 7972 | // Use callback instead | ||
| 7973 | if (s.urlconverter_callback) | ||
| 7974 | return t.execCallback('urlconverter_callback', u, e, true, n); | ||
| 7975 | |||
| 7976 | // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs | ||
| 7977 | if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0) | ||
| 7978 | return u; | ||
| 7979 | |||
| 7980 | // Convert to relative | ||
| 7981 | if (s.relative_urls) | ||
| 7982 | return t.documentBaseURI.toRelative(u); | ||
| 7983 | |||
| 7984 | // Convert to absolute | ||
| 7985 | u = t.documentBaseURI.toAbsolute(u, s.remove_script_host); | ||
| 7986 | |||
| 7987 | return u; | ||
| 7988 | }, | ||
| 7989 | |||
| 7990 | addVisual : function(e) { | ||
| 7991 | var t = this, s = t.settings; | ||
| 7992 | |||
| 7993 | e = e || t.getBody(); | ||
| 7994 | |||
| 7995 | if (!is(t.hasVisual)) | ||
| 7996 | t.hasVisual = s.visual; | ||
| 7997 | |||
| 7998 | each(t.dom.select('table,a', e), function(e) { | ||
| 7999 | var v; | ||
| 8000 | |||
| 8001 | switch (e.nodeName) { | ||
| 8002 | case 'TABLE': | ||
| 8003 | v = t.dom.getAttrib(e, 'border'); | ||
| 8004 | |||
| 8005 | if (!v || v == '0') { | ||
| 8006 | if (t.hasVisual) | ||
| 8007 | t.dom.addClass(e, s.visual_table_class); | ||
| 8008 | else | ||
| 8009 | t.dom.removeClass(e, s.visual_table_class); | ||
| 8010 | } | ||
| 8011 | |||
| 8012 | return; | ||
| 8013 | |||
| 8014 | case 'A': | ||
| 8015 | v = t.dom.getAttrib(e, 'name'); | ||
| 8016 | |||
| 8017 | if (v) { | ||
| 8018 | if (t.hasVisual) | ||
| 8019 | t.dom.addClass(e, 'mceItemAnchor'); | ||
| 8020 | else | ||
| 8021 | t.dom.removeClass(e, 'mceItemAnchor'); | ||
| 8022 | } | ||
| 8023 | |||
| 8024 | return; | ||
| 8025 | } | ||
| 8026 | }); | ||
| 8027 | |||
| 8028 | t.onVisualAid.dispatch(t, e, t.hasVisual); | ||
| 8029 | }, | ||
| 8030 | |||
| 8031 | remove : function() { | ||
| 8032 | var t = this, e = t.getContainer(); | ||
| 8033 | |||
| 8034 | t.removed = 1; // Cancels post remove event execution | ||
| 8035 | t.hide(); | ||
| 8036 | |||
| 8037 | t.execCallback('remove_instance_callback', t); | ||
| 8038 | t.onRemove.dispatch(t); | ||
| 8039 | |||
| 8040 | // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command | ||
| 8041 | t.onExecCommand.listeners = []; | ||
| 8042 | |||
| 8043 | EditorManager.remove(t); | ||
| 8044 | DOM.remove(e); | ||
| 8045 | }, | ||
| 8046 | |||
| 8047 | destroy : function(s) { | ||
| 8048 | var t = this; | ||
| 8049 | |||
| 8050 | // One time is enough | ||
| 8051 | if (t.destroyed) | ||
| 8052 | return; | ||
| 8053 | |||
| 8054 | if (!s) { | ||
| 8055 | tinymce.removeUnload(t.destroy); | ||
| 8056 | tinyMCE.onBeforeUnload.remove(t._beforeUnload); | ||
| 8057 | |||
| 8058 | // Manual destroy | ||
| 8059 | if (t.theme.destroy) | ||
| 8060 | t.theme.destroy(); | ||
| 8061 | |||
| 8062 | // Destroy controls, selection and dom | ||
| 8063 | t.controlManager.destroy(); | ||
| 8064 | t.selection.destroy(); | ||
| 8065 | t.dom.destroy(); | ||
| 8066 | |||
| 8067 | // Remove all events | ||
| 8068 | |||
| 8069 | // Don't clear the window or document if content editable | ||
| 8070 | // is enabled since other instances might still be present | ||
| 8071 | if (!t.settings.content_editable) { | ||
| 8072 | Event.clear(t.getWin()); | ||
| 8073 | Event.clear(t.getDoc()); | ||
| 8074 | } | ||
| 8075 | |||
| 8076 | Event.clear(t.getBody()); | ||
| 8077 | Event.clear(t.formElement); | ||
| 8078 | } | ||
| 8079 | |||
| 8080 | if (t.formElement) { | ||
| 8081 | t.formElement.submit = t.formElement._mceOldSubmit; | ||
| 8082 | t.formElement._mceOldSubmit = null; | ||
| 8083 | } | ||
| 8084 | |||
| 8085 | t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null; | ||
| 8086 | |||
| 8087 | if (t.selection) | ||
| 8088 | t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null; | ||
| 8089 | |||
| 8090 | t.destroyed = 1; | ||
| 8091 | }, | ||
| 8092 | |||
| 8093 | // Internal functions | ||
| 8094 | |||
| 8095 | _addEvents : function() { | ||
| 8096 | // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset | ||
| 8097 | var t = this, i, s = t.settings, lo = { | ||
| 8098 | mouseup : 'onMouseUp', | ||
| 8099 | mousedown : 'onMouseDown', | ||
| 8100 | click : 'onClick', | ||
| 8101 | keyup : 'onKeyUp', | ||
| 8102 | keydown : 'onKeyDown', | ||
| 8103 | keypress : 'onKeyPress', | ||
| 8104 | submit : 'onSubmit', | ||
| 8105 | reset : 'onReset', | ||
| 8106 | contextmenu : 'onContextMenu', | ||
| 8107 | dblclick : 'onDblClick', | ||
| 8108 | paste : 'onPaste' // Doesn't work in all browsers yet | ||
| 8109 | }; | ||
| 8110 | |||
| 8111 | function eventHandler(e, o) { | ||
| 8112 | var ty = e.type; | ||
| 8113 | |||
| 8114 | // Don't fire events when it's removed | ||
| 8115 | if (t.removed) | ||
| 8116 | return; | ||
| 8117 | |||
| 8118 | // Generic event handler | ||
| 8119 | if (t.onEvent.dispatch(t, e, o) !== false) { | ||
| 8120 | // Specific event handler | ||
| 8121 | t[lo[e.fakeType || e.type]].dispatch(t, e, o); | ||
| 8122 | } | ||
| 8123 | }; | ||
| 8124 | |||
| 8125 | // Add DOM events | ||
| 8126 | each(lo, function(v, k) { | ||
| 8127 | switch (k) { | ||
| 8128 | case 'contextmenu': | ||
| 8129 | if (tinymce.isOpera) { | ||
| 8130 | // Fake contextmenu on Opera | ||
| 8131 | Event.add(t.getBody(), 'mousedown', function(e) { | ||
| 8132 | if (e.ctrlKey) { | ||
| 8133 | e.fakeType = 'contextmenu'; | ||
| 8134 | eventHandler(e); | ||
| 8135 | } | ||
| 8136 | }); | ||
| 8137 | } else | ||
| 8138 | Event.add(t.getBody(), k, eventHandler); | ||
| 8139 | break; | ||
| 8140 | |||
| 8141 | case 'paste': | ||
| 8142 | Event.add(t.getBody(), k, function(e) { | ||
| 8143 | var tx, h, el, r; | ||
| 8144 | |||
| 8145 | // Get plain text data | ||
| 8146 | if (e.clipboardData) | ||
| 8147 | tx = e.clipboardData.getData('text/plain'); | ||
| 8148 | else if (tinymce.isIE) | ||
| 8149 | tx = t.getWin().clipboardData.getData('Text'); | ||
| 8150 | |||
| 8151 | // Get HTML data | ||
| 8152 | /*if (tinymce.isIE) { | ||
| 8153 | el = DOM.add(DOM.doc.body, 'div', {style : 'visibility:hidden;overflow:hidden;position:absolute;width:1px;height:1px'}); | ||
| 8154 | r = DOM.doc.body.createTextRange(); | ||
| 8155 | r.moveToElementText(el); | ||
| 8156 | r.execCommand('Paste'); | ||
| 8157 | h = el.innerHTML; | ||
| 8158 | DOM.remove(el); | ||
| 8159 | }*/ | ||
| 8160 | |||
| 8161 | eventHandler(e, {text : tx, html : h}); | ||
| 8162 | }); | ||
| 8163 | break; | ||
| 8164 | |||
| 8165 | case 'submit': | ||
| 8166 | case 'reset': | ||
| 8167 | Event.add(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); | ||
| 8168 | break; | ||
| 8169 | |||
| 8170 | default: | ||
| 8171 | Event.add(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); | ||
| 8172 | } | ||
| 8173 | }); | ||
| 8174 | |||
| 8175 | Event.add(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { | ||
| 8176 | t.focus(true); | ||
| 8177 | }); | ||
| 8178 | |||
| 8179 | |||
| 8180 | // Fixes bug where a specified document_base_uri could result in broken images | ||
| 8181 | // This will also fix drag drop of images in Gecko | ||
| 8182 | if (tinymce.isGecko) { | ||
| 8183 | // Convert all images to absolute URLs | ||
| 8184 | /* t.onSetContent.add(function(ed, o) { | ||
| 8185 | each(ed.dom.select('img'), function(e) { | ||
| 8186 | var v; | ||
| 8187 | |||
| 8188 | if (v = e.getAttribute('mce_src')) | ||
| 8189 | e.src = t.documentBaseURI.toAbsolute(v); | ||
| 8190 | }) | ||
| 8191 | });*/ | ||
| 8192 | |||
| 8193 | Event.add(t.getDoc(), 'DOMNodeInserted', function(e) { | ||
| 8194 | var v; | ||
| 8195 | |||
| 8196 | e = e.target; | ||
| 8197 | |||
| 8198 | if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('mce_src'))) | ||
| 8199 | e.src = t.documentBaseURI.toAbsolute(v); | ||
| 8200 | }); | ||
| 8201 | } | ||
| 8202 | |||
| 8203 | // Set various midas options in Gecko | ||
| 8204 | if (isGecko) { | ||
| 8205 | function setOpts() { | ||
| 8206 | var t = this, d = t.getDoc(), s = t.settings; | ||
| 8207 | |||
| 8208 | if (isGecko && !s.readonly) { | ||
| 8209 | if (t._isHidden()) { | ||
| 8210 | try { | ||
| 8211 | if (!s.content_editable) | ||
| 8212 | d.designMode = 'On'; | ||
| 8213 | } catch (ex) { | ||
| 8214 | // Fails if it's hidden | ||
| 8215 | } | ||
| 8216 | } | ||
| 8217 | |||
| 8218 | try { | ||
| 8219 | // Try new Gecko method | ||
| 8220 | d.execCommand("styleWithCSS", 0, false); | ||
| 8221 | } catch (ex) { | ||
| 8222 | // Use old method | ||
| 8223 | if (!t._isHidden()) | ||
| 8224 | try {d.execCommand("useCSS", 0, true);} catch (ex) {} | ||
| 8225 | } | ||
| 8226 | |||
| 8227 | if (!s.table_inline_editing) | ||
| 8228 | try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {} | ||
| 8229 | |||
| 8230 | if (!s.object_resizing) | ||
| 8231 | try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {} | ||
| 8232 | } | ||
| 8233 | }; | ||
| 8234 | |||
| 8235 | t.onBeforeExecCommand.add(setOpts); | ||
| 8236 | t.onMouseDown.add(setOpts); | ||
| 8237 | } | ||
| 8238 | |||
| 8239 | // Add node change handlers | ||
| 8240 | t.onMouseUp.add(t.nodeChanged); | ||
| 8241 | t.onClick.add(t.nodeChanged); | ||
| 8242 | t.onKeyUp.add(function(ed, e) { | ||
| 8243 | var c = e.keyCode; | ||
| 8244 | |||
| 8245 | if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey) | ||
| 8246 | t.nodeChanged(); | ||
| 8247 | }); | ||
| 8248 | |||
| 8249 | // Add reset handler | ||
| 8250 | t.onReset.add(function() { | ||
| 8251 | t.setContent(t.startContent, {format : 'raw'}); | ||
| 8252 | }); | ||
| 8253 | |||
| 8254 | if (t.getParam('tab_focus')) { | ||
| 8255 | function tabCancel(ed, e) { | ||
| 8256 | if (e.keyCode === 9) | ||
| 8257 | return Event.cancel(e); | ||
| 8258 | }; | ||
| 8259 | |||
| 8260 | function tabHandler(ed, e) { | ||
| 8261 | var x, i, f, el, v; | ||
| 8262 | |||
| 8263 | function find(d) { | ||
| 8264 | f = DOM.getParent(ed.id, 'form'); | ||
| 8265 | el = f.elements; | ||
| 8266 | |||
| 8267 | if (f) { | ||
| 8268 | each(el, function(e, i) { | ||
| 8269 | if (e.id == ed.id) { | ||
| 8270 | x = i; | ||
| 8271 | return false; | ||
| 8272 | } | ||
| 8273 | }); | ||
| 8274 | |||
| 8275 | if (d > 0) { | ||
| 8276 | for (i = x + 1; i < el.length; i++) { | ||
| 8277 | if (el[i].type != 'hidden') | ||
| 8278 | return el[i]; | ||
| 8279 | } | ||
| 8280 | } else { | ||
| 8281 | for (i = x - 1; i >= 0; i--) { | ||
| 8282 | if (el[i].type != 'hidden') | ||
| 8283 | return el[i]; | ||
| 8284 | } | ||
| 8285 | } | ||
| 8286 | } | ||
| 8287 | |||
| 8288 | return null; | ||
| 8289 | }; | ||
| 8290 | |||
| 8291 | if (e.keyCode === 9) { | ||
| 8292 | v = explode(ed.getParam('tab_focus')); | ||
| 8293 | |||
| 8294 | if (v.length == 1) { | ||
| 8295 | v[1] = v[0]; | ||
| 8296 | v[0] = ':prev'; | ||
| 8297 | } | ||
| 8298 | |||
| 8299 | // Find element to focus | ||
| 8300 | if (e.shiftKey) { | ||
| 8301 | if (v[0] == ':prev') | ||
| 8302 | el = find(-1); | ||
| 8303 | else | ||
| 8304 | el = DOM.get(v[0]); | ||
| 8305 | } else { | ||
| 8306 | if (v[1] == ':next') | ||
| 8307 | el = find(1); | ||
| 8308 | else | ||
| 8309 | el = DOM.get(v[1]); | ||
| 8310 | } | ||
| 8311 | |||
| 8312 | if (el) { | ||
| 8313 | if (ed = EditorManager.get(el.id || el.name)) | ||
| 8314 | ed.focus(); | ||
| 8315 | else | ||
| 8316 | window.setTimeout(function() {window.focus();el.focus();}, 10); | ||
| 8317 | |||
| 8318 | return Event.cancel(e); | ||
| 8319 | } | ||
| 8320 | } | ||
| 8321 | }; | ||
| 8322 | |||
| 8323 | t.onKeyUp.add(tabCancel); | ||
| 8324 | |||
| 8325 | if (isGecko) { | ||
| 8326 | t.onKeyPress.add(tabHandler); | ||
| 8327 | t.onKeyDown.add(tabCancel); | ||
| 8328 | } else | ||
| 8329 | t.onKeyDown.add(tabHandler); | ||
| 8330 | } | ||
| 8331 | |||
| 8332 | // Add shortcuts | ||
| 8333 | if (s.custom_shortcuts) { | ||
| 8334 | if (s.custom_undo_redo_keyboard_shortcuts) { | ||
| 8335 | t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo'); | ||
| 8336 | t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo'); | ||
| 8337 | } | ||
| 8338 | |||
| 8339 | // Add default shortcuts for gecko | ||
| 8340 | if (isGecko) { | ||
| 8341 | t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold'); | ||
| 8342 | t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic'); | ||
| 8343 | t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline'); | ||
| 8344 | } | ||
| 8345 | |||
| 8346 | // BlockFormat shortcuts keys | ||
| 8347 | for (i=1; i<=6; i++) | ||
| 8348 | t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, '<h' + i + '>']); | ||
| 8349 | |||
| 8350 | t.addShortcut('ctrl+7', '', ['FormatBlock', false, '<p>']); | ||
| 8351 | t.addShortcut('ctrl+8', '', ['FormatBlock', false, '<div>']); | ||
| 8352 | t.addShortcut('ctrl+9', '', ['FormatBlock', false, '<address>']); | ||
| 8353 | |||
| 8354 | function find(e) { | ||
| 8355 | var v = null; | ||
| 8356 | |||
| 8357 | if (!e.altKey && !e.ctrlKey && !e.metaKey) | ||
| 8358 | return v; | ||
| 8359 | |||
| 8360 | each(t.shortcuts, function(o) { | ||
| 8361 | if (tinymce.isMac && o.ctrl != e.metaKey) | ||
| 8362 | return; | ||
| 8363 | else if (!tinymce.isMac && o.ctrl != e.ctrlKey) | ||
| 8364 | return; | ||
| 8365 | |||
| 8366 | if (o.alt != e.altKey) | ||
| 8367 | return; | ||
| 8368 | |||
| 8369 | if (o.shift != e.shiftKey) | ||
| 8370 | return; | ||
| 8371 | |||
| 8372 | if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) { | ||
| 8373 | v = o; | ||
| 8374 | return false; | ||
| 8375 | } | ||
| 8376 | }); | ||
| 8377 | |||
| 8378 | return v; | ||
| 8379 | }; | ||
| 8380 | |||
| 8381 | t.onKeyUp.add(function(ed, e) { | ||
| 8382 | var o = find(e); | ||
| 8383 | |||
| 8384 | if (o) | ||
| 8385 | return Event.cancel(e); | ||
| 8386 | }); | ||
| 8387 | |||
| 8388 | t.onKeyPress.add(function(ed, e) { | ||
| 8389 | var o = find(e); | ||
| 8390 | |||
| 8391 | if (o) | ||
| 8392 | return Event.cancel(e); | ||
| 8393 | }); | ||
| 8394 | |||
| 8395 | t.onKeyDown.add(function(ed, e) { | ||
| 8396 | var o = find(e); | ||
| 8397 | |||
| 8398 | if (o) { | ||
| 8399 | o.func.call(o.scope); | ||
| 8400 | return Event.cancel(e); | ||
| 8401 | } | ||
| 8402 | }); | ||
| 8403 | } | ||
| 8404 | |||
| 8405 | if (tinymce.isIE) { | ||
| 8406 | // Fix so resize will only update the width and height attributes not the styles of an image | ||
| 8407 | // It will also block mceItemNoResize items | ||
| 8408 | Event.add(t.getDoc(), 'controlselect', function(e) { | ||
| 8409 | var re = t.resizeInfo, cb; | ||
| 8410 | |||
| 8411 | e = e.target; | ||
| 8412 | |||
| 8413 | // Don't do this action for non image elements | ||
| 8414 | if (e.nodeName !== 'IMG') | ||
| 8415 | return; | ||
| 8416 | |||
| 8417 | if (re) | ||
| 8418 | Event.remove(re.node, re.ev, re.cb); | ||
| 8419 | |||
| 8420 | if (!t.dom.hasClass(e, 'mceItemNoResize')) { | ||
| 8421 | ev = 'resizeend'; | ||
| 8422 | cb = Event.add(e, ev, function(e) { | ||
| 8423 | var v; | ||
| 8424 | |||
| 8425 | e = e.target; | ||
| 8426 | |||
| 8427 | if (v = t.dom.getStyle(e, 'width')) { | ||
| 8428 | t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); | ||
| 8429 | t.dom.setStyle(e, 'width', ''); | ||
| 8430 | } | ||
| 8431 | |||
| 8432 | if (v = t.dom.getStyle(e, 'height')) { | ||
| 8433 | t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); | ||
| 8434 | t.dom.setStyle(e, 'height', ''); | ||
| 8435 | } | ||
| 8436 | }); | ||
| 8437 | } else { | ||
| 8438 | ev = 'resizestart'; | ||
| 8439 | cb = Event.add(e, 'resizestart', Event.cancel, Event); | ||
| 8440 | } | ||
| 8441 | |||
| 8442 | re = t.resizeInfo = { | ||
| 8443 | node : e, | ||
| 8444 | ev : ev, | ||
| 8445 | cb : cb | ||
| 8446 | }; | ||
| 8447 | }); | ||
| 8448 | |||
| 8449 | t.onKeyDown.add(function(ed, e) { | ||
| 8450 | switch (e.keyCode) { | ||
| 8451 | case 8: | ||
| 8452 | // Fix IE control + backspace browser bug | ||
| 8453 | if (t.selection.getRng().item) { | ||
| 8454 | t.selection.getRng().item(0).removeNode(); | ||
| 8455 | return Event.cancel(e); | ||
| 8456 | } | ||
| 8457 | } | ||
| 8458 | }); | ||
| 8459 | } | ||
| 8460 | |||
| 8461 | if (tinymce.isOpera) { | ||
| 8462 | t.onClick.add(function(ed, e) { | ||
| 8463 | Event.prevent(e); | ||
| 8464 | }); | ||
| 8465 | } | ||
| 8466 | |||
| 8467 | // Add custom undo/redo handlers | ||
| 8468 | if (s.custom_undo_redo) { | ||
| 8469 | function addUndo() { | ||
| 8470 | t.undoManager.typing = 0; | ||
| 8471 | t.undoManager.add(); | ||
| 8472 | }; | ||
| 8473 | |||
| 8474 | // Add undo level on editor blur | ||
| 8475 | if (tinymce.isIE) { | ||
| 8476 | Event.add(t.getWin(), 'blur', function(e) { | ||
| 8477 | var n; | ||
| 8478 | |||
| 8479 | // Check added for fullscreen bug | ||
| 8480 | if (t.selection) { | ||
| 8481 | n = t.selection.getNode(); | ||
| 8482 | |||
| 8483 | // Add undo level is selection was lost to another document | ||
| 8484 | if (!t.removed && n.ownerDocument && n.ownerDocument != t.getDoc()) | ||
| 8485 | addUndo(); | ||
| 8486 | } | ||
| 8487 | }); | ||
| 8488 | } else { | ||
| 8489 | Event.add(t.getDoc(), 'blur', function() { | ||
| 8490 | if (t.selection && !t.removed) | ||
| 8491 | addUndo(); | ||
| 8492 | }); | ||
| 8493 | } | ||
| 8494 | |||
| 8495 | t.onMouseDown.add(addUndo); | ||
| 8496 | |||
| 8497 | t.onKeyUp.add(function(ed, e) { | ||
| 8498 | if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey) { | ||
| 8499 | t.undoManager.typing = 0; | ||
| 8500 | t.undoManager.add(); | ||
| 8501 | } | ||
| 8502 | }); | ||
| 8503 | |||
| 8504 | t.onKeyDown.add(function(ed, e) { | ||
| 8505 | // Is caracter positon keys | ||
| 8506 | if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) { | ||
| 8507 | if (t.undoManager.typing) { | ||
| 8508 | t.undoManager.add(); | ||
| 8509 | t.undoManager.typing = 0; | ||
| 8510 | } | ||
| 8511 | |||
| 8512 | return; | ||
| 8513 | } | ||
| 8514 | |||
| 8515 | if (!t.undoManager.typing) { | ||
| 8516 | t.undoManager.add(); | ||
| 8517 | t.undoManager.typing = 1; | ||
| 8518 | } | ||
| 8519 | }); | ||
| 8520 | } | ||
| 8521 | }, | ||
| 8522 | |||
| 8523 | _convertInlineElements : function() { | ||
| 8524 | var t = this, s = t.settings, dom = t.dom, v, e, na, st, sp; | ||
| 8525 | |||
| 8526 | function convert(ed, o) { | ||
| 8527 | if (!s.inline_styles) | ||
| 8528 | return; | ||
| 8529 | |||
| 8530 | if (o.get) { | ||
| 8531 | each(t.dom.select('table,u,strike', o.node), function(n) { | ||
| 8532 | switch (n.nodeName) { | ||
| 8533 | case 'TABLE': | ||
| 8534 | if (v = dom.getAttrib(n, 'height')) { | ||
| 8535 | dom.setStyle(n, 'height', v); | ||
| 8536 | dom.setAttrib(n, 'height', ''); | ||
| 8537 | } | ||
| 8538 | break; | ||
| 8539 | |||
| 8540 | case 'U': | ||
| 8541 | case 'STRIKE': | ||
| 8542 | //sp = dom.create('span', {style : dom.getAttrib(n, 'style')}); | ||
| 8543 | n.style.textDecoration = n.nodeName == 'U' ? 'underline' : 'line-through'; | ||
| 8544 | dom.setAttrib(n, 'mce_style', ''); | ||
| 8545 | dom.setAttrib(n, 'mce_name', 'span'); | ||
| 8546 | break; | ||
| 8547 | } | ||
| 8548 | }); | ||
| 8549 | } else if (o.set) { | ||
| 8550 | each(t.dom.select('table,span', o.node).reverse(), function(n) { | ||
| 8551 | if (n.nodeName == 'TABLE') { | ||
| 8552 | if (v = dom.getStyle(n, 'height')) | ||
| 8553 | dom.setAttrib(n, 'height', v.replace(/[^0-9%]+/g, '')); | ||
| 8554 | } else { | ||
| 8555 | // Convert spans to elements | ||
| 8556 | if (n.style.textDecoration == 'underline') | ||
| 8557 | na = 'u'; | ||
| 8558 | else if (n.style.textDecoration == 'line-through') | ||
| 8559 | na = 'strike'; | ||
| 8560 | else | ||
| 8561 | na = ''; | ||
| 8562 | |||
| 8563 | if (na) { | ||
| 8564 | n.style.textDecoration = ''; | ||
| 8565 | dom.setAttrib(n, 'mce_style', ''); | ||
| 8566 | |||
| 8567 | e = dom.create(na, { | ||
| 8568 | style : dom.getAttrib(n, 'style') | ||
| 8569 | }); | ||
| 8570 | |||
| 8571 | dom.replace(e, n, 1); | ||
| 8572 | } | ||
| 8573 | } | ||
| 8574 | }); | ||
| 8575 | } | ||
| 8576 | }; | ||
| 8577 | |||
| 8578 | t.onPreProcess.add(convert); | ||
| 8579 | |||
| 8580 | if (!s.cleanup_on_startup) { | ||
| 8581 | t.onSetContent.add(function(ed, o) { | ||
| 8582 | if (o.initial) | ||
| 8583 | convert(t, {node : t.getBody(), set : 1}); | ||
| 8584 | }); | ||
| 8585 | } | ||
| 8586 | }, | ||
| 8587 | |||
| 8588 | _convertFonts : function() { | ||
| 8589 | var t = this, s = t.settings, dom = t.dom, fz, fzn, sl, cl; | ||
| 8590 | |||
| 8591 | // No need | ||
| 8592 | if (!s.inline_styles) | ||
| 8593 | return; | ||
| 8594 | |||
| 8595 | // Font pt values and font size names | ||
| 8596 | fz = [8, 10, 12, 14, 18, 24, 36]; | ||
| 8597 | fzn = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large']; | ||
| 8598 | |||
| 8599 | if (sl = s.font_size_style_values) | ||
| 8600 | sl = explode(sl); | ||
| 8601 | |||
| 8602 | if (cl = s.font_size_classes) | ||
| 8603 | cl = explode(cl); | ||
| 8604 | |||
| 8605 | function process(no) { | ||
| 8606 | var n, sp, nl, x; | ||
| 8607 | |||
| 8608 | // Keep unit tests happy | ||
| 8609 | if (!s.inline_styles) | ||
| 8610 | return; | ||
| 8611 | |||
| 8612 | nl = t.dom.select('font', no); | ||
| 8613 | for (x = nl.length - 1; x >= 0; x--) { | ||
| 8614 | n = nl[x]; | ||
| 8615 | |||
| 8616 | sp = dom.create('span', { | ||
| 8617 | style : dom.getAttrib(n, 'style'), | ||
| 8618 | 'class' : dom.getAttrib(n, 'class') | ||
| 8619 | }); | ||
| 8620 | |||
| 8621 | dom.setStyles(sp, { | ||
| 8622 | fontFamily : dom.getAttrib(n, 'face'), | ||
| 8623 | color : dom.getAttrib(n, 'color'), | ||
| 8624 | backgroundColor : n.style.backgroundColor | ||
| 8625 | }); | ||
| 8626 | |||
| 8627 | if (n.size) { | ||
| 8628 | if (sl) | ||
| 8629 | dom.setStyle(sp, 'fontSize', sl[parseInt(n.size) - 1]); | ||
| 8630 | else | ||
| 8631 | dom.setAttrib(sp, 'class', cl[parseInt(n.size) - 1]); | ||
| 8632 | } | ||
| 8633 | |||
| 8634 | dom.setAttrib(sp, 'mce_style', ''); | ||
| 8635 | dom.replace(sp, n, 1); | ||
| 8636 | } | ||
| 8637 | }; | ||
| 8638 | |||
| 8639 | // Run on cleanup | ||
| 8640 | t.onPreProcess.add(function(ed, o) { | ||
| 8641 | if (o.get) | ||
| 8642 | process(o.node); | ||
| 8643 | }); | ||
| 8644 | |||
| 8645 | t.onSetContent.add(function(ed, o) { | ||
| 8646 | if (o.initial) | ||
| 8647 | process(o.node); | ||
| 8648 | }); | ||
| 8649 | }, | ||
| 8650 | |||
| 8651 | _isHidden : function() { | ||
| 8652 | var s; | ||
| 8653 | |||
| 8654 | if (!isGecko) | ||
| 8655 | return 0; | ||
| 8656 | |||
| 8657 | // Weird, wheres that cursor selection? | ||
| 8658 | s = this.selection.getSel(); | ||
| 8659 | return (!s || !s.rangeCount || s.rangeCount == 0); | ||
| 8660 | }, | ||
| 8661 | |||
| 8662 | // Fix for bug #1867292 | ||
| 8663 | _fixNesting : function(s) { | ||
| 8664 | var d = [], i; | ||
| 8665 | |||
| 8666 | s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) { | ||
| 8667 | var e; | ||
| 8668 | |||
| 8669 | // Handle end element | ||
| 8670 | if (b === '/') { | ||
| 8671 | if (!d.length) | ||
| 8672 | return ''; | ||
| 8673 | |||
| 8674 | if (c !== d[d.length - 1].tag) { | ||
| 8675 | for (i=d.length - 1; i>=0; i--) { | ||
| 8676 | if (d[i].tag === c) { | ||
| 8677 | d[i].close = 1; | ||
| 8678 | break; | ||
| 8679 | } | ||
| 8680 | } | ||
| 8681 | |||
| 8682 | return ''; | ||
| 8683 | } else { | ||
| 8684 | d.pop(); | ||
| 8685 | |||
| 8686 | if (d.length && d[d.length - 1].close) { | ||
| 8687 | a = a + '</' + d[d.length - 1].tag + '>'; | ||
| 8688 | d.pop(); | ||
| 8689 | } | ||
| 8690 | } | ||
| 8691 | } else { | ||
| 8692 | // Ignore these | ||
| 8693 | if (/^(br|hr|input|meta|img|link|param)$/i.test(c)) | ||
| 8694 | return a; | ||
| 8695 | |||
| 8696 | // Ignore closed ones | ||
| 8697 | if (/\/>$/.test(a)) | ||
| 8698 | return a; | ||
| 8699 | |||
| 8700 | d.push({tag : c}); // Push start element | ||
| 8701 | } | ||
| 8702 | |||
| 8703 | return a; | ||
| 8704 | }); | ||
| 8705 | |||
| 8706 | // End all open tags | ||
| 8707 | for (i=d.length - 1; i>=0; i--) | ||
| 8708 | s += '</' + d[i].tag + '>'; | ||
| 8709 | |||
| 8710 | return s; | ||
| 8711 | } | ||
| 8712 | |||
| 8713 | }); | ||
| 8714 | })(); | ||
| 8715 | |||
| 8716 | /* file:jscripts/tiny_mce/classes/EditorCommands.js */ | ||
| 8717 | |||
| 8718 | (function() { | ||
| 8719 | var each = tinymce.each, isIE = tinymce.isIE, isGecko = tinymce.isGecko, isOpera = tinymce.isOpera, isWebKit = tinymce.isWebKit; | ||
| 8720 | |||
| 8721 | function isBlock(n) { | ||
| 8722 | return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n.nodeName); | ||
| 8723 | }; | ||
| 8724 | |||
| 8725 | tinymce.create('tinymce.EditorCommands', { | ||
| 8726 | EditorCommands : function(ed) { | ||
| 8727 | this.editor = ed; | ||
| 8728 | }, | ||
| 8729 | |||
| 8730 | execCommand : function(cmd, ui, val) { | ||
| 8731 | var t = this, ed = t.editor, f; | ||
| 8732 | |||
| 8733 | switch (cmd) { | ||
| 8734 | case 'Cut': | ||
| 8735 | case 'Copy': | ||
| 8736 | case 'Paste': | ||
| 8737 | try { | ||
| 8738 | ed.getDoc().execCommand(cmd, ui, val); | ||
| 8739 | } catch (ex) { | ||
| 8740 | if (isGecko) { | ||
| 8741 | ed.windowManager.confirm(ed.getLang('clipboard_msg'), function(s) { | ||
| 8742 | if (s) | ||
| 8743 | window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', 'mceExternal'); | ||
| 8744 | }); | ||
| 8745 | } else | ||
| 8746 | ed.windowManager.alert(ed.getLang('clipboard_no_support')); | ||
| 8747 | } | ||
| 8748 | |||
| 8749 | return true; | ||
| 8750 | |||
| 8751 | // Ignore these | ||
| 8752 | case 'mceResetDesignMode': | ||
| 8753 | case 'mceBeginUndoLevel': | ||
| 8754 | return true; | ||
| 8755 | |||
| 8756 | // Ignore these | ||
| 8757 | case 'unlink': | ||
| 8758 | t.UnLink(); | ||
| 8759 | return true; | ||
| 8760 | |||
| 8761 | // Bundle these together | ||
| 8762 | case 'JustifyLeft': | ||
| 8763 | case 'JustifyCenter': | ||
| 8764 | case 'JustifyRight': | ||
| 8765 | case 'JustifyFull': | ||
| 8766 | t.mceJustify(cmd, cmd.substring(7).toLowerCase()); | ||
| 8767 | return true; | ||
| 8768 | |||
| 8769 | case 'mceEndUndoLevel': | ||
| 8770 | case 'mceAddUndoLevel': | ||
| 8771 | ed.undoManager.add(); | ||
| 8772 | return true; | ||
| 8773 | |||
| 8774 | default: | ||
| 8775 | f = this[cmd]; | ||
| 8776 | |||
| 8777 | if (f) { | ||
| 8778 | f.call(this, ui, val); | ||
| 8779 | return true; | ||
| 8780 | } | ||
| 8781 | } | ||
| 8782 | |||
| 8783 | return false; | ||
| 8784 | }, | ||
| 8785 | |||
| 8786 | Indent : function() { | ||
| 8787 | var ed = this.editor, d = ed.dom, s = ed.selection, e, iv, iu; | ||
| 8788 | |||
| 8789 | // Setup indent level | ||
| 8790 | iv = ed.settings.indentation; | ||
| 8791 | iu = /[a-z%]+$/i.exec(iv); | ||
| 8792 | iv = parseInt(iv); | ||
| 8793 | |||
| 8794 | if (ed.settings.inline_styles && (!this.queryStateInsertUnorderedList() && !this.queryStateInsertOrderedList())) { | ||
| 8795 | each(this._getSelectedBlocks(), function(e) { | ||
| 8796 | d.setStyle(e, 'paddingLeft', (parseInt(e.style.paddingLeft || 0) + iv) + iu); | ||
| 8797 | }); | ||
| 8798 | |||
| 8799 | return; | ||
| 8800 | } | ||
| 8801 | |||
| 8802 | ed.getDoc().execCommand('Indent', false, null); | ||
| 8803 | |||
| 8804 | if (isIE) { | ||
| 8805 | d.getParent(s.getNode(), function(n) { | ||
| 8806 | if (n.nodeName == 'BLOCKQUOTE') { | ||
| 8807 | n.dir = n.style.cssText = ''; | ||
| 8808 | } | ||
| 8809 | }); | ||
| 8810 | } | ||
| 8811 | }, | ||
| 8812 | |||
| 8813 | Outdent : function() { | ||
| 8814 | var ed = this.editor, d = ed.dom, s = ed.selection, e, v, iv, iu; | ||
| 8815 | |||
| 8816 | // Setup indent level | ||
| 8817 | iv = ed.settings.indentation; | ||
| 8818 | iu = /[a-z%]+$/i.exec(iv); | ||
| 8819 | iv = parseInt(iv); | ||
| 8820 | |||
| 8821 | if (ed.settings.inline_styles && (!this.queryStateInsertUnorderedList() && !this.queryStateInsertOrderedList())) { | ||
| 8822 | each(this._getSelectedBlocks(), function(e) { | ||
| 8823 | v = Math.max(0, parseInt(e.style.paddingLeft || 0) - iv); | ||
| 8824 | d.setStyle(e, 'paddingLeft', v ? v + iu : ''); | ||
| 8825 | }); | ||
| 8826 | |||
| 8827 | return; | ||
| 8828 | } | ||
| 8829 | |||
| 8830 | ed.getDoc().execCommand('Outdent', false, null); | ||
| 8831 | }, | ||
| 8832 | |||
| 8833 | mceSetAttribute : function(u, v) { | ||
| 8834 | var ed = this.editor, d = ed.dom, e; | ||
| 8835 | |||
| 8836 | if (e = d.getParent(ed.selection.getNode(), d.isBlock)) | ||
| 8837 | d.setAttrib(e, v.name, v.value); | ||
| 8838 | }, | ||
| 8839 | |||
| 8840 | mceSetContent : function(u, v) { | ||
| 8841 | this.editor.setContent(v); | ||
| 8842 | }, | ||
| 8843 | |||
| 8844 | mceToggleVisualAid : function() { | ||
| 8845 | var ed = this.editor; | ||
| 8846 | |||
| 8847 | ed.hasVisual = !ed.hasVisual; | ||
| 8848 | ed.addVisual(); | ||
| 8849 | }, | ||
| 8850 | |||
| 8851 | mceReplaceContent : function(u, v) { | ||
| 8852 | var s = this.editor.selection; | ||
| 8853 | |||
| 8854 | s.setContent(v.replace(/\{\$selection\}/g, s.getContent({format : 'text'}))); | ||
| 8855 | }, | ||
| 8856 | |||
| 8857 | mceInsertLink : function(u, v) { | ||
| 8858 | var ed = this.editor, s = ed.selection, e = ed.dom.getParent(s.getNode(), 'A'); | ||
| 8859 | |||
| 8860 | if (tinymce.is(v, 'string')) | ||
| 8861 | v = {href : v}; | ||
| 8862 | |||
| 8863 | function set(e) { | ||
| 8864 | each(v, function(v, k) { | ||
| 8865 | ed.dom.setAttrib(e, k, v); | ||
| 8866 | }); | ||
| 8867 | }; | ||
| 8868 | |||
| 8869 | if (!e) { | ||
| 8870 | ed.execCommand('CreateLink', false, 'javascript:mctmp(0);'); | ||
| 8871 | each(ed.dom.select('a'), function(e) { | ||
| 8872 | if (e.href == 'javascript:mctmp(0);') | ||
| 8873 | set(e); | ||
| 8874 | }); | ||
| 8875 | } else { | ||
| 8876 | if (v.href) | ||
| 8877 | set(e); | ||
| 8878 | else | ||
| 8879 | ed.dom.remove(e, 1); | ||
| 8880 | } | ||
| 8881 | }, | ||
| 8882 | |||
| 8883 | UnLink : function() { | ||
| 8884 | var ed = this.editor, s = ed.selection; | ||
| 8885 | |||
| 8886 | if (s.isCollapsed()) | ||
| 8887 | s.select(s.getNode()); | ||
| 8888 | |||
| 8889 | ed.getDoc().execCommand('unlink', false, null); | ||
| 8890 | s.collapse(0); | ||
| 8891 | }, | ||
| 8892 | |||
| 8893 | FontName : function(u, v) { | ||
| 8894 | var t = this, ed = t.editor, s = ed.selection, e; | ||
| 8895 | |||
| 8896 | if (!v) { | ||
| 8897 | if (s.isCollapsed()) | ||
| 8898 | s.select(s.getNode()); | ||
| 8899 | |||
| 8900 | t.RemoveFormat(); | ||
| 8901 | } else { | ||
| 8902 | if (ed.settings.convert_fonts_to_spans) | ||
| 8903 | t._applyInlineStyle('span', {style : {fontFamily : v}}); | ||
| 8904 | else | ||
| 8905 | ed.getDoc().execCommand('FontName', false, v); | ||
| 8906 | } | ||
| 8907 | }, | ||
| 8908 | |||
| 8909 | FontSize : function(u, v) { | ||
| 8910 | var ed = this.editor, s = ed.settings, fc, fs; | ||
| 8911 | |||
| 8912 | // Use style options instead | ||
| 8913 | if (s.convert_fonts_to_spans && v >= 1 && v <= 7) { | ||
| 8914 | fs = tinymce.explode(s.font_size_style_values); | ||
| 8915 | fc = tinymce.explode(s.font_size_classes); | ||
| 8916 | |||
| 8917 | if (fc) | ||
| 8918 | v = fc[v - 1] || v; | ||
| 8919 | else | ||
| 8920 | v = fs[v - 1] || v; | ||
| 8921 | } | ||
| 8922 | |||
| 8923 | if (v >= 1 && v <= 7) | ||
| 8924 | ed.getDoc().execCommand('FontSize', false, v); | ||
| 8925 | else | ||
| 8926 | this._applyInlineStyle('span', {style : {fontSize : v}}); | ||
| 8927 | }, | ||
| 8928 | |||
| 8929 | queryCommandValue : function(c) { | ||
| 8930 | var f = this['queryValue' + c]; | ||
| 8931 | |||
| 8932 | if (f) | ||
| 8933 | return f.call(this, c); | ||
| 8934 | |||
| 8935 | return false; | ||
| 8936 | }, | ||
| 8937 | |||
| 8938 | queryCommandState : function(cmd) { | ||
| 8939 | var f; | ||
| 8940 | |||
| 8941 | switch (cmd) { | ||
| 8942 | // Bundle these together | ||
| 8943 | case 'JustifyLeft': | ||
| 8944 | case 'JustifyCenter': | ||
| 8945 | case 'JustifyRight': | ||
| 8946 | case 'JustifyFull': | ||
| 8947 | return this.queryStateJustify(cmd, cmd.substring(7).toLowerCase()); | ||
| 8948 | |||
| 8949 | default: | ||
| 8950 | if (f = this['queryState' + cmd]) | ||
| 8951 | return f.call(this, cmd); | ||
| 8952 | } | ||
| 8953 | |||
| 8954 | return -1; | ||
| 8955 | }, | ||
| 8956 | |||
| 8957 | _queryState : function(c) { | ||
| 8958 | try { | ||
| 8959 | return this.editor.getDoc().queryCommandState(c); | ||
| 8960 | } catch (ex) { | ||
| 8961 | // Ignore exception | ||
| 8962 | } | ||
| 8963 | }, | ||
| 8964 | |||
| 8965 | _queryVal : function(c) { | ||
| 8966 | try { | ||
| 8967 | return this.editor.getDoc().queryCommandValue(c); | ||
| 8968 | } catch (ex) { | ||
| 8969 | // Ignore exception | ||
| 8970 | } | ||
| 8971 | }, | ||
| 8972 | |||
| 8973 | queryValueFontSize : function() { | ||
| 8974 | var ed = this.editor, v = 0, p; | ||
| 8975 | |||
| 8976 | if (p = ed.dom.getParent(ed.selection.getNode(), 'SPAN')) | ||
| 8977 | v = p.style.fontSize; | ||
| 8978 | |||
| 8979 | if (!v && (isOpera || isWebKit)) { | ||
| 8980 | if (p = ed.dom.getParent(ed.selection.getNode(), 'FONT')) | ||
| 8981 | v = p.size; | ||
| 8982 | |||
| 8983 | return v; | ||
| 8984 | } | ||
| 8985 | |||
| 8986 | return v || this._queryVal('FontSize'); | ||
| 8987 | }, | ||
| 8988 | |||
| 8989 | queryValueFontName : function() { | ||
| 8990 | var ed = this.editor, v = 0, p; | ||
| 8991 | |||
| 8992 | if (p = ed.dom.getParent(ed.selection.getNode(), 'FONT')) | ||
| 8993 | v = p.face; | ||
| 8994 | |||
| 8995 | if (p = ed.dom.getParent(ed.selection.getNode(), 'SPAN')) | ||
| 8996 | v = p.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); | ||
| 8997 | |||
| 8998 | if (!v) | ||
| 8999 | v = this._queryVal('FontName'); | ||
| 9000 | |||
| 9001 | return v; | ||
| 9002 | }, | ||
| 9003 | |||
| 9004 | mceJustify : function(c, v) { | ||
| 9005 | var ed = this.editor, se = ed.selection, n = se.getNode(), nn = n.nodeName, bl, nb, dom = ed.dom, rm; | ||
| 9006 | |||
| 9007 | if (ed.settings.inline_styles && this.queryStateJustify(c, v)) | ||
| 9008 | rm = 1; | ||
| 9009 | |||
| 9010 | bl = dom.getParent(n, ed.dom.isBlock); | ||
| 9011 | |||
| 9012 | if (nn == 'IMG') { | ||
| 9013 | if (v == 'full') | ||
| 9014 | return; | ||
| 9015 | |||
| 9016 | if (rm) { | ||
| 9017 | if (v == 'center') | ||
| 9018 | dom.setStyle(bl || n.parentNode, 'textAlign', ''); | ||
| 9019 | |||
| 9020 | dom.setStyle(n, 'float', ''); | ||
| 9021 | this.mceRepaint(); | ||
| 9022 | return; | ||
| 9023 | } | ||
| 9024 | |||
| 9025 | if (v == 'center') { | ||
| 9026 | // Do not change table elements | ||
| 9027 | if (bl && /^(TD|TH)$/.test(bl.nodeName)) | ||
| 9028 | bl = 0; | ||
| 9029 | |||
| 9030 | if (!bl || bl.childNodes.length > 1) { | ||
| 9031 | nb = dom.create('p'); | ||
| 9032 | nb.appendChild(n.cloneNode(false)); | ||
| 9033 | |||
| 9034 | if (bl) | ||
| 9035 | dom.insertAfter(nb, bl); | ||
| 9036 | else | ||
| 9037 | dom.insertAfter(nb, n); | ||
| 9038 | |||
| 9039 | dom.remove(n); | ||
| 9040 | n = nb.firstChild; | ||
| 9041 | bl = nb; | ||
| 9042 | } | ||
| 9043 | |||
| 9044 | dom.setStyle(bl, 'textAlign', v); | ||
| 9045 | dom.setStyle(n, 'float', ''); | ||
| 9046 | } else { | ||
| 9047 | dom.setStyle(n, 'float', v); | ||
| 9048 | dom.setStyle(bl || n.parentNode, 'textAlign', ''); | ||
| 9049 | } | ||
| 9050 | |||
| 9051 | this.mceRepaint(); | ||
| 9052 | return; | ||
| 9053 | } | ||
| 9054 | |||
| 9055 | // Handle the alignment outselfs, less quirks in all browsers | ||
| 9056 | if (ed.settings.inline_styles && ed.settings.forced_root_block) { | ||
| 9057 | if (rm) | ||
| 9058 | v = ''; | ||
| 9059 | |||
| 9060 | each(this._getSelectedBlocks(dom.getParent(se.getStart(), dom.isBlock), dom.getParent(se.getEnd(), dom.isBlock)), function(e) { | ||
| 9061 | dom.setAttrib(e, 'align', ''); | ||
| 9062 | dom.setStyle(e, 'textAlign', v == 'full' ? 'justify' : v); | ||
| 9063 | }); | ||
| 9064 | |||
| 9065 | return; | ||
| 9066 | } else if (!rm) | ||
| 9067 | ed.getDoc().execCommand(c, false, null); | ||
| 9068 | |||
| 9069 | if (ed.settings.inline_styles) { | ||
| 9070 | if (rm) { | ||
| 9071 | dom.getParent(ed.selection.getNode(), function(n) { | ||
| 9072 | if (n.style && n.style.textAlign) | ||
| 9073 | dom.setStyle(n, 'textAlign', ''); | ||
| 9074 | }); | ||
| 9075 | |||
| 9076 | return; | ||
| 9077 | } | ||
| 9078 | |||
| 9079 | each(dom.select('*'), function(n) { | ||
| 9080 | var v = n.align; | ||
| 9081 | |||
| 9082 | if (v) { | ||
| 9083 | if (v == 'full') | ||
| 9084 | v = 'justify'; | ||
| 9085 | |||
| 9086 | dom.setStyle(n, 'textAlign', v); | ||
| 9087 | dom.setAttrib(n, 'align', ''); | ||
| 9088 | } | ||
| 9089 | }); | ||
| 9090 | } | ||
| 9091 | }, | ||
| 9092 | |||
| 9093 | mceSetCSSClass : function(u, v) { | ||
| 9094 | this.mceSetStyleInfo(0, {command : 'setattrib', name : 'class', value : v}); | ||
| 9095 | }, | ||
| 9096 | |||
| 9097 | getSelectedElement : function() { | ||
| 9098 | var t = this, ed = t.editor, dom = ed.dom, se = ed.selection, r = se.getRng(), r1, r2, sc, ec, so, eo, e, sp, ep, re; | ||
| 9099 | |||
| 9100 | if (se.isCollapsed() || r.item) | ||
| 9101 | return se.getNode(); | ||
| 9102 | |||
| 9103 | // Setup regexp | ||
| 9104 | re = ed.settings.merge_styles_invalid_parents; | ||
| 9105 | if (tinymce.is(re, 'string')) | ||
| 9106 | re = new RegExp(re, 'i'); | ||
| 9107 | |||
| 9108 | if (isIE) { | ||
| 9109 | r1 = r.duplicate(); | ||
| 9110 | r1.collapse(true); | ||
| 9111 | sc = r1.parentElement(); | ||
| 9112 | |||
| 9113 | r2 = r.duplicate(); | ||
| 9114 | r2.collapse(false); | ||
| 9115 | ec = r2.parentElement(); | ||
| 9116 | |||
| 9117 | if (sc != ec) { | ||
| 9118 | r1.move('character', 1); | ||
| 9119 | sc = r1.parentElement(); | ||
| 9120 | } | ||
| 9121 | |||
| 9122 | if (sc == ec) { | ||
| 9123 | r1 = r.duplicate(); | ||
| 9124 | r1.moveToElementText(sc); | ||
| 9125 | |||
| 9126 | if (r1.compareEndPoints('StartToStart', r) == 0 && r1.compareEndPoints('EndToEnd', r) == 0) | ||
| 9127 | return re && re.test(sc.nodeName) ? null : sc; | ||
| 9128 | } | ||
| 9129 | } else { | ||
| 9130 | function getParent(n) { | ||
| 9131 | return dom.getParent(n, function(n) {return n.nodeType == 1;}); | ||
| 9132 | }; | ||
| 9133 | |||
| 9134 | sc = r.startContainer; | ||
| 9135 | ec = r.endContainer; | ||
| 9136 | so = r.startOffset; | ||
| 9137 | eo = r.endOffset; | ||
| 9138 | |||
| 9139 | if (!r.collapsed) { | ||
| 9140 | if (sc == ec) { | ||
| 9141 | if (so - eo < 2) { | ||
| 9142 | if (sc.hasChildNodes()) { | ||
| 9143 | sp = sc.childNodes[so]; | ||
| 9144 | return re && re.test(sp.nodeName) ? null : sp; | ||
| 9145 | } | ||
| 9146 | } | ||
| 9147 | } | ||
| 9148 | } | ||
| 9149 | |||
| 9150 | if (sc.nodeType != 3 || ec.nodeType != 3) | ||
| 9151 | return null; | ||
| 9152 | |||
| 9153 | if (so == 0) { | ||
| 9154 | sp = getParent(sc); | ||
| 9155 | |||
| 9156 | if (sp && sp.firstChild != sc) | ||
| 9157 | sp = null; | ||
| 9158 | } | ||
| 9159 | |||
| 9160 | if (so == sc.nodeValue.length) { | ||
| 9161 | e = sc.nextSibling; | ||
| 9162 | |||
| 9163 | if (e && e.nodeType == 1) | ||
| 9164 | sp = sc.nextSibling; | ||
| 9165 | } | ||
| 9166 | |||
| 9167 | if (eo == 0) { | ||
| 9168 | e = ec.previousSibling; | ||
| 9169 | |||
| 9170 | if (e && e.nodeType == 1) | ||
| 9171 | ep = e; | ||
| 9172 | } | ||
| 9173 | |||
| 9174 | if (eo == ec.nodeValue.length) { | ||
| 9175 | ep = getParent(ec); | ||
| 9176 | |||
| 9177 | if (ep && ep.lastChild != ec) | ||
| 9178 | ep = null; | ||
| 9179 | } | ||
| 9180 | |||
| 9181 | // Same element | ||
| 9182 | if (sp == ep) | ||
| 9183 | return re && sp && re.test(sp.nodeName) ? null : sp; | ||
| 9184 | } | ||
| 9185 | |||
| 9186 | return null; | ||
| 9187 | }, | ||
| 9188 | |||
| 9189 | InsertHorizontalRule : function() { | ||
| 9190 | // Fix for Gecko <hr size="1" /> issue and IE bug rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"); | ||
| 9191 | if (isGecko || isIE) | ||
| 9192 | this.editor.selection.setContent('<hr />'); | ||
| 9193 | else | ||
| 9194 | this.editor.getDoc().execCommand('InsertHorizontalRule', false, ''); | ||
| 9195 | }, | ||
| 9196 | |||
| 9197 | RemoveFormat : function() { | ||
| 9198 | var t = this, ed = t.editor, s = ed.selection, b; | ||
| 9199 | |||
| 9200 | // Safari breaks tables | ||
| 9201 | if (isWebKit) | ||
| 9202 | s.setContent(s.getContent({format : 'raw'}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g, ''), {format : 'raw'}); | ||
| 9203 | else | ||
| 9204 | ed.getDoc().execCommand('RemoveFormat', false, null); | ||
| 9205 | |||
| 9206 | t.mceSetStyleInfo(0, {command : 'removeformat'}); | ||
| 9207 | ed.addVisual(); | ||
| 9208 | }, | ||
| 9209 | |||
| 9210 | mceSetStyleInfo : function(u, v) { | ||
| 9211 | var t = this, ed = t.editor, d = ed.getDoc(), dom = ed.dom, e, b, s = ed.selection, nn = v.wrapper || 'span', b = s.getBookmark(), re; | ||
| 9212 | |||
| 9213 | function set(n, e) { | ||
| 9214 | if (n.nodeType == 1) { | ||
| 9215 | switch (v.command) { | ||
| 9216 | case 'setattrib': | ||
| 9217 | return dom.setAttrib(n, v.name, v.value); | ||
| 9218 | |||
| 9219 | case 'setstyle': | ||
| 9220 | return dom.setStyle(n, v.name, v.value); | ||
| 9221 | |||
| 9222 | case 'removeformat': | ||
| 9223 | return dom.setAttrib(n, 'class', ''); | ||
| 9224 | } | ||
| 9225 | } | ||
| 9226 | }; | ||
| 9227 | |||
| 9228 | // Setup regexp | ||
| 9229 | re = ed.settings.merge_styles_invalid_parents; | ||
| 9230 | if (tinymce.is(re, 'string')) | ||
| 9231 | re = new RegExp(re, 'i'); | ||
| 9232 | |||
| 9233 | // Set style info on selected element | ||
| 9234 | if ((e = t.getSelectedElement()) && !ed.settings.force_span_wrappers) | ||
| 9235 | set(e, 1); | ||
| 9236 | else { | ||
| 9237 | // Generate wrappers and set styles on them | ||
| 9238 | d.execCommand('FontName', false, '__'); | ||
| 9239 | each(isWebKit ? dom.select('span') : dom.select('font'), function(n) { | ||
| 9240 | var sp, e; | ||
| 9241 | |||
| 9242 | if (dom.getAttrib(n, 'face') == '__' || n.style.fontFamily === '__') { | ||
| 9243 | sp = dom.create(nn, {mce_new : '1'}); | ||
| 9244 | |||
| 9245 | set(sp); | ||
| 9246 | |||
| 9247 | each (n.childNodes, function(n) { | ||
| 9248 | sp.appendChild(n.cloneNode(true)); | ||
| 9249 | }); | ||
| 9250 | |||
| 9251 | dom.replace(sp, n); | ||
| 9252 | } | ||
| 9253 | }); | ||
| 9254 | } | ||
| 9255 | |||
| 9256 | // Remove wrappers inside new ones | ||
| 9257 | each(dom.select(nn).reverse(), function(n) { | ||
| 9258 | var p = n.parentNode; | ||
| 9259 | |||
| 9260 | // Check if it's an old span in a new wrapper | ||
| 9261 | if (!dom.getAttrib(n, 'mce_new')) { | ||
| 9262 | // Find new wrapper | ||
| 9263 | p = dom.getParent(n, function(n) { | ||
| 9264 | return n.nodeType == 1 && dom.getAttrib(n, 'mce_new'); | ||
| 9265 | }); | ||
| 9266 | |||
| 9267 | if (p) | ||
| 9268 | dom.remove(n, 1); | ||
| 9269 | } | ||
| 9270 | }); | ||
| 9271 | |||
| 9272 | // Merge wrappers with parent wrappers | ||
| 9273 | each(dom.select(nn).reverse(), function(n) { | ||
| 9274 | var p = n.parentNode; | ||
| 9275 | |||
| 9276 | if (!p || !dom.getAttrib(n, 'mce_new')) | ||
| 9277 | return; | ||
| 9278 | |||
| 9279 | if (ed.settings.force_span_wrappers && p.nodeName != 'SPAN') | ||
| 9280 | return; | ||
| 9281 | |||
| 9282 | // Has parent of the same type and only child | ||
| 9283 | if (p.nodeName == nn.toUpperCase() && p.childNodes.length == 1) | ||
| 9284 | return dom.remove(p, 1); | ||
| 9285 | |||
| 9286 | // Has parent that is more suitable to have the class and only child | ||
| 9287 | if (n.nodeType == 1 && (!re || !re.test(p.nodeName)) && p.childNodes.length == 1) { | ||
| 9288 | set(p); // Set style info on parent instead | ||
| 9289 | dom.setAttrib(n, 'class', ''); | ||
| 9290 | } | ||
| 9291 | }); | ||
| 9292 | |||
| 9293 | // Remove empty wrappers | ||
| 9294 | each(dom.select(nn).reverse(), function(n) { | ||
| 9295 | if (dom.getAttrib(n, 'mce_new') || (dom.getAttribs(n).length <= 1 && n.className === '')) { | ||
| 9296 | if (!dom.getAttrib(n, 'class') && !dom.getAttrib(n, 'style')) | ||
| 9297 | return dom.remove(n, 1); | ||
| 9298 | |||
| 9299 | dom.setAttrib(n, 'mce_new', ''); // Remove mce_new marker | ||
| 9300 | } | ||
| 9301 | }); | ||
| 9302 | |||
| 9303 | s.moveToBookmark(b); | ||
| 9304 | }, | ||
| 9305 | |||
| 9306 | queryStateJustify : function(c, v) { | ||
| 9307 | var ed = this.editor, n = ed.selection.getNode(), dom = ed.dom; | ||
| 9308 | |||
| 9309 | if (n && n.nodeName == 'IMG') { | ||
| 9310 | if (dom.getStyle(n, 'float') == v) | ||
| 9311 | return 1; | ||
| 9312 | |||
| 9313 | return n.parentNode.style.textAlign == v; | ||
| 9314 | } | ||
| 9315 | |||
| 9316 | n = dom.getParent(ed.selection.getStart(), function(n) { | ||
| 9317 | return n.nodeType == 1 && n.style.textAlign; | ||
| 9318 | }); | ||
| 9319 | |||
| 9320 | if (v == 'full') | ||
| 9321 | v = 'justify'; | ||
| 9322 | |||
| 9323 | if (ed.settings.inline_styles) | ||
| 9324 | return (n && n.style.textAlign == v); | ||
| 9325 | |||
| 9326 | return this._queryState(c); | ||
| 9327 | }, | ||
| 9328 | |||
| 9329 | ForeColor : function(ui, v) { | ||
| 9330 | var ed = this.editor; | ||
| 9331 | |||
| 9332 | if (ed.settings.convert_fonts_to_spans) { | ||
| 9333 | this._applyInlineStyle('span', {style : {color : v}}); | ||
| 9334 | return; | ||
| 9335 | } else | ||
| 9336 | ed.getDoc().execCommand('ForeColor', false, v); | ||
| 9337 | }, | ||
| 9338 | |||
| 9339 | HiliteColor : function(ui, val) { | ||
| 9340 | var t = this, ed = t.editor, d = ed.getDoc(); | ||
| 9341 | |||
| 9342 | if (ed.settings.convert_fonts_to_spans) { | ||
| 9343 | this._applyInlineStyle('span', {style : {backgroundColor : val}}); | ||
| 9344 | return; | ||
| 9345 | } | ||
| 9346 | |||
| 9347 | function set(s) { | ||
| 9348 | if (!isGecko) | ||
| 9349 | return; | ||
| 9350 | |||
| 9351 | try { | ||
| 9352 | // Try new Gecko method | ||
| 9353 | d.execCommand("styleWithCSS", 0, s); | ||
| 9354 | } catch (ex) { | ||
| 9355 | // Use old | ||
| 9356 | d.execCommand("useCSS", 0, !s); | ||
| 9357 | } | ||
| 9358 | }; | ||
| 9359 | |||
| 9360 | if (isGecko || isOpera) { | ||
| 9361 | set(true); | ||
| 9362 | d.execCommand('hilitecolor', false, val); | ||
| 9363 | set(false); | ||
| 9364 | } else | ||
| 9365 | d.execCommand('BackColor', false, val); | ||
| 9366 | }, | ||
| 9367 | |||
| 9368 | Undo : function() { | ||
| 9369 | var ed = this.editor; | ||
| 9370 | |||
| 9371 | if (ed.settings.custom_undo_redo) { | ||
| 9372 | ed.undoManager.undo(); | ||
| 9373 | ed.nodeChanged(); | ||
| 9374 | } else | ||
| 9375 | ed.getDoc().execCommand('Undo', false, null); | ||
| 9376 | }, | ||
| 9377 | |||
| 9378 | Redo : function() { | ||
| 9379 | var ed = this.editor; | ||
| 9380 | |||
| 9381 | if (ed.settings.custom_undo_redo) { | ||
| 9382 | ed.undoManager.redo(); | ||
| 9383 | ed.nodeChanged(); | ||
| 9384 | } else | ||
| 9385 | ed.getDoc().execCommand('Redo', false, null); | ||
| 9386 | }, | ||
| 9387 | |||
| 9388 | FormatBlock : function(ui, val) { | ||
| 9389 | var t = this, ed = t.editor, s = ed.selection, dom = ed.dom, bl, nb, b; | ||
| 9390 | |||
| 9391 | function isBlock(n) { | ||
| 9392 | return /^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(n.nodeName); | ||
| 9393 | }; | ||
| 9394 | |||
| 9395 | bl = dom.getParent(s.getNode(), function(n) { | ||
| 9396 | return isBlock(n); | ||
| 9397 | }); | ||
| 9398 | |||
| 9399 | // IE has an issue where it removes the parent div if you change format on the paragrah in <div><p>Content</p></div> | ||
| 9400 | // FF and Opera doesn't change parent DIV elements if you switch format | ||
| 9401 | if (bl) { | ||
| 9402 | if ((isIE && isBlock(bl.parentNode)) || bl.nodeName == 'DIV') { | ||
| 9403 | // Rename block element | ||
| 9404 | nb = ed.dom.create(val); | ||
| 9405 | |||
| 9406 | each(dom.getAttribs(bl), function(v) { | ||
| 9407 | dom.setAttrib(nb, v.nodeName, dom.getAttrib(bl, v.nodeName)); | ||
| 9408 | }); | ||
| 9409 | |||
| 9410 | b = s.getBookmark(); | ||
| 9411 | dom.replace(nb, bl, 1); | ||
| 9412 | s.moveToBookmark(b); | ||
| 9413 | ed.nodeChanged(); | ||
| 9414 | return; | ||
| 9415 | } | ||
| 9416 | } | ||
| 9417 | |||
| 9418 | val = ed.settings.forced_root_block ? (val || '<p>') : val; | ||
| 9419 | |||
| 9420 | if (val.indexOf('<') == -1) | ||
| 9421 | val = '<' + val + '>'; | ||
| 9422 | |||
| 9423 | if (tinymce.isGecko) | ||
| 9424 | val = val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi, '$1'); | ||
| 9425 | |||
| 9426 | ed.getDoc().execCommand('FormatBlock', false, val); | ||
| 9427 | }, | ||
| 9428 | |||
| 9429 | mceCleanup : function() { | ||
| 9430 | var ed = this.editor, s = ed.selection, b = s.getBookmark(); | ||
| 9431 | ed.setContent(ed.getContent()); | ||
| 9432 | s.moveToBookmark(b); | ||
| 9433 | }, | ||
| 9434 | |||
| 9435 | mceRemoveNode : function(ui, val) { | ||
| 9436 | var ed = this.editor, s = ed.selection, b, n = val || s.getNode(); | ||
| 9437 | |||
| 9438 | // Make sure that the body node isn't removed | ||
| 9439 | if (n == ed.getBody()) | ||
| 9440 | return; | ||
| 9441 | |||
| 9442 | b = s.getBookmark(); | ||
| 9443 | ed.dom.remove(n, 1); | ||
| 9444 | s.moveToBookmark(b); | ||
| 9445 | ed.nodeChanged(); | ||
| 9446 | }, | ||
| 9447 | |||
| 9448 | mceSelectNodeDepth : function(ui, val) { | ||
| 9449 | var ed = this.editor, s = ed.selection, c = 0; | ||
| 9450 | |||
| 9451 | ed.dom.getParent(s.getNode(), function(n) { | ||
| 9452 | if (n.nodeType == 1 && c++ == val) { | ||
| 9453 | s.select(n); | ||
| 9454 | ed.nodeChanged(); | ||
| 9455 | return false; | ||
| 9456 | } | ||
| 9457 | }, ed.getBody()); | ||
| 9458 | }, | ||
| 9459 | |||
| 9460 | mceSelectNode : function(u, v) { | ||
| 9461 | this.editor.selection.select(v); | ||
| 9462 | }, | ||
| 9463 | |||
| 9464 | mceInsertContent : function(ui, val) { | ||
| 9465 | this.editor.selection.setContent(val); | ||
| 9466 | }, | ||
| 9467 | |||
| 9468 | mceInsertRawHTML : function(ui, val) { | ||
| 9469 | var ed = this.editor; | ||
| 9470 | |||
| 9471 | ed.selection.setContent('tiny_mce_marker'); | ||
| 9472 | ed.setContent(ed.getContent().replace(/tiny_mce_marker/g, val)); | ||
| 9473 | }, | ||
| 9474 | |||
| 9475 | mceRepaint : function() { | ||
| 9476 | var s, b, e = this.editor; | ||
| 9477 | |||
| 9478 | if (tinymce.isGecko) { | ||
| 9479 | try { | ||
| 9480 | s = e.selection; | ||
| 9481 | b = s.getBookmark(true); | ||
| 9482 | |||
| 9483 | if (s.getSel()) | ||
| 9484 | s.getSel().selectAllChildren(e.getBody()); | ||
| 9485 | |||
| 9486 | s.collapse(true); | ||
| 9487 | s.moveToBookmark(b); | ||
| 9488 | } catch (ex) { | ||
| 9489 | // Ignore | ||
| 9490 | } | ||
| 9491 | } | ||
| 9492 | }, | ||
| 9493 | |||
| 9494 | queryStateUnderline : function() { | ||
| 9495 | var ed = this.editor, n = ed.selection.getNode(); | ||
| 9496 | |||
| 9497 | if (n && n.nodeName == 'A') | ||
| 9498 | return false; | ||
| 9499 | |||
| 9500 | return this._queryState('Underline'); | ||
| 9501 | }, | ||
| 9502 | |||
| 9503 | queryStateOutdent : function() { | ||
| 9504 | var ed = this.editor, n; | ||
| 9505 | |||
| 9506 | if (ed.settings.inline_styles) { | ||
| 9507 | if ((n = ed.dom.getParent(ed.selection.getStart(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0) | ||
| 9508 | return true; | ||
| 9509 | |||
| 9510 | if ((n = ed.dom.getParent(ed.selection.getEnd(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0) | ||
| 9511 | return true; | ||
| 9512 | } | ||
| 9513 | |||
| 9514 | return this.queryStateInsertUnorderedList() || this.queryStateInsertOrderedList() || (!ed.settings.inline_styles && !!ed.dom.getParent(ed.selection.getNode(), 'BLOCKQUOTE')); | ||
| 9515 | }, | ||
| 9516 | |||
| 9517 | queryStateInsertUnorderedList : function() { | ||
| 9518 | return this.editor.dom.getParent(this.editor.selection.getNode(), 'UL'); | ||
| 9519 | }, | ||
| 9520 | |||
| 9521 | queryStateInsertOrderedList : function() { | ||
| 9522 | return this.editor.dom.getParent(this.editor.selection.getNode(), 'OL'); | ||
| 9523 | }, | ||
| 9524 | |||
| 9525 | queryStatemceBlockQuote : function() { | ||
| 9526 | return !!this.editor.dom.getParent(this.editor.selection.getStart(), function(n) {return n.nodeName === 'BLOCKQUOTE';}); | ||
| 9527 | }, | ||
| 9528 | |||
| 9529 | mceBlockQuote : function() { | ||
| 9530 | var t = this, ed = t.editor, s = ed.selection, dom = ed.dom, sb, eb, n, bm, bq, r, bq2, i, nl; | ||
| 9531 | |||
| 9532 | function getBQ(e) { | ||
| 9533 | return dom.getParent(e, function(n) {return n.nodeName === 'BLOCKQUOTE';}); | ||
| 9534 | }; | ||
| 9535 | |||
| 9536 | // Get start/end block | ||
| 9537 | sb = dom.getParent(s.getStart(), isBlock); | ||
| 9538 | eb = dom.getParent(s.getEnd(), isBlock); | ||
| 9539 | |||
| 9540 | // Remove blockquote(s) | ||
| 9541 | if (bq = getBQ(sb)) { | ||
| 9542 | if (sb != eb || sb.childNodes.length > 1 || (sb.childNodes.length == 1 && sb.firstChild.nodeName != 'BR')) | ||
| 9543 | bm = s.getBookmark(); | ||
| 9544 | |||
| 9545 | // Move all elements after the end block into new bq | ||
| 9546 | if (getBQ(eb)) { | ||
| 9547 | bq2 = bq.cloneNode(false); | ||
| 9548 | |||
| 9549 | while (n = eb.nextSibling) | ||
| 9550 | bq2.appendChild(n.parentNode.removeChild(n)); | ||
| 9551 | } | ||
| 9552 | |||
| 9553 | // Add new bq after | ||
| 9554 | if (bq2) | ||
| 9555 | dom.insertAfter(bq2, bq); | ||
| 9556 | |||
| 9557 | // Move all selected blocks after the current bq | ||
| 9558 | nl = t._getSelectedBlocks(sb, eb); | ||
| 9559 | for (i = nl.length - 1; i >= 0; i--) { | ||
| 9560 | dom.insertAfter(nl[i], bq); | ||
| 9561 | } | ||
| 9562 | |||
| 9563 | // Empty bq, then remove it | ||
| 9564 | if (/^\s*$/.test(bq.innerHTML)) | ||
| 9565 | dom.remove(bq, 1); // Keep children so boomark restoration works correctly | ||
| 9566 | |||
| 9567 | // Empty bq, then remote it | ||
| 9568 | if (bq2 && /^\s*$/.test(bq2.innerHTML)) | ||
| 9569 | dom.remove(bq2, 1); // Keep children so boomark restoration works correctly | ||
| 9570 | |||
| 9571 | if (!bm) { | ||
| 9572 | // Move caret inside empty block element | ||
| 9573 | if (!isIE) { | ||
| 9574 | r = ed.getDoc().createRange(); | ||
| 9575 | r.setStart(sb, 0); | ||
| 9576 | r.setEnd(sb, 0); | ||
| 9577 | s.setRng(r); | ||
| 9578 | } else { | ||
| 9579 | s.select(sb); | ||
| 9580 | s.collapse(0); | ||
| 9581 | |||
| 9582 | // IE misses the empty block some times element so we must move back the caret | ||
| 9583 | if (dom.getParent(s.getStart(), isBlock) != sb) { | ||
| 9584 | r = s.getRng(); | ||
| 9585 | r.move('character', -1); | ||
| 9586 | r.select(); | ||
| 9587 | } | ||
| 9588 | } | ||
| 9589 | } else | ||
| 9590 | t.editor.selection.moveToBookmark(bm); | ||
| 9591 | |||
| 9592 | return; | ||
| 9593 | } | ||
| 9594 | |||
| 9595 | // Since IE can start with a totally empty document we need to add the first bq and paragraph | ||
| 9596 | if (isIE && !sb && !eb) { | ||
| 9597 | t.editor.getDoc().execCommand('Indent'); | ||
| 9598 | n = getBQ(s.getNode()); | ||
| 9599 | n.style.margin = n.dir = ''; // IE adds margin and dir to bq | ||
| 9600 | return; | ||
| 9601 | } | ||
| 9602 | |||
| 9603 | if (!sb || !eb) | ||
| 9604 | return; | ||
| 9605 | |||
| 9606 | // If empty paragraph node then do not use bookmark | ||
| 9607 | if (sb != eb || sb.childNodes.length > 1 || (sb.childNodes.length == 1 && sb.firstChild.nodeName != 'BR')) | ||
| 9608 | bm = s.getBookmark(); | ||
| 9609 | |||
| 9610 | // Move selected block elements into a bq | ||
| 9611 | each(t._getSelectedBlocks(getBQ(s.getStart()), getBQ(s.getEnd())), function(e) { | ||
| 9612 | // Found existing BQ add to this one | ||
| 9613 | if (e.nodeName == 'BLOCKQUOTE' && !bq) { | ||
| 9614 | bq = e; | ||
| 9615 | return; | ||
| 9616 | } | ||
| 9617 | |||
| 9618 | // No BQ found, create one | ||
| 9619 | if (!bq) { | ||
| 9620 | bq = dom.create('blockquote'); | ||
| 9621 | e.parentNode.insertBefore(bq, e); | ||
| 9622 | } | ||
| 9623 | |||
| 9624 | // Add children from existing BQ | ||
| 9625 | if (e.nodeName == 'BLOCKQUOTE' && bq) { | ||
| 9626 | n = e.firstChild; | ||
| 9627 | |||
| 9628 | while (n) { | ||
| 9629 | bq.appendChild(n.cloneNode(true)); | ||
| 9630 | n = n.nextSibling; | ||
| 9631 | } | ||
| 9632 | |||
| 9633 | dom.remove(e); | ||
| 9634 | return; | ||
| 9635 | } | ||
| 9636 | |||
| 9637 | // Add non BQ element to BQ | ||
| 9638 | bq.appendChild(dom.remove(e)); | ||
| 9639 | }); | ||
| 9640 | |||
| 9641 | if (!bm) { | ||
| 9642 | // Move caret inside empty block element | ||
| 9643 | if (!isIE) { | ||
| 9644 | r = ed.getDoc().createRange(); | ||
| 9645 | r.setStart(sb, 0); | ||
| 9646 | r.setEnd(sb, 0); | ||
| 9647 | s.setRng(r); | ||
| 9648 | } else { | ||
| 9649 | s.select(sb); | ||
| 9650 | s.collapse(1); | ||
| 9651 | } | ||
| 9652 | } else | ||
| 9653 | s.moveToBookmark(bm); | ||
| 9654 | }, | ||
| 9655 | |||
| 9656 | _applyInlineStyle : function(na, at, op) { | ||
| 9657 | var t = this, ed = t.editor, dom = ed.dom, bm, lo = {}, kh; | ||
| 9658 | |||
| 9659 | na = na.toUpperCase(); | ||
| 9660 | |||
| 9661 | if (op && op.check_classes && at['class']) | ||
| 9662 | op.check_classes.push(at['class']); | ||
| 9663 | |||
| 9664 | function replaceFonts() { | ||
| 9665 | var bm; | ||
| 9666 | |||
| 9667 | each(dom.select(tinymce.isWebKit && !tinymce.isAir ? 'span' : 'font'), function(n) { | ||
| 9668 | if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') { | ||
| 9669 | if (!bm) | ||
| 9670 | bm = ed.selection.getBookmark(); | ||
| 9671 | |||
| 9672 | at._mce_new = '1'; | ||
| 9673 | dom.replace(dom.create(na, at), n, 1); | ||
| 9674 | } | ||
| 9675 | }); | ||
| 9676 | |||
| 9677 | // Remove redundant elements | ||
| 9678 | each(dom.select(na), function(n) { | ||
| 9679 | if (n.getAttribute('_mce_new')) { | ||
| 9680 | function removeStyle(n) { | ||
| 9681 | if (n.nodeType == 1) { | ||
| 9682 | each(at.style, function(v, k) { | ||
| 9683 | dom.setStyle(n, k, ''); | ||
| 9684 | }); | ||
| 9685 | |||
| 9686 | // Remove spans with the same class or marked classes | ||
| 9687 | if (at['class'] && n.className && op) { | ||
| 9688 | each(op.check_classes, function(c) { | ||
| 9689 | if (dom.hasClass(n, c)) | ||
| 9690 | dom.removeClass(n, c); | ||
| 9691 | }); | ||
| 9692 | } | ||
| 9693 | } | ||
| 9694 | }; | ||
| 9695 | |||
| 9696 | // Remove specified style information from child elements | ||
| 9697 | each(dom.select(na, n), removeStyle); | ||
| 9698 | |||
| 9699 | // Remove the specified style information on parent if current node is only child (IE) | ||
| 9700 | if (n.parentNode && n.parentNode.nodeType == 1 && n.parentNode.childNodes.length == 1) | ||
| 9701 | removeStyle(n.parentNode); | ||
| 9702 | |||
| 9703 | // Remove the child elements style info if a parent already has it | ||
| 9704 | dom.getParent(n.parentNode, function(pn) { | ||
| 9705 | if (pn.nodeType == 1) { | ||
| 9706 | if (at.style) { | ||
| 9707 | each(at.style, function(v, k) { | ||
| 9708 | var sv; | ||
| 9709 | |||
| 9710 | if (!lo[k] && (sv = dom.getStyle(pn, k))) { | ||
| 9711 | if (sv === v) | ||
| 9712 | dom.setStyle(n, k, ''); | ||
| 9713 | |||
| 9714 | lo[k] = 1; | ||
| 9715 | } | ||
| 9716 | }); | ||
| 9717 | } | ||
| 9718 | |||
| 9719 | // Remove spans with the same class or marked classes | ||
| 9720 | if (at['class'] && pn.className && op) { | ||
| 9721 | each(op.check_classes, function(c) { | ||
| 9722 | if (dom.hasClass(pn, c)) | ||
| 9723 | dom.removeClass(n, c); | ||
| 9724 | }); | ||
| 9725 | } | ||
| 9726 | } | ||
| 9727 | |||
| 9728 | return false; | ||
| 9729 | }); | ||
| 9730 | |||
| 9731 | n.removeAttribute('_mce_new'); | ||
| 9732 | } | ||
| 9733 | }); | ||
| 9734 | |||
| 9735 | // Remove empty span elements | ||
| 9736 | each(dom.select(na).reverse(), function(n) { | ||
| 9737 | var c = 0; | ||
| 9738 | |||
| 9739 | // Check if there is any attributes | ||
| 9740 | each(dom.getAttribs(n), function(an) { | ||
| 9741 | if (an.nodeName.substring(0, 1) != '_' && dom.getAttrib(n, an.nodeName) != '') { | ||
| 9742 | //console.log(dom.getOuterHTML(n), dom.getAttrib(n, an.nodeName)); | ||
| 9743 | c++; | ||
| 9744 | } | ||
| 9745 | }); | ||
| 9746 | |||
| 9747 | // No attributes then remove the element and keep the children | ||
| 9748 | if (c == 0) | ||
| 9749 | dom.remove(n, 1); | ||
| 9750 | }); | ||
| 9751 | |||
| 9752 | ed.selection.moveToBookmark(bm); | ||
| 9753 | |||
| 9754 | return !!bm; | ||
| 9755 | }; | ||
| 9756 | |||
| 9757 | // Create inline elements | ||
| 9758 | ed.focus(); | ||
| 9759 | ed.getDoc().execCommand('FontName', false, 'mceinline'); | ||
| 9760 | replaceFonts(); | ||
| 9761 | |||
| 9762 | if (kh = t._applyInlineStyle.keyhandler) { | ||
| 9763 | ed.onKeyUp.remove(kh); | ||
| 9764 | ed.onKeyPress.remove(kh); | ||
| 9765 | ed.onKeyDown.remove(kh); | ||
| 9766 | ed.onSetContent.remove(t._applyInlineStyle.chandler); | ||
| 9767 | } | ||
| 9768 | |||
| 9769 | if (ed.selection.isCollapsed()) { | ||
| 9770 | // Start collecting styles | ||
| 9771 | t._pendingStyles = tinymce.extend(t._pendingStyles || {}, at.style); | ||
| 9772 | |||
| 9773 | t._applyInlineStyle.chandler = ed.onSetContent.add(function() { | ||
| 9774 | delete t._pendingStyles; | ||
| 9775 | }); | ||
| 9776 | |||
| 9777 | t._applyInlineStyle.keyhandler = kh = function(e) { | ||
| 9778 | // Use pending styles | ||
| 9779 | if (t._pendingStyles) { | ||
| 9780 | at.style = t._pendingStyles; | ||
| 9781 | delete t._pendingStyles; | ||
| 9782 | } | ||
| 9783 | |||
| 9784 | if (replaceFonts()) { | ||
| 9785 | ed.onKeyDown.remove(t._applyInlineStyle.keyhandler); | ||
| 9786 | ed.onKeyPress.remove(t._applyInlineStyle.keyhandler); | ||
| 9787 | } | ||
| 9788 | |||
| 9789 | if (e.type == 'keyup') | ||
| 9790 | ed.onKeyUp.remove(t._applyInlineStyle.keyhandler); | ||
| 9791 | }; | ||
| 9792 | |||
| 9793 | ed.onKeyDown.add(kh); | ||
| 9794 | ed.onKeyPress.add(kh); | ||
| 9795 | ed.onKeyUp.add(kh); | ||
| 9796 | } else | ||
| 9797 | t._pendingStyles = 0; | ||
| 9798 | }, | ||
| 9799 | |||
| 9800 | /* | ||
| 9801 | _mceBlockQuote : function() { | ||
| 9802 | var t = this, s = t.editor.selection, b = s.getBookmark(), bq, dom = t.editor.dom; | ||
| 9803 | |||
| 9804 | function findBQ(e) { | ||
| 9805 | return dom.getParent(e, function(n) {return n.nodeName === 'BLOCKQUOTE';}); | ||
| 9806 | }; | ||
| 9807 | |||
| 9808 | // Remove blockquote(s) | ||
| 9809 | if (findBQ(s.getStart())) { | ||
| 9810 | each(t._getSelectedBlocks(findBQ(s.getStart()), findBQ(s.getEnd())), function(e) { | ||
| 9811 | // Found BQ lets remove it | ||
| 9812 | if (e.nodeName == 'BLOCKQUOTE') | ||
| 9813 | dom.remove(e, 1); | ||
| 9814 | }); | ||
| 9815 | |||
| 9816 | t.editor.selection.moveToBookmark(b); | ||
| 9817 | return; | ||
| 9818 | } | ||
| 9819 | |||
| 9820 | each(t._getSelectedBlocks(findBQ(s.getStart()), findBQ(s.getEnd())), function(e) { | ||
| 9821 | var n; | ||
| 9822 | |||
| 9823 | // Found existing BQ add to this one | ||
| 9824 | if (e.nodeName == 'BLOCKQUOTE' && !bq) { | ||
| 9825 | bq = e; | ||
| 9826 | return; | ||
| 9827 | } | ||
| 9828 | |||
| 9829 | // No BQ found, create one | ||
| 9830 | if (!bq) { | ||
| 9831 | bq = dom.create('blockquote'); | ||
| 9832 | e.parentNode.insertBefore(bq, e); | ||
| 9833 | } | ||
| 9834 | |||
| 9835 | // Add children from existing BQ | ||
| 9836 | if (e.nodeName == 'BLOCKQUOTE' && bq) { | ||
| 9837 | n = e.firstChild; | ||
| 9838 | |||
| 9839 | while (n) { | ||
| 9840 | bq.appendChild(n.cloneNode(true)); | ||
| 9841 | n = n.nextSibling; | ||
| 9842 | } | ||
| 9843 | |||
| 9844 | dom.remove(e); | ||
| 9845 | |||
| 9846 | return; | ||
| 9847 | } | ||
| 9848 | |||
| 9849 | // Add non BQ element to BQ | ||
| 9850 | bq.appendChild(dom.remove(e)); | ||
| 9851 | }); | ||
| 9852 | |||
| 9853 | t.editor.selection.moveToBookmark(b); | ||
| 9854 | }, | ||
| 9855 | */ | ||
| 9856 | _getSelectedBlocks : function(st, en) { | ||
| 9857 | var ed = this.editor, dom = ed.dom, s = ed.selection, sb, eb, n, bl = []; | ||
| 9858 | |||
| 9859 | sb = dom.getParent(st || s.getStart(), isBlock); | ||
| 9860 | eb = dom.getParent(en || s.getEnd(), isBlock); | ||
| 9861 | |||
| 9862 | if (sb) | ||
| 9863 | bl.push(sb); | ||
| 9864 | |||
| 9865 | if (sb && eb && sb != eb) { | ||
| 9866 | n = sb; | ||
| 9867 | |||
| 9868 | while ((n = n.nextSibling) && n != eb) { | ||
| 9869 | if (isBlock(n)) | ||
| 9870 | bl.push(n); | ||
| 9871 | } | ||
| 9872 | } | ||
| 9873 | |||
| 9874 | if (eb && sb != eb) | ||
| 9875 | bl.push(eb); | ||
| 9876 | |||
| 9877 | return bl; | ||
| 9878 | } | ||
| 9879 | }); | ||
| 9880 | })(); | ||
| 9881 | |||
| 9882 | |||
| 9883 | /* file:jscripts/tiny_mce/classes/UndoManager.js */ | ||
| 9884 | |||
| 9885 | tinymce.create('tinymce.UndoManager', { | ||
| 9886 | index : 0, | ||
| 9887 | data : null, | ||
| 9888 | typing : 0, | ||
| 9889 | |||
| 9890 | UndoManager : function(ed) { | ||
| 9891 | var t = this, Dispatcher = tinymce.util.Dispatcher; | ||
| 9892 | |||
| 9893 | t.editor = ed; | ||
| 9894 | t.data = []; | ||
| 9895 | t.onAdd = new Dispatcher(this); | ||
| 9896 | t.onUndo = new Dispatcher(this); | ||
| 9897 | t.onRedo = new Dispatcher(this); | ||
| 9898 | }, | ||
| 9899 | |||
| 9900 | add : function(l) { | ||
| 9901 | var t = this, i, ed = t.editor, b, s = ed.settings, la; | ||
| 9902 | |||
| 9903 | l = l || {}; | ||
| 9904 | l.content = l.content || ed.getContent({format : 'raw', no_events : 1}); | ||
| 9905 | |||
| 9906 | // Add undo level if needed | ||
| 9907 | l.content = l.content.replace(/^\s*|\s*$/g, ''); | ||
| 9908 | la = t.data[t.index > 0 && (t.index == 0 || t.index == t.data.length) ? t.index - 1 : t.index]; | ||
| 9909 | if (!l.initial && la && l.content == la.content) | ||
| 9910 | return null; | ||
| 9911 | |||
| 9912 | // Time to compress | ||
| 9913 | if (s.custom_undo_redo_levels) { | ||
| 9914 | if (t.data.length > s.custom_undo_redo_levels) { | ||
| 9915 | for (i = 0; i < t.data.length - 1; i++) | ||
| 9916 | t.data[i] = t.data[i + 1]; | ||
| 9917 | |||
| 9918 | t.data.length--; | ||
| 9919 | t.index = t.data.length; | ||
| 9920 | } | ||
| 9921 | } | ||
| 9922 | |||
| 9923 | if (s.custom_undo_redo_restore_selection && !l.initial) | ||
| 9924 | l.bookmark = b = l.bookmark || ed.selection.getBookmark(); | ||
| 9925 | |||
| 9926 | if (t.index < t.data.length) | ||
| 9927 | t.index++; | ||
| 9928 | |||
| 9929 | // Only initial marked undo levels should be allowed as first item | ||
| 9930 | // This to workaround a bug with Firefox and the blur event | ||
| 9931 | if (t.data.length === 0 && !l.initial) | ||
| 9932 | return null; | ||
| 9933 | |||
| 9934 | // Add level | ||
| 9935 | t.data.length = t.index + 1; | ||
| 9936 | t.data[t.index++] = l; | ||
| 9937 | |||
| 9938 | if (l.initial) | ||
| 9939 | t.index = 0; | ||
| 9940 | |||
| 9941 | // Set initial bookmark use first real undo level | ||
| 9942 | if (t.data.length == 2 && t.data[0].initial) | ||
| 9943 | t.data[0].bookmark = b; | ||
| 9944 | |||
| 9945 | t.onAdd.dispatch(t, l); | ||
| 9946 | ed.isNotDirty = 0; | ||
| 9947 | |||
| 9948 | //console.dir(t.data); | ||
| 9949 | |||
| 9950 | return l; | ||
| 9951 | }, | ||
| 9952 | |||
| 9953 | undo : function() { | ||
| 9954 | var t = this, ed = t.editor, l = l, i; | ||
| 9955 | |||
| 9956 | if (t.typing) { | ||
| 9957 | t.add(); | ||
| 9958 | t.typing = 0; | ||
| 9959 | } | ||
| 9960 | |||
| 9961 | if (t.index > 0) { | ||
| 9962 | // If undo on last index then take snapshot | ||
| 9963 | if (t.index == t.data.length && t.index > 1) { | ||
| 9964 | i = t.index; | ||
| 9965 | t.typing = 0; | ||
| 9966 | |||
| 9967 | if (!t.add()) | ||
| 9968 | t.index = i; | ||
| 9969 | |||
| 9970 | --t.index; | ||
| 9971 | } | ||
| 9972 | |||
| 9973 | l = t.data[--t.index]; | ||
| 9974 | ed.setContent(l.content, {format : 'raw'}); | ||
| 9975 | ed.selection.moveToBookmark(l.bookmark); | ||
| 9976 | |||
| 9977 | t.onUndo.dispatch(t, l); | ||
| 9978 | } | ||
| 9979 | |||
| 9980 | return l; | ||
| 9981 | }, | ||
| 9982 | |||
| 9983 | redo : function() { | ||
| 9984 | var t = this, ed = t.editor, l = null; | ||
| 9985 | |||
| 9986 | if (t.index < t.data.length - 1) { | ||
| 9987 | l = t.data[++t.index]; | ||
| 9988 | ed.setContent(l.content, {format : 'raw'}); | ||
| 9989 | ed.selection.moveToBookmark(l.bookmark); | ||
| 9990 | |||
| 9991 | t.onRedo.dispatch(t, l); | ||
| 9992 | } | ||
| 9993 | |||
| 9994 | return l; | ||
| 9995 | }, | ||
| 9996 | |||
| 9997 | clear : function() { | ||
| 9998 | var t = this; | ||
| 9999 | |||
| 10000 | t.data = []; | ||
| 10001 | t.index = 0; | ||
| 10002 | t.typing = 0; | ||
| 10003 | t.add({initial : true}); | ||
| 10004 | }, | ||
| 10005 | |||
| 10006 | hasUndo : function() { | ||
| 10007 | return this.index != 0 || this.typing; | ||
| 10008 | }, | ||
| 10009 | |||
| 10010 | hasRedo : function() { | ||
| 10011 | return this.index < this.data.length - 1; | ||
| 10012 | } | ||
| 10013 | |||
| 10014 | }); | ||
| 10015 | /* file:jscripts/tiny_mce/classes/ForceBlocks.js */ | ||
| 10016 | |||
| 10017 | (function() { | ||
| 10018 | // Shorten names | ||
| 10019 | var Event, isIE, isGecko, isOpera, each, extend; | ||
| 10020 | |||
| 10021 | Event = tinymce.dom.Event; | ||
| 10022 | isIE = tinymce.isIE; | ||
| 10023 | isGecko = tinymce.isGecko; | ||
| 10024 | isOpera = tinymce.isOpera; | ||
| 10025 | each = tinymce.each; | ||
| 10026 | extend = tinymce.extend; | ||
| 10027 | |||
| 10028 | tinymce.create('tinymce.ForceBlocks', { | ||
| 10029 | ForceBlocks : function(ed) { | ||
| 10030 | var t = this, s = ed.settings, elm; | ||
| 10031 | |||
| 10032 | t.editor = ed; | ||
| 10033 | t.dom = ed.dom; | ||
| 10034 | elm = (s.forced_root_block || 'p').toLowerCase(); | ||
| 10035 | s.element = elm.toUpperCase(); | ||
| 10036 | |||
| 10037 | ed.onPreInit.add(t.setup, t); | ||
| 10038 | |||
| 10039 | t.reOpera = new RegExp('(\\u00a0| | )<\/' + elm + '>', 'gi'); | ||
| 10040 | t.rePadd = new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g, elm), 'gi'); | ||
| 10041 | t.reNbsp2BR1 = new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi'); | ||
| 10042 | t.reNbsp2BR2 = new RegExp('<p( )([^>]+)>( | )<\\\/p>|<p>( | )<\\\/p>'.replace(/p/g, elm), 'gi'); | ||
| 10043 | t.reBR2Nbsp = new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g, elm), 'gi'); | ||
| 10044 | t.reTrailBr = new RegExp('\\s*<br \\/>\\s*<\\\/p>'.replace(/p/g, elm), 'gi'); | ||
| 10045 | |||
| 10046 | function padd(ed, o) { | ||
| 10047 | if (isOpera) | ||
| 10048 | o.content = o.content.replace(t.reOpera, '</' + elm + '>'); | ||
| 10049 | |||
| 10050 | o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0</' + elm + '>'); | ||
| 10051 | |||
| 10052 | if (!isIE && !isOpera && o.set) { | ||
| 10053 | // Use instead of BR in padded paragraphs | ||
| 10054 | o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2><br /></' + elm + '>'); | ||
| 10055 | o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2><br /></' + elm + '>'); | ||
| 10056 | } else { | ||
| 10057 | o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0</' + elm + '>'); | ||
| 10058 | o.content = o.content.replace(t.reTrailBr, '</' + elm + '>'); | ||
| 10059 | } | ||
| 10060 | }; | ||
| 10061 | |||
| 10062 | ed.onBeforeSetContent.add(padd); | ||
| 10063 | ed.onPostProcess.add(padd); | ||
| 10064 | |||
| 10065 | if (s.forced_root_block) { | ||
| 10066 | ed.onInit.add(t.forceRoots, t); | ||
| 10067 | ed.onSetContent.add(t.forceRoots, t); | ||
| 10068 | ed.onBeforeGetContent.add(t.forceRoots, t); | ||
| 10069 | } | ||
| 10070 | }, | ||
| 10071 | |||
| 10072 | setup : function() { | ||
| 10073 | var t = this, ed = t.editor, s = ed.settings; | ||
| 10074 | |||
| 10075 | // Force root blocks when typing and when getting output | ||
| 10076 | if (s.forced_root_block) { | ||
| 10077 | ed.onKeyUp.add(t.forceRoots, t); | ||
| 10078 | ed.onPreProcess.add(t.forceRoots, t); | ||
| 10079 | } | ||
| 10080 | |||
| 10081 | if (s.force_br_newlines) { | ||
| 10082 | // Force IE to produce BRs on enter | ||
| 10083 | if (isIE) { | ||
| 10084 | ed.onKeyPress.add(function(ed, e) { | ||
| 10085 | var n, s = ed.selection; | ||
| 10086 | |||
| 10087 | if (e.keyCode == 13 && s.getNode().nodeName != 'LI') { | ||
| 10088 | s.setContent('<br id="__" /> ', {format : 'raw'}); | ||
| 10089 | n = ed.dom.get('__'); | ||
| 10090 | n.removeAttribute('id'); | ||
| 10091 | s.select(n); | ||
| 10092 | s.collapse(); | ||
| 10093 | return Event.cancel(e); | ||
| 10094 | } | ||
| 10095 | }); | ||
| 10096 | } | ||
| 10097 | |||
| 10098 | return; | ||
| 10099 | } | ||
| 10100 | |||
| 10101 | if (!isIE && s.force_p_newlines) { | ||
| 10102 | /* ed.onPreProcess.add(function(ed, o) { | ||
| 10103 | each(ed.dom.select('br', o.node), function(n) { | ||
| 10104 | var p = n.parentNode; | ||
| 10105 | |||
| 10106 | // Replace <p><br /></p> with <p> </p> | ||
| 10107 | if (p && p.nodeName == 'p' && (p.childNodes.length == 1 || p.lastChild == n)) { | ||
| 10108 | p.replaceChild(ed.getDoc().createTextNode('\u00a0'), n); | ||
| 10109 | } | ||
| 10110 | }); | ||
| 10111 | });*/ | ||
| 10112 | |||
| 10113 | ed.onKeyPress.add(function(ed, e) { | ||
| 10114 | if (e.keyCode == 13 && !e.shiftKey) { | ||
| 10115 | if (!t.insertPara(e)) | ||
| 10116 | Event.cancel(e); | ||
| 10117 | } | ||
| 10118 | }); | ||
| 10119 | |||
| 10120 | if (isGecko) { | ||
| 10121 | ed.onKeyDown.add(function(ed, e) { | ||
| 10122 | if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) | ||
| 10123 | t.backspaceDelete(e, e.keyCode == 8); | ||
| 10124 | }); | ||
| 10125 | } | ||
| 10126 | } | ||
| 10127 | |||
| 10128 | function ren(rn, na) { | ||
| 10129 | var ne = ed.dom.create(na); | ||
| 10130 | |||
| 10131 | each(rn.attributes, function(a) { | ||
| 10132 | if (a.specified && a.nodeValue) | ||
| 10133 | ne.setAttribute(a.nodeName.toLowerCase(), a.nodeValue); | ||
| 10134 | }); | ||
| 10135 | |||
| 10136 | each(rn.childNodes, function(n) { | ||
| 10137 | ne.appendChild(n.cloneNode(true)); | ||
| 10138 | }); | ||
| 10139 | |||
| 10140 | rn.parentNode.replaceChild(ne, rn); | ||
| 10141 | |||
| 10142 | return ne; | ||
| 10143 | }; | ||
| 10144 | |||
| 10145 | // Replaces IE:s auto generated paragraphs with the specified element name | ||
| 10146 | if (isIE && s.element != 'P') { | ||
| 10147 | ed.onKeyPress.add(function(ed, e) { | ||
| 10148 | t.lastElm = ed.selection.getNode().nodeName; | ||
| 10149 | }); | ||
| 10150 | |||
| 10151 | ed.onKeyUp.add(function(ed, e) { | ||
| 10152 | var bl, sel = ed.selection, n = sel.getNode(), b = ed.getBody(); | ||
| 10153 | |||
| 10154 | if (b.childNodes.length === 1 && n.nodeName == 'P') { | ||
| 10155 | n = ren(n, s.element); | ||
| 10156 | sel.select(n); | ||
| 10157 | sel.collapse(); | ||
| 10158 | ed.nodeChanged(); | ||
| 10159 | } else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') { | ||
| 10160 | bl = ed.dom.getParent(n, 'P'); | ||
| 10161 | |||
| 10162 | if (bl) { | ||
| 10163 | ren(bl, s.element); | ||
| 10164 | ed.nodeChanged(); | ||
| 10165 | } | ||
| 10166 | } | ||
| 10167 | }); | ||
| 10168 | } | ||
| 10169 | }, | ||
| 10170 | |||
| 10171 | find : function(n, t, s) { | ||
| 10172 | var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, false), c = -1; | ||
| 10173 | |||
| 10174 | while (n = w.nextNode()) { | ||
| 10175 | c++; | ||
| 10176 | |||
| 10177 | // Index by node | ||
| 10178 | if (t == 0 && n == s) | ||
| 10179 | return c; | ||
| 10180 | |||
| 10181 | // Node by index | ||
| 10182 | if (t == 1 && c == s) | ||
| 10183 | return n; | ||
| 10184 | } | ||
| 10185 | |||
| 10186 | return -1; | ||
| 10187 | }, | ||
| 10188 | |||
| 10189 | forceRoots : function(ed, e) { | ||
| 10190 | var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF; | ||
| 10191 | var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid; | ||
| 10192 | |||
| 10193 | // Fix for bug #1863847 | ||
| 10194 | //if (e && e.keyCode == 13) | ||
| 10195 | // return true; | ||
| 10196 | |||
| 10197 | // Wrap non blocks into blocks | ||
| 10198 | for (i = nl.length - 1; i >= 0; i--) { | ||
| 10199 | nx = nl[i]; | ||
| 10200 | |||
| 10201 | // Is text or non block element | ||
| 10202 | if (nx.nodeType == 3 || (!t.dom.isBlock(nx) && nx.nodeType != 8)) { | ||
| 10203 | if (!bl) { | ||
| 10204 | // Create new block but ignore whitespace | ||
| 10205 | if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) { | ||
| 10206 | // Store selection | ||
| 10207 | if (si == -2 && r) { | ||
| 10208 | if (!isIE) { | ||
| 10209 | // If selection is element then mark it | ||
| 10210 | if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) { | ||
| 10211 | // Save the id of the selected element | ||
| 10212 | eid = n.getAttribute("id"); | ||
| 10213 | n.setAttribute("id", "__mce"); | ||
| 10214 | } else { | ||
| 10215 | // If element is inside body, might not be the case in contentEdiable mode | ||
| 10216 | if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) { | ||
| 10217 | so = r.startOffset; | ||
| 10218 | eo = r.endOffset; | ||
| 10219 | si = t.find(b, 0, r.startContainer); | ||
| 10220 | ei = t.find(b, 0, r.endContainer); | ||
| 10221 | } | ||
| 10222 | } | ||
| 10223 | } else { | ||
| 10224 | tr = d.body.createTextRange(); | ||
| 10225 | tr.moveToElementText(b); | ||
| 10226 | tr.collapse(1); | ||
| 10227 | bp = tr.move('character', c) * -1; | ||
| 10228 | |||
| 10229 | tr = r.duplicate(); | ||
| 10230 | tr.collapse(1); | ||
| 10231 | sp = tr.move('character', c) * -1; | ||
| 10232 | |||
| 10233 | tr = r.duplicate(); | ||
| 10234 | tr.collapse(0); | ||
| 10235 | le = (tr.move('character', c) * -1) - sp; | ||
| 10236 | |||
| 10237 | si = sp - bp; | ||
| 10238 | ei = le; | ||
| 10239 | } | ||
| 10240 | } | ||
| 10241 | |||
| 10242 | bl = ed.dom.create(ed.settings.forced_root_block); | ||
| 10243 | bl.appendChild(nx.cloneNode(1)); | ||
| 10244 | nx.parentNode.replaceChild(bl, nx); | ||
| 10245 | } | ||
| 10246 | } else { | ||
| 10247 | if (bl.hasChildNodes()) | ||
| 10248 | bl.insertBefore(nx, bl.firstChild); | ||
| 10249 | else | ||
| 10250 | bl.appendChild(nx); | ||
| 10251 | } | ||
| 10252 | } else | ||
| 10253 | bl = null; // Time to create new block | ||
| 10254 | } | ||
| 10255 | |||
| 10256 | // Restore selection | ||
| 10257 | if (si != -2) { | ||
| 10258 | if (!isIE) { | ||
| 10259 | bl = b.getElementsByTagName(ed.settings.element)[0]; | ||
| 10260 | r = d.createRange(); | ||
| 10261 | |||
| 10262 | // Select last location or generated block | ||
| 10263 | if (si != -1) | ||
| 10264 | r.setStart(t.find(b, 1, si), so); | ||
| 10265 | else | ||
| 10266 | r.setStart(bl, 0); | ||
| 10267 | |||
| 10268 | // Select last location or generated block | ||
| 10269 | if (ei != -1) | ||
| 10270 | r.setEnd(t.find(b, 1, ei), eo); | ||
| 10271 | else | ||
| 10272 | r.setEnd(bl, 0); | ||
| 10273 | |||
| 10274 | if (s) { | ||
| 10275 | s.removeAllRanges(); | ||
| 10276 | s.addRange(r); | ||
| 10277 | } | ||
| 10278 | } else { | ||
| 10279 | try { | ||
| 10280 | r = s.createRange(); | ||
| 10281 | r.moveToElementText(b); | ||
| 10282 | r.collapse(1); | ||
| 10283 | r.moveStart('character', si); | ||
| 10284 | r.moveEnd('character', ei); | ||
| 10285 | r.select(); | ||
| 10286 | } catch (ex) { | ||
| 10287 | // Ignore | ||
| 10288 | } | ||
| 10289 | } | ||
| 10290 | } else if (!isIE && (n = ed.dom.get('__mce'))) { | ||
| 10291 | // Restore the id of the selected element | ||
| 10292 | if (eid) | ||
| 10293 | n.setAttribute('id', eid); | ||
| 10294 | else | ||
| 10295 | n.removeAttribute('id'); | ||
| 10296 | |||
| 10297 | // Move caret before selected element | ||
| 10298 | r = d.createRange(); | ||
| 10299 | r.setStartBefore(n); | ||
| 10300 | r.setEndBefore(n); | ||
| 10301 | se.setRng(r); | ||
| 10302 | } | ||
| 10303 | }, | ||
| 10304 | |||
| 10305 | getParentBlock : function(n) { | ||
| 10306 | var d = this.dom; | ||
| 10307 | |||
| 10308 | return d.getParent(n, d.isBlock); | ||
| 10309 | }, | ||
| 10310 | |||
| 10311 | insertPara : function(e) { | ||
| 10312 | var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body; | ||
| 10313 | var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car; | ||
| 10314 | |||
| 10315 | function isEmpty(n) { | ||
| 10316 | n = n.innerHTML; | ||
| 10317 | n = n.replace(/<(img|hr|table)/gi, '-'); // Keep these convert them to - chars | ||
| 10318 | n = n.replace(/<[^>]+>/g, ''); // Remove all tags | ||
| 10319 | |||
| 10320 | return n.replace(/[ \t\r\n]+/g, '') == ''; | ||
| 10321 | }; | ||
| 10322 | |||
| 10323 | // If root blocks are forced then use Operas default behavior since it's really good | ||
| 10324 | // Removed due to bug: #1853816 | ||
| 10325 | // if (se.forced_root_block && isOpera) | ||
| 10326 | // return true; | ||
| 10327 | |||
| 10328 | // Setup before range | ||
| 10329 | rb = d.createRange(); | ||
| 10330 | |||
| 10331 | // If is before the first block element and in body, then move it into first block element | ||
| 10332 | rb.setStart(s.anchorNode, s.anchorOffset); | ||
| 10333 | rb.collapse(true); | ||
| 10334 | |||
| 10335 | // Setup after range | ||
| 10336 | ra = d.createRange(); | ||
| 10337 | |||
| 10338 | // If is before the first block element and in body, then move it into first block element | ||
| 10339 | ra.setStart(s.focusNode, s.focusOffset); | ||
| 10340 | ra.collapse(true); | ||
| 10341 | |||
| 10342 | // Setup start/end points | ||
| 10343 | dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; | ||
| 10344 | sn = dir ? s.anchorNode : s.focusNode; | ||
| 10345 | so = dir ? s.anchorOffset : s.focusOffset; | ||
| 10346 | en = dir ? s.focusNode : s.anchorNode; | ||
| 10347 | eo = dir ? s.focusOffset : s.anchorOffset; | ||
| 10348 | |||
| 10349 | // If selection is in empty table cell | ||
| 10350 | if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) { | ||
| 10351 | dom.remove(sn.firstChild); // Remove BR | ||
| 10352 | |||
| 10353 | // Create two new block elements | ||
| 10354 | ed.dom.add(sn, se.element, null, '<br />'); | ||
| 10355 | aft = ed.dom.add(sn, se.element, null, '<br />'); | ||
| 10356 | |||
| 10357 | // Move caret into the last one | ||
| 10358 | r = d.createRange(); | ||
| 10359 | r.selectNodeContents(aft); | ||
| 10360 | r.collapse(1); | ||
| 10361 | ed.selection.setRng(r); | ||
| 10362 | |||
| 10363 | return false; | ||
| 10364 | } | ||
| 10365 | |||
| 10366 | // If the caret is in an invalid location in FF we need to move it into the first block | ||
| 10367 | if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) { | ||
| 10368 | sn = en = sn.firstChild; | ||
| 10369 | so = eo = 0; | ||
| 10370 | rb = d.createRange(); | ||
| 10371 | rb.setStart(sn, 0); | ||
| 10372 | ra = d.createRange(); | ||
| 10373 | ra.setStart(en, 0); | ||
| 10374 | } | ||
| 10375 | |||
| 10376 | // Never use body as start or end node | ||
| 10377 | sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes | ||
| 10378 | sn = sn.nodeName == "BODY" ? sn.firstChild : sn; | ||
| 10379 | en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes | ||
| 10380 | en = en.nodeName == "BODY" ? en.firstChild : en; | ||
| 10381 | |||
| 10382 | // Get start and end blocks | ||
| 10383 | sb = t.getParentBlock(sn); | ||
| 10384 | eb = t.getParentBlock(en); | ||
| 10385 | bn = sb ? sb.nodeName : se.element; // Get block name to create | ||
| 10386 | |||
| 10387 | // Return inside list use default browser behavior | ||
| 10388 | if (t.dom.getParent(sb, function(n) { return /OL|UL|PRE/.test(n.nodeName); })) | ||
| 10389 | return true; | ||
| 10390 | |||
| 10391 | // If caption or absolute layers then always generate new blocks within | ||
| 10392 | if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|static/gi.test(sb.style.position))) { | ||
| 10393 | bn = se.element; | ||
| 10394 | sb = null; | ||
| 10395 | } | ||
| 10396 | |||
| 10397 | // If caption or absolute layers then always generate new blocks within | ||
| 10398 | if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|static/gi.test(eb.style.position))) { | ||
| 10399 | bn = se.element; | ||
| 10400 | eb = null; | ||
| 10401 | } | ||
| 10402 | |||
| 10403 | // Use P instead | ||
| 10404 | if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(sb.style.cssFloat))) { | ||
| 10405 | bn = se.element; | ||
| 10406 | sb = eb = null; | ||
| 10407 | } | ||
| 10408 | |||
| 10409 | // Setup new before and after blocks | ||
| 10410 | bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn); | ||
| 10411 | aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn); | ||
| 10412 | |||
| 10413 | // Remove id from after clone | ||
| 10414 | aft.removeAttribute('id'); | ||
| 10415 | |||
| 10416 | // Is header and cursor is at the end, then force paragraph under | ||
| 10417 | if (/^(H[1-6])$/.test(bn) && sn.nodeValue && so == sn.nodeValue.length) | ||
| 10418 | aft = ed.dom.create(se.element); | ||
| 10419 | |||
| 10420 | // Find start chop node | ||
| 10421 | n = sc = sn; | ||
| 10422 | do { | ||
| 10423 | if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) | ||
| 10424 | break; | ||
| 10425 | |||
| 10426 | sc = n; | ||
| 10427 | } while ((n = n.previousSibling ? n.previousSibling : n.parentNode)); | ||
| 10428 | |||
| 10429 | // Find end chop node | ||
| 10430 | n = ec = en; | ||
| 10431 | do { | ||
| 10432 | if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) | ||
| 10433 | break; | ||
| 10434 | |||
| 10435 | ec = n; | ||
| 10436 | } while ((n = n.nextSibling ? n.nextSibling : n.parentNode)); | ||
| 10437 | |||
| 10438 | // Place first chop part into before block element | ||
| 10439 | if (sc.nodeName == bn) | ||
| 10440 | rb.setStart(sc, 0); | ||
| 10441 | else | ||
| 10442 | rb.setStartBefore(sc); | ||
| 10443 | |||
| 10444 | rb.setEnd(sn, so); | ||
| 10445 | bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari | ||
| 10446 | |||
| 10447 | // Place secnd chop part within new block element | ||
| 10448 | try { | ||
| 10449 | ra.setEndAfter(ec); | ||
| 10450 | } catch(ex) { | ||
| 10451 | //console.debug(s.focusNode, s.focusOffset); | ||
| 10452 | } | ||
| 10453 | |||
| 10454 | ra.setStart(en, eo); | ||
| 10455 | aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari | ||
| 10456 | |||
| 10457 | // Create range around everything | ||
| 10458 | r = d.createRange(); | ||
| 10459 | if (!sc.previousSibling && sc.parentNode.nodeName == bn) { | ||
| 10460 | r.setStartBefore(sc.parentNode); | ||
| 10461 | } else { | ||
| 10462 | if (rb.startContainer.nodeName == bn && rb.startOffset == 0) | ||
| 10463 | r.setStartBefore(rb.startContainer); | ||
| 10464 | else | ||
| 10465 | r.setStart(rb.startContainer, rb.startOffset); | ||
| 10466 | } | ||
| 10467 | |||
| 10468 | if (!ec.nextSibling && ec.parentNode.nodeName == bn) | ||
| 10469 | r.setEndAfter(ec.parentNode); | ||
| 10470 | else | ||
| 10471 | r.setEnd(ra.endContainer, ra.endOffset); | ||
| 10472 | |||
| 10473 | // Delete and replace it with new block elements | ||
| 10474 | r.deleteContents(); | ||
| 10475 | |||
| 10476 | if (isOpera) | ||
| 10477 | ed.getWin().scrollTo(0, vp.y); | ||
| 10478 | |||
| 10479 | // Never wrap blocks in blocks | ||
| 10480 | if (bef.firstChild && bef.firstChild.nodeName == bn) | ||
| 10481 | bef.innerHTML = bef.firstChild.innerHTML; | ||
| 10482 | |||
| 10483 | if (aft.firstChild && aft.firstChild.nodeName == bn) | ||
| 10484 | aft.innerHTML = aft.firstChild.innerHTML; | ||
| 10485 | |||
| 10486 | // Padd empty blocks | ||
| 10487 | if (isEmpty(bef)) | ||
| 10488 | bef.innerHTML = '<br />'; | ||
| 10489 | |||
| 10490 | function appendStyles(e, en) { | ||
| 10491 | var nl = [], nn, n, i; | ||
| 10492 | |||
| 10493 | e.innerHTML = ''; | ||
| 10494 | |||
| 10495 | // Make clones of style elements | ||
| 10496 | if (se.keep_styles) { | ||
| 10497 | n = en; | ||
| 10498 | do { | ||
| 10499 | // We only want style specific elements | ||
| 10500 | if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) { | ||
| 10501 | nn = n.cloneNode(false); | ||
| 10502 | dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique | ||
| 10503 | nl.push(nn); | ||
| 10504 | } | ||
| 10505 | } while (n = n.parentNode); | ||
| 10506 | } | ||
| 10507 | |||
| 10508 | // Append style elements to aft | ||
| 10509 | if (nl.length > 0) { | ||
| 10510 | for (i = nl.length - 1, nn = e; i >= 0; i--) | ||
| 10511 | nn = nn.appendChild(nl[i]); | ||
| 10512 | |||
| 10513 | // Padd most inner style element | ||
| 10514 | nl[0].innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there | ||
| 10515 | return nl[0]; // Move caret to most inner element | ||
| 10516 | } else | ||
| 10517 | e.innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there | ||
| 10518 | }; | ||
| 10519 | |||
| 10520 | // Fill empty afterblook with current style | ||
| 10521 | if (isEmpty(aft)) | ||
| 10522 | car = appendStyles(aft, en); | ||
| 10523 | |||
| 10524 | // Opera needs this one backwards for older versions | ||
| 10525 | if (isOpera && parseFloat(opera.version()) < 9.5) { | ||
| 10526 | r.insertNode(bef); | ||
| 10527 | r.insertNode(aft); | ||
| 10528 | } else { | ||
| 10529 | r.insertNode(aft); | ||
| 10530 | r.insertNode(bef); | ||
| 10531 | } | ||
| 10532 | |||
| 10533 | // Normalize | ||
| 10534 | aft.normalize(); | ||
| 10535 | bef.normalize(); | ||
| 10536 | |||
| 10537 | function first(n) { | ||
| 10538 | return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false).nextNode() || n; | ||
| 10539 | }; | ||
| 10540 | |||
| 10541 | // Move cursor and scroll into view | ||
| 10542 | r = d.createRange(); | ||
| 10543 | r.selectNodeContents(isGecko ? first(car || aft) : car || aft); | ||
| 10544 | r.collapse(1); | ||
| 10545 | s.removeAllRanges(); | ||
| 10546 | s.addRange(r); | ||
| 10547 | |||
| 10548 | // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs | ||
| 10549 | y = ed.dom.getPos(aft).y; | ||
| 10550 | ch = aft.clientHeight; | ||
| 10551 | |||
| 10552 | // Is element within viewport | ||
| 10553 | if (y < vp.y || y + ch > vp.y + vp.h) { | ||
| 10554 | ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks | ||
| 10555 | //console.debug('SCROLL!', 'vp.y: ' + vp.y, 'y' + y, 'vp.h' + vp.h, 'clientHeight' + aft.clientHeight, 'yyy: ' + (y < vp.y ? y : y - vp.h + aft.clientHeight)); | ||
| 10556 | } | ||
| 10557 | |||
| 10558 | return false; | ||
| 10559 | }, | ||
| 10560 | |||
| 10561 | backspaceDelete : function(e, bs) { | ||
| 10562 | var t = this, ed = t.editor, b = ed.getBody(), n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn; | ||
| 10563 | |||
| 10564 | // The caret sometimes gets stuck in Gecko if you delete empty paragraphs | ||
| 10565 | // This workaround removes the element by hand and moves the caret to the previous element | ||
| 10566 | if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) { | ||
| 10567 | if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) { | ||
| 10568 | // Find previous block element | ||
| 10569 | n = sc; | ||
| 10570 | while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ; | ||
| 10571 | |||
| 10572 | if (n) { | ||
| 10573 | if (sc != b.firstChild) { | ||
| 10574 | // Find last text node | ||
| 10575 | w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); | ||
| 10576 | while (tn = w.nextNode()) | ||
| 10577 | n = tn; | ||
| 10578 | |||
| 10579 | // Place caret at the end of last text node | ||
| 10580 | r = ed.getDoc().createRange(); | ||
| 10581 | r.setStart(n, n.nodeValue ? n.nodeValue.length : 0); | ||
| 10582 | r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0); | ||
| 10583 | se.setRng(r); | ||
| 10584 | |||
| 10585 | // Remove the target container | ||
| 10586 | ed.dom.remove(sc); | ||
| 10587 | } | ||
| 10588 | |||
| 10589 | return Event.cancel(e); | ||
| 10590 | } | ||
| 10591 | } | ||
| 10592 | } | ||
| 10593 | |||
| 10594 | // Gecko generates BR elements here and there, we don't like those so lets remove them | ||
| 10595 | function handler(e) { | ||
| 10596 | var pr; | ||
| 10597 | |||
| 10598 | e = e.target; | ||
| 10599 | |||
| 10600 | // A new BR was created in a block element, remove it | ||
| 10601 | if (e && e.parentNode && e.nodeName == 'BR' && (n = t.getParentBlock(e))) { | ||
| 10602 | pr = e.previousSibling; | ||
| 10603 | |||
| 10604 | Event.remove(b, 'DOMNodeInserted', handler); | ||
| 10605 | |||
| 10606 | // Is there whitespace at the end of the node before then we might need the pesky BR | ||
| 10607 | // to place the caret at a correct location see bug: #2013943 | ||
| 10608 | if (pr && pr.nodeType == 3 && /\s+$/.test(pr.nodeValue)) | ||
| 10609 | return; | ||
| 10610 | |||
| 10611 | // Only remove BR elements that got inserted in the middle of the text | ||
| 10612 | if (e.previousSibling || e.nextSibling) | ||
| 10613 | ed.dom.remove(e); | ||
| 10614 | } | ||
| 10615 | }; | ||
| 10616 | |||
| 10617 | // Listen for new nodes | ||
| 10618 | Event._add(b, 'DOMNodeInserted', handler); | ||
| 10619 | |||
| 10620 | // Remove listener | ||
| 10621 | window.setTimeout(function() { | ||
| 10622 | Event._remove(b, 'DOMNodeInserted', handler); | ||
| 10623 | }, 1); | ||
| 10624 | } | ||
| 10625 | }); | ||
| 10626 | })(); | ||
| 10627 | |||
| 10628 | /* file:jscripts/tiny_mce/classes/ControlManager.js */ | ||
| 10629 | |||
| 10630 | (function() { | ||
| 10631 | // Shorten names | ||
| 10632 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend; | ||
| 10633 | |||
| 10634 | tinymce.create('tinymce.ControlManager', { | ||
| 10635 | ControlManager : function(ed, s) { | ||
| 10636 | var t = this, i; | ||
| 10637 | |||
| 10638 | s = s || {}; | ||
| 10639 | t.editor = ed; | ||
| 10640 | t.controls = {}; | ||
| 10641 | t.onAdd = new tinymce.util.Dispatcher(t); | ||
| 10642 | t.onPostRender = new tinymce.util.Dispatcher(t); | ||
| 10643 | t.prefix = s.prefix || ed.id + '_'; | ||
| 10644 | t._cls = {}; | ||
| 10645 | |||
| 10646 | t.onPostRender.add(function() { | ||
| 10647 | each(t.controls, function(c) { | ||
| 10648 | c.postRender(); | ||
| 10649 | }); | ||
| 10650 | }); | ||
| 10651 | }, | ||
| 10652 | |||
| 10653 | get : function(id) { | ||
| 10654 | return this.controls[this.prefix + id] || this.controls[id]; | ||
| 10655 | }, | ||
| 10656 | |||
| 10657 | setActive : function(id, s) { | ||
| 10658 | var c = null; | ||
| 10659 | |||
| 10660 | if (c = this.get(id)) | ||
| 10661 | c.setActive(s); | ||
| 10662 | |||
| 10663 | return c; | ||
| 10664 | }, | ||
| 10665 | |||
| 10666 | setDisabled : function(id, s) { | ||
| 10667 | var c = null; | ||
| 10668 | |||
| 10669 | if (c = this.get(id)) | ||
| 10670 | c.setDisabled(s); | ||
| 10671 | |||
| 10672 | return c; | ||
| 10673 | }, | ||
| 10674 | |||
| 10675 | add : function(c) { | ||
| 10676 | var t = this; | ||
| 10677 | |||
| 10678 | if (c) { | ||
| 10679 | t.controls[c.id] = c; | ||
| 10680 | t.onAdd.dispatch(c, t); | ||
| 10681 | } | ||
| 10682 | |||
| 10683 | return c; | ||
| 10684 | }, | ||
| 10685 | |||
| 10686 | createControl : function(n) { | ||
| 10687 | var c, t = this, ed = t.editor; | ||
| 10688 | |||
| 10689 | each(ed.plugins, function(p) { | ||
| 10690 | if (p.createControl) { | ||
| 10691 | c = p.createControl(n, t); | ||
| 10692 | |||
| 10693 | if (c) | ||
| 10694 | return false; | ||
| 10695 | } | ||
| 10696 | }); | ||
| 10697 | |||
| 10698 | switch (n) { | ||
| 10699 | case "|": | ||
| 10700 | case "separator": | ||
| 10701 | return t.createSeparator(); | ||
| 10702 | } | ||
| 10703 | |||
| 10704 | if (!c && ed.buttons && (c = ed.buttons[n])) | ||
| 10705 | return t.createButton(n, c); | ||
| 10706 | |||
| 10707 | return t.add(c); | ||
| 10708 | }, | ||
| 10709 | |||
| 10710 | createDropMenu : function(id, s, cc) { | ||
| 10711 | var t = this, ed = t.editor, c, bm, v, cls; | ||
| 10712 | |||
| 10713 | s = extend({ | ||
| 10714 | 'class' : 'mceDropDown', | ||
| 10715 | constrain : ed.settings.constrain_menus | ||
| 10716 | }, s); | ||
| 10717 | |||
| 10718 | s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin'; | ||
| 10719 | if (v = ed.getParam('skin_variant')) | ||
| 10720 | s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1); | ||
| 10721 | |||
| 10722 | id = t.prefix + id; | ||
| 10723 | cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu; | ||
| 10724 | c = t.controls[id] = new cls(id, s); | ||
| 10725 | c.onAddItem.add(function(c, o) { | ||
| 10726 | var s = o.settings; | ||
| 10727 | |||
| 10728 | s.title = ed.getLang(s.title, s.title); | ||
| 10729 | |||
| 10730 | if (!s.onclick) { | ||
| 10731 | s.onclick = function(v) { | ||
| 10732 | ed.execCommand(s.cmd, s.ui || false, s.value); | ||
| 10733 | }; | ||
| 10734 | } | ||
| 10735 | }); | ||
| 10736 | |||
| 10737 | ed.onRemove.add(function() { | ||
| 10738 | c.destroy(); | ||
| 10739 | }); | ||
| 10740 | |||
| 10741 | // Fix for bug #1897785, #1898007 | ||
| 10742 | if (tinymce.isIE) { | ||
| 10743 | c.onShowMenu.add(function() { | ||
| 10744 | bm = ed.selection.getBookmark(1); | ||
| 10745 | }); | ||
| 10746 | |||
| 10747 | c.onHideMenu.add(function() { | ||
| 10748 | if (bm) | ||
| 10749 | ed.selection.moveToBookmark(bm); | ||
| 10750 | }); | ||
| 10751 | } | ||
| 10752 | |||
| 10753 | return t.add(c); | ||
| 10754 | }, | ||
| 10755 | |||
| 10756 | createListBox : function(id, s, cc) { | ||
| 10757 | var t = this, ed = t.editor, cmd, c, cls; | ||
| 10758 | |||
| 10759 | if (t.get(id)) | ||
| 10760 | return null; | ||
| 10761 | |||
| 10762 | s.title = ed.translate(s.title); | ||
| 10763 | s.scope = s.scope || ed; | ||
| 10764 | |||
| 10765 | if (!s.onselect) { | ||
| 10766 | s.onselect = function(v) { | ||
| 10767 | ed.execCommand(s.cmd, s.ui || false, v || s.value); | ||
| 10768 | }; | ||
| 10769 | } | ||
| 10770 | |||
| 10771 | s = extend({ | ||
| 10772 | title : s.title, | ||
| 10773 | 'class' : 'mce_' + id, | ||
| 10774 | scope : s.scope, | ||
| 10775 | control_manager : t | ||
| 10776 | }, s); | ||
| 10777 | |||
| 10778 | id = t.prefix + id; | ||
| 10779 | |||
| 10780 | if (ed.settings.use_native_selects) | ||
| 10781 | c = new tinymce.ui.NativeListBox(id, s); | ||
| 10782 | else { | ||
| 10783 | cls = cc || t._cls.listbox || tinymce.ui.ListBox; | ||
| 10784 | c = new cls(id, s); | ||
| 10785 | } | ||
| 10786 | |||
| 10787 | t.controls[id] = c; | ||
| 10788 | |||
| 10789 | // Fix focus problem in Safari | ||
| 10790 | if (tinymce.isWebKit) { | ||
| 10791 | c.onPostRender.add(function(c, n) { | ||
| 10792 | // Store bookmark on mousedown | ||
| 10793 | Event.add(n, 'mousedown', function() { | ||
| 10794 | ed.bookmark = ed.selection.getBookmark('simple'); | ||
| 10795 | }); | ||
| 10796 | |||
| 10797 | // Restore on focus, since it might be lost | ||
| 10798 | Event.add(n, 'focus', function() { | ||
| 10799 | ed.selection.moveToBookmark(ed.bookmark); | ||
| 10800 | ed.bookmark = null; | ||
| 10801 | }); | ||
| 10802 | }); | ||
| 10803 | } | ||
| 10804 | |||
| 10805 | if (c.hideMenu) | ||
| 10806 | ed.onMouseDown.add(c.hideMenu, c); | ||
| 10807 | |||
| 10808 | return t.add(c); | ||
| 10809 | }, | ||
| 10810 | |||
| 10811 | createButton : function(id, s, cc) { | ||
| 10812 | var t = this, ed = t.editor, o, c, cls; | ||
| 10813 | |||
| 10814 | if (t.get(id)) | ||
| 10815 | return null; | ||
| 10816 | |||
| 10817 | s.title = ed.translate(s.title); | ||
| 10818 | s.label = ed.translate(s.label); | ||
| 10819 | s.scope = s.scope || ed; | ||
| 10820 | |||
| 10821 | if (!s.onclick && !s.menu_button) { | ||
| 10822 | s.onclick = function() { | ||
| 10823 | ed.execCommand(s.cmd, s.ui || false, s.value); | ||
| 10824 | }; | ||
| 10825 | } | ||
| 10826 | |||
| 10827 | s = extend({ | ||
| 10828 | title : s.title, | ||
| 10829 | 'class' : 'mce_' + id, | ||
| 10830 | unavailable_prefix : ed.getLang('unavailable', ''), | ||
| 10831 | scope : s.scope, | ||
| 10832 | control_manager : t | ||
| 10833 | }, s); | ||
| 10834 | |||
| 10835 | id = t.prefix + id; | ||
| 10836 | |||
| 10837 | if (s.menu_button) { | ||
| 10838 | cls = cc || t._cls.menubutton || tinymce.ui.MenuButton; | ||
| 10839 | c = new cls(id, s); | ||
| 10840 | ed.onMouseDown.add(c.hideMenu, c); | ||
| 10841 | } else { | ||
| 10842 | cls = t._cls.button || tinymce.ui.Button; | ||
| 10843 | c = new cls(id, s); | ||
| 10844 | } | ||
| 10845 | |||
| 10846 | return t.add(c); | ||
| 10847 | }, | ||
| 10848 | |||
| 10849 | createMenuButton : function(id, s, cc) { | ||
| 10850 | s = s || {}; | ||
| 10851 | s.menu_button = 1; | ||
| 10852 | |||
| 10853 | return this.createButton(id, s, cc); | ||
| 10854 | }, | ||
| 10855 | |||
| 10856 | createSplitButton : function(id, s, cc) { | ||
| 10857 | var t = this, ed = t.editor, cmd, c, cls; | ||
| 10858 | |||
| 10859 | if (t.get(id)) | ||
| 10860 | return null; | ||
| 10861 | |||
| 10862 | s.title = ed.translate(s.title); | ||
| 10863 | s.scope = s.scope || ed; | ||
| 10864 | |||
| 10865 | if (!s.onclick) { | ||
| 10866 | s.onclick = function(v) { | ||
| 10867 | ed.execCommand(s.cmd, s.ui || false, v || s.value); | ||
| 10868 | }; | ||
| 10869 | } | ||
| 10870 | |||
| 10871 | if (!s.onselect) { | ||
| 10872 | s.onselect = function(v) { | ||
| 10873 | ed.execCommand(s.cmd, s.ui || false, v || s.value); | ||
| 10874 | }; | ||
| 10875 | } | ||
| 10876 | |||
| 10877 | s = extend({ | ||
| 10878 | title : s.title, | ||
| 10879 | 'class' : 'mce_' + id, | ||
| 10880 | scope : s.scope, | ||
| 10881 | control_manager : t | ||
| 10882 | }, s); | ||
| 10883 | |||
| 10884 | id = t.prefix + id; | ||
| 10885 | cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton; | ||
| 10886 | c = t.add(new cls(id, s)); | ||
| 10887 | ed.onMouseDown.add(c.hideMenu, c); | ||
| 10888 | |||
| 10889 | return c; | ||
| 10890 | }, | ||
| 10891 | |||
| 10892 | createColorSplitButton : function(id, s, cc) { | ||
| 10893 | var t = this, ed = t.editor, cmd, c, cls, bm; | ||
| 10894 | |||
| 10895 | if (t.get(id)) | ||
| 10896 | return null; | ||
| 10897 | |||
| 10898 | s.title = ed.translate(s.title); | ||
| 10899 | s.scope = s.scope || ed; | ||
| 10900 | |||
| 10901 | if (!s.onclick) { | ||
| 10902 | s.onclick = function(v) { | ||
| 10903 | ed.execCommand(s.cmd, s.ui || false, v || s.value); | ||
| 10904 | }; | ||
| 10905 | } | ||
| 10906 | |||
| 10907 | if (!s.onselect) { | ||
| 10908 | s.onselect = function(v) { | ||
| 10909 | ed.execCommand(s.cmd, s.ui || false, v || s.value); | ||
| 10910 | }; | ||
| 10911 | } | ||
| 10912 | |||
| 10913 | s = extend({ | ||
| 10914 | title : s.title, | ||
| 10915 | 'class' : 'mce_' + id, | ||
| 10916 | 'menu_class' : ed.getParam('skin') + 'Skin', | ||
| 10917 | scope : s.scope, | ||
| 10918 | more_colors_title : ed.getLang('more_colors') | ||
| 10919 | }, s); | ||
| 10920 | |||
| 10921 | id = t.prefix + id; | ||
| 10922 | cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton; | ||
| 10923 | c = new cls(id, s); | ||
| 10924 | ed.onMouseDown.add(c.hideMenu, c); | ||
| 10925 | |||
| 10926 | // Remove the menu element when the editor is removed | ||
| 10927 | ed.onRemove.add(function() { | ||
| 10928 | c.destroy(); | ||
| 10929 | }); | ||
| 10930 | |||
| 10931 | // Fix for bug #1897785, #1898007 | ||
| 10932 | if (tinymce.isIE) { | ||
| 10933 | c.onShowMenu.add(function() { | ||
| 10934 | bm = ed.selection.getBookmark(1); | ||
| 10935 | }); | ||
| 10936 | |||
| 10937 | c.onHideMenu.add(function() { | ||
| 10938 | if (bm) { | ||
| 10939 | ed.selection.moveToBookmark(bm); | ||
| 10940 | bm = 0; | ||
| 10941 | } | ||
| 10942 | }); | ||
| 10943 | } | ||
| 10944 | |||
| 10945 | return t.add(c); | ||
| 10946 | }, | ||
| 10947 | |||
| 10948 | createToolbar : function(id, s, cc) { | ||
| 10949 | var c, t = this, cls; | ||
| 10950 | |||
| 10951 | id = t.prefix + id; | ||
| 10952 | cls = cc || t._cls.toolbar || tinymce.ui.Toolbar; | ||
| 10953 | c = new cls(id, s); | ||
| 10954 | |||
| 10955 | if (t.get(id)) | ||
| 10956 | return null; | ||
| 10957 | |||
| 10958 | return t.add(c); | ||
| 10959 | }, | ||
| 10960 | |||
| 10961 | createSeparator : function(cc) { | ||
| 10962 | var cls = cc || this._cls.separator || tinymce.ui.Separator; | ||
| 10963 | |||
| 10964 | return new cls(); | ||
| 10965 | }, | ||
| 10966 | |||
| 10967 | setControlType : function(n, c) { | ||
| 10968 | return this._cls[n.toLowerCase()] = c; | ||
| 10969 | }, | ||
| 10970 | |||
| 10971 | destroy : function() { | ||
| 10972 | each(this.controls, function(c) { | ||
| 10973 | c.destroy(); | ||
| 10974 | }); | ||
| 10975 | |||
| 10976 | this.controls = null; | ||
| 10977 | } | ||
| 10978 | |||
| 10979 | }); | ||
| 10980 | })(); | ||
| 10981 | |||
| 10982 | /* file:jscripts/tiny_mce/classes/WindowManager.js */ | ||
| 10983 | |||
| 10984 | (function() { | ||
| 10985 | var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera; | ||
| 10986 | |||
| 10987 | tinymce.create('tinymce.WindowManager', { | ||
| 10988 | WindowManager : function(ed) { | ||
| 10989 | var t = this; | ||
| 10990 | |||
| 10991 | t.editor = ed; | ||
| 10992 | t.onOpen = new Dispatcher(t); | ||
| 10993 | t.onClose = new Dispatcher(t); | ||
| 10994 | t.params = {}; | ||
| 10995 | t.features = {}; | ||
| 10996 | }, | ||
| 10997 | |||
| 10998 | open : function(s, p) { | ||
| 10999 | var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u; | ||
| 11000 | |||
| 11001 | // Default some options | ||
| 11002 | s = s || {}; | ||
| 11003 | p = p || {}; | ||
| 11004 | sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window | ||
| 11005 | sh = isOpera ? vp.h : screen.height; | ||
| 11006 | s.name = s.name || 'mc_' + new Date().getTime(); | ||
| 11007 | s.width = parseInt(s.width || 320); | ||
| 11008 | s.height = parseInt(s.height || 240); | ||
| 11009 | s.resizable = true; | ||
| 11010 | s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0); | ||
| 11011 | s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0); | ||
| 11012 | p.inline = false; | ||
| 11013 | p.mce_width = s.width; | ||
| 11014 | p.mce_height = s.height; | ||
| 11015 | p.mce_auto_focus = s.auto_focus; | ||
| 11016 | |||
| 11017 | if (mo) { | ||
| 11018 | if (isIE) { | ||
| 11019 | s.center = true; | ||
| 11020 | s.help = false; | ||
| 11021 | s.dialogWidth = s.width + 'px'; | ||
| 11022 | s.dialogHeight = s.height + 'px'; | ||
| 11023 | s.scroll = s.scrollbars || false; | ||
| 11024 | } | ||
| 11025 | } | ||
| 11026 | |||
| 11027 | // Build features string | ||
| 11028 | each(s, function(v, k) { | ||
| 11029 | if (tinymce.is(v, 'boolean')) | ||
| 11030 | v = v ? 'yes' : 'no'; | ||
| 11031 | |||
| 11032 | if (!/^(name|url)$/.test(k)) { | ||
| 11033 | if (isIE && mo) | ||
| 11034 | f += (f ? ';' : '') + k + ':' + v; | ||
| 11035 | else | ||
| 11036 | f += (f ? ',' : '') + k + '=' + v; | ||
| 11037 | } | ||
| 11038 | }); | ||
| 11039 | |||
| 11040 | t.features = s; | ||
| 11041 | t.params = p; | ||
| 11042 | t.onOpen.dispatch(t, s, p); | ||
| 11043 | |||
| 11044 | u = s.url || s.file; | ||
| 11045 | if (tinymce.relaxedDomain) | ||
| 11046 | u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; | ||
| 11047 | |||
| 11048 | u = tinymce._addVer(u); | ||
| 11049 | |||
| 11050 | try { | ||
| 11051 | if (isIE && mo) { | ||
| 11052 | w = 1; | ||
| 11053 | window.showModalDialog(u, window, f); | ||
| 11054 | } else | ||
| 11055 | w = window.open(u, s.name, f); | ||
| 11056 | } catch (ex) { | ||
| 11057 | // Ignore | ||
| 11058 | } | ||
| 11059 | |||
| 11060 | if (!w) | ||
| 11061 | alert(t.editor.getLang('popup_blocked')); | ||
| 11062 | }, | ||
| 11063 | |||
| 11064 | close : function(w) { | ||
| 11065 | w.close(); | ||
| 11066 | this.onClose.dispatch(this); | ||
| 11067 | }, | ||
| 11068 | |||
| 11069 | createInstance : function(cl, a, b, c, d, e) { | ||
| 11070 | var f = tinymce.resolve(cl); | ||
| 11071 | |||
| 11072 | return new f(a, b, c, d, e); | ||
| 11073 | }, | ||
| 11074 | |||
| 11075 | confirm : function(t, cb, s, w) { | ||
| 11076 | w = w || window; | ||
| 11077 | |||
| 11078 | cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t)))); | ||
| 11079 | }, | ||
| 11080 | |||
| 11081 | alert : function(tx, cb, s, w) { | ||
| 11082 | var t = this; | ||
| 11083 | |||
| 11084 | w = w || window; | ||
| 11085 | w.alert(t._decode(t.editor.getLang(tx, tx))); | ||
| 11086 | |||
| 11087 | if (cb) | ||
| 11088 | cb.call(s || t); | ||
| 11089 | }, | ||
| 11090 | |||
| 11091 | // Internal functions | ||
| 11092 | |||
| 11093 | _decode : function(s) { | ||
| 11094 | return tinymce.DOM.decode(s).replace(/\\n/g, '\n'); | ||
| 11095 | } | ||
| 11096 | |||
| 11097 | }); | ||
| 11098 | }()); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/utils/editable_selects.js b/public/javascripts/tiny_mce/utils/editable_selects.js new file mode 100755 index 0000000..fff4963 --- /dev/null +++ b/public/javascripts/tiny_mce/utils/editable_selects.js | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editable_selects.js 867 2008-06-09 20:33:40Z spocke $ | ||
| 3 | * | ||
| 4 | * Makes select boxes editable. | ||
| 5 | * | ||
| 6 | * @author Moxiecode | ||
| 7 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 8 | */ | ||
| 9 | |||
| 10 | var TinyMCE_EditableSelects = { | ||
| 11 | editSelectElm : null, | ||
| 12 | |||
| 13 | init : function() { | ||
| 14 | var nl = document.getElementsByTagName("select"), i, d = document, o; | ||
| 15 | |||
| 16 | for (i=0; i<nl.length; i++) { | ||
| 17 | if (nl[i].className.indexOf('mceEditableSelect') != -1) { | ||
| 18 | o = new Option('(value)', '__mce_add_custom__'); | ||
| 19 | |||
| 20 | o.className = 'mceAddSelectValue'; | ||
| 21 | |||
| 22 | nl[i].options[nl[i].options.length] = o; | ||
| 23 | nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect; | ||
| 24 | } | ||
| 25 | } | ||
| 26 | }, | ||
| 27 | |||
| 28 | onChangeEditableSelect : function(e) { | ||
| 29 | var d = document, ne, se = window.event ? window.event.srcElement : e.target; | ||
| 30 | |||
| 31 | if (se.options[se.selectedIndex].value == '__mce_add_custom__') { | ||
| 32 | ne = d.createElement("input"); | ||
| 33 | ne.id = se.id + "_custom"; | ||
| 34 | ne.name = se.name + "_custom"; | ||
| 35 | ne.type = "text"; | ||
| 36 | |||
| 37 | ne.style.width = se.offsetWidth + 'px'; | ||
| 38 | se.parentNode.insertBefore(ne, se); | ||
| 39 | se.style.display = 'none'; | ||
| 40 | ne.focus(); | ||
| 41 | ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput; | ||
| 42 | ne.onkeydown = TinyMCE_EditableSelects.onKeyDown; | ||
| 43 | TinyMCE_EditableSelects.editSelectElm = se; | ||
| 44 | } | ||
| 45 | }, | ||
| 46 | |||
| 47 | onBlurEditableSelectInput : function() { | ||
| 48 | var se = TinyMCE_EditableSelects.editSelectElm; | ||
| 49 | |||
| 50 | if (se) { | ||
| 51 | if (se.previousSibling.value != '') { | ||
| 52 | addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value); | ||
| 53 | selectByValue(document.forms[0], se.id, se.previousSibling.value); | ||
| 54 | } else | ||
| 55 | selectByValue(document.forms[0], se.id, ''); | ||
| 56 | |||
| 57 | se.style.display = 'inline'; | ||
| 58 | se.parentNode.removeChild(se.previousSibling); | ||
| 59 | TinyMCE_EditableSelects.editSelectElm = null; | ||
| 60 | } | ||
| 61 | }, | ||
| 62 | |||
| 63 | onKeyDown : function(e) { | ||
| 64 | e = e || window.event; | ||
| 65 | |||
| 66 | if (e.keyCode == 13) | ||
| 67 | TinyMCE_EditableSelects.onBlurEditableSelectInput(); | ||
| 68 | } | ||
| 69 | }; | ||
diff --git a/public/javascripts/tiny_mce/utils/form_utils.js b/public/javascripts/tiny_mce/utils/form_utils.js new file mode 100755 index 0000000..c1f1409 --- /dev/null +++ b/public/javascripts/tiny_mce/utils/form_utils.js | |||
| @@ -0,0 +1,199 @@ | |||
| 1 | /** | ||
| 2 | * $Id: form_utils.js 673 2008-03-06 13:26:20Z spocke $ | ||
| 3 | * | ||
| 4 | * Various form utilitiy functions. | ||
| 5 | * | ||
| 6 | * @author Moxiecode | ||
| 7 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 8 | */ | ||
| 9 | |||
| 10 | var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme")); | ||
| 11 | |||
| 12 | function getColorPickerHTML(id, target_form_element) { | ||
| 13 | var h = ""; | ||
| 14 | |||
| 15 | h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">'; | ||
| 16 | h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>'; | ||
| 17 | |||
| 18 | return h; | ||
| 19 | } | ||
| 20 | |||
| 21 | function updateColor(img_id, form_element_id) { | ||
| 22 | document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; | ||
| 23 | } | ||
| 24 | |||
| 25 | function setBrowserDisabled(id, state) { | ||
| 26 | var img = document.getElementById(id); | ||
| 27 | var lnk = document.getElementById(id + "_link"); | ||
| 28 | |||
| 29 | if (lnk) { | ||
| 30 | if (state) { | ||
| 31 | lnk.setAttribute("realhref", lnk.getAttribute("href")); | ||
| 32 | lnk.removeAttribute("href"); | ||
| 33 | tinyMCEPopup.dom.addClass(img, 'disabled'); | ||
| 34 | } else { | ||
| 35 | if (lnk.getAttribute("realhref")) | ||
| 36 | lnk.setAttribute("href", lnk.getAttribute("realhref")); | ||
| 37 | |||
| 38 | tinyMCEPopup.dom.removeClass(img, 'disabled'); | ||
| 39 | } | ||
| 40 | } | ||
| 41 | } | ||
| 42 | |||
| 43 | function getBrowserHTML(id, target_form_element, type, prefix) { | ||
| 44 | var option = prefix + "_" + type + "_browser_callback", cb, html; | ||
| 45 | |||
| 46 | cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); | ||
| 47 | |||
| 48 | if (!cb) | ||
| 49 | return ""; | ||
| 50 | |||
| 51 | html = ""; | ||
| 52 | html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">'; | ||
| 53 | html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>'; | ||
| 54 | |||
| 55 | return html; | ||
| 56 | } | ||
| 57 | |||
| 58 | function openBrowser(img_id, target_form_element, type, option) { | ||
| 59 | var img = document.getElementById(img_id); | ||
| 60 | |||
| 61 | if (img.className != "mceButtonDisabled") | ||
| 62 | tinyMCEPopup.openBrowser(target_form_element, type, option); | ||
| 63 | } | ||
| 64 | |||
| 65 | function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { | ||
| 66 | if (!form_obj || !form_obj.elements[field_name]) | ||
| 67 | return; | ||
| 68 | |||
| 69 | var sel = form_obj.elements[field_name]; | ||
| 70 | |||
| 71 | var found = false; | ||
| 72 | for (var i=0; i<sel.options.length; i++) { | ||
| 73 | var option = sel.options[i]; | ||
| 74 | |||
| 75 | if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) { | ||
| 76 | option.selected = true; | ||
| 77 | found = true; | ||
| 78 | } else | ||
| 79 | option.selected = false; | ||
| 80 | } | ||
| 81 | |||
| 82 | if (!found && add_custom && value != '') { | ||
| 83 | var option = new Option(value, value); | ||
| 84 | option.selected = true; | ||
| 85 | sel.options[sel.options.length] = option; | ||
| 86 | sel.selectedIndex = sel.options.length - 1; | ||
| 87 | } | ||
| 88 | |||
| 89 | return found; | ||
| 90 | } | ||
| 91 | |||
| 92 | function getSelectValue(form_obj, field_name) { | ||
| 93 | var elm = form_obj.elements[field_name]; | ||
| 94 | |||
| 95 | if (elm == null || elm.options == null) | ||
| 96 | return ""; | ||
| 97 | |||
| 98 | return elm.options[elm.selectedIndex].value; | ||
| 99 | } | ||
| 100 | |||
| 101 | function addSelectValue(form_obj, field_name, name, value) { | ||
| 102 | var s = form_obj.elements[field_name]; | ||
| 103 | var o = new Option(name, value); | ||
| 104 | s.options[s.options.length] = o; | ||
| 105 | } | ||
| 106 | |||
| 107 | function addClassesToList(list_id, specific_option) { | ||
| 108 | // Setup class droplist | ||
| 109 | var styleSelectElm = document.getElementById(list_id); | ||
| 110 | var styles = tinyMCEPopup.getParam('theme_advanced_styles', false); | ||
| 111 | styles = tinyMCEPopup.getParam(specific_option, styles); | ||
| 112 | |||
| 113 | if (styles) { | ||
| 114 | var stylesAr = styles.split(';'); | ||
| 115 | |||
| 116 | for (var i=0; i<stylesAr.length; i++) { | ||
| 117 | if (stylesAr != "") { | ||
| 118 | var key, value; | ||
| 119 | |||
| 120 | key = stylesAr[i].split('=')[0]; | ||
| 121 | value = stylesAr[i].split('=')[1]; | ||
| 122 | |||
| 123 | styleSelectElm.options[styleSelectElm.length] = new Option(key, value); | ||
| 124 | } | ||
| 125 | } | ||
| 126 | } else { | ||
| 127 | tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) { | ||
| 128 | styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']); | ||
| 129 | }); | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | function isVisible(element_id) { | ||
| 134 | var elm = document.getElementById(element_id); | ||
| 135 | |||
| 136 | return elm && elm.style.display != "none"; | ||
| 137 | } | ||
| 138 | |||
| 139 | function convertRGBToHex(col) { | ||
| 140 | var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); | ||
| 141 | |||
| 142 | var rgb = col.replace(re, "$1,$2,$3").split(','); | ||
| 143 | if (rgb.length == 3) { | ||
| 144 | r = parseInt(rgb[0]).toString(16); | ||
| 145 | g = parseInt(rgb[1]).toString(16); | ||
| 146 | b = parseInt(rgb[2]).toString(16); | ||
| 147 | |||
| 148 | r = r.length == 1 ? '0' + r : r; | ||
| 149 | g = g.length == 1 ? '0' + g : g; | ||
| 150 | b = b.length == 1 ? '0' + b : b; | ||
| 151 | |||
| 152 | return "#" + r + g + b; | ||
| 153 | } | ||
| 154 | |||
| 155 | return col; | ||
| 156 | } | ||
| 157 | |||
| 158 | function convertHexToRGB(col) { | ||
| 159 | if (col.indexOf('#') != -1) { | ||
| 160 | col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); | ||
| 161 | |||
| 162 | r = parseInt(col.substring(0, 2), 16); | ||
| 163 | g = parseInt(col.substring(2, 4), 16); | ||
| 164 | b = parseInt(col.substring(4, 6), 16); | ||
| 165 | |||
| 166 | return "rgb(" + r + "," + g + "," + b + ")"; | ||
| 167 | } | ||
| 168 | |||
| 169 | return col; | ||
| 170 | } | ||
| 171 | |||
| 172 | function trimSize(size) { | ||
| 173 | return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2'); | ||
| 174 | } | ||
| 175 | |||
| 176 | function getCSSSize(size) { | ||
| 177 | size = trimSize(size); | ||
| 178 | |||
| 179 | if (size == "") | ||
| 180 | return ""; | ||
| 181 | |||
| 182 | // Add px | ||
| 183 | if (/^[0-9]+$/.test(size)) | ||
| 184 | size += 'px'; | ||
| 185 | |||
| 186 | return size; | ||
| 187 | } | ||
| 188 | |||
| 189 | function getStyle(elm, attrib, style) { | ||
| 190 | var val = tinyMCEPopup.dom.getAttrib(elm, attrib); | ||
| 191 | |||
| 192 | if (val != '') | ||
| 193 | return '' + val; | ||
| 194 | |||
| 195 | if (typeof(style) == 'undefined') | ||
| 196 | style = attrib; | ||
| 197 | |||
| 198 | return tinyMCEPopup.dom.getStyle(elm, style); | ||
| 199 | } | ||
diff --git a/public/javascripts/tiny_mce/utils/mctabs.js b/public/javascripts/tiny_mce/utils/mctabs.js new file mode 100755 index 0000000..284501e --- /dev/null +++ b/public/javascripts/tiny_mce/utils/mctabs.js | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | /** | ||
| 2 | * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $ | ||
| 3 | * | ||
| 4 | * Moxiecode DHTML Tabs script. | ||
| 5 | * | ||
| 6 | * @author Moxiecode | ||
| 7 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 8 | */ | ||
| 9 | |||
| 10 | function MCTabs() { | ||
| 11 | this.settings = []; | ||
| 12 | }; | ||
| 13 | |||
| 14 | MCTabs.prototype.init = function(settings) { | ||
| 15 | this.settings = settings; | ||
| 16 | }; | ||
| 17 | |||
| 18 | MCTabs.prototype.getParam = function(name, default_value) { | ||
| 19 | var value = null; | ||
| 20 | |||
| 21 | value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name]; | ||
| 22 | |||
| 23 | // Fix bool values | ||
| 24 | if (value == "true" || value == "false") | ||
| 25 | return (value == "true"); | ||
| 26 | |||
| 27 | return value; | ||
| 28 | }; | ||
| 29 | |||
| 30 | MCTabs.prototype.displayTab = function(tab_id, panel_id) { | ||
| 31 | var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i; | ||
| 32 | |||
| 33 | panelElm= document.getElementById(panel_id); | ||
| 34 | panelContainerElm = panelElm ? panelElm.parentNode : null; | ||
| 35 | tabElm = document.getElementById(tab_id); | ||
| 36 | tabContainerElm = tabElm ? tabElm.parentNode : null; | ||
| 37 | selectionClass = this.getParam('selection_class', 'current'); | ||
| 38 | |||
| 39 | if (tabElm && tabContainerElm) { | ||
| 40 | nodes = tabContainerElm.childNodes; | ||
| 41 | |||
| 42 | // Hide all other tabs | ||
| 43 | for (i = 0; i < nodes.length; i++) { | ||
| 44 | if (nodes[i].nodeName == "LI") | ||
| 45 | nodes[i].className = ''; | ||
| 46 | } | ||
| 47 | |||
| 48 | // Show selected tab | ||
| 49 | tabElm.className = 'current'; | ||
| 50 | } | ||
| 51 | |||
| 52 | if (panelElm && panelContainerElm) { | ||
| 53 | nodes = panelContainerElm.childNodes; | ||
| 54 | |||
| 55 | // Hide all other panels | ||
| 56 | for (i = 0; i < nodes.length; i++) { | ||
| 57 | if (nodes[i].nodeName == "DIV") | ||
| 58 | nodes[i].className = 'panel'; | ||
| 59 | } | ||
| 60 | |||
| 61 | // Show selected panel | ||
| 62 | panelElm.className = 'current'; | ||
| 63 | } | ||
| 64 | }; | ||
| 65 | |||
| 66 | MCTabs.prototype.getAnchor = function() { | ||
| 67 | var pos, url = document.location.href; | ||
| 68 | |||
| 69 | if ((pos = url.lastIndexOf('#')) != -1) | ||
| 70 | return url.substring(pos + 1); | ||
| 71 | |||
| 72 | return ""; | ||
| 73 | }; | ||
| 74 | |||
| 75 | // Global instance | ||
| 76 | var mcTabs = new MCTabs(); | ||
diff --git a/public/javascripts/tiny_mce/utils/validate.js b/public/javascripts/tiny_mce/utils/validate.js new file mode 100755 index 0000000..cde4c97 --- /dev/null +++ b/public/javascripts/tiny_mce/utils/validate.js | |||
| @@ -0,0 +1,219 @@ | |||
| 1 | /** | ||
| 2 | * $Id: validate.js 758 2008-03-30 13:53:29Z spocke $ | ||
| 3 | * | ||
| 4 | * Various form validation methods. | ||
| 5 | * | ||
| 6 | * @author Moxiecode | ||
| 7 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 8 | */ | ||
| 9 | |||
| 10 | /** | ||
| 11 | // String validation: | ||
| 12 | |||
| 13 | if (!Validator.isEmail('myemail')) | ||
| 14 | alert('Invalid email.'); | ||
| 15 | |||
| 16 | // Form validation: | ||
| 17 | |||
| 18 | var f = document.forms['myform']; | ||
| 19 | |||
| 20 | if (!Validator.isEmail(f.myemail)) | ||
| 21 | alert('Invalid email.'); | ||
| 22 | */ | ||
| 23 | |||
| 24 | var Validator = { | ||
| 25 | isEmail : function(s) { | ||
| 26 | return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$'); | ||
| 27 | }, | ||
| 28 | |||
| 29 | isAbsUrl : function(s) { | ||
| 30 | return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$'); | ||
| 31 | }, | ||
| 32 | |||
| 33 | isSize : function(s) { | ||
| 34 | return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$'); | ||
| 35 | }, | ||
| 36 | |||
| 37 | isId : function(s) { | ||
| 38 | return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$'); | ||
| 39 | }, | ||
| 40 | |||
| 41 | isEmpty : function(s) { | ||
| 42 | var nl, i; | ||
| 43 | |||
| 44 | if (s.nodeName == 'SELECT' && s.selectedIndex < 1) | ||
| 45 | return true; | ||
| 46 | |||
| 47 | if (s.type == 'checkbox' && !s.checked) | ||
| 48 | return true; | ||
| 49 | |||
| 50 | if (s.type == 'radio') { | ||
| 51 | for (i=0, nl = s.form.elements; i<nl.length; i++) { | ||
| 52 | if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked) | ||
| 53 | return false; | ||
| 54 | } | ||
| 55 | |||
| 56 | return true; | ||
| 57 | } | ||
| 58 | |||
| 59 | return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s); | ||
| 60 | }, | ||
| 61 | |||
| 62 | isNumber : function(s, d) { | ||
| 63 | return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$')); | ||
| 64 | }, | ||
| 65 | |||
| 66 | test : function(s, p) { | ||
| 67 | s = s.nodeType == 1 ? s.value : s; | ||
| 68 | |||
| 69 | return s == '' || new RegExp(p).test(s); | ||
| 70 | } | ||
| 71 | }; | ||
| 72 | |||
| 73 | var AutoValidator = { | ||
| 74 | settings : { | ||
| 75 | id_cls : 'id', | ||
| 76 | int_cls : 'int', | ||
| 77 | url_cls : 'url', | ||
| 78 | number_cls : 'number', | ||
| 79 | email_cls : 'email', | ||
| 80 | size_cls : 'size', | ||
| 81 | required_cls : 'required', | ||
| 82 | invalid_cls : 'invalid', | ||
| 83 | min_cls : 'min', | ||
| 84 | max_cls : 'max' | ||
| 85 | }, | ||
| 86 | |||
| 87 | init : function(s) { | ||
| 88 | var n; | ||
| 89 | |||
| 90 | for (n in s) | ||
| 91 | this.settings[n] = s[n]; | ||
| 92 | }, | ||
| 93 | |||
| 94 | validate : function(f) { | ||
| 95 | var i, nl, s = this.settings, c = 0; | ||
| 96 | |||
| 97 | nl = this.tags(f, 'label'); | ||
| 98 | for (i=0; i<nl.length; i++) | ||
| 99 | this.removeClass(nl[i], s.invalid_cls); | ||
| 100 | |||
| 101 | c += this.validateElms(f, 'input'); | ||
| 102 | c += this.validateElms(f, 'select'); | ||
| 103 | c += this.validateElms(f, 'textarea'); | ||
| 104 | |||
| 105 | return c == 3; | ||
| 106 | }, | ||
| 107 | |||
| 108 | invalidate : function(n) { | ||
| 109 | this.mark(n.form, n); | ||
| 110 | }, | ||
| 111 | |||
| 112 | reset : function(e) { | ||
| 113 | var t = ['label', 'input', 'select', 'textarea']; | ||
| 114 | var i, j, nl, s = this.settings; | ||
| 115 | |||
| 116 | if (e == null) | ||
| 117 | return; | ||
| 118 | |||
| 119 | for (i=0; i<t.length; i++) { | ||
| 120 | nl = this.tags(e.form ? e.form : e, t[i]); | ||
| 121 | for (j=0; j<nl.length; j++) | ||
| 122 | this.removeClass(nl[j], s.invalid_cls); | ||
| 123 | } | ||
| 124 | }, | ||
| 125 | |||
| 126 | validateElms : function(f, e) { | ||
| 127 | var nl, i, n, s = this.settings, st = true, va = Validator, v; | ||
| 128 | |||
| 129 | nl = this.tags(f, e); | ||
| 130 | for (i=0; i<nl.length; i++) { | ||
| 131 | n = nl[i]; | ||
| 132 | |||
| 133 | this.removeClass(n, s.invalid_cls); | ||
| 134 | |||
| 135 | if (this.hasClass(n, s.required_cls) && va.isEmpty(n)) | ||
| 136 | st = this.mark(f, n); | ||
| 137 | |||
| 138 | if (this.hasClass(n, s.number_cls) && !va.isNumber(n)) | ||
| 139 | st = this.mark(f, n); | ||
| 140 | |||
| 141 | if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true)) | ||
| 142 | st = this.mark(f, n); | ||
| 143 | |||
| 144 | if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n)) | ||
| 145 | st = this.mark(f, n); | ||
| 146 | |||
| 147 | if (this.hasClass(n, s.email_cls) && !va.isEmail(n)) | ||
| 148 | st = this.mark(f, n); | ||
| 149 | |||
| 150 | if (this.hasClass(n, s.size_cls) && !va.isSize(n)) | ||
| 151 | st = this.mark(f, n); | ||
| 152 | |||
| 153 | if (this.hasClass(n, s.id_cls) && !va.isId(n)) | ||
| 154 | st = this.mark(f, n); | ||
| 155 | |||
| 156 | if (this.hasClass(n, s.min_cls, true)) { | ||
| 157 | v = this.getNum(n, s.min_cls); | ||
| 158 | |||
| 159 | if (isNaN(v) || parseInt(n.value) < parseInt(v)) | ||
| 160 | st = this.mark(f, n); | ||
| 161 | } | ||
| 162 | |||
| 163 | if (this.hasClass(n, s.max_cls, true)) { | ||
| 164 | v = this.getNum(n, s.max_cls); | ||
| 165 | |||
| 166 | if (isNaN(v) || parseInt(n.value) > parseInt(v)) | ||
| 167 | st = this.mark(f, n); | ||
| 168 | } | ||
| 169 | } | ||
| 170 | |||
| 171 | return st; | ||
| 172 | }, | ||
| 173 | |||
| 174 | hasClass : function(n, c, d) { | ||
| 175 | return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); | ||
| 176 | }, | ||
| 177 | |||
| 178 | getNum : function(n, c) { | ||
| 179 | c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; | ||
| 180 | c = c.replace(/[^0-9]/g, ''); | ||
| 181 | |||
| 182 | return c; | ||
| 183 | }, | ||
| 184 | |||
| 185 | addClass : function(n, c, b) { | ||
| 186 | var o = this.removeClass(n, c); | ||
| 187 | n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; | ||
| 188 | }, | ||
| 189 | |||
| 190 | removeClass : function(n, c) { | ||
| 191 | c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); | ||
| 192 | return n.className = c != ' ' ? c : ''; | ||
| 193 | }, | ||
| 194 | |||
| 195 | tags : function(f, s) { | ||
| 196 | return f.getElementsByTagName(s); | ||
| 197 | }, | ||
| 198 | |||
| 199 | mark : function(f, n) { | ||
| 200 | var s = this.settings; | ||
| 201 | |||
| 202 | this.addClass(n, s.invalid_cls); | ||
| 203 | this.markLabels(f, n, s.invalid_cls); | ||
| 204 | |||
| 205 | return false; | ||
| 206 | }, | ||
| 207 | |||
| 208 | markLabels : function(f, n, ic) { | ||
| 209 | var nl, i; | ||
| 210 | |||
| 211 | nl = this.tags(f, "label"); | ||
| 212 | for (i=0; i<nl.length; i++) { | ||
| 213 | if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id) | ||
| 214 | this.addClass(nl[i], ic); | ||
| 215 | } | ||
| 216 | |||
| 217 | return null; | ||
| 218 | } | ||
| 219 | }; | ||
