Version Description
- Added events to lead tracking
- Bug Fix: Marketing Button
- Optimized CTA Tracking JS.
Download this release
Release Info
Developer | DavidWells |
Plugin | WordPress Landing Pages |
Version | 1.5.5 |
Comparing to | |
See all releases |
Code changes from version 1.5.2 to 1.5.5
- LICENSE +339 -339
- css/admin-install-plugins.css +12 -12
- css/admin-lp-cpt-only-style.css +91 -91
- css/admin-templates.css +47 -47
- css/customizer-load.css +68 -68
- css/customizer.frontend.css +155 -155
- css/frontend/global-landing-page-style.css +39 -39
- css/jquery.qtip.min.css +3 -3
- css/new-customizer-admin.css +240 -240
- js/admin/admin.global-settings.js +43 -43
- js/admin/admin.install-plugins.js +30 -30
- js/admin/admin.landing-page-list.js +7 -7
- js/admin/admin.metaboxes.js +1 -1
- js/admin/admin.templates-upload.js +24 -24
- js/admin/new-customizer-admin.js +57 -57
- js/admin/tour/tour.post-edit.js +10 -10
- js/admin/tour/tour.post-list.js +7 -7
- js/ajax.clearstats.js +1 -1
- js/customizer.load.js +125 -125
- js/customizer.save.js +472 -472
- js/jquery.form-population.js +1 -1
- js/jquery.tablesorter.js +1030 -1030
- js/libraries/jpicker/css/jPicker-1.1.6.css +231 -231
- js/libraries/jpicker/css/jPicker.css +16 -16
- js/libraries/jquery-datepicker/jquery.timepicker.css +51 -51
- js/libraries/jquery-datepicker/jquery.timepicker.min.js +2 -2
- js/libraries/jquery-datepicker/lib/base.js +13 -13
- js/libraries/jquery-datepicker/lib/datepair.js +204 -204
- js/libraries/jquery-datepicker/picker_functions.js +47 -47
- js/libraries/tiny_mce/license.txt +504 -504
- js/libraries/tiny_mce/plugins/advhr/css/advhr.css +5 -5
- js/libraries/tiny_mce/plugins/advhr/editor_plugin_src.js +56 -56
- js/libraries/tiny_mce/plugins/advhr/js/rule.js +43 -43
- js/libraries/tiny_mce/plugins/advhr/rule.htm +58 -58
- js/libraries/tiny_mce/plugins/advimage/css/advimage.css +13 -13
- js/libraries/tiny_mce/plugins/advimage/editor_plugin_src.js +49 -49
- js/libraries/tiny_mce/plugins/advimage/image.htm +235 -235
- js/libraries/tiny_mce/plugins/advimage/js/image.js +464 -464
- js/libraries/tiny_mce/plugins/advlink/css/advlink.css +8 -8
- js/libraries/tiny_mce/plugins/advlink/editor_plugin_src.js +60 -60
- js/libraries/tiny_mce/plugins/advlink/js/advlink.js +543 -543
- js/libraries/tiny_mce/plugins/advlink/link.htm +338 -338
- js/libraries/tiny_mce/plugins/advlist/editor_plugin_src.js +175 -175
- js/libraries/tiny_mce/plugins/autosave/editor_plugin_src.js +433 -433
- js/libraries/tiny_mce/plugins/autosave/langs/en.js +3 -3
- js/libraries/tiny_mce/plugins/bbcode/editor_plugin_src.js +119 -119
- js/libraries/tiny_mce/plugins/contextmenu/editor_plugin_src.js +163 -163
- js/libraries/tiny_mce/plugins/directionality/editor_plugin_src.js +84 -84
- js/libraries/tiny_mce/plugins/emotions/editor_plugin_src.js +42 -42
- js/libraries/tiny_mce/plugins/emotions/emotions.htm +42 -42
- js/libraries/tiny_mce/plugins/emotions/js/emotions.js +43 -43
- js/libraries/tiny_mce/plugins/example/dialog.htm +22 -22
- js/libraries/tiny_mce/plugins/example/editor_plugin_src.js +83 -83
- js/libraries/tiny_mce/plugins/example/js/dialog.js +19 -19
- js/libraries/tiny_mce/plugins/example/langs/en.js +3 -3
- js/libraries/tiny_mce/plugins/example/langs/en_dlg.js +3 -3
- js/libraries/tiny_mce/plugins/fullpage/css/fullpage.css +142 -142
- js/libraries/tiny_mce/plugins/fullpage/editor_plugin_src.js +405 -405
- js/libraries/tiny_mce/plugins/fullpage/fullpage.htm +259 -259
- js/libraries/tiny_mce/plugins/fullpage/js/fullpage.js +232 -232
- js/libraries/tiny_mce/plugins/fullscreen/editor_plugin_src.js +159 -159
- js/libraries/tiny_mce/plugins/fullscreen/fullscreen.htm +110 -110
- js/libraries/tiny_mce/plugins/iespell/editor_plugin_src.js +53 -53
- js/libraries/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +699 -699
- js/libraries/tiny_mce/plugins/inlinepopups/template.htm +387 -387
- js/libraries/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +82 -82
- js/libraries/tiny_mce/plugins/layer/editor_plugin_src.js +261 -261
- js/libraries/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +137 -137
- js/libraries/tiny_mce/plugins/media/css/media.css +17 -17
- js/libraries/tiny_mce/plugins/media/editor_plugin_src.js +898 -898
- js/libraries/tiny_mce/plugins/media/js/embed.js +73 -73
- js/libraries/tiny_mce/plugins/media/js/media.js +503 -503
- js/libraries/tiny_mce/plugins/media/media.htm +922 -922
- js/libraries/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +53 -53
- js/libraries/tiny_mce/plugins/noneditable/editor_plugin_src.js +536 -536
- js/libraries/tiny_mce/plugins/pagebreak/editor_plugin_src.js +73 -73
- js/libraries/tiny_mce/plugins/paste/editor_plugin_src.js +0 -504
LICENSE
CHANGED
@@ -1,339 +1,339 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 2, June 1991
|
3 |
-
|
4 |
-
Copyright (C) 1989, 1991 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 |
-
Preamble
|
10 |
-
|
11 |
-
The licenses for most software are designed to take away your
|
12 |
-
freedom to share and change it. By contrast, the GNU General Public
|
13 |
-
License is intended to guarantee your freedom to share and change free
|
14 |
-
software--to make sure the software is free for all its users. This
|
15 |
-
General Public License applies to most of the Free Software
|
16 |
-
Foundation's software and to any other program whose authors commit to
|
17 |
-
using it. (Some other Free Software Foundation software is covered by
|
18 |
-
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
-
your programs, too.
|
20 |
-
|
21 |
-
When we speak of free software, we are referring to freedom, not
|
22 |
-
price. Our General Public Licenses are designed to make sure that you
|
23 |
-
have the freedom to distribute copies of free software (and charge for
|
24 |
-
this service if you wish), that you receive source code or can get it
|
25 |
-
if you want it, that you can change the software or use pieces of it
|
26 |
-
in new free programs; and that you know you can do these things.
|
27 |
-
|
28 |
-
To protect your rights, we need to make restrictions that forbid
|
29 |
-
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
-
These restrictions translate to certain responsibilities for you if you
|
31 |
-
distribute copies of the software, or if you modify it.
|
32 |
-
|
33 |
-
For example, if you distribute copies of such a program, whether
|
34 |
-
gratis or for a fee, you must give the recipients all the rights that
|
35 |
-
you have. You must make sure that they, too, receive or can get the
|
36 |
-
source code. And you must show them these terms so they know their
|
37 |
-
rights.
|
38 |
-
|
39 |
-
We protect your rights with two steps: (1) copyright the software, and
|
40 |
-
(2) offer you this license which gives you legal permission to copy,
|
41 |
-
distribute and/or modify the software.
|
42 |
-
|
43 |
-
Also, for each author's protection and ours, we want to make certain
|
44 |
-
that everyone understands that there is no warranty for this free
|
45 |
-
software. If the software is modified by someone else and passed on, we
|
46 |
-
want its recipients to know that what they have is not the original, so
|
47 |
-
that any problems introduced by others will not reflect on the original
|
48 |
-
authors' reputations.
|
49 |
-
|
50 |
-
Finally, any free program is threatened constantly by software
|
51 |
-
patents. We wish to avoid the danger that redistributors of a free
|
52 |
-
program will individually obtain patent licenses, in effect making the
|
53 |
-
program proprietary. To prevent this, we have made it clear that any
|
54 |
-
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
-
|
56 |
-
The precise terms and conditions for copying, distribution and
|
57 |
-
modification follow.
|
58 |
-
|
59 |
-
GNU GENERAL PUBLIC LICENSE
|
60 |
-
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
-
|
62 |
-
0. This License applies to any program or other work which contains
|
63 |
-
a notice placed by the copyright holder saying it may be distributed
|
64 |
-
under the terms of this General Public License. The "Program", below,
|
65 |
-
refers to any such program or work, and a "work based on the Program"
|
66 |
-
means either the Program or any derivative work under copyright law:
|
67 |
-
that is to say, a work containing the Program or a portion of it,
|
68 |
-
either verbatim or with modifications and/or translated into another
|
69 |
-
language. (Hereinafter, translation is included without limitation in
|
70 |
-
the term "modification".) Each licensee is addressed as "you".
|
71 |
-
|
72 |
-
Activities other than copying, distribution and modification are not
|
73 |
-
covered by this License; they are outside its scope. The act of
|
74 |
-
running the Program is not restricted, and the output from the Program
|
75 |
-
is covered only if its contents constitute a work based on the
|
76 |
-
Program (independent of having been made by running the Program).
|
77 |
-
Whether that is true depends on what the Program does.
|
78 |
-
|
79 |
-
1. You may copy and distribute verbatim copies of the Program's
|
80 |
-
source code as you receive it, in any medium, provided that you
|
81 |
-
conspicuously and appropriately publish on each copy an appropriate
|
82 |
-
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
-
notices that refer to this License and to the absence of any warranty;
|
84 |
-
and give any other recipients of the Program a copy of this License
|
85 |
-
along with the Program.
|
86 |
-
|
87 |
-
You may charge a fee for the physical act of transferring a copy, and
|
88 |
-
you may at your option offer warranty protection in exchange for a fee.
|
89 |
-
|
90 |
-
2. You may modify your copy or copies of the Program or any portion
|
91 |
-
of it, thus forming a work based on the Program, and copy and
|
92 |
-
distribute such modifications or work under the terms of Section 1
|
93 |
-
above, provided that you also meet all of these conditions:
|
94 |
-
|
95 |
-
a) You must cause the modified files to carry prominent notices
|
96 |
-
stating that you changed the files and the date of any change.
|
97 |
-
|
98 |
-
b) You must cause any work that you distribute or publish, that in
|
99 |
-
whole or in part contains or is derived from the Program or any
|
100 |
-
part thereof, to be licensed as a whole at no charge to all third
|
101 |
-
parties under the terms of this License.
|
102 |
-
|
103 |
-
c) If the modified program normally reads commands interactively
|
104 |
-
when run, you must cause it, when started running for such
|
105 |
-
interactive use in the most ordinary way, to print or display an
|
106 |
-
announcement including an appropriate copyright notice and a
|
107 |
-
notice that there is no warranty (or else, saying that you provide
|
108 |
-
a warranty) and that users may redistribute the program under
|
109 |
-
these conditions, and telling the user how to view a copy of this
|
110 |
-
License. (Exception: if the Program itself is interactive but
|
111 |
-
does not normally print such an announcement, your work based on
|
112 |
-
the Program is not required to print an announcement.)
|
113 |
-
|
114 |
-
These requirements apply to the modified work as a whole. If
|
115 |
-
identifiable sections of that work are not derived from the Program,
|
116 |
-
and can be reasonably considered independent and separate works in
|
117 |
-
themselves, then this License, and its terms, do not apply to those
|
118 |
-
sections when you distribute them as separate works. But when you
|
119 |
-
distribute the same sections as part of a whole which is a work based
|
120 |
-
on the Program, the distribution of the whole must be on the terms of
|
121 |
-
this License, whose permissions for other licensees extend to the
|
122 |
-
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
-
|
124 |
-
Thus, it is not the intent of this section to claim rights or contest
|
125 |
-
your rights to work written entirely by you; rather, the intent is to
|
126 |
-
exercise the right to control the distribution of derivative or
|
127 |
-
collective works based on the Program.
|
128 |
-
|
129 |
-
In addition, mere aggregation of another work not based on the Program
|
130 |
-
with the Program (or with a work based on the Program) on a volume of
|
131 |
-
a storage or distribution medium does not bring the other work under
|
132 |
-
the scope of this License.
|
133 |
-
|
134 |
-
3. You may copy and distribute the Program (or a work based on it,
|
135 |
-
under Section 2) in object code or executable form under the terms of
|
136 |
-
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
-
|
138 |
-
a) Accompany it with the complete corresponding machine-readable
|
139 |
-
source code, which must be distributed under the terms of Sections
|
140 |
-
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
-
|
142 |
-
b) Accompany it with a written offer, valid for at least three
|
143 |
-
years, to give any third party, for a charge no more than your
|
144 |
-
cost of physically performing source distribution, a complete
|
145 |
-
machine-readable copy of the corresponding source code, to be
|
146 |
-
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
-
customarily used for software interchange; or,
|
148 |
-
|
149 |
-
c) Accompany it with the information you received as to the offer
|
150 |
-
to distribute corresponding source code. (This alternative is
|
151 |
-
allowed only for noncommercial distribution and only if you
|
152 |
-
received the program in object code or executable form with such
|
153 |
-
an offer, in accord with Subsection b above.)
|
154 |
-
|
155 |
-
The source code for a work means the preferred form of the work for
|
156 |
-
making modifications to it. For an executable work, complete source
|
157 |
-
code means all the source code for all modules it contains, plus any
|
158 |
-
associated interface definition files, plus the scripts used to
|
159 |
-
control compilation and installation of the executable. However, as a
|
160 |
-
special exception, the source code distributed need not include
|
161 |
-
anything that is normally distributed (in either source or binary
|
162 |
-
form) with the major components (compiler, kernel, and so on) of the
|
163 |
-
operating system on which the executable runs, unless that component
|
164 |
-
itself accompanies the executable.
|
165 |
-
|
166 |
-
If distribution of executable or object code is made by offering
|
167 |
-
access to copy from a designated place, then offering equivalent
|
168 |
-
access to copy the source code from the same place counts as
|
169 |
-
distribution of the source code, even though third parties are not
|
170 |
-
compelled to copy the source along with the object code.
|
171 |
-
|
172 |
-
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
-
except as expressly provided under this License. Any attempt
|
174 |
-
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
-
void, and will automatically terminate your rights under this License.
|
176 |
-
However, parties who have received copies, or rights, from you under
|
177 |
-
this License will not have their licenses terminated so long as such
|
178 |
-
parties remain in full compliance.
|
179 |
-
|
180 |
-
5. You are not required to accept this License, since you have not
|
181 |
-
signed it. However, nothing else grants you permission to modify or
|
182 |
-
distribute the Program or its derivative works. These actions are
|
183 |
-
prohibited by law if you do not accept this License. Therefore, by
|
184 |
-
modifying or distributing the Program (or any work based on the
|
185 |
-
Program), you indicate your acceptance of this License to do so, and
|
186 |
-
all its terms and conditions for copying, distributing or modifying
|
187 |
-
the Program or works based on it.
|
188 |
-
|
189 |
-
6. Each time you redistribute the Program (or any work based on the
|
190 |
-
Program), the recipient automatically receives a license from the
|
191 |
-
original licensor to copy, distribute or modify the Program subject to
|
192 |
-
these terms and conditions. You may not impose any further
|
193 |
-
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
-
You are not responsible for enforcing compliance by third parties to
|
195 |
-
this License.
|
196 |
-
|
197 |
-
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
-
infringement or for any other reason (not limited to patent issues),
|
199 |
-
conditions are imposed on you (whether by court order, agreement or
|
200 |
-
otherwise) that contradict the conditions of this License, they do not
|
201 |
-
excuse you from the conditions of this License. If you cannot
|
202 |
-
distribute so as to satisfy simultaneously your obligations under this
|
203 |
-
License and any other pertinent obligations, then as a consequence you
|
204 |
-
may not distribute the Program at all. For example, if a patent
|
205 |
-
license would not permit royalty-free redistribution of the Program by
|
206 |
-
all those who receive copies directly or indirectly through you, then
|
207 |
-
the only way you could satisfy both it and this License would be to
|
208 |
-
refrain entirely from distribution of the Program.
|
209 |
-
|
210 |
-
If any portion of this section is held invalid or unenforceable under
|
211 |
-
any particular circumstance, the balance of the section is intended to
|
212 |
-
apply and the section as a whole is intended to apply in other
|
213 |
-
circumstances.
|
214 |
-
|
215 |
-
It is not the purpose of this section to induce you to infringe any
|
216 |
-
patents or other property right claims or to contest validity of any
|
217 |
-
such claims; this section has the sole purpose of protecting the
|
218 |
-
integrity of the free software distribution system, which is
|
219 |
-
implemented by public license practices. Many people have made
|
220 |
-
generous contributions to the wide range of software distributed
|
221 |
-
through that system in reliance on consistent application of that
|
222 |
-
system; it is up to the author/donor to decide if he or she is willing
|
223 |
-
to distribute software through any other system and a licensee cannot
|
224 |
-
impose that choice.
|
225 |
-
|
226 |
-
This section is intended to make thoroughly clear what is believed to
|
227 |
-
be a consequence of the rest of this License.
|
228 |
-
|
229 |
-
8. If the distribution and/or use of the Program is restricted in
|
230 |
-
certain countries either by patents or by copyrighted interfaces, the
|
231 |
-
original copyright holder who places the Program under this License
|
232 |
-
may add an explicit geographical distribution limitation excluding
|
233 |
-
those countries, so that distribution is permitted only in or among
|
234 |
-
countries not thus excluded. In such case, this License incorporates
|
235 |
-
the limitation as if written in the body of this License.
|
236 |
-
|
237 |
-
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
-
of the General Public License from time to time. Such new versions will
|
239 |
-
be similar in spirit to the present version, but may differ in detail to
|
240 |
-
address new problems or concerns.
|
241 |
-
|
242 |
-
Each version is given a distinguishing version number. If the Program
|
243 |
-
specifies a version number of this License which applies to it and "any
|
244 |
-
later version", you have the option of following the terms and conditions
|
245 |
-
either of that version or of any later version published by the Free
|
246 |
-
Software Foundation. If the Program does not specify a version number of
|
247 |
-
this License, you may choose any version ever published by the Free Software
|
248 |
-
Foundation.
|
249 |
-
|
250 |
-
10. If you wish to incorporate parts of the Program into other free
|
251 |
-
programs whose distribution conditions are different, write to the author
|
252 |
-
to ask for permission. For software which is copyrighted by the Free
|
253 |
-
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
-
make exceptions for this. Our decision will be guided by the two goals
|
255 |
-
of preserving the free status of all derivatives of our free software and
|
256 |
-
of promoting the sharing and reuse of software generally.
|
257 |
-
|
258 |
-
NO WARRANTY
|
259 |
-
|
260 |
-
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
-
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
-
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
-
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
-
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
-
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
-
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
-
REPAIR OR CORRECTION.
|
269 |
-
|
270 |
-
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
-
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
-
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
-
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
-
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
-
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
-
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
-
POSSIBILITY OF SUCH DAMAGES.
|
279 |
-
|
280 |
-
END OF TERMS AND CONDITIONS
|
281 |
-
|
282 |
-
How to Apply These Terms to Your New Programs
|
283 |
-
|
284 |
-
If you develop a new program, and you want it to be of the greatest
|
285 |
-
possible use to the public, the best way to achieve this is to make it
|
286 |
-
free software which everyone can redistribute and change under these terms.
|
287 |
-
|
288 |
-
To do so, attach the following notices to the program. It is safest
|
289 |
-
to attach them to the start of each source file to most effectively
|
290 |
-
convey the exclusion of warranty; and each file should have at least
|
291 |
-
the "copyright" line and a pointer to where the full notice is found.
|
292 |
-
|
293 |
-
WordPress Landing Pages
|
294 |
-
Copyright (C) 2013 Inbound Now
|
295 |
-
|
296 |
-
This program is free software; you can redistribute it and/or modify
|
297 |
-
it under the terms of the GNU General Public License as published by
|
298 |
-
the Free Software Foundation; either version 2 of the License, or
|
299 |
-
(at your option) any later version.
|
300 |
-
|
301 |
-
This program is distributed in the hope that it will be useful,
|
302 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
-
GNU General Public License for more details.
|
305 |
-
|
306 |
-
You should have received a copy of the GNU General Public License along
|
307 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
-
|
310 |
-
Also add information on how to contact you by electronic and paper mail.
|
311 |
-
|
312 |
-
If the program is interactive, make it output a short notice like this
|
313 |
-
when it starts in an interactive mode:
|
314 |
-
|
315 |
-
Gnomovision version 69, Copyright (C) year name of author
|
316 |
-
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
-
This is free software, and you are welcome to redistribute it
|
318 |
-
under certain conditions; type `show c' for details.
|
319 |
-
|
320 |
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
-
parts of the General Public License. Of course, the commands you use may
|
322 |
-
be called something other than `show w' and `show c'; they could even be
|
323 |
-
mouse-clicks or menu items--whatever suits your program.
|
324 |
-
|
325 |
-
You should also get your employer (if you work as a programmer) or your
|
326 |
-
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
-
necessary. Here is a sample; alter the names:
|
328 |
-
|
329 |
-
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
-
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
-
|
332 |
-
{signature of Ty Coon}, 1 April 1989
|
333 |
-
Ty Coon, President of Vice
|
334 |
-
|
335 |
-
This General Public License does not permit incorporating your program into
|
336 |
-
proprietary programs. If your program is a subroutine library, you may
|
337 |
-
consider it more useful to permit linking proprietary applications with the
|
338 |
-
library. If this is what you want to do, use the GNU Lesser General
|
339 |
-
Public License instead of this License.
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 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 |
+
Preamble
|
10 |
+
|
11 |
+
The licenses for most software are designed to take away your
|
12 |
+
freedom to share and change it. By contrast, the GNU General Public
|
13 |
+
License is intended to guarantee your freedom to share and change free
|
14 |
+
software--to make sure the software is free for all its users. This
|
15 |
+
General Public License applies to most of the Free Software
|
16 |
+
Foundation's software and to any other program whose authors commit to
|
17 |
+
using it. (Some other Free Software Foundation software is covered by
|
18 |
+
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
+
your programs, too.
|
20 |
+
|
21 |
+
When we speak of free software, we are referring to freedom, not
|
22 |
+
price. Our General Public Licenses are designed to make sure that you
|
23 |
+
have the freedom to distribute copies of free software (and charge for
|
24 |
+
this service if you wish), that you receive source code or can get it
|
25 |
+
if you want it, that you can change the software or use pieces of it
|
26 |
+
in new free programs; and that you know you can do these things.
|
27 |
+
|
28 |
+
To protect your rights, we need to make restrictions that forbid
|
29 |
+
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
+
These restrictions translate to certain responsibilities for you if you
|
31 |
+
distribute copies of the software, or if you modify it.
|
32 |
+
|
33 |
+
For example, if you distribute copies of such a program, whether
|
34 |
+
gratis or for a fee, you must give the recipients all the rights that
|
35 |
+
you have. You must make sure that they, too, receive or can get the
|
36 |
+
source code. And you must show them these terms so they know their
|
37 |
+
rights.
|
38 |
+
|
39 |
+
We protect your rights with two steps: (1) copyright the software, and
|
40 |
+
(2) offer you this license which gives you legal permission to copy,
|
41 |
+
distribute and/or modify the software.
|
42 |
+
|
43 |
+
Also, for each author's protection and ours, we want to make certain
|
44 |
+
that everyone understands that there is no warranty for this free
|
45 |
+
software. If the software is modified by someone else and passed on, we
|
46 |
+
want its recipients to know that what they have is not the original, so
|
47 |
+
that any problems introduced by others will not reflect on the original
|
48 |
+
authors' reputations.
|
49 |
+
|
50 |
+
Finally, any free program is threatened constantly by software
|
51 |
+
patents. We wish to avoid the danger that redistributors of a free
|
52 |
+
program will individually obtain patent licenses, in effect making the
|
53 |
+
program proprietary. To prevent this, we have made it clear that any
|
54 |
+
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
+
|
56 |
+
The precise terms and conditions for copying, distribution and
|
57 |
+
modification follow.
|
58 |
+
|
59 |
+
GNU GENERAL PUBLIC LICENSE
|
60 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
+
|
62 |
+
0. This License applies to any program or other work which contains
|
63 |
+
a notice placed by the copyright holder saying it may be distributed
|
64 |
+
under the terms of this General Public License. The "Program", below,
|
65 |
+
refers to any such program or work, and a "work based on the Program"
|
66 |
+
means either the Program or any derivative work under copyright law:
|
67 |
+
that is to say, a work containing the Program or a portion of it,
|
68 |
+
either verbatim or with modifications and/or translated into another
|
69 |
+
language. (Hereinafter, translation is included without limitation in
|
70 |
+
the term "modification".) Each licensee is addressed as "you".
|
71 |
+
|
72 |
+
Activities other than copying, distribution and modification are not
|
73 |
+
covered by this License; they are outside its scope. The act of
|
74 |
+
running the Program is not restricted, and the output from the Program
|
75 |
+
is covered only if its contents constitute a work based on the
|
76 |
+
Program (independent of having been made by running the Program).
|
77 |
+
Whether that is true depends on what the Program does.
|
78 |
+
|
79 |
+
1. You may copy and distribute verbatim copies of the Program's
|
80 |
+
source code as you receive it, in any medium, provided that you
|
81 |
+
conspicuously and appropriately publish on each copy an appropriate
|
82 |
+
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
+
notices that refer to this License and to the absence of any warranty;
|
84 |
+
and give any other recipients of the Program a copy of this License
|
85 |
+
along with the Program.
|
86 |
+
|
87 |
+
You may charge a fee for the physical act of transferring a copy, and
|
88 |
+
you may at your option offer warranty protection in exchange for a fee.
|
89 |
+
|
90 |
+
2. You may modify your copy or copies of the Program or any portion
|
91 |
+
of it, thus forming a work based on the Program, and copy and
|
92 |
+
distribute such modifications or work under the terms of Section 1
|
93 |
+
above, provided that you also meet all of these conditions:
|
94 |
+
|
95 |
+
a) You must cause the modified files to carry prominent notices
|
96 |
+
stating that you changed the files and the date of any change.
|
97 |
+
|
98 |
+
b) You must cause any work that you distribute or publish, that in
|
99 |
+
whole or in part contains or is derived from the Program or any
|
100 |
+
part thereof, to be licensed as a whole at no charge to all third
|
101 |
+
parties under the terms of this License.
|
102 |
+
|
103 |
+
c) If the modified program normally reads commands interactively
|
104 |
+
when run, you must cause it, when started running for such
|
105 |
+
interactive use in the most ordinary way, to print or display an
|
106 |
+
announcement including an appropriate copyright notice and a
|
107 |
+
notice that there is no warranty (or else, saying that you provide
|
108 |
+
a warranty) and that users may redistribute the program under
|
109 |
+
these conditions, and telling the user how to view a copy of this
|
110 |
+
License. (Exception: if the Program itself is interactive but
|
111 |
+
does not normally print such an announcement, your work based on
|
112 |
+
the Program is not required to print an announcement.)
|
113 |
+
|
114 |
+
These requirements apply to the modified work as a whole. If
|
115 |
+
identifiable sections of that work are not derived from the Program,
|
116 |
+
and can be reasonably considered independent and separate works in
|
117 |
+
themselves, then this License, and its terms, do not apply to those
|
118 |
+
sections when you distribute them as separate works. But when you
|
119 |
+
distribute the same sections as part of a whole which is a work based
|
120 |
+
on the Program, the distribution of the whole must be on the terms of
|
121 |
+
this License, whose permissions for other licensees extend to the
|
122 |
+
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
+
|
124 |
+
Thus, it is not the intent of this section to claim rights or contest
|
125 |
+
your rights to work written entirely by you; rather, the intent is to
|
126 |
+
exercise the right to control the distribution of derivative or
|
127 |
+
collective works based on the Program.
|
128 |
+
|
129 |
+
In addition, mere aggregation of another work not based on the Program
|
130 |
+
with the Program (or with a work based on the Program) on a volume of
|
131 |
+
a storage or distribution medium does not bring the other work under
|
132 |
+
the scope of this License.
|
133 |
+
|
134 |
+
3. You may copy and distribute the Program (or a work based on it,
|
135 |
+
under Section 2) in object code or executable form under the terms of
|
136 |
+
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
+
|
138 |
+
a) Accompany it with the complete corresponding machine-readable
|
139 |
+
source code, which must be distributed under the terms of Sections
|
140 |
+
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
+
|
142 |
+
b) Accompany it with a written offer, valid for at least three
|
143 |
+
years, to give any third party, for a charge no more than your
|
144 |
+
cost of physically performing source distribution, a complete
|
145 |
+
machine-readable copy of the corresponding source code, to be
|
146 |
+
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
+
customarily used for software interchange; or,
|
148 |
+
|
149 |
+
c) Accompany it with the information you received as to the offer
|
150 |
+
to distribute corresponding source code. (This alternative is
|
151 |
+
allowed only for noncommercial distribution and only if you
|
152 |
+
received the program in object code or executable form with such
|
153 |
+
an offer, in accord with Subsection b above.)
|
154 |
+
|
155 |
+
The source code for a work means the preferred form of the work for
|
156 |
+
making modifications to it. For an executable work, complete source
|
157 |
+
code means all the source code for all modules it contains, plus any
|
158 |
+
associated interface definition files, plus the scripts used to
|
159 |
+
control compilation and installation of the executable. However, as a
|
160 |
+
special exception, the source code distributed need not include
|
161 |
+
anything that is normally distributed (in either source or binary
|
162 |
+
form) with the major components (compiler, kernel, and so on) of the
|
163 |
+
operating system on which the executable runs, unless that component
|
164 |
+
itself accompanies the executable.
|
165 |
+
|
166 |
+
If distribution of executable or object code is made by offering
|
167 |
+
access to copy from a designated place, then offering equivalent
|
168 |
+
access to copy the source code from the same place counts as
|
169 |
+
distribution of the source code, even though third parties are not
|
170 |
+
compelled to copy the source along with the object code.
|
171 |
+
|
172 |
+
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
+
except as expressly provided under this License. Any attempt
|
174 |
+
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
+
void, and will automatically terminate your rights under this License.
|
176 |
+
However, parties who have received copies, or rights, from you under
|
177 |
+
this License will not have their licenses terminated so long as such
|
178 |
+
parties remain in full compliance.
|
179 |
+
|
180 |
+
5. You are not required to accept this License, since you have not
|
181 |
+
signed it. However, nothing else grants you permission to modify or
|
182 |
+
distribute the Program or its derivative works. These actions are
|
183 |
+
prohibited by law if you do not accept this License. Therefore, by
|
184 |
+
modifying or distributing the Program (or any work based on the
|
185 |
+
Program), you indicate your acceptance of this License to do so, and
|
186 |
+
all its terms and conditions for copying, distributing or modifying
|
187 |
+
the Program or works based on it.
|
188 |
+
|
189 |
+
6. Each time you redistribute the Program (or any work based on the
|
190 |
+
Program), the recipient automatically receives a license from the
|
191 |
+
original licensor to copy, distribute or modify the Program subject to
|
192 |
+
these terms and conditions. You may not impose any further
|
193 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
+
You are not responsible for enforcing compliance by third parties to
|
195 |
+
this License.
|
196 |
+
|
197 |
+
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
+
infringement or for any other reason (not limited to patent issues),
|
199 |
+
conditions are imposed on you (whether by court order, agreement or
|
200 |
+
otherwise) that contradict the conditions of this License, they do not
|
201 |
+
excuse you from the conditions of this License. If you cannot
|
202 |
+
distribute so as to satisfy simultaneously your obligations under this
|
203 |
+
License and any other pertinent obligations, then as a consequence you
|
204 |
+
may not distribute the Program at all. For example, if a patent
|
205 |
+
license would not permit royalty-free redistribution of the Program by
|
206 |
+
all those who receive copies directly or indirectly through you, then
|
207 |
+
the only way you could satisfy both it and this License would be to
|
208 |
+
refrain entirely from distribution of the Program.
|
209 |
+
|
210 |
+
If any portion of this section is held invalid or unenforceable under
|
211 |
+
any particular circumstance, the balance of the section is intended to
|
212 |
+
apply and the section as a whole is intended to apply in other
|
213 |
+
circumstances.
|
214 |
+
|
215 |
+
It is not the purpose of this section to induce you to infringe any
|
216 |
+
patents or other property right claims or to contest validity of any
|
217 |
+
such claims; this section has the sole purpose of protecting the
|
218 |
+
integrity of the free software distribution system, which is
|
219 |
+
implemented by public license practices. Many people have made
|
220 |
+
generous contributions to the wide range of software distributed
|
221 |
+
through that system in reliance on consistent application of that
|
222 |
+
system; it is up to the author/donor to decide if he or she is willing
|
223 |
+
to distribute software through any other system and a licensee cannot
|
224 |
+
impose that choice.
|
225 |
+
|
226 |
+
This section is intended to make thoroughly clear what is believed to
|
227 |
+
be a consequence of the rest of this License.
|
228 |
+
|
229 |
+
8. If the distribution and/or use of the Program is restricted in
|
230 |
+
certain countries either by patents or by copyrighted interfaces, the
|
231 |
+
original copyright holder who places the Program under this License
|
232 |
+
may add an explicit geographical distribution limitation excluding
|
233 |
+
those countries, so that distribution is permitted only in or among
|
234 |
+
countries not thus excluded. In such case, this License incorporates
|
235 |
+
the limitation as if written in the body of this License.
|
236 |
+
|
237 |
+
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
+
of the General Public License from time to time. Such new versions will
|
239 |
+
be similar in spirit to the present version, but may differ in detail to
|
240 |
+
address new problems or concerns.
|
241 |
+
|
242 |
+
Each version is given a distinguishing version number. If the Program
|
243 |
+
specifies a version number of this License which applies to it and "any
|
244 |
+
later version", you have the option of following the terms and conditions
|
245 |
+
either of that version or of any later version published by the Free
|
246 |
+
Software Foundation. If the Program does not specify a version number of
|
247 |
+
this License, you may choose any version ever published by the Free Software
|
248 |
+
Foundation.
|
249 |
+
|
250 |
+
10. If you wish to incorporate parts of the Program into other free
|
251 |
+
programs whose distribution conditions are different, write to the author
|
252 |
+
to ask for permission. For software which is copyrighted by the Free
|
253 |
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
+
make exceptions for this. Our decision will be guided by the two goals
|
255 |
+
of preserving the free status of all derivatives of our free software and
|
256 |
+
of promoting the sharing and reuse of software generally.
|
257 |
+
|
258 |
+
NO WARRANTY
|
259 |
+
|
260 |
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
+
REPAIR OR CORRECTION.
|
269 |
+
|
270 |
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
+
POSSIBILITY OF SUCH DAMAGES.
|
279 |
+
|
280 |
+
END OF TERMS AND CONDITIONS
|
281 |
+
|
282 |
+
How to Apply These Terms to Your New Programs
|
283 |
+
|
284 |
+
If you develop a new program, and you want it to be of the greatest
|
285 |
+
possible use to the public, the best way to achieve this is to make it
|
286 |
+
free software which everyone can redistribute and change under these terms.
|
287 |
+
|
288 |
+
To do so, attach the following notices to the program. It is safest
|
289 |
+
to attach them to the start of each source file to most effectively
|
290 |
+
convey the exclusion of warranty; and each file should have at least
|
291 |
+
the "copyright" line and a pointer to where the full notice is found.
|
292 |
+
|
293 |
+
WordPress Landing Pages
|
294 |
+
Copyright (C) 2013 Inbound Now
|
295 |
+
|
296 |
+
This program is free software; you can redistribute it and/or modify
|
297 |
+
it under the terms of the GNU General Public License as published by
|
298 |
+
the Free Software Foundation; either version 2 of the License, or
|
299 |
+
(at your option) any later version.
|
300 |
+
|
301 |
+
This program is distributed in the hope that it will be useful,
|
302 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
+
GNU General Public License for more details.
|
305 |
+
|
306 |
+
You should have received a copy of the GNU General Public License along
|
307 |
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
+
|
310 |
+
Also add information on how to contact you by electronic and paper mail.
|
311 |
+
|
312 |
+
If the program is interactive, make it output a short notice like this
|
313 |
+
when it starts in an interactive mode:
|
314 |
+
|
315 |
+
Gnomovision version 69, Copyright (C) year name of author
|
316 |
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
+
This is free software, and you are welcome to redistribute it
|
318 |
+
under certain conditions; type `show c' for details.
|
319 |
+
|
320 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
+
parts of the General Public License. Of course, the commands you use may
|
322 |
+
be called something other than `show w' and `show c'; they could even be
|
323 |
+
mouse-clicks or menu items--whatever suits your program.
|
324 |
+
|
325 |
+
You should also get your employer (if you work as a programmer) or your
|
326 |
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
+
necessary. Here is a sample; alter the names:
|
328 |
+
|
329 |
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
+
|
332 |
+
{signature of Ty Coon}, 1 April 1989
|
333 |
+
Ty Coon, President of Vice
|
334 |
+
|
335 |
+
This General Public License does not permit incorporating your program into
|
336 |
+
proprietary programs. If your program is a subroutine library, you may
|
337 |
+
consider it more useful to permit linking proprietary applications with the
|
338 |
+
library. If this is what you want to do, use the GNU Lesser General
|
339 |
+
Public License instead of this License.
|
css/admin-install-plugins.css
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
#the-list .inbound-install-notice, #the-list .inbound-install-notice-links, .click-to-activate, .click-to-activate-bulk {
|
2 |
-
display: none;
|
3 |
-
}
|
4 |
-
.click-to-activate, .click-to-activate-bulk {
|
5 |
-
vertical-align: top !important;
|
6 |
-
padding-top: 0px !important;
|
7 |
-
}
|
8 |
-
.click-to-activate span, .click-to-activate-bulk span {
|
9 |
-
color: #04A204;
|
10 |
-
padding-right: 10px;
|
11 |
-
font-size: 40px;
|
12 |
-
text-shadow: none;
|
13 |
}
|
1 |
+
#the-list .inbound-install-notice, #the-list .inbound-install-notice-links, .click-to-activate, .click-to-activate-bulk {
|
2 |
+
display: none;
|
3 |
+
}
|
4 |
+
.click-to-activate, .click-to-activate-bulk {
|
5 |
+
vertical-align: top !important;
|
6 |
+
padding-top: 0px !important;
|
7 |
+
}
|
8 |
+
.click-to-activate span, .click-to-activate-bulk span {
|
9 |
+
color: #04A204;
|
10 |
+
padding-right: 10px;
|
11 |
+
font-size: 40px;
|
12 |
+
text-shadow: none;
|
13 |
}
|
css/admin-lp-cpt-only-style.css
CHANGED
@@ -1,92 +1,92 @@
|
|
1 |
-
#main-title-area #lp-main-headline {
|
2 |
-
width: 100%;
|
3 |
-
|
4 |
-
font-size: 23px;
|
5 |
-
line-height: 100%;
|
6 |
-
outline: 0 none;
|
7 |
-
padding: 0px 7px;
|
8 |
-
padding-top: 8px;
|
9 |
-
}
|
10 |
-
#main-title-header h3 {
|
11 |
-
display: inline-block;
|
12 |
-
padding-left: 0px;
|
13 |
-
}
|
14 |
-
#titlediv {
|
15 |
-
margin-bottom: 0px;
|
16 |
-
}
|
17 |
-
.currently_selected{
|
18 |
-
position: absolute;
|
19 |
-
top: 72px;
|
20 |
-
left: 16px;
|
21 |
-
font-size: 19px;
|
22 |
-
line-height: 21px;
|
23 |
-
padding-top: 15px;
|
24 |
-
text-align: center;
|
25 |
-
background: black;
|
26 |
-
width: 90%;
|
27 |
-
height: 36px;
|
28 |
-
color: white;
|
29 |
-
opacity: 0.5;
|
30 |
-
border-radius: 7px;
|
31 |
-
}
|
32 |
-
.lp-template-selector-container ul#template-filter li {
|
33 |
-
display: inline-block;
|
34 |
-
padding: 5px;
|
35 |
-
padding-top: 0px;
|
36 |
-
margin-right: 5px;
|
37 |
-
text-align: center;
|
38 |
-
margin-bottom: 10px;
|
39 |
-
}
|
40 |
-
.lp-template-selector-container ul#template-filter {
|
41 |
-
line-height: 30px;
|
42 |
-
margin-top: 10px;
|
43 |
-
margin-bottom: 0px;
|
44 |
-
}
|
45 |
-
.lp-template-selector-container ul#template-filter a {
|
46 |
-
margin-right: 0px;
|
47 |
-
padding: 0px;
|
48 |
-
font-weight: bold;
|
49 |
-
text-decoration: none;
|
50 |
-
}
|
51 |
-
ul#template-filter .button-primary a {
|
52 |
-
color:#fff;
|
53 |
-
}
|
54 |
-
#more-templates-button {
|
55 |
-
display: inline-block;
|
56 |
-
vertical-align: middle;
|
57 |
-
float: none !important;
|
58 |
-
font-weight: normal;
|
59 |
-
margin-left: 20px;
|
60 |
-
}
|
61 |
-
#lp_2_form_content .hndle em {
|
62 |
-
font-size: 13px;
|
63 |
-
}
|
64 |
-
.template-thumbnail
|
65 |
-
{
|
66 |
-
width:100%;
|
67 |
-
height:190px;
|
68 |
-
-webkit-border-radius: 4px;
|
69 |
-
-khtml-border-radius: 4px;
|
70 |
-
-moz-border-radius: 4px;
|
71 |
-
border-radius: 4px;
|
72 |
-
background-color: #A9A9A9;
|
73 |
-
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(0, 0, 0, 0.3) 0 2px 5px;
|
74 |
-
-moz-box-shadow: rgba(0,0,0,0.2) 0 0 0 1px,rgba(0,0,0,0.3) 0 2px 5px;
|
75 |
-
box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(0, 0, 0, 0.3) 0 2px 5px;
|
76 |
-
}
|
77 |
-
|
78 |
-
ul#template-filter{ margin: 0px 0; padding: 0; padding-left: 0px; line-height: 64px; }
|
79 |
-
ul#template-filter li{ display: inline; }
|
80 |
-
ul#template-filter a{ margin-right: 0.5em; padding: 0em 1em; font-weight: bold; text-decoration: none; }
|
81 |
-
ul#template-filter .button-primary a:hover { color:#fff;}
|
82 |
-
ul#template-filter a.current{ background-color: #DDD; }
|
83 |
-
|
84 |
-
#template-item{ float: left; margin-right: 18px; overflow: hidden; margin: 0px 0 0 0; padding: 0; list-style: none; width: 300px; margin-bottom: 10px; }
|
85 |
-
#template-item div{ display: block; }
|
86 |
-
/* #template-item div a{ display: block; width: 163px; height: 120px; overflow: hidden; border: 1px solid #CDCDCD; background: #eee; }*/
|
87 |
-
#template-item li p{ font-size: 11px; line-height: 15px; color: #AAA; margin: 5px 0; }
|
88 |
-
#template-box .lp_tooltip_templates{
|
89 |
-
bottom: 6px;
|
90 |
-
position: absolute;
|
91 |
-
right: 8px;
|
92 |
}
|
1 |
+
#main-title-area #lp-main-headline {
|
2 |
+
width: 100%;
|
3 |
+
|
4 |
+
font-size: 23px;
|
5 |
+
line-height: 100%;
|
6 |
+
outline: 0 none;
|
7 |
+
padding: 0px 7px;
|
8 |
+
padding-top: 8px;
|
9 |
+
}
|
10 |
+
#main-title-header h3 {
|
11 |
+
display: inline-block;
|
12 |
+
padding-left: 0px;
|
13 |
+
}
|
14 |
+
#titlediv {
|
15 |
+
margin-bottom: 0px;
|
16 |
+
}
|
17 |
+
.currently_selected{
|
18 |
+
position: absolute;
|
19 |
+
top: 72px;
|
20 |
+
left: 16px;
|
21 |
+
font-size: 19px;
|
22 |
+
line-height: 21px;
|
23 |
+
padding-top: 15px;
|
24 |
+
text-align: center;
|
25 |
+
background: black;
|
26 |
+
width: 90%;
|
27 |
+
height: 36px;
|
28 |
+
color: white;
|
29 |
+
opacity: 0.5;
|
30 |
+
border-radius: 7px;
|
31 |
+
}
|
32 |
+
.lp-template-selector-container ul#template-filter li {
|
33 |
+
display: inline-block;
|
34 |
+
padding: 5px;
|
35 |
+
padding-top: 0px;
|
36 |
+
margin-right: 5px;
|
37 |
+
text-align: center;
|
38 |
+
margin-bottom: 10px;
|
39 |
+
}
|
40 |
+
.lp-template-selector-container ul#template-filter {
|
41 |
+
line-height: 30px;
|
42 |
+
margin-top: 10px;
|
43 |
+
margin-bottom: 0px;
|
44 |
+
}
|
45 |
+
.lp-template-selector-container ul#template-filter a {
|
46 |
+
margin-right: 0px;
|
47 |
+
padding: 0px;
|
48 |
+
font-weight: bold;
|
49 |
+
text-decoration: none;
|
50 |
+
}
|
51 |
+
ul#template-filter .button-primary a {
|
52 |
+
color:#fff;
|
53 |
+
}
|
54 |
+
#more-templates-button {
|
55 |
+
display: inline-block;
|
56 |
+
vertical-align: middle;
|
57 |
+
float: none !important;
|
58 |
+
font-weight: normal;
|
59 |
+
margin-left: 20px;
|
60 |
+
}
|
61 |
+
#lp_2_form_content .hndle em {
|
62 |
+
font-size: 13px;
|
63 |
+
}
|
64 |
+
.template-thumbnail
|
65 |
+
{
|
66 |
+
width:100%;
|
67 |
+
height:190px;
|
68 |
+
-webkit-border-radius: 4px;
|
69 |
+
-khtml-border-radius: 4px;
|
70 |
+
-moz-border-radius: 4px;
|
71 |
+
border-radius: 4px;
|
72 |
+
background-color: #A9A9A9;
|
73 |
+
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(0, 0, 0, 0.3) 0 2px 5px;
|
74 |
+
-moz-box-shadow: rgba(0,0,0,0.2) 0 0 0 1px,rgba(0,0,0,0.3) 0 2px 5px;
|
75 |
+
box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(0, 0, 0, 0.3) 0 2px 5px;
|
76 |
+
}
|
77 |
+
|
78 |
+
ul#template-filter{ margin: 0px 0; padding: 0; padding-left: 0px; line-height: 64px; }
|
79 |
+
ul#template-filter li{ display: inline; }
|
80 |
+
ul#template-filter a{ margin-right: 0.5em; padding: 0em 1em; font-weight: bold; text-decoration: none; }
|
81 |
+
ul#template-filter .button-primary a:hover { color:#fff;}
|
82 |
+
ul#template-filter a.current{ background-color: #DDD; }
|
83 |
+
|
84 |
+
#template-item{ float: left; margin-right: 18px; overflow: hidden; margin: 0px 0 0 0; padding: 0; list-style: none; width: 300px; margin-bottom: 10px; }
|
85 |
+
#template-item div{ display: block; }
|
86 |
+
/* #template-item div a{ display: block; width: 163px; height: 120px; overflow: hidden; border: 1px solid #CDCDCD; background: #eee; }*/
|
87 |
+
#template-item li p{ font-size: 11px; line-height: 15px; color: #AAA; margin: 5px 0; }
|
88 |
+
#template-box .lp_tooltip_templates{
|
89 |
+
bottom: 6px;
|
90 |
+
position: absolute;
|
91 |
+
right: 8px;
|
92 |
}
|
css/admin-templates.css
CHANGED
@@ -1,48 +1,48 @@
|
|
1 |
-
.update-message {
|
2 |
-
background-color: #FFFBE4;
|
3 |
-
border-color: #DFDFDF;
|
4 |
-
border-bottom-color: #DFDFDF;
|
5 |
-
border-top-color: #FFFFFF;
|
6 |
-
padding:3px;
|
7 |
-
}
|
8 |
-
|
9 |
-
.update-available
|
10 |
-
{
|
11 |
-
font-weight:600;
|
12 |
-
color:cadetblue;
|
13 |
-
}
|
14 |
-
|
15 |
-
.template-thumbnail {
|
16 |
-
background-color: #A9A9A9;
|
17 |
-
border-radius: 2px;
|
18 |
-
height: 120px;
|
19 |
-
width: 150px;
|
20 |
-
padding:6px;
|
21 |
-
}
|
22 |
-
|
23 |
-
.wp-list-table .column-thumbnail
|
24 |
-
{
|
25 |
-
height:0px;
|
26 |
-
}
|
27 |
-
|
28 |
-
.capty-wrapper
|
29 |
-
{
|
30 |
-
margin-left:20px;
|
31 |
-
height:140px;
|
32 |
-
}
|
33 |
-
|
34 |
-
.column-template
|
35 |
-
{
|
36 |
-
width:200px;
|
37 |
-
}
|
38 |
-
|
39 |
-
.column-description
|
40 |
-
{
|
41 |
-
width:377px;
|
42 |
-
font-style:italic;
|
43 |
-
}
|
44 |
-
|
45 |
-
.column-category
|
46 |
-
{
|
47 |
-
width:160px;
|
48 |
}
|
1 |
+
.update-message {
|
2 |
+
background-color: #FFFBE4;
|
3 |
+
border-color: #DFDFDF;
|
4 |
+
border-bottom-color: #DFDFDF;
|
5 |
+
border-top-color: #FFFFFF;
|
6 |
+
padding:3px;
|
7 |
+
}
|
8 |
+
|
9 |
+
.update-available
|
10 |
+
{
|
11 |
+
font-weight:600;
|
12 |
+
color:cadetblue;
|
13 |
+
}
|
14 |
+
|
15 |
+
.template-thumbnail {
|
16 |
+
background-color: #A9A9A9;
|
17 |
+
border-radius: 2px;
|
18 |
+
height: 120px;
|
19 |
+
width: 150px;
|
20 |
+
padding:6px;
|
21 |
+
}
|
22 |
+
|
23 |
+
.wp-list-table .column-thumbnail
|
24 |
+
{
|
25 |
+
height:0px;
|
26 |
+
}
|
27 |
+
|
28 |
+
.capty-wrapper
|
29 |
+
{
|
30 |
+
margin-left:20px;
|
31 |
+
height:140px;
|
32 |
+
}
|
33 |
+
|
34 |
+
.column-template
|
35 |
+
{
|
36 |
+
width:200px;
|
37 |
+
}
|
38 |
+
|
39 |
+
.column-description
|
40 |
+
{
|
41 |
+
width:377px;
|
42 |
+
font-style:italic;
|
43 |
+
}
|
44 |
+
|
45 |
+
.column-category
|
46 |
+
{
|
47 |
+
width:160px;
|
48 |
}
|
css/customizer-load.css
CHANGED
@@ -1,69 +1,69 @@
|
|
1 |
-
.lp-customizer-overlay
|
2 |
-
{
|
3 |
-
position: absolute;
|
4 |
-
z-index: 999999;
|
5 |
-
background-color: #000;
|
6 |
-
opacity: 0;
|
7 |
-
background: -moz-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
8 |
-
background: -webkit-gradient(radial,center center,0px,center center,100%,color-stop(0%,rgba(0,0,0,0.4)),color-stop(100%,rgba(0,0,0,0.9)));
|
9 |
-
background: -webkit-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
10 |
-
background: -o-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
11 |
-
background: -ms-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
12 |
-
background: radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
13 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#66000000',endColorstr='#e6000000',GradientType=1);
|
14 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
15 |
-
filter: alpha(opacity=50);
|
16 |
-
-webkit-transition: all 0.3s ease-out;
|
17 |
-
-moz-transition: all 0.3s ease-out;
|
18 |
-
-ms-transition: all 0.3s ease-out;
|
19 |
-
-o-transition: all 0.3s ease-out;
|
20 |
-
transition: all 0.3s ease-out;
|
21 |
-
}
|
22 |
-
html {
|
23 |
-
margin-top: 0px !important;
|
24 |
-
}
|
25 |
-
.live-preview-active
|
26 |
-
{
|
27 |
-
background-color: gray;
|
28 |
-
background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.5) 35px, rgba(255,255,255,.5) 70px);
|
29 |
-
}
|
30 |
-
.live-preview-area-box {
|
31 |
-
display:inline-block;
|
32 |
-
}
|
33 |
-
.lp-see-this {
|
34 |
-
color:#000000 !important;
|
35 |
-
}
|
36 |
-
.live-preview-active {
|
37 |
-
background: rgba(253, 253, 252, 1);
|
38 |
-
border-radius: 0px;
|
39 |
-
padding: 0px;
|
40 |
-
outline: 2px dashed rgb(255, 0, 0);
|
41 |
-
-webkit-box-shadow: 0px 0px 35px rgba(50, 50, 50, 1);
|
42 |
-
-moz-box-shadow: 0px 0px 35px rgba(50, 50, 50, 1);
|
43 |
-
box-shadow: 0px 0px 35px rgba(50, 50, 50, 1);
|
44 |
-
z-index: 99999999;
|
45 |
-
}
|
46 |
-
|
47 |
-
.small-html {
|
48 |
-
height: 200%;
|
49 |
-
border: 0;
|
50 |
-
position: absolute;
|
51 |
-
top: 0;
|
52 |
-
left: 0;
|
53 |
-
background-color: #eee;
|
54 |
-
|
55 |
-
-webkit-transform: scale(.8);
|
56 |
-
-moz-transform: scale(0.8);
|
57 |
-
-ms-transform: scale(0.8);
|
58 |
-
-o-transform: scale(0.8);
|
59 |
-
transform: scale(0.8);
|
60 |
-
-webkit-transform-origin: top left;
|
61 |
-
-moz-transform-origin: top left;
|
62 |
-
-ms-transform-origin: top left;
|
63 |
-
-o-transform-origin: top left;
|
64 |
-
transform-origin: top left;
|
65 |
-
-webkit-transition: opacity 0.4s ease;
|
66 |
-
-moz-transition: opacity 0.4s ease;
|
67 |
-
-o-transition: opacity 0.4s ease;
|
68 |
-
transition: opacity 0.4s ease;
|
69 |
}
|
1 |
+
.lp-customizer-overlay
|
2 |
+
{
|
3 |
+
position: absolute;
|
4 |
+
z-index: 999999;
|
5 |
+
background-color: #000;
|
6 |
+
opacity: 0;
|
7 |
+
background: -moz-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
8 |
+
background: -webkit-gradient(radial,center center,0px,center center,100%,color-stop(0%,rgba(0,0,0,0.4)),color-stop(100%,rgba(0,0,0,0.9)));
|
9 |
+
background: -webkit-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
10 |
+
background: -o-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
11 |
+
background: -ms-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
12 |
+
background: radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
13 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#66000000',endColorstr='#e6000000',GradientType=1);
|
14 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
15 |
+
filter: alpha(opacity=50);
|
16 |
+
-webkit-transition: all 0.3s ease-out;
|
17 |
+
-moz-transition: all 0.3s ease-out;
|
18 |
+
-ms-transition: all 0.3s ease-out;
|
19 |
+
-o-transition: all 0.3s ease-out;
|
20 |
+
transition: all 0.3s ease-out;
|
21 |
+
}
|
22 |
+
html {
|
23 |
+
margin-top: 0px !important;
|
24 |
+
}
|
25 |
+
.live-preview-active
|
26 |
+
{
|
27 |
+
background-color: gray;
|
28 |
+
background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.5) 35px, rgba(255,255,255,.5) 70px);
|
29 |
+
}
|
30 |
+
.live-preview-area-box {
|
31 |
+
display:inline-block;
|
32 |
+
}
|
33 |
+
.lp-see-this {
|
34 |
+
color:#000000 !important;
|
35 |
+
}
|
36 |
+
.live-preview-active {
|
37 |
+
background: rgba(253, 253, 252, 1);
|
38 |
+
border-radius: 0px;
|
39 |
+
padding: 0px;
|
40 |
+
outline: 2px dashed rgb(255, 0, 0);
|
41 |
+
-webkit-box-shadow: 0px 0px 35px rgba(50, 50, 50, 1);
|
42 |
+
-moz-box-shadow: 0px 0px 35px rgba(50, 50, 50, 1);
|
43 |
+
box-shadow: 0px 0px 35px rgba(50, 50, 50, 1);
|
44 |
+
z-index: 99999999;
|
45 |
+
}
|
46 |
+
|
47 |
+
.small-html {
|
48 |
+
height: 200%;
|
49 |
+
border: 0;
|
50 |
+
position: absolute;
|
51 |
+
top: 0;
|
52 |
+
left: 0;
|
53 |
+
background-color: #eee;
|
54 |
+
|
55 |
+
-webkit-transform: scale(.8);
|
56 |
+
-moz-transform: scale(0.8);
|
57 |
+
-ms-transform: scale(0.8);
|
58 |
+
-o-transform: scale(0.8);
|
59 |
+
transform: scale(0.8);
|
60 |
+
-webkit-transform-origin: top left;
|
61 |
+
-moz-transform-origin: top left;
|
62 |
+
-ms-transform-origin: top left;
|
63 |
+
-o-transform-origin: top left;
|
64 |
+
transform-origin: top left;
|
65 |
+
-webkit-transition: opacity 0.4s ease;
|
66 |
+
-moz-transition: opacity 0.4s ease;
|
67 |
+
-o-transition: opacity 0.4s ease;
|
68 |
+
transition: opacity 0.4s ease;
|
69 |
}
|
css/customizer.frontend.css
CHANGED
@@ -1,156 +1,156 @@
|
|
1 |
-
html.wp-toolbar {
|
2 |
-
padding-top: 0px;
|
3 |
-
}
|
4 |
-
body {
|
5 |
-
min-width: 400px !important;
|
6 |
-
}
|
7 |
-
#wpadminbar, #adminmenuback, #current_variation_id, #post_ID {
|
8 |
-
display: none !important;
|
9 |
-
}
|
10 |
-
#adminmenuwrap {display: none !important;}
|
11 |
-
.auto-fold #wpcontent {
|
12 |
-
margin-left: 0px;
|
13 |
-
}
|
14 |
-
.jPicker .Icon {
|
15 |
-
height: 23px;}
|
16 |
-
|
17 |
-
#lp-options-controls {
|
18 |
-
position: absolute;
|
19 |
-
top: 13px;
|
20 |
-
right: 10px;
|
21 |
-
}
|
22 |
-
#lp-frontend-options-container {
|
23 |
-
padding-left: 8px;
|
24 |
-
padding-right: 8px;
|
25 |
-
z-index: 99999999998 !important;
|
26 |
-
}
|
27 |
-
#lp-top-box {
|
28 |
-
background: #eaeaea;
|
29 |
-
width: 100%;
|
30 |
-
height: 42px;
|
31 |
-
border-bottom: rgba(206, 206, 206, 0.5);
|
32 |
-
border-width: 1px;
|
33 |
-
border-style: solid;
|
34 |
-
|
35 |
-
}
|
36 |
-
.mceToolbar.mceToolbarRow1.Enabled td {
|
37 |
-
display: inline-block !important;
|
38 |
-
}
|
39 |
-
.media-modal {
|
40 |
-
position: fixed;
|
41 |
-
top: 45px !important;}
|
42 |
-
|
43 |
-
.mceStatusbar.mceFirst.mceLast div {
|
44 |
-
display: none !important;
|
45 |
-
}
|
46 |
-
.media-modal {
|
47 |
-
width: 473px !important;
|
48 |
-
left:10px !important;
|
49 |
-
position: absolute;
|
50 |
-
}
|
51 |
-
input[type="radio"] {
|
52 |
-
margin-left: 5px;
|
53 |
-
vertical-align: middle;
|
54 |
-
}
|
55 |
-
/* #wpcontent, body {
|
56 |
-
min-width: 470px !important;
|
57 |
-
} */
|
58 |
-
.click-this {
|
59 |
-
display: none;
|
60 |
-
}
|
61 |
-
.jPicker .Grid {
|
62 |
-
display: none;
|
63 |
-
}
|
64 |
-
.jPicker .Button {
|
65 |
-
text-align: center;
|
66 |
-
padding: 0 4px;
|
67 |
-
width: 264px;
|
68 |
-
position: absolute;
|
69 |
-
border-bottom: none;
|
70 |
-
left: 0px;
|
71 |
-
bottom: 3px;
|
72 |
-
}
|
73 |
-
.jPicker .Button input {
|
74 |
-
font-size: 18px !important;
|
75 |
-
}
|
76 |
-
.jPicker .Icon span.Color, .jPicker .Icon span.Alpha {
|
77 |
-
width: 97% !important;
|
78 |
-
}
|
79 |
-
.jPicker .Title {
|
80 |
-
width: 254px;
|
81 |
-
}
|
82 |
-
.landing-page-option-td {
|
83 |
-
position: relative;
|
84 |
-
}
|
85 |
-
.media-modal-backdrop, .media-modal {
|
86 |
-
position: fixed !important;
|
87 |
-
}
|
88 |
-
.upload_image_button {
|
89 |
-
background: #f3f3f3;
|
90 |
-
background-image: -webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));
|
91 |
-
background-image: -webkit-linear-gradient(top,#fefefe,#f4f4f4);
|
92 |
-
background-image: -moz-linear-gradient(top,#fefefe,#f4f4f4);
|
93 |
-
background-image: -o-linear-gradient(top,#fefefe,#f4f4f4);
|
94 |
-
background-image: linear-gradient(to bottom,#fefefe,#f4f4f4);
|
95 |
-
border-color: #bbb;
|
96 |
-
color: #333;
|
97 |
-
text-shadow: 0 1px 0 #fff;
|
98 |
-
display: inline-block;
|
99 |
-
text-decoration: none;
|
100 |
-
font-size: 12px;
|
101 |
-
line-height: 23px;
|
102 |
-
height: 24px;
|
103 |
-
margin: 0;
|
104 |
-
padding: 0 10px 1px;
|
105 |
-
cursor: pointer;
|
106 |
-
border-width: 1px;
|
107 |
-
border-style: solid;
|
108 |
-
-webkit-border-radius: 3px;
|
109 |
-
-webkit-appearance: none;
|
110 |
-
border-radius: 3px;
|
111 |
-
white-space: nowrap;
|
112 |
-
-webkit-box-sizing: border-box;
|
113 |
-
-moz-box-sizing: border-box;
|
114 |
-
box-sizing: border-box;
|
115 |
-
}
|
116 |
-
#media-items {
|
117 |
-
width: 311px !important;
|
118 |
-
}
|
119 |
-
.variation-letter-top {
|
120 |
-
border-radius: 3px;
|
121 |
-
border-style: solid;
|
122 |
-
border-width: 1px;
|
123 |
-
padding: 1px;
|
124 |
-
padding-left: 4px;
|
125 |
-
padding-right: 5px;
|
126 |
-
background: #fff;
|
127 |
-
display: inline-block;
|
128 |
-
margin-right: 10px;
|
129 |
-
}
|
130 |
-
.the-title input {
|
131 |
-
width: 78%;
|
132 |
-
}
|
133 |
-
table.jPicker {
|
134 |
-
width: 445px;}
|
135 |
-
|
136 |
-
html {
|
137 |
-
background: #f5f5f5;
|
138 |
-
border-right: 1px solid rgba(0,0,0,0.2);
|
139 |
-
}
|
140 |
-
.landing-page-option-row {
|
141 |
-
padding-top: 10px;
|
142 |
-
padding-left: 3px;
|
143 |
-
padding-bottom:0px;
|
144 |
-
padding-right: 0px;
|
145 |
-
clear: both;
|
146 |
-
}
|
147 |
-
.landing-page-table-header {
|
148 |
-
font-size: 17px;
|
149 |
-
padding-bottom: 5px;
|
150 |
-
padding-left: 2px;
|
151 |
-
}
|
152 |
-
h1 {
|
153 |
-
line-height: 28px;
|
154 |
-
margin-bottom: 0px;
|
155 |
-
margin-top: 10px;
|
156 |
}
|
1 |
+
html.wp-toolbar {
|
2 |
+
padding-top: 0px;
|
3 |
+
}
|
4 |
+
body {
|
5 |
+
min-width: 400px !important;
|
6 |
+
}
|
7 |
+
#wpadminbar, #adminmenuback, #current_variation_id, #post_ID {
|
8 |
+
display: none !important;
|
9 |
+
}
|
10 |
+
#adminmenuwrap {display: none !important;}
|
11 |
+
.auto-fold #wpcontent {
|
12 |
+
margin-left: 0px;
|
13 |
+
}
|
14 |
+
.jPicker .Icon {
|
15 |
+
height: 23px;}
|
16 |
+
|
17 |
+
#lp-options-controls {
|
18 |
+
position: absolute;
|
19 |
+
top: 13px;
|
20 |
+
right: 10px;
|
21 |
+
}
|
22 |
+
#lp-frontend-options-container {
|
23 |
+
padding-left: 8px;
|
24 |
+
padding-right: 8px;
|
25 |
+
z-index: 99999999998 !important;
|
26 |
+
}
|
27 |
+
#lp-top-box {
|
28 |
+
background: #eaeaea;
|
29 |
+
width: 100%;
|
30 |
+
height: 42px;
|
31 |
+
border-bottom: rgba(206, 206, 206, 0.5);
|
32 |
+
border-width: 1px;
|
33 |
+
border-style: solid;
|
34 |
+
|
35 |
+
}
|
36 |
+
.mceToolbar.mceToolbarRow1.Enabled td {
|
37 |
+
display: inline-block !important;
|
38 |
+
}
|
39 |
+
.media-modal {
|
40 |
+
position: fixed;
|
41 |
+
top: 45px !important;}
|
42 |
+
|
43 |
+
.mceStatusbar.mceFirst.mceLast div {
|
44 |
+
display: none !important;
|
45 |
+
}
|
46 |
+
.media-modal {
|
47 |
+
width: 473px !important;
|
48 |
+
left:10px !important;
|
49 |
+
position: absolute;
|
50 |
+
}
|
51 |
+
input[type="radio"] {
|
52 |
+
margin-left: 5px;
|
53 |
+
vertical-align: middle;
|
54 |
+
}
|
55 |
+
/* #wpcontent, body {
|
56 |
+
min-width: 470px !important;
|
57 |
+
} */
|
58 |
+
.click-this {
|
59 |
+
display: none;
|
60 |
+
}
|
61 |
+
.jPicker .Grid {
|
62 |
+
display: none;
|
63 |
+
}
|
64 |
+
.jPicker .Button {
|
65 |
+
text-align: center;
|
66 |
+
padding: 0 4px;
|
67 |
+
width: 264px;
|
68 |
+
position: absolute;
|
69 |
+
border-bottom: none;
|
70 |
+
left: 0px;
|
71 |
+
bottom: 3px;
|
72 |
+
}
|
73 |
+
.jPicker .Button input {
|
74 |
+
font-size: 18px !important;
|
75 |
+
}
|
76 |
+
.jPicker .Icon span.Color, .jPicker .Icon span.Alpha {
|
77 |
+
width: 97% !important;
|
78 |
+
}
|
79 |
+
.jPicker .Title {
|
80 |
+
width: 254px;
|
81 |
+
}
|
82 |
+
.landing-page-option-td {
|
83 |
+
position: relative;
|
84 |
+
}
|
85 |
+
.media-modal-backdrop, .media-modal {
|
86 |
+
position: fixed !important;
|
87 |
+
}
|
88 |
+
.upload_image_button {
|
89 |
+
background: #f3f3f3;
|
90 |
+
background-image: -webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));
|
91 |
+
background-image: -webkit-linear-gradient(top,#fefefe,#f4f4f4);
|
92 |
+
background-image: -moz-linear-gradient(top,#fefefe,#f4f4f4);
|
93 |
+
background-image: -o-linear-gradient(top,#fefefe,#f4f4f4);
|
94 |
+
background-image: linear-gradient(to bottom,#fefefe,#f4f4f4);
|
95 |
+
border-color: #bbb;
|
96 |
+
color: #333;
|
97 |
+
text-shadow: 0 1px 0 #fff;
|
98 |
+
display: inline-block;
|
99 |
+
text-decoration: none;
|
100 |
+
font-size: 12px;
|
101 |
+
line-height: 23px;
|
102 |
+
height: 24px;
|
103 |
+
margin: 0;
|
104 |
+
padding: 0 10px 1px;
|
105 |
+
cursor: pointer;
|
106 |
+
border-width: 1px;
|
107 |
+
border-style: solid;
|
108 |
+
-webkit-border-radius: 3px;
|
109 |
+
-webkit-appearance: none;
|
110 |
+
border-radius: 3px;
|
111 |
+
white-space: nowrap;
|
112 |
+
-webkit-box-sizing: border-box;
|
113 |
+
-moz-box-sizing: border-box;
|
114 |
+
box-sizing: border-box;
|
115 |
+
}
|
116 |
+
#media-items {
|
117 |
+
width: 311px !important;
|
118 |
+
}
|
119 |
+
.variation-letter-top {
|
120 |
+
border-radius: 3px;
|
121 |
+
border-style: solid;
|
122 |
+
border-width: 1px;
|
123 |
+
padding: 1px;
|
124 |
+
padding-left: 4px;
|
125 |
+
padding-right: 5px;
|
126 |
+
background: #fff;
|
127 |
+
display: inline-block;
|
128 |
+
margin-right: 10px;
|
129 |
+
}
|
130 |
+
.the-title input {
|
131 |
+
width: 78%;
|
132 |
+
}
|
133 |
+
table.jPicker {
|
134 |
+
width: 445px;}
|
135 |
+
|
136 |
+
html {
|
137 |
+
background: #f5f5f5;
|
138 |
+
border-right: 1px solid rgba(0,0,0,0.2);
|
139 |
+
}
|
140 |
+
.landing-page-option-row {
|
141 |
+
padding-top: 10px;
|
142 |
+
padding-left: 3px;
|
143 |
+
padding-bottom:0px;
|
144 |
+
padding-right: 0px;
|
145 |
+
clear: both;
|
146 |
+
}
|
147 |
+
.landing-page-table-header {
|
148 |
+
font-size: 17px;
|
149 |
+
padding-bottom: 5px;
|
150 |
+
padding-left: 2px;
|
151 |
+
}
|
152 |
+
h1 {
|
153 |
+
line-height: 28px;
|
154 |
+
margin-bottom: 0px;
|
155 |
+
margin-top: 10px;
|
156 |
}
|
css/frontend/global-landing-page-style.css
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
/**
|
2 |
-
* WordPress required styles
|
3 |
-
* Needed for editor media floats
|
4 |
-
*/
|
5 |
-
/* ---------------------------------------------- */
|
6 |
-
.wp-caption{
|
7 |
-
background:#FBFBFB;
|
8 |
-
border:1px solid #EEE;
|
9 |
-
padding:10px;
|
10 |
-
max-width: 100%;
|
11 |
-
}
|
12 |
-
.wp-caption img{
|
13 |
-
display:block;
|
14 |
-
margin-bottom:5px;
|
15 |
-
}
|
16 |
-
.wp-caption-text,
|
17 |
-
.gallery-caption{
|
18 |
-
margin:0;
|
19 |
-
font-size:12px;
|
20 |
-
font-style:italic
|
21 |
-
}
|
22 |
-
.alignright{
|
23 |
-
float:right;
|
24 |
-
margin: 10px 0px 10px 20px;
|
25 |
-
}
|
26 |
-
.alignleft{
|
27 |
-
float:left;
|
28 |
-
margin: 10px 20px 10px 0px;
|
29 |
-
}
|
30 |
-
.aligncenter{
|
31 |
-
display:block;
|
32 |
-
margin-left:auto;
|
33 |
-
margin-right:auto;
|
34 |
-
}
|
35 |
-
.alignnone{
|
36 |
-
display:block;
|
37 |
-
margin: 10px 0px;
|
38 |
-
}
|
39 |
-
.bypostauthor{}
|
40 |
/* ---------------------------------------------- */
|
1 |
+
/**
|
2 |
+
* WordPress required styles
|
3 |
+
* Needed for editor media floats
|
4 |
+
*/
|
5 |
+
/* ---------------------------------------------- */
|
6 |
+
.wp-caption{
|
7 |
+
background:#FBFBFB;
|
8 |
+
border:1px solid #EEE;
|
9 |
+
padding:10px;
|
10 |
+
max-width: 100%;
|
11 |
+
}
|
12 |
+
.wp-caption img{
|
13 |
+
display:block;
|
14 |
+
margin-bottom:5px;
|
15 |
+
}
|
16 |
+
.wp-caption-text,
|
17 |
+
.gallery-caption{
|
18 |
+
margin:0;
|
19 |
+
font-size:12px;
|
20 |
+
font-style:italic
|
21 |
+
}
|
22 |
+
.alignright{
|
23 |
+
float:right;
|
24 |
+
margin: 10px 0px 10px 20px;
|
25 |
+
}
|
26 |
+
.alignleft{
|
27 |
+
float:left;
|
28 |
+
margin: 10px 20px 10px 0px;
|
29 |
+
}
|
30 |
+
.aligncenter{
|
31 |
+
display:block;
|
32 |
+
margin-left:auto;
|
33 |
+
margin-right:auto;
|
34 |
+
}
|
35 |
+
.alignnone{
|
36 |
+
display:block;
|
37 |
+
margin: 10px 0px;
|
38 |
+
}
|
39 |
+
.bypostauthor{}
|
40 |
/* ---------------------------------------------- */
|
css/jquery.qtip.min.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! qtip2 v2.0.0 | http://craigsworks.com/projects/qtip2/ | Licensed MIT, GPL */.qtip,.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:700px;min-width:50px;font-size:14.5px;line-height:12px;direction:ltr}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:15px 35px 7px 8px;overflow:hidden;border-width:0 0 1px;font-weight:normal}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;border-color:transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr;vertical-align:middle}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;text-align:center;text-indent:0;font:normal bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border-width:1px;border-style:solid;border-color:#F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111}/*! Light tooltip style */.qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1}/*! Dark tooltip style */.qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030}/*! Cream tooltip style */.qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0}/*! Red tooltip style */.qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252}/*! Green tooltip style */.qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0}/*! Blue tooltip style */.qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border-width:0;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,black));background-image:-webkit-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-moz-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-ms-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-o-linear-gradient(top,#4A4A4A 0,black 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:transparent;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px black}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));background-image:-webkit-linear-gradient(top,#3A79B8,#2E629D);background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-ms-linear-gradient(top,#3A79B8,#2E629D);background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:-10000em;top:-10000em}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important}.qtip-jtools{padding-bottom: 5px;}.qtip-title{font-size:20px;}
|
2 |
-
.qtip-content {
|
3 |
-
font-weight: 300;
|
4 |
}
|
1 |
+
/*! qtip2 v2.0.0 | http://craigsworks.com/projects/qtip2/ | Licensed MIT, GPL */.qtip,.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:700px;min-width:50px;font-size:14.5px;line-height:12px;direction:ltr}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:15px 35px 7px 8px;overflow:hidden;border-width:0 0 1px;font-weight:normal}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;border-color:transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr;vertical-align:middle}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;text-align:center;text-indent:0;font:normal bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border-width:1px;border-style:solid;border-color:#F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111}/*! Light tooltip style */.qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1}/*! Dark tooltip style */.qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030}/*! Cream tooltip style */.qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0}/*! Red tooltip style */.qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252}/*! Green tooltip style */.qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0}/*! Blue tooltip style */.qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border-width:0;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,black));background-image:-webkit-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-moz-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-ms-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-o-linear-gradient(top,#4A4A4A 0,black 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:transparent;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px black}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));background-image:-webkit-linear-gradient(top,#3A79B8,#2E629D);background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-ms-linear-gradient(top,#3A79B8,#2E629D);background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:-10000em;top:-10000em}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important}.qtip-jtools{padding-bottom: 5px;}.qtip-title{font-size:20px;}
|
2 |
+
.qtip-content {
|
3 |
+
font-weight: 300;
|
4 |
}
|
css/new-customizer-admin.css
CHANGED
@@ -1,241 +1,241 @@
|
|
1 |
-
#wpadminbar, #edit-slug-box, #post-status-info, #screen-options-link-wrap, #leads-table-container, .misc-pub-section, #minor-publishing, .misc-pub-section, .misc-pub-section.curtime, #delete-action, #convert-header, #lp-tour, #view-post-btn, #launch-visual-editer, #adminmenuwrap, #lp_ab_display_stats_metabox, #lp-thumbnail-sidebar-preview, #landing_page_categorydiv, #postimagediv, #leads-table-container-inside, .updated.below-h2 a, .mceButton.mceButtonEnabled.mce_fullscreen, .mce_strikethrough, .mce_wp_more, #setting-error-tgmpa {
|
2 |
-
display: none !important;
|
3 |
-
}
|
4 |
-
html.wp-toolbar {
|
5 |
-
padding-top: 0px !important;
|
6 |
-
}
|
7 |
-
.auto-fold #adminmenuback, .auto-fold #adminmenuwrap, .auto-fold #adminmenu, .auto-fold #adminmenu li.menu-top {
|
8 |
-
width: 0px !important;
|
9 |
-
}
|
10 |
-
.auto-fold #wpcontent, .auto-fold #wpfooter {
|
11 |
-
margin-left: 10px !important;
|
12 |
-
}
|
13 |
-
#wpbody-content {
|
14 |
-
padding-bottom: 90px !important;
|
15 |
-
width: 100% !important;
|
16 |
-
}
|
17 |
-
|
18 |
-
.wp_themeSkin .mceButton {
|
19 |
-
display: block;
|
20 |
-
width: 20px !important;
|
21 |
-
height: 20px !important;
|
22 |
-
}
|
23 |
-
.quicktags-toolbar input {
|
24 |
-
min-width: 10px !important;
|
25 |
-
padding: 2px 2px !important;
|
26 |
-
}
|
27 |
-
#post-body-content {
|
28 |
-
width: 103% !important;
|
29 |
-
margin-left: -10px !important; }
|
30 |
-
#lp_2_form_content {
|
31 |
-
margin-left: -10px !important;
|
32 |
-
}
|
33 |
-
.inbound-textarea-row .inbound-meta-box-option.inbound-textarea-option textarea {
|
34 |
-
width: 90% !important;
|
35 |
-
}
|
36 |
-
.wp_themeSkin .mceButton .mceIcon {
|
37 |
-
margin-top: 0px !important;
|
38 |
-
margin-left: 0px !important;
|
39 |
-
}
|
40 |
-
#inbound-meta .inbound-meta-box-row.inbound-wysiwyg-row {
|
41 |
-
width: 105%;
|
42 |
-
margin-left: -6px;
|
43 |
-
}
|
44 |
-
|
45 |
-
@media screen and (max-width: 600px) {
|
46 |
-
.version-3-8 #wpbody {
|
47 |
-
padding-top: 5px !important;
|
48 |
-
}
|
49 |
-
}
|
50 |
-
#submitdiv .handlediv , #submitdiv .hndle {
|
51 |
-
display: none !important;
|
52 |
-
}
|
53 |
-
.wrap div.updated, .wrap div.error, .media-upload-form div.error {
|
54 |
-
margin: 5px 0 0px !important;
|
55 |
-
}
|
56 |
-
.inbound-meta-box-option.inbound-dropdown-option {
|
57 |
-
width: 95% !important;
|
58 |
-
}
|
59 |
-
#publishing-action {
|
60 |
-
text-align: center !important;
|
61 |
-
float: none !important;
|
62 |
-
margin-bottom: 15px;
|
63 |
-
line-height: 32px; }
|
64 |
-
#minor-publishing-actions input, #major-publishing-actions input, #minor-publishing-actions .preview {
|
65 |
-
text-align: center !important;
|
66 |
-
width: 280px !important;
|
67 |
-
margin: auto !important;
|
68 |
-
height: 44px !important;
|
69 |
-
font-size: 17px !important;
|
70 |
-
}
|
71 |
-
#major-publishing-actions {
|
72 |
-
padding: 10px 10px 10px !important;}
|
73 |
-
.select2-container {
|
74 |
-
min-width: 100% !important;
|
75 |
-
}
|
76 |
-
.inbound-meta-box-option.inbound-media-option input[type=text] {
|
77 |
-
width: 100%;
|
78 |
-
}
|
79 |
-
#submitdiv {
|
80 |
-
position: fixed !important;
|
81 |
-
bottom: 0px !important;
|
82 |
-
z-index: 999999 !important;
|
83 |
-
width: 100% !important;
|
84 |
-
margin-left: -10px !important;
|
85 |
-
padding-bottom: 10px !important;
|
86 |
-
margin-bottom: 0px !important;
|
87 |
-
|
88 |
-
}
|
89 |
-
.version-3-8 #submitdiv {
|
90 |
-
margin-left: -20px !important;
|
91 |
-
}
|
92 |
-
.jPicker .Grid {
|
93 |
-
display: none;
|
94 |
-
}
|
95 |
-
.jPicker .Button {
|
96 |
-
text-align: center;
|
97 |
-
padding: 0 4px;
|
98 |
-
width: 264px;
|
99 |
-
position: absolute;
|
100 |
-
border-bottom: none;
|
101 |
-
left: 0px;
|
102 |
-
bottom: 3px;
|
103 |
-
}
|
104 |
-
.jPicker .Button input {
|
105 |
-
font-size: 18px !important;
|
106 |
-
}
|
107 |
-
.jPicker .Icon span.Color, .jPicker .Icon span.Alpha {
|
108 |
-
width: 97% !important;
|
109 |
-
}
|
110 |
-
.jPicker .Title {
|
111 |
-
width: 254px;
|
112 |
-
}
|
113 |
-
.jPicker hr {
|
114 |
-
display: none !important;
|
115 |
-
}
|
116 |
-
.inbound-meta-box-option.inbound-datepicker-option span{
|
117 |
-
display: block;
|
118 |
-
}
|
119 |
-
.inbound-meta-box-option.inbound-datepicker-option input {
|
120 |
-
width: 70%;
|
121 |
-
}
|
122 |
-
#lp-notes-area input {
|
123 |
-
|
124 |
-
padding-bottom: 0px;
|
125 |
-
}
|
126 |
-
table.jPicker {
|
127 |
-
width: 430px !important;}
|
128 |
-
@media only screen and (max-width: 600px) {
|
129 |
-
.media-modal {
|
130 |
-
width: 432px !important;
|
131 |
-
position: fixed !important;
|
132 |
-
height: 484px !important;
|
133 |
-
}
|
134 |
-
.media-modal-backdrop {
|
135 |
-
width: 600px;
|
136 |
-
position: fixed !important;
|
137 |
-
}
|
138 |
-
}
|
139 |
-
@media screen and (max-width: 782px) {
|
140 |
-
#wp-content-editor-tools {
|
141 |
-
overflow: hidden;
|
142 |
-
padding: 0px 15px 1px 0; }
|
143 |
-
}
|
144 |
-
ul#template-filter {
|
145 |
-
clear: both !important;
|
146 |
-
margin: 0px 0;
|
147 |
-
padding: 0;
|
148 |
-
padding-left: 0px;
|
149 |
-
line-height: 28px;
|
150 |
-
}
|
151 |
-
#lp-cancel-selection {
|
152 |
-
display: block;
|
153 |
-
float: none;
|
154 |
-
width: 70%;
|
155 |
-
text-align: center;
|
156 |
-
margin: auto;
|
157 |
-
margin-bottom: 10px;
|
158 |
-
margin-top: 10px;
|
159 |
-
}
|
160 |
-
#template-item {
|
161 |
-
width: 200px;}
|
162 |
-
ul#template-filter li {
|
163 |
-
display: inline-block;
|
164 |
-
|
165 |
-
padding-bottom: 0px;
|
166 |
-
padding-top: 0px;
|
167 |
-
margin: 0px;
|
168 |
-
line-height: 20px;
|
169 |
-
}
|
170 |
-
.lp-selection-heading h1 {
|
171 |
-
font-size: 18px;
|
172 |
-
display: block;
|
173 |
-
text-align: center;
|
174 |
-
}
|
175 |
-
.form-table .inbound-meta-box-label label{
|
176 |
-
width: 100% !important;
|
177 |
-
display: block !important;
|
178 |
-
margin-bottom: 5px;
|
179 |
-
font-size: 20px !important;
|
180 |
-
|
181 |
-
}
|
182 |
-
.form-table .inbound-wysiwyg-row .inbound-meta-box-label label{
|
183 |
-
margin-left: -10px !important;
|
184 |
-
}
|
185 |
-
.inbound-textarea-option {
|
186 |
-
width: 106% !important; }
|
187 |
-
.inbound-wysiwyg-option {
|
188 |
-
width: 103% !important;
|
189 |
-
}
|
190 |
-
.inbound-wysiwyg-option {
|
191 |
-
margin-left: -10px !important;
|
192 |
-
}
|
193 |
-
.mceIframeContainer.mceFirst.mceLast iframe {
|
194 |
-
width: 100% !important;
|
195 |
-
}
|
196 |
-
.mceIframeContainer.mceFirst.mceLast {
|
197 |
-
margin-top: 30px;
|
198 |
-
}
|
199 |
-
.mceToolbar.mceLeft.mceFirst.mceLast div {
|
200 |
-
background: #F5F5F5;
|
201 |
-
}
|
202 |
-
#lp_metabox_select_template {
|
203 |
-
margin-left: -20px !important;
|
204 |
-
width: 108%;
|
205 |
-
}
|
206 |
-
.wp-editor-container {
|
207 |
-
border-right-color: transparent !important;
|
208 |
-
}
|
209 |
-
|
210 |
-
#inbound-shortcodes-preview-wrap {
|
211 |
-
display: none !important;
|
212 |
-
}
|
213 |
-
.wp-editor-wrap {
|
214 |
-
|
215 |
-
border-right: 1px solid #E6E6E6 !important;
|
216 |
-
}
|
217 |
-
#inbound-shortcodes-form-wrap {
|
218 |
-
width: 96% !important;}
|
219 |
-
#inbound-shortcodes-form-wrap tbody tr.form-row td.label {
|
220 |
-
line-height: 29px !important;
|
221 |
-
display: block !important;
|
222 |
-
}
|
223 |
-
#popup-controls {
|
224 |
-
position: fixed;
|
225 |
-
border-top: 1px solid transparent !important;
|
226 |
-
bottom: 90px !important;
|
227 |
-
width: 300px !important;
|
228 |
-
left: 0% !important;
|
229 |
-
background: transparent !important;}
|
230 |
-
#inbound-shortcodes-form-table tbody tr.form-row {
|
231 |
-
display: block;
|
232 |
-
padding: 0px !important;
|
233 |
-
border-bottom: none !important;}
|
234 |
-
#inbound-shortcodes-form-wrap #inbound-shortcodes-form {
|
235 |
-
padding-bottom: 300px !important;
|
236 |
-
}
|
237 |
-
#inbound-shortcodes-form-table input[type="text"], #inbound-shortcodes-form-table input[type="email"], #inbound-shortcodes-form-table input[type="url"], #inbound-shortcodes-form-table input[type="number"], #inbound-shortcodes-form-table input[type="password"], #inbound-shortcodes-form-table textarea {
|
238 |
-
width: 100% !important;
|
239 |
-
}
|
240 |
-
#inbound_insert_shortcode_two, #shortcode_cancel, #inbound_save_form {
|
241 |
margin-bottom: 10px !important; }
|
1 |
+
#wpadminbar, #edit-slug-box, #post-status-info, #screen-options-link-wrap, #leads-table-container, .misc-pub-section, #minor-publishing, .misc-pub-section, .misc-pub-section.curtime, #delete-action, #convert-header, #lp-tour, #view-post-btn, #launch-visual-editer, #adminmenuwrap, #lp_ab_display_stats_metabox, #lp-thumbnail-sidebar-preview, #landing_page_categorydiv, #postimagediv, #leads-table-container-inside, .updated.below-h2 a, .mceButton.mceButtonEnabled.mce_fullscreen, .mce_strikethrough, .mce_wp_more, #setting-error-tgmpa {
|
2 |
+
display: none !important;
|
3 |
+
}
|
4 |
+
html.wp-toolbar {
|
5 |
+
padding-top: 0px !important;
|
6 |
+
}
|
7 |
+
.auto-fold #adminmenuback, .auto-fold #adminmenuwrap, .auto-fold #adminmenu, .auto-fold #adminmenu li.menu-top {
|
8 |
+
width: 0px !important;
|
9 |
+
}
|
10 |
+
.auto-fold #wpcontent, .auto-fold #wpfooter {
|
11 |
+
margin-left: 10px !important;
|
12 |
+
}
|
13 |
+
#wpbody-content {
|
14 |
+
padding-bottom: 90px !important;
|
15 |
+
width: 100% !important;
|
16 |
+
}
|
17 |
+
|
18 |
+
.wp_themeSkin .mceButton {
|
19 |
+
display: block;
|
20 |
+
width: 20px !important;
|
21 |
+
height: 20px !important;
|
22 |
+
}
|
23 |
+
.quicktags-toolbar input {
|
24 |
+
min-width: 10px !important;
|
25 |
+
padding: 2px 2px !important;
|
26 |
+
}
|
27 |
+
#post-body-content {
|
28 |
+
width: 103% !important;
|
29 |
+
margin-left: -10px !important; }
|
30 |
+
#lp_2_form_content {
|
31 |
+
margin-left: -10px !important;
|
32 |
+
}
|
33 |
+
.inbound-textarea-row .inbound-meta-box-option.inbound-textarea-option textarea {
|
34 |
+
width: 90% !important;
|
35 |
+
}
|
36 |
+
.wp_themeSkin .mceButton .mceIcon {
|
37 |
+
margin-top: 0px !important;
|
38 |
+
margin-left: 0px !important;
|
39 |
+
}
|
40 |
+
#inbound-meta .inbound-meta-box-row.inbound-wysiwyg-row {
|
41 |
+
width: 105%;
|
42 |
+
margin-left: -6px;
|
43 |
+
}
|
44 |
+
|
45 |
+
@media screen and (max-width: 600px) {
|
46 |
+
.version-3-8 #wpbody {
|
47 |
+
padding-top: 5px !important;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
#submitdiv .handlediv , #submitdiv .hndle {
|
51 |
+
display: none !important;
|
52 |
+
}
|
53 |
+
.wrap div.updated, .wrap div.error, .media-upload-form div.error {
|
54 |
+
margin: 5px 0 0px !important;
|
55 |
+
}
|
56 |
+
.inbound-meta-box-option.inbound-dropdown-option {
|
57 |
+
width: 95% !important;
|
58 |
+
}
|
59 |
+
#publishing-action {
|
60 |
+
text-align: center !important;
|
61 |
+
float: none !important;
|
62 |
+
margin-bottom: 15px;
|
63 |
+
line-height: 32px; }
|
64 |
+
#minor-publishing-actions input, #major-publishing-actions input, #minor-publishing-actions .preview {
|
65 |
+
text-align: center !important;
|
66 |
+
width: 280px !important;
|
67 |
+
margin: auto !important;
|
68 |
+
height: 44px !important;
|
69 |
+
font-size: 17px !important;
|
70 |
+
}
|
71 |
+
#major-publishing-actions {
|
72 |
+
padding: 10px 10px 10px !important;}
|
73 |
+
.select2-container {
|
74 |
+
min-width: 100% !important;
|
75 |
+
}
|
76 |
+
.inbound-meta-box-option.inbound-media-option input[type=text] {
|
77 |
+
width: 100%;
|
78 |
+
}
|
79 |
+
#submitdiv {
|
80 |
+
position: fixed !important;
|
81 |
+
bottom: 0px !important;
|
82 |
+
z-index: 999999 !important;
|
83 |
+
width: 100% !important;
|
84 |
+
margin-left: -10px !important;
|
85 |
+
padding-bottom: 10px !important;
|
86 |
+
margin-bottom: 0px !important;
|
87 |
+
|
88 |
+
}
|
89 |
+
.version-3-8 #submitdiv {
|
90 |
+
margin-left: -20px !important;
|
91 |
+
}
|
92 |
+
.jPicker .Grid {
|
93 |
+
display: none;
|
94 |
+
}
|
95 |
+
.jPicker .Button {
|
96 |
+
text-align: center;
|
97 |
+
padding: 0 4px;
|
98 |
+
width: 264px;
|
99 |
+
position: absolute;
|
100 |
+
border-bottom: none;
|
101 |
+
left: 0px;
|
102 |
+
bottom: 3px;
|
103 |
+
}
|
104 |
+
.jPicker .Button input {
|
105 |
+
font-size: 18px !important;
|
106 |
+
}
|
107 |
+
.jPicker .Icon span.Color, .jPicker .Icon span.Alpha {
|
108 |
+
width: 97% !important;
|
109 |
+
}
|
110 |
+
.jPicker .Title {
|
111 |
+
width: 254px;
|
112 |
+
}
|
113 |
+
.jPicker hr {
|
114 |
+
display: none !important;
|
115 |
+
}
|
116 |
+
.inbound-meta-box-option.inbound-datepicker-option span{
|
117 |
+
display: block;
|
118 |
+
}
|
119 |
+
.inbound-meta-box-option.inbound-datepicker-option input {
|
120 |
+
width: 70%;
|
121 |
+
}
|
122 |
+
#lp-notes-area input {
|
123 |
+
|
124 |
+
padding-bottom: 0px;
|
125 |
+
}
|
126 |
+
table.jPicker {
|
127 |
+
width: 430px !important;}
|
128 |
+
@media only screen and (max-width: 600px) {
|
129 |
+
.media-modal {
|
130 |
+
width: 432px !important;
|
131 |
+
position: fixed !important;
|
132 |
+
height: 484px !important;
|
133 |
+
}
|
134 |
+
.media-modal-backdrop {
|
135 |
+
width: 600px;
|
136 |
+
position: fixed !important;
|
137 |
+
}
|
138 |
+
}
|
139 |
+
@media screen and (max-width: 782px) {
|
140 |
+
#wp-content-editor-tools {
|
141 |
+
overflow: hidden;
|
142 |
+
padding: 0px 15px 1px 0; }
|
143 |
+
}
|
144 |
+
ul#template-filter {
|
145 |
+
clear: both !important;
|
146 |
+
margin: 0px 0;
|
147 |
+
padding: 0;
|
148 |
+
padding-left: 0px;
|
149 |
+
line-height: 28px;
|
150 |
+
}
|
151 |
+
#lp-cancel-selection {
|
152 |
+
display: block;
|
153 |
+
float: none;
|
154 |
+
width: 70%;
|
155 |
+
text-align: center;
|
156 |
+
margin: auto;
|
157 |
+
margin-bottom: 10px;
|
158 |
+
margin-top: 10px;
|
159 |
+
}
|
160 |
+
#template-item {
|
161 |
+
width: 200px;}
|
162 |
+
ul#template-filter li {
|
163 |
+
display: inline-block;
|
164 |
+
|
165 |
+
padding-bottom: 0px;
|
166 |
+
padding-top: 0px;
|
167 |
+
margin: 0px;
|
168 |
+
line-height: 20px;
|
169 |
+
}
|
170 |
+
.lp-selection-heading h1 {
|
171 |
+
font-size: 18px;
|
172 |
+
display: block;
|
173 |
+
text-align: center;
|
174 |
+
}
|
175 |
+
.form-table .inbound-meta-box-label label{
|
176 |
+
width: 100% !important;
|
177 |
+
display: block !important;
|
178 |
+
margin-bottom: 5px;
|
179 |
+
font-size: 20px !important;
|
180 |
+
|
181 |
+
}
|
182 |
+
.form-table .inbound-wysiwyg-row .inbound-meta-box-label label{
|
183 |
+
margin-left: -10px !important;
|
184 |
+
}
|
185 |
+
.inbound-textarea-option {
|
186 |
+
width: 106% !important; }
|
187 |
+
.inbound-wysiwyg-option {
|
188 |
+
width: 103% !important;
|
189 |
+
}
|
190 |
+
.inbound-wysiwyg-option {
|
191 |
+
margin-left: -10px !important;
|
192 |
+
}
|
193 |
+
.mceIframeContainer.mceFirst.mceLast iframe {
|
194 |
+
width: 100% !important;
|
195 |
+
}
|
196 |
+
.mceIframeContainer.mceFirst.mceLast {
|
197 |
+
margin-top: 30px;
|
198 |
+
}
|
199 |
+
.mceToolbar.mceLeft.mceFirst.mceLast div {
|
200 |
+
background: #F5F5F5;
|
201 |
+
}
|
202 |
+
#lp_metabox_select_template {
|
203 |
+
margin-left: -20px !important;
|
204 |
+
width: 108%;
|
205 |
+
}
|
206 |
+
.wp-editor-container {
|
207 |
+
border-right-color: transparent !important;
|
208 |
+
}
|
209 |
+
|
210 |
+
#inbound-shortcodes-preview-wrap {
|
211 |
+
display: none !important;
|
212 |
+
}
|
213 |
+
.wp-editor-wrap {
|
214 |
+
|
215 |
+
border-right: 1px solid #E6E6E6 !important;
|
216 |
+
}
|
217 |
+
#inbound-shortcodes-form-wrap {
|
218 |
+
width: 96% !important;}
|
219 |
+
#inbound-shortcodes-form-wrap tbody tr.form-row td.label {
|
220 |
+
line-height: 29px !important;
|
221 |
+
display: block !important;
|
222 |
+
}
|
223 |
+
#popup-controls {
|
224 |
+
position: fixed;
|
225 |
+
border-top: 1px solid transparent !important;
|
226 |
+
bottom: 90px !important;
|
227 |
+
width: 300px !important;
|
228 |
+
left: 0% !important;
|
229 |
+
background: transparent !important;}
|
230 |
+
#inbound-shortcodes-form-table tbody tr.form-row {
|
231 |
+
display: block;
|
232 |
+
padding: 0px !important;
|
233 |
+
border-bottom: none !important;}
|
234 |
+
#inbound-shortcodes-form-wrap #inbound-shortcodes-form {
|
235 |
+
padding-bottom: 300px !important;
|
236 |
+
}
|
237 |
+
#inbound-shortcodes-form-table input[type="text"], #inbound-shortcodes-form-table input[type="email"], #inbound-shortcodes-form-table input[type="url"], #inbound-shortcodes-form-table input[type="number"], #inbound-shortcodes-form-table input[type="password"], #inbound-shortcodes-form-table textarea {
|
238 |
+
width: 100% !important;
|
239 |
+
}
|
240 |
+
#inbound_insert_shortcode_two, #shortcode_cancel, #inbound_save_form {
|
241 |
margin-bottom: 10px !important; }
|
js/admin/admin.global-settings.js
CHANGED
@@ -1,44 +1,44 @@
|
|
1 |
-
|
2 |
-
function getUrlVars() {
|
3 |
-
var vars = [], hash;
|
4 |
-
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
5 |
-
for(var i = 0; i < hashes.length; i++)
|
6 |
-
{
|
7 |
-
hash = hashes[i].split('=');
|
8 |
-
vars.push(hash[0]);
|
9 |
-
vars[hash[0]] = hash[1];
|
10 |
-
}
|
11 |
-
return vars;
|
12 |
-
};
|
13 |
-
|
14 |
-
function getUrlVar(name){
|
15 |
-
return getUrlVars()[name];
|
16 |
-
};
|
17 |
-
|
18 |
-
jQuery(document).ready(function($) {
|
19 |
-
|
20 |
-
// Getting URL var by its nam
|
21 |
-
var byName = getUrlVar('tab');
|
22 |
-
|
23 |
-
// Set setting Tab
|
24 |
-
setTimeout(function() {
|
25 |
-
jQuery("#" + byName).click();
|
26 |
-
}, 300);
|
27 |
-
/* Update Setting URL */
|
28 |
-
jQuery("body").on('click', '.nav-tab', function () {
|
29 |
-
var this_id = jQuery(this).attr('id');
|
30 |
-
if (history.pushState) {
|
31 |
-
var newurl = window.location.href.replace(/tab=([^"]*)/g, 'tab=' + this_id);
|
32 |
-
var current_tab = newurl.match(/tab=([^"]*)/g);
|
33 |
-
if (typeof (current_tab) != "undefined" && current_tab != null && current_tab != "") {
|
34 |
-
var current_tab = current_tab[0].replace("tab=","");
|
35 |
-
window.history.pushState({path:newurl},'',newurl);
|
36 |
-
} else {
|
37 |
-
var newurl = window.location.href + '&tab=' + this_id;
|
38 |
-
window.history.pushState({path:newurl},'',newurl);
|
39 |
-
}
|
40 |
-
|
41 |
-
}
|
42 |
-
});
|
43 |
-
|
44 |
});
|
1 |
+
|
2 |
+
function getUrlVars() {
|
3 |
+
var vars = [], hash;
|
4 |
+
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
5 |
+
for(var i = 0; i < hashes.length; i++)
|
6 |
+
{
|
7 |
+
hash = hashes[i].split('=');
|
8 |
+
vars.push(hash[0]);
|
9 |
+
vars[hash[0]] = hash[1];
|
10 |
+
}
|
11 |
+
return vars;
|
12 |
+
};
|
13 |
+
|
14 |
+
function getUrlVar(name){
|
15 |
+
return getUrlVars()[name];
|
16 |
+
};
|
17 |
+
|
18 |
+
jQuery(document).ready(function($) {
|
19 |
+
|
20 |
+
// Getting URL var by its nam
|
21 |
+
var byName = getUrlVar('tab');
|
22 |
+
|
23 |
+
// Set setting Tab
|
24 |
+
setTimeout(function() {
|
25 |
+
jQuery("#" + byName).click();
|
26 |
+
}, 300);
|
27 |
+
/* Update Setting URL */
|
28 |
+
jQuery("body").on('click', '.nav-tab', function () {
|
29 |
+
var this_id = jQuery(this).attr('id');
|
30 |
+
if (history.pushState) {
|
31 |
+
var newurl = window.location.href.replace(/tab=([^"]*)/g, 'tab=' + this_id);
|
32 |
+
var current_tab = newurl.match(/tab=([^"]*)/g);
|
33 |
+
if (typeof (current_tab) != "undefined" && current_tab != null && current_tab != "") {
|
34 |
+
var current_tab = current_tab[0].replace("tab=","");
|
35 |
+
window.history.pushState({path:newurl},'',newurl);
|
36 |
+
} else {
|
37 |
+
var newurl = window.location.href + '&tab=' + this_id;
|
38 |
+
window.history.pushState({path:newurl},'',newurl);
|
39 |
+
}
|
40 |
+
|
41 |
+
}
|
42 |
+
});
|
43 |
+
|
44 |
});
|
js/admin/admin.install-plugins.js
CHANGED
@@ -1,30 +1,30 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
/* Loads on /themes.php?page=install-inbound-plugins */
|
3 |
-
var install_status = jQuery("#the-list td.status.column-status").text();
|
4 |
-
var click_apply = "<h2 class='click-to-activate'><span>←</span>Click Apply to Install</h2>";
|
5 |
-
var activate_apply = "<h2 class='click-to-activate-bulk'><span>←</span>Click Apply to Bulk Activate Plugins</h2>";
|
6 |
-
jQuery(".alignleft.actions.bulkactions").after(click_apply);
|
7 |
-
jQuery(".alignleft.actions.bulkactions").after(activate_apply);
|
8 |
-
console.log(install_status);
|
9 |
-
jQuery('#the-list td.status.column-status').each(function(){
|
10 |
-
var installed_on = $(this).text();
|
11 |
-
if (installed_on === "Not Installed") {
|
12 |
-
$(this).parent().find("input[type=checkbox]").attr("checked", "on");
|
13 |
-
if ( $(".click-to-activate-bulk").is(":hidden") ) {
|
14 |
-
jQuery('.click-to-activate').show();
|
15 |
-
jQuery(".alignleft.actions.bulkactions select").val('tgmpa-bulk-install');
|
16 |
-
}
|
17 |
-
|
18 |
-
}
|
19 |
-
if (installed_on === "Installed But Not Activated") {
|
20 |
-
$(this).parent().find("input[type=checkbox]").attr("checked", "on");
|
21 |
-
if ( $(".click-to-activate").is(":hidden") ) {
|
22 |
-
jQuery('.click-to-activate-bulk').show();
|
23 |
-
jQuery(".alignleft.actions.bulkactions select").val('tgmpa-bulk-activate');
|
24 |
-
}
|
25 |
-
|
26 |
-
}
|
27 |
-
});
|
28 |
-
jQuery("#cb-select-all-1, #cb-select-all-2").attr("checked", "on");
|
29 |
-
|
30 |
-
});
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
/* Loads on /themes.php?page=install-inbound-plugins */
|
3 |
+
var install_status = jQuery("#the-list td.status.column-status").text();
|
4 |
+
var click_apply = "<h2 class='click-to-activate'><span>←</span>Click Apply to Install</h2>";
|
5 |
+
var activate_apply = "<h2 class='click-to-activate-bulk'><span>←</span>Click Apply to Bulk Activate Plugins</h2>";
|
6 |
+
jQuery(".alignleft.actions.bulkactions").after(click_apply);
|
7 |
+
jQuery(".alignleft.actions.bulkactions").after(activate_apply);
|
8 |
+
console.log(install_status);
|
9 |
+
jQuery('#the-list td.status.column-status').each(function(){
|
10 |
+
var installed_on = $(this).text();
|
11 |
+
if (installed_on === "Not Installed") {
|
12 |
+
$(this).parent().find("input[type=checkbox]").attr("checked", "on");
|
13 |
+
if ( $(".click-to-activate-bulk").is(":hidden") ) {
|
14 |
+
jQuery('.click-to-activate').show();
|
15 |
+
jQuery(".alignleft.actions.bulkactions select").val('tgmpa-bulk-install');
|
16 |
+
}
|
17 |
+
|
18 |
+
}
|
19 |
+
if (installed_on === "Installed But Not Activated") {
|
20 |
+
$(this).parent().find("input[type=checkbox]").attr("checked", "on");
|
21 |
+
if ( $(".click-to-activate").is(":hidden") ) {
|
22 |
+
jQuery('.click-to-activate-bulk').show();
|
23 |
+
jQuery(".alignleft.actions.bulkactions select").val('tgmpa-bulk-activate');
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
27 |
+
});
|
28 |
+
jQuery("#cb-select-all-1, #cb-select-all-2").attr("checked", "on");
|
29 |
+
|
30 |
+
});
|
js/admin/admin.landing-page-list.js
CHANGED
@@ -73,7 +73,7 @@ jQuery("body").on('mouseleave', 'tr.type-landing-page', function () {
|
|
73 |
jQuery(this).hide();
|
74 |
jQuery(this).parent().find(".lp-varation-stat-ul").show();
|
75 |
});
|
76 |
-
|
77 |
jQuery('.lp-letter, .cr-number, .qtip').on('mouseenter', function(event) {
|
78 |
// Bind the qTip within the event handler
|
79 |
var text_in_tip = jQuery(this).attr("data-notes");
|
@@ -99,13 +99,13 @@ jQuery("body").on('mouseleave', 'tr.type-landing-page', function () {
|
|
99 |
show: {
|
100 |
event: event.type, // Use the same show event as the one that triggered the event handler
|
101 |
ready: true, // Show the tooltip as soon as it's bound, vital so it shows up the first time you hover!
|
102 |
-
solo: true
|
103 |
},
|
104 |
-
|
105 |
-
hide: { when: { event: 'inactive' }, delay: 1200 }
|
106 |
}, event); // Pass through our original event to qTip
|
107 |
})
|
108 |
-
|
109 |
jQuery('.lp-letter').on('mouseleave', function(event) {
|
110 |
|
111 |
|
@@ -114,7 +114,7 @@ jQuery("body").on('mouseleave', 'tr.type-landing-page', function () {
|
|
114 |
jQuery("body").on("click", ".lp-pop-close", function(event) {
|
115 |
jQuery(this).parent().parent().parent().hide();
|
116 |
});
|
117 |
-
|
118 |
jQuery("body").on("click", ".lp-pop-preview a", function(event) {
|
119 |
jQuery(this).parent().parent().parent().parent().hide();
|
120 |
});
|
@@ -151,7 +151,7 @@ jQuery("body").on('mouseleave', 'tr.type-landing-page', function () {
|
|
151 |
tinyMCE.get('content').focus();
|
152 |
tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
|
153 |
}
|
154 |
-
|
155 |
});
|
156 |
|
157 |
$(window).resize( function() { tb_position() } );
|
73 |
jQuery(this).hide();
|
74 |
jQuery(this).parent().find(".lp-varation-stat-ul").show();
|
75 |
});
|
76 |
+
|
77 |
jQuery('.lp-letter, .cr-number, .qtip').on('mouseenter', function(event) {
|
78 |
// Bind the qTip within the event handler
|
79 |
var text_in_tip = jQuery(this).attr("data-notes");
|
99 |
show: {
|
100 |
event: event.type, // Use the same show event as the one that triggered the event handler
|
101 |
ready: true, // Show the tooltip as soon as it's bound, vital so it shows up the first time you hover!
|
102 |
+
solo: true
|
103 |
},
|
104 |
+
hide: 'unfocus'
|
105 |
+
//hide: { when: { event: 'inactive' }, delay: 1200 }
|
106 |
}, event); // Pass through our original event to qTip
|
107 |
})
|
108 |
+
|
109 |
jQuery('.lp-letter').on('mouseleave', function(event) {
|
110 |
|
111 |
|
114 |
jQuery("body").on("click", ".lp-pop-close", function(event) {
|
115 |
jQuery(this).parent().parent().parent().hide();
|
116 |
});
|
117 |
+
|
118 |
jQuery("body").on("click", ".lp-pop-preview a", function(event) {
|
119 |
jQuery(this).parent().parent().parent().parent().hide();
|
120 |
});
|
151 |
tinyMCE.get('content').focus();
|
152 |
tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
|
153 |
}
|
154 |
+
|
155 |
});
|
156 |
|
157 |
$(window).resize( function() { tb_position() } );
|
js/admin/admin.metaboxes.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
1 |
+
jQuery(document).ready(function($) {
|
js/admin/admin.templates-upload.js
CHANGED
@@ -1,25 +1,25 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
|
3 |
-
jQuery('.subsubsub li a').live('click', function () {
|
4 |
-
|
5 |
-
var id = jQuery(this).attr('id');
|
6 |
-
//alert (id);
|
7 |
-
if (id == 'menu_upload') {
|
8 |
-
jQuery('.templates_search').hide();
|
9 |
-
jQuery('.templates_search').removeClass('current');
|
10 |
-
|
11 |
-
jQuery('.templates_upload').show();
|
12 |
-
jQuery('.templates_upload').addClass('current');
|
13 |
-
}
|
14 |
-
else if (id == 'menu_search')
|
15 |
-
{
|
16 |
-
jQuery('.templates_upload').hide();
|
17 |
-
jQuery('.templates_upload').removeClass('current');
|
18 |
-
|
19 |
-
jQuery('.templates_search').show();
|
20 |
-
jQuery('.templates_search').addClass('current');
|
21 |
-
}
|
22 |
-
|
23 |
-
});
|
24 |
-
|
25 |
});
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
|
3 |
+
jQuery('.subsubsub li a').live('click', function () {
|
4 |
+
|
5 |
+
var id = jQuery(this).attr('id');
|
6 |
+
//alert (id);
|
7 |
+
if (id == 'menu_upload') {
|
8 |
+
jQuery('.templates_search').hide();
|
9 |
+
jQuery('.templates_search').removeClass('current');
|
10 |
+
|
11 |
+
jQuery('.templates_upload').show();
|
12 |
+
jQuery('.templates_upload').addClass('current');
|
13 |
+
}
|
14 |
+
else if (id == 'menu_search')
|
15 |
+
{
|
16 |
+
jQuery('.templates_upload').hide();
|
17 |
+
jQuery('.templates_upload').removeClass('current');
|
18 |
+
|
19 |
+
jQuery('.templates_search').show();
|
20 |
+
jQuery('.templates_search').addClass('current');
|
21 |
+
}
|
22 |
+
|
23 |
+
});
|
24 |
+
|
25 |
});
|
js/admin/new-customizer-admin.js
CHANGED
@@ -1,57 +1,57 @@
|
|
1 |
-
function generate_random_cache_bust(length) {
|
2 |
-
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
|
3 |
-
|
4 |
-
if (! length) {
|
5 |
-
length = Math.floor(Math.random() * chars.length);
|
6 |
-
}
|
7 |
-
|
8 |
-
var str = '';
|
9 |
-
for (var i = 0; i < length; i++) {
|
10 |
-
str += chars[Math.floor(Math.random() * chars.length)];
|
11 |
-
}
|
12 |
-
return str;
|
13 |
-
}
|
14 |
-
|
15 |
-
jQuery(document).ready(function($) {
|
16 |
-
jQuery('.nav-tab-wrapper.a_b_tabs a').each(function(){
|
17 |
-
var this_link = jQuery(this).attr('href');
|
18 |
-
jQuery(this).attr('href', this_link + "&frontend=true");
|
19 |
-
|
20 |
-
});
|
21 |
-
|
22 |
-
jQuery(".nav-tab-wrapper.a_b_tabs a").on('click', function (event) {
|
23 |
-
|
24 |
-
jQuery(parent.document).find(".lp-load-overlay").fadeIn('slow');
|
25 |
-
|
26 |
-
});
|
27 |
-
|
28 |
-
|
29 |
-
var open_variation = jQuery("#open_variation").val();
|
30 |
-
var link_variation = jQuery("#view-post-btn a").attr('href');
|
31 |
-
|
32 |
-
var preview_window = jQuery(parent.document).find("#lp-live-preview").attr('src');
|
33 |
-
console.log(preview_window);
|
34 |
-
|
35 |
-
console.log(link_variation);
|
36 |
-
|
37 |
-
// reload the iframe preview page (for option toggles)
|
38 |
-
//jQuery('.reload').on('click', function (event) {
|
39 |
-
reload_preview(); // need to trigger reload from parent frame
|
40 |
-
//});
|
41 |
-
|
42 |
-
//alert(jQuery("#current_variation_id").text());
|
43 |
-
function reload_preview() {
|
44 |
-
var cache_bust = generate_random_cache_bust(35);
|
45 |
-
var reload_url = parent.window.location.href;
|
46 |
-
reload_url = reload_url.replace('template-customize=on','');
|
47 |
-
//alert(reload_url);
|
48 |
-
var current_variation_id = jQuery("#open_variation").val();
|
49 |
-
|
50 |
-
// var reload = jQuery(parent.document).find("#lp-live-preview").attr("src");
|
51 |
-
var new_reload = reload_url + "&live-preview-area=" + cache_bust + "&lp-variation-id=" + current_variation_id;
|
52 |
-
jQuery(parent.document).find("#lp-live-preview").attr("src", new_reload);
|
53 |
-
// console.log(new_reload);
|
54 |
-
jQuery(parent.document).find(".lp-load-overlay").fadeOut('slow');
|
55 |
-
}
|
56 |
-
|
57 |
-
});
|
1 |
+
function generate_random_cache_bust(length) {
|
2 |
+
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
|
3 |
+
|
4 |
+
if (! length) {
|
5 |
+
length = Math.floor(Math.random() * chars.length);
|
6 |
+
}
|
7 |
+
|
8 |
+
var str = '';
|
9 |
+
for (var i = 0; i < length; i++) {
|
10 |
+
str += chars[Math.floor(Math.random() * chars.length)];
|
11 |
+
}
|
12 |
+
return str;
|
13 |
+
}
|
14 |
+
|
15 |
+
jQuery(document).ready(function($) {
|
16 |
+
jQuery('.nav-tab-wrapper.a_b_tabs a').each(function(){
|
17 |
+
var this_link = jQuery(this).attr('href');
|
18 |
+
jQuery(this).attr('href', this_link + "&frontend=true");
|
19 |
+
|
20 |
+
});
|
21 |
+
|
22 |
+
jQuery(".nav-tab-wrapper.a_b_tabs a").on('click', function (event) {
|
23 |
+
|
24 |
+
jQuery(parent.document).find(".lp-load-overlay").fadeIn('slow');
|
25 |
+
|
26 |
+
});
|
27 |
+
|
28 |
+
|
29 |
+
var open_variation = jQuery("#open_variation").val();
|
30 |
+
var link_variation = jQuery("#view-post-btn a").attr('href');
|
31 |
+
|
32 |
+
var preview_window = jQuery(parent.document).find("#lp-live-preview").attr('src');
|
33 |
+
console.log(preview_window);
|
34 |
+
|
35 |
+
console.log(link_variation);
|
36 |
+
|
37 |
+
// reload the iframe preview page (for option toggles)
|
38 |
+
//jQuery('.reload').on('click', function (event) {
|
39 |
+
reload_preview(); // need to trigger reload from parent frame
|
40 |
+
//});
|
41 |
+
|
42 |
+
//alert(jQuery("#current_variation_id").text());
|
43 |
+
function reload_preview() {
|
44 |
+
var cache_bust = generate_random_cache_bust(35);
|
45 |
+
var reload_url = parent.window.location.href;
|
46 |
+
reload_url = reload_url.replace('template-customize=on','');
|
47 |
+
//alert(reload_url);
|
48 |
+
var current_variation_id = jQuery("#open_variation").val();
|
49 |
+
|
50 |
+
// var reload = jQuery(parent.document).find("#lp-live-preview").attr("src");
|
51 |
+
var new_reload = reload_url + "&live-preview-area=" + cache_bust + "&lp-variation-id=" + current_variation_id;
|
52 |
+
jQuery(parent.document).find("#lp-live-preview").attr("src", new_reload);
|
53 |
+
// console.log(new_reload);
|
54 |
+
jQuery(parent.document).find(".lp-load-overlay").fadeOut('slow');
|
55 |
+
}
|
56 |
+
|
57 |
+
});
|
js/admin/tour/tour.post-edit.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
// Post Edit Screen Tour
|
2 |
-
jQuery("#titlewrap").attr({"data-step": "1", "data-intro": 'This is the adminstrative title of your landing. <br>Visitors will not be able to see this. To edit this, simply click on the text.'});
|
3 |
-
jQuery(".nav-tab-wrapper").attr({"data-step": "2", "data-intro": 'This controls the A/B testing functionality of the page.<br>You can toggle back and forth between variations or click the add new variation to start an A/B test.'});
|
4 |
-
jQuery(".new-save-lp-frontend").attr({"data-step": "3", "data-intro": 'This lauches the frontend editor that will allow you to see live previews of your landing page variations and edit the settings on the same screen!'});
|
5 |
-
jQuery(".lp-notes").attr({"data-step": "4", "data-intro": 'Add notes to each of your A/B test variations to keep track of what you are testing.'});
|
6 |
-
jQuery("#main-title-area").attr({"data-step": "5", "data-intro": 'This is the main headline area of your landing page. Make sure your headlines are catchy and have a clear value proposition'});
|
7 |
-
jQuery("#content_InboundShortcodesButton_action").attr({"data-step": "6", "data-intro": '<p>This is the inbound shortcode tool. You can use it to <strong>build forms</strong> and do a number of other cool things!</p>'});
|
8 |
-
jQuery("#lp_ab_display_stats_metabox").attr({"data-step": "7", "data-intro": '<p>This is the main stats box for your landing page variations. Here you will find all of your page views, conversions, and conversion rate numbers.</p><p>A/B Variation controls are also available here.</p><p><strong>Pause:</strong> Paused the current variation from a/b testing</p><p><strong>Edit:</strong> Jump to edit screen of selected variation</p><p><strong>Preview:</strong> Pop open preview window</p><p><strong>Clone:</strong> Clones exact copy of landing page in a new variation</p><p><strong>Delete:</strong> Deletes the variation from landing page</p>'});
|
9 |
-
jQuery("#wp-content-wrap").attr({"data-step": "8", "data-intro": 'This is the main content area of your landing page. Not every landing page template uses this field but most do.'});
|
10 |
-
jQuery("#lp_2_form_content").attr({"data-step": "9", "data-intro": 'The Landing Page Form or Conversion Button area is where you insert your form or link for conversion tracking. This box will accept any shortcodes or html forms inserted.'});
|
11 |
jQuery("#lp_metabox_select_template").attr({"data-step": "9", "data-intro": 'These are the main options that control the currently selected template.'});
|
1 |
+
// Post Edit Screen Tour
|
2 |
+
jQuery("#titlewrap").attr({"data-step": "1", "data-intro": 'This is the adminstrative title of your landing. <br>Visitors will not be able to see this. To edit this, simply click on the text.'});
|
3 |
+
jQuery(".nav-tab-wrapper").attr({"data-step": "2", "data-intro": 'This controls the A/B testing functionality of the page.<br>You can toggle back and forth between variations or click the add new variation to start an A/B test.'});
|
4 |
+
jQuery(".new-save-lp-frontend").attr({"data-step": "3", "data-intro": 'This lauches the frontend editor that will allow you to see live previews of your landing page variations and edit the settings on the same screen!'});
|
5 |
+
jQuery(".lp-notes").attr({"data-step": "4", "data-intro": 'Add notes to each of your A/B test variations to keep track of what you are testing.'});
|
6 |
+
jQuery("#main-title-area").attr({"data-step": "5", "data-intro": 'This is the main headline area of your landing page. Make sure your headlines are catchy and have a clear value proposition'});
|
7 |
+
jQuery("#content_InboundShortcodesButton_action").attr({"data-step": "6", "data-intro": '<p>This is the inbound shortcode tool. You can use it to <strong>build forms</strong> and do a number of other cool things!</p>'});
|
8 |
+
jQuery("#lp_ab_display_stats_metabox").attr({"data-step": "7", "data-intro": '<p>This is the main stats box for your landing page variations. Here you will find all of your page views, conversions, and conversion rate numbers.</p><p>A/B Variation controls are also available here.</p><p><strong>Pause:</strong> Paused the current variation from a/b testing</p><p><strong>Edit:</strong> Jump to edit screen of selected variation</p><p><strong>Preview:</strong> Pop open preview window</p><p><strong>Clone:</strong> Clones exact copy of landing page in a new variation</p><p><strong>Delete:</strong> Deletes the variation from landing page</p>'});
|
9 |
+
jQuery("#wp-content-wrap").attr({"data-step": "8", "data-intro": 'This is the main content area of your landing page. Not every landing page template uses this field but most do.'});
|
10 |
+
jQuery("#lp_2_form_content").attr({"data-step": "9", "data-intro": 'The Landing Page Form or Conversion Button area is where you insert your form or link for conversion tracking. This box will accept any shortcodes or html forms inserted.'});
|
11 |
jQuery("#lp_metabox_select_template").attr({"data-step": "9", "data-intro": 'These are the main options that control the currently selected template.'});
|
js/admin/tour/tour.post-list.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
// Post Edit Screen Tour
|
2 |
-
jQuery(".thumbnail-lander.column-thumbnail-lander:eq(0)").attr({"data-step": "1", "data-intro": 'This is a quick screenshot of your landing page.<br><br> Click on it to see the live version in a popup window here.<br><br> You can preview your a/b variations directly from this view.'});
|
3 |
-
jQuery(".post-title.page-title.column-title:eq(0)").attr({"data-step": "2", "data-intro": '<p>This is the admin title of the landing page. This isn\'t visible to visitors</p><p>You can delete, clone, or clears all of the page stats from here.</p><p><strong>Trash:</strong> Deletes this landing page and places it in the trash</p><p><strong>Edit:</strong> Jump to edit screen of this landing page</p><p><strong>Preview:</strong> Pop open preview window</p><p><strong>Clone:</strong> Clones exact copy of landing page. This includes all current variations.</p><p><strong>Clear Stats:</strong> This will clear all stats for each variation. This cannot be undone.</p>'});
|
4 |
-
jQuery(".stats.column-stats:eq(0)").attr({"data-step": "3", "data-intro": '<p>These are the current stats of your landing page variations.</p><p>If you <strong>hover over the letter</strong> you will be able to preview or jump directly to the edit screen of that particular variation.</p><p>You can also clear indiviudal variation stats from there.</p>'});
|
5 |
-
jQuery("#impressions").attr({"data-step": "4", "data-intro": '<p>This column shows the total number of page views the landing page has. This include all current A/B testing variations.</p>'});
|
6 |
-
jQuery("#actions").attr({"data-step": "5", "data-intro": '<p>This column shows the total number of conversions the landing page has. This include all current A/B testing variations.</p>'});
|
7 |
-
jQuery("#cr").attr({"data-step": "6", "data-intro": '<p>This column shows the total aggregate conversion rate of the landing page. This include all current A/B testing variations.</p>'});
|
8 |
jQuery(".add-new-h2").attr({"data-step": "7", "data-intro": '<p>Thats all folks! Go ahead and create a new landing page and get started!</p>'});
|
1 |
+
// Post Edit Screen Tour
|
2 |
+
jQuery(".thumbnail-lander.column-thumbnail-lander:eq(0)").attr({"data-step": "1", "data-intro": 'This is a quick screenshot of your landing page.<br><br> Click on it to see the live version in a popup window here.<br><br> You can preview your a/b variations directly from this view.'});
|
3 |
+
jQuery(".post-title.page-title.column-title:eq(0)").attr({"data-step": "2", "data-intro": '<p>This is the admin title of the landing page. This isn\'t visible to visitors</p><p>You can delete, clone, or clears all of the page stats from here.</p><p><strong>Trash:</strong> Deletes this landing page and places it in the trash</p><p><strong>Edit:</strong> Jump to edit screen of this landing page</p><p><strong>Preview:</strong> Pop open preview window</p><p><strong>Clone:</strong> Clones exact copy of landing page. This includes all current variations.</p><p><strong>Clear Stats:</strong> This will clear all stats for each variation. This cannot be undone.</p>'});
|
4 |
+
jQuery(".stats.column-stats:eq(0)").attr({"data-step": "3", "data-intro": '<p>These are the current stats of your landing page variations.</p><p>If you <strong>hover over the letter</strong> you will be able to preview or jump directly to the edit screen of that particular variation.</p><p>You can also clear indiviudal variation stats from there.</p>'});
|
5 |
+
jQuery("#impressions").attr({"data-step": "4", "data-intro": '<p>This column shows the total number of page views the landing page has. This include all current A/B testing variations.</p>'});
|
6 |
+
jQuery("#actions").attr({"data-step": "5", "data-intro": '<p>This column shows the total number of conversions the landing page has. This include all current A/B testing variations.</p>'});
|
7 |
+
jQuery("#cr").attr({"data-step": "6", "data-intro": '<p>This column shows the total aggregate conversion rate of the landing page. This include all current A/B testing variations.</p>'});
|
8 |
jQuery(".add-new-h2").attr({"data-step": "7", "data-intro": '<p>Thats all folks! Go ahead and create a new landing page and get started!</p>'});
|
js/ajax.clearstats.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
$( '.clear_stats' ).on( 'click', function() {
|
3 |
$( 'body' ).on( 'click', '.lp-delete-var-stats', function() {
|
4 |
});
|
|
|
5 |
$( '.clear_stats' ).on( 'click', function() {
|
6 |
});
|
|
|
1 |
$( '.clear_stats' ).on( 'click', function() {
|
2 |
$( 'body' ).on( 'click', '.lp-delete-var-stats', function() {
|
3 |
});
|
4 |
+
jQuery(document).ready(function($) {
|
5 |
$( '.clear_stats' ).on( 'click', function() {
|
6 |
});
|
js/customizer.load.js
CHANGED
@@ -1,126 +1,126 @@
|
|
1 |
-
jQuery(document).ready(function ($) {
|
2 |
-
var viewchoice = $.cookie("lp-view-choice");
|
3 |
-
|
4 |
-
var current_page = jQuery("#current_variation_id").text();
|
5 |
-
|
6 |
-
// reload the iframe preview page (for option toggles)
|
7 |
-
jQuery('.variation-lp').on('click', function (event) {
|
8 |
-
variation_is = jQuery(this).attr("id");
|
9 |
-
var original_url = jQuery(parent.document).find("#TB_iframeContent").attr("src");
|
10 |
-
var current_id = jQuery("#current-post-id").text();
|
11 |
-
someURL = original_url;
|
12 |
-
|
13 |
-
splitURL = someURL.split('?');
|
14 |
-
someURL = splitURL[0];
|
15 |
-
new_url = someURL + "?lp-variation-id=" + variation_is + "&iframe_window=on&post_id=" + current_id;
|
16 |
-
jQuery(parent.document).find("#TB_iframeContent").attr("src", new_url);
|
17 |
-
|
18 |
-
});
|
19 |
-
|
20 |
-
|
21 |
-
jQuery('html').addClass('small-html').css('overflow', 'auto').css('padding-bottom', '40px');
|
22 |
-
jQuery('html').width('125%');
|
23 |
-
jQuery('body').height('100%');
|
24 |
-
jQuery('head').append('<link rel="stylesheet" href="/wp-content/plugins/landing-pages/css/customizer-load.css" type="text/css" />');
|
25 |
-
if (viewchoice === "full-size") {
|
26 |
-
jQuery('html').removeClass('small-html');
|
27 |
-
jQuery('html').width('100%');
|
28 |
-
jQuery('body').height('100%');
|
29 |
-
setTimeout(function() {
|
30 |
-
jQuery(parent.document).find('#lp_customizer_options').contents().find(".full-size-view").hide();
|
31 |
-
jQuery(parent.document).find('#lp_customizer_options').contents().find(".shrink-view").show();
|
32 |
-
}, 1000);
|
33 |
-
}
|
34 |
-
|
35 |
-
setTimeout(function () {
|
36 |
-
|
37 |
-
var sidebarwidth = jQuery('#lp_customizer_options').width();
|
38 |
-
var widthfix = jQuery(parent.document).width() - sidebarwidth;
|
39 |
-
|
40 |
-
//console.log('ran');
|
41 |
-
}, 2000);
|
42 |
-
/* Almost working
|
43 |
-
jQuery('.live-preview-area-box, #lp_container_form').on('mouseover', function (event)
|
44 |
-
{
|
45 |
-
var $tgt = jQuery(event.target);
|
46 |
-
var domElement = jQuery(event.target);
|
47 |
-
var current_el_id = jQuery(this).attr('id');
|
48 |
-
var match_color = jQuery(this).css("color");
|
49 |
-
|
50 |
-
jQuery(this).addClass("live-preview-active");
|
51 |
-
|
52 |
-
if ( match_color === "rgb(255, 255, 255)") {
|
53 |
-
jQuery(this).addClass('lp-see-this');
|
54 |
-
}
|
55 |
-
|
56 |
-
var current_el_parent_id = jQuery(this).parent().attr('id');
|
57 |
-
|
58 |
-
if (typeof (current_el_id) != "undefined" && current_el_id !== null)
|
59 |
-
{
|
60 |
-
actual_el = "#" + current_el_id;
|
61 |
-
}
|
62 |
-
else if (typeof (current_el_parent_id) != "undefined" && current_el_parent_id !== null && current_el_parent_id !== "")
|
63 |
-
{
|
64 |
-
var actual_el = "#" + current_el_parent_id;
|
65 |
-
}
|
66 |
-
else
|
67 |
-
{
|
68 |
-
console.log("empty");
|
69 |
-
}
|
70 |
-
//console.log(actual_el);
|
71 |
-
var finding_the_match = jQuery(parent.document).find('#lp_customizer_options').contents().find(actual_el);
|
72 |
-
jQuery(finding_the_match).parent().parent().css("background", "#EBEBEB");
|
73 |
-
|
74 |
-
|
75 |
-
});
|
76 |
-
|
77 |
-
jQuery('.live-preview-area-box, #lp_container_form').on('mouseout', function (event) {
|
78 |
-
var $tgt = jQuery(event.target);
|
79 |
-
var domElement = jQuery(event.target);
|
80 |
-
var match_color = jQuery(this).css("color");
|
81 |
-
|
82 |
-
jQuery(this).removeClass("live-preview-active");
|
83 |
-
|
84 |
-
if ( match_color === "rgb(0, 0, 0)") {
|
85 |
-
jQuery(this).removeClass('lp-see-this');
|
86 |
-
}
|
87 |
-
|
88 |
-
var current_el_id = jQuery(this).attr('id');
|
89 |
-
var current_el_parent_id = jQuery(this).parent().attr('id');
|
90 |
-
|
91 |
-
if (typeof (current_el_id) != "undefined" && current_el_id !== null)
|
92 |
-
{
|
93 |
-
actual_el = "#" + current_el_id;
|
94 |
-
}
|
95 |
-
else if (typeof (current_el_parent_id) != "undefined" && current_el_parent_id !== null && current_el_parent_id !== "")
|
96 |
-
{
|
97 |
-
var actual_el = "#" + current_el_parent_id;
|
98 |
-
}
|
99 |
-
else
|
100 |
-
{
|
101 |
-
console.log("empty");
|
102 |
-
}
|
103 |
-
// console.log(actual_el);
|
104 |
-
var finding_the_match = jQuery(parent.document).find('#lp_customizer_options').contents().find(actual_el);
|
105 |
-
jQuery(finding_the_match).parent().parent().css("background", "white");
|
106 |
-
|
107 |
-
});
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
jQuery('.live-preview-area-box').on('click', function (event)
|
112 |
-
{
|
113 |
-
var $tgt = jQuery(event.target);
|
114 |
-
var domElement = jQuery(event.target);
|
115 |
-
var current_el_id = jQuery(this).attr('id');
|
116 |
-
var click_id = "click-" + current_el_id;
|
117 |
-
var frame_body = jQuery(parent.document).find('#lp_customizer_options').contents().find(click_id);
|
118 |
-
|
119 |
-
console.log(frame_body);
|
120 |
-
//jQuery(parent.document).find('#lp_customizer_options').contents().find(click_id).click();
|
121 |
-
//parent.document.getElementById('lp_customizer_options').contentWindow.MyFunction(click_id, event)
|
122 |
-
|
123 |
-
|
124 |
-
});
|
125 |
-
*/
|
126 |
});
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
var viewchoice = $.cookie("lp-view-choice");
|
3 |
+
|
4 |
+
var current_page = jQuery("#current_variation_id").text();
|
5 |
+
|
6 |
+
// reload the iframe preview page (for option toggles)
|
7 |
+
jQuery('.variation-lp').on('click', function (event) {
|
8 |
+
variation_is = jQuery(this).attr("id");
|
9 |
+
var original_url = jQuery(parent.document).find("#TB_iframeContent").attr("src");
|
10 |
+
var current_id = jQuery("#current-post-id").text();
|
11 |
+
someURL = original_url;
|
12 |
+
|
13 |
+
splitURL = someURL.split('?');
|
14 |
+
someURL = splitURL[0];
|
15 |
+
new_url = someURL + "?lp-variation-id=" + variation_is + "&iframe_window=on&post_id=" + current_id;
|
16 |
+
jQuery(parent.document).find("#TB_iframeContent").attr("src", new_url);
|
17 |
+
|
18 |
+
});
|
19 |
+
|
20 |
+
|
21 |
+
jQuery('html').addClass('small-html').css('overflow', 'auto').css('padding-bottom', '40px');
|
22 |
+
jQuery('html').width('125%');
|
23 |
+
jQuery('body').height('100%');
|
24 |
+
jQuery('head').append('<link rel="stylesheet" href="/wp-content/plugins/landing-pages/css/customizer-load.css" type="text/css" />');
|
25 |
+
if (viewchoice === "full-size") {
|
26 |
+
jQuery('html').removeClass('small-html');
|
27 |
+
jQuery('html').width('100%');
|
28 |
+
jQuery('body').height('100%');
|
29 |
+
setTimeout(function() {
|
30 |
+
jQuery(parent.document).find('#lp_customizer_options').contents().find(".full-size-view").hide();
|
31 |
+
jQuery(parent.document).find('#lp_customizer_options').contents().find(".shrink-view").show();
|
32 |
+
}, 1000);
|
33 |
+
}
|
34 |
+
|
35 |
+
setTimeout(function () {
|
36 |
+
|
37 |
+
var sidebarwidth = jQuery('#lp_customizer_options').width();
|
38 |
+
var widthfix = jQuery(parent.document).width() - sidebarwidth;
|
39 |
+
|
40 |
+
//console.log('ran');
|
41 |
+
}, 2000);
|
42 |
+
/* Almost working
|
43 |
+
jQuery('.live-preview-area-box, #lp_container_form').on('mouseover', function (event)
|
44 |
+
{
|
45 |
+
var $tgt = jQuery(event.target);
|
46 |
+
var domElement = jQuery(event.target);
|
47 |
+
var current_el_id = jQuery(this).attr('id');
|
48 |
+
var match_color = jQuery(this).css("color");
|
49 |
+
|
50 |
+
jQuery(this).addClass("live-preview-active");
|
51 |
+
|
52 |
+
if ( match_color === "rgb(255, 255, 255)") {
|
53 |
+
jQuery(this).addClass('lp-see-this');
|
54 |
+
}
|
55 |
+
|
56 |
+
var current_el_parent_id = jQuery(this).parent().attr('id');
|
57 |
+
|
58 |
+
if (typeof (current_el_id) != "undefined" && current_el_id !== null)
|
59 |
+
{
|
60 |
+
actual_el = "#" + current_el_id;
|
61 |
+
}
|
62 |
+
else if (typeof (current_el_parent_id) != "undefined" && current_el_parent_id !== null && current_el_parent_id !== "")
|
63 |
+
{
|
64 |
+
var actual_el = "#" + current_el_parent_id;
|
65 |
+
}
|
66 |
+
else
|
67 |
+
{
|
68 |
+
console.log("empty");
|
69 |
+
}
|
70 |
+
//console.log(actual_el);
|
71 |
+
var finding_the_match = jQuery(parent.document).find('#lp_customizer_options').contents().find(actual_el);
|
72 |
+
jQuery(finding_the_match).parent().parent().css("background", "#EBEBEB");
|
73 |
+
|
74 |
+
|
75 |
+
});
|
76 |
+
|
77 |
+
jQuery('.live-preview-area-box, #lp_container_form').on('mouseout', function (event) {
|
78 |
+
var $tgt = jQuery(event.target);
|
79 |
+
var domElement = jQuery(event.target);
|
80 |
+
var match_color = jQuery(this).css("color");
|
81 |
+
|
82 |
+
jQuery(this).removeClass("live-preview-active");
|
83 |
+
|
84 |
+
if ( match_color === "rgb(0, 0, 0)") {
|
85 |
+
jQuery(this).removeClass('lp-see-this');
|
86 |
+
}
|
87 |
+
|
88 |
+
var current_el_id = jQuery(this).attr('id');
|
89 |
+
var current_el_parent_id = jQuery(this).parent().attr('id');
|
90 |
+
|
91 |
+
if (typeof (current_el_id) != "undefined" && current_el_id !== null)
|
92 |
+
{
|
93 |
+
actual_el = "#" + current_el_id;
|
94 |
+
}
|
95 |
+
else if (typeof (current_el_parent_id) != "undefined" && current_el_parent_id !== null && current_el_parent_id !== "")
|
96 |
+
{
|
97 |
+
var actual_el = "#" + current_el_parent_id;
|
98 |
+
}
|
99 |
+
else
|
100 |
+
{
|
101 |
+
console.log("empty");
|
102 |
+
}
|
103 |
+
// console.log(actual_el);
|
104 |
+
var finding_the_match = jQuery(parent.document).find('#lp_customizer_options').contents().find(actual_el);
|
105 |
+
jQuery(finding_the_match).parent().parent().css("background", "white");
|
106 |
+
|
107 |
+
});
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
jQuery('.live-preview-area-box').on('click', function (event)
|
112 |
+
{
|
113 |
+
var $tgt = jQuery(event.target);
|
114 |
+
var domElement = jQuery(event.target);
|
115 |
+
var current_el_id = jQuery(this).attr('id');
|
116 |
+
var click_id = "click-" + current_el_id;
|
117 |
+
var frame_body = jQuery(parent.document).find('#lp_customizer_options').contents().find(click_id);
|
118 |
+
|
119 |
+
console.log(frame_body);
|
120 |
+
//jQuery(parent.document).find('#lp_customizer_options').contents().find(click_id).click();
|
121 |
+
//parent.document.getElementById('lp_customizer_options').contentWindow.MyFunction(click_id, event)
|
122 |
+
|
123 |
+
|
124 |
+
});
|
125 |
+
*/
|
126 |
});
|
js/customizer.save.js
CHANGED
@@ -1,472 +1,472 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
|
3 |
-
var window_width = jQuery(window).width();
|
4 |
-
var parent_window = parent.document.width;
|
5 |
-
iframe_size = parent_window * 0.334;
|
6 |
-
new_size = parent_window * 0.70;
|
7 |
-
new_new_size = parent_window - new_size;
|
8 |
-
editor_size = iframe_size * 0.85 + "px";
|
9 |
-
// Resize Functions
|
10 |
-
$("#wp_content_resize, #lp-conversion-area_ifr").height(210);
|
11 |
-
setTimeout(function() {
|
12 |
-
jQuery("#lp-conversion-area_ifr, #lp-conversion-area_tbl, #wp_content_ifr, .mceLayout, .mceIframeContainer iframe").height(150);
|
13 |
-
jQuery(".wp-editor-container table").css("max-width", editor_size);
|
14 |
-
jQuery('iframe').contents().find("body").each(function(){
|
15 |
-
jQuery(this).css("max-width", editor_size);
|
16 |
-
});
|
17 |
-
}, 1000);
|
18 |
-
|
19 |
-
//jQuery("body").width(iframe_size);
|
20 |
-
//jQuery("#wpcontent").width(iframe_size);
|
21 |
-
|
22 |
-
// On keystroke have save button show
|
23 |
-
jQuery('#lp-frontend-options-container input, #lp-frontend-options-container textarea').on("keyup", function (e) {
|
24 |
-
var this_id = jQuery(this).attr("id");
|
25 |
-
var parent_el = jQuery(this).parent();
|
26 |
-
jQuery(parent_el).find(".lp-success-message").remove();
|
27 |
-
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
28 |
-
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
29 |
-
//console.log(parent_el);
|
30 |
-
jQuery(ajax_save_button).appendTo(parent_el);
|
31 |
-
});
|
32 |
-
|
33 |
-
// On change have save button show
|
34 |
-
jQuery('#lp-frontend-options-container input, #lp-frontend-options-container select, #lp-frontend-options-container textarea').on("change", function (e) {
|
35 |
-
var this_id = jQuery(this).attr("id");
|
36 |
-
var parent_el = jQuery(this).parent();
|
37 |
-
jQuery(parent_el).find(".lp-success-message").remove();
|
38 |
-
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
39 |
-
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
40 |
-
//console.log(parent_el);
|
41 |
-
jQuery(ajax_save_button).appendTo(parent_el);
|
42 |
-
});
|
43 |
-
|
44 |
-
// wysiwyg on keyup save action
|
45 |
-
setTimeout(function() {
|
46 |
-
jQuery('.landing-page-option-row iframe').contents().find('body').on("keyup", function (e) {
|
47 |
-
var thisclass = jQuery(this).attr("class");
|
48 |
-
var this_class_dirty = thisclass.replace("mceContentBody ", "");
|
49 |
-
var this_class_cleaner = this_class_dirty.replace("wp-editor", "");
|
50 |
-
var clean_1 = this_class_cleaner.replace("post-type-landing-page", "");
|
51 |
-
var clean_2 = clean_1.replace(/[.\s]+$/g, ""); // remove trailing whitespace
|
52 |
-
var clean_spaces = clean_2.replace(/\s{2,}/g, ' '); // remove more than one space
|
53 |
-
var this_id = clean_spaces.replace(/[.\s]+$/g, ""); // remove trailing whitespace
|
54 |
-
console.log(this_id);
|
55 |
-
var parent_el = jQuery( "." + this_id + " .landing-page-table-header");
|
56 |
-
jQuery(parent_el).find(".lp-success-message").remove();
|
57 |
-
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
58 |
-
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + this_id + '" style="margin-left:10px;">Update</span>');
|
59 |
-
//console.log(parent_el);
|
60 |
-
jQuery(ajax_save_button).appendTo(parent_el);
|
61 |
-
});
|
62 |
-
}, 4000);
|
63 |
-
|
64 |
-
// Prep Data and Save
|
65 |
-
var nonce_val = lp_post_edit_ui.wp_landing_page_meta_nonce; // NEED CORRECT NONCE
|
66 |
-
jQuery(document).on('mousedown', '.new-save-lp-frontend', function () {
|
67 |
-
var type_input = jQuery(this).parent().find("input").attr("type");
|
68 |
-
var type_select = jQuery(this).parent().find("select");
|
69 |
-
// var the_conversion_area_editor = jQuery(this).parent().parent().find('#lp-conversion-area_ifr').length;
|
70 |
-
jQuery(this).parent().find(".lp-success-message").hide();
|
71 |
-
// var the_content_editor = jQuery(this).parent().parent().find('#wp_content_ifr').length;
|
72 |
-
var type_wysiwyg = jQuery(this).parent().parent().find('iframe').length;
|
73 |
-
|
74 |
-
var type_textarea = jQuery(this).parent().find("textarea");
|
75 |
-
if (typeof (type_input) != "undefined" && type_input !== null) {
|
76 |
-
var type_of_field = type_input;
|
77 |
-
} else if (typeof (type_wysiwyg) != "undefined" && type_wysiwyg !== null && type_wysiwyg === 1) {
|
78 |
-
var type_of_field = 'wysiwyg';
|
79 |
-
} else if (typeof (type_textarea) != "undefined" && type_textarea !== null) {
|
80 |
-
var type_of_field = 'textarea';
|
81 |
-
} else {
|
82 |
-
(typeof (type_select) != "undefined" && type_select)
|
83 |
-
var type_of_field = 'select';
|
84 |
-
}
|
85 |
-
// console.log(type_of_field); // type of input
|
86 |
-
var new_value_meta_input = jQuery(this).parent().find("input").val();
|
87 |
-
//console.log(new_value_meta_input);
|
88 |
-
var new_value_meta_select = jQuery(this).parent().find("select").val();
|
89 |
-
var new_value_meta_textarea = jQuery(this).parent().find("textarea").val();
|
90 |
-
// console.log(new_value_meta_select);
|
91 |
-
var new_value_meta_radio = jQuery(this).parent().find("input:checked").val();
|
92 |
-
var new_value_meta_checkbox = jQuery(this).parent().find('input[type="checkbox"]:checked').val();
|
93 |
-
var new_wysiwyg_meta = jQuery(this).parent().parent().find("iframe").contents().find("body").html();
|
94 |
-
// prep data
|
95 |
-
if (typeof (new_value_meta_input) != "undefined" && new_value_meta_input !== null && type_of_field == "text") {
|
96 |
-
var meta_to_save = new_value_meta_input;
|
97 |
-
} else if (typeof (new_value_meta_textarea) != "undefined" && new_value_meta_textarea !== null && type_of_field == "textarea") {
|
98 |
-
var meta_to_save = new_value_meta_textarea;
|
99 |
-
} else if (typeof (new_value_meta_select) != "undefined" && new_value_meta_select !== null) {
|
100 |
-
var meta_to_save = new_value_meta_select;
|
101 |
-
} else if (typeof (new_value_meta_radio) != "undefined" && new_value_meta_radio !== null && type_of_field == "radio") {
|
102 |
-
var meta_to_save = new_value_meta_radio;
|
103 |
-
} else if (typeof (new_value_meta_checkbox) != "undefined" && new_value_meta_checkbox !== null && type_of_field == "checkbox") {
|
104 |
-
var meta_to_save = new_value_meta_checkbox;
|
105 |
-
} else if (typeof (new_wysiwyg_meta) != "undefined" && new_wysiwyg_meta !== null && type_of_field == "wysiwyg") {
|
106 |
-
var meta_to_save = new_wysiwyg_meta;
|
107 |
-
//alert('here');
|
108 |
-
} else {
|
109 |
-
var meta_to_save = "";
|
110 |
-
}
|
111 |
-
|
112 |
-
// if data exists save it
|
113 |
-
// console.log(meta_to_save);
|
114 |
-
|
115 |
-
var this_meta_id = jQuery(this).attr("id"); // From save button
|
116 |
-
console.log(this_meta_id);
|
117 |
-
var post_id = jQuery("#post_ID").text();
|
118 |
-
console.log(post_id);
|
119 |
-
console.log(meta_to_save);
|
120 |
-
|
121 |
-
// Run Ajax
|
122 |
-
jQuery.ajax({
|
123 |
-
type: 'POST',
|
124 |
-
url: lp_post_edit_ui.ajaxurl,
|
125 |
-
context: this,
|
126 |
-
data: {
|
127 |
-
action: 'wp_landing_page_meta_save',
|
128 |
-
meta_id: this_meta_id,
|
129 |
-
new_meta_val: meta_to_save,
|
130 |
-
page_id: post_id,
|
131 |
-
nonce: nonce_val
|
132 |
-
},
|
133 |
-
|
134 |
-
success: function (data) {
|
135 |
-
var self = this;
|
136 |
-
|
137 |
-
//alert(data);
|
138 |
-
// jQuery('.lp-form').unbind('submit').submit();
|
139 |
-
//var worked = '<span class="success-message-map">Success! ' + this_meta_id + ' set to ' + meta_to_save + '</span>';
|
140 |
-
var worked = '<span class="lp-success-message">Updated!</span>';
|
141 |
-
var s_message = jQuery(self).parent();
|
142 |
-
jQuery(worked).appendTo(s_message);
|
143 |
-
jQuery(self).parent().find("lp-success-message").remove();
|
144 |
-
jQuery(self).hide();
|
145 |
-
jQuery('.reload').click();
|
146 |
-
//alert("Changes Saved!");
|
147 |
-
},
|
148 |
-
|
149 |
-
error: function (MLHttpRequest, textStatus, errorThrown) {
|
150 |
-
alert("Ajax not enabled");
|
151 |
-
}
|
152 |
-
});
|
153 |
-
|
154 |
-
//reload_preview();
|
155 |
-
return false;
|
156 |
-
|
157 |
-
});
|
158 |
-
|
159 |
-
function MyFunction(id, this_event)
|
160 |
-
{
|
161 |
-
var anchor = id;
|
162 |
-
element = document.getElementsByTagName("a");
|
163 |
-
console.log(anchor);
|
164 |
-
var anchorid = "#" + anchor;
|
165 |
-
testing = jQuery(anchorid);
|
166 |
-
|
167 |
-
var wrapit = jQuery(anchorid).attr('href');
|
168 |
-
jQuery('html, body').stop().animate({
|
169 |
-
scrollTop: jQuery(anchorid).offset().top - 100
|
170 |
-
}, 500,'easeInOutExpo');
|
171 |
-
/*
|
172 |
-
if you don't want to use the easing effects:
|
173 |
-
$('html, body').stop().animate({
|
174 |
-
scrollTop: $($anchor.attr('href')).offset().top
|
175 |
-
}, 1000);
|
176 |
-
*/
|
177 |
-
this_event.preventDefault();
|
178 |
-
}
|
179 |
-
|
180 |
-
|
181 |
-
jQuery('.full-size-view').on('click', function (event) {
|
182 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find('html').removeClass("small-html");
|
183 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find('html').css("width", "100%");
|
184 |
-
jQuery(this).hide();
|
185 |
-
jQuery('.shrink-view').show();
|
186 |
-
$.cookie("lp-view-choice", "full-size", { path: '/', expires: 7 });
|
187 |
-
});
|
188 |
-
|
189 |
-
jQuery('.shrink-view').on('click', function (event) {
|
190 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find('html').css("width", "125%");
|
191 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find('html').addClass("small-html");
|
192 |
-
jQuery(this).hide();
|
193 |
-
|
194 |
-
jQuery('.full-size-view').show();
|
195 |
-
$.cookie("lp-view-choice", "shrink", { path: '/', expires: 7 });
|
196 |
-
});
|
197 |
-
|
198 |
-
function generate_random_cache_bust(length) {
|
199 |
-
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
|
200 |
-
|
201 |
-
if (! length) {
|
202 |
-
length = Math.floor(Math.random() * chars.length);
|
203 |
-
}
|
204 |
-
|
205 |
-
var str = '';
|
206 |
-
for (var i = 0; i < length; i++) {
|
207 |
-
str += chars[Math.floor(Math.random() * chars.length)];
|
208 |
-
}
|
209 |
-
return str;
|
210 |
-
}
|
211 |
-
|
212 |
-
// reload the iframe preview page (for option toggles)
|
213 |
-
jQuery('.reload').on('click', function (event) {
|
214 |
-
reload_preview();
|
215 |
-
});
|
216 |
-
|
217 |
-
var reload_url = parent.window.location.href;
|
218 |
-
|
219 |
-
//alert(jQuery("#current_variation_id").text());
|
220 |
-
function reload_preview() {
|
221 |
-
var cache_bust = generate_random_cache_bust(35);
|
222 |
-
var reload_url = parent.window.location.href;
|
223 |
-
reload_url = reload_url.replace('template-customize=on','');
|
224 |
-
//alert(reload_url);
|
225 |
-
var current_variation_id = jQuery("#current_variation_id").text();
|
226 |
-
|
227 |
-
// var reload = jQuery(parent.document).find("#lp-live-preview").attr("src");
|
228 |
-
var new_reload = reload_url + "&live-preview-area=" + cache_bust + "&lp-variation-id=" + current_variation_id;
|
229 |
-
jQuery(parent.document).find("#lp-live-preview").attr("src", new_reload);
|
230 |
-
// console.log(new_reload);
|
231 |
-
}
|
232 |
-
|
233 |
-
// need rewrite to include the content and the form area
|
234 |
-
jQuery('.landing-page-option-row').on('mouseover', function (event) {
|
235 |
-
var $tgt = jQuery(event.target);
|
236 |
-
var domElement = jQuery(event.target);
|
237 |
-
var current_el_id = jQuery(this).find('input[type="text"], textarea, select').attr("id");
|
238 |
-
var finding_the_match = jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_el_id);
|
239 |
-
var match_color = jQuery(finding_the_match).css("color");
|
240 |
-
jQuery(finding_the_match).addClass("live-preview-active");
|
241 |
-
if ( match_color === "rgb(255, 255, 255)") {
|
242 |
-
jQuery(finding_the_match).addClass('lp-see-this');
|
243 |
-
}
|
244 |
-
//jQuery(parent.document).find(".introjs-overlay").show();
|
245 |
-
|
246 |
-
});
|
247 |
-
|
248 |
-
|
249 |
-
jQuery('.landing-page-option-row').on('mouseout', function (event) {
|
250 |
-
var $tgt = jQuery(event.target);
|
251 |
-
var domElement = jQuery(event.target);
|
252 |
-
var current_el_id = jQuery(this).find('input[type="text"], textarea, select').attr("id");
|
253 |
-
var finding_the_match = jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_el_id);
|
254 |
-
var match_color = jQuery(finding_the_match).css("color");
|
255 |
-
jQuery(finding_the_match).removeClass("live-preview-active");
|
256 |
-
if ( match_color === "rgb(0, 0, 0)") {
|
257 |
-
jQuery(finding_the_match).removeClass('lp-see-this');
|
258 |
-
}
|
259 |
-
//jQuery(parent.document).find("#new").contents().find(".introjs-overlay").hide();
|
260 |
-
|
261 |
-
});
|
262 |
-
|
263 |
-
jQuery('input[type="text"], textarea, select').each(function(){
|
264 |
-
|
265 |
-
//console.log(current_id);
|
266 |
-
jQuery(this).on("keyup", function (e) {
|
267 |
-
var current_id = jQuery(this).attr("id");
|
268 |
-
var actual_id = "#" + current_id;
|
269 |
-
//var current_id = jQuery(this).attr("id");
|
270 |
-
var current_value_from_page = $(this, parent.document.body).text();
|
271 |
-
//console.log(current_value_from_page);
|
272 |
-
var new_value_show = jQuery(this).val();
|
273 |
-
//console.log(new_value_show);
|
274 |
-
//$(this, parent.document.body).html(new_value_show);
|
275 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
276 |
-
});
|
277 |
-
|
278 |
-
});
|
279 |
-
|
280 |
-
/* On change add revert button
|
281 |
-
jQuery('input[type="text"], textarea, select').each(function(){
|
282 |
-
|
283 |
-
//console.log(current_id);
|
284 |
-
jQuery(this).on("change", function (e) {
|
285 |
-
|
286 |
-
});
|
287 |
-
|
288 |
-
});
|
289 |
-
*/
|
290 |
-
|
291 |
-
|
292 |
-
// Listen to the_content editor
|
293 |
-
setTimeout(function() {
|
294 |
-
jQuery('#wp_content_ifr').contents().find("body").on({
|
295 |
-
keyup: function() {
|
296 |
-
//console.log('new vale');
|
297 |
-
var new_value = jQuery(this).html();
|
298 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find("#the-content").html(new_value);
|
299 |
-
parent_el = jQuery(".the-content-label");
|
300 |
-
jQuery(parent_el).find(".lp-success-message").remove();
|
301 |
-
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
302 |
-
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="the_content" style="margin-left:10px;">Update</span>');
|
303 |
-
jQuery(ajax_save_button).appendTo(parent_el);
|
304 |
-
},
|
305 |
-
// change not working probably need timeout on clicks
|
306 |
-
change: function() {
|
307 |
-
//console.log('change logged');
|
308 |
-
var new_value = jQuery(this).html();
|
309 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find("#the-content").html(new_value);
|
310 |
-
}
|
311 |
-
//jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
312 |
-
});
|
313 |
-
|
314 |
-
}, 4000);
|
315 |
-
|
316 |
-
/* might still need
|
317 |
-
// Listen to form area editor. Note shortcodes won't render correctly
|
318 |
-
setTimeout(function() {
|
319 |
-
jQuery('#lp-conversion-area_ifr').contents().find("body").on({
|
320 |
-
keyup: function() {
|
321 |
-
//console.log('new vale');
|
322 |
-
var new_value = jQuery(this).html();
|
323 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find("#lp-conversion-area").html(new_value);
|
324 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find("#lp_container_form").html(new_value);
|
325 |
-
parent_el = jQuery(".lp-conversion-area-label");
|
326 |
-
jQuery(parent_el).find(".lp-success-message").remove();
|
327 |
-
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
328 |
-
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="lp-conversion-area" style="margin-left:10px;">Update</span>');
|
329 |
-
//console.log(parent_el);
|
330 |
-
|
331 |
-
jQuery(ajax_save_button).appendTo(parent_el);
|
332 |
-
},
|
333 |
-
// change not working probably need timeout on clicks
|
334 |
-
change: function() {
|
335 |
-
//console.log('change logged');
|
336 |
-
var new_value = jQuery(this).html();
|
337 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find("#lp-conversion-area").html(new_value);
|
338 |
-
|
339 |
-
}
|
340 |
-
//jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
341 |
-
});
|
342 |
-
|
343 |
-
}, 3000);
|
344 |
-
*/
|
345 |
-
jQuery('#wp_content').on("keyup", function (e) {
|
346 |
-
//console.log('new vale');
|
347 |
-
var new_value = jQuery(this).text();
|
348 |
-
jQuery(parent.document).find("#lp-live-preview").contents().find("#the-content").html(new_value);
|
349 |
-
//jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
350 |
-
});
|
351 |
-
|
352 |
-
//jQuery(parent.document).find('#lp_customizer_options').contents().find('#wp_content_ifr').contents().find("body").html();
|
353 |
-
|
354 |
-
// Need to resize or insert custom css into media-uploader iframe
|
355 |
-
/*
|
356 |
-
tb_position_two = function() {
|
357 |
-
var tbWindow = $('#TB_window');
|
358 |
-
console.log(tbWindow);
|
359 |
-
|
360 |
-
}
|
361 |
-
*/
|
362 |
-
|
363 |
-
jQuery('#lp-frontend-options-container .upload_image_button').on('click', function (event) {
|
364 |
-
|
365 |
-
//console.log(parent_input);
|
366 |
-
var media_name = jQuery(this).attr('id');
|
367 |
-
media_name = media_name.replace('uploader_','');
|
368 |
-
var parent_el = jQuery(this).parent().parent();
|
369 |
-
jQuery(parent_el).find(".lp-success-message").remove();
|
370 |
-
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
371 |
-
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + media_name + '" style="position: absolute; top: 0px; right: 34px;">Update</span>');
|
372 |
-
setTimeout(function() {
|
373 |
-
jQuery("#TB_iframeContent").contents().find('head').append('<link rel="stylesheet" href="/wp-content/plugins/landing-pages/css/customizer.media-uploader.css" type="text/css" />');
|
374 |
-
}, 500);
|
375 |
-
setTimeout(function() {
|
376 |
-
jQuery("#TB_iframeContent").contents().find('head').append('<link rel="stylesheet" href="/wp-content/plugins/landing-pages/css/customizer.media-uploader.css" type="text/css" />');
|
377 |
-
}, 2000);
|
378 |
-
|
379 |
-
//console.log(parent_el);
|
380 |
-
jQuery(ajax_save_button).appendTo(parent_el);
|
381 |
-
//alert(media_name);
|
382 |
-
jQuery.cookie('media_name', media_name);
|
383 |
-
jQuery.cookie('media_init', 1);
|
384 |
-
tb_show('', 'media-upload.php?type=image&type=image&TB_iframe=true');
|
385 |
-
return false;
|
386 |
-
}
|
387 |
-
);
|
388 |
-
|
389 |
-
window.tb_remove = function()
|
390 |
-
{
|
391 |
-
console.log('new-image-chosen');
|
392 |
-
$("#TB_imageOff").unbind("click");
|
393 |
-
$("#TB_closeWindowButton").unbind("click");
|
394 |
-
$("#TB_window").fadeOut("fast",function(){
|
395 |
-
$('#TB_window,#TB_overlay,#TB_HideSelect').remove();
|
396 |
-
});
|
397 |
-
$("#TB_load").remove();
|
398 |
-
if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
|
399 |
-
$("body","html").css({height: "auto", width: "auto"});
|
400 |
-
$("html").css("overflow","");
|
401 |
-
}
|
402 |
-
document.onkeydown = "";
|
403 |
-
document.onkeyup = "";
|
404 |
-
|
405 |
-
jQuery.cookie('media_init', 0);
|
406 |
-
return false;
|
407 |
-
}
|
408 |
-
|
409 |
-
window.send_to_editor = function(h) {
|
410 |
-
if (jQuery.cookie('media_init')==1)
|
411 |
-
{
|
412 |
-
var imgurl = jQuery('img',h).attr('src');
|
413 |
-
if (!imgurl)
|
414 |
-
{
|
415 |
-
var array = html.match("src=\"(.*?)\"");
|
416 |
-
imgurl = array[1];
|
417 |
-
}
|
418 |
-
//alert(jQuery.cookie('media_name'));
|
419 |
-
jQuery('#' + jQuery.cookie('media_name')).val(imgurl);
|
420 |
-
jQuery.cookie('media_init', 0);
|
421 |
-
tb_remove();
|
422 |
-
}
|
423 |
-
else
|
424 |
-
{
|
425 |
-
var ed, mce = typeof(tinymce) != 'undefined', qt = typeof(QTags) != 'undefined';
|
426 |
-
|
427 |
-
if ( !wpActiveEditor ) {
|
428 |
-
if ( mce && tinymce.activeEditor ) {
|
429 |
-
ed = tinymce.activeEditor;
|
430 |
-
wpActiveEditor = ed.id;
|
431 |
-
} else if ( !qt ) {
|
432 |
-
return false;
|
433 |
-
}
|
434 |
-
} else if ( mce ) {
|
435 |
-
if ( tinymce.activeEditor && (tinymce.activeEditor.id == 'mce_fullscreen' || tinymce.activeEditor.id == 'wp_mce_fullscreen') )
|
436 |
-
ed = tinymce.activeEditor;
|
437 |
-
else
|
438 |
-
ed = tinymce.get(wpActiveEditor);
|
439 |
-
}
|
440 |
-
|
441 |
-
if ( ed && !ed.isHidden() ) {
|
442 |
-
// restore caret position on IE
|
443 |
-
if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
|
444 |
-
ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
|
445 |
-
|
446 |
-
if ( h.indexOf('[caption') === 0 ) {
|
447 |
-
if ( ed.wpSetImgCaption )
|
448 |
-
h = ed.wpSetImgCaption(h);
|
449 |
-
} else if ( h.indexOf('[gallery') === 0 ) {
|
450 |
-
if ( ed.plugins.wpgallery )
|
451 |
-
h = ed.plugins.wpgallery._do_gallery(h);
|
452 |
-
} else if ( h.indexOf('[embed') === 0 ) {
|
453 |
-
if ( ed.plugins.wordpress )
|
454 |
-
h = ed.plugins.wordpress._setEmbed(h);
|
455 |
-
}
|
456 |
-
|
457 |
-
ed.execCommand('mceInsertContent', false, h);
|
458 |
-
} else if ( qt ) {
|
459 |
-
QTags.insertContent(h);
|
460 |
-
} else {
|
461 |
-
document.getElementById(wpActiveEditor).value += h;
|
462 |
-
}
|
463 |
-
|
464 |
-
jQuery.cookie('media_init', 0);
|
465 |
-
|
466 |
-
try{tb_remove();}catch(e){};
|
467 |
-
}
|
468 |
-
}
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
});
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
|
3 |
+
var window_width = jQuery(window).width();
|
4 |
+
var parent_window = parent.document.width;
|
5 |
+
iframe_size = parent_window * 0.334;
|
6 |
+
new_size = parent_window * 0.70;
|
7 |
+
new_new_size = parent_window - new_size;
|
8 |
+
editor_size = iframe_size * 0.85 + "px";
|
9 |
+
// Resize Functions
|
10 |
+
$("#wp_content_resize, #lp-conversion-area_ifr").height(210);
|
11 |
+
setTimeout(function() {
|
12 |
+
jQuery("#lp-conversion-area_ifr, #lp-conversion-area_tbl, #wp_content_ifr, .mceLayout, .mceIframeContainer iframe").height(150);
|
13 |
+
jQuery(".wp-editor-container table").css("max-width", editor_size);
|
14 |
+
jQuery('iframe').contents().find("body").each(function(){
|
15 |
+
jQuery(this).css("max-width", editor_size);
|
16 |
+
});
|
17 |
+
}, 1000);
|
18 |
+
|
19 |
+
//jQuery("body").width(iframe_size);
|
20 |
+
//jQuery("#wpcontent").width(iframe_size);
|
21 |
+
|
22 |
+
// On keystroke have save button show
|
23 |
+
jQuery('#lp-frontend-options-container input, #lp-frontend-options-container textarea').on("keyup", function (e) {
|
24 |
+
var this_id = jQuery(this).attr("id");
|
25 |
+
var parent_el = jQuery(this).parent();
|
26 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
27 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
28 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
29 |
+
//console.log(parent_el);
|
30 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
31 |
+
});
|
32 |
+
|
33 |
+
// On change have save button show
|
34 |
+
jQuery('#lp-frontend-options-container input, #lp-frontend-options-container select, #lp-frontend-options-container textarea').on("change", function (e) {
|
35 |
+
var this_id = jQuery(this).attr("id");
|
36 |
+
var parent_el = jQuery(this).parent();
|
37 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
38 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
39 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
40 |
+
//console.log(parent_el);
|
41 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
42 |
+
});
|
43 |
+
|
44 |
+
// wysiwyg on keyup save action
|
45 |
+
setTimeout(function() {
|
46 |
+
jQuery('.landing-page-option-row iframe').contents().find('body').on("keyup", function (e) {
|
47 |
+
var thisclass = jQuery(this).attr("class");
|
48 |
+
var this_class_dirty = thisclass.replace("mceContentBody ", "");
|
49 |
+
var this_class_cleaner = this_class_dirty.replace("wp-editor", "");
|
50 |
+
var clean_1 = this_class_cleaner.replace("post-type-landing-page", "");
|
51 |
+
var clean_2 = clean_1.replace(/[.\s]+$/g, ""); // remove trailing whitespace
|
52 |
+
var clean_spaces = clean_2.replace(/\s{2,}/g, ' '); // remove more than one space
|
53 |
+
var this_id = clean_spaces.replace(/[.\s]+$/g, ""); // remove trailing whitespace
|
54 |
+
console.log(this_id);
|
55 |
+
var parent_el = jQuery( "." + this_id + " .landing-page-table-header");
|
56 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
57 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
58 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + this_id + '" style="margin-left:10px;">Update</span>');
|
59 |
+
//console.log(parent_el);
|
60 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
61 |
+
});
|
62 |
+
}, 4000);
|
63 |
+
|
64 |
+
// Prep Data and Save
|
65 |
+
var nonce_val = lp_post_edit_ui.wp_landing_page_meta_nonce; // NEED CORRECT NONCE
|
66 |
+
jQuery(document).on('mousedown', '.new-save-lp-frontend', function () {
|
67 |
+
var type_input = jQuery(this).parent().find("input").attr("type");
|
68 |
+
var type_select = jQuery(this).parent().find("select");
|
69 |
+
// var the_conversion_area_editor = jQuery(this).parent().parent().find('#lp-conversion-area_ifr').length;
|
70 |
+
jQuery(this).parent().find(".lp-success-message").hide();
|
71 |
+
// var the_content_editor = jQuery(this).parent().parent().find('#wp_content_ifr').length;
|
72 |
+
var type_wysiwyg = jQuery(this).parent().parent().find('iframe').length;
|
73 |
+
|
74 |
+
var type_textarea = jQuery(this).parent().find("textarea");
|
75 |
+
if (typeof (type_input) != "undefined" && type_input !== null) {
|
76 |
+
var type_of_field = type_input;
|
77 |
+
} else if (typeof (type_wysiwyg) != "undefined" && type_wysiwyg !== null && type_wysiwyg === 1) {
|
78 |
+
var type_of_field = 'wysiwyg';
|
79 |
+
} else if (typeof (type_textarea) != "undefined" && type_textarea !== null) {
|
80 |
+
var type_of_field = 'textarea';
|
81 |
+
} else {
|
82 |
+
(typeof (type_select) != "undefined" && type_select)
|
83 |
+
var type_of_field = 'select';
|
84 |
+
}
|
85 |
+
// console.log(type_of_field); // type of input
|
86 |
+
var new_value_meta_input = jQuery(this).parent().find("input").val();
|
87 |
+
//console.log(new_value_meta_input);
|
88 |
+
var new_value_meta_select = jQuery(this).parent().find("select").val();
|
89 |
+
var new_value_meta_textarea = jQuery(this).parent().find("textarea").val();
|
90 |
+
// console.log(new_value_meta_select);
|
91 |
+
var new_value_meta_radio = jQuery(this).parent().find("input:checked").val();
|
92 |
+
var new_value_meta_checkbox = jQuery(this).parent().find('input[type="checkbox"]:checked').val();
|
93 |
+
var new_wysiwyg_meta = jQuery(this).parent().parent().find("iframe").contents().find("body").html();
|
94 |
+
// prep data
|
95 |
+
if (typeof (new_value_meta_input) != "undefined" && new_value_meta_input !== null && type_of_field == "text") {
|
96 |
+
var meta_to_save = new_value_meta_input;
|
97 |
+
} else if (typeof (new_value_meta_textarea) != "undefined" && new_value_meta_textarea !== null && type_of_field == "textarea") {
|
98 |
+
var meta_to_save = new_value_meta_textarea;
|
99 |
+
} else if (typeof (new_value_meta_select) != "undefined" && new_value_meta_select !== null) {
|
100 |
+
var meta_to_save = new_value_meta_select;
|
101 |
+
} else if (typeof (new_value_meta_radio) != "undefined" && new_value_meta_radio !== null && type_of_field == "radio") {
|
102 |
+
var meta_to_save = new_value_meta_radio;
|
103 |
+
} else if (typeof (new_value_meta_checkbox) != "undefined" && new_value_meta_checkbox !== null && type_of_field == "checkbox") {
|
104 |
+
var meta_to_save = new_value_meta_checkbox;
|
105 |
+
} else if (typeof (new_wysiwyg_meta) != "undefined" && new_wysiwyg_meta !== null && type_of_field == "wysiwyg") {
|
106 |
+
var meta_to_save = new_wysiwyg_meta;
|
107 |
+
//alert('here');
|
108 |
+
} else {
|
109 |
+
var meta_to_save = "";
|
110 |
+
}
|
111 |
+
|
112 |
+
// if data exists save it
|
113 |
+
// console.log(meta_to_save);
|
114 |
+
|
115 |
+
var this_meta_id = jQuery(this).attr("id"); // From save button
|
116 |
+
console.log(this_meta_id);
|
117 |
+
var post_id = jQuery("#post_ID").text();
|
118 |
+
console.log(post_id);
|
119 |
+
console.log(meta_to_save);
|
120 |
+
|
121 |
+
// Run Ajax
|
122 |
+
jQuery.ajax({
|
123 |
+
type: 'POST',
|
124 |
+
url: lp_post_edit_ui.ajaxurl,
|
125 |
+
context: this,
|
126 |
+
data: {
|
127 |
+
action: 'wp_landing_page_meta_save',
|
128 |
+
meta_id: this_meta_id,
|
129 |
+
new_meta_val: meta_to_save,
|
130 |
+
page_id: post_id,
|
131 |
+
nonce: nonce_val
|
132 |
+
},
|
133 |
+
|
134 |
+
success: function (data) {
|
135 |
+
var self = this;
|
136 |
+
|
137 |
+
//alert(data);
|
138 |
+
// jQuery('.lp-form').unbind('submit').submit();
|
139 |
+
//var worked = '<span class="success-message-map">Success! ' + this_meta_id + ' set to ' + meta_to_save + '</span>';
|
140 |
+
var worked = '<span class="lp-success-message">Updated!</span>';
|
141 |
+
var s_message = jQuery(self).parent();
|
142 |
+
jQuery(worked).appendTo(s_message);
|
143 |
+
jQuery(self).parent().find("lp-success-message").remove();
|
144 |
+
jQuery(self).hide();
|
145 |
+
jQuery('.reload').click();
|
146 |
+
//alert("Changes Saved!");
|
147 |
+
},
|
148 |
+
|
149 |
+
error: function (MLHttpRequest, textStatus, errorThrown) {
|
150 |
+
alert("Ajax not enabled");
|
151 |
+
}
|
152 |
+
});
|
153 |
+
|
154 |
+
//reload_preview();
|
155 |
+
return false;
|
156 |
+
|
157 |
+
});
|
158 |
+
|
159 |
+
function MyFunction(id, this_event)
|
160 |
+
{
|
161 |
+
var anchor = id;
|
162 |
+
element = document.getElementsByTagName("a");
|
163 |
+
console.log(anchor);
|
164 |
+
var anchorid = "#" + anchor;
|
165 |
+
testing = jQuery(anchorid);
|
166 |
+
|
167 |
+
var wrapit = jQuery(anchorid).attr('href');
|
168 |
+
jQuery('html, body').stop().animate({
|
169 |
+
scrollTop: jQuery(anchorid).offset().top - 100
|
170 |
+
}, 500,'easeInOutExpo');
|
171 |
+
/*
|
172 |
+
if you don't want to use the easing effects:
|
173 |
+
$('html, body').stop().animate({
|
174 |
+
scrollTop: $($anchor.attr('href')).offset().top
|
175 |
+
}, 1000);
|
176 |
+
*/
|
177 |
+
this_event.preventDefault();
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
jQuery('.full-size-view').on('click', function (event) {
|
182 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find('html').removeClass("small-html");
|
183 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find('html').css("width", "100%");
|
184 |
+
jQuery(this).hide();
|
185 |
+
jQuery('.shrink-view').show();
|
186 |
+
$.cookie("lp-view-choice", "full-size", { path: '/', expires: 7 });
|
187 |
+
});
|
188 |
+
|
189 |
+
jQuery('.shrink-view').on('click', function (event) {
|
190 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find('html').css("width", "125%");
|
191 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find('html').addClass("small-html");
|
192 |
+
jQuery(this).hide();
|
193 |
+
|
194 |
+
jQuery('.full-size-view').show();
|
195 |
+
$.cookie("lp-view-choice", "shrink", { path: '/', expires: 7 });
|
196 |
+
});
|
197 |
+
|
198 |
+
function generate_random_cache_bust(length) {
|
199 |
+
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
|
200 |
+
|
201 |
+
if (! length) {
|
202 |
+
length = Math.floor(Math.random() * chars.length);
|
203 |
+
}
|
204 |
+
|
205 |
+
var str = '';
|
206 |
+
for (var i = 0; i < length; i++) {
|
207 |
+
str += chars[Math.floor(Math.random() * chars.length)];
|
208 |
+
}
|
209 |
+
return str;
|
210 |
+
}
|
211 |
+
|
212 |
+
// reload the iframe preview page (for option toggles)
|
213 |
+
jQuery('.reload').on('click', function (event) {
|
214 |
+
reload_preview();
|
215 |
+
});
|
216 |
+
|
217 |
+
var reload_url = parent.window.location.href;
|
218 |
+
|
219 |
+
//alert(jQuery("#current_variation_id").text());
|
220 |
+
function reload_preview() {
|
221 |
+
var cache_bust = generate_random_cache_bust(35);
|
222 |
+
var reload_url = parent.window.location.href;
|
223 |
+
reload_url = reload_url.replace('template-customize=on','');
|
224 |
+
//alert(reload_url);
|
225 |
+
var current_variation_id = jQuery("#current_variation_id").text();
|
226 |
+
|
227 |
+
// var reload = jQuery(parent.document).find("#lp-live-preview").attr("src");
|
228 |
+
var new_reload = reload_url + "&live-preview-area=" + cache_bust + "&lp-variation-id=" + current_variation_id;
|
229 |
+
jQuery(parent.document).find("#lp-live-preview").attr("src", new_reload);
|
230 |
+
// console.log(new_reload);
|
231 |
+
}
|
232 |
+
|
233 |
+
// need rewrite to include the content and the form area
|
234 |
+
jQuery('.landing-page-option-row').on('mouseover', function (event) {
|
235 |
+
var $tgt = jQuery(event.target);
|
236 |
+
var domElement = jQuery(event.target);
|
237 |
+
var current_el_id = jQuery(this).find('input[type="text"], textarea, select').attr("id");
|
238 |
+
var finding_the_match = jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_el_id);
|
239 |
+
var match_color = jQuery(finding_the_match).css("color");
|
240 |
+
jQuery(finding_the_match).addClass("live-preview-active");
|
241 |
+
if ( match_color === "rgb(255, 255, 255)") {
|
242 |
+
jQuery(finding_the_match).addClass('lp-see-this');
|
243 |
+
}
|
244 |
+
//jQuery(parent.document).find(".introjs-overlay").show();
|
245 |
+
|
246 |
+
});
|
247 |
+
|
248 |
+
|
249 |
+
jQuery('.landing-page-option-row').on('mouseout', function (event) {
|
250 |
+
var $tgt = jQuery(event.target);
|
251 |
+
var domElement = jQuery(event.target);
|
252 |
+
var current_el_id = jQuery(this).find('input[type="text"], textarea, select').attr("id");
|
253 |
+
var finding_the_match = jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_el_id);
|
254 |
+
var match_color = jQuery(finding_the_match).css("color");
|
255 |
+
jQuery(finding_the_match).removeClass("live-preview-active");
|
256 |
+
if ( match_color === "rgb(0, 0, 0)") {
|
257 |
+
jQuery(finding_the_match).removeClass('lp-see-this');
|
258 |
+
}
|
259 |
+
//jQuery(parent.document).find("#new").contents().find(".introjs-overlay").hide();
|
260 |
+
|
261 |
+
});
|
262 |
+
|
263 |
+
jQuery('input[type="text"], textarea, select').each(function(){
|
264 |
+
|
265 |
+
//console.log(current_id);
|
266 |
+
jQuery(this).on("keyup", function (e) {
|
267 |
+
var current_id = jQuery(this).attr("id");
|
268 |
+
var actual_id = "#" + current_id;
|
269 |
+
//var current_id = jQuery(this).attr("id");
|
270 |
+
var current_value_from_page = $(this, parent.document.body).text();
|
271 |
+
//console.log(current_value_from_page);
|
272 |
+
var new_value_show = jQuery(this).val();
|
273 |
+
//console.log(new_value_show);
|
274 |
+
//$(this, parent.document.body).html(new_value_show);
|
275 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
276 |
+
});
|
277 |
+
|
278 |
+
});
|
279 |
+
|
280 |
+
/* On change add revert button
|
281 |
+
jQuery('input[type="text"], textarea, select').each(function(){
|
282 |
+
|
283 |
+
//console.log(current_id);
|
284 |
+
jQuery(this).on("change", function (e) {
|
285 |
+
|
286 |
+
});
|
287 |
+
|
288 |
+
});
|
289 |
+
*/
|
290 |
+
|
291 |
+
|
292 |
+
// Listen to the_content editor
|
293 |
+
setTimeout(function() {
|
294 |
+
jQuery('#wp_content_ifr').contents().find("body").on({
|
295 |
+
keyup: function() {
|
296 |
+
//console.log('new vale');
|
297 |
+
var new_value = jQuery(this).html();
|
298 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#the-content").html(new_value);
|
299 |
+
parent_el = jQuery(".the-content-label");
|
300 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
301 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
302 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="the_content" style="margin-left:10px;">Update</span>');
|
303 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
304 |
+
},
|
305 |
+
// change not working probably need timeout on clicks
|
306 |
+
change: function() {
|
307 |
+
//console.log('change logged');
|
308 |
+
var new_value = jQuery(this).html();
|
309 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#the-content").html(new_value);
|
310 |
+
}
|
311 |
+
//jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
312 |
+
});
|
313 |
+
|
314 |
+
}, 4000);
|
315 |
+
|
316 |
+
/* might still need
|
317 |
+
// Listen to form area editor. Note shortcodes won't render correctly
|
318 |
+
setTimeout(function() {
|
319 |
+
jQuery('#lp-conversion-area_ifr').contents().find("body").on({
|
320 |
+
keyup: function() {
|
321 |
+
//console.log('new vale');
|
322 |
+
var new_value = jQuery(this).html();
|
323 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#lp-conversion-area").html(new_value);
|
324 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#lp_container_form").html(new_value);
|
325 |
+
parent_el = jQuery(".lp-conversion-area-label");
|
326 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
327 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
328 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="lp-conversion-area" style="margin-left:10px;">Update</span>');
|
329 |
+
//console.log(parent_el);
|
330 |
+
|
331 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
332 |
+
},
|
333 |
+
// change not working probably need timeout on clicks
|
334 |
+
change: function() {
|
335 |
+
//console.log('change logged');
|
336 |
+
var new_value = jQuery(this).html();
|
337 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#lp-conversion-area").html(new_value);
|
338 |
+
|
339 |
+
}
|
340 |
+
//jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
341 |
+
});
|
342 |
+
|
343 |
+
}, 3000);
|
344 |
+
*/
|
345 |
+
jQuery('#wp_content').on("keyup", function (e) {
|
346 |
+
//console.log('new vale');
|
347 |
+
var new_value = jQuery(this).text();
|
348 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#the-content").html(new_value);
|
349 |
+
//jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
350 |
+
});
|
351 |
+
|
352 |
+
//jQuery(parent.document).find('#lp_customizer_options').contents().find('#wp_content_ifr').contents().find("body").html();
|
353 |
+
|
354 |
+
// Need to resize or insert custom css into media-uploader iframe
|
355 |
+
/*
|
356 |
+
tb_position_two = function() {
|
357 |
+
var tbWindow = $('#TB_window');
|
358 |
+
console.log(tbWindow);
|
359 |
+
|
360 |
+
}
|
361 |
+
*/
|
362 |
+
|
363 |
+
jQuery('#lp-frontend-options-container .upload_image_button').on('click', function (event) {
|
364 |
+
|
365 |
+
//console.log(parent_input);
|
366 |
+
var media_name = jQuery(this).attr('id');
|
367 |
+
media_name = media_name.replace('uploader_','');
|
368 |
+
var parent_el = jQuery(this).parent().parent();
|
369 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
370 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
371 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + media_name + '" style="position: absolute; top: 0px; right: 34px;">Update</span>');
|
372 |
+
setTimeout(function() {
|
373 |
+
jQuery("#TB_iframeContent").contents().find('head').append('<link rel="stylesheet" href="/wp-content/plugins/landing-pages/css/customizer.media-uploader.css" type="text/css" />');
|
374 |
+
}, 500);
|
375 |
+
setTimeout(function() {
|
376 |
+
jQuery("#TB_iframeContent").contents().find('head').append('<link rel="stylesheet" href="/wp-content/plugins/landing-pages/css/customizer.media-uploader.css" type="text/css" />');
|
377 |
+
}, 2000);
|
378 |
+
|
379 |
+
//console.log(parent_el);
|
380 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
381 |
+
//alert(media_name);
|
382 |
+
jQuery.cookie('media_name', media_name);
|
383 |
+
jQuery.cookie('media_init', 1);
|
384 |
+
tb_show('', 'media-upload.php?type=image&type=image&TB_iframe=true');
|
385 |
+
return false;
|
386 |
+
}
|
387 |
+
);
|
388 |
+
|
389 |
+
window.tb_remove = function()
|
390 |
+
{
|
391 |
+
console.log('new-image-chosen');
|
392 |
+
$("#TB_imageOff").unbind("click");
|
393 |
+
$("#TB_closeWindowButton").unbind("click");
|
394 |
+
$("#TB_window").fadeOut("fast",function(){
|
395 |
+
$('#TB_window,#TB_overlay,#TB_HideSelect').remove();
|
396 |
+
});
|
397 |
+
$("#TB_load").remove();
|
398 |
+
if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
|
399 |
+
$("body","html").css({height: "auto", width: "auto"});
|
400 |
+
$("html").css("overflow","");
|
401 |
+
}
|
402 |
+
document.onkeydown = "";
|
403 |
+
document.onkeyup = "";
|
404 |
+
|
405 |
+
jQuery.cookie('media_init', 0);
|
406 |
+
return false;
|
407 |
+
}
|
408 |
+
|
409 |
+
window.send_to_editor = function(h) {
|
410 |
+
if (jQuery.cookie('media_init')==1)
|
411 |
+
{
|
412 |
+
var imgurl = jQuery('img',h).attr('src');
|
413 |
+
if (!imgurl)
|
414 |
+
{
|
415 |
+
var array = html.match("src=\"(.*?)\"");
|
416 |
+
imgurl = array[1];
|
417 |
+
}
|
418 |
+
//alert(jQuery.cookie('media_name'));
|
419 |
+
jQuery('#' + jQuery.cookie('media_name')).val(imgurl);
|
420 |
+
jQuery.cookie('media_init', 0);
|
421 |
+
tb_remove();
|
422 |
+
}
|
423 |
+
else
|
424 |
+
{
|
425 |
+
var ed, mce = typeof(tinymce) != 'undefined', qt = typeof(QTags) != 'undefined';
|
426 |
+
|
427 |
+
if ( !wpActiveEditor ) {
|
428 |
+
if ( mce && tinymce.activeEditor ) {
|
429 |
+
ed = tinymce.activeEditor;
|
430 |
+
wpActiveEditor = ed.id;
|
431 |
+
} else if ( !qt ) {
|
432 |
+
return false;
|
433 |
+
}
|
434 |
+
} else if ( mce ) {
|
435 |
+
if ( tinymce.activeEditor && (tinymce.activeEditor.id == 'mce_fullscreen' || tinymce.activeEditor.id == 'wp_mce_fullscreen') )
|
436 |
+
ed = tinymce.activeEditor;
|
437 |
+
else
|
438 |
+
ed = tinymce.get(wpActiveEditor);
|
439 |
+
}
|
440 |
+
|
441 |
+
if ( ed && !ed.isHidden() ) {
|
442 |
+
// restore caret position on IE
|
443 |
+
if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
|
444 |
+
ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
|
445 |
+
|
446 |
+
if ( h.indexOf('[caption') === 0 ) {
|
447 |
+
if ( ed.wpSetImgCaption )
|
448 |
+
h = ed.wpSetImgCaption(h);
|
449 |
+
} else if ( h.indexOf('[gallery') === 0 ) {
|
450 |
+
if ( ed.plugins.wpgallery )
|
451 |
+
h = ed.plugins.wpgallery._do_gallery(h);
|
452 |
+
} else if ( h.indexOf('[embed') === 0 ) {
|
453 |
+
if ( ed.plugins.wordpress )
|
454 |
+
h = ed.plugins.wordpress._setEmbed(h);
|
455 |
+
}
|
456 |
+
|
457 |
+
ed.execCommand('mceInsertContent', false, h);
|
458 |
+
} else if ( qt ) {
|
459 |
+
QTags.insertContent(h);
|
460 |
+
} else {
|
461 |
+
document.getElementById(wpActiveEditor).value += h;
|
462 |
+
}
|
463 |
+
|
464 |
+
jQuery.cookie('media_init', 0);
|
465 |
+
|
466 |
+
try{tb_remove();}catch(e){};
|
467 |
+
}
|
468 |
+
}
|
469 |
+
|
470 |
+
|
471 |
+
|
472 |
+
});
|
js/jquery.form-population.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function wpl_remember_inputs( selector ){
|
2 |
jQuery(selector).each(
|
3 |
function(){
|
4 |
//if this item has been cookied, restore it
|
5 |
var name = jQuery(this).attr('name');
|
6 |
|
7 |
if( jQuery.cookie( name ) && type_input != 'submit' && type_input != 'hidden' ){
|
8 |
jQuery(this).val( jQuery.cookie(name) );
|
9 |
}
|
10 |
//assign a change function to the item to cookie it
|
11 |
jQuery(this).change(
|
12 |
function(){
|
13 |
jQuery.cookie(name, jQuery(this).val(), { path: '/', expires: 365 });
|
14 |
}
|
15 |
);
|
16 |
}
|
17 |
);
|
18 |
jQuery(selector).each(
|
19 |
function(){
|
20 |
var form_name = jQuery(this).attr('name');
|
21 |
var form_id = jQuery(this).attr('id');
|
22 |
var form_class = jQuery(this).attr('class');
|
23 |
if(typeof(form_name) != "undefined" && form_name !== null) {
|
24 |
jQuery.cookie("lp_form_uid", form_name, { path: '/', expires: 365 });
|
25 |
}
|
26 |
else if(typeof(form_id) != "undefined" && form_id !== null) {
|
27 |
jQuery.cookie("lp_form_uid", form_id, { path: '/', expires: 365 });
|
28 |
}
|
29 |
else if (typeof(form_class) != "undefined" && form_class !== null) {
|
30 |
jQuery.cookie("lp_form_uid", form_class, { path: '/', expires: 365 });
|
31 |
} else {
|
32 |
jQuery.cookie("lp_form_uid", 'form_generic', { path: '/', expires: 365 });
|
33 |
}
|
34 |
}
|
35 |
);
|
36 |
// Fill Form Inputs from Cookies
|
37 |
});
|
|
|
38 |
jQuery(selector).each(
|
39 |
function(){
|
40 |
//if this item has been cookied, restore it
|
41 |
var name = ( jQuery(this).attr('name') ) ? jQuery(this).attr('name') : '';
|
42 |
if( jQuery.cookie( name ) && type_input != 'submit' && type_input != 'hidden' && type_input != 'file' && name != 'comment' ){
|
43 |
jQuery(this).val( jQuery.cookie(name) );
|
44 |
}
|
45 |
//assign a change function to the item to cookie it
|
46 |
jQuery(this).change(
|
47 |
function(){
|
48 |
jQuery.cookie(name, jQuery(this).val(), { path: '/', expires: 365 });
|
49 |
}
|
50 |
);
|
51 |
}
|
52 |
);
|
53 |
jQuery(selector).each(
|
54 |
function(){
|
55 |
var form_name = jQuery(this).attr('name');
|
56 |
var form_id = jQuery(this).attr('id');
|
57 |
var form_class = jQuery(this).attr('class');
|
58 |
if(typeof(form_name) != "undefined" && form_name !== null) {
|
59 |
jQuery.cookie("lp_form_uid", form_name, { path: '/', expires: 365 });
|
60 |
}
|
61 |
else if(typeof(form_id) != "undefined" && form_id !== null) {
|
62 |
jQuery.cookie("lp_form_uid", form_id, { path: '/', expires: 365 });
|
63 |
}
|
64 |
else if (typeof(form_class) != "undefined" && form_class !== null) {
|
65 |
jQuery.cookie("lp_form_uid", form_class, { path: '/', expires: 365 });
|
66 |
} else {
|
67 |
jQuery.cookie("lp_form_uid", 'form_generic', { path: '/', expires: 365 });
|
68 |
}
|
69 |
}
|
70 |
);
|
71 |
// Fill Form Inputs from Cookies
|
72 |
});
|
|
|
1 |
jQuery(selector).each(
|
2 |
function(){
|
3 |
//if this item has been cookied, restore it
|
4 |
var name = jQuery(this).attr('name');
|
5 |
|
6 |
if( jQuery.cookie( name ) && type_input != 'submit' && type_input != 'hidden' ){
|
7 |
jQuery(this).val( jQuery.cookie(name) );
|
8 |
}
|
9 |
//assign a change function to the item to cookie it
|
10 |
jQuery(this).change(
|
11 |
function(){
|
12 |
jQuery.cookie(name, jQuery(this).val(), { path: '/', expires: 365 });
|
13 |
}
|
14 |
);
|
15 |
}
|
16 |
);
|
17 |
jQuery(selector).each(
|
18 |
function(){
|
19 |
var form_name = jQuery(this).attr('name');
|
20 |
var form_id = jQuery(this).attr('id');
|
21 |
var form_class = jQuery(this).attr('class');
|
22 |
if(typeof(form_name) != "undefined" && form_name !== null) {
|
23 |
jQuery.cookie("lp_form_uid", form_name, { path: '/', expires: 365 });
|
24 |
}
|
25 |
else if(typeof(form_id) != "undefined" && form_id !== null) {
|
26 |
jQuery.cookie("lp_form_uid", form_id, { path: '/', expires: 365 });
|
27 |
}
|
28 |
else if (typeof(form_class) != "undefined" && form_class !== null) {
|
29 |
jQuery.cookie("lp_form_uid", form_class, { path: '/', expires: 365 });
|
30 |
} else {
|
31 |
jQuery.cookie("lp_form_uid", 'form_generic', { path: '/', expires: 365 });
|
32 |
}
|
33 |
}
|
34 |
);
|
35 |
// Fill Form Inputs from Cookies
|
36 |
});
|
37 |
+
function wpl_remember_inputs( selector ){
|
38 |
jQuery(selector).each(
|
39 |
function(){
|
40 |
//if this item has been cookied, restore it
|
41 |
var name = ( jQuery(this).attr('name') ) ? jQuery(this).attr('name') : '';
|
42 |
if( jQuery.cookie( name ) && type_input != 'submit' && type_input != 'hidden' && type_input != 'file' && name != 'comment' ){
|
43 |
jQuery(this).val( jQuery.cookie(name) );
|
44 |
}
|
45 |
//assign a change function to the item to cookie it
|
46 |
jQuery(this).change(
|
47 |
function(){
|
48 |
jQuery.cookie(name, jQuery(this).val(), { path: '/', expires: 365 });
|
49 |
}
|
50 |
);
|
51 |
}
|
52 |
);
|
53 |
jQuery(selector).each(
|
54 |
function(){
|
55 |
var form_name = jQuery(this).attr('name');
|
56 |
var form_id = jQuery(this).attr('id');
|
57 |
var form_class = jQuery(this).attr('class');
|
58 |
if(typeof(form_name) != "undefined" && form_name !== null) {
|
59 |
jQuery.cookie("lp_form_uid", form_name, { path: '/', expires: 365 });
|
60 |
}
|
61 |
else if(typeof(form_id) != "undefined" && form_id !== null) {
|
62 |
jQuery.cookie("lp_form_uid", form_id, { path: '/', expires: 365 });
|
63 |
}
|
64 |
else if (typeof(form_class) != "undefined" && form_class !== null) {
|
65 |
jQuery.cookie("lp_form_uid", form_class, { path: '/', expires: 365 });
|
66 |
} else {
|
67 |
jQuery.cookie("lp_form_uid", 'form_generic', { path: '/', expires: 365 });
|
68 |
}
|
69 |
}
|
70 |
);
|
71 |
// Fill Form Inputs from Cookies
|
72 |
});
|
js/jquery.tablesorter.js
CHANGED
@@ -1,1031 +1,1031 @@
|
|
1 |
-
/*
|
2 |
-
*
|
3 |
-
* TableSorter 2.0 - Client-side table sorting with ease!
|
4 |
-
* Version 2.0.5b
|
5 |
-
* @requires jQuery v1.2.3
|
6 |
-
*
|
7 |
-
* Copyright (c) 2007 Christian Bach
|
8 |
-
* Examples and docs at: http://tablesorter.com
|
9 |
-
* Dual licensed under the MIT and GPL licenses:
|
10 |
-
* http://www.opensource.org/licenses/mit-license.php
|
11 |
-
* http://www.gnu.org/licenses/gpl.html
|
12 |
-
*
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
*
|
16 |
-
* @description Create a sortable table with multi-column sorting capabilitys
|
17 |
-
*
|
18 |
-
* @example $('table').tablesorter();
|
19 |
-
* @desc Create a simple tablesorter interface.
|
20 |
-
*
|
21 |
-
* @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
|
22 |
-
* @desc Create a tablesorter interface and sort on the first and secound column column headers.
|
23 |
-
*
|
24 |
-
* @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
|
25 |
-
*
|
26 |
-
* @desc Create a tablesorter interface and disableing the first and second column headers.
|
27 |
-
*
|
28 |
-
*
|
29 |
-
* @example $('table').tablesorter({ headers: { 0: {sorter:"integer"}, 1: {sorter:"currency"} } });
|
30 |
-
*
|
31 |
-
* @desc Create a tablesorter interface and set a column parser for the first
|
32 |
-
* and second column.
|
33 |
-
*
|
34 |
-
*
|
35 |
-
* @param Object
|
36 |
-
* settings An object literal containing key/value pairs to provide
|
37 |
-
* optional settings.
|
38 |
-
*
|
39 |
-
*
|
40 |
-
* @option String cssHeader (optional) A string of the class name to be appended
|
41 |
-
* to sortable tr elements in the thead of the table. Default value:
|
42 |
-
* "header"
|
43 |
-
*
|
44 |
-
* @option String cssAsc (optional) A string of the class name to be appended to
|
45 |
-
* sortable tr elements in the thead on a ascending sort. Default value:
|
46 |
-
* "headerSortUp"
|
47 |
-
*
|
48 |
-
* @option String cssDesc (optional) A string of the class name to be appended
|
49 |
-
* to sortable tr elements in the thead on a descending sort. Default
|
50 |
-
* value: "headerSortDown"
|
51 |
-
*
|
52 |
-
* @option String sortInitialOrder (optional) A string of the inital sorting
|
53 |
-
* order can be asc or desc. Default value: "asc"
|
54 |
-
*
|
55 |
-
* @option String sortMultisortKey (optional) A string of the multi-column sort
|
56 |
-
* key. Default value: "shiftKey"
|
57 |
-
*
|
58 |
-
* @option String textExtraction (optional) A string of the text-extraction
|
59 |
-
* method to use. For complex html structures inside td cell set this
|
60 |
-
* option to "complex", on large tables the complex option can be slow.
|
61 |
-
* Default value: "simple"
|
62 |
-
*
|
63 |
-
* @option Object headers (optional) An array containing the forces sorting
|
64 |
-
* rules. This option let's you specify a default sorting rule. Default
|
65 |
-
* value: null
|
66 |
-
*
|
67 |
-
* @option Array sortList (optional) An array containing the forces sorting
|
68 |
-
* rules. This option let's you specify a default sorting rule. Default
|
69 |
-
* value: null
|
70 |
-
*
|
71 |
-
* @option Array sortForce (optional) An array containing forced sorting rules.
|
72 |
-
* This option let's you specify a default sorting rule, which is
|
73 |
-
* prepended to user-selected rules. Default value: null
|
74 |
-
*
|
75 |
-
* @option Boolean sortLocaleCompare (optional) Boolean flag indicating whatever
|
76 |
-
* to use String.localeCampare method or not. Default set to true.
|
77 |
-
*
|
78 |
-
*
|
79 |
-
* @option Array sortAppend (optional) An array containing forced sorting rules.
|
80 |
-
* This option let's you specify a default sorting rule, which is
|
81 |
-
* appended to user-selected rules. Default value: null
|
82 |
-
*
|
83 |
-
* @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter
|
84 |
-
* should apply fixed widths to the table columns. This is usefull when
|
85 |
-
* using the pager companion plugin. This options requires the dimension
|
86 |
-
* jquery plugin. Default value: false
|
87 |
-
*
|
88 |
-
* @option Boolean cancelSelection (optional) Boolean flag indicating if
|
89 |
-
* tablesorter should cancel selection of the table headers text.
|
90 |
-
* Default value: true
|
91 |
-
*
|
92 |
-
* @option Boolean debug (optional) Boolean flag indicating if tablesorter
|
93 |
-
* should display debuging information usefull for development.
|
94 |
-
*
|
95 |
-
* @type jQuery
|
96 |
-
*
|
97 |
-
* @name tablesorter
|
98 |
-
*
|
99 |
-
* @cat Plugins/Tablesorter
|
100 |
-
*
|
101 |
-
* @author Christian Bach/christian.bach@polyester.se
|
102 |
-
*/
|
103 |
-
|
104 |
-
(function ($) {
|
105 |
-
$.extend({
|
106 |
-
tablesorter: new
|
107 |
-
function () {
|
108 |
-
|
109 |
-
var parsers = [],
|
110 |
-
widgets = [];
|
111 |
-
|
112 |
-
this.defaults = {
|
113 |
-
cssHeader: "header",
|
114 |
-
cssAsc: "headerSortUp",
|
115 |
-
cssDesc: "headerSortDown",
|
116 |
-
cssChildRow: "expand-child",
|
117 |
-
sortInitialOrder: "asc",
|
118 |
-
sortMultiSortKey: "shiftKey",
|
119 |
-
sortForce: null,
|
120 |
-
sortAppend: null,
|
121 |
-
sortLocaleCompare: true,
|
122 |
-
textExtraction: "simple",
|
123 |
-
parsers: {}, widgets: [],
|
124 |
-
widgetZebra: {
|
125 |
-
css: ["even", "odd"]
|
126 |
-
}, headers: {}, widthFixed: false,
|
127 |
-
cancelSelection: true,
|
128 |
-
sortList: [],
|
129 |
-
headerList: [],
|
130 |
-
dateFormat: "us",
|
131 |
-
decimal: '/\.|\,/g',
|
132 |
-
onRenderHeader: null,
|
133 |
-
selectorHeaders: 'thead th',
|
134 |
-
debug: false
|
135 |
-
};
|
136 |
-
|
137 |
-
/* debuging utils */
|
138 |
-
|
139 |
-
function benchmark(s, d) {
|
140 |
-
log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
|
141 |
-
}
|
142 |
-
|
143 |
-
this.benchmark = benchmark;
|
144 |
-
|
145 |
-
function log(s) {
|
146 |
-
if (typeof console != "undefined" && typeof console.debug != "undefined") {
|
147 |
-
console.log(s);
|
148 |
-
} else {
|
149 |
-
alert(s);
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
/* parsers utils */
|
154 |
-
|
155 |
-
function buildParserCache(table, $headers) {
|
156 |
-
|
157 |
-
if (table.config.debug) {
|
158 |
-
var parsersDebug = "";
|
159 |
-
}
|
160 |
-
|
161 |
-
if (table.tBodies.length == 0) return; // In the case of empty tables
|
162 |
-
var rows = table.tBodies[0].rows;
|
163 |
-
|
164 |
-
if (rows[0]) {
|
165 |
-
|
166 |
-
var list = [],
|
167 |
-
cells = rows[0].cells,
|
168 |
-
l = cells.length;
|
169 |
-
|
170 |
-
for (var i = 0; i < l; i++) {
|
171 |
-
|
172 |
-
var p = false;
|
173 |
-
|
174 |
-
if ($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter)) {
|
175 |
-
|
176 |
-
p = getParserById($($headers[i]).metadata().sorter);
|
177 |
-
|
178 |
-
} else if ((table.config.headers[i] && table.config.headers[i].sorter)) {
|
179 |
-
|
180 |
-
p = getParserById(table.config.headers[i].sorter);
|
181 |
-
}
|
182 |
-
if (!p) {
|
183 |
-
|
184 |
-
p = detectParserForColumn(table, rows, -1, i);
|
185 |
-
}
|
186 |
-
|
187 |
-
if (table.config.debug) {
|
188 |
-
parsersDebug += "column:" + i + " parser:" + p.id + "\n";
|
189 |
-
}
|
190 |
-
|
191 |
-
list.push(p);
|
192 |
-
}
|
193 |
-
}
|
194 |
-
|
195 |
-
if (table.config.debug) {
|
196 |
-
log(parsersDebug);
|
197 |
-
}
|
198 |
-
|
199 |
-
return list;
|
200 |
-
};
|
201 |
-
|
202 |
-
function detectParserForColumn(table, rows, rowIndex, cellIndex) {
|
203 |
-
var l = parsers.length,
|
204 |
-
node = false,
|
205 |
-
nodeValue = false,
|
206 |
-
keepLooking = true;
|
207 |
-
while (nodeValue == '' && keepLooking) {
|
208 |
-
rowIndex++;
|
209 |
-
if (rows[rowIndex]) {
|
210 |
-
node = getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex);
|
211 |
-
nodeValue = trimAndGetNodeText(table.config, node);
|
212 |
-
if (table.config.debug) {
|
213 |
-
log('Checking if value was empty on row:' + rowIndex);
|
214 |
-
}
|
215 |
-
} else {
|
216 |
-
keepLooking = false;
|
217 |
-
}
|
218 |
-
}
|
219 |
-
for (var i = 1; i < l; i++) {
|
220 |
-
if (parsers[i].is(nodeValue, table, node)) {
|
221 |
-
return parsers[i];
|
222 |
-
}
|
223 |
-
}
|
224 |
-
// 0 is always the generic parser (text)
|
225 |
-
return parsers[0];
|
226 |
-
}
|
227 |
-
|
228 |
-
function getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex) {
|
229 |
-
return rows[rowIndex].cells[cellIndex];
|
230 |
-
}
|
231 |
-
|
232 |
-
function trimAndGetNodeText(config, node) {
|
233 |
-
return $.trim(getElementText(config, node));
|
234 |
-
}
|
235 |
-
|
236 |
-
function getParserById(name) {
|
237 |
-
var l = parsers.length;
|
238 |
-
for (var i = 0; i < l; i++) {
|
239 |
-
if (parsers[i].id.toLowerCase() == name.toLowerCase()) {
|
240 |
-
return parsers[i];
|
241 |
-
}
|
242 |
-
}
|
243 |
-
return false;
|
244 |
-
}
|
245 |
-
|
246 |
-
/* utils */
|
247 |
-
|
248 |
-
function buildCache(table) {
|
249 |
-
|
250 |
-
if (table.config.debug) {
|
251 |
-
var cacheTime = new Date();
|
252 |
-
}
|
253 |
-
|
254 |
-
var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
|
255 |
-
totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0,
|
256 |
-
parsers = table.config.parsers,
|
257 |
-
cache = {
|
258 |
-
row: [],
|
259 |
-
normalized: []
|
260 |
-
};
|
261 |
-
|
262 |
-
for (var i = 0; i < totalRows; ++i) {
|
263 |
-
|
264 |
-
/** Add the table data to main data array */
|
265 |
-
var c = $(table.tBodies[0].rows[i]),
|
266 |
-
cols = [];
|
267 |
-
|
268 |
-
// if this is a child row, add it to the last row's children and
|
269 |
-
// continue to the next row
|
270 |
-
if (c.hasClass(table.config.cssChildRow)) {
|
271 |
-
cache.row[cache.row.length - 1] = cache.row[cache.row.length - 1].add(c);
|
272 |
-
// go to the next for loop
|
273 |
-
continue;
|
274 |
-
}
|
275 |
-
|
276 |
-
cache.row.push(c);
|
277 |
-
|
278 |
-
for (var j = 0; j < totalCells; ++j) {
|
279 |
-
cols.push(parsers[j].format(getElementText(table.config, c[0].cells[j]), table, c[0].cells[j]));
|
280 |
-
}
|
281 |
-
|
282 |
-
cols.push(cache.normalized.length); // add position for rowCache
|
283 |
-
cache.normalized.push(cols);
|
284 |
-
cols = null;
|
285 |
-
};
|
286 |
-
|
287 |
-
if (table.config.debug) {
|
288 |
-
benchmark("Building cache for " + totalRows + " rows:", cacheTime);
|
289 |
-
}
|
290 |
-
|
291 |
-
return cache;
|
292 |
-
};
|
293 |
-
|
294 |
-
function getElementText(config, node) {
|
295 |
-
|
296 |
-
var text = "";
|
297 |
-
|
298 |
-
if (!node) return "";
|
299 |
-
|
300 |
-
if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false;
|
301 |
-
|
302 |
-
if (config.textExtraction == "simple") {
|
303 |
-
if (config.supportsTextContent) {
|
304 |
-
text = node.textContent;
|
305 |
-
} else {
|
306 |
-
if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
|
307 |
-
text = node.childNodes[0].innerHTML;
|
308 |
-
} else {
|
309 |
-
text = node.innerHTML;
|
310 |
-
}
|
311 |
-
}
|
312 |
-
} else {
|
313 |
-
if (typeof(config.textExtraction) == "function") {
|
314 |
-
text = config.textExtraction(node);
|
315 |
-
} else {
|
316 |
-
text = $(node).text();
|
317 |
-
}
|
318 |
-
}
|
319 |
-
return text;
|
320 |
-
}
|
321 |
-
|
322 |
-
function appendToTable(table, cache) {
|
323 |
-
|
324 |
-
if (table.config.debug) {
|
325 |
-
var appendTime = new Date()
|
326 |
-
}
|
327 |
-
|
328 |
-
var c = cache,
|
329 |
-
r = c.row,
|
330 |
-
n = c.normalized,
|
331 |
-
totalRows = n.length,
|
332 |
-
checkCell = (n[0].length - 1),
|
333 |
-
tableBody = $(table.tBodies[0]),
|
334 |
-
rows = [];
|
335 |
-
|
336 |
-
|
337 |
-
for (var i = 0; i < totalRows; i++) {
|
338 |
-
var pos = n[i][checkCell];
|
339 |
-
|
340 |
-
rows.push(r[pos]);
|
341 |
-
|
342 |
-
if (!table.config.appender) {
|
343 |
-
|
344 |
-
//var o = ;
|
345 |
-
var l = r[pos].length;
|
346 |
-
for (var j = 0; j < l; j++) {
|
347 |
-
tableBody[0].appendChild(r[pos][j]);
|
348 |
-
}
|
349 |
-
|
350 |
-
//
|
351 |
-
}
|
352 |
-
}
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
if (table.config.appender) {
|
357 |
-
|
358 |
-
table.config.appender(table, rows);
|
359 |
-
}
|
360 |
-
|
361 |
-
rows = null;
|
362 |
-
|
363 |
-
if (table.config.debug) {
|
364 |
-
benchmark("Rebuilt table:", appendTime);
|
365 |
-
}
|
366 |
-
|
367 |
-
// apply table widgets
|
368 |
-
applyWidget(table);
|
369 |
-
|
370 |
-
// trigger sortend
|
371 |
-
setTimeout(function () {
|
372 |
-
$(table).trigger("sortEnd");
|
373 |
-
}, 0);
|
374 |
-
|
375 |
-
};
|
376 |
-
|
377 |
-
function buildHeaders(table) {
|
378 |
-
|
379 |
-
if (table.config.debug) {
|
380 |
-
var time = new Date();
|
381 |
-
}
|
382 |
-
|
383 |
-
var meta = ($.metadata) ? true : false;
|
384 |
-
|
385 |
-
var header_index = computeTableHeaderCellIndexes(table);
|
386 |
-
|
387 |
-
$tableHeaders = $(table.config.selectorHeaders, table).each(function (index) {
|
388 |
-
|
389 |
-
this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
|
390 |
-
// this.column = index;
|
391 |
-
this.order = formatSortingOrder(table.config.sortInitialOrder);
|
392 |
-
|
393 |
-
|
394 |
-
this.count = this.order;
|
395 |
-
|
396 |
-
if (checkHeaderMetadata(this) || checkHeaderOptions(table, index)) this.sortDisabled = true;
|
397 |
-
if (checkHeaderOptionsSortingLocked(table, index)) this.order = this.lockedOrder = checkHeaderOptionsSortingLocked(table, index);
|
398 |
-
|
399 |
-
if (!this.sortDisabled) {
|
400 |
-
var $th = $(this).addClass(table.config.cssHeader);
|
401 |
-
if (table.config.onRenderHeader) table.config.onRenderHeader.apply($th);
|
402 |
-
}
|
403 |
-
|
404 |
-
// add cell to headerList
|
405 |
-
table.config.headerList[index] = this;
|
406 |
-
});
|
407 |
-
|
408 |
-
if (table.config.debug) {
|
409 |
-
benchmark("Built headers:", time);
|
410 |
-
log($tableHeaders);
|
411 |
-
}
|
412 |
-
|
413 |
-
return $tableHeaders;
|
414 |
-
|
415 |
-
};
|
416 |
-
|
417 |
-
// from:
|
418 |
-
// http://www.javascripttoolbox.com/lib/table/examples.php
|
419 |
-
// http://www.javascripttoolbox.com/temp/table_cellindex.html
|
420 |
-
|
421 |
-
|
422 |
-
function computeTableHeaderCellIndexes(t) {
|
423 |
-
var matrix = [];
|
424 |
-
var lookup = {};
|
425 |
-
var thead = t.getElementsByTagName('THEAD')[0];
|
426 |
-
var trs = thead.getElementsByTagName('TR');
|
427 |
-
|
428 |
-
for (var i = 0; i < trs.length; i++) {
|
429 |
-
var cells = trs[i].cells;
|
430 |
-
for (var j = 0; j < cells.length; j++) {
|
431 |
-
var c = cells[j];
|
432 |
-
|
433 |
-
var rowIndex = c.parentNode.rowIndex;
|
434 |
-
var cellId = rowIndex + "-" + c.cellIndex;
|
435 |
-
var rowSpan = c.rowSpan || 1;
|
436 |
-
var colSpan = c.colSpan || 1
|
437 |
-
var firstAvailCol;
|
438 |
-
if (typeof(matrix[rowIndex]) == "undefined") {
|
439 |
-
matrix[rowIndex] = [];
|
440 |
-
}
|
441 |
-
// Find first available column in the first row
|
442 |
-
for (var k = 0; k < matrix[rowIndex].length + 1; k++) {
|
443 |
-
if (typeof(matrix[rowIndex][k]) == "undefined") {
|
444 |
-
firstAvailCol = k;
|
445 |
-
break;
|
446 |
-
}
|
447 |
-
}
|
448 |
-
lookup[cellId] = firstAvailCol;
|
449 |
-
for (var k = rowIndex; k < rowIndex + rowSpan; k++) {
|
450 |
-
if (typeof(matrix[k]) == "undefined") {
|
451 |
-
matrix[k] = [];
|
452 |
-
}
|
453 |
-
var matrixrow = matrix[k];
|
454 |
-
for (var l = firstAvailCol; l < firstAvailCol + colSpan; l++) {
|
455 |
-
matrixrow[l] = "x";
|
456 |
-
}
|
457 |
-
}
|
458 |
-
}
|
459 |
-
}
|
460 |
-
return lookup;
|
461 |
-
}
|
462 |
-
|
463 |
-
function checkCellColSpan(table, rows, row) {
|
464 |
-
var arr = [],
|
465 |
-
r = table.tHead.rows,
|
466 |
-
c = r[row].cells;
|
467 |
-
|
468 |
-
for (var i = 0; i < c.length; i++) {
|
469 |
-
var cell = c[i];
|
470 |
-
|
471 |
-
if (cell.colSpan > 1) {
|
472 |
-
arr = arr.concat(checkCellColSpan(table, headerArr, row++));
|
473 |
-
} else {
|
474 |
-
if (table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row + 1])) {
|
475 |
-
arr.push(cell);
|
476 |
-
}
|
477 |
-
// headerArr[row] = (i+row);
|
478 |
-
}
|
479 |
-
}
|
480 |
-
return arr;
|
481 |
-
};
|
482 |
-
|
483 |
-
function checkHeaderMetadata(cell) {
|
484 |
-
if (($.metadata) && ($(cell).metadata().sorter === false)) {
|
485 |
-
return true;
|
486 |
-
};
|
487 |
-
return false;
|
488 |
-
}
|
489 |
-
|
490 |
-
function checkHeaderOptions(table, i) {
|
491 |
-
if ((table.config.headers[i]) && (table.config.headers[i].sorter === false)) {
|
492 |
-
return true;
|
493 |
-
};
|
494 |
-
return false;
|
495 |
-
}
|
496 |
-
|
497 |
-
function checkHeaderOptionsSortingLocked(table, i) {
|
498 |
-
if ((table.config.headers[i]) && (table.config.headers[i].lockedOrder)) return table.config.headers[i].lockedOrder;
|
499 |
-
return false;
|
500 |
-
}
|
501 |
-
|
502 |
-
function applyWidget(table) {
|
503 |
-
var c = table.config.widgets;
|
504 |
-
var l = c.length;
|
505 |
-
for (var i = 0; i < l; i++) {
|
506 |
-
|
507 |
-
getWidgetById(c[i]).format(table);
|
508 |
-
}
|
509 |
-
|
510 |
-
}
|
511 |
-
|
512 |
-
function getWidgetById(name) {
|
513 |
-
var l = widgets.length;
|
514 |
-
for (var i = 0; i < l; i++) {
|
515 |
-
if (widgets[i].id.toLowerCase() == name.toLowerCase()) {
|
516 |
-
return widgets[i];
|
517 |
-
}
|
518 |
-
}
|
519 |
-
};
|
520 |
-
|
521 |
-
function formatSortingOrder(v) {
|
522 |
-
if (typeof(v) != "Number") {
|
523 |
-
return (v.toLowerCase() == "desc") ? 1 : 0;
|
524 |
-
} else {
|
525 |
-
return (v == 1) ? 1 : 0;
|
526 |
-
}
|
527 |
-
}
|
528 |
-
|
529 |
-
function isValueInArray(v, a) {
|
530 |
-
var l = a.length;
|
531 |
-
for (var i = 0; i < l; i++) {
|
532 |
-
if (a[i][0] == v) {
|
533 |
-
return true;
|
534 |
-
}
|
535 |
-
}
|
536 |
-
return false;
|
537 |
-
}
|
538 |
-
|
539 |
-
function setHeadersCss(table, $headers, list, css) {
|
540 |
-
// remove all header information
|
541 |
-
$headers.removeClass(css[0]).removeClass(css[1]);
|
542 |
-
|
543 |
-
var h = [];
|
544 |
-
$headers.each(function (offset) {
|
545 |
-
if (!this.sortDisabled) {
|
546 |
-
h[this.column] = $(this);
|
547 |
-
}
|
548 |
-
});
|
549 |
-
|
550 |
-
var l = list.length;
|
551 |
-
for (var i = 0; i < l; i++) {
|
552 |
-
h[list[i][0]].addClass(css[list[i][1]]);
|
553 |
-
}
|
554 |
-
}
|
555 |
-
|
556 |
-
function fixColumnWidth(table, $headers) {
|
557 |
-
var c = table.config;
|
558 |
-
if (c.widthFixed) {
|
559 |
-
var colgroup = $('<colgroup>');
|
560 |
-
$("tr:first td", table.tBodies[0]).each(function () {
|
561 |
-
colgroup.append($('<col>').css('width', $(this).width()));
|
562 |
-
});
|
563 |
-
$(table).prepend(colgroup);
|
564 |
-
};
|
565 |
-
}
|
566 |
-
|
567 |
-
function updateHeaderSortCount(table, sortList) {
|
568 |
-
var c = table.config,
|
569 |
-
l = sortList.length;
|
570 |
-
for (var i = 0; i < l; i++) {
|
571 |
-
var s = sortList[i],
|
572 |
-
o = c.headerList[s[0]];
|
573 |
-
o.count = s[1];
|
574 |
-
o.count++;
|
575 |
-
}
|
576 |
-
}
|
577 |
-
|
578 |
-
/* sorting methods */
|
579 |
-
|
580 |
-
function multisort(table, sortList, cache) {
|
581 |
-
|
582 |
-
if (table.config.debug) {
|
583 |
-
var sortTime = new Date();
|
584 |
-
}
|
585 |
-
|
586 |
-
var dynamicExp = "var sortWrapper = function(a,b) {",
|
587 |
-
l = sortList.length;
|
588 |
-
|
589 |
-
// TODO: inline functions.
|
590 |
-
for (var i = 0; i < l; i++) {
|
591 |
-
|
592 |
-
var c = sortList[i][0];
|
593 |
-
var order = sortList[i][1];
|
594 |
-
// var s = (getCachedSortType(table.config.parsers,c) == "text") ?
|
595 |
-
// ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ?
|
596 |
-
// "sortNumeric" : "sortNumericDesc");
|
597 |
-
// var s = (table.config.parsers[c].type == "text") ? ((order == 0)
|
598 |
-
// ? makeSortText(c) : makeSortTextDesc(c)) : ((order == 0) ?
|
599 |
-
// makeSortNumeric(c) : makeSortNumericDesc(c));
|
600 |
-
var s = (table.config.parsers[c].type == "text") ? ((order == 0) ? makeSortFunction("text", "asc", c) : makeSortFunction("text", "desc", c)) : ((order == 0) ? makeSortFunction("numeric", "asc", c) : makeSortFunction("numeric", "desc", c));
|
601 |
-
var e = "e" + i;
|
602 |
-
|
603 |
-
dynamicExp += "var " + e + " = " + s; // + "(a[" + c + "],b[" + c
|
604 |
-
// + "]); ";
|
605 |
-
dynamicExp += "if(" + e + ") { return " + e + "; } ";
|
606 |
-
dynamicExp += "else { ";
|
607 |
-
|
608 |
-
}
|
609 |
-
|
610 |
-
// if value is the same keep orignal order
|
611 |
-
var orgOrderCol = cache.normalized[0].length - 1;
|
612 |
-
dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
|
613 |
-
|
614 |
-
for (var i = 0; i < l; i++) {
|
615 |
-
dynamicExp += "}; ";
|
616 |
-
}
|
617 |
-
|
618 |
-
dynamicExp += "return 0; ";
|
619 |
-
dynamicExp += "}; ";
|
620 |
-
|
621 |
-
if (table.config.debug) {
|
622 |
-
benchmark("Evaling expression:" + dynamicExp, new Date());
|
623 |
-
}
|
624 |
-
|
625 |
-
eval(dynamicExp);
|
626 |
-
|
627 |
-
cache.normalized.sort(sortWrapper);
|
628 |
-
|
629 |
-
if (table.config.debug) {
|
630 |
-
benchmark("Sorting on " + sortList.toString() + " and dir " + order + " time:", sortTime);
|
631 |
-
}
|
632 |
-
|
633 |
-
return cache;
|
634 |
-
};
|
635 |
-
|
636 |
-
function makeSortFunction(type, direction, index) {
|
637 |
-
var a = "a[" + index + "]",
|
638 |
-
b = "b[" + index + "]";
|
639 |
-
if (type == 'text' && direction == 'asc') {
|
640 |
-
return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + a + " < " + b + ") ? -1 : 1 )));";
|
641 |
-
} else if (type == 'text' && direction == 'desc') {
|
642 |
-
return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + b + " < " + a + ") ? -1 : 1 )));";
|
643 |
-
} else if (type == 'numeric' && direction == 'asc') {
|
644 |
-
return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + a + " - " + b + "));";
|
645 |
-
} else if (type == 'numeric' && direction == 'desc') {
|
646 |
-
return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + b + " - " + a + "));";
|
647 |
-
}
|
648 |
-
};
|
649 |
-
|
650 |
-
function makeSortText(i) {
|
651 |
-
return "((a[" + i + "] < b[" + i + "]) ? -1 : ((a[" + i + "] > b[" + i + "]) ? 1 : 0));";
|
652 |
-
};
|
653 |
-
|
654 |
-
function makeSortTextDesc(i) {
|
655 |
-
return "((b[" + i + "] < a[" + i + "]) ? -1 : ((b[" + i + "] > a[" + i + "]) ? 1 : 0));";
|
656 |
-
};
|
657 |
-
|
658 |
-
function makeSortNumeric(i) {
|
659 |
-
return "a[" + i + "]-b[" + i + "];";
|
660 |
-
};
|
661 |
-
|
662 |
-
function makeSortNumericDesc(i) {
|
663 |
-
return "b[" + i + "]-a[" + i + "];";
|
664 |
-
};
|
665 |
-
|
666 |
-
function sortText(a, b) {
|
667 |
-
if (table.config.sortLocaleCompare) return a.localeCompare(b);
|
668 |
-
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
669 |
-
};
|
670 |
-
|
671 |
-
function sortTextDesc(a, b) {
|
672 |
-
if (table.config.sortLocaleCompare) return b.localeCompare(a);
|
673 |
-
return ((b < a) ? -1 : ((b > a) ? 1 : 0));
|
674 |
-
};
|
675 |
-
|
676 |
-
function sortNumeric(a, b) {
|
677 |
-
return a - b;
|
678 |
-
};
|
679 |
-
|
680 |
-
function sortNumericDesc(a, b) {
|
681 |
-
return b - a;
|
682 |
-
};
|
683 |
-
|
684 |
-
function getCachedSortType(parsers, i) {
|
685 |
-
return parsers[i].type;
|
686 |
-
}; /* public methods */
|
687 |
-
this.construct = function (settings) {
|
688 |
-
return this.each(function () {
|
689 |
-
// if no thead or tbody quit.
|
690 |
-
if (!this.tHead || !this.tBodies) return;
|
691 |
-
// declare
|
692 |
-
var $this, $document, $headers, cache, config, shiftDown = 0,
|
693 |
-
sortOrder;
|
694 |
-
// new blank config object
|
695 |
-
this.config = {};
|
696 |
-
// merge and extend.
|
697 |
-
config = $.extend(this.config, $.tablesorter.defaults, settings);
|
698 |
-
// store common expression for speed
|
699 |
-
$this = $(this);
|
700 |
-
// save the settings where they read
|
701 |
-
$.data(this, "tablesorter", config);
|
702 |
-
// build headers
|
703 |
-
$headers = buildHeaders(this);
|
704 |
-
// try to auto detect column type, and store in tables config
|
705 |
-
this.config.parsers = buildParserCache(this, $headers);
|
706 |
-
// build the cache for the tbody cells
|
707 |
-
cache = buildCache(this);
|
708 |
-
// get the css class names, could be done else where.
|
709 |
-
var sortCSS = [config.cssDesc, config.cssAsc];
|
710 |
-
// fixate columns if the users supplies the fixedWidth option
|
711 |
-
fixColumnWidth(this);
|
712 |
-
// apply event handling to headers
|
713 |
-
// this is to big, perhaps break it out?
|
714 |
-
$headers.click(
|
715 |
-
|
716 |
-
function (e) {
|
717 |
-
var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
|
718 |
-
if (!this.sortDisabled && totalRows > 0) {
|
719 |
-
// Only call sortStart if sorting is
|
720 |
-
// enabled.
|
721 |
-
$this.trigger("sortStart");
|
722 |
-
// store exp, for speed
|
723 |
-
var $cell = $(this);
|
724 |
-
// get current column index
|
725 |
-
var i = this.column;
|
726 |
-
// get current column sort order
|
727 |
-
this.order = this.count++ % 2;
|
728 |
-
// always sort on the locked order.
|
729 |
-
if(this.lockedOrder) this.order = this.lockedOrder;
|
730 |
-
|
731 |
-
// user only whants to sort on one
|
732 |
-
// column
|
733 |
-
if (!e[config.sortMultiSortKey]) {
|
734 |
-
// flush the sort list
|
735 |
-
config.sortList = [];
|
736 |
-
if (config.sortForce != null) {
|
737 |
-
var a = config.sortForce;
|
738 |
-
for (var j = 0; j < a.length; j++) {
|
739 |
-
if (a[j][0] != i) {
|
740 |
-
config.sortList.push(a[j]);
|
741 |
-
}
|
742 |
-
}
|
743 |
-
}
|
744 |
-
// add column to sort list
|
745 |
-
config.sortList.push([i, this.order]);
|
746 |
-
// multi column sorting
|
747 |
-
} else {
|
748 |
-
// the user has clicked on an all
|
749 |
-
// ready sortet column.
|
750 |
-
if (isValueInArray(i, config.sortList)) {
|
751 |
-
// revers the sorting direction
|
752 |
-
// for all tables.
|
753 |
-
for (var j = 0; j < config.sortList.length; j++) {
|
754 |
-
var s = config.sortList[j],
|
755 |
-
o = config.headerList[s[0]];
|
756 |
-
if (s[0] == i) {
|
757 |
-
o.count = s[1];
|
758 |
-
o.count++;
|
759 |
-
s[1] = o.count % 2;
|
760 |
-
}
|
761 |
-
}
|
762 |
-
} else {
|
763 |
-
// add column to sort list array
|
764 |
-
config.sortList.push([i, this.order]);
|
765 |
-
}
|
766 |
-
};
|
767 |
-
setTimeout(function () {
|
768 |
-
// set css for headers
|
769 |
-
setHeadersCss($this[0], $headers, config.sortList, sortCSS);
|
770 |
-
appendToTable(
|
771 |
-
$this[0], multisort(
|
772 |
-
$this[0], config.sortList, cache)
|
773 |
-
);
|
774 |
-
}, 1);
|
775 |
-
// stop normal event by returning false
|
776 |
-
return false;
|
777 |
-
}
|
778 |
-
// cancel selection
|
779 |
-
}).mousedown(function () {
|
780 |
-
if (config.cancelSelection) {
|
781 |
-
this.onselectstart = function () {
|
782 |
-
return false
|
783 |
-
};
|
784 |
-
return false;
|
785 |
-
}
|
786 |
-
});
|
787 |
-
// apply easy methods that trigger binded events
|
788 |
-
$this.bind("update", function () {
|
789 |
-
var me = this;
|
790 |
-
setTimeout(function () {
|
791 |
-
// rebuild parsers.
|
792 |
-
me.config.parsers = buildParserCache(
|
793 |
-
me, $headers);
|
794 |
-
// rebuild the cache map
|
795 |
-
cache = buildCache(me);
|
796 |
-
}, 1);
|
797 |
-
}).bind("updateCell", function (e, cell) {
|
798 |
-
var config = this.config;
|
799 |
-
// get position from the dom.
|
800 |
-
var pos = [(cell.parentNode.rowIndex - 1), cell.cellIndex];
|
801 |
-
// update cache
|
802 |
-
cache.normalized[pos[0]][pos[1]] = config.parsers[pos[1]].format(
|
803 |
-
getElementText(config, cell), cell);
|
804 |
-
}).bind("sorton", function (e, list) {
|
805 |
-
$(this).trigger("sortStart");
|
806 |
-
config.sortList = list;
|
807 |
-
// update and store the sortlist
|
808 |
-
var sortList = config.sortList;
|
809 |
-
// update header count index
|
810 |
-
updateHeaderSortCount(this, sortList);
|
811 |
-
// set css for headers
|
812 |
-
setHeadersCss(this, $headers, sortList, sortCSS);
|
813 |
-
// sort the table and append it to the dom
|
814 |
-
appendToTable(this, multisort(this, sortList, cache));
|
815 |
-
}).bind("appendCache", function () {
|
816 |
-
appendToTable(this, cache);
|
817 |
-
}).bind("applyWidgetId", function (e, id) {
|
818 |
-
getWidgetById(id).format(this);
|
819 |
-
}).bind("applyWidgets", function () {
|
820 |
-
// apply widgets
|
821 |
-
applyWidget(this);
|
822 |
-
});
|
823 |
-
if ($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) {
|
824 |
-
config.sortList = $(this).metadata().sortlist;
|
825 |
-
}
|
826 |
-
// if user has supplied a sort list to constructor.
|
827 |
-
if (config.sortList.length > 0) {
|
828 |
-
$this.trigger("sorton", [config.sortList]);
|
829 |
-
}
|
830 |
-
// apply widgets
|
831 |
-
applyWidget(this);
|
832 |
-
});
|
833 |
-
};
|
834 |
-
this.addParser = function (parser) {
|
835 |
-
var l = parsers.length,
|
836 |
-
a = true;
|
837 |
-
for (var i = 0; i < l; i++) {
|
838 |
-
if (parsers[i].id.toLowerCase() == parser.id.toLowerCase()) {
|
839 |
-
a = false;
|
840 |
-
}
|
841 |
-
}
|
842 |
-
if (a) {
|
843 |
-
parsers.push(parser);
|
844 |
-
};
|
845 |
-
};
|
846 |
-
this.addWidget = function (widget) {
|
847 |
-
widgets.push(widget);
|
848 |
-
};
|
849 |
-
this.formatFloat = function (s) {
|
850 |
-
var i = parseFloat(s);
|
851 |
-
return (isNaN(i)) ? 0 : i;
|
852 |
-
};
|
853 |
-
this.formatInt = function (s) {
|
854 |
-
var i = parseInt(s);
|
855 |
-
return (isNaN(i)) ? 0 : i;
|
856 |
-
};
|
857 |
-
this.isDigit = function (s, config) {
|
858 |
-
// replace all an wanted chars and match.
|
859 |
-
return /^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g, '')));
|
860 |
-
};
|
861 |
-
this.clearTableBody = function (table) {
|
862 |
-
if ($.browser.msie) {
|
863 |
-
function empty() {
|
864 |
-
while (this.firstChild)
|
865 |
-
this.removeChild(this.firstChild);
|
866 |
-
}
|
867 |
-
empty.apply(table.tBodies[0]);
|
868 |
-
} else {
|
869 |
-
table.tBodies[0].innerHTML = "";
|
870 |
-
}
|
871 |
-
};
|
872 |
-
}
|
873 |
-
});
|
874 |
-
|
875 |
-
// extend plugin scope
|
876 |
-
$.fn.extend({
|
877 |
-
tablesorter: $.tablesorter.construct
|
878 |
-
});
|
879 |
-
|
880 |
-
// make shortcut
|
881 |
-
var ts = $.tablesorter;
|
882 |
-
|
883 |
-
// add default parsers
|
884 |
-
ts.addParser({
|
885 |
-
id: "text",
|
886 |
-
is: function (s) {
|
887 |
-
return true;
|
888 |
-
}, format: function (s) {
|
889 |
-
return $.trim(s.toLocaleLowerCase());
|
890 |
-
}, type: "text"
|
891 |
-
});
|
892 |
-
|
893 |
-
ts.addParser({
|
894 |
-
id: "digit",
|
895 |
-
is: function (s, table) {
|
896 |
-
var c = table.config;
|
897 |
-
return $.tablesorter.isDigit(s, c);
|
898 |
-
}, format: function (s) {
|
899 |
-
return $.tablesorter.formatFloat(s);
|
900 |
-
}, type: "numeric"
|
901 |
-
});
|
902 |
-
|
903 |
-
ts.addParser({
|
904 |
-
id: "currency",
|
905 |
-
is: function (s) {
|
906 |
-
return /^[£$€?.]/.test(s);
|
907 |
-
}, format: function (s) {
|
908 |
-
return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g), ""));
|
909 |
-
}, type: "numeric"
|
910 |
-
});
|
911 |
-
|
912 |
-
ts.addParser({
|
913 |
-
id: "ipAddress",
|
914 |
-
is: function (s) {
|
915 |
-
return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);
|
916 |
-
}, format: function (s) {
|
917 |
-
var a = s.split("."),
|
918 |
-
r = "",
|
919 |
-
l = a.length;
|
920 |
-
for (var i = 0; i < l; i++) {
|
921 |
-
var item = a[i];
|
922 |
-
if (item.length == 2) {
|
923 |
-
r += "0" + item;
|
924 |
-
} else {
|
925 |
-
r += item;
|
926 |
-
}
|
927 |
-
}
|
928 |
-
return $.tablesorter.formatFloat(r);
|
929 |
-
}, type: "numeric"
|
930 |
-
});
|
931 |
-
|
932 |
-
ts.addParser({
|
933 |
-
id: "url",
|
934 |
-
is: function (s) {
|
935 |
-
return /^(https?|ftp|file):\/\/$/.test(s);
|
936 |
-
}, format: function (s) {
|
937 |
-
return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//), ''));
|
938 |
-
}, type: "text"
|
939 |
-
});
|
940 |
-
|
941 |
-
ts.addParser({
|
942 |
-
id: "isoDate",
|
943 |
-
is: function (s) {
|
944 |
-
return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);
|
945 |
-
}, format: function (s) {
|
946 |
-
return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(
|
947 |
-
new RegExp(/-/g), "/")).getTime() : "0");
|
948 |
-
}, type: "numeric"
|
949 |
-
});
|
950 |
-
|
951 |
-
ts.addParser({
|
952 |
-
id: "percent",
|
953 |
-
is: function (s) {
|
954 |
-
return /\%$/.test($.trim(s));
|
955 |
-
}, format: function (s) {
|
956 |
-
return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g), ""));
|
957 |
-
}, type: "numeric"
|
958 |
-
});
|
959 |
-
|
960 |
-
ts.addParser({
|
961 |
-
id: "usLongDate",
|
962 |
-
is: function (s) {
|
963 |
-
return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));
|
964 |
-
}, format: function (s) {
|
965 |
-
return $.tablesorter.formatFloat(new Date(s).getTime());
|
966 |
-
}, type: "numeric"
|
967 |
-
});
|
968 |
-
|
969 |
-
ts.addParser({
|
970 |
-
id: "shortDate",
|
971 |
-
is: function (s) {
|
972 |
-
return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);
|
973 |
-
}, format: function (s, table) {
|
974 |
-
var c = table.config;
|
975 |
-
s = s.replace(/\-/g, "/");
|
976 |
-
if (c.dateFormat == "us") {
|
977 |
-
// reformat the string in ISO format
|
978 |
-
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2");
|
979 |
-
} else if (c.dateFormat == "uk") {
|
980 |
-
// reformat the string in ISO format
|
981 |
-
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
|
982 |
-
} else if (c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
|
983 |
-
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");
|
984 |
-
}
|
985 |
-
return $.tablesorter.formatFloat(new Date(s).getTime());
|
986 |
-
}, type: "numeric"
|
987 |
-
});
|
988 |
-
ts.addParser({
|
989 |
-
id: "time",
|
990 |
-
is: function (s) {
|
991 |
-
return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);
|
992 |
-
}, format: function (s) {
|
993 |
-
return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime());
|
994 |
-
}, type: "numeric"
|
995 |
-
});
|
996 |
-
ts.addParser({
|
997 |
-
id: "metadata",
|
998 |
-
is: function (s) {
|
999 |
-
return false;
|
1000 |
-
}, format: function (s, table, cell) {
|
1001 |
-
var c = table.config,
|
1002 |
-
p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
|
1003 |
-
return $(cell).metadata()[p];
|
1004 |
-
}, type: "numeric"
|
1005 |
-
});
|
1006 |
-
// add default widgets
|
1007 |
-
ts.addWidget({
|
1008 |
-
id: "zebra",
|
1009 |
-
format: function (table) {
|
1010 |
-
if (table.config.debug) {
|
1011 |
-
var time = new Date();
|
1012 |
-
}
|
1013 |
-
var $tr, row = -1,
|
1014 |
-
odd;
|
1015 |
-
// loop through the visible rows
|
1016 |
-
$("tr:visible", table.tBodies[0]).each(function (i) {
|
1017 |
-
$tr = $(this);
|
1018 |
-
// style children rows the same way the parent
|
1019 |
-
// row was styled
|
1020 |
-
if (!$tr.hasClass(table.config.cssChildRow)) row++;
|
1021 |
-
odd = (row % 2 == 0);
|
1022 |
-
$tr.removeClass(
|
1023 |
-
table.config.widgetZebra.css[odd ? 0 : 1]).addClass(
|
1024 |
-
table.config.widgetZebra.css[odd ? 1 : 0])
|
1025 |
-
});
|
1026 |
-
if (table.config.debug) {
|
1027 |
-
$.tablesorter.benchmark("Applying Zebra widget", time);
|
1028 |
-
}
|
1029 |
-
}
|
1030 |
-
});
|
1031 |
})(jQuery);
|
1 |
+
/*
|
2 |
+
*
|
3 |
+
* TableSorter 2.0 - Client-side table sorting with ease!
|
4 |
+
* Version 2.0.5b
|
5 |
+
* @requires jQuery v1.2.3
|
6 |
+
*
|
7 |
+
* Copyright (c) 2007 Christian Bach
|
8 |
+
* Examples and docs at: http://tablesorter.com
|
9 |
+
* Dual licensed under the MIT and GPL licenses:
|
10 |
+
* http://www.opensource.org/licenses/mit-license.php
|
11 |
+
* http://www.gnu.org/licenses/gpl.html
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
/**
|
15 |
+
*
|
16 |
+
* @description Create a sortable table with multi-column sorting capabilitys
|
17 |
+
*
|
18 |
+
* @example $('table').tablesorter();
|
19 |
+
* @desc Create a simple tablesorter interface.
|
20 |
+
*
|
21 |
+
* @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
|
22 |
+
* @desc Create a tablesorter interface and sort on the first and secound column column headers.
|
23 |
+
*
|
24 |
+
* @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
|
25 |
+
*
|
26 |
+
* @desc Create a tablesorter interface and disableing the first and second column headers.
|
27 |
+
*
|
28 |
+
*
|
29 |
+
* @example $('table').tablesorter({ headers: { 0: {sorter:"integer"}, 1: {sorter:"currency"} } });
|
30 |
+
*
|
31 |
+
* @desc Create a tablesorter interface and set a column parser for the first
|
32 |
+
* and second column.
|
33 |
+
*
|
34 |
+
*
|
35 |
+
* @param Object
|
36 |
+
* settings An object literal containing key/value pairs to provide
|
37 |
+
* optional settings.
|
38 |
+
*
|
39 |
+
*
|
40 |
+
* @option String cssHeader (optional) A string of the class name to be appended
|
41 |
+
* to sortable tr elements in the thead of the table. Default value:
|
42 |
+
* "header"
|
43 |
+
*
|
44 |
+
* @option String cssAsc (optional) A string of the class name to be appended to
|
45 |
+
* sortable tr elements in the thead on a ascending sort. Default value:
|
46 |
+
* "headerSortUp"
|
47 |
+
*
|
48 |
+
* @option String cssDesc (optional) A string of the class name to be appended
|
49 |
+
* to sortable tr elements in the thead on a descending sort. Default
|
50 |
+
* value: "headerSortDown"
|
51 |
+
*
|
52 |
+
* @option String sortInitialOrder (optional) A string of the inital sorting
|
53 |
+
* order can be asc or desc. Default value: "asc"
|
54 |
+
*
|
55 |
+
* @option String sortMultisortKey (optional) A string of the multi-column sort
|
56 |
+
* key. Default value: "shiftKey"
|
57 |
+
*
|
58 |
+
* @option String textExtraction (optional) A string of the text-extraction
|
59 |
+
* method to use. For complex html structures inside td cell set this
|
60 |
+
* option to "complex", on large tables the complex option can be slow.
|
61 |
+
* Default value: "simple"
|
62 |
+
*
|
63 |
+
* @option Object headers (optional) An array containing the forces sorting
|
64 |
+
* rules. This option let's you specify a default sorting rule. Default
|
65 |
+
* value: null
|
66 |
+
*
|
67 |
+
* @option Array sortList (optional) An array containing the forces sorting
|
68 |
+
* rules. This option let's you specify a default sorting rule. Default
|
69 |
+
* value: null
|
70 |
+
*
|
71 |
+
* @option Array sortForce (optional) An array containing forced sorting rules.
|
72 |
+
* This option let's you specify a default sorting rule, which is
|
73 |
+
* prepended to user-selected rules. Default value: null
|
74 |
+
*
|
75 |
+
* @option Boolean sortLocaleCompare (optional) Boolean flag indicating whatever
|
76 |
+
* to use String.localeCampare method or not. Default set to true.
|
77 |
+
*
|
78 |
+
*
|
79 |
+
* @option Array sortAppend (optional) An array containing forced sorting rules.
|
80 |
+
* This option let's you specify a default sorting rule, which is
|
81 |
+
* appended to user-selected rules. Default value: null
|
82 |
+
*
|
83 |
+
* @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter
|
84 |
+
* should apply fixed widths to the table columns. This is usefull when
|
85 |
+
* using the pager companion plugin. This options requires the dimension
|
86 |
+
* jquery plugin. Default value: false
|
87 |
+
*
|
88 |
+
* @option Boolean cancelSelection (optional) Boolean flag indicating if
|
89 |
+
* tablesorter should cancel selection of the table headers text.
|
90 |
+
* Default value: true
|
91 |
+
*
|
92 |
+
* @option Boolean debug (optional) Boolean flag indicating if tablesorter
|
93 |
+
* should display debuging information usefull for development.
|
94 |
+
*
|
95 |
+
* @type jQuery
|
96 |
+
*
|
97 |
+
* @name tablesorter
|
98 |
+
*
|
99 |
+
* @cat Plugins/Tablesorter
|
100 |
+
*
|
101 |
+
* @author Christian Bach/christian.bach@polyester.se
|
102 |
+
*/
|
103 |
+
|
104 |
+
(function ($) {
|
105 |
+
$.extend({
|
106 |
+
tablesorter: new
|
107 |
+
function () {
|
108 |
+
|
109 |
+
var parsers = [],
|
110 |
+
widgets = [];
|
111 |
+
|
112 |
+
this.defaults = {
|
113 |
+
cssHeader: "header",
|
114 |
+
cssAsc: "headerSortUp",
|
115 |
+
cssDesc: "headerSortDown",
|
116 |
+
cssChildRow: "expand-child",
|
117 |
+
sortInitialOrder: "asc",
|
118 |
+
sortMultiSortKey: "shiftKey",
|
119 |
+
sortForce: null,
|
120 |
+
sortAppend: null,
|
121 |
+
sortLocaleCompare: true,
|
122 |
+
textExtraction: "simple",
|
123 |
+
parsers: {}, widgets: [],
|
124 |
+
widgetZebra: {
|
125 |
+
css: ["even", "odd"]
|
126 |
+
}, headers: {}, widthFixed: false,
|
127 |
+
cancelSelection: true,
|
128 |
+
sortList: [],
|
129 |
+
headerList: [],
|
130 |
+
dateFormat: "us",
|
131 |
+
decimal: '/\.|\,/g',
|
132 |
+
onRenderHeader: null,
|
133 |
+
selectorHeaders: 'thead th',
|
134 |
+
debug: false
|
135 |
+
};
|
136 |
+
|
137 |
+
/* debuging utils */
|
138 |
+
|
139 |
+
function benchmark(s, d) {
|
140 |
+
log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
|
141 |
+
}
|
142 |
+
|
143 |
+
this.benchmark = benchmark;
|
144 |
+
|
145 |
+
function log(s) {
|
146 |
+
if (typeof console != "undefined" && typeof console.debug != "undefined") {
|
147 |
+
console.log(s);
|
148 |
+
} else {
|
149 |
+
alert(s);
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
/* parsers utils */
|
154 |
+
|
155 |
+
function buildParserCache(table, $headers) {
|
156 |
+
|
157 |
+
if (table.config.debug) {
|
158 |
+
var parsersDebug = "";
|
159 |
+
}
|
160 |
+
|
161 |
+
if (table.tBodies.length == 0) return; // In the case of empty tables
|
162 |
+
var rows = table.tBodies[0].rows;
|
163 |
+
|
164 |
+
if (rows[0]) {
|
165 |
+
|
166 |
+
var list = [],
|
167 |
+
cells = rows[0].cells,
|
168 |
+
l = cells.length;
|
169 |
+
|
170 |
+
for (var i = 0; i < l; i++) {
|
171 |
+
|
172 |
+
var p = false;
|
173 |
+
|
174 |
+
if ($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter)) {
|
175 |
+
|
176 |
+
p = getParserById($($headers[i]).metadata().sorter);
|
177 |
+
|
178 |
+
} else if ((table.config.headers[i] && table.config.headers[i].sorter)) {
|
179 |
+
|
180 |
+
p = getParserById(table.config.headers[i].sorter);
|
181 |
+
}
|
182 |
+
if (!p) {
|
183 |
+
|
184 |
+
p = detectParserForColumn(table, rows, -1, i);
|
185 |
+
}
|
186 |
+
|
187 |
+
if (table.config.debug) {
|
188 |
+
parsersDebug += "column:" + i + " parser:" + p.id + "\n";
|
189 |
+
}
|
190 |
+
|
191 |
+
list.push(p);
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
if (table.config.debug) {
|
196 |
+
log(parsersDebug);
|
197 |
+
}
|
198 |
+
|
199 |
+
return list;
|
200 |
+
};
|
201 |
+
|
202 |
+
function detectParserForColumn(table, rows, rowIndex, cellIndex) {
|
203 |
+
var l = parsers.length,
|
204 |
+
node = false,
|
205 |
+
nodeValue = false,
|
206 |
+
keepLooking = true;
|
207 |
+
while (nodeValue == '' && keepLooking) {
|
208 |
+
rowIndex++;
|
209 |
+
if (rows[rowIndex]) {
|
210 |
+
node = getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex);
|
211 |
+
nodeValue = trimAndGetNodeText(table.config, node);
|
212 |
+
if (table.config.debug) {
|
213 |
+
log('Checking if value was empty on row:' + rowIndex);
|
214 |
+
}
|
215 |
+
} else {
|
216 |
+
keepLooking = false;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
for (var i = 1; i < l; i++) {
|
220 |
+
if (parsers[i].is(nodeValue, table, node)) {
|
221 |
+
return parsers[i];
|
222 |
+
}
|
223 |
+
}
|
224 |
+
// 0 is always the generic parser (text)
|
225 |
+
return parsers[0];
|
226 |
+
}
|
227 |
+
|
228 |
+
function getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex) {
|
229 |
+
return rows[rowIndex].cells[cellIndex];
|
230 |
+
}
|
231 |
+
|
232 |
+
function trimAndGetNodeText(config, node) {
|
233 |
+
return $.trim(getElementText(config, node));
|
234 |
+
}
|
235 |
+
|
236 |
+
function getParserById(name) {
|
237 |
+
var l = parsers.length;
|
238 |
+
for (var i = 0; i < l; i++) {
|
239 |
+
if (parsers[i].id.toLowerCase() == name.toLowerCase()) {
|
240 |
+
return parsers[i];
|
241 |
+
}
|
242 |
+
}
|
243 |
+
return false;
|
244 |
+
}
|
245 |
+
|
246 |
+
/* utils */
|
247 |
+
|
248 |
+
function buildCache(table) {
|
249 |
+
|
250 |
+
if (table.config.debug) {
|
251 |
+
var cacheTime = new Date();
|
252 |
+
}
|
253 |
+
|
254 |
+
var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
|
255 |
+
totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0,
|
256 |
+
parsers = table.config.parsers,
|
257 |
+
cache = {
|
258 |
+
row: [],
|
259 |
+
normalized: []
|
260 |
+
};
|
261 |
+
|
262 |
+
for (var i = 0; i < totalRows; ++i) {
|
263 |
+
|
264 |
+
/** Add the table data to main data array */
|
265 |
+
var c = $(table.tBodies[0].rows[i]),
|
266 |
+
cols = [];
|
267 |
+
|
268 |
+
// if this is a child row, add it to the last row's children and
|
269 |
+
// continue to the next row
|
270 |
+
if (c.hasClass(table.config.cssChildRow)) {
|
271 |
+
cache.row[cache.row.length - 1] = cache.row[cache.row.length - 1].add(c);
|
272 |
+
// go to the next for loop
|
273 |
+
continue;
|
274 |
+
}
|
275 |
+
|
276 |
+
cache.row.push(c);
|
277 |
+
|
278 |
+
for (var j = 0; j < totalCells; ++j) {
|
279 |
+
cols.push(parsers[j].format(getElementText(table.config, c[0].cells[j]), table, c[0].cells[j]));
|
280 |
+
}
|
281 |
+
|
282 |
+
cols.push(cache.normalized.length); // add position for rowCache
|
283 |
+
cache.normalized.push(cols);
|
284 |
+
cols = null;
|
285 |
+
};
|
286 |
+
|
287 |
+
if (table.config.debug) {
|
288 |
+
benchmark("Building cache for " + totalRows + " rows:", cacheTime);
|
289 |
+
}
|
290 |
+
|
291 |
+
return cache;
|
292 |
+
};
|
293 |
+
|
294 |
+
function getElementText(config, node) {
|
295 |
+
|
296 |
+
var text = "";
|
297 |
+
|
298 |
+
if (!node) return "";
|
299 |
+
|
300 |
+
if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false;
|
301 |
+
|
302 |
+
if (config.textExtraction == "simple") {
|
303 |
+
if (config.supportsTextContent) {
|
304 |
+
text = node.textContent;
|
305 |
+
} else {
|
306 |
+
if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
|
307 |
+
text = node.childNodes[0].innerHTML;
|
308 |
+
} else {
|
309 |
+
text = node.innerHTML;
|
310 |
+
}
|
311 |
+
}
|
312 |
+
} else {
|
313 |
+
if (typeof(config.textExtraction) == "function") {
|
314 |
+
text = config.textExtraction(node);
|
315 |
+
} else {
|
316 |
+
text = $(node).text();
|
317 |
+
}
|
318 |
+
}
|
319 |
+
return text;
|
320 |
+
}
|
321 |
+
|
322 |
+
function appendToTable(table, cache) {
|
323 |
+
|
324 |
+
if (table.config.debug) {
|
325 |
+
var appendTime = new Date()
|
326 |
+
}
|
327 |
+
|
328 |
+
var c = cache,
|
329 |
+
r = c.row,
|
330 |
+
n = c.normalized,
|
331 |
+
totalRows = n.length,
|
332 |
+
checkCell = (n[0].length - 1),
|
333 |
+
tableBody = $(table.tBodies[0]),
|
334 |
+
rows = [];
|
335 |
+
|
336 |
+
|
337 |
+
for (var i = 0; i < totalRows; i++) {
|
338 |
+
var pos = n[i][checkCell];
|
339 |
+
|
340 |
+
rows.push(r[pos]);
|
341 |
+
|
342 |
+
if (!table.config.appender) {
|
343 |
+
|
344 |
+
//var o = ;
|
345 |
+
var l = r[pos].length;
|
346 |
+
for (var j = 0; j < l; j++) {
|
347 |
+
tableBody[0].appendChild(r[pos][j]);
|
348 |
+
}
|
349 |
+
|
350 |
+
//
|
351 |
+
}
|
352 |
+
}
|
353 |
+
|
354 |
+
|
355 |
+
|
356 |
+
if (table.config.appender) {
|
357 |
+
|
358 |
+
table.config.appender(table, rows);
|
359 |
+
}
|
360 |
+
|
361 |
+
rows = null;
|
362 |
+
|
363 |
+
if (table.config.debug) {
|
364 |
+
benchmark("Rebuilt table:", appendTime);
|
365 |
+
}
|
366 |
+
|
367 |
+
// apply table widgets
|
368 |
+
applyWidget(table);
|
369 |
+
|
370 |
+
// trigger sortend
|
371 |
+
setTimeout(function () {
|
372 |
+
$(table).trigger("sortEnd");
|
373 |
+
}, 0);
|
374 |
+
|
375 |
+
};
|
376 |
+
|
377 |
+
function buildHeaders(table) {
|
378 |
+
|
379 |
+
if (table.config.debug) {
|
380 |
+
var time = new Date();
|
381 |
+
}
|
382 |
+
|
383 |
+
var meta = ($.metadata) ? true : false;
|
384 |
+
|
385 |
+
var header_index = computeTableHeaderCellIndexes(table);
|
386 |
+
|
387 |
+
$tableHeaders = $(table.config.selectorHeaders, table).each(function (index) {
|
388 |
+
|
389 |
+
this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
|
390 |
+
// this.column = index;
|
391 |
+
this.order = formatSortingOrder(table.config.sortInitialOrder);
|
392 |
+
|
393 |
+
|
394 |
+
this.count = this.order;
|
395 |
+
|
396 |
+
if (checkHeaderMetadata(this) || checkHeaderOptions(table, index)) this.sortDisabled = true;
|
397 |
+
if (checkHeaderOptionsSortingLocked(table, index)) this.order = this.lockedOrder = checkHeaderOptionsSortingLocked(table, index);
|
398 |
+
|
399 |
+
if (!this.sortDisabled) {
|
400 |
+
var $th = $(this).addClass(table.config.cssHeader);
|
401 |
+
if (table.config.onRenderHeader) table.config.onRenderHeader.apply($th);
|
402 |
+
}
|
403 |
+
|
404 |
+
// add cell to headerList
|
405 |
+
table.config.headerList[index] = this;
|
406 |
+
});
|
407 |
+
|
408 |
+
if (table.config.debug) {
|
409 |
+
benchmark("Built headers:", time);
|
410 |
+
log($tableHeaders);
|
411 |
+
}
|
412 |
+
|
413 |
+
return $tableHeaders;
|
414 |
+
|
415 |
+
};
|
416 |
+
|
417 |
+
// from:
|
418 |
+
// http://www.javascripttoolbox.com/lib/table/examples.php
|
419 |
+
// http://www.javascripttoolbox.com/temp/table_cellindex.html
|
420 |
+
|
421 |
+
|
422 |
+
function computeTableHeaderCellIndexes(t) {
|
423 |
+
var matrix = [];
|
424 |
+
var lookup = {};
|
425 |
+
var thead = t.getElementsByTagName('THEAD')[0];
|
426 |
+
var trs = thead.getElementsByTagName('TR');
|
427 |
+
|
428 |
+
for (var i = 0; i < trs.length; i++) {
|
429 |
+
var cells = trs[i].cells;
|
430 |
+
for (var j = 0; j < cells.length; j++) {
|
431 |
+
var c = cells[j];
|
432 |
+
|
433 |
+
var rowIndex = c.parentNode.rowIndex;
|
434 |
+
var cellId = rowIndex + "-" + c.cellIndex;
|
435 |
+
var rowSpan = c.rowSpan || 1;
|
436 |
+
var colSpan = c.colSpan || 1
|
437 |
+
var firstAvailCol;
|
438 |
+
if (typeof(matrix[rowIndex]) == "undefined") {
|
439 |
+
matrix[rowIndex] = [];
|
440 |
+
}
|
441 |
+
// Find first available column in the first row
|
442 |
+
for (var k = 0; k < matrix[rowIndex].length + 1; k++) {
|
443 |
+
if (typeof(matrix[rowIndex][k]) == "undefined") {
|
444 |
+
firstAvailCol = k;
|
445 |
+
break;
|
446 |
+
}
|
447 |
+
}
|
448 |
+
lookup[cellId] = firstAvailCol;
|
449 |
+
for (var k = rowIndex; k < rowIndex + rowSpan; k++) {
|
450 |
+
if (typeof(matrix[k]) == "undefined") {
|
451 |
+
matrix[k] = [];
|
452 |
+
}
|
453 |
+
var matrixrow = matrix[k];
|
454 |
+
for (var l = firstAvailCol; l < firstAvailCol + colSpan; l++) {
|
455 |
+
matrixrow[l] = "x";
|
456 |
+
}
|
457 |
+
}
|
458 |
+
}
|
459 |
+
}
|
460 |
+
return lookup;
|
461 |
+
}
|
462 |
+
|
463 |
+
function checkCellColSpan(table, rows, row) {
|
464 |
+
var arr = [],
|
465 |
+
r = table.tHead.rows,
|
466 |
+
c = r[row].cells;
|
467 |
+
|
468 |
+
for (var i = 0; i < c.length; i++) {
|
469 |
+
var cell = c[i];
|
470 |
+
|
471 |
+
if (cell.colSpan > 1) {
|
472 |
+
arr = arr.concat(checkCellColSpan(table, headerArr, row++));
|
473 |
+
} else {
|
474 |
+
if (table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row + 1])) {
|
475 |
+
arr.push(cell);
|
476 |
+
}
|
477 |
+
// headerArr[row] = (i+row);
|
478 |
+
}
|
479 |
+
}
|
480 |
+
return arr;
|
481 |
+
};
|
482 |
+
|
483 |
+
function checkHeaderMetadata(cell) {
|
484 |
+
if (($.metadata) && ($(cell).metadata().sorter === false)) {
|
485 |
+
return true;
|
486 |
+
};
|
487 |
+
return false;
|
488 |
+
}
|
489 |
+
|
490 |
+
function checkHeaderOptions(table, i) {
|
491 |
+
if ((table.config.headers[i]) && (table.config.headers[i].sorter === false)) {
|
492 |
+
return true;
|
493 |
+
};
|
494 |
+
return false;
|
495 |
+
}
|
496 |
+
|
497 |
+
function checkHeaderOptionsSortingLocked(table, i) {
|
498 |
+
if ((table.config.headers[i]) && (table.config.headers[i].lockedOrder)) return table.config.headers[i].lockedOrder;
|
499 |
+
return false;
|
500 |
+
}
|
501 |
+
|
502 |
+
function applyWidget(table) {
|
503 |
+
var c = table.config.widgets;
|
504 |
+
var l = c.length;
|
505 |
+
for (var i = 0; i < l; i++) {
|
506 |
+
|
507 |
+
getWidgetById(c[i]).format(table);
|
508 |
+
}
|
509 |
+
|
510 |
+
}
|
511 |
+
|
512 |
+
function getWidgetById(name) {
|
513 |
+
var l = widgets.length;
|
514 |
+
for (var i = 0; i < l; i++) {
|
515 |
+
if (widgets[i].id.toLowerCase() == name.toLowerCase()) {
|
516 |
+
return widgets[i];
|
517 |
+
}
|
518 |
+
}
|
519 |
+
};
|
520 |
+
|
521 |
+
function formatSortingOrder(v) {
|
522 |
+
if (typeof(v) != "Number") {
|
523 |
+
return (v.toLowerCase() == "desc") ? 1 : 0;
|
524 |
+
} else {
|
525 |
+
return (v == 1) ? 1 : 0;
|
526 |
+
}
|
527 |
+
}
|
528 |
+
|
529 |
+
function isValueInArray(v, a) {
|
530 |
+
var l = a.length;
|
531 |
+
for (var i = 0; i < l; i++) {
|
532 |
+
if (a[i][0] == v) {
|
533 |
+
return true;
|
534 |
+
}
|
535 |
+
}
|
536 |
+
return false;
|
537 |
+
}
|
538 |
+
|
539 |
+
function setHeadersCss(table, $headers, list, css) {
|
540 |
+
// remove all header information
|
541 |
+
$headers.removeClass(css[0]).removeClass(css[1]);
|
542 |
+
|
543 |
+
var h = [];
|
544 |
+
$headers.each(function (offset) {
|
545 |
+
if (!this.sortDisabled) {
|
546 |
+
h[this.column] = $(this);
|
547 |
+
}
|
548 |
+
});
|
549 |
+
|
550 |
+
var l = list.length;
|
551 |
+
for (var i = 0; i < l; i++) {
|
552 |
+
h[list[i][0]].addClass(css[list[i][1]]);
|
553 |
+
}
|
554 |
+
}
|
555 |
+
|
556 |
+
function fixColumnWidth(table, $headers) {
|
557 |
+
var c = table.config;
|
558 |
+
if (c.widthFixed) {
|
559 |
+
var colgroup = $('<colgroup>');
|
560 |
+
$("tr:first td", table.tBodies[0]).each(function () {
|
561 |
+
colgroup.append($('<col>').css('width', $(this).width()));
|
562 |
+
});
|
563 |
+
$(table).prepend(colgroup);
|
564 |
+
};
|
565 |
+
}
|
566 |
+
|
567 |
+
function updateHeaderSortCount(table, sortList) {
|
568 |
+
var c = table.config,
|
569 |
+
l = sortList.length;
|
570 |
+
for (var i = 0; i < l; i++) {
|
571 |
+
var s = sortList[i],
|
572 |
+
o = c.headerList[s[0]];
|
573 |
+
o.count = s[1];
|
574 |
+
o.count++;
|
575 |
+
}
|
576 |
+
}
|
577 |
+
|
578 |
+
/* sorting methods */
|
579 |
+
|
580 |
+
function multisort(table, sortList, cache) {
|
581 |
+
|
582 |
+
if (table.config.debug) {
|
583 |
+
var sortTime = new Date();
|
584 |
+
}
|
585 |
+
|
586 |
+
var dynamicExp = "var sortWrapper = function(a,b) {",
|
587 |
+
l = sortList.length;
|
588 |
+
|
589 |
+
// TODO: inline functions.
|
590 |
+
for (var i = 0; i < l; i++) {
|
591 |
+
|
592 |
+
var c = sortList[i][0];
|
593 |
+
var order = sortList[i][1];
|
594 |
+
// var s = (getCachedSortType(table.config.parsers,c) == "text") ?
|
595 |
+
// ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ?
|
596 |
+
// "sortNumeric" : "sortNumericDesc");
|
597 |
+
// var s = (table.config.parsers[c].type == "text") ? ((order == 0)
|
598 |
+
// ? makeSortText(c) : makeSortTextDesc(c)) : ((order == 0) ?
|
599 |
+
// makeSortNumeric(c) : makeSortNumericDesc(c));
|
600 |
+
var s = (table.config.parsers[c].type == "text") ? ((order == 0) ? makeSortFunction("text", "asc", c) : makeSortFunction("text", "desc", c)) : ((order == 0) ? makeSortFunction("numeric", "asc", c) : makeSortFunction("numeric", "desc", c));
|
601 |
+
var e = "e" + i;
|
602 |
+
|
603 |
+
dynamicExp += "var " + e + " = " + s; // + "(a[" + c + "],b[" + c
|
604 |
+
// + "]); ";
|
605 |
+
dynamicExp += "if(" + e + ") { return " + e + "; } ";
|
606 |
+
dynamicExp += "else { ";
|
607 |
+
|
608 |
+
}
|
609 |
+
|
610 |
+
// if value is the same keep orignal order
|
611 |
+
var orgOrderCol = cache.normalized[0].length - 1;
|
612 |
+
dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
|
613 |
+
|
614 |
+
for (var i = 0; i < l; i++) {
|
615 |
+
dynamicExp += "}; ";
|
616 |
+
}
|
617 |
+
|
618 |
+
dynamicExp += "return 0; ";
|
619 |
+
dynamicExp += "}; ";
|
620 |
+
|
621 |
+
if (table.config.debug) {
|
622 |
+
benchmark("Evaling expression:" + dynamicExp, new Date());
|
623 |
+
}
|
624 |
+
|
625 |
+
eval(dynamicExp);
|
626 |
+
|
627 |
+
cache.normalized.sort(sortWrapper);
|
628 |
+
|
629 |
+
if (table.config.debug) {
|
630 |
+
benchmark("Sorting on " + sortList.toString() + " and dir " + order + " time:", sortTime);
|
631 |
+
}
|
632 |
+
|
633 |
+
return cache;
|
634 |
+
};
|
635 |
+
|
636 |
+
function makeSortFunction(type, direction, index) {
|
637 |
+
var a = "a[" + index + "]",
|
638 |
+
b = "b[" + index + "]";
|
639 |
+
if (type == 'text' && direction == 'asc') {
|
640 |
+
return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + a + " < " + b + ") ? -1 : 1 )));";
|
641 |
+
} else if (type == 'text' && direction == 'desc') {
|
642 |
+
return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + b + " < " + a + ") ? -1 : 1 )));";
|
643 |
+
} else if (type == 'numeric' && direction == 'asc') {
|
644 |
+
return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + a + " - " + b + "));";
|
645 |
+
} else if (type == 'numeric' && direction == 'desc') {
|
646 |
+
return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + b + " - " + a + "));";
|
647 |
+
}
|
648 |
+
};
|
649 |
+
|
650 |
+
function makeSortText(i) {
|
651 |
+
return "((a[" + i + "] < b[" + i + "]) ? -1 : ((a[" + i + "] > b[" + i + "]) ? 1 : 0));";
|
652 |
+
};
|
653 |
+
|
654 |
+
function makeSortTextDesc(i) {
|
655 |
+
return "((b[" + i + "] < a[" + i + "]) ? -1 : ((b[" + i + "] > a[" + i + "]) ? 1 : 0));";
|
656 |
+
};
|
657 |
+
|
658 |
+
function makeSortNumeric(i) {
|
659 |
+
return "a[" + i + "]-b[" + i + "];";
|
660 |
+
};
|
661 |
+
|
662 |
+
function makeSortNumericDesc(i) {
|
663 |
+
return "b[" + i + "]-a[" + i + "];";
|
664 |
+
};
|
665 |
+
|
666 |
+
function sortText(a, b) {
|
667 |
+
if (table.config.sortLocaleCompare) return a.localeCompare(b);
|
668 |
+
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
669 |
+
};
|
670 |
+
|
671 |
+
function sortTextDesc(a, b) {
|
672 |
+
if (table.config.sortLocaleCompare) return b.localeCompare(a);
|
673 |
+
return ((b < a) ? -1 : ((b > a) ? 1 : 0));
|
674 |
+
};
|
675 |
+
|
676 |
+
function sortNumeric(a, b) {
|
677 |
+
return a - b;
|
678 |
+
};
|
679 |
+
|
680 |
+
function sortNumericDesc(a, b) {
|
681 |
+
return b - a;
|
682 |
+
};
|
683 |
+
|
684 |
+
function getCachedSortType(parsers, i) {
|
685 |
+
return parsers[i].type;
|
686 |
+
}; /* public methods */
|
687 |
+
this.construct = function (settings) {
|
688 |
+
return this.each(function () {
|
689 |
+
// if no thead or tbody quit.
|
690 |
+
if (!this.tHead || !this.tBodies) return;
|
691 |
+
// declare
|
692 |
+
var $this, $document, $headers, cache, config, shiftDown = 0,
|
693 |
+
sortOrder;
|
694 |
+
// new blank config object
|
695 |
+
this.config = {};
|
696 |
+
// merge and extend.
|
697 |
+
config = $.extend(this.config, $.tablesorter.defaults, settings);
|
698 |
+
// store common expression for speed
|
699 |
+
$this = $(this);
|
700 |
+
// save the settings where they read
|
701 |
+
$.data(this, "tablesorter", config);
|
702 |
+
// build headers
|
703 |
+
$headers = buildHeaders(this);
|
704 |
+
// try to auto detect column type, and store in tables config
|
705 |
+
this.config.parsers = buildParserCache(this, $headers);
|
706 |
+
// build the cache for the tbody cells
|
707 |
+
cache = buildCache(this);
|
708 |
+
// get the css class names, could be done else where.
|
709 |
+
var sortCSS = [config.cssDesc, config.cssAsc];
|
710 |
+
// fixate columns if the users supplies the fixedWidth option
|
711 |
+
fixColumnWidth(this);
|
712 |
+
// apply event handling to headers
|
713 |
+
// this is to big, perhaps break it out?
|
714 |
+
$headers.click(
|
715 |
+
|
716 |
+
function (e) {
|
717 |
+
var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
|
718 |
+
if (!this.sortDisabled && totalRows > 0) {
|
719 |
+
// Only call sortStart if sorting is
|
720 |
+
// enabled.
|
721 |
+
$this.trigger("sortStart");
|
722 |
+
// store exp, for speed
|
723 |
+
var $cell = $(this);
|
724 |
+
// get current column index
|
725 |
+
var i = this.column;
|
726 |
+
// get current column sort order
|
727 |
+
this.order = this.count++ % 2;
|
728 |
+
// always sort on the locked order.
|
729 |
+
if(this.lockedOrder) this.order = this.lockedOrder;
|
730 |
+
|
731 |
+
// user only whants to sort on one
|
732 |
+
// column
|
733 |
+
if (!e[config.sortMultiSortKey]) {
|
734 |
+
// flush the sort list
|
735 |
+
config.sortList = [];
|
736 |
+
if (config.sortForce != null) {
|
737 |
+
var a = config.sortForce;
|
738 |
+
for (var j = 0; j < a.length; j++) {
|
739 |
+
if (a[j][0] != i) {
|
740 |
+
config.sortList.push(a[j]);
|
741 |
+
}
|
742 |
+
}
|
743 |
+
}
|
744 |
+
// add column to sort list
|
745 |
+
config.sortList.push([i, this.order]);
|
746 |
+
// multi column sorting
|
747 |
+
} else {
|
748 |
+
// the user has clicked on an all
|
749 |
+
// ready sortet column.
|
750 |
+
if (isValueInArray(i, config.sortList)) {
|
751 |
+
// revers the sorting direction
|
752 |
+
// for all tables.
|
753 |
+
for (var j = 0; j < config.sortList.length; j++) {
|
754 |
+
var s = config.sortList[j],
|
755 |
+
o = config.headerList[s[0]];
|
756 |
+
if (s[0] == i) {
|
757 |
+
o.count = s[1];
|
758 |
+
o.count++;
|
759 |
+
s[1] = o.count % 2;
|
760 |
+
}
|
761 |
+
}
|
762 |
+
} else {
|
763 |
+
// add column to sort list array
|
764 |
+
config.sortList.push([i, this.order]);
|
765 |
+
}
|
766 |
+
};
|
767 |
+
setTimeout(function () {
|
768 |
+
// set css for headers
|
769 |
+
setHeadersCss($this[0], $headers, config.sortList, sortCSS);
|
770 |
+
appendToTable(
|
771 |
+
$this[0], multisort(
|
772 |
+
$this[0], config.sortList, cache)
|
773 |
+
);
|
774 |
+
}, 1);
|
775 |
+
// stop normal event by returning false
|
776 |
+
return false;
|
777 |
+
}
|
778 |
+
// cancel selection
|
779 |
+
}).mousedown(function () {
|
780 |
+
if (config.cancelSelection) {
|
781 |
+
this.onselectstart = function () {
|
782 |
+
return false
|
783 |
+
};
|
784 |
+
return false;
|
785 |
+
}
|
786 |
+
});
|
787 |
+
// apply easy methods that trigger binded events
|
788 |
+
$this.bind("update", function () {
|
789 |
+
var me = this;
|
790 |
+
setTimeout(function () {
|
791 |
+
// rebuild parsers.
|
792 |
+
me.config.parsers = buildParserCache(
|
793 |
+
me, $headers);
|
794 |
+
// rebuild the cache map
|
795 |
+
cache = buildCache(me);
|
796 |
+
}, 1);
|
797 |
+
}).bind("updateCell", function (e, cell) {
|
798 |
+
var config = this.config;
|
799 |
+
// get position from the dom.
|
800 |
+
var pos = [(cell.parentNode.rowIndex - 1), cell.cellIndex];
|
801 |
+
// update cache
|
802 |
+
cache.normalized[pos[0]][pos[1]] = config.parsers[pos[1]].format(
|
803 |
+
getElementText(config, cell), cell);
|
804 |
+
}).bind("sorton", function (e, list) {
|
805 |
+
$(this).trigger("sortStart");
|
806 |
+
config.sortList = list;
|
807 |
+
// update and store the sortlist
|
808 |
+
var sortList = config.sortList;
|
809 |
+
// update header count index
|
810 |
+
updateHeaderSortCount(this, sortList);
|
811 |
+
// set css for headers
|
812 |
+
setHeadersCss(this, $headers, sortList, sortCSS);
|
813 |
+
// sort the table and append it to the dom
|
814 |
+
appendToTable(this, multisort(this, sortList, cache));
|
815 |
+
}).bind("appendCache", function () {
|
816 |
+
appendToTable(this, cache);
|
817 |
+
}).bind("applyWidgetId", function (e, id) {
|
818 |
+
getWidgetById(id).format(this);
|
819 |
+
}).bind("applyWidgets", function () {
|
820 |
+
// apply widgets
|
821 |
+
applyWidget(this);
|
822 |
+
});
|
823 |
+
if ($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) {
|
824 |
+
config.sortList = $(this).metadata().sortlist;
|
825 |
+
}
|
826 |
+
// if user has supplied a sort list to constructor.
|
827 |
+
if (config.sortList.length > 0) {
|
828 |
+
$this.trigger("sorton", [config.sortList]);
|
829 |
+
}
|
830 |
+
// apply widgets
|
831 |
+
applyWidget(this);
|
832 |
+
});
|
833 |
+
};
|
834 |
+
this.addParser = function (parser) {
|
835 |
+
var l = parsers.length,
|
836 |
+
a = true;
|
837 |
+
for (var i = 0; i < l; i++) {
|
838 |
+
if (parsers[i].id.toLowerCase() == parser.id.toLowerCase()) {
|
839 |
+
a = false;
|
840 |
+
}
|
841 |
+
}
|
842 |
+
if (a) {
|
843 |
+
parsers.push(parser);
|
844 |
+
};
|
845 |
+
};
|
846 |
+
this.addWidget = function (widget) {
|
847 |
+
widgets.push(widget);
|
848 |
+
};
|
849 |
+
this.formatFloat = function (s) {
|
850 |
+
var i = parseFloat(s);
|
851 |
+
return (isNaN(i)) ? 0 : i;
|
852 |
+
};
|
853 |
+
this.formatInt = function (s) {
|
854 |
+
var i = parseInt(s);
|
855 |
+
return (isNaN(i)) ? 0 : i;
|
856 |
+
};
|
857 |
+
this.isDigit = function (s, config) {
|
858 |
+
// replace all an wanted chars and match.
|
859 |
+
return /^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g, '')));
|
860 |
+
};
|
861 |
+
this.clearTableBody = function (table) {
|
862 |
+
if ($.browser.msie) {
|
863 |
+
function empty() {
|
864 |
+
while (this.firstChild)
|
865 |
+
this.removeChild(this.firstChild);
|
866 |
+
}
|
867 |
+
empty.apply(table.tBodies[0]);
|
868 |
+
} else {
|
869 |
+
table.tBodies[0].innerHTML = "";
|
870 |
+
}
|
871 |
+
};
|
872 |
+
}
|
873 |
+
});
|
874 |
+
|
875 |
+
// extend plugin scope
|
876 |
+
$.fn.extend({
|
877 |
+
tablesorter: $.tablesorter.construct
|
878 |
+
});
|
879 |
+
|
880 |
+
// make shortcut
|
881 |
+
var ts = $.tablesorter;
|
882 |
+
|
883 |
+
// add default parsers
|
884 |
+
ts.addParser({
|
885 |
+
id: "text",
|
886 |
+
is: function (s) {
|
887 |
+
return true;
|
888 |
+
}, format: function (s) {
|
889 |
+
return $.trim(s.toLocaleLowerCase());
|
890 |
+
}, type: "text"
|
891 |
+
});
|
892 |
+
|
893 |
+
ts.addParser({
|
894 |
+
id: "digit",
|
895 |
+
is: function (s, table) {
|
896 |
+
var c = table.config;
|
897 |
+
return $.tablesorter.isDigit(s, c);
|
898 |
+
}, format: function (s) {
|
899 |
+
return $.tablesorter.formatFloat(s);
|
900 |
+
}, type: "numeric"
|
901 |
+
});
|
902 |
+
|
903 |
+
ts.addParser({
|
904 |
+
id: "currency",
|
905 |
+
is: function (s) {
|
906 |
+
return /^[£$€?.]/.test(s);
|
907 |
+
}, format: function (s) {
|
908 |
+
return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g), ""));
|
909 |
+
}, type: "numeric"
|
910 |
+
});
|
911 |
+
|
912 |
+
ts.addParser({
|
913 |
+
id: "ipAddress",
|
914 |
+
is: function (s) {
|
915 |
+
return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);
|
916 |
+
}, format: function (s) {
|
917 |
+
var a = s.split("."),
|
918 |
+
r = "",
|
919 |
+
l = a.length;
|
920 |
+
for (var i = 0; i < l; i++) {
|
921 |
+
var item = a[i];
|
922 |
+
if (item.length == 2) {
|
923 |
+
r += "0" + item;
|
924 |
+
} else {
|
925 |
+
r += item;
|
926 |
+
}
|
927 |
+
}
|
928 |
+
return $.tablesorter.formatFloat(r);
|
929 |
+
}, type: "numeric"
|
930 |
+
});
|
931 |
+
|
932 |
+
ts.addParser({
|
933 |
+
id: "url",
|
934 |
+
is: function (s) {
|
935 |
+
return /^(https?|ftp|file):\/\/$/.test(s);
|
936 |
+
}, format: function (s) {
|
937 |
+
return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//), ''));
|
938 |
+
}, type: "text"
|
939 |
+
});
|
940 |
+
|
941 |
+
ts.addParser({
|
942 |
+
id: "isoDate",
|
943 |
+
is: function (s) {
|
944 |
+
return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);
|
945 |
+
}, format: function (s) {
|
946 |
+
return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(
|
947 |
+
new RegExp(/-/g), "/")).getTime() : "0");
|
948 |
+
}, type: "numeric"
|
949 |
+
});
|
950 |
+
|
951 |
+
ts.addParser({
|
952 |
+
id: "percent",
|
953 |
+
is: function (s) {
|
954 |
+
return /\%$/.test($.trim(s));
|
955 |
+
}, format: function (s) {
|
956 |
+
return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g), ""));
|
957 |
+
}, type: "numeric"
|
958 |
+
});
|
959 |
+
|
960 |
+
ts.addParser({
|
961 |
+
id: "usLongDate",
|
962 |
+
is: function (s) {
|
963 |
+
return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));
|
964 |
+
}, format: function (s) {
|
965 |
+
return $.tablesorter.formatFloat(new Date(s).getTime());
|
966 |
+
}, type: "numeric"
|
967 |
+
});
|
968 |
+
|
969 |
+
ts.addParser({
|
970 |
+
id: "shortDate",
|
971 |
+
is: function (s) {
|
972 |
+
return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);
|
973 |
+
}, format: function (s, table) {
|
974 |
+
var c = table.config;
|
975 |
+
s = s.replace(/\-/g, "/");
|
976 |
+
if (c.dateFormat == "us") {
|
977 |
+
// reformat the string in ISO format
|
978 |
+
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2");
|
979 |
+
} else if (c.dateFormat == "uk") {
|
980 |
+
// reformat the string in ISO format
|
981 |
+
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
|
982 |
+
} else if (c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
|
983 |
+
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");
|
984 |
+
}
|
985 |
+
return $.tablesorter.formatFloat(new Date(s).getTime());
|
986 |
+
}, type: "numeric"
|
987 |
+
});
|
988 |
+
ts.addParser({
|
989 |
+
id: "time",
|
990 |
+
is: function (s) {
|
991 |
+
return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);
|
992 |
+
}, format: function (s) {
|
993 |
+
return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime());
|
994 |
+
}, type: "numeric"
|
995 |
+
});
|
996 |
+
ts.addParser({
|
997 |
+
id: "metadata",
|
998 |
+
is: function (s) {
|
999 |
+
return false;
|
1000 |
+
}, format: function (s, table, cell) {
|
1001 |
+
var c = table.config,
|
1002 |
+
p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
|
1003 |
+
return $(cell).metadata()[p];
|
1004 |
+
}, type: "numeric"
|
1005 |
+
});
|
1006 |
+
// add default widgets
|
1007 |
+
ts.addWidget({
|
1008 |
+
id: "zebra",
|
1009 |
+
format: function (table) {
|
1010 |
+
if (table.config.debug) {
|
1011 |
+
var time = new Date();
|
1012 |
+
}
|
1013 |
+
var $tr, row = -1,
|
1014 |
+
odd;
|
1015 |
+
// loop through the visible rows
|
1016 |
+
$("tr:visible", table.tBodies[0]).each(function (i) {
|
1017 |
+
$tr = $(this);
|
1018 |
+
// style children rows the same way the parent
|
1019 |
+
// row was styled
|
1020 |
+
if (!$tr.hasClass(table.config.cssChildRow)) row++;
|
1021 |
+
odd = (row % 2 == 0);
|
1022 |
+
$tr.removeClass(
|
1023 |
+
table.config.widgetZebra.css[odd ? 0 : 1]).addClass(
|
1024 |
+
table.config.widgetZebra.css[odd ? 1 : 0])
|
1025 |
+
});
|
1026 |
+
if (table.config.debug) {
|
1027 |
+
$.tablesorter.benchmark("Applying Zebra widget", time);
|
1028 |
+
}
|
1029 |
+
}
|
1030 |
+
});
|
1031 |
})(jQuery);
|
js/libraries/jpicker/css/jPicker-1.1.6.css
CHANGED
@@ -1,232 +1,232 @@
|
|
1 |
-
.jPicker .Icon {
|
2 |
-
display: inline-block;
|
3 |
-
height: 24px; /* change this value if using a different sized color picker icon */
|
4 |
-
position: relative; /* make this element an absolute positioning container */
|
5 |
-
text-align: left; /* make the zero width children position to the left of container */
|
6 |
-
width: 25px; /* change this value if using a different sized color picker icon */
|
7 |
-
}
|
8 |
-
.jPicker .Icon span.Color, .jPicker .Icon span.Alpha {
|
9 |
-
background-position: 2px 2px;
|
10 |
-
display: block;
|
11 |
-
height: 100%;
|
12 |
-
left: 0px;
|
13 |
-
position: absolute;
|
14 |
-
top: 0px;
|
15 |
-
width: 100%;
|
16 |
-
}
|
17 |
-
.jPicker .Icon span.Image {
|
18 |
-
background-repeat: no-repeat;
|
19 |
-
cursor: pointer;
|
20 |
-
display: block;
|
21 |
-
height: 100%;
|
22 |
-
left: 0px;
|
23 |
-
position: absolute;
|
24 |
-
top: 0px;
|
25 |
-
width: 100%;
|
26 |
-
}
|
27 |
-
.jPicker.Container {
|
28 |
-
color: #000;
|
29 |
-
z-index: 10;
|
30 |
-
}
|
31 |
-
table.jPicker {
|
32 |
-
background-color: #efefef;
|
33 |
-
border: 1px outset #666;
|
34 |
-
font-family: Arial, Helvetica, Sans-Serif;
|
35 |
-
font-size: 12px !important;
|
36 |
-
margin: 0px;
|
37 |
-
padding: 5px;
|
38 |
-
width: 545px;
|
39 |
-
z-index: 20;
|
40 |
-
}
|
41 |
-
.jPicker .Move {
|
42 |
-
background-color: #dddddd;
|
43 |
-
border-color: #fff #666 #666 #fff;
|
44 |
-
border-style: solid;
|
45 |
-
border-width: 1px;
|
46 |
-
cursor: move;
|
47 |
-
height: 12px;
|
48 |
-
padding: 0px;
|
49 |
-
}
|
50 |
-
.jPicker .Title {
|
51 |
-
font-size: 11px !important;
|
52 |
-
font-weight: bold;
|
53 |
-
margin: -2px 0px 0px 0px;
|
54 |
-
padding: 10px 0px 0px 0px;
|
55 |
-
text-align: center;
|
56 |
-
width: 100%;
|
57 |
-
}
|
58 |
-
.jPicker div.Map {
|
59 |
-
border-bottom: 2px solid #fff;
|
60 |
-
border-left: 2px solid #9a9a9a;
|
61 |
-
border-right: 2px solid #fff;
|
62 |
-
border-top: 2px solid #9a9a9a;
|
63 |
-
cursor: crosshair;
|
64 |
-
height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
|
65 |
-
margin: 0px 10px 10px 10px;
|
66 |
-
overflow: hidden; /* hide the overdraw of the Color Map icon when at edge of viewing box */
|
67 |
-
padding: 0px;
|
68 |
-
position: relative; /* make this element an absolute positioning container */
|
69 |
-
width: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
|
70 |
-
}
|
71 |
-
.jPicker div[class="Map"] {
|
72 |
-
height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
73 |
-
width: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
74 |
-
}
|
75 |
-
.jPicker div.Bar {
|
76 |
-
border-bottom: 2px solid #fff;
|
77 |
-
border-left: 2px solid #9a9a9a;
|
78 |
-
border-right: 2px solid #fff;
|
79 |
-
border-top: 2px solid #9a9a9a;
|
80 |
-
cursor: n-resize;
|
81 |
-
height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
|
82 |
-
margin: 12px 10px 0px 5px;
|
83 |
-
overflow: hidden;
|
84 |
-
padding: 0px;
|
85 |
-
position: relative;
|
86 |
-
width: 24px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 20px later */
|
87 |
-
}
|
88 |
-
.jPicker div[class="Bar"] {
|
89 |
-
height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
90 |
-
width: 20px; /* correct to 20px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
91 |
-
}
|
92 |
-
.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3, .jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4, .jPicker .Bar .Map5, .jPicker .Bar .Map6 {
|
93 |
-
background-color: transparent;
|
94 |
-
background-image: none;
|
95 |
-
display: block;
|
96 |
-
left: 0px;
|
97 |
-
position: absolute;
|
98 |
-
top: 0px;
|
99 |
-
}
|
100 |
-
.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3 {
|
101 |
-
height: 2596px;
|
102 |
-
width: 256px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
|
103 |
-
would not be drawn if its overflow is set to hidden. */
|
104 |
-
}
|
105 |
-
.jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 {
|
106 |
-
height: 3896px;
|
107 |
-
width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
|
108 |
-
would not be drawn if its overflow is set to hidden. */
|
109 |
-
}
|
110 |
-
.jPicker .Bar .Map5, .jPicker .Bar .Map6 {
|
111 |
-
height: 256px;
|
112 |
-
width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
|
113 |
-
would not be drawn if its overflow is set to hidden. */
|
114 |
-
}
|
115 |
-
.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Bar .Map6 {
|
116 |
-
background-repeat: no-repeat;
|
117 |
-
}
|
118 |
-
.jPicker .Map .Map3, .jPicker .Bar .Map5 {
|
119 |
-
background-repeat: repeat;
|
120 |
-
}
|
121 |
-
.jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 {
|
122 |
-
background-repeat: repeat-x;
|
123 |
-
}
|
124 |
-
.jPicker .Map .Arrow {
|
125 |
-
display: block;
|
126 |
-
position: absolute;
|
127 |
-
}
|
128 |
-
.jPicker .Bar .Arrow {
|
129 |
-
display: block;
|
130 |
-
left: 0px; /* (arrow width / 2) - (element width / 2) - position arrows' center in elements' center */
|
131 |
-
position: absolute;
|
132 |
-
}
|
133 |
-
.jPicker .Preview {
|
134 |
-
font-size: 9px;
|
135 |
-
padding: 5px 0px 0px 0px;
|
136 |
-
text-align: center;
|
137 |
-
}
|
138 |
-
.jPicker .Preview div {
|
139 |
-
border: 2px inset #eee;
|
140 |
-
height: 62px;
|
141 |
-
margin: 0px auto;
|
142 |
-
padding: 0px;
|
143 |
-
width: 62px;
|
144 |
-
}
|
145 |
-
.jPicker .Preview div span {
|
146 |
-
border: 1px solid #000;
|
147 |
-
display: block;
|
148 |
-
height: 30px;
|
149 |
-
margin: 0px auto;
|
150 |
-
padding: 0px;
|
151 |
-
width: 60px;
|
152 |
-
}
|
153 |
-
.jPicker .Preview .Active {
|
154 |
-
border-bottom-width: 0px;
|
155 |
-
}
|
156 |
-
.jPicker .Preview .Current {
|
157 |
-
border-top-width: 0px;
|
158 |
-
cursor: pointer;
|
159 |
-
}
|
160 |
-
.jPicker input {
|
161 |
-
font-size: 13px;
|
162 |
-
}
|
163 |
-
.jPicker .Button {
|
164 |
-
text-align: center;
|
165 |
-
padding: 0px 4px;
|
166 |
-
width: 115px;
|
167 |
-
}
|
168 |
-
.jPicker .Button input {
|
169 |
-
padding: 2px 0px;
|
170 |
-
width: 100px;
|
171 |
-
}
|
172 |
-
.jPicker .Button .Ok {
|
173 |
-
margin: 12px 0px 5px 0px;
|
174 |
-
}
|
175 |
-
.jPicker td {
|
176 |
-
margin: 0px;
|
177 |
-
padding: 0px;
|
178 |
-
}
|
179 |
-
.jPicker td.Radio {
|
180 |
-
margin: 0px;
|
181 |
-
padding: 0px;
|
182 |
-
width: 31px;
|
183 |
-
}
|
184 |
-
.jPicker td.Radio input {
|
185 |
-
margin: 0px 5px 0px 0px;
|
186 |
-
padding: 0px;
|
187 |
-
}
|
188 |
-
.jPicker td.Text {
|
189 |
-
font-size: 12px !important;
|
190 |
-
height: 22px;
|
191 |
-
margin: 0px;
|
192 |
-
padding: 0px;
|
193 |
-
text-align: left;
|
194 |
-
width: 70px;
|
195 |
-
}
|
196 |
-
.jPicker tr.Hex td.Text {
|
197 |
-
width: 100px;
|
198 |
-
}
|
199 |
-
.jPicker td.Text input {
|
200 |
-
background-color: #fff;
|
201 |
-
border: 1px inset #aaa;
|
202 |
-
height: 19px;
|
203 |
-
margin: 0px 0px 0px 5px;
|
204 |
-
text-align: left;
|
205 |
-
width: 30px;
|
206 |
-
}
|
207 |
-
.jPicker td[class="Text"] input {
|
208 |
-
height: 15px;
|
209 |
-
}
|
210 |
-
.jPicker tr.Hex td.Text input.Hex {
|
211 |
-
width: 50px;
|
212 |
-
}
|
213 |
-
.jPicker tr.Hex td.Text input.AHex {
|
214 |
-
width: 20px;
|
215 |
-
}
|
216 |
-
.jPicker .Grid {
|
217 |
-
text-align: center;
|
218 |
-
width: 114px;
|
219 |
-
}
|
220 |
-
.jPicker .Grid span.QuickColor {
|
221 |
-
border: 1px inset #aaa;
|
222 |
-
cursor: pointer;
|
223 |
-
display: inline-block;
|
224 |
-
height: 15px;
|
225 |
-
line-height: 15px;
|
226 |
-
margin: 0px;
|
227 |
-
padding: 0px;
|
228 |
-
width: 19px;
|
229 |
-
}
|
230 |
-
.jPicker .Grid span[class="QuickColor"] {
|
231 |
-
width: 17px;
|
232 |
}
|
1 |
+
.jPicker .Icon {
|
2 |
+
display: inline-block;
|
3 |
+
height: 24px; /* change this value if using a different sized color picker icon */
|
4 |
+
position: relative; /* make this element an absolute positioning container */
|
5 |
+
text-align: left; /* make the zero width children position to the left of container */
|
6 |
+
width: 25px; /* change this value if using a different sized color picker icon */
|
7 |
+
}
|
8 |
+
.jPicker .Icon span.Color, .jPicker .Icon span.Alpha {
|
9 |
+
background-position: 2px 2px;
|
10 |
+
display: block;
|
11 |
+
height: 100%;
|
12 |
+
left: 0px;
|
13 |
+
position: absolute;
|
14 |
+
top: 0px;
|
15 |
+
width: 100%;
|
16 |
+
}
|
17 |
+
.jPicker .Icon span.Image {
|
18 |
+
background-repeat: no-repeat;
|
19 |
+
cursor: pointer;
|
20 |
+
display: block;
|
21 |
+
height: 100%;
|
22 |
+
left: 0px;
|
23 |
+
position: absolute;
|
24 |
+
top: 0px;
|
25 |
+
width: 100%;
|
26 |
+
}
|
27 |
+
.jPicker.Container {
|
28 |
+
color: #000;
|
29 |
+
z-index: 10;
|
30 |
+
}
|
31 |
+
table.jPicker {
|
32 |
+
background-color: #efefef;
|
33 |
+
border: 1px outset #666;
|
34 |
+
font-family: Arial, Helvetica, Sans-Serif;
|
35 |
+
font-size: 12px !important;
|
36 |
+
margin: 0px;
|
37 |
+
padding: 5px;
|
38 |
+
width: 545px;
|
39 |
+
z-index: 20;
|
40 |
+
}
|
41 |
+
.jPicker .Move {
|
42 |
+
background-color: #dddddd;
|
43 |
+
border-color: #fff #666 #666 #fff;
|
44 |
+
border-style: solid;
|
45 |
+
border-width: 1px;
|
46 |
+
cursor: move;
|
47 |
+
height: 12px;
|
48 |
+
padding: 0px;
|
49 |
+
}
|
50 |
+
.jPicker .Title {
|
51 |
+
font-size: 11px !important;
|
52 |
+
font-weight: bold;
|
53 |
+
margin: -2px 0px 0px 0px;
|
54 |
+
padding: 10px 0px 0px 0px;
|
55 |
+
text-align: center;
|
56 |
+
width: 100%;
|
57 |
+
}
|
58 |
+
.jPicker div.Map {
|
59 |
+
border-bottom: 2px solid #fff;
|
60 |
+
border-left: 2px solid #9a9a9a;
|
61 |
+
border-right: 2px solid #fff;
|
62 |
+
border-top: 2px solid #9a9a9a;
|
63 |
+
cursor: crosshair;
|
64 |
+
height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
|
65 |
+
margin: 0px 10px 10px 10px;
|
66 |
+
overflow: hidden; /* hide the overdraw of the Color Map icon when at edge of viewing box */
|
67 |
+
padding: 0px;
|
68 |
+
position: relative; /* make this element an absolute positioning container */
|
69 |
+
width: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
|
70 |
+
}
|
71 |
+
.jPicker div[class="Map"] {
|
72 |
+
height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
73 |
+
width: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
74 |
+
}
|
75 |
+
.jPicker div.Bar {
|
76 |
+
border-bottom: 2px solid #fff;
|
77 |
+
border-left: 2px solid #9a9a9a;
|
78 |
+
border-right: 2px solid #fff;
|
79 |
+
border-top: 2px solid #9a9a9a;
|
80 |
+
cursor: n-resize;
|
81 |
+
height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
|
82 |
+
margin: 12px 10px 0px 5px;
|
83 |
+
overflow: hidden;
|
84 |
+
padding: 0px;
|
85 |
+
position: relative;
|
86 |
+
width: 24px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 20px later */
|
87 |
+
}
|
88 |
+
.jPicker div[class="Bar"] {
|
89 |
+
height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
90 |
+
width: 20px; /* correct to 20px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
91 |
+
}
|
92 |
+
.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3, .jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4, .jPicker .Bar .Map5, .jPicker .Bar .Map6 {
|
93 |
+
background-color: transparent;
|
94 |
+
background-image: none;
|
95 |
+
display: block;
|
96 |
+
left: 0px;
|
97 |
+
position: absolute;
|
98 |
+
top: 0px;
|
99 |
+
}
|
100 |
+
.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3 {
|
101 |
+
height: 2596px;
|
102 |
+
width: 256px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
|
103 |
+
would not be drawn if its overflow is set to hidden. */
|
104 |
+
}
|
105 |
+
.jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 {
|
106 |
+
height: 3896px;
|
107 |
+
width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
|
108 |
+
would not be drawn if its overflow is set to hidden. */
|
109 |
+
}
|
110 |
+
.jPicker .Bar .Map5, .jPicker .Bar .Map6 {
|
111 |
+
height: 256px;
|
112 |
+
width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
|
113 |
+
would not be drawn if its overflow is set to hidden. */
|
114 |
+
}
|
115 |
+
.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Bar .Map6 {
|
116 |
+
background-repeat: no-repeat;
|
117 |
+
}
|
118 |
+
.jPicker .Map .Map3, .jPicker .Bar .Map5 {
|
119 |
+
background-repeat: repeat;
|
120 |
+
}
|
121 |
+
.jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 {
|
122 |
+
background-repeat: repeat-x;
|
123 |
+
}
|
124 |
+
.jPicker .Map .Arrow {
|
125 |
+
display: block;
|
126 |
+
position: absolute;
|
127 |
+
}
|
128 |
+
.jPicker .Bar .Arrow {
|
129 |
+
display: block;
|
130 |
+
left: 0px; /* (arrow width / 2) - (element width / 2) - position arrows' center in elements' center */
|
131 |
+
position: absolute;
|
132 |
+
}
|
133 |
+
.jPicker .Preview {
|
134 |
+
font-size: 9px;
|
135 |
+
padding: 5px 0px 0px 0px;
|
136 |
+
text-align: center;
|
137 |
+
}
|
138 |
+
.jPicker .Preview div {
|
139 |
+
border: 2px inset #eee;
|
140 |
+
height: 62px;
|
141 |
+
margin: 0px auto;
|
142 |
+
padding: 0px;
|
143 |
+
width: 62px;
|
144 |
+
}
|
145 |
+
.jPicker .Preview div span {
|
146 |
+
border: 1px solid #000;
|
147 |
+
display: block;
|
148 |
+
height: 30px;
|
149 |
+
margin: 0px auto;
|
150 |
+
padding: 0px;
|
151 |
+
width: 60px;
|
152 |
+
}
|
153 |
+
.jPicker .Preview .Active {
|
154 |
+
border-bottom-width: 0px;
|
155 |
+
}
|
156 |
+
.jPicker .Preview .Current {
|
157 |
+
border-top-width: 0px;
|
158 |
+
cursor: pointer;
|
159 |
+
}
|
160 |
+
.jPicker input {
|
161 |
+
font-size: 13px;
|
162 |
+
}
|
163 |
+
.jPicker .Button {
|
164 |
+
text-align: center;
|
165 |
+
padding: 0px 4px;
|
166 |
+
width: 115px;
|
167 |
+
}
|
168 |
+
.jPicker .Button input {
|
169 |
+
padding: 2px 0px;
|
170 |
+
width: 100px;
|
171 |
+
}
|
172 |
+
.jPicker .Button .Ok {
|
173 |
+
margin: 12px 0px 5px 0px;
|
174 |
+
}
|
175 |
+
.jPicker td {
|
176 |
+
margin: 0px;
|
177 |
+
padding: 0px;
|
178 |
+
}
|
179 |
+
.jPicker td.Radio {
|
180 |
+
margin: 0px;
|
181 |
+
padding: 0px;
|
182 |
+
width: 31px;
|
183 |
+
}
|
184 |
+
.jPicker td.Radio input {
|
185 |
+
margin: 0px 5px 0px 0px;
|
186 |
+
padding: 0px;
|
187 |
+
}
|
188 |
+
.jPicker td.Text {
|
189 |
+
font-size: 12px !important;
|
190 |
+
height: 22px;
|
191 |
+
margin: 0px;
|
192 |
+
padding: 0px;
|
193 |
+
text-align: left;
|
194 |
+
width: 70px;
|
195 |
+
}
|
196 |
+
.jPicker tr.Hex td.Text {
|
197 |
+
width: 100px;
|
198 |
+
}
|
199 |
+
.jPicker td.Text input {
|
200 |
+
background-color: #fff;
|
201 |
+
border: 1px inset #aaa;
|
202 |
+
height: 19px;
|
203 |
+
margin: 0px 0px 0px 5px;
|
204 |
+
text-align: left;
|
205 |
+
width: 30px;
|
206 |
+
}
|
207 |
+
.jPicker td[class="Text"] input {
|
208 |
+
height: 15px;
|
209 |
+
}
|
210 |
+
.jPicker tr.Hex td.Text input.Hex {
|
211 |
+
width: 50px;
|
212 |
+
}
|
213 |
+
.jPicker tr.Hex td.Text input.AHex {
|
214 |
+
width: 20px;
|
215 |
+
}
|
216 |
+
.jPicker .Grid {
|
217 |
+
text-align: center;
|
218 |
+
width: 114px;
|
219 |
+
}
|
220 |
+
.jPicker .Grid span.QuickColor {
|
221 |
+
border: 1px inset #aaa;
|
222 |
+
cursor: pointer;
|
223 |
+
display: inline-block;
|
224 |
+
height: 15px;
|
225 |
+
line-height: 15px;
|
226 |
+
margin: 0px;
|
227 |
+
padding: 0px;
|
228 |
+
width: 19px;
|
229 |
+
}
|
230 |
+
.jPicker .Grid span[class="QuickColor"] {
|
231 |
+
width: 17px;
|
232 |
}
|
js/libraries/jpicker/css/jPicker.css
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
@media all
|
2 |
-
{
|
3 |
-
#jPicker { margin: 0px 8px; text-align: left; }
|
4 |
-
#jPicker ul { font-size: 15px; margin: 0px 0px 0px 15px; padding: 0px; }
|
5 |
-
#jPicker ul li { list-style: disc; padding: 2px 0px; }
|
6 |
-
#jPicker ul li ul { margin-bottom: 10px; }
|
7 |
-
#jPicker ul li ul li { list-style: circle; }
|
8 |
-
#jPicker p { font-size: 13px; padding: 0px 10px; }
|
9 |
-
#jPicker hr { clear: both; }
|
10 |
-
#jPicker h2.jPicker { font-size: 16px; padding: 20px 10px; }
|
11 |
-
#jPicker code { color: #8bd; font-size: 14px; font-weight: bold; }
|
12 |
-
#jPicker pre { background: #eee; border: 1px solid #000; color: #000; display: block; font-size: 11px; margin: 10px 5px; padding: 5px; }
|
13 |
-
#jPicker span { font-size: 13px; text-align: center; }
|
14 |
-
#jPicker a { color: #ff8050; }
|
15 |
-
#jPicker input { font-size: 13px; padding: 2px 5px; }
|
16 |
-
#jPicker h2 { font-size: 16px; margin: 10px 0px; }
|
17 |
}
|
1 |
+
@media all
|
2 |
+
{
|
3 |
+
#jPicker { margin: 0px 8px; text-align: left; }
|
4 |
+
#jPicker ul { font-size: 15px; margin: 0px 0px 0px 15px; padding: 0px; }
|
5 |
+
#jPicker ul li { list-style: disc; padding: 2px 0px; }
|
6 |
+
#jPicker ul li ul { margin-bottom: 10px; }
|
7 |
+
#jPicker ul li ul li { list-style: circle; }
|
8 |
+
#jPicker p { font-size: 13px; padding: 0px 10px; }
|
9 |
+
#jPicker hr { clear: both; }
|
10 |
+
#jPicker h2.jPicker { font-size: 16px; padding: 20px 10px; }
|
11 |
+
#jPicker code { color: #8bd; font-size: 14px; font-weight: bold; }
|
12 |
+
#jPicker pre { background: #eee; border: 1px solid #000; color: #000; display: block; font-size: 11px; margin: 10px 5px; padding: 5px; }
|
13 |
+
#jPicker span { font-size: 13px; text-align: center; }
|
14 |
+
#jPicker a { color: #ff8050; }
|
15 |
+
#jPicker input { font-size: 13px; padding: 2px 5px; }
|
16 |
+
#jPicker h2 { font-size: 16px; margin: 10px 0px; }
|
17 |
}
|
js/libraries/jquery-datepicker/jquery.timepicker.css
CHANGED
@@ -1,51 +1,51 @@
|
|
1 |
-
.ui-timepicker-list {
|
2 |
-
overflow-y: auto;
|
3 |
-
height: 150px;
|
4 |
-
width: 6.5em;
|
5 |
-
background: #fff;
|
6 |
-
border: 1px solid #ddd;
|
7 |
-
margin: 0;
|
8 |
-
padding: 0;
|
9 |
-
list-style: none;
|
10 |
-
-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
11 |
-
-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
12 |
-
box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
13 |
-
outline: none;
|
14 |
-
z-index: 10001;
|
15 |
-
}
|
16 |
-
|
17 |
-
.ui-timepicker-list.ui-timepicker-with-duration {
|
18 |
-
width: 11em;
|
19 |
-
}
|
20 |
-
|
21 |
-
.ui-timepicker-duration {
|
22 |
-
margin-left: 5px; color: #888;
|
23 |
-
}
|
24 |
-
|
25 |
-
.ui-timepicker-list:hover .ui-timepicker-duration {
|
26 |
-
color: #888;
|
27 |
-
}
|
28 |
-
|
29 |
-
.ui-timepicker-list li {
|
30 |
-
padding: 3px 0 3px 5px;
|
31 |
-
cursor: pointer;
|
32 |
-
white-space: nowrap;
|
33 |
-
color: #000;
|
34 |
-
list-style: none;
|
35 |
-
margin: 0;
|
36 |
-
}
|
37 |
-
|
38 |
-
.ui-timepicker-list:hover .ui-timepicker-selected {
|
39 |
-
background: #fff; color: #000;
|
40 |
-
}
|
41 |
-
|
42 |
-
li.ui-timepicker-selected,
|
43 |
-
.ui-timepicker-list li:hover,
|
44 |
-
.ui-timepicker-list:hover .ui-timepicker-selected:hover {
|
45 |
-
background: #1980EC; color: #fff;
|
46 |
-
}
|
47 |
-
|
48 |
-
li.ui-timepicker-selected .ui-timepicker-duration,
|
49 |
-
.ui-timepicker-list li:hover .ui-timepicker-duration {
|
50 |
-
color: #ccc;
|
51 |
-
}
|
1 |
+
.ui-timepicker-list {
|
2 |
+
overflow-y: auto;
|
3 |
+
height: 150px;
|
4 |
+
width: 6.5em;
|
5 |
+
background: #fff;
|
6 |
+
border: 1px solid #ddd;
|
7 |
+
margin: 0;
|
8 |
+
padding: 0;
|
9 |
+
list-style: none;
|
10 |
+
-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
11 |
+
-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
12 |
+
box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
13 |
+
outline: none;
|
14 |
+
z-index: 10001;
|
15 |
+
}
|
16 |
+
|
17 |
+
.ui-timepicker-list.ui-timepicker-with-duration {
|
18 |
+
width: 11em;
|
19 |
+
}
|
20 |
+
|
21 |
+
.ui-timepicker-duration {
|
22 |
+
margin-left: 5px; color: #888;
|
23 |
+
}
|
24 |
+
|
25 |
+
.ui-timepicker-list:hover .ui-timepicker-duration {
|
26 |
+
color: #888;
|
27 |
+
}
|
28 |
+
|
29 |
+
.ui-timepicker-list li {
|
30 |
+
padding: 3px 0 3px 5px;
|
31 |
+
cursor: pointer;
|
32 |
+
white-space: nowrap;
|
33 |
+
color: #000;
|
34 |
+
list-style: none;
|
35 |
+
margin: 0;
|
36 |
+
}
|
37 |
+
|
38 |
+
.ui-timepicker-list:hover .ui-timepicker-selected {
|
39 |
+
background: #fff; color: #000;
|
40 |
+
}
|
41 |
+
|
42 |
+
li.ui-timepicker-selected,
|
43 |
+
.ui-timepicker-list li:hover,
|
44 |
+
.ui-timepicker-list:hover .ui-timepicker-selected:hover {
|
45 |
+
background: #1980EC; color: #fff;
|
46 |
+
}
|
47 |
+
|
48 |
+
li.ui-timepicker-selected .ui-timepicker-duration,
|
49 |
+
.ui-timepicker-list li:hover .ui-timepicker-duration {
|
50 |
+
color: #ccc;
|
51 |
+
}
|
js/libraries/jquery-datepicker/jquery.timepicker.min.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
(function(e){typeof define=="function"&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function o(t){var r=t.data("timepicker-settings"),i=t.data("timepicker-list");i&&i.length&&(i.remove(),t.data("timepicker-list",!1)),i=e("<ul />",{tabindex:-1,"class":"ui-timepicker-list"}),r.className&&i.addClass(r.className),i.css({display:"none",position:"absolute"}),(r.minTime!==null||r.durationTime!==null)&&r.showDuration&&i.addClass("ui-timepicker-with-duration");var s=r.durationTime!==null?r.durationTime:r.minTime,o=r.minTime!==null?r.minTime:0,u=r.maxTime!==null?r.maxTime:o+n-1;u<=o&&(u+=n);for(var a=o;a<=u;a+=r.step*60){var f=a%n,l=e("<li />");l.data("time",f),l.text(m(f,r.timeFormat));if((r.minTime!==null||r.durationTime!==null)&&r.showDuration){var h=e("<span />");h.addClass("ui-timepicker-duration"),h.text(" ("+v(a-s)+")"),l.append(h)}i.append(l)}i.data("timepicker-input",t),t.data("timepicker-list",i);var p=r.appendTo;typeof p=="string"?p=e(p):typeof p=="function"&&(p=p(t)),p.append(i),c(t,i),i.on("click","li",function(n){t.addClass("ui-timepicker-hideme"),t[0].focus(),i.find("li").removeClass("ui-timepicker-selected"),e(this).addClass("ui-timepicker-selected"),d(t),i.hide()})}function u(){var e=new Date,t=e.getTimezoneOffset()*6e4;e.setHours(0),e.setMinutes(0),e.setSeconds(0);var n=e.getTimezoneOffset()*6e4;return new Date(e.valueOf()-n+t)}function a(){"ontouchstart"in document?e("body").on("touchstart.ui-timepicker",f):(e("body").on("mousedown.ui-timepicker",f),e(window).on("scroll.ui-timepicker",f))}function f(t){var n=e(t.target),r=n.closest(".ui-timepicker-input");r.length===0&&n.closest(".ui-timepicker-list").length===0&&s.hide(),e("body").unbind(".ui-timepicker"),e(window).unbind(".ui-timepicker")}function l(t,n,r){if(!r&&r!==0)return!1;var i=t.data("timepicker-settings"),s=!1,o=i.step*30;return n.find("li").each(function(t,n){var i=e(n),u=i.data("time")-r;if(Math.abs(u)<o||u==o)return s=i,!1}),s}function c(e,t){var n=g(e.val()),r=l(e,t,n);r&&r.addClass("ui-timepicker-selected")}function h(){if(this.value==="")return;var t=e(this),n=g(this.value);if(n===null){t.trigger("timeFormatError");return}var r=t.data("timepicker-settings");if(r.forceRoundTime){var i=n%(r.step*60);i>=r.step*30?n+=r.step*60-i:n-=i}var s=m(n,r.timeFormat);t.val(s)}function p(t){var n=e(this),r=n.data("timepicker-list");if(!r.is(":visible")){if(t.keyCode!=40)return!0;n.focus()}switch(t.keyCode){case 13:return d(n),s.hide.apply(this),t.preventDefault(),!1;case 38:var i=r.find(".ui-timepicker-selected");i.length?i.is(":first-child")||(i.removeClass("ui-timepicker-selected"),i.prev().addClass("ui-timepicker-selected"),i.prev().position().top<i.outerHeight()&&r.scrollTop(r.scrollTop()-i.outerHeight())):(r.children().each(function(t,n){if(e(n).position().top>0)return i=e(n),!1}),i.addClass("ui-timepicker-selected"));break;case 40:i=r.find(".ui-timepicker-selected"),i.length===0?(r.children().each(function(t,n){if(e(n).position().top>0)return i=e(n),!1}),i.addClass("ui-timepicker-selected")):i.is(":last-child")||(i.removeClass("ui-timepicker-selected"),i.next().addClass("ui-timepicker-selected"),i.next().position().top+2*i.outerHeight()>r.outerHeight()&&r.scrollTop(r.scrollTop()+i.outerHeight()));break;case 27:r.find("li").removeClass("ui-timepicker-selected"),r.hide();break;case 9:s.hide();break;case 16:case 17:case 18:case 19:case 20:case 33:case 34:case 35:case 36:case 37:case 39:case 45:return;default:r.find("li").removeClass("ui-timepicker-selected");return}}function d(e){var t=e.data("timepicker-settings"),n=e.data("timepicker-list"),r=null,i=n.find(".ui-timepicker-selected");i.length?r=i.data("time"):e.val()&&(r=g(e.val()),c(e,n));if(r!==null){var s=m(r,t.timeFormat);e.val(s)}e.trigger("change").trigger("changeTime")}function v(e){var t=Math.round(e/60),n;if(Math.abs(t)<60)n=[t,i.mins];else if(t==60)n=["1",i.hr];else{var r=(t/60).toFixed(1);i.decimal!="."&&(r=r.replace(".",i.decimal)),n=[r,i.hrs]}return n.join(" ")}function m(e,n){if(e===null)return;var r=new Date(t.valueOf()+e*1e3),i="",s,o;for(var u=0;u<n.length;u++){o=n.charAt(u);switch(o){case"a":i+=r.getHours()>11?"pm":"am";break;case"A":i+=r.getHours()>11?"PM":"AM";break;case"g":s=r.getHours()%12,i+=s===0?"12":s;break;case"G":i+=r.getHours();break;case"h":s=r.getHours()%12,s!==0&&s<10&&(s="0"+s),i+=s===0?"12":s;break;case"H":s=r.getHours(),i+=s>9?s:"0"+s;break;case"i":var a=r.getMinutes();i+=a>9?a:"0"+a;break;case"s":e=r.getSeconds(),i+=e>9?e:"0"+e;break;default:i+=o}}return i}function g(e){if(e==="")return null;if(e+0==e)return e;typeof e=="object"&&(e=e.getHours()+":"+e.getMinutes()+":"+e.getSeconds());var t=new Date(0),n=e.toLowerCase().match(/(\d{1,2})(?::(\d{1,2}))?(?::(\d{2}))?\s*([pa]?)/);if(!n)return null;var r=parseInt(n[1]*1,10),i;n[4]?r==12?i=n[4]=="p"?12:0:i=r+(n[4]=="p"?12:0):i=r;var s=n[2]*1||0,o=n[3]*1||0;return i*3600+s*60+o}var t=u(),n=86400,r={className:null,minTime:null,maxTime:null,durationTime:null,step:30,showDuration:!1,timeFormat:"g:ia",scrollDefaultNow:!1,scrollDefaultTime:!1,selectOnBlur:!1,forceRoundTime:!1,appendTo:"body"},i={decimal:".",mins:"mins",hr:"hr",hrs:"hrs"},s={init:function(t){return this.each(function(){var n=e(this);if(n[0].tagName=="SELECT"){var o={type:"text",value:n.val()},u=n[0].attributes;for(var a=0;a<u.length;a++)o[u[a].nodeName]=u[a].nodeValue;var f=e("<input />",o);n.replaceWith(f),n=f}var l=e.extend({},r);t&&(l=e.extend(l,t)),l.minTime&&(l.minTime=g(l.minTime)),l.maxTime&&(l.maxTime=g(l.maxTime)),l.durationTime&&(l.durationTime=g(l.durationTime)),l.lang&&(i=e.extend(i,l.lang)),n.data("timepicker-settings",l),n.prop("autocomplete","off"),n.on("click.timepicker focus.timepicker",s.show),n.on("blur.timepicker",h),n.on("keydown.timepicker",p),n.addClass("ui-timepicker-input"),h.call(n.get(0))})},show:function(t){var n=e(this);"ontouchstart"in document&&n.blur();var r=n.data("timepicker-list");if(n.prop("readonly"))return;if(!r||r.length===0)o(n),r=n.data("timepicker-list");if(n.hasClass("ui-timepicker-hideme")){n.removeClass("ui-timepicker-hideme"),r.hide();return}if(r.is(":visible"))return;s.hide(),n.offset().top+n.outerHeight(!0)+r.outerHeight()>e(window).height()+e(window).scrollTop()?r.css({left:n.offset().left,top:n.offset().top-r.outerHeight()}):r.css({left:n.offset().left,top:n.offset().top+n.outerHeight()}),r.show();var i=n.data("timepicker-settings"),u=r.find(".ui-timepicker-selected");u.length||(n.val()?u=l(n,r,g(n.val())):i.scrollDefaultNow?u=l(n,r,g(new Date)):i.scrollDefaultTime!==!1&&(u=l(n,r,g(i.scrollDefaultTime))));if(u&&u.length){var f=r.scrollTop()+u.position().top-u.outerHeight();r.scrollTop(f)}else r.scrollTop(0);a(),n.trigger("showTimepicker")},hide:function(t){e(".ui-timepicker-list:visible").each(function(){var t=e(this),n=t.data("timepicker-input"),r=n.data("timepicker-settings");r&&r.selectOnBlur&&d(n),t.hide(),n.trigger("hideTimepicker")})},option:function(t,n){var r=e(this),i=r.data("timepicker-settings"),s=r.data("timepicker-list");if(typeof t=="object")i=e.extend(i,t);else if(typeof t=="string"&&typeof n!="undefined")i[t]=n;else if(typeof t=="string")return i[t];i.minTime&&(i.minTime=g(i.minTime)),i.maxTime&&(i.maxTime=g(i.maxTime)),i.durationTime&&(i.durationTime=g(i.durationTime)),r.data("timepicker-settings",i),s&&(s.remove(),r.data("timepicker-list",!1))},getSecondsFromMidnight:function(){return g(e(this).val())},getTime:function(){return new Date(t.valueOf()+g(e(this).val())*1e3)},setTime:function(t){var n=e(this),r=m(g(t),n.data("timepicker-settings").timeFormat);n.val(r)},remove:function(){var t=e(this);if(!t.hasClass("ui-timepicker-input"))return;t.removeAttr("autocomplete","off"),t.removeClass("ui-timepicker-input"),t.removeData("timepicker-settings"),t.off(".timepicker"),t.data("timepicker-list")&&t.data("timepicker-list").remove(),t.removeData("timepicker-list")}};e.fn.timepicker=function(t){if(s[t])return s[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return s.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timepicker")}});
|
3 |
});
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
(function(e){typeof define=="function"&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function o(t){var r=t.data("timepicker-settings"),i=t.data("timepicker-list");i&&i.length&&(i.remove(),t.data("timepicker-list",!1)),i=e("<ul />",{tabindex:-1,"class":"ui-timepicker-list"}),r.className&&i.addClass(r.className),i.css({display:"none",position:"absolute"}),(r.minTime!==null||r.durationTime!==null)&&r.showDuration&&i.addClass("ui-timepicker-with-duration");var s=r.durationTime!==null?r.durationTime:r.minTime,o=r.minTime!==null?r.minTime:0,u=r.maxTime!==null?r.maxTime:o+n-1;u<=o&&(u+=n);for(var a=o;a<=u;a+=r.step*60){var f=a%n,l=e("<li />");l.data("time",f),l.text(m(f,r.timeFormat));if((r.minTime!==null||r.durationTime!==null)&&r.showDuration){var h=e("<span />");h.addClass("ui-timepicker-duration"),h.text(" ("+v(a-s)+")"),l.append(h)}i.append(l)}i.data("timepicker-input",t),t.data("timepicker-list",i);var p=r.appendTo;typeof p=="string"?p=e(p):typeof p=="function"&&(p=p(t)),p.append(i),c(t,i),i.on("click","li",function(n){t.addClass("ui-timepicker-hideme"),t[0].focus(),i.find("li").removeClass("ui-timepicker-selected"),e(this).addClass("ui-timepicker-selected"),d(t),i.hide()})}function u(){var e=new Date,t=e.getTimezoneOffset()*6e4;e.setHours(0),e.setMinutes(0),e.setSeconds(0);var n=e.getTimezoneOffset()*6e4;return new Date(e.valueOf()-n+t)}function a(){"ontouchstart"in document?e("body").on("touchstart.ui-timepicker",f):(e("body").on("mousedown.ui-timepicker",f),e(window).on("scroll.ui-timepicker",f))}function f(t){var n=e(t.target),r=n.closest(".ui-timepicker-input");r.length===0&&n.closest(".ui-timepicker-list").length===0&&s.hide(),e("body").unbind(".ui-timepicker"),e(window).unbind(".ui-timepicker")}function l(t,n,r){if(!r&&r!==0)return!1;var i=t.data("timepicker-settings"),s=!1,o=i.step*30;return n.find("li").each(function(t,n){var i=e(n),u=i.data("time")-r;if(Math.abs(u)<o||u==o)return s=i,!1}),s}function c(e,t){var n=g(e.val()),r=l(e,t,n);r&&r.addClass("ui-timepicker-selected")}function h(){if(this.value==="")return;var t=e(this),n=g(this.value);if(n===null){t.trigger("timeFormatError");return}var r=t.data("timepicker-settings");if(r.forceRoundTime){var i=n%(r.step*60);i>=r.step*30?n+=r.step*60-i:n-=i}var s=m(n,r.timeFormat);t.val(s)}function p(t){var n=e(this),r=n.data("timepicker-list");if(!r.is(":visible")){if(t.keyCode!=40)return!0;n.focus()}switch(t.keyCode){case 13:return d(n),s.hide.apply(this),t.preventDefault(),!1;case 38:var i=r.find(".ui-timepicker-selected");i.length?i.is(":first-child")||(i.removeClass("ui-timepicker-selected"),i.prev().addClass("ui-timepicker-selected"),i.prev().position().top<i.outerHeight()&&r.scrollTop(r.scrollTop()-i.outerHeight())):(r.children().each(function(t,n){if(e(n).position().top>0)return i=e(n),!1}),i.addClass("ui-timepicker-selected"));break;case 40:i=r.find(".ui-timepicker-selected"),i.length===0?(r.children().each(function(t,n){if(e(n).position().top>0)return i=e(n),!1}),i.addClass("ui-timepicker-selected")):i.is(":last-child")||(i.removeClass("ui-timepicker-selected"),i.next().addClass("ui-timepicker-selected"),i.next().position().top+2*i.outerHeight()>r.outerHeight()&&r.scrollTop(r.scrollTop()+i.outerHeight()));break;case 27:r.find("li").removeClass("ui-timepicker-selected"),r.hide();break;case 9:s.hide();break;case 16:case 17:case 18:case 19:case 20:case 33:case 34:case 35:case 36:case 37:case 39:case 45:return;default:r.find("li").removeClass("ui-timepicker-selected");return}}function d(e){var t=e.data("timepicker-settings"),n=e.data("timepicker-list"),r=null,i=n.find(".ui-timepicker-selected");i.length?r=i.data("time"):e.val()&&(r=g(e.val()),c(e,n));if(r!==null){var s=m(r,t.timeFormat);e.val(s)}e.trigger("change").trigger("changeTime")}function v(e){var t=Math.round(e/60),n;if(Math.abs(t)<60)n=[t,i.mins];else if(t==60)n=["1",i.hr];else{var r=(t/60).toFixed(1);i.decimal!="."&&(r=r.replace(".",i.decimal)),n=[r,i.hrs]}return n.join(" ")}function m(e,n){if(e===null)return;var r=new Date(t.valueOf()+e*1e3),i="",s,o;for(var u=0;u<n.length;u++){o=n.charAt(u);switch(o){case"a":i+=r.getHours()>11?"pm":"am";break;case"A":i+=r.getHours()>11?"PM":"AM";break;case"g":s=r.getHours()%12,i+=s===0?"12":s;break;case"G":i+=r.getHours();break;case"h":s=r.getHours()%12,s!==0&&s<10&&(s="0"+s),i+=s===0?"12":s;break;case"H":s=r.getHours(),i+=s>9?s:"0"+s;break;case"i":var a=r.getMinutes();i+=a>9?a:"0"+a;break;case"s":e=r.getSeconds(),i+=e>9?e:"0"+e;break;default:i+=o}}return i}function g(e){if(e==="")return null;if(e+0==e)return e;typeof e=="object"&&(e=e.getHours()+":"+e.getMinutes()+":"+e.getSeconds());var t=new Date(0),n=e.toLowerCase().match(/(\d{1,2})(?::(\d{1,2}))?(?::(\d{2}))?\s*([pa]?)/);if(!n)return null;var r=parseInt(n[1]*1,10),i;n[4]?r==12?i=n[4]=="p"?12:0:i=r+(n[4]=="p"?12:0):i=r;var s=n[2]*1||0,o=n[3]*1||0;return i*3600+s*60+o}var t=u(),n=86400,r={className:null,minTime:null,maxTime:null,durationTime:null,step:30,showDuration:!1,timeFormat:"g:ia",scrollDefaultNow:!1,scrollDefaultTime:!1,selectOnBlur:!1,forceRoundTime:!1,appendTo:"body"},i={decimal:".",mins:"mins",hr:"hr",hrs:"hrs"},s={init:function(t){return this.each(function(){var n=e(this);if(n[0].tagName=="SELECT"){var o={type:"text",value:n.val()},u=n[0].attributes;for(var a=0;a<u.length;a++)o[u[a].nodeName]=u[a].nodeValue;var f=e("<input />",o);n.replaceWith(f),n=f}var l=e.extend({},r);t&&(l=e.extend(l,t)),l.minTime&&(l.minTime=g(l.minTime)),l.maxTime&&(l.maxTime=g(l.maxTime)),l.durationTime&&(l.durationTime=g(l.durationTime)),l.lang&&(i=e.extend(i,l.lang)),n.data("timepicker-settings",l),n.prop("autocomplete","off"),n.on("click.timepicker focus.timepicker",s.show),n.on("blur.timepicker",h),n.on("keydown.timepicker",p),n.addClass("ui-timepicker-input"),h.call(n.get(0))})},show:function(t){var n=e(this);"ontouchstart"in document&&n.blur();var r=n.data("timepicker-list");if(n.prop("readonly"))return;if(!r||r.length===0)o(n),r=n.data("timepicker-list");if(n.hasClass("ui-timepicker-hideme")){n.removeClass("ui-timepicker-hideme"),r.hide();return}if(r.is(":visible"))return;s.hide(),n.offset().top+n.outerHeight(!0)+r.outerHeight()>e(window).height()+e(window).scrollTop()?r.css({left:n.offset().left,top:n.offset().top-r.outerHeight()}):r.css({left:n.offset().left,top:n.offset().top+n.outerHeight()}),r.show();var i=n.data("timepicker-settings"),u=r.find(".ui-timepicker-selected");u.length||(n.val()?u=l(n,r,g(n.val())):i.scrollDefaultNow?u=l(n,r,g(new Date)):i.scrollDefaultTime!==!1&&(u=l(n,r,g(i.scrollDefaultTime))));if(u&&u.length){var f=r.scrollTop()+u.position().top-u.outerHeight();r.scrollTop(f)}else r.scrollTop(0);a(),n.trigger("showTimepicker")},hide:function(t){e(".ui-timepicker-list:visible").each(function(){var t=e(this),n=t.data("timepicker-input"),r=n.data("timepicker-settings");r&&r.selectOnBlur&&d(n),t.hide(),n.trigger("hideTimepicker")})},option:function(t,n){var r=e(this),i=r.data("timepicker-settings"),s=r.data("timepicker-list");if(typeof t=="object")i=e.extend(i,t);else if(typeof t=="string"&&typeof n!="undefined")i[t]=n;else if(typeof t=="string")return i[t];i.minTime&&(i.minTime=g(i.minTime)),i.maxTime&&(i.maxTime=g(i.maxTime)),i.durationTime&&(i.durationTime=g(i.durationTime)),r.data("timepicker-settings",i),s&&(s.remove(),r.data("timepicker-list",!1))},getSecondsFromMidnight:function(){return g(e(this).val())},getTime:function(){return new Date(t.valueOf()+g(e(this).val())*1e3)},setTime:function(t){var n=e(this),r=m(g(t),n.data("timepicker-settings").timeFormat);n.val(r)},remove:function(){var t=e(this);if(!t.hasClass("ui-timepicker-input"))return;t.removeAttr("autocomplete","off"),t.removeClass("ui-timepicker-input"),t.removeData("timepicker-settings"),t.off(".timepicker"),t.data("timepicker-list")&&t.data("timepicker-list").remove(),t.removeData("timepicker-list")}};e.fn.timepicker=function(t){if(s[t])return s[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return s.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timepicker")}});
|
3 |
});
|
js/libraries/jquery-datepicker/lib/base.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
/* Rainbow v1.1.8 rainbowco.de | included languages: generic, javascript */
|
2 |
-
window.Rainbow=function(){function q(a){var b,c=a.getAttribute&&a.getAttribute("data-language")||0;if(!c){a=a.attributes;for(b=0;b<a.length;++b)if("data-language"===a[b].nodeName)return a[b].nodeValue}return c}function B(a){var b=q(a)||q(a.parentNode);if(!b){var c=/\blang(?:uage)?-(\w+)/;(a=a.className.match(c)||a.parentNode.className.match(c))&&(b=a[1])}return b}function C(a,b){for(var c in e[d]){c=parseInt(c,10);if(a==c&&b==e[d][c]?0:a<=c&&b>=e[d][c])delete e[d][c],delete j[d][c];if(a>=c&&a<e[d][c]||
|
3 |
-
b>c&&b<e[d][c])return!0}return!1}function r(a,b){return'<span class="'+a.replace(/\./g," ")+(l?" "+l:"")+'">'+b+"</span>"}function s(a,b,c,h){var f=a.exec(c);if(f){++t;!b.name&&"string"==typeof b.matches[0]&&(b.name=b.matches[0],delete b.matches[0]);var k=f[0],i=f.index,u=f[0].length+i,g=function(){function f(){s(a,b,c,h)}t%100>0?f():setTimeout(f,0)};if(C(i,u))g();else{var m=v(b.matches),l=function(a,c,h){if(a>=c.length)h(k);else{var d=f[c[a]];if(d){var e=b.matches[c[a]],i=e.language,g=e.name&&e.matches?
|
4 |
-
e.matches:e,j=function(b,d,e){var i;i=0;var g;for(g=1;g<c[a];++g)f[g]&&(i=i+f[g].length);d=e?r(e,d):d;k=k.substr(0,i)+k.substr(i).replace(b,d);l(++a,c,h)};i?n(d,i,function(a){j(d,a)}):typeof e==="string"?j(d,d,e):w(d,g.length?g:[g],function(a){j(d,a,e.matches?e.name:0)})}else l(++a,c,h)}};l(0,m,function(a){b.name&&(a=r(b.name,a));if(!j[d]){j[d]={};e[d]={}}j[d][i]={replace:f[0],"with":a};e[d][i]=u;g()})}}else h()}function v(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b.sort(function(a,
|
5 |
-
b){return b-a})}function w(a,b,c){function h(b,k){k<b.length?s(b[k].pattern,b[k],a,function(){h(b,++k)}):D(a,function(a){delete j[d];delete e[d];--d;c(a)})}++d;h(b,0)}function D(a,b){function c(a,b,h,e){if(h<b.length){++x;var g=b[h],l=j[d][g],a=a.substr(0,g)+a.substr(g).replace(l.replace,l["with"]),g=function(){c(a,b,++h,e)};0<x%250?g():setTimeout(g,0)}else e(a)}var h=v(j[d]);c(a,h,0,b)}function n(a,b,c){var d=m[b]||[],f=m[y]||[],b=z[b]?d:d.concat(f);w(a.replace(/</g,"<").replace(/>/g,">").replace(/&(?![\w\#]+;)/g,
|
6 |
-
"&"),b,c)}function o(a,b,c){if(b<a.length){var d=a[b],f=B(d);return!(-1<(" "+d.className+" ").indexOf(" rainbow "))&&f?(f=f.toLowerCase(),d.className+=d.className?" rainbow":"rainbow",n(d.innerHTML,f,function(k){d.innerHTML=k;j={};e={};p&&p(d,f);setTimeout(function(){o(a,++b,c)},0)})):o(a,++b,c)}c&&c()}function A(a,b){var a=a&&"function"==typeof a.getElementsByTagName?a:document,c=a.getElementsByTagName("pre"),d=a.getElementsByTagName("code"),f,e=[];for(f=0;f<d.length;++f)e.push(d[f]);for(f=0;f<
|
7 |
-
c.length;++f)c[f].getElementsByTagName("code").length||e.push(c[f]);o(e,0,b)}var j={},e={},m={},z={},d=0,y=0,t=0,x=0,l,p;return{extend:function(a,b,c){1==arguments.length&&(b=a,a=y);z[a]=c;m[a]=b.concat(m[a]||[])},b:function(a){p=a},a:function(a){l=a},color:function(a,b,c){if("string"==typeof a)return n(a,b,c);if("function"==typeof a)return A(0,a);A(a,b)}}}();window.addEventListener?window.addEventListener("load",Rainbow.color,!1):window.attachEvent("onload",Rainbow.color);Rainbow.onHighlight=Rainbow.b;
|
8 |
-
Rainbow.addClass=Rainbow.a;Rainbow.extend([{matches:{1:{name:"keyword.operator",pattern:/\=/g},2:{name:"string",matches:{name:"constant.character.escape",pattern:/\\('|"){1}/g}}},pattern:/(\(|\s|\[|\=|:)(('|")([^\\\1]|\\.)*?(\3))/gm},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm},{name:"constant.numeric",pattern:/\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi},{matches:{1:"keyword"},pattern:/\b(and|array|as|bool(ean)?|c(atch|har|lass|onst)|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi},
|
9 |
-
{name:"constant.language",pattern:/true|false|null/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g},{matches:{1:"function.call"},pattern:/(\w+?)(?=\()/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(function)\s(.*?)(?=\()/g}]);Rainbow.extend("javascript",[{name:"selector",pattern:/(\s|^)\$(?=\.|\()/g},{name:"support",pattern:/\b(window|document)\b/g},{matches:{1:"support.property"},pattern:/\.(length|node(Name|Value))\b/g},{matches:{1:"support.function"},pattern:/(setTimeout|setInterval)(?=\()/g},{matches:{1:"support.method"},pattern:/\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g},{matches:{1:"support.tag.script",2:[{name:"string",pattern:/('|")(.*?)(\1)/g},{name:"entity.tag.script",
|
10 |
-
pattern:/(\w+)/g}],3:"support.tag.script"},pattern:/(<\/?)(script.*?)(>)/g},{name:"string.regexp",matches:{1:"string.regexp.open",2:{name:"constant.regexp.escape",pattern:/\\(.){1}/g},3:"string.regexp.close",4:"string.regexp.modifier"},pattern:/(\/)(?!\*)(.+)(\/)([igm]{0,3})/g},{matches:{1:"storage",3:"entity.function"},pattern:/(var)?(\s|^)(.*)(?=\s?=\s?function\()/g},{name:"entity.function",pattern:/(\w+)(?=:\s{0,}function)/g}]);
|
11 |
-
|
12 |
-
|
13 |
-
// https://github.com/eternicode/bootstrap-datepicker
|
14 |
!function(a){function b(){return new Date(Date.UTC.apply(Date,arguments))}var d=function(b,c){var d=this;switch(this.element=a(b),this.language=c.language||this.element.data("date-language")||"en",this.language=this.language in e?this.language:"en",this.format=f.parseFormat(c.format||this.element.data("date-format")||"mm/dd/yyyy"),this.picker=a(f.template).appendTo("body").on({click:a.proxy(this.click,this)}),this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this._attachEvents(),this.forceParse=!0,"forceParse"in c?this.forceParse=c.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),a(document).on("mousedown",function(b){0==a(b.target).closest(".datepicker").length&&d.hide()}),this.autoclose=!1,"autoclose"in c?this.autoclose=c.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in c?this.keyboardNavigation=c.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),c.startView||this.element.data("date-start-view")){case 2:case"decade":this.viewMode=this.startViewMode=2;break;case 1:case"year":this.viewMode=this.startViewMode=1;break;case 0:case"month":default:this.viewMode=this.startViewMode=0}this.todayBtn=c.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=c.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=(c.weekStart||this.element.data("date-weekstart")||e[this.language].weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-1/0,this.endDate=1/0,this.daysOfWeekDisabled=[],this.setStartDate(c.startDate||this.element.data("date-startdate")),this.setEndDate(c.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(c.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode()};d.prototype={constructor:d,_events:[],_attachEvents:function(){this._detachEvents(),this._events=this.isInput?[[this.element,{focus:a.proxy(this.show,this),keyup:a.proxy(this.update,this),keydown:a.proxy(this.keydown,this)}]]:this.component&&this.hasInput?[[this.element.find("input"),{focus:a.proxy(this.show,this),keyup:a.proxy(this.update,this),keydown:a.proxy(this.keydown,this)}],[this.component,{click:a.proxy(this.show,this)}]]:[[this.element,{click:a.proxy(this.show,this)}]];for(var c,d,b=0;this._events.length>b;b++)c=this._events[b][0],d=this._events[b][1],c.on(d)},_detachEvents:function(){for(var b,c,a=0;this._events.length>a;a++)b=this._events[a][0],c=this._events[a][1],b.off(c);this._events=[]},show:function(b){this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.update(),this.place(),a(window).on("resize",a.proxy(this.place,this)),b&&(b.stopPropagation(),b.preventDefault()),this.element.trigger({type:"show",date:this.date})},hide:function(){this.picker.hide(),a(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||a(document).off("mousedown",this.hide),this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this.element.trigger({type:"hide",date:this.date})},remove:function(){this._detachEvents(),this.picker.remove(),delete this.element.data().datepicker},getDate:function(){var a=this.getUTCDate();return new Date(a.getTime()+6e4*a.getTimezoneOffset())},getUTCDate:function(){return this.date},setDate:function(a){this.setUTCDate(new Date(a.getTime()-6e4*a.getTimezoneOffset()))},setUTCDate:function(a){this.date=a,this.setValue()},setValue:function(){var a=f.formatDate(this.date,this.format,this.language);this.isInput?this.element.prop("value",a):(this.component&&this.element.find("input").prop("value",a),this.element.data("date",a))},setStartDate:function(a){this.startDate=a||-1/0,this.startDate!==-1/0&&(this.startDate=f.parseDate(this.startDate,this.format,this.language)),this.update(),this.updateNavArrows()},setEndDate:function(a){this.endDate=a||1/0,1/0!==this.endDate&&(this.endDate=f.parseDate(this.endDate,this.format,this.language)),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(b){this.daysOfWeekDisabled=b||[],a.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=a.map(this.daysOfWeekDisabled,function(a){return parseInt(a,10)}),this.update(),this.updateNavArrows()},place:function(){var b=parseInt(this.element.parents().filter(function(){return"auto"!=a(this).css("z-index")}).first().css("z-index"))+10,c=this.component?this.component.offset():this.element.offset();this.picker.css({top:c.top+this.height,left:c.left,zIndex:b})},update:function(){this.date=f.parseDate(this.isInput?this.element.prop("value"):this.element.data("date")||this.element.find("input").prop("value"),this.format,this.language),this.viewDate=this.date<this.startDate?new Date(this.startDate):this.date>this.endDate?new Date(this.endDate):new Date(this.date),this.fill()},fillDow:function(){for(var a=this.weekStart,b="<tr>";this.weekStart+7>a;)b+='<th class="dow">'+e[this.language].daysMin[a++%7]+"</th>";b+="</tr>",this.picker.find(".datepicker-days thead").append(b)},fillMonths:function(){for(var a="",b=0;12>b;)a+='<span class="month">'+e[this.language].monthsShort[b++]+"</span>";this.picker.find(".datepicker-months td").html(a)},fill:function(){var c=new Date(this.viewDate),d=c.getUTCFullYear(),g=c.getUTCMonth(),h=this.startDate!==-1/0?this.startDate.getUTCFullYear():-1/0,i=this.startDate!==-1/0?this.startDate.getUTCMonth():-1/0,j=1/0!==this.endDate?this.endDate.getUTCFullYear():1/0,k=1/0!==this.endDate?this.endDate.getUTCMonth():1/0,l=this.date.valueOf(),m=new Date;this.picker.find(".datepicker-days thead th:eq(1)").text(e[this.language].months[g]+" "+d),this.picker.find("tfoot th.today").text(e[this.language].today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var n=b(d,g-1,28,0,0,0,0),o=f.getDaysInMonth(n.getUTCFullYear(),n.getUTCMonth());n.setUTCDate(o),n.setUTCDate(o-(n.getUTCDay()-this.weekStart+7)%7);var p=new Date(n);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();for(var r,q=[];p>n.valueOf();)n.getUTCDay()==this.weekStart&&q.push("<tr>"),r="",d>n.getUTCFullYear()||n.getUTCFullYear()==d&&g>n.getUTCMonth()?r+=" old":(n.getUTCFullYear()>d||n.getUTCFullYear()==d&&n.getUTCMonth()>g)&&(r+=" new"),this.todayHighlight&&n.getUTCFullYear()==m.getFullYear()&&n.getUTCMonth()==m.getMonth()&&n.getUTCDate()==m.getDate()&&(r+=" today"),n.valueOf()==l&&(r+=" active"),(n.valueOf()<this.startDate||n.valueOf()>this.endDate||-1!==a.inArray(n.getUTCDay(),this.daysOfWeekDisabled))&&(r+=" disabled"),q.push('<td class="day'+r+'">'+n.getUTCDate()+"</td>"),n.getUTCDay()==this.weekEnd&&q.push("</tr>"),n.setUTCDate(n.getUTCDate()+1);this.picker.find(".datepicker-days tbody").empty().append(q.join(""));var s=this.date.getUTCFullYear(),t=this.picker.find(".datepicker-months").find("th:eq(1)").text(d).end().find("span").removeClass("active");s==d&&t.eq(this.date.getUTCMonth()).addClass("active"),(h>d||d>j)&&t.addClass("disabled"),d==h&&t.slice(0,i).addClass("disabled"),d==j&&t.slice(k+1).addClass("disabled"),q="",d=10*parseInt(d/10,10);var u=this.picker.find(".datepicker-years").find("th:eq(1)").text(d+"-"+(d+9)).end().find("td");d-=1;for(var v=-1;11>v;v++)q+='<span class="year'+(-1==v||10==v?" old":"")+(s==d?" active":"")+(h>d||d>j?" disabled":"")+'">'+d+"</span>",d+=1;u.html(q)},updateNavArrows:function(){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth();switch(this.viewMode){case 0:this.startDate!==-1/0&&this.startDate.getUTCFullYear()>=b&&this.startDate.getUTCMonth()>=c?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()&&c>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.startDate!==-1/0&&this.startDate.getUTCFullYear()>=b?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},click:function(c){c.stopPropagation(),c.preventDefault();var d=a(c.target).closest("span, td, th");if(1==d.length)switch(d[0].nodeName.toLowerCase()){case"th":switch(d[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var e=f.modes[this.viewMode].navStep*("prev"==d[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,e);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,e)}this.fill();break;case"today":var g=new Date;g.setUTCHours(0),g.setUTCMinutes(0),g.setUTCSeconds(0),g.setUTCMilliseconds(0),this.showMode(-2);var h="linked"==this.todayBtn?null:"view";this._setDate(g,h)}break;case"span":if(!d.is(".disabled")){if(this.viewDate.setUTCDate(1),d.is(".month")){var i=d.parent().find("span").index(d);this.viewDate.setUTCMonth(i),this.element.trigger({type:"changeMonth",date:this.viewDate})}else{var j=parseInt(d.text(),10)||0;this.viewDate.setUTCFullYear(j),this.element.trigger({type:"changeYear",date:this.viewDate})}this.showMode(-1),this.fill()}break;case"td":if(d.is(".day")&&!d.is(".disabled")){var k=parseInt(d.text(),10)||1,j=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth();d.is(".old")?0==i?(i=11,j-=1):i-=1:d.is(".new")&&(11==i?(i=0,j+=1):i+=1),this._setDate(b(j,i,k,0,0,0,0))}}},_setDate:function(a,b){b&&"date"!=b||(this.date=a),b&&"view"!=b||(this.viewDate=a),this.fill(),this.setValue(),this.element.trigger({type:"changeDate",date:this.date});var c;this.isInput?c=this.element:this.component&&(c=this.element.find("input")),c&&(c.change(),this.autoclose&&this.hide())},moveMonth:function(a,b){if(!b)return a;var g,h,c=new Date(a.valueOf()),d=c.getUTCDate(),e=c.getUTCMonth(),f=Math.abs(b);if(b=b>0?1:-1,1==f)h=-1==b?function(){return c.getUTCMonth()==e}:function(){return c.getUTCMonth()!=g},g=e+b,c.setUTCMonth(g),(0>g||g>11)&&(g=(g+12)%12);else{for(var i=0;f>i;i++)c=this.moveMonth(c,b);g=c.getUTCMonth(),c.setUTCDate(d),h=function(){return g!=c.getUTCMonth()}}for(;h();)c.setUTCDate(--d),c.setUTCMonth(g);return c},moveYear:function(a,b){return this.moveMonth(a,12*b)},dateWithinRange:function(a){return a>=this.startDate&&this.endDate>=a},keydown:function(a){if(this.picker.is(":not(:visible)"))return 27==a.keyCode&&this.show(),void 0;var c,f,g,b=!1;switch(a.keyCode){case 27:this.hide(),a.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;c=37==a.keyCode?-1:1,a.ctrlKey?(f=this.moveYear(this.date,c),g=this.moveYear(this.viewDate,c)):a.shiftKey?(f=this.moveMonth(this.date,c),g=this.moveMonth(this.viewDate,c)):(f=new Date(this.date),f.setUTCDate(this.date.getUTCDate()+c),g=new Date(this.viewDate),g.setUTCDate(this.viewDate.getUTCDate()+c)),this.dateWithinRange(f)&&(this.date=f,this.viewDate=g,this.setValue(),this.update(),a.preventDefault(),b=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;c=38==a.keyCode?-1:1,a.ctrlKey?(f=this.moveYear(this.date,c),g=this.moveYear(this.viewDate,c)):a.shiftKey?(f=this.moveMonth(this.date,c),g=this.moveMonth(this.viewDate,c)):(f=new Date(this.date),f.setUTCDate(this.date.getUTCDate()+7*c),g=new Date(this.viewDate),g.setUTCDate(this.viewDate.getUTCDate()+7*c)),this.dateWithinRange(f)&&(this.date=f,this.viewDate=g,this.setValue(),this.update(),a.preventDefault(),b=!0);break;case 13:this.hide(),a.preventDefault();break;case 9:this.hide()}if(b){this.element.trigger({type:"changeDate",date:this.date});var h;this.isInput?h=this.element:this.component&&(h=this.element.find("input")),h&&h.change()}},showMode:function(a){a&&(this.viewMode=Math.max(0,Math.min(2,this.viewMode+a))),this.picker.find(">div").hide().filter(".datepicker-"+f.modes[this.viewMode].clsName).show(),this.updateNavArrows()}},a.fn.datepicker=function(b){var c=Array.apply(null,arguments);return c.shift(),this.each(function(){var e=a(this),f=e.data("datepicker"),g="object"==typeof b&&b;f||e.data("datepicker",f=new d(this,a.extend({},a.fn.datepicker.defaults,g))),"string"==typeof b&&"function"==typeof f[b]&&f[b].apply(f,c)})},a.fn.datepicker.defaults={},a.fn.datepicker.Constructor=d;var e=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"}},f={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(a){return 0===a%4&&0!==a%100||0===a%400},getDaysInMonth:function(a,b){return[31,f.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},validParts:/dd?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\r]+/g,parseFormat:function(a){var b=a.replace(this.validParts,"\0").split("\0"),c=a.match(this.validParts);if(!b||!b.length||!c||0==c.length)throw Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(c,f,g){if(c instanceof Date)return c;if(/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(c)){var j,k,h=/([-+]\d+)([dmwy])/,i=c.match(/([-+]\d+)([dmwy])/g);c=new Date;for(var l=0;i.length>l;l++)switch(j=h.exec(i[l]),k=parseInt(j[1]),j[2]){case"d":c.setUTCDate(c.getUTCDate()+k);break;case"m":c=d.prototype.moveMonth.call(d.prototype,c,k);break;case"w":c.setUTCDate(c.getUTCDate()+7*k);break;case"y":c=d.prototype.moveYear.call(d.prototype,c,k)}return b(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate(),0,0,0)}var p,q,j,i=c&&c.match(this.nonpunctuation)||[],c=new Date,m={},n=["yyyy","yy","M","MM","m","mm","d","dd"],o={yyyy:function(a,b){return a.setUTCFullYear(b)},yy:function(a,b){return a.setUTCFullYear(2e3+b)},m:function(a,b){for(b-=1;0>b;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!=b;)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)}};if(o.M=o.MM=o.mm=o.m,o.dd=o.d,c=b(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0),i.length==f.parts.length){for(var l=0,r=f.parts.length;r>l;l++){if(p=parseInt(i[l],10),j=f.parts[l],isNaN(p))switch(j){case"MM":q=a(e[g].months).filter(function(){var a=this.slice(0,i[l].length),b=i[l].slice(0,a.length);return a==b}),p=a.inArray(q[0],e[g].months)+1;break;case"M":q=a(e[g].monthsShort).filter(function(){var a=this.slice(0,i[l].length),b=i[l].slice(0,a.length);return a==b}),p=a.inArray(q[0],e[g].monthsShort)+1}m[j]=p}for(var s,l=0;n.length>l;l++)s=n[l],s in m&&!isNaN(m[s])&&o[s](c,m[s])}return c},formatDate:function(b,c,d){var f={d:b.getUTCDate(),m:b.getUTCMonth()+1,M:e[d].monthsShort[b.getUTCMonth()],MM:e[d].months[b.getUTCMonth()],yy:(""+b.getUTCFullYear()).substring(2),yyyy:b.getUTCFullYear()};f.dd=(10>f.d?"0":"")+f.d,f.mm=(10>f.m?"0":"")+f.m;for(var b=[],g=a.extend([],c.separators),h=0,i=c.parts.length;i>h;h++)g.length&&b.push(g.shift()),b.push(f[c.parts[h]]);return b.join("")},headTemplate:'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr></tfoot>'};f.template='<div class="datepicker dropdown-menu"><div class="datepicker-days"><table class=" table-condensed">'+f.headTemplate+"<tbody></tbody>"+f.footTemplate+"</table>"+"</div>"+'<div class="datepicker-months">'+'<table class="table-condensed">'+f.headTemplate+f.contTemplate+f.footTemplate+"</table>"+"</div>"+'<div class="datepicker-years">'+'<table class="table-condensed">'+f.headTemplate+f.contTemplate+f.footTemplate+"</table>"+"</div>"+"</div>"}(window.jQuery);
|
1 |
+
/* Rainbow v1.1.8 rainbowco.de | included languages: generic, javascript */
|
2 |
+
window.Rainbow=function(){function q(a){var b,c=a.getAttribute&&a.getAttribute("data-language")||0;if(!c){a=a.attributes;for(b=0;b<a.length;++b)if("data-language"===a[b].nodeName)return a[b].nodeValue}return c}function B(a){var b=q(a)||q(a.parentNode);if(!b){var c=/\blang(?:uage)?-(\w+)/;(a=a.className.match(c)||a.parentNode.className.match(c))&&(b=a[1])}return b}function C(a,b){for(var c in e[d]){c=parseInt(c,10);if(a==c&&b==e[d][c]?0:a<=c&&b>=e[d][c])delete e[d][c],delete j[d][c];if(a>=c&&a<e[d][c]||
|
3 |
+
b>c&&b<e[d][c])return!0}return!1}function r(a,b){return'<span class="'+a.replace(/\./g," ")+(l?" "+l:"")+'">'+b+"</span>"}function s(a,b,c,h){var f=a.exec(c);if(f){++t;!b.name&&"string"==typeof b.matches[0]&&(b.name=b.matches[0],delete b.matches[0]);var k=f[0],i=f.index,u=f[0].length+i,g=function(){function f(){s(a,b,c,h)}t%100>0?f():setTimeout(f,0)};if(C(i,u))g();else{var m=v(b.matches),l=function(a,c,h){if(a>=c.length)h(k);else{var d=f[c[a]];if(d){var e=b.matches[c[a]],i=e.language,g=e.name&&e.matches?
|
4 |
+
e.matches:e,j=function(b,d,e){var i;i=0;var g;for(g=1;g<c[a];++g)f[g]&&(i=i+f[g].length);d=e?r(e,d):d;k=k.substr(0,i)+k.substr(i).replace(b,d);l(++a,c,h)};i?n(d,i,function(a){j(d,a)}):typeof e==="string"?j(d,d,e):w(d,g.length?g:[g],function(a){j(d,a,e.matches?e.name:0)})}else l(++a,c,h)}};l(0,m,function(a){b.name&&(a=r(b.name,a));if(!j[d]){j[d]={};e[d]={}}j[d][i]={replace:f[0],"with":a};e[d][i]=u;g()})}}else h()}function v(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b.sort(function(a,
|
5 |
+
b){return b-a})}function w(a,b,c){function h(b,k){k<b.length?s(b[k].pattern,b[k],a,function(){h(b,++k)}):D(a,function(a){delete j[d];delete e[d];--d;c(a)})}++d;h(b,0)}function D(a,b){function c(a,b,h,e){if(h<b.length){++x;var g=b[h],l=j[d][g],a=a.substr(0,g)+a.substr(g).replace(l.replace,l["with"]),g=function(){c(a,b,++h,e)};0<x%250?g():setTimeout(g,0)}else e(a)}var h=v(j[d]);c(a,h,0,b)}function n(a,b,c){var d=m[b]||[],f=m[y]||[],b=z[b]?d:d.concat(f);w(a.replace(/</g,"<").replace(/>/g,">").replace(/&(?![\w\#]+;)/g,
|
6 |
+
"&"),b,c)}function o(a,b,c){if(b<a.length){var d=a[b],f=B(d);return!(-1<(" "+d.className+" ").indexOf(" rainbow "))&&f?(f=f.toLowerCase(),d.className+=d.className?" rainbow":"rainbow",n(d.innerHTML,f,function(k){d.innerHTML=k;j={};e={};p&&p(d,f);setTimeout(function(){o(a,++b,c)},0)})):o(a,++b,c)}c&&c()}function A(a,b){var a=a&&"function"==typeof a.getElementsByTagName?a:document,c=a.getElementsByTagName("pre"),d=a.getElementsByTagName("code"),f,e=[];for(f=0;f<d.length;++f)e.push(d[f]);for(f=0;f<
|
7 |
+
c.length;++f)c[f].getElementsByTagName("code").length||e.push(c[f]);o(e,0,b)}var j={},e={},m={},z={},d=0,y=0,t=0,x=0,l,p;return{extend:function(a,b,c){1==arguments.length&&(b=a,a=y);z[a]=c;m[a]=b.concat(m[a]||[])},b:function(a){p=a},a:function(a){l=a},color:function(a,b,c){if("string"==typeof a)return n(a,b,c);if("function"==typeof a)return A(0,a);A(a,b)}}}();window.addEventListener?window.addEventListener("load",Rainbow.color,!1):window.attachEvent("onload",Rainbow.color);Rainbow.onHighlight=Rainbow.b;
|
8 |
+
Rainbow.addClass=Rainbow.a;Rainbow.extend([{matches:{1:{name:"keyword.operator",pattern:/\=/g},2:{name:"string",matches:{name:"constant.character.escape",pattern:/\\('|"){1}/g}}},pattern:/(\(|\s|\[|\=|:)(('|")([^\\\1]|\\.)*?(\3))/gm},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm},{name:"constant.numeric",pattern:/\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi},{matches:{1:"keyword"},pattern:/\b(and|array|as|bool(ean)?|c(atch|har|lass|onst)|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi},
|
9 |
+
{name:"constant.language",pattern:/true|false|null/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g},{matches:{1:"function.call"},pattern:/(\w+?)(?=\()/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(function)\s(.*?)(?=\()/g}]);Rainbow.extend("javascript",[{name:"selector",pattern:/(\s|^)\$(?=\.|\()/g},{name:"support",pattern:/\b(window|document)\b/g},{matches:{1:"support.property"},pattern:/\.(length|node(Name|Value))\b/g},{matches:{1:"support.function"},pattern:/(setTimeout|setInterval)(?=\()/g},{matches:{1:"support.method"},pattern:/\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g},{matches:{1:"support.tag.script",2:[{name:"string",pattern:/('|")(.*?)(\1)/g},{name:"entity.tag.script",
|
10 |
+
pattern:/(\w+)/g}],3:"support.tag.script"},pattern:/(<\/?)(script.*?)(>)/g},{name:"string.regexp",matches:{1:"string.regexp.open",2:{name:"constant.regexp.escape",pattern:/\\(.){1}/g},3:"string.regexp.close",4:"string.regexp.modifier"},pattern:/(\/)(?!\*)(.+)(\/)([igm]{0,3})/g},{matches:{1:"storage",3:"entity.function"},pattern:/(var)?(\s|^)(.*)(?=\s?=\s?function\()/g},{name:"entity.function",pattern:/(\w+)(?=:\s{0,}function)/g}]);
|
11 |
+
|
12 |
+
|
13 |
+
// https://github.com/eternicode/bootstrap-datepicker
|
14 |
!function(a){function b(){return new Date(Date.UTC.apply(Date,arguments))}var d=function(b,c){var d=this;switch(this.element=a(b),this.language=c.language||this.element.data("date-language")||"en",this.language=this.language in e?this.language:"en",this.format=f.parseFormat(c.format||this.element.data("date-format")||"mm/dd/yyyy"),this.picker=a(f.template).appendTo("body").on({click:a.proxy(this.click,this)}),this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this._attachEvents(),this.forceParse=!0,"forceParse"in c?this.forceParse=c.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),a(document).on("mousedown",function(b){0==a(b.target).closest(".datepicker").length&&d.hide()}),this.autoclose=!1,"autoclose"in c?this.autoclose=c.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in c?this.keyboardNavigation=c.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),c.startView||this.element.data("date-start-view")){case 2:case"decade":this.viewMode=this.startViewMode=2;break;case 1:case"year":this.viewMode=this.startViewMode=1;break;case 0:case"month":default:this.viewMode=this.startViewMode=0}this.todayBtn=c.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=c.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=(c.weekStart||this.element.data("date-weekstart")||e[this.language].weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-1/0,this.endDate=1/0,this.daysOfWeekDisabled=[],this.setStartDate(c.startDate||this.element.data("date-startdate")),this.setEndDate(c.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(c.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode()};d.prototype={constructor:d,_events:[],_attachEvents:function(){this._detachEvents(),this._events=this.isInput?[[this.element,{focus:a.proxy(this.show,this),keyup:a.proxy(this.update,this),keydown:a.proxy(this.keydown,this)}]]:this.component&&this.hasInput?[[this.element.find("input"),{focus:a.proxy(this.show,this),keyup:a.proxy(this.update,this),keydown:a.proxy(this.keydown,this)}],[this.component,{click:a.proxy(this.show,this)}]]:[[this.element,{click:a.proxy(this.show,this)}]];for(var c,d,b=0;this._events.length>b;b++)c=this._events[b][0],d=this._events[b][1],c.on(d)},_detachEvents:function(){for(var b,c,a=0;this._events.length>a;a++)b=this._events[a][0],c=this._events[a][1],b.off(c);this._events=[]},show:function(b){this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.update(),this.place(),a(window).on("resize",a.proxy(this.place,this)),b&&(b.stopPropagation(),b.preventDefault()),this.element.trigger({type:"show",date:this.date})},hide:function(){this.picker.hide(),a(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||a(document).off("mousedown",this.hide),this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this.element.trigger({type:"hide",date:this.date})},remove:function(){this._detachEvents(),this.picker.remove(),delete this.element.data().datepicker},getDate:function(){var a=this.getUTCDate();return new Date(a.getTime()+6e4*a.getTimezoneOffset())},getUTCDate:function(){return this.date},setDate:function(a){this.setUTCDate(new Date(a.getTime()-6e4*a.getTimezoneOffset()))},setUTCDate:function(a){this.date=a,this.setValue()},setValue:function(){var a=f.formatDate(this.date,this.format,this.language);this.isInput?this.element.prop("value",a):(this.component&&this.element.find("input").prop("value",a),this.element.data("date",a))},setStartDate:function(a){this.startDate=a||-1/0,this.startDate!==-1/0&&(this.startDate=f.parseDate(this.startDate,this.format,this.language)),this.update(),this.updateNavArrows()},setEndDate:function(a){this.endDate=a||1/0,1/0!==this.endDate&&(this.endDate=f.parseDate(this.endDate,this.format,this.language)),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(b){this.daysOfWeekDisabled=b||[],a.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=a.map(this.daysOfWeekDisabled,function(a){return parseInt(a,10)}),this.update(),this.updateNavArrows()},place:function(){var b=parseInt(this.element.parents().filter(function(){return"auto"!=a(this).css("z-index")}).first().css("z-index"))+10,c=this.component?this.component.offset():this.element.offset();this.picker.css({top:c.top+this.height,left:c.left,zIndex:b})},update:function(){this.date=f.parseDate(this.isInput?this.element.prop("value"):this.element.data("date")||this.element.find("input").prop("value"),this.format,this.language),this.viewDate=this.date<this.startDate?new Date(this.startDate):this.date>this.endDate?new Date(this.endDate):new Date(this.date),this.fill()},fillDow:function(){for(var a=this.weekStart,b="<tr>";this.weekStart+7>a;)b+='<th class="dow">'+e[this.language].daysMin[a++%7]+"</th>";b+="</tr>",this.picker.find(".datepicker-days thead").append(b)},fillMonths:function(){for(var a="",b=0;12>b;)a+='<span class="month">'+e[this.language].monthsShort[b++]+"</span>";this.picker.find(".datepicker-months td").html(a)},fill:function(){var c=new Date(this.viewDate),d=c.getUTCFullYear(),g=c.getUTCMonth(),h=this.startDate!==-1/0?this.startDate.getUTCFullYear():-1/0,i=this.startDate!==-1/0?this.startDate.getUTCMonth():-1/0,j=1/0!==this.endDate?this.endDate.getUTCFullYear():1/0,k=1/0!==this.endDate?this.endDate.getUTCMonth():1/0,l=this.date.valueOf(),m=new Date;this.picker.find(".datepicker-days thead th:eq(1)").text(e[this.language].months[g]+" "+d),this.picker.find("tfoot th.today").text(e[this.language].today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var n=b(d,g-1,28,0,0,0,0),o=f.getDaysInMonth(n.getUTCFullYear(),n.getUTCMonth());n.setUTCDate(o),n.setUTCDate(o-(n.getUTCDay()-this.weekStart+7)%7);var p=new Date(n);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();for(var r,q=[];p>n.valueOf();)n.getUTCDay()==this.weekStart&&q.push("<tr>"),r="",d>n.getUTCFullYear()||n.getUTCFullYear()==d&&g>n.getUTCMonth()?r+=" old":(n.getUTCFullYear()>d||n.getUTCFullYear()==d&&n.getUTCMonth()>g)&&(r+=" new"),this.todayHighlight&&n.getUTCFullYear()==m.getFullYear()&&n.getUTCMonth()==m.getMonth()&&n.getUTCDate()==m.getDate()&&(r+=" today"),n.valueOf()==l&&(r+=" active"),(n.valueOf()<this.startDate||n.valueOf()>this.endDate||-1!==a.inArray(n.getUTCDay(),this.daysOfWeekDisabled))&&(r+=" disabled"),q.push('<td class="day'+r+'">'+n.getUTCDate()+"</td>"),n.getUTCDay()==this.weekEnd&&q.push("</tr>"),n.setUTCDate(n.getUTCDate()+1);this.picker.find(".datepicker-days tbody").empty().append(q.join(""));var s=this.date.getUTCFullYear(),t=this.picker.find(".datepicker-months").find("th:eq(1)").text(d).end().find("span").removeClass("active");s==d&&t.eq(this.date.getUTCMonth()).addClass("active"),(h>d||d>j)&&t.addClass("disabled"),d==h&&t.slice(0,i).addClass("disabled"),d==j&&t.slice(k+1).addClass("disabled"),q="",d=10*parseInt(d/10,10);var u=this.picker.find(".datepicker-years").find("th:eq(1)").text(d+"-"+(d+9)).end().find("td");d-=1;for(var v=-1;11>v;v++)q+='<span class="year'+(-1==v||10==v?" old":"")+(s==d?" active":"")+(h>d||d>j?" disabled":"")+'">'+d+"</span>",d+=1;u.html(q)},updateNavArrows:function(){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth();switch(this.viewMode){case 0:this.startDate!==-1/0&&this.startDate.getUTCFullYear()>=b&&this.startDate.getUTCMonth()>=c?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()&&c>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.startDate!==-1/0&&this.startDate.getUTCFullYear()>=b?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},click:function(c){c.stopPropagation(),c.preventDefault();var d=a(c.target).closest("span, td, th");if(1==d.length)switch(d[0].nodeName.toLowerCase()){case"th":switch(d[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var e=f.modes[this.viewMode].navStep*("prev"==d[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,e);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,e)}this.fill();break;case"today":var g=new Date;g.setUTCHours(0),g.setUTCMinutes(0),g.setUTCSeconds(0),g.setUTCMilliseconds(0),this.showMode(-2);var h="linked"==this.todayBtn?null:"view";this._setDate(g,h)}break;case"span":if(!d.is(".disabled")){if(this.viewDate.setUTCDate(1),d.is(".month")){var i=d.parent().find("span").index(d);this.viewDate.setUTCMonth(i),this.element.trigger({type:"changeMonth",date:this.viewDate})}else{var j=parseInt(d.text(),10)||0;this.viewDate.setUTCFullYear(j),this.element.trigger({type:"changeYear",date:this.viewDate})}this.showMode(-1),this.fill()}break;case"td":if(d.is(".day")&&!d.is(".disabled")){var k=parseInt(d.text(),10)||1,j=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth();d.is(".old")?0==i?(i=11,j-=1):i-=1:d.is(".new")&&(11==i?(i=0,j+=1):i+=1),this._setDate(b(j,i,k,0,0,0,0))}}},_setDate:function(a,b){b&&"date"!=b||(this.date=a),b&&"view"!=b||(this.viewDate=a),this.fill(),this.setValue(),this.element.trigger({type:"changeDate",date:this.date});var c;this.isInput?c=this.element:this.component&&(c=this.element.find("input")),c&&(c.change(),this.autoclose&&this.hide())},moveMonth:function(a,b){if(!b)return a;var g,h,c=new Date(a.valueOf()),d=c.getUTCDate(),e=c.getUTCMonth(),f=Math.abs(b);if(b=b>0?1:-1,1==f)h=-1==b?function(){return c.getUTCMonth()==e}:function(){return c.getUTCMonth()!=g},g=e+b,c.setUTCMonth(g),(0>g||g>11)&&(g=(g+12)%12);else{for(var i=0;f>i;i++)c=this.moveMonth(c,b);g=c.getUTCMonth(),c.setUTCDate(d),h=function(){return g!=c.getUTCMonth()}}for(;h();)c.setUTCDate(--d),c.setUTCMonth(g);return c},moveYear:function(a,b){return this.moveMonth(a,12*b)},dateWithinRange:function(a){return a>=this.startDate&&this.endDate>=a},keydown:function(a){if(this.picker.is(":not(:visible)"))return 27==a.keyCode&&this.show(),void 0;var c,f,g,b=!1;switch(a.keyCode){case 27:this.hide(),a.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;c=37==a.keyCode?-1:1,a.ctrlKey?(f=this.moveYear(this.date,c),g=this.moveYear(this.viewDate,c)):a.shiftKey?(f=this.moveMonth(this.date,c),g=this.moveMonth(this.viewDate,c)):(f=new Date(this.date),f.setUTCDate(this.date.getUTCDate()+c),g=new Date(this.viewDate),g.setUTCDate(this.viewDate.getUTCDate()+c)),this.dateWithinRange(f)&&(this.date=f,this.viewDate=g,this.setValue(),this.update(),a.preventDefault(),b=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;c=38==a.keyCode?-1:1,a.ctrlKey?(f=this.moveYear(this.date,c),g=this.moveYear(this.viewDate,c)):a.shiftKey?(f=this.moveMonth(this.date,c),g=this.moveMonth(this.viewDate,c)):(f=new Date(this.date),f.setUTCDate(this.date.getUTCDate()+7*c),g=new Date(this.viewDate),g.setUTCDate(this.viewDate.getUTCDate()+7*c)),this.dateWithinRange(f)&&(this.date=f,this.viewDate=g,this.setValue(),this.update(),a.preventDefault(),b=!0);break;case 13:this.hide(),a.preventDefault();break;case 9:this.hide()}if(b){this.element.trigger({type:"changeDate",date:this.date});var h;this.isInput?h=this.element:this.component&&(h=this.element.find("input")),h&&h.change()}},showMode:function(a){a&&(this.viewMode=Math.max(0,Math.min(2,this.viewMode+a))),this.picker.find(">div").hide().filter(".datepicker-"+f.modes[this.viewMode].clsName).show(),this.updateNavArrows()}},a.fn.datepicker=function(b){var c=Array.apply(null,arguments);return c.shift(),this.each(function(){var e=a(this),f=e.data("datepicker"),g="object"==typeof b&&b;f||e.data("datepicker",f=new d(this,a.extend({},a.fn.datepicker.defaults,g))),"string"==typeof b&&"function"==typeof f[b]&&f[b].apply(f,c)})},a.fn.datepicker.defaults={},a.fn.datepicker.Constructor=d;var e=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"}},f={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(a){return 0===a%4&&0!==a%100||0===a%400},getDaysInMonth:function(a,b){return[31,f.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},validParts:/dd?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\r]+/g,parseFormat:function(a){var b=a.replace(this.validParts,"\0").split("\0"),c=a.match(this.validParts);if(!b||!b.length||!c||0==c.length)throw Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(c,f,g){if(c instanceof Date)return c;if(/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(c)){var j,k,h=/([-+]\d+)([dmwy])/,i=c.match(/([-+]\d+)([dmwy])/g);c=new Date;for(var l=0;i.length>l;l++)switch(j=h.exec(i[l]),k=parseInt(j[1]),j[2]){case"d":c.setUTCDate(c.getUTCDate()+k);break;case"m":c=d.prototype.moveMonth.call(d.prototype,c,k);break;case"w":c.setUTCDate(c.getUTCDate()+7*k);break;case"y":c=d.prototype.moveYear.call(d.prototype,c,k)}return b(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate(),0,0,0)}var p,q,j,i=c&&c.match(this.nonpunctuation)||[],c=new Date,m={},n=["yyyy","yy","M","MM","m","mm","d","dd"],o={yyyy:function(a,b){return a.setUTCFullYear(b)},yy:function(a,b){return a.setUTCFullYear(2e3+b)},m:function(a,b){for(b-=1;0>b;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!=b;)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)}};if(o.M=o.MM=o.mm=o.m,o.dd=o.d,c=b(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0),i.length==f.parts.length){for(var l=0,r=f.parts.length;r>l;l++){if(p=parseInt(i[l],10),j=f.parts[l],isNaN(p))switch(j){case"MM":q=a(e[g].months).filter(function(){var a=this.slice(0,i[l].length),b=i[l].slice(0,a.length);return a==b}),p=a.inArray(q[0],e[g].months)+1;break;case"M":q=a(e[g].monthsShort).filter(function(){var a=this.slice(0,i[l].length),b=i[l].slice(0,a.length);return a==b}),p=a.inArray(q[0],e[g].monthsShort)+1}m[j]=p}for(var s,l=0;n.length>l;l++)s=n[l],s in m&&!isNaN(m[s])&&o[s](c,m[s])}return c},formatDate:function(b,c,d){var f={d:b.getUTCDate(),m:b.getUTCMonth()+1,M:e[d].monthsShort[b.getUTCMonth()],MM:e[d].months[b.getUTCMonth()],yy:(""+b.getUTCFullYear()).substring(2),yyyy:b.getUTCFullYear()};f.dd=(10>f.d?"0":"")+f.d,f.mm=(10>f.m?"0":"")+f.m;for(var b=[],g=a.extend([],c.separators),h=0,i=c.parts.length;i>h;h++)g.length&&b.push(g.shift()),b.push(f[c.parts[h]]);return b.join("")},headTemplate:'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr></tfoot>'};f.template='<div class="datepicker dropdown-menu"><div class="datepicker-days"><table class=" table-condensed">'+f.headTemplate+"<tbody></tbody>"+f.footTemplate+"</table>"+"</div>"+'<div class="datepicker-months">'+'<table class="table-condensed">'+f.headTemplate+f.contTemplate+f.footTemplate+"</table>"+"</div>"+'<div class="datepicker-years">'+'<table class="table-condensed">'+f.headTemplate+f.contTemplate+f.footTemplate+"</table>"+"</div>"+"</div>"}(window.jQuery);
|
js/libraries/jquery-datepicker/lib/datepair.js
CHANGED
@@ -1,204 +1,204 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
$(function() {
|
3 |
-
|
4 |
-
var DATE_FORMAT = 'Y-m-d';
|
5 |
-
var DATEPICKER_FORMAT = 'yyyy-m-d';
|
6 |
-
|
7 |
-
$('.datepair input.date').each(function(){
|
8 |
-
var $this = $(this);
|
9 |
-
$this.datepicker({
|
10 |
-
'format': DATEPICKER_FORMAT,
|
11 |
-
'autoclose': true
|
12 |
-
});
|
13 |
-
|
14 |
-
if ($this.hasClass('start') || $this.hasClass('end')) {
|
15 |
-
$this.on('changeDate change', doDatepair);
|
16 |
-
}
|
17 |
-
|
18 |
-
});
|
19 |
-
|
20 |
-
$('.datepair input.time').each(function() {
|
21 |
-
var $this = $(this);
|
22 |
-
var opts = { 'showDuration': true, 'timeFormat': 'g:ia', 'scrollDefaultNow': true };
|
23 |
-
|
24 |
-
if ($this.hasClass('start') || $this.hasClass('end')) {
|
25 |
-
opts.onSelect = doDatepair;
|
26 |
-
}
|
27 |
-
|
28 |
-
$this.timepicker(opts);
|
29 |
-
});
|
30 |
-
|
31 |
-
$('.datepair').each(initDatepair);
|
32 |
-
|
33 |
-
function initDatepair()
|
34 |
-
{
|
35 |
-
var container = $(this);
|
36 |
-
|
37 |
-
var startDateInput = container.find('input.start.date');
|
38 |
-
var endDateInput = container.find('input.end.date');
|
39 |
-
var dateDelta = 0;
|
40 |
-
|
41 |
-
if (startDateInput.length && endDateInput.length) {
|
42 |
-
var startDate = new Date(startDateInput.val());
|
43 |
-
var endDate = new Date(endDateInput.val());
|
44 |
-
|
45 |
-
dateDelta = endDate.getTime() - startDate.getTime();
|
46 |
-
|
47 |
-
container.data('dateDelta', dateDelta);
|
48 |
-
}
|
49 |
-
|
50 |
-
var startTimeInput = container.find('input.start.time');
|
51 |
-
var endTimeInput = container.find('input.end.time');
|
52 |
-
|
53 |
-
if (startTimeInput.length && endTimeInput.length) {
|
54 |
-
var startInt = startTimeInput.timepicker('getSecondsFromMidnight');
|
55 |
-
var endInt = endTimeInput.timepicker('getSecondsFromMidnight');
|
56 |
-
|
57 |
-
container.data('timeDelta', endInt - startInt);
|
58 |
-
|
59 |
-
if (dateDelta < 86400000) {
|
60 |
-
endTimeInput.timepicker('option', 'minTime', startInt);
|
61 |
-
}
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
function doDatepair()
|
66 |
-
{
|
67 |
-
var target = $(this);
|
68 |
-
if (target.val() == '') {
|
69 |
-
return;
|
70 |
-
}
|
71 |
-
|
72 |
-
var container = target.closest('.datepair');
|
73 |
-
|
74 |
-
if (target.hasClass('date')) {
|
75 |
-
updateDatePair(target, container);
|
76 |
-
|
77 |
-
} else if (target.hasClass('time')) {
|
78 |
-
updateTimePair(target, container);
|
79 |
-
}
|
80 |
-
}
|
81 |
-
|
82 |
-
function updateDatePair(target, container)
|
83 |
-
{
|
84 |
-
var start = container.find('input.start.date');
|
85 |
-
var end = container.find('input.end.date');
|
86 |
-
|
87 |
-
if (!start.length || !end.length) {
|
88 |
-
return;
|
89 |
-
}
|
90 |
-
|
91 |
-
var startDate = new Date(start.val());
|
92 |
-
var endDate = new Date(end.val());
|
93 |
-
|
94 |
-
var oldDelta = container.data('dateDelta');
|
95 |
-
|
96 |
-
if (oldDelta && target.hasClass('start')) {
|
97 |
-
var newEnd = new Date(startDate.getTime()+oldDelta);
|
98 |
-
end.val(newEnd.format(DATE_FORMAT));
|
99 |
-
end.datepicker('update');
|
100 |
-
return;
|
101 |
-
|
102 |
-
} else {
|
103 |
-
var newDelta = endDate.getTime() - startDate.getTime();
|
104 |
-
|
105 |
-
if (newDelta < 0) {
|
106 |
-
newDelta = 0;
|
107 |
-
|
108 |
-
if (target.hasClass('start')) {
|
109 |
-
end.val(start.val());
|
110 |
-
end.datepicker('update');
|
111 |
-
} else if (target.hasClass('end')) {
|
112 |
-
start.val(end.val());
|
113 |
-
start.datepicker('update');
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
if (newDelta < 86400000) {
|
118 |
-
var startTimeVal = container.find('input.start.time').val();
|
119 |
-
|
120 |
-
if (startTimeVal) {
|
121 |
-
container.find('input.end.time').timepicker('option', {'minTime': startTimeVal});
|
122 |
-
}
|
123 |
-
} else {
|
124 |
-
container.find('input.end.time').timepicker('option', {'minTime': null});
|
125 |
-
}
|
126 |
-
|
127 |
-
container.data('dateDelta', newDelta);
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
function updateTimePair(target, container)
|
132 |
-
{
|
133 |
-
var start = container.find('input.start.time');
|
134 |
-
var end = container.find('input.end.time');
|
135 |
-
|
136 |
-
if (!start.length || !end.length) {
|
137 |
-
return;
|
138 |
-
}
|
139 |
-
|
140 |
-
var startInt = start.timepicker('getSecondsFromMidnight');
|
141 |
-
var endInt = end.timepicker('getSecondsFromMidnight');
|
142 |
-
|
143 |
-
var oldDelta = container.data('timeDelta');
|
144 |
-
var dateDelta = container.data('dateDelta');
|
145 |
-
|
146 |
-
if (target.hasClass('start') && (!dateDelta || dateDelta < 86400000)) {
|
147 |
-
end.timepicker('option', 'minTime', startInt);
|
148 |
-
}
|
149 |
-
|
150 |
-
var endDateAdvance = 0;
|
151 |
-
var newDelta;
|
152 |
-
|
153 |
-
if (oldDelta && target.hasClass('start')) {
|
154 |
-
// lock the duration and advance the end time
|
155 |
-
|
156 |
-
var newEnd = (startInt+oldDelta)%86400;
|
157 |
-
|
158 |
-
if (newEnd < 0) {
|
159 |
-
newEnd += 86400;
|
160 |
-
}
|
161 |
-
|
162 |
-
end.timepicker('setTime', newEnd);
|
163 |
-
newDelta = newEnd - startInt;
|
164 |
-
} else if (startInt !== null && endInt !== null) {
|
165 |
-
newDelta = endInt - startInt;
|
166 |
-
} else {
|
167 |
-
return;
|
168 |
-
}
|
169 |
-
|
170 |
-
container.data('timeDelta', newDelta);
|
171 |
-
|
172 |
-
if (newDelta < 0 && (!oldDelta || oldDelta > 0)) {
|
173 |
-
// overnight time span. advance the end date 1 day
|
174 |
-
var endDateAdvance = 86400000;
|
175 |
-
|
176 |
-
} else if (newDelta > 0 && oldDelta < 0) {
|
177 |
-
// switching from overnight to same-day time span. decrease the end date 1 day
|
178 |
-
var endDateAdvance = -86400000;
|
179 |
-
}
|
180 |
-
|
181 |
-
var startInput = container.find('.start.date');
|
182 |
-
var endInput = container.find('.end.date');
|
183 |
-
|
184 |
-
if (startInput.val() && !endInput.val()) {
|
185 |
-
endInput.val(startInput.val());
|
186 |
-
endInput.datepicker('update');
|
187 |
-
dateDelta = 0;
|
188 |
-
container.data('dateDelta', 0);
|
189 |
-
}
|
190 |
-
|
191 |
-
if (endDateAdvance != 0) {
|
192 |
-
if (dateDelta || dateDelta === 0) {
|
193 |
-
var endDate = new Date(endInput.val());
|
194 |
-
var newEnd = new Date(endDate.getTime() + endDateAdvance);
|
195 |
-
endInput.val(newEnd.format(DATE_FORMAT));
|
196 |
-
endInput.datepicker('update');
|
197 |
-
container.data('dateDelta', dateDelta + endDateAdvance);
|
198 |
-
}
|
199 |
-
}
|
200 |
-
}
|
201 |
-
});
|
202 |
-
});
|
203 |
-
// Simulates PHP's date function
|
204 |
-
Date.prototype.format=function(format){var returnStr='';var replace=Date.replaceChars;for(var i=0;i<format.length;i++){var curChar=format.charAt(i);if(replace[curChar]){returnStr+=replace[curChar].call(this);}else{returnStr+=curChar;}}return returnStr;};Date.replaceChars={shortMonths:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],longMonths:['January','February','March','April','May','June','July','August','September','October','November','December'],shortDays:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],longDays:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],d:function(){return(this.getDate()<10?'0':'')+this.getDate();},D:function(){return Date.replaceChars.shortDays[this.getDay()];},j:function(){return this.getDate();},l:function(){return Date.replaceChars.longDays[this.getDay()];},N:function(){return this.getDay()+1;},S:function(){return(this.getDate()%10==1&&this.getDate()!=11?'st':(this.getDate()%10==2&&this.getDate()!=12?'nd':(this.getDate()%10==3&&this.getDate()!=13?'rd':'th')));},w:function(){return this.getDay();},z:function(){return"Not Yet Supported";},W:function(){return"Not Yet Supported";},F:function(){return Date.replaceChars.longMonths[this.getMonth()];},m:function(){return(this.getMonth()<9?'0':'')+(this.getMonth()+1);},M:function(){return Date.replaceChars.shortMonths[this.getMonth()];},n:function(){return this.getMonth()+1;},t:function(){return"Not Yet Supported";},L:function(){return(((this.getFullYear()%4==0)&&(this.getFullYear()%100!=0))||(this.getFullYear()%400==0))?'1':'0';},o:function(){return"Not Supported";},Y:function(){return this.getFullYear();},y:function(){return(''+this.getFullYear()).substr(2);},a:function(){return this.getHours()<12?'am':'pm';},A:function(){return this.getHours()<12?'AM':'PM';},B:function(){return"Not Yet Supported";},g:function(){return this.getHours()%12||12;},G:function(){return this.getHours();},h:function(){return((this.getHours()%12||12)<10?'0':'')+(this.getHours()%12||12);},H:function(){return(this.getHours()<10?'0':'')+this.getHours();},i:function(){return(this.getMinutes()<10?'0':'')+this.getMinutes();},s:function(){return(this.getSeconds()<10?'0':'')+this.getSeconds();},e:function(){return"Not Yet Supported";},I:function(){return"Not Supported";},O:function(){return(-this.getTimezoneOffset()<0?'-':'+')+(Math.abs(this.getTimezoneOffset()/60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()/60))+'00';},P:function(){return(-this.getTimezoneOffset()<0?'-':'+')+(Math.abs(this.getTimezoneOffset()/60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()/60))+':'+(Math.abs(this.getTimezoneOffset()%60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()%60));},T:function(){var m=this.getMonth();this.setMonth(0);var result=this.toTimeString().replace(/^.+ \(?([^\)]+)\)?$/,'$1');this.setMonth(m);return result;},Z:function(){return-this.getTimezoneOffset()*60;},c:function(){return this.format("Y-m-d")+"T"+this.format("H:i:sP");},r:function(){return this.toString();},U:function(){return this.getTime()/1000;}};
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
$(function() {
|
3 |
+
|
4 |
+
var DATE_FORMAT = 'Y-m-d';
|
5 |
+
var DATEPICKER_FORMAT = 'yyyy-m-d';
|
6 |
+
|
7 |
+
$('.datepair input.date').each(function(){
|
8 |
+
var $this = $(this);
|
9 |
+
$this.datepicker({
|
10 |
+
'format': DATEPICKER_FORMAT,
|
11 |
+
'autoclose': true
|
12 |
+
});
|
13 |
+
|
14 |
+
if ($this.hasClass('start') || $this.hasClass('end')) {
|
15 |
+
$this.on('changeDate change', doDatepair);
|
16 |
+
}
|
17 |
+
|
18 |
+
});
|
19 |
+
|
20 |
+
$('.datepair input.time').each(function() {
|
21 |
+
var $this = $(this);
|
22 |
+
var opts = { 'showDuration': true, 'timeFormat': 'g:ia', 'scrollDefaultNow': true };
|
23 |
+
|
24 |
+
if ($this.hasClass('start') || $this.hasClass('end')) {
|
25 |
+
opts.onSelect = doDatepair;
|
26 |
+
}
|
27 |
+
|
28 |
+
$this.timepicker(opts);
|
29 |
+
});
|
30 |
+
|
31 |
+
$('.datepair').each(initDatepair);
|
32 |
+
|
33 |
+
function initDatepair()
|
34 |
+
{
|
35 |
+
var container = $(this);
|
36 |
+
|
37 |
+
var startDateInput = container.find('input.start.date');
|
38 |
+
var endDateInput = container.find('input.end.date');
|
39 |
+
var dateDelta = 0;
|
40 |
+
|
41 |
+
if (startDateInput.length && endDateInput.length) {
|
42 |
+
var startDate = new Date(startDateInput.val());
|
43 |
+
var endDate = new Date(endDateInput.val());
|
44 |
+
|
45 |
+
dateDelta = endDate.getTime() - startDate.getTime();
|
46 |
+
|
47 |
+
container.data('dateDelta', dateDelta);
|
48 |
+
}
|
49 |
+
|
50 |
+
var startTimeInput = container.find('input.start.time');
|
51 |
+
var endTimeInput = container.find('input.end.time');
|
52 |
+
|
53 |
+
if (startTimeInput.length && endTimeInput.length) {
|
54 |
+
var startInt = startTimeInput.timepicker('getSecondsFromMidnight');
|
55 |
+
var endInt = endTimeInput.timepicker('getSecondsFromMidnight');
|
56 |
+
|
57 |
+
container.data('timeDelta', endInt - startInt);
|
58 |
+
|
59 |
+
if (dateDelta < 86400000) {
|
60 |
+
endTimeInput.timepicker('option', 'minTime', startInt);
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
function doDatepair()
|
66 |
+
{
|
67 |
+
var target = $(this);
|
68 |
+
if (target.val() == '') {
|
69 |
+
return;
|
70 |
+
}
|
71 |
+
|
72 |
+
var container = target.closest('.datepair');
|
73 |
+
|
74 |
+
if (target.hasClass('date')) {
|
75 |
+
updateDatePair(target, container);
|
76 |
+
|
77 |
+
} else if (target.hasClass('time')) {
|
78 |
+
updateTimePair(target, container);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
function updateDatePair(target, container)
|
83 |
+
{
|
84 |
+
var start = container.find('input.start.date');
|
85 |
+
var end = container.find('input.end.date');
|
86 |
+
|
87 |
+
if (!start.length || !end.length) {
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
|
91 |
+
var startDate = new Date(start.val());
|
92 |
+
var endDate = new Date(end.val());
|
93 |
+
|
94 |
+
var oldDelta = container.data('dateDelta');
|
95 |
+
|
96 |
+
if (oldDelta && target.hasClass('start')) {
|
97 |
+
var newEnd = new Date(startDate.getTime()+oldDelta);
|
98 |
+
end.val(newEnd.format(DATE_FORMAT));
|
99 |
+
end.datepicker('update');
|
100 |
+
return;
|
101 |
+
|
102 |
+
} else {
|
103 |
+
var newDelta = endDate.getTime() - startDate.getTime();
|
104 |
+
|
105 |
+
if (newDelta < 0) {
|
106 |
+
newDelta = 0;
|
107 |
+
|
108 |
+
if (target.hasClass('start')) {
|
109 |
+
end.val(start.val());
|
110 |
+
end.datepicker('update');
|
111 |
+
} else if (target.hasClass('end')) {
|
112 |
+
start.val(end.val());
|
113 |
+
start.datepicker('update');
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
if (newDelta < 86400000) {
|
118 |
+
var startTimeVal = container.find('input.start.time').val();
|
119 |
+
|
120 |
+
if (startTimeVal) {
|
121 |
+
container.find('input.end.time').timepicker('option', {'minTime': startTimeVal});
|
122 |
+
}
|
123 |
+
} else {
|
124 |
+
container.find('input.end.time').timepicker('option', {'minTime': null});
|
125 |
+
}
|
126 |
+
|
127 |
+
container.data('dateDelta', newDelta);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
function updateTimePair(target, container)
|
132 |
+
{
|
133 |
+
var start = container.find('input.start.time');
|
134 |
+
var end = container.find('input.end.time');
|
135 |
+
|
136 |
+
if (!start.length || !end.length) {
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
|
140 |
+
var startInt = start.timepicker('getSecondsFromMidnight');
|
141 |
+
var endInt = end.timepicker('getSecondsFromMidnight');
|
142 |
+
|
143 |
+
var oldDelta = container.data('timeDelta');
|
144 |
+
var dateDelta = container.data('dateDelta');
|
145 |
+
|
146 |
+
if (target.hasClass('start') && (!dateDelta || dateDelta < 86400000)) {
|
147 |
+
end.timepicker('option', 'minTime', startInt);
|
148 |
+
}
|
149 |
+
|
150 |
+
var endDateAdvance = 0;
|
151 |
+
var newDelta;
|
152 |
+
|
153 |
+
if (oldDelta && target.hasClass('start')) {
|
154 |
+
// lock the duration and advance the end time
|
155 |
+
|
156 |
+
var newEnd = (startInt+oldDelta)%86400;
|
157 |
+
|
158 |
+
if (newEnd < 0) {
|
159 |
+
newEnd += 86400;
|
160 |
+
}
|
161 |
+
|
162 |
+
end.timepicker('setTime', newEnd);
|
163 |
+
newDelta = newEnd - startInt;
|
164 |
+
} else if (startInt !== null && endInt !== null) {
|
165 |
+
newDelta = endInt - startInt;
|
166 |
+
} else {
|
167 |
+
return;
|
168 |
+
}
|
169 |
+
|
170 |
+
container.data('timeDelta', newDelta);
|
171 |
+
|
172 |
+
if (newDelta < 0 && (!oldDelta || oldDelta > 0)) {
|
173 |
+
// overnight time span. advance the end date 1 day
|
174 |
+
var endDateAdvance = 86400000;
|
175 |
+
|
176 |
+
} else if (newDelta > 0 && oldDelta < 0) {
|
177 |
+
// switching from overnight to same-day time span. decrease the end date 1 day
|
178 |
+
var endDateAdvance = -86400000;
|
179 |
+
}
|
180 |
+
|
181 |
+
var startInput = container.find('.start.date');
|
182 |
+
var endInput = container.find('.end.date');
|
183 |
+
|
184 |
+
if (startInput.val() && !endInput.val()) {
|
185 |
+
endInput.val(startInput.val());
|
186 |
+
endInput.datepicker('update');
|
187 |
+
dateDelta = 0;
|
188 |
+
container.data('dateDelta', 0);
|
189 |
+
}
|
190 |
+
|
191 |
+
if (endDateAdvance != 0) {
|
192 |
+
if (dateDelta || dateDelta === 0) {
|
193 |
+
var endDate = new Date(endInput.val());
|
194 |
+
var newEnd = new Date(endDate.getTime() + endDateAdvance);
|
195 |
+
endInput.val(newEnd.format(DATE_FORMAT));
|
196 |
+
endInput.datepicker('update');
|
197 |
+
container.data('dateDelta', dateDelta + endDateAdvance);
|
198 |
+
}
|
199 |
+
}
|
200 |
+
}
|
201 |
+
});
|
202 |
+
});
|
203 |
+
// Simulates PHP's date function
|
204 |
+
Date.prototype.format=function(format){var returnStr='';var replace=Date.replaceChars;for(var i=0;i<format.length;i++){var curChar=format.charAt(i);if(replace[curChar]){returnStr+=replace[curChar].call(this);}else{returnStr+=curChar;}}return returnStr;};Date.replaceChars={shortMonths:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],longMonths:['January','February','March','April','May','June','July','August','September','October','November','December'],shortDays:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],longDays:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],d:function(){return(this.getDate()<10?'0':'')+this.getDate();},D:function(){return Date.replaceChars.shortDays[this.getDay()];},j:function(){return this.getDate();},l:function(){return Date.replaceChars.longDays[this.getDay()];},N:function(){return this.getDay()+1;},S:function(){return(this.getDate()%10==1&&this.getDate()!=11?'st':(this.getDate()%10==2&&this.getDate()!=12?'nd':(this.getDate()%10==3&&this.getDate()!=13?'rd':'th')));},w:function(){return this.getDay();},z:function(){return"Not Yet Supported";},W:function(){return"Not Yet Supported";},F:function(){return Date.replaceChars.longMonths[this.getMonth()];},m:function(){return(this.getMonth()<9?'0':'')+(this.getMonth()+1);},M:function(){return Date.replaceChars.shortMonths[this.getMonth()];},n:function(){return this.getMonth()+1;},t:function(){return"Not Yet Supported";},L:function(){return(((this.getFullYear()%4==0)&&(this.getFullYear()%100!=0))||(this.getFullYear()%400==0))?'1':'0';},o:function(){return"Not Supported";},Y:function(){return this.getFullYear();},y:function(){return(''+this.getFullYear()).substr(2);},a:function(){return this.getHours()<12?'am':'pm';},A:function(){return this.getHours()<12?'AM':'PM';},B:function(){return"Not Yet Supported";},g:function(){return this.getHours()%12||12;},G:function(){return this.getHours();},h:function(){return((this.getHours()%12||12)<10?'0':'')+(this.getHours()%12||12);},H:function(){return(this.getHours()<10?'0':'')+this.getHours();},i:function(){return(this.getMinutes()<10?'0':'')+this.getMinutes();},s:function(){return(this.getSeconds()<10?'0':'')+this.getSeconds();},e:function(){return"Not Yet Supported";},I:function(){return"Not Supported";},O:function(){return(-this.getTimezoneOffset()<0?'-':'+')+(Math.abs(this.getTimezoneOffset()/60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()/60))+'00';},P:function(){return(-this.getTimezoneOffset()<0?'-':'+')+(Math.abs(this.getTimezoneOffset()/60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()/60))+':'+(Math.abs(this.getTimezoneOffset()%60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()%60));},T:function(){var m=this.getMonth();this.setMonth(0);var result=this.toTimeString().replace(/^.+ \(?([^\)]+)\)?$/,'$1');this.setMonth(m);return result;},Z:function(){return-this.getTimezoneOffset()*60;},c:function(){return this.format("Y-m-d")+"T"+this.format("H:i:sP");},r:function(){return this.toString();},U:function(){return this.getTime()/1000;}};
|
js/libraries/jquery-datepicker/picker_functions.js
CHANGED
@@ -1,48 +1,48 @@
|
|
1 |
-
jQuery(document).ready(function ($) {
|
2 |
-
|
3 |
-
/* Populates timepicker values */
|
4 |
-
|
5 |
-
jQuery('.time-picker').timepicker({ 'timeFormat': 'H:i' });
|
6 |
-
|
7 |
-
if ($('.current_lander .new-date').length) { // implies *not* zero
|
8 |
-
var current_val = jQuery(".current_lander .new-date").val();
|
9 |
-
} else {
|
10 |
-
var current_val = jQuery(".new-date").val();
|
11 |
-
}
|
12 |
-
// if no timepicker in options fix it
|
13 |
-
if (typeof (current_val) == "undefined" || current_val === null || current_val == "") {
|
14 |
-
var current_val = '';
|
15 |
-
}
|
16 |
-
|
17 |
-
jQuery('.new-date').each(function(){
|
18 |
-
var the_val = $(this).val();
|
19 |
-
if (typeof (the_val) == "undefined" || the_val === null || the_val == "") {
|
20 |
-
var the_val = '';
|
21 |
-
}
|
22 |
-
var ret = the_val.split(" ");
|
23 |
-
var current_date = ret[0];
|
24 |
-
var current_time = ret[1];
|
25 |
-
jQuery(this).parent().parent().find(".date.start").val(current_date);
|
26 |
-
jQuery(this).parent().parent().find(".time-picker").val(current_time);
|
27 |
-
});
|
28 |
-
|
29 |
-
jQuery("body").on('change', '.jquery-date-picker .date.start', function () {
|
30 |
-
var date_chosen = jQuery(this).val();
|
31 |
-
var time_chosen = jQuery(this).parent().parent().find(".jquery-date-picker .time-picker").val();
|
32 |
-
var total_time = date_chosen + " " + time_chosen;
|
33 |
-
jQuery(this).parent().parent().find(".new-date").val(total_time);
|
34 |
-
|
35 |
-
});
|
36 |
-
|
37 |
-
jQuery("body").on('change', '.jquery-date-picker .time-picker', function () {
|
38 |
-
var date_chosen = jQuery(this).parent().parent().find(".jquery-date-picker .date.start").val();
|
39 |
-
var time_chosen = jQuery(this).val();
|
40 |
-
if (typeof (time_chosen) === "undefined" && time_chosen == null && time_chosen === "") {
|
41 |
-
var time_chosen = "00:00";
|
42 |
-
}
|
43 |
-
var total_time = date_chosen + " " + time_chosen;
|
44 |
-
jQuery(this).parent().find(".new-date").val(total_time);
|
45 |
-
|
46 |
-
});
|
47 |
-
|
48 |
});
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
|
3 |
+
/* Populates timepicker values */
|
4 |
+
|
5 |
+
jQuery('.time-picker').timepicker({ 'timeFormat': 'H:i' });
|
6 |
+
|
7 |
+
if ($('.current_lander .new-date').length) { // implies *not* zero
|
8 |
+
var current_val = jQuery(".current_lander .new-date").val();
|
9 |
+
} else {
|
10 |
+
var current_val = jQuery(".new-date").val();
|
11 |
+
}
|
12 |
+
// if no timepicker in options fix it
|
13 |
+
if (typeof (current_val) == "undefined" || current_val === null || current_val == "") {
|
14 |
+
var current_val = '';
|
15 |
+
}
|
16 |
+
|
17 |
+
jQuery('.new-date').each(function(){
|
18 |
+
var the_val = $(this).val();
|
19 |
+
if (typeof (the_val) == "undefined" || the_val === null || the_val == "") {
|
20 |
+
var the_val = '';
|
21 |
+
}
|
22 |
+
var ret = the_val.split(" ");
|
23 |
+
var current_date = ret[0];
|
24 |
+
var current_time = ret[1];
|
25 |
+
jQuery(this).parent().parent().find(".date.start").val(current_date);
|
26 |
+
jQuery(this).parent().parent().find(".time-picker").val(current_time);
|
27 |
+
});
|
28 |
+
|
29 |
+
jQuery("body").on('change', '.jquery-date-picker .date.start', function () {
|
30 |
+
var date_chosen = jQuery(this).val();
|
31 |
+
var time_chosen = jQuery(this).parent().parent().find(".jquery-date-picker .time-picker").val();
|
32 |
+
var total_time = date_chosen + " " + time_chosen;
|
33 |
+
jQuery(this).parent().parent().find(".new-date").val(total_time);
|
34 |
+
|
35 |
+
});
|
36 |
+
|
37 |
+
jQuery("body").on('change', '.jquery-date-picker .time-picker', function () {
|
38 |
+
var date_chosen = jQuery(this).parent().parent().find(".jquery-date-picker .date.start").val();
|
39 |
+
var time_chosen = jQuery(this).val();
|
40 |
+
if (typeof (time_chosen) === "undefined" && time_chosen == null && time_chosen === "") {
|
41 |
+
var time_chosen = "00:00";
|
42 |
+
}
|
43 |
+
var total_time = date_chosen + " " + time_chosen;
|
44 |
+
jQuery(this).parent().find(".new-date").val(total_time);
|
45 |
+
|
46 |
+
});
|
47 |
+
|
48 |
});
|
js/libraries/tiny_mce/license.txt
CHANGED
@@ -1,504 +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 |
-
|
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 |
+
|
js/libraries/tiny_mce/plugins/advhr/css/advhr.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
|
2 |
-
.panel_wrapper div.current {height:80px;}
|
3 |
-
#width {width:50px; vertical-align:middle;}
|
4 |
-
#width2 {width:50px; vertical-align:middle;}
|
5 |
-
#size {width:100px;}
|
1 |
+
input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
|
2 |
+
.panel_wrapper div.current {height:80px;}
|
3 |
+
#width {width:50px; vertical-align:middle;}
|
4 |
+
#width2 {width:50px; vertical-align:middle;}
|
5 |
+
#size {width:100px;}
|
js/libraries/tiny_mce/plugins/advhr/editor_plugin_src.js
CHANGED
@@ -1,57 +1,57 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
// Register commands
|
15 |
-
ed.addCommand('mceAdvancedHr', function() {
|
16 |
-
ed.windowManager.open({
|
17 |
-
file : url + '/rule.htm',
|
18 |
-
width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
|
19 |
-
height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
|
20 |
-
inline : 1
|
21 |
-
}, {
|
22 |
-
plugin_url : url
|
23 |
-
});
|
24 |
-
});
|
25 |
-
|
26 |
-
// Register buttons
|
27 |
-
ed.addButton('advhr', {
|
28 |
-
title : 'advhr.advhr_desc',
|
29 |
-
cmd : 'mceAdvancedHr'
|
30 |
-
});
|
31 |
-
|
32 |
-
ed.onNodeChange.add(function(ed, cm, n) {
|
33 |
-
cm.setActive('advhr', n.nodeName == 'HR');
|
34 |
-
});
|
35 |
-
|
36 |
-
ed.onClick.add(function(ed, e) {
|
37 |
-
e = e.target;
|
38 |
-
|
39 |
-
if (e.nodeName === 'HR')
|
40 |
-
ed.selection.select(e);
|
41 |
-
});
|
42 |
-
},
|
43 |
-
|
44 |
-
getInfo : function() {
|
45 |
-
return {
|
46 |
-
longname : 'Advanced HR',
|
47 |
-
author : 'Moxiecode Systems AB',
|
48 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
49 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
|
50 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
51 |
-
};
|
52 |
-
}
|
53 |
-
});
|
54 |
-
|
55 |
-
// Register plugin
|
56 |
-
tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
|
57 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
// Register commands
|
15 |
+
ed.addCommand('mceAdvancedHr', function() {
|
16 |
+
ed.windowManager.open({
|
17 |
+
file : url + '/rule.htm',
|
18 |
+
width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
|
19 |
+
height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
|
20 |
+
inline : 1
|
21 |
+
}, {
|
22 |
+
plugin_url : url
|
23 |
+
});
|
24 |
+
});
|
25 |
+
|
26 |
+
// Register buttons
|
27 |
+
ed.addButton('advhr', {
|
28 |
+
title : 'advhr.advhr_desc',
|
29 |
+
cmd : 'mceAdvancedHr'
|
30 |
+
});
|
31 |
+
|
32 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
33 |
+
cm.setActive('advhr', n.nodeName == 'HR');
|
34 |
+
});
|
35 |
+
|
36 |
+
ed.onClick.add(function(ed, e) {
|
37 |
+
e = e.target;
|
38 |
+
|
39 |
+
if (e.nodeName === 'HR')
|
40 |
+
ed.selection.select(e);
|
41 |
+
});
|
42 |
+
},
|
43 |
+
|
44 |
+
getInfo : function() {
|
45 |
+
return {
|
46 |
+
longname : 'Advanced HR',
|
47 |
+
author : 'Moxiecode Systems AB',
|
48 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
49 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
|
50 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
51 |
+
};
|
52 |
+
}
|
53 |
+
});
|
54 |
+
|
55 |
+
// Register plugin
|
56 |
+
tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
|
57 |
})();
|
js/libraries/tiny_mce/plugins/advhr/js/rule.js
CHANGED
@@ -1,43 +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);
|
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);
|
js/libraries/tiny_mce/plugins/advhr/rule.htm
CHANGED
@@ -1,58 +1,58 @@
|
|
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 |
-
</head>
|
11 |
-
<body role="application">
|
12 |
-
<form onsubmit="AdvHRDialog.update();return false;" action="#">
|
13 |
-
<div class="tabs">
|
14 |
-
<ul>
|
15 |
-
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>
|
16 |
-
</ul>
|
17 |
-
</div>
|
18 |
-
|
19 |
-
<div class="panel_wrapper">
|
20 |
-
<div id="general_panel" class="panel current">
|
21 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
22 |
-
<tr role="group" aria-labelledby="width_label">
|
23 |
-
<td><label id="width_label" for="width">{#advhr_dlg.width}</label></td>
|
24 |
-
<td class="nowrap">
|
25 |
-
<input id="width" name="width" type="text" value="" class="mceFocus" />
|
26 |
-
<span style="display:none;" id="width_unit_label">{#advhr_dlg.widthunits}</span>
|
27 |
-
<select name="width2" id="width2" aria-labelledby="width_unit_label">
|
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="">{#advhr_dlg.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 |
-
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
54 |
-
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
55 |
-
</div>
|
56 |
-
</form>
|
57 |
-
</body>
|
58 |
-
</html>
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#advhr.advhr_desc}</title>
|
5 |
+
<script type="text/javascript" src="../../tiny_mce_popup.js"></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 |
+
</head>
|
11 |
+
<body role="application">
|
12 |
+
<form onsubmit="AdvHRDialog.update();return false;" action="#">
|
13 |
+
<div class="tabs">
|
14 |
+
<ul>
|
15 |
+
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>
|
16 |
+
</ul>
|
17 |
+
</div>
|
18 |
+
|
19 |
+
<div class="panel_wrapper">
|
20 |
+
<div id="general_panel" class="panel current">
|
21 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
22 |
+
<tr role="group" aria-labelledby="width_label">
|
23 |
+
<td><label id="width_label" for="width">{#advhr_dlg.width}</label></td>
|
24 |
+
<td class="nowrap">
|
25 |
+
<input id="width" name="width" type="text" value="" class="mceFocus" />
|
26 |
+
<span style="display:none;" id="width_unit_label">{#advhr_dlg.widthunits}</span>
|
27 |
+
<select name="width2" id="width2" aria-labelledby="width_unit_label">
|
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="">{#advhr_dlg.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 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
54 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
55 |
+
</div>
|
56 |
+
</form>
|
57 |
+
</body>
|
58 |
+
</html>
|
js/libraries/tiny_mce/plugins/advimage/css/advimage.css
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
#src_list, #over_list, #out_list {width:280px;}
|
2 |
-
.mceActionPanel {margin-top:7px;}
|
3 |
-
.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
|
4 |
-
.checkbox {border:0;}
|
5 |
-
.panel_wrapper div.current {height:305px;}
|
6 |
-
#prev {margin:0; border:1px solid #000; width: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;}
|
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;}
|
js/libraries/tiny_mce/plugins/advimage/editor_plugin_src.js
CHANGED
@@ -1,50 +1,50 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
// Register commands
|
15 |
-
ed.addCommand('mceAdvImage', function() {
|
16 |
-
// Internal image object like a flash placeholder
|
17 |
-
if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1)
|
18 |
-
return;
|
19 |
-
|
20 |
-
ed.windowManager.open({
|
21 |
-
file : url + '/image.htm',
|
22 |
-
width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
|
23 |
-
height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
|
24 |
-
inline : 1
|
25 |
-
}, {
|
26 |
-
plugin_url : url
|
27 |
-
});
|
28 |
-
});
|
29 |
-
|
30 |
-
// Register buttons
|
31 |
-
ed.addButton('image', {
|
32 |
-
title : 'advimage.image_desc',
|
33 |
-
cmd : 'mceAdvImage'
|
34 |
-
});
|
35 |
-
},
|
36 |
-
|
37 |
-
getInfo : function() {
|
38 |
-
return {
|
39 |
-
longname : 'Advanced image',
|
40 |
-
author : 'Moxiecode Systems AB',
|
41 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
42 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
43 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
44 |
-
};
|
45 |
-
}
|
46 |
-
});
|
47 |
-
|
48 |
-
// Register plugin
|
49 |
-
tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
|
50 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
// Register commands
|
15 |
+
ed.addCommand('mceAdvImage', function() {
|
16 |
+
// Internal image object like a flash placeholder
|
17 |
+
if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1)
|
18 |
+
return;
|
19 |
+
|
20 |
+
ed.windowManager.open({
|
21 |
+
file : url + '/image.htm',
|
22 |
+
width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
|
23 |
+
height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
|
24 |
+
inline : 1
|
25 |
+
}, {
|
26 |
+
plugin_url : url
|
27 |
+
});
|
28 |
+
});
|
29 |
+
|
30 |
+
// Register buttons
|
31 |
+
ed.addButton('image', {
|
32 |
+
title : 'advimage.image_desc',
|
33 |
+
cmd : 'mceAdvImage'
|
34 |
+
});
|
35 |
+
},
|
36 |
+
|
37 |
+
getInfo : function() {
|
38 |
+
return {
|
39 |
+
longname : 'Advanced image',
|
40 |
+
author : 'Moxiecode Systems AB',
|
41 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
42 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
43 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
44 |
+
};
|
45 |
+
}
|
46 |
+
});
|
47 |
+
|
48 |
+
// Register plugin
|
49 |
+
tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
|
50 |
})();
|
js/libraries/tiny_mce/plugins/advimage/image.htm
CHANGED
@@ -1,235 +1,235 @@
|
|
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 |
-
</head>
|
13 |
-
<body id="advimage" style="display: none" role="application" aria-labelledby="app_title">
|
14 |
-
<span id="app_title" style="display:none">{#advimage_dlg.dialog_title}</span>
|
15 |
-
<form onsubmit="ImageDialog.insert();return false;" action="#">
|
16 |
-
<div class="tabs">
|
17 |
-
<ul>
|
18 |
-
<li id="general_tab" class="current" aria-controls="general_panel"><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" aria-controls="appearance_panel"><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" aria-controls="advanced_panel"><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 role="presentation" class="properties">
|
30 |
-
<tr>
|
31 |
-
<td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
|
32 |
-
<td colspan="2"><table role="presentation" 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);" aria-required="true" /></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);"><option value=""></option></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 role="presentation" 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 role="group" aria-labelledby="widthlabel">
|
91 |
-
<td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
|
92 |
-
<td class="nowrap">
|
93 |
-
<span style="display:none" id="width_voiceLabel">{#advimage_dlg.width}</span>
|
94 |
-
<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" aria-labelledby="width_voiceLabel" /> x
|
95 |
-
<span style="display:none" id="height_voiceLabel">{#advimage_dlg.height}</span>
|
96 |
-
<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" aria-labelledby="height_voiceLabel" /> px
|
97 |
-
</td>
|
98 |
-
</tr>
|
99 |
-
|
100 |
-
<tr>
|
101 |
-
<td> </td>
|
102 |
-
<td><table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
103 |
-
<tr>
|
104 |
-
<td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
|
105 |
-
<td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>
|
106 |
-
</tr>
|
107 |
-
</table></td>
|
108 |
-
</tr>
|
109 |
-
|
110 |
-
<tr>
|
111 |
-
<td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td>
|
112 |
-
<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();" />
|
113 |
-
</td>
|
114 |
-
</tr>
|
115 |
-
|
116 |
-
<tr>
|
117 |
-
<td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td>
|
118 |
-
<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>
|
119 |
-
</tr>
|
120 |
-
|
121 |
-
<tr>
|
122 |
-
<td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td>
|
123 |
-
<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>
|
124 |
-
</tr>
|
125 |
-
|
126 |
-
<tr>
|
127 |
-
<td><label for="class_list">{#class_name}</label></td>
|
128 |
-
<td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>
|
129 |
-
</tr>
|
130 |
-
|
131 |
-
<tr>
|
132 |
-
<td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td>
|
133 |
-
<td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td>
|
134 |
-
</tr>
|
135 |
-
|
136 |
-
<!-- <tr>
|
137 |
-
<td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td>
|
138 |
-
<td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
139 |
-
</tr> -->
|
140 |
-
</table>
|
141 |
-
</fieldset>
|
142 |
-
</div>
|
143 |
-
|
144 |
-
<div id="advanced_panel" class="panel">
|
145 |
-
<fieldset>
|
146 |
-
<legend>{#advimage_dlg.swap_image}</legend>
|
147 |
-
|
148 |
-
<input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" aria-controls="onmouseoversrc onmouseoutsrc" />
|
149 |
-
<label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>
|
150 |
-
|
151 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
|
152 |
-
<tr>
|
153 |
-
<td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td>
|
154 |
-
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
155 |
-
<tr>
|
156 |
-
<td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
|
157 |
-
<td id="onmouseoversrccontainer"> </td>
|
158 |
-
</tr>
|
159 |
-
</table></td>
|
160 |
-
</tr>
|
161 |
-
<tr>
|
162 |
-
<td><label for="over_list">{#advimage_dlg.image_list}</label></td>
|
163 |
-
<td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
164 |
-
</tr>
|
165 |
-
<tr>
|
166 |
-
<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
|
167 |
-
<td class="column2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
168 |
-
<tr>
|
169 |
-
<td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
|
170 |
-
<td id="onmouseoutsrccontainer"> </td>
|
171 |
-
</tr>
|
172 |
-
</table></td>
|
173 |
-
</tr>
|
174 |
-
<tr>
|
175 |
-
<td><label for="out_list">{#advimage_dlg.image_list}</label></td>
|
176 |
-
<td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
177 |
-
</tr>
|
178 |
-
</table>
|
179 |
-
</fieldset>
|
180 |
-
|
181 |
-
<fieldset>
|
182 |
-
<legend>{#advimage_dlg.misc}</legend>
|
183 |
-
|
184 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
185 |
-
<tr>
|
186 |
-
<td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
|
187 |
-
<td><input id="id" name="id" type="text" value="" /></td>
|
188 |
-
</tr>
|
189 |
-
|
190 |
-
<tr>
|
191 |
-
<td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
|
192 |
-
<td>
|
193 |
-
<select id="dir" name="dir" onchange="ImageDialog.changeAppearance();">
|
194 |
-
<option value="">{#not_set}</option>
|
195 |
-
<option value="ltr">{#advimage_dlg.ltr}</option>
|
196 |
-
<option value="rtl">{#advimage_dlg.rtl}</option>
|
197 |
-
</select>
|
198 |
-
</td>
|
199 |
-
</tr>
|
200 |
-
|
201 |
-
<tr>
|
202 |
-
<td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td>
|
203 |
-
<td>
|
204 |
-
<input id="lang" name="lang" type="text" value="" />
|
205 |
-
</td>
|
206 |
-
</tr>
|
207 |
-
|
208 |
-
<tr>
|
209 |
-
<td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td>
|
210 |
-
<td>
|
211 |
-
<input id="usemap" name="usemap" type="text" value="" />
|
212 |
-
</td>
|
213 |
-
</tr>
|
214 |
-
|
215 |
-
<tr>
|
216 |
-
<td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>
|
217 |
-
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
218 |
-
<tr>
|
219 |
-
<td><input id="longdesc" name="longdesc" type="text" value="" /></td>
|
220 |
-
<td id="longdesccontainer"> </td>
|
221 |
-
</tr>
|
222 |
-
</table></td>
|
223 |
-
</tr>
|
224 |
-
</table>
|
225 |
-
</fieldset>
|
226 |
-
</div>
|
227 |
-
</div>
|
228 |
-
|
229 |
-
<div class="mceActionPanel">
|
230 |
-
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
231 |
-
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
232 |
-
</div>
|
233 |
-
</form>
|
234 |
-
</body>
|
235 |
-
</html>
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#advimage_dlg.dialog_title}</title>
|
5 |
+
<script type="text/javascript" src="../../tiny_mce_popup.js"></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 |
+
</head>
|
13 |
+
<body id="advimage" style="display: none" role="application" aria-labelledby="app_title">
|
14 |
+
<span id="app_title" style="display:none">{#advimage_dlg.dialog_title}</span>
|
15 |
+
<form onsubmit="ImageDialog.insert();return false;" action="#">
|
16 |
+
<div class="tabs">
|
17 |
+
<ul>
|
18 |
+
<li id="general_tab" class="current" aria-controls="general_panel"><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" aria-controls="appearance_panel"><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" aria-controls="advanced_panel"><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 role="presentation" class="properties">
|
30 |
+
<tr>
|
31 |
+
<td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
|
32 |
+
<td colspan="2"><table role="presentation" 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);" aria-required="true" /></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);"><option value=""></option></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 role="presentation" 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 role="group" aria-labelledby="widthlabel">
|
91 |
+
<td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
|
92 |
+
<td class="nowrap">
|
93 |
+
<span style="display:none" id="width_voiceLabel">{#advimage_dlg.width}</span>
|
94 |
+
<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" aria-labelledby="width_voiceLabel" /> x
|
95 |
+
<span style="display:none" id="height_voiceLabel">{#advimage_dlg.height}</span>
|
96 |
+
<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" aria-labelledby="height_voiceLabel" /> px
|
97 |
+
</td>
|
98 |
+
</tr>
|
99 |
+
|
100 |
+
<tr>
|
101 |
+
<td> </td>
|
102 |
+
<td><table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
103 |
+
<tr>
|
104 |
+
<td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
|
105 |
+
<td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>
|
106 |
+
</tr>
|
107 |
+
</table></td>
|
108 |
+
</tr>
|
109 |
+
|
110 |
+
<tr>
|
111 |
+
<td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td>
|
112 |
+
<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();" />
|
113 |
+
</td>
|
114 |
+
</tr>
|
115 |
+
|
116 |
+
<tr>
|
117 |
+
<td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td>
|
118 |
+
<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>
|
119 |
+
</tr>
|
120 |
+
|
121 |
+
<tr>
|
122 |
+
<td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td>
|
123 |
+
<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>
|
124 |
+
</tr>
|
125 |
+
|
126 |
+
<tr>
|
127 |
+
<td><label for="class_list">{#class_name}</label></td>
|
128 |
+
<td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>
|
129 |
+
</tr>
|
130 |
+
|
131 |
+
<tr>
|
132 |
+
<td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td>
|
133 |
+
<td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td>
|
134 |
+
</tr>
|
135 |
+
|
136 |
+
<!-- <tr>
|
137 |
+
<td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td>
|
138 |
+
<td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
139 |
+
</tr> -->
|
140 |
+
</table>
|
141 |
+
</fieldset>
|
142 |
+
</div>
|
143 |
+
|
144 |
+
<div id="advanced_panel" class="panel">
|
145 |
+
<fieldset>
|
146 |
+
<legend>{#advimage_dlg.swap_image}</legend>
|
147 |
+
|
148 |
+
<input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" aria-controls="onmouseoversrc onmouseoutsrc" />
|
149 |
+
<label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>
|
150 |
+
|
151 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
|
152 |
+
<tr>
|
153 |
+
<td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td>
|
154 |
+
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
155 |
+
<tr>
|
156 |
+
<td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
|
157 |
+
<td id="onmouseoversrccontainer"> </td>
|
158 |
+
</tr>
|
159 |
+
</table></td>
|
160 |
+
</tr>
|
161 |
+
<tr>
|
162 |
+
<td><label for="over_list">{#advimage_dlg.image_list}</label></td>
|
163 |
+
<td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
164 |
+
</tr>
|
165 |
+
<tr>
|
166 |
+
<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
|
167 |
+
<td class="column2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
168 |
+
<tr>
|
169 |
+
<td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
|
170 |
+
<td id="onmouseoutsrccontainer"> </td>
|
171 |
+
</tr>
|
172 |
+
</table></td>
|
173 |
+
</tr>
|
174 |
+
<tr>
|
175 |
+
<td><label for="out_list">{#advimage_dlg.image_list}</label></td>
|
176 |
+
<td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
177 |
+
</tr>
|
178 |
+
</table>
|
179 |
+
</fieldset>
|
180 |
+
|
181 |
+
<fieldset>
|
182 |
+
<legend>{#advimage_dlg.misc}</legend>
|
183 |
+
|
184 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
185 |
+
<tr>
|
186 |
+
<td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
|
187 |
+
<td><input id="id" name="id" type="text" value="" /></td>
|
188 |
+
</tr>
|
189 |
+
|
190 |
+
<tr>
|
191 |
+
<td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
|
192 |
+
<td>
|
193 |
+
<select id="dir" name="dir" onchange="ImageDialog.changeAppearance();">
|
194 |
+
<option value="">{#not_set}</option>
|
195 |
+
<option value="ltr">{#advimage_dlg.ltr}</option>
|
196 |
+
<option value="rtl">{#advimage_dlg.rtl}</option>
|
197 |
+
</select>
|
198 |
+
</td>
|
199 |
+
</tr>
|
200 |
+
|
201 |
+
<tr>
|
202 |
+
<td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td>
|
203 |
+
<td>
|
204 |
+
<input id="lang" name="lang" type="text" value="" />
|
205 |
+
</td>
|
206 |
+
</tr>
|
207 |
+
|
208 |
+
<tr>
|
209 |
+
<td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td>
|
210 |
+
<td>
|
211 |
+
<input id="usemap" name="usemap" type="text" value="" />
|
212 |
+
</td>
|
213 |
+
</tr>
|
214 |
+
|
215 |
+
<tr>
|
216 |
+
<td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>
|
217 |
+
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
218 |
+
<tr>
|
219 |
+
<td><input id="longdesc" name="longdesc" type="text" value="" /></td>
|
220 |
+
<td id="longdesccontainer"> </td>
|
221 |
+
</tr>
|
222 |
+
</table></td>
|
223 |
+
</tr>
|
224 |
+
</table>
|
225 |
+
</fieldset>
|
226 |
+
</div>
|
227 |
+
</div>
|
228 |
+
|
229 |
+
<div class="mceActionPanel">
|
230 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
231 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
232 |
+
</div>
|
233 |
+
</form>
|
234 |
+
</body>
|
235 |
+
</html>
|
js/libraries/tiny_mce/plugins/advimage/js/image.js
CHANGED
@@ -1,464 +1,464 @@
|
|
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(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList');
|
13 |
-
|
14 |
-
tinyMCEPopup.resizeToInnerSize();
|
15 |
-
this.fillClassList('class_list');
|
16 |
-
this.fillFileList('src_list', fl);
|
17 |
-
this.fillFileList('over_list', fl);
|
18 |
-
this.fillFileList('out_list', fl);
|
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.replace(/ /g, '%20'),
|
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 |
-
tinymce.each(args, function(value, name) {
|
175 |
-
if (value === "") {
|
176 |
-
delete args[name];
|
177 |
-
}
|
178 |
-
});
|
179 |
-
|
180 |
-
ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});
|
181 |
-
ed.undoManager.add();
|
182 |
-
}
|
183 |
-
|
184 |
-
tinyMCEPopup.editor.execCommand('mceRepaint');
|
185 |
-
tinyMCEPopup.editor.focus();
|
186 |
-
tinyMCEPopup.close();
|
187 |
-
},
|
188 |
-
|
189 |
-
getAttrib : function(e, at) {
|
190 |
-
var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
|
191 |
-
|
192 |
-
if (ed.settings.inline_styles) {
|
193 |
-
switch (at) {
|
194 |
-
case 'align':
|
195 |
-
if (v = dom.getStyle(e, 'float'))
|
196 |
-
return v;
|
197 |
-
|
198 |
-
if (v = dom.getStyle(e, 'vertical-align'))
|
199 |
-
return v;
|
200 |
-
|
201 |
-
break;
|
202 |
-
|
203 |
-
case 'hspace':
|
204 |
-
v = dom.getStyle(e, 'margin-left')
|
205 |
-
v2 = dom.getStyle(e, 'margin-right');
|
206 |
-
|
207 |
-
if (v && v == v2)
|
208 |
-
return parseInt(v.replace(/[^0-9]/g, ''));
|
209 |
-
|
210 |
-
break;
|
211 |
-
|
212 |
-
case 'vspace':
|
213 |
-
v = dom.getStyle(e, 'margin-top')
|
214 |
-
v2 = dom.getStyle(e, 'margin-bottom');
|
215 |
-
if (v && v == v2)
|
216 |
-
return parseInt(v.replace(/[^0-9]/g, ''));
|
217 |
-
|
218 |
-
break;
|
219 |
-
|
220 |
-
case 'border':
|
221 |
-
v = 0;
|
222 |
-
|
223 |
-
tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
|
224 |
-
sv = dom.getStyle(e, 'border-' + sv + '-width');
|
225 |
-
|
226 |
-
// False or not the same as prev
|
227 |
-
if (!sv || (sv != v && v !== 0)) {
|
228 |
-
v = 0;
|
229 |
-
return false;
|
230 |
-
}
|
231 |
-
|
232 |
-
if (sv)
|
233 |
-
v = sv;
|
234 |
-
});
|
235 |
-
|
236 |
-
if (v)
|
237 |
-
return parseInt(v.replace(/[^0-9]/g, ''));
|
238 |
-
|
239 |
-
break;
|
240 |
-
}
|
241 |
-
}
|
242 |
-
|
243 |
-
if (v = dom.getAttrib(e, at))
|
244 |
-
return v;
|
245 |
-
|
246 |
-
return '';
|
247 |
-
},
|
248 |
-
|
249 |
-
setSwapImage : function(st) {
|
250 |
-
var f = document.forms[0];
|
251 |
-
|
252 |
-
f.onmousemovecheck.checked = st;
|
253 |
-
setBrowserDisabled('overbrowser', !st);
|
254 |
-
setBrowserDisabled('outbrowser', !st);
|
255 |
-
|
256 |
-
if (f.over_list)
|
257 |
-
f.over_list.disabled = !st;
|
258 |
-
|
259 |
-
if (f.out_list)
|
260 |
-
f.out_list.disabled = !st;
|
261 |
-
|
262 |
-
f.onmouseoversrc.disabled = !st;
|
263 |
-
f.onmouseoutsrc.disabled = !st;
|
264 |
-
},
|
265 |
-
|
266 |
-
fillClassList : function(id) {
|
267 |
-
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
268 |
-
|
269 |
-
if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
|
270 |
-
cl = [];
|
271 |
-
|
272 |
-
tinymce.each(v.split(';'), function(v) {
|
273 |
-
var p = v.split('=');
|
274 |
-
|
275 |
-
cl.push({'title' : p[0], 'class' : p[1]});
|
276 |
-
});
|
277 |
-
} else
|
278 |
-
cl = tinyMCEPopup.editor.dom.getClasses();
|
279 |
-
|
280 |
-
if (cl.length > 0) {
|
281 |
-
lst.options.length = 0;
|
282 |
-
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
|
283 |
-
|
284 |
-
tinymce.each(cl, function(o) {
|
285 |
-
lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
|
286 |
-
});
|
287 |
-
} else
|
288 |
-
dom.remove(dom.getParent(id, 'tr'));
|
289 |
-
},
|
290 |
-
|
291 |
-
fillFileList : function(id, l) {
|
292 |
-
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
293 |
-
|
294 |
-
l = typeof(l) === 'function' ? l() : window[l];
|
295 |
-
lst.options.length = 0;
|
296 |
-
|
297 |
-
if (l && l.length > 0) {
|
298 |
-
lst.options[lst.options.length] = new Option('', '');
|
299 |
-
|
300 |
-
tinymce.each(l, function(o) {
|
301 |
-
lst.options[lst.options.length] = new Option(o[0], o[1]);
|
302 |
-
});
|
303 |
-
} else
|
304 |
-
dom.remove(dom.getParent(id, 'tr'));
|
305 |
-
},
|
306 |
-
|
307 |
-
resetImageData : function() {
|
308 |
-
var f = document.forms[0];
|
309 |
-
|
310 |
-
f.elements.width.value = f.elements.height.value = '';
|
311 |
-
},
|
312 |
-
|
313 |
-
updateImageData : function(img, st) {
|
314 |
-
var f = document.forms[0];
|
315 |
-
|
316 |
-
if (!st) {
|
317 |
-
f.elements.width.value = img.width;
|
318 |
-
f.elements.height.value = img.height;
|
319 |
-
}
|
320 |
-
|
321 |
-
this.preloadImg = img;
|
322 |
-
},
|
323 |
-
|
324 |
-
changeAppearance : function() {
|
325 |
-
var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');
|
326 |
-
|
327 |
-
if (img) {
|
328 |
-
if (ed.getParam('inline_styles')) {
|
329 |
-
ed.dom.setAttrib(img, 'style', f.style.value);
|
330 |
-
} else {
|
331 |
-
img.align = f.align.value;
|
332 |
-
img.border = f.border.value;
|
333 |
-
img.hspace = f.hspace.value;
|
334 |
-
img.vspace = f.vspace.value;
|
335 |
-
}
|
336 |
-
}
|
337 |
-
},
|
338 |
-
|
339 |
-
changeHeight : function() {
|
340 |
-
var f = document.forms[0], tp, t = this;
|
341 |
-
|
342 |
-
if (!f.constrain.checked || !t.preloadImg) {
|
343 |
-
return;
|
344 |
-
}
|
345 |
-
|
346 |
-
if (f.width.value == "" || f.height.value == "")
|
347 |
-
return;
|
348 |
-
|
349 |
-
tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;
|
350 |
-
f.height.value = tp.toFixed(0);
|
351 |
-
},
|
352 |
-
|
353 |
-
changeWidth : function() {
|
354 |
-
var f = document.forms[0], tp, t = this;
|
355 |
-
|
356 |
-
if (!f.constrain.checked || !t.preloadImg) {
|
357 |
-
return;
|
358 |
-
}
|
359 |
-
|
360 |
-
if (f.width.value == "" || f.height.value == "")
|
361 |
-
return;
|
362 |
-
|
363 |
-
tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;
|
364 |
-
f.width.value = tp.toFixed(0);
|
365 |
-
},
|
366 |
-
|
367 |
-
updateStyle : function(ty) {
|
368 |
-
var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
|
369 |
-
|
370 |
-
if (tinyMCEPopup.editor.settings.inline_styles) {
|
371 |
-
// Handle align
|
372 |
-
if (ty == 'align') {
|
373 |
-
dom.setStyle(img, 'float', '');
|
374 |
-
dom.setStyle(img, 'vertical-align', '');
|
375 |
-
|
376 |
-
v = getSelectValue(f, 'align');
|
377 |
-
if (v) {
|
378 |
-
if (v == 'left' || v == 'right')
|
379 |
-
dom.setStyle(img, 'float', v);
|
380 |
-
else
|
381 |
-
img.style.verticalAlign = v;
|
382 |
-
}
|
383 |
-
}
|
384 |
-
|
385 |
-
// Handle border
|
386 |
-
if (ty == 'border') {
|
387 |
-
b = img.style.border ? img.style.border.split(' ') : [];
|
388 |
-
bStyle = dom.getStyle(img, 'border-style');
|
389 |
-
bColor = dom.getStyle(img, 'border-color');
|
390 |
-
|
391 |
-
dom.setStyle(img, 'border', '');
|
392 |
-
|
393 |
-
v = f.border.value;
|
394 |
-
if (v || v == '0') {
|
395 |
-
if (v == '0')
|
396 |
-
img.style.border = isIE ? '0' : '0 none none';
|
397 |
-
else {
|
398 |
-
var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9);
|
399 |
-
|
400 |
-
if (b.length == 3 && b[isOldIE ? 2 : 1])
|
401 |
-
bStyle = b[isOldIE ? 2 : 1];
|
402 |
-
else if (!bStyle || bStyle == 'none')
|
403 |
-
bStyle = 'solid';
|
404 |
-
if (b.length == 3 && b[isIE ? 0 : 2])
|
405 |
-
bColor = b[isOldIE ? 0 : 2];
|
406 |
-
else if (!bColor || bColor == 'none')
|
407 |
-
bColor = 'black';
|
408 |
-
img.style.border = v + 'px ' + bStyle + ' ' + bColor;
|
409 |
-
}
|
410 |
-
}
|
411 |
-
}
|
412 |
-
|
413 |
-
// Handle hspace
|
414 |
-
if (ty == 'hspace') {
|
415 |
-
dom.setStyle(img, 'marginLeft', '');
|
416 |
-
dom.setStyle(img, 'marginRight', '');
|
417 |
-
|
418 |
-
v = f.hspace.value;
|
419 |
-
if (v) {
|
420 |
-
img.style.marginLeft = v + 'px';
|
421 |
-
img.style.marginRight = v + 'px';
|
422 |
-
}
|
423 |
-
}
|
424 |
-
|
425 |
-
// Handle vspace
|
426 |
-
if (ty == 'vspace') {
|
427 |
-
dom.setStyle(img, 'marginTop', '');
|
428 |
-
dom.setStyle(img, 'marginBottom', '');
|
429 |
-
|
430 |
-
v = f.vspace.value;
|
431 |
-
if (v) {
|
432 |
-
img.style.marginTop = v + 'px';
|
433 |
-
img.style.marginBottom = v + 'px';
|
434 |
-
}
|
435 |
-
}
|
436 |
-
|
437 |
-
// Merge
|
438 |
-
dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img');
|
439 |
-
}
|
440 |
-
},
|
441 |
-
|
442 |
-
changeMouseMove : function() {
|
443 |
-
},
|
444 |
-
|
445 |
-
showPreviewImage : function(u, st) {
|
446 |
-
if (!u) {
|
447 |
-
tinyMCEPopup.dom.setHTML('prev', '');
|
448 |
-
return;
|
449 |
-
}
|
450 |
-
|
451 |
-
if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
|
452 |
-
this.resetImageData();
|
453 |
-
|
454 |
-
u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
|
455 |
-
|
456 |
-
if (!st)
|
457 |
-
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
|
458 |
-
else
|
459 |
-
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
|
460 |
-
}
|
461 |
-
};
|
462 |
-
|
463 |
-
ImageDialog.preInit();
|
464 |
-
tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
|
1 |
+
var ImageDialog = {
|
2 |
+
preInit : function() {
|
3 |
+
var url;
|
4 |
+
|
5 |
+
tinyMCEPopup.requireLangPack();
|
6 |
+
|
7 |
+
if (url = tinyMCEPopup.getParam("external_image_list_url"))
|
8 |
+
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
9 |
+
},
|
10 |
+
|
11 |
+
init : function(ed) {
|
12 |
+
var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList');
|
13 |
+
|
14 |
+
tinyMCEPopup.resizeToInnerSize();
|
15 |
+
this.fillClassList('class_list');
|
16 |
+
this.fillFileList('src_list', fl);
|
17 |
+
this.fillFileList('over_list', fl);
|
18 |
+
this.fillFileList('out_list', fl);
|
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.replace(/ /g, '%20'),
|
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 |
+
tinymce.each(args, function(value, name) {
|
175 |
+
if (value === "") {
|
176 |
+
delete args[name];
|
177 |
+
}
|
178 |
+
});
|
179 |
+
|
180 |
+
ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});
|
181 |
+
ed.undoManager.add();
|
182 |
+
}
|
183 |
+
|
184 |
+
tinyMCEPopup.editor.execCommand('mceRepaint');
|
185 |
+
tinyMCEPopup.editor.focus();
|
186 |
+
tinyMCEPopup.close();
|
187 |
+
},
|
188 |
+
|
189 |
+
getAttrib : function(e, at) {
|
190 |
+
var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
|
191 |
+
|
192 |
+
if (ed.settings.inline_styles) {
|
193 |
+
switch (at) {
|
194 |
+
case 'align':
|
195 |
+
if (v = dom.getStyle(e, 'float'))
|
196 |
+
return v;
|
197 |
+
|
198 |
+
if (v = dom.getStyle(e, 'vertical-align'))
|
199 |
+
return v;
|
200 |
+
|
201 |
+
break;
|
202 |
+
|
203 |
+
case 'hspace':
|
204 |
+
v = dom.getStyle(e, 'margin-left')
|
205 |
+
v2 = dom.getStyle(e, 'margin-right');
|
206 |
+
|
207 |
+
if (v && v == v2)
|
208 |
+
return parseInt(v.replace(/[^0-9]/g, ''));
|
209 |
+
|
210 |
+
break;
|
211 |
+
|
212 |
+
case 'vspace':
|
213 |
+
v = dom.getStyle(e, 'margin-top')
|
214 |
+
v2 = dom.getStyle(e, 'margin-bottom');
|
215 |
+
if (v && v == v2)
|
216 |
+
return parseInt(v.replace(/[^0-9]/g, ''));
|
217 |
+
|
218 |
+
break;
|
219 |
+
|
220 |
+
case 'border':
|
221 |
+
v = 0;
|
222 |
+
|
223 |
+
tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
|
224 |
+
sv = dom.getStyle(e, 'border-' + sv + '-width');
|
225 |
+
|
226 |
+
// False or not the same as prev
|
227 |
+
if (!sv || (sv != v && v !== 0)) {
|
228 |
+
v = 0;
|
229 |
+
return false;
|
230 |
+
}
|
231 |
+
|
232 |
+
if (sv)
|
233 |
+
v = sv;
|
234 |
+
});
|
235 |
+
|
236 |
+
if (v)
|
237 |
+
return parseInt(v.replace(/[^0-9]/g, ''));
|
238 |
+
|
239 |
+
break;
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
if (v = dom.getAttrib(e, at))
|
244 |
+
return v;
|
245 |
+
|
246 |
+
return '';
|
247 |
+
},
|
248 |
+
|
249 |
+
setSwapImage : function(st) {
|
250 |
+
var f = document.forms[0];
|
251 |
+
|
252 |
+
f.onmousemovecheck.checked = st;
|
253 |
+
setBrowserDisabled('overbrowser', !st);
|
254 |
+
setBrowserDisabled('outbrowser', !st);
|
255 |
+
|
256 |
+
if (f.over_list)
|
257 |
+
f.over_list.disabled = !st;
|
258 |
+
|
259 |
+
if (f.out_list)
|
260 |
+
f.out_list.disabled = !st;
|
261 |
+
|
262 |
+
f.onmouseoversrc.disabled = !st;
|
263 |
+
f.onmouseoutsrc.disabled = !st;
|
264 |
+
},
|
265 |
+
|
266 |
+
fillClassList : function(id) {
|
267 |
+
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
268 |
+
|
269 |
+
if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
|
270 |
+
cl = [];
|
271 |
+
|
272 |
+
tinymce.each(v.split(';'), function(v) {
|
273 |
+
var p = v.split('=');
|
274 |
+
|
275 |
+
cl.push({'title' : p[0], 'class' : p[1]});
|
276 |
+
});
|
277 |
+
} else
|
278 |
+
cl = tinyMCEPopup.editor.dom.getClasses();
|
279 |
+
|
280 |
+
if (cl.length > 0) {
|
281 |
+
lst.options.length = 0;
|
282 |
+
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
|
283 |
+
|
284 |
+
tinymce.each(cl, function(o) {
|
285 |
+
lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
|
286 |
+
});
|
287 |
+
} else
|
288 |
+
dom.remove(dom.getParent(id, 'tr'));
|
289 |
+
},
|
290 |
+
|
291 |
+
fillFileList : function(id, l) {
|
292 |
+
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
293 |
+
|
294 |
+
l = typeof(l) === 'function' ? l() : window[l];
|
295 |
+
lst.options.length = 0;
|
296 |
+
|
297 |
+
if (l && l.length > 0) {
|
298 |
+
lst.options[lst.options.length] = new Option('', '');
|
299 |
+
|
300 |
+
tinymce.each(l, function(o) {
|
301 |
+
lst.options[lst.options.length] = new Option(o[0], o[1]);
|
302 |
+
});
|
303 |
+
} else
|
304 |
+
dom.remove(dom.getParent(id, 'tr'));
|
305 |
+
},
|
306 |
+
|
307 |
+
resetImageData : function() {
|
308 |
+
var f = document.forms[0];
|
309 |
+
|
310 |
+
f.elements.width.value = f.elements.height.value = '';
|
311 |
+
},
|
312 |
+
|
313 |
+
updateImageData : function(img, st) {
|
314 |
+
var f = document.forms[0];
|
315 |
+
|
316 |
+
if (!st) {
|
317 |
+
f.elements.width.value = img.width;
|
318 |
+
f.elements.height.value = img.height;
|
319 |
+
}
|
320 |
+
|
321 |
+
this.preloadImg = img;
|
322 |
+
},
|
323 |
+
|
324 |
+
changeAppearance : function() {
|
325 |
+
var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');
|
326 |
+
|
327 |
+
if (img) {
|
328 |
+
if (ed.getParam('inline_styles')) {
|
329 |
+
ed.dom.setAttrib(img, 'style', f.style.value);
|
330 |
+
} else {
|
331 |
+
img.align = f.align.value;
|
332 |
+
img.border = f.border.value;
|
333 |
+
img.hspace = f.hspace.value;
|
334 |
+
img.vspace = f.vspace.value;
|
335 |
+
}
|
336 |
+
}
|
337 |
+
},
|
338 |
+
|
339 |
+
changeHeight : function() {
|
340 |
+
var f = document.forms[0], tp, t = this;
|
341 |
+
|
342 |
+
if (!f.constrain.checked || !t.preloadImg) {
|
343 |
+
return;
|
344 |
+
}
|
345 |
+
|
346 |
+
if (f.width.value == "" || f.height.value == "")
|
347 |
+
return;
|
348 |
+
|
349 |
+
tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;
|
350 |
+
f.height.value = tp.toFixed(0);
|
351 |
+
},
|
352 |
+
|
353 |
+
changeWidth : function() {
|
354 |
+
var f = document.forms[0], tp, t = this;
|
355 |
+
|
356 |
+
if (!f.constrain.checked || !t.preloadImg) {
|
357 |
+
return;
|
358 |
+
}
|
359 |
+
|
360 |
+
if (f.width.value == "" || f.height.value == "")
|
361 |
+
return;
|
362 |
+
|
363 |
+
tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;
|
364 |
+
f.width.value = tp.toFixed(0);
|
365 |
+
},
|
366 |
+
|
367 |
+
updateStyle : function(ty) {
|
368 |
+
var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
|
369 |
+
|
370 |
+
if (tinyMCEPopup.editor.settings.inline_styles) {
|
371 |
+
// Handle align
|
372 |
+
if (ty == 'align') {
|
373 |
+
dom.setStyle(img, 'float', '');
|
374 |
+
dom.setStyle(img, 'vertical-align', '');
|
375 |
+
|
376 |
+
v = getSelectValue(f, 'align');
|
377 |
+
if (v) {
|
378 |
+
if (v == 'left' || v == 'right')
|
379 |
+
dom.setStyle(img, 'float', v);
|
380 |
+
else
|
381 |
+
img.style.verticalAlign = v;
|
382 |
+
}
|
383 |
+
}
|
384 |
+
|
385 |
+
// Handle border
|
386 |
+
if (ty == 'border') {
|
387 |
+
b = img.style.border ? img.style.border.split(' ') : [];
|
388 |
+
bStyle = dom.getStyle(img, 'border-style');
|
389 |
+
bColor = dom.getStyle(img, 'border-color');
|
390 |
+
|
391 |
+
dom.setStyle(img, 'border', '');
|
392 |
+
|
393 |
+
v = f.border.value;
|
394 |
+
if (v || v == '0') {
|
395 |
+
if (v == '0')
|
396 |
+
img.style.border = isIE ? '0' : '0 none none';
|
397 |
+
else {
|
398 |
+
var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9);
|
399 |
+
|
400 |
+
if (b.length == 3 && b[isOldIE ? 2 : 1])
|
401 |
+
bStyle = b[isOldIE ? 2 : 1];
|
402 |
+
else if (!bStyle || bStyle == 'none')
|
403 |
+
bStyle = 'solid';
|
404 |
+
if (b.length == 3 && b[isIE ? 0 : 2])
|
405 |
+
bColor = b[isOldIE ? 0 : 2];
|
406 |
+
else if (!bColor || bColor == 'none')
|
407 |
+
bColor = 'black';
|
408 |
+
img.style.border = v + 'px ' + bStyle + ' ' + bColor;
|
409 |
+
}
|
410 |
+
}
|
411 |
+
}
|
412 |
+
|
413 |
+
// Handle hspace
|
414 |
+
if (ty == 'hspace') {
|
415 |
+
dom.setStyle(img, 'marginLeft', '');
|
416 |
+
dom.setStyle(img, 'marginRight', '');
|
417 |
+
|
418 |
+
v = f.hspace.value;
|
419 |
+
if (v) {
|
420 |
+
img.style.marginLeft = v + 'px';
|
421 |
+
img.style.marginRight = v + 'px';
|
422 |
+
}
|
423 |
+
}
|
424 |
+
|
425 |
+
// Handle vspace
|
426 |
+
if (ty == 'vspace') {
|
427 |
+
dom.setStyle(img, 'marginTop', '');
|
428 |
+
dom.setStyle(img, 'marginBottom', '');
|
429 |
+
|
430 |
+
v = f.vspace.value;
|
431 |
+
if (v) {
|
432 |
+
img.style.marginTop = v + 'px';
|
433 |
+
img.style.marginBottom = v + 'px';
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
// Merge
|
438 |
+
dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img');
|
439 |
+
}
|
440 |
+
},
|
441 |
+
|
442 |
+
changeMouseMove : function() {
|
443 |
+
},
|
444 |
+
|
445 |
+
showPreviewImage : function(u, st) {
|
446 |
+
if (!u) {
|
447 |
+
tinyMCEPopup.dom.setHTML('prev', '');
|
448 |
+
return;
|
449 |
+
}
|
450 |
+
|
451 |
+
if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
|
452 |
+
this.resetImageData();
|
453 |
+
|
454 |
+
u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
|
455 |
+
|
456 |
+
if (!st)
|
457 |
+
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
|
458 |
+
else
|
459 |
+
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
|
460 |
+
}
|
461 |
+
};
|
462 |
+
|
463 |
+
ImageDialog.preInit();
|
464 |
+
tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
|
js/libraries/tiny_mce/plugins/advlink/css/advlink.css
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
.mceLinkList, .mceAnchorList, #targetlist {width:280px;}
|
2 |
-
.mceActionPanel {margin-top:7px;}
|
3 |
-
.panel_wrapper div.current {height:320px;}
|
4 |
-
#classlist, #title, #href {width:280px;}
|
5 |
-
#popupurl, #popupname {width:200px;}
|
6 |
-
#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
|
7 |
-
#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
|
8 |
-
#events_panel input {width:200px;}
|
1 |
+
.mceLinkList, .mceAnchorList, #targetlist {width:280px;}
|
2 |
+
.mceActionPanel {margin-top:7px;}
|
3 |
+
.panel_wrapper div.current {height:320px;}
|
4 |
+
#classlist, #title, #href {width:280px;}
|
5 |
+
#popupurl, #popupname {width:200px;}
|
6 |
+
#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
|
7 |
+
#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
|
8 |
+
#events_panel input {width:200px;}
|
js/libraries/tiny_mce/plugins/advlink/editor_plugin_src.js
CHANGED
@@ -1,61 +1,61 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
this.editor = ed;
|
15 |
-
|
16 |
-
// Register commands
|
17 |
-
ed.addCommand('mceAdvLink', function() {
|
18 |
-
var se = ed.selection;
|
19 |
-
|
20 |
-
// No selection and not in link
|
21 |
-
if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
|
22 |
-
return;
|
23 |
-
|
24 |
-
ed.windowManager.open({
|
25 |
-
file : url + '/link.htm',
|
26 |
-
width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
|
27 |
-
height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
|
28 |
-
inline : 1
|
29 |
-
}, {
|
30 |
-
plugin_url : url
|
31 |
-
});
|
32 |
-
});
|
33 |
-
|
34 |
-
// Register buttons
|
35 |
-
ed.addButton('link', {
|
36 |
-
title : 'advlink.link_desc',
|
37 |
-
cmd : 'mceAdvLink'
|
38 |
-
});
|
39 |
-
|
40 |
-
ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
|
41 |
-
|
42 |
-
ed.onNodeChange.add(function(ed, cm, n, co) {
|
43 |
-
cm.setDisabled('link', co && n.nodeName != 'A');
|
44 |
-
cm.setActive('link', n.nodeName == 'A' && !n.name);
|
45 |
-
});
|
46 |
-
},
|
47 |
-
|
48 |
-
getInfo : function() {
|
49 |
-
return {
|
50 |
-
longname : 'Advanced link',
|
51 |
-
author : 'Moxiecode Systems AB',
|
52 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
53 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
|
54 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
55 |
-
};
|
56 |
-
}
|
57 |
-
});
|
58 |
-
|
59 |
-
// Register plugin
|
60 |
-
tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
|
61 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
this.editor = ed;
|
15 |
+
|
16 |
+
// Register commands
|
17 |
+
ed.addCommand('mceAdvLink', function() {
|
18 |
+
var se = ed.selection;
|
19 |
+
|
20 |
+
// No selection and not in link
|
21 |
+
if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
|
22 |
+
return;
|
23 |
+
|
24 |
+
ed.windowManager.open({
|
25 |
+
file : url + '/link.htm',
|
26 |
+
width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
|
27 |
+
height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
|
28 |
+
inline : 1
|
29 |
+
}, {
|
30 |
+
plugin_url : url
|
31 |
+
});
|
32 |
+
});
|
33 |
+
|
34 |
+
// Register buttons
|
35 |
+
ed.addButton('link', {
|
36 |
+
title : 'advlink.link_desc',
|
37 |
+
cmd : 'mceAdvLink'
|
38 |
+
});
|
39 |
+
|
40 |
+
ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
|
41 |
+
|
42 |
+
ed.onNodeChange.add(function(ed, cm, n, co) {
|
43 |
+
cm.setDisabled('link', co && n.nodeName != 'A');
|
44 |
+
cm.setActive('link', n.nodeName == 'A' && !n.name);
|
45 |
+
});
|
46 |
+
},
|
47 |
+
|
48 |
+
getInfo : function() {
|
49 |
+
return {
|
50 |
+
longname : 'Advanced link',
|
51 |
+
author : 'Moxiecode Systems AB',
|
52 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
53 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
|
54 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
55 |
+
};
|
56 |
+
}
|
57 |
+
});
|
58 |
+
|
59 |
+
// Register plugin
|
60 |
+
tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
|
61 |
})();
|
js/libraries/tiny_mce/plugins/advlink/js/advlink.js
CHANGED
@@ -1,543 +1,543 @@
|
|
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('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
|
34 |
-
|
35 |
-
// Link list
|
36 |
-
html = getLinkListHTML('linklisthref','href');
|
37 |
-
if (html == "")
|
38 |
-
document.getElementById("linklisthrefrow").style.display = 'none';
|
39 |
-
else
|
40 |
-
document.getElementById("linklisthrefcontainer").innerHTML = html;
|
41 |
-
|
42 |
-
// Anchor list
|
43 |
-
html = getAnchorListHTML('anchorlist','href');
|
44 |
-
if (html == "")
|
45 |
-
document.getElementById("anchorlistrow").style.display = 'none';
|
46 |
-
else
|
47 |
-
document.getElementById("anchorlistcontainer").innerHTML = html;
|
48 |
-
|
49 |
-
// Resize some elements
|
50 |
-
if (isVisible('hrefbrowser'))
|
51 |
-
document.getElementById('href').style.width = '260px';
|
52 |
-
|
53 |
-
if (isVisible('popupurlbrowser'))
|
54 |
-
document.getElementById('popupurl').style.width = '180px';
|
55 |
-
|
56 |
-
elm = inst.dom.getParent(elm, "A");
|
57 |
-
if (elm == null) {
|
58 |
-
var prospect = inst.dom.create("p", null, inst.selection.getContent());
|
59 |
-
if (prospect.childNodes.length === 1) {
|
60 |
-
elm = prospect.firstChild;
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
if (elm != null && elm.nodeName == "A")
|
65 |
-
action = "update";
|
66 |
-
|
67 |
-
formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
|
68 |
-
|
69 |
-
setPopupControlsDisabled(true);
|
70 |
-
|
71 |
-
if (action == "update") {
|
72 |
-
var href = inst.dom.getAttrib(elm, 'href');
|
73 |
-
var onclick = inst.dom.getAttrib(elm, 'onclick');
|
74 |
-
var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self";
|
75 |
-
|
76 |
-
// Setup form data
|
77 |
-
setFormValue('href', href);
|
78 |
-
setFormValue('title', inst.dom.getAttrib(elm, 'title'));
|
79 |
-
setFormValue('id', inst.dom.getAttrib(elm, 'id'));
|
80 |
-
setFormValue('style', inst.dom.getAttrib(elm, "style"));
|
81 |
-
setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));
|
82 |
-
setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));
|
83 |
-
setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));
|
84 |
-
setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));
|
85 |
-
setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));
|
86 |
-
setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));
|
87 |
-
setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
|
88 |
-
setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
|
89 |
-
setFormValue('type', inst.dom.getAttrib(elm, 'type'));
|
90 |
-
setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));
|
91 |
-
setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));
|
92 |
-
setFormValue('onclick', onclick);
|
93 |
-
setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));
|
94 |
-
setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));
|
95 |
-
setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));
|
96 |
-
setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));
|
97 |
-
setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));
|
98 |
-
setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));
|
99 |
-
setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
|
100 |
-
setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
|
101 |
-
setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
|
102 |
-
setFormValue('target', linkTarget);
|
103 |
-
setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
|
104 |
-
|
105 |
-
// Parse onclick data
|
106 |
-
if (onclick != null && onclick.indexOf('window.open') != -1)
|
107 |
-
parseWindowOpen(onclick);
|
108 |
-
else
|
109 |
-
parseFunction(onclick);
|
110 |
-
|
111 |
-
// Select by the values
|
112 |
-
selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));
|
113 |
-
selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));
|
114 |
-
selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));
|
115 |
-
selectByValue(formObj, 'linklisthref', href);
|
116 |
-
|
117 |
-
if (href.charAt(0) == '#')
|
118 |
-
selectByValue(formObj, 'anchorlist', href);
|
119 |
-
|
120 |
-
addClassesToList('classlist', 'advlink_styles');
|
121 |
-
|
122 |
-
selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
|
123 |
-
selectByValue(formObj, 'targetlist', linkTarget, true);
|
124 |
-
} else
|
125 |
-
addClassesToList('classlist', 'advlink_styles');
|
126 |
-
}
|
127 |
-
|
128 |
-
function checkPrefix(n) {
|
129 |
-
if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
|
130 |
-
n.value = 'mailto:' + n.value;
|
131 |
-
|
132 |
-
if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
|
133 |
-
n.value = 'http://' + n.value;
|
134 |
-
}
|
135 |
-
|
136 |
-
function setFormValue(name, value) {
|
137 |
-
document.forms[0].elements[name].value = value;
|
138 |
-
}
|
139 |
-
|
140 |
-
function parseWindowOpen(onclick) {
|
141 |
-
var formObj = document.forms[0];
|
142 |
-
|
143 |
-
// Preprocess center code
|
144 |
-
if (onclick.indexOf('return false;') != -1) {
|
145 |
-
formObj.popupreturn.checked = true;
|
146 |
-
onclick = onclick.replace('return false;', '');
|
147 |
-
} else
|
148 |
-
formObj.popupreturn.checked = false;
|
149 |
-
|
150 |
-
var onClickData = parseLink(onclick);
|
151 |
-
|
152 |
-
if (onClickData != null) {
|
153 |
-
formObj.ispopup.checked = true;
|
154 |
-
setPopupControlsDisabled(false);
|
155 |
-
|
156 |
-
var onClickWindowOptions = parseOptions(onClickData['options']);
|
157 |
-
var url = onClickData['url'];
|
158 |
-
|
159 |
-
formObj.popupname.value = onClickData['target'];
|
160 |
-
formObj.popupurl.value = url;
|
161 |
-
formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
|
162 |
-
formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
|
163 |
-
|
164 |
-
formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
|
165 |
-
formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
|
166 |
-
|
167 |
-
if (formObj.popupleft.value.indexOf('screen') != -1)
|
168 |
-
formObj.popupleft.value = "c";
|
169 |
-
|
170 |
-
if (formObj.popuptop.value.indexOf('screen') != -1)
|
171 |
-
formObj.popuptop.value = "c";
|
172 |
-
|
173 |
-
formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
|
174 |
-
formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
|
175 |
-
formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
|
176 |
-
formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
|
177 |
-
formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
|
178 |
-
formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
|
179 |
-
formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
|
180 |
-
|
181 |
-
buildOnClick();
|
182 |
-
}
|
183 |
-
}
|
184 |
-
|
185 |
-
function parseFunction(onclick) {
|
186 |
-
var formObj = document.forms[0];
|
187 |
-
var onClickData = parseLink(onclick);
|
188 |
-
|
189 |
-
// TODO: Add stuff here
|
190 |
-
}
|
191 |
-
|
192 |
-
function getOption(opts, name) {
|
193 |
-
return typeof(opts[name]) == "undefined" ? "" : opts[name];
|
194 |
-
}
|
195 |
-
|
196 |
-
function setPopupControlsDisabled(state) {
|
197 |
-
var formObj = document.forms[0];
|
198 |
-
|
199 |
-
formObj.popupname.disabled = state;
|
200 |
-
formObj.popupurl.disabled = state;
|
201 |
-
formObj.popupwidth.disabled = state;
|
202 |
-
formObj.popupheight.disabled = state;
|
203 |
-
formObj.popupleft.disabled = state;
|
204 |
-
formObj.popuptop.disabled = state;
|
205 |
-
formObj.popuplocation.disabled = state;
|
206 |
-
formObj.popupscrollbars.disabled = state;
|
207 |
-
formObj.popupmenubar.disabled = state;
|
208 |
-
formObj.popupresizable.disabled = state;
|
209 |
-
formObj.popuptoolbar.disabled = state;
|
210 |
-
formObj.popupstatus.disabled = state;
|
211 |
-
formObj.popupreturn.disabled = state;
|
212 |
-
formObj.popupdependent.disabled = state;
|
213 |
-
|
214 |
-
setBrowserDisabled('popupurlbrowser', state);
|
215 |
-
}
|
216 |
-
|
217 |
-
function parseLink(link) {
|
218 |
-
link = link.replace(new RegExp(''', 'g'), "'");
|
219 |
-
|
220 |
-
var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
|
221 |
-
|
222 |
-
// Is function name a template function
|
223 |
-
var template = templates[fnName];
|
224 |
-
if (template) {
|
225 |
-
// Build regexp
|
226 |
-
var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
|
227 |
-
var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
|
228 |
-
var replaceStr = "";
|
229 |
-
for (var i=0; i<variableNames.length; i++) {
|
230 |
-
// Is string value
|
231 |
-
if (variableNames[i].indexOf("'${") != -1)
|
232 |
-
regExp += "'(.*)'";
|
233 |
-
else // Number value
|
234 |
-
regExp += "([0-9]*)";
|
235 |
-
|
236 |
-
replaceStr += "$" + (i+1);
|
237 |
-
|
238 |
-
// Cleanup variable name
|
239 |
-
variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
|
240 |
-
|
241 |
-
if (i != variableNames.length-1) {
|
242 |
-
regExp += "\\s*,\\s*";
|
243 |
-
replaceStr += "<delim>";
|
244 |
-
} else
|
245 |
-
regExp += ".*";
|
246 |
-
}
|
247 |
-
|
248 |
-
regExp += "\\);?";
|
249 |
-
|
250 |
-
// Build variable array
|
251 |
-
var variables = [];
|
252 |
-
variables["_function"] = fnName;
|
253 |
-
var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
|
254 |
-
for (var i=0; i<variableNames.length; i++)
|
255 |
-
variables[variableNames[i]] = variableValues[i];
|
256 |
-
|
257 |
-
return variables;
|
258 |
-
}
|
259 |
-
|
260 |
-
return null;
|
261 |
-
}
|
262 |
-
|
263 |
-
function parseOptions(opts) {
|
264 |
-
if (opts == null || opts == "")
|
265 |
-
return [];
|
266 |
-
|
267 |
-
// Cleanup the options
|
268 |
-
opts = opts.toLowerCase();
|
269 |
-
opts = opts.replace(/;/g, ",");
|
270 |
-
opts = opts.replace(/[^0-9a-z=,]/g, "");
|
271 |
-
|
272 |
-
var optionChunks = opts.split(',');
|
273 |
-
var options = [];
|
274 |
-
|
275 |
-
for (var i=0; i<optionChunks.length; i++) {
|
276 |
-
var parts = optionChunks[i].split('=');
|
277 |
-
|
278 |
-
if (parts.length == 2)
|
279 |
-
options[parts[0]] = parts[1];
|
280 |
-
}
|
281 |
-
|
282 |
-
return options;
|
283 |
-
}
|
284 |
-
|
285 |
-
function buildOnClick() {
|
286 |
-
var formObj = document.forms[0];
|
287 |
-
|
288 |
-
if (!formObj.ispopup.checked) {
|
289 |
-
formObj.onclick.value = "";
|
290 |
-
return;
|
291 |
-
}
|
292 |
-
|
293 |
-
var onclick = "window.open('";
|
294 |
-
var url = formObj.popupurl.value;
|
295 |
-
|
296 |
-
onclick += url + "','";
|
297 |
-
onclick += formObj.popupname.value + "','";
|
298 |
-
|
299 |
-
if (formObj.popuplocation.checked)
|
300 |
-
onclick += "location=yes,";
|
301 |
-
|
302 |
-
if (formObj.popupscrollbars.checked)
|
303 |
-
onclick += "scrollbars=yes,";
|
304 |
-
|
305 |
-
if (formObj.popupmenubar.checked)
|
306 |
-
onclick += "menubar=yes,";
|
307 |
-
|
308 |
-
if (formObj.popupresizable.checked)
|
309 |
-
onclick += "resizable=yes,";
|
310 |
-
|
311 |
-
if (formObj.popuptoolbar.checked)
|
312 |
-
onclick += "toolbar=yes,";
|
313 |
-
|
314 |
-
if (formObj.popupstatus.checked)
|
315 |
-
onclick += "status=yes,";
|
316 |
-
|
317 |
-
if (formObj.popupdependent.checked)
|
318 |
-
onclick += "dependent=yes,";
|
319 |
-
|
320 |
-
if (formObj.popupwidth.value != "")
|
321 |
-
onclick += "width=" + formObj.popupwidth.value + ",";
|
322 |
-
|
323 |
-
if (formObj.popupheight.value != "")
|
324 |
-
onclick += "height=" + formObj.popupheight.value + ",";
|
325 |
-
|
326 |
-
if (formObj.popupleft.value != "") {
|
327 |
-
if (formObj.popupleft.value != "c")
|
328 |
-
onclick += "left=" + formObj.popupleft.value + ",";
|
329 |
-
else
|
330 |
-
onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
|
331 |
-
}
|
332 |
-
|
333 |
-
if (formObj.popuptop.value != "") {
|
334 |
-
if (formObj.popuptop.value != "c")
|
335 |
-
onclick += "top=" + formObj.popuptop.value + ",";
|
336 |
-
else
|
337 |
-
onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
|
338 |
-
}
|
339 |
-
|
340 |
-
if (onclick.charAt(onclick.length-1) == ',')
|
341 |
-
onclick = onclick.substring(0, onclick.length-1);
|
342 |
-
|
343 |
-
onclick += "');";
|
344 |
-
|
345 |
-
if (formObj.popupreturn.checked)
|
346 |
-
onclick += "return false;";
|
347 |
-
|
348 |
-
// tinyMCE.debug(onclick);
|
349 |
-
|
350 |
-
formObj.onclick.value = onclick;
|
351 |
-
|
352 |
-
if (formObj.href.value == "")
|
353 |
-
formObj.href.value = url;
|
354 |
-
}
|
355 |
-
|
356 |
-
function setAttrib(elm, attrib, value) {
|
357 |
-
var formObj = document.forms[0];
|
358 |
-
var valueElm = formObj.elements[attrib.toLowerCase()];
|
359 |
-
var dom = tinyMCEPopup.editor.dom;
|
360 |
-
|
361 |
-
if (typeof(value) == "undefined" || value == null) {
|
362 |
-
value = "";
|
363 |
-
|
364 |
-
if (valueElm)
|
365 |
-
value = valueElm.value;
|
366 |
-
}
|
367 |
-
|
368 |
-
// Clean up the style
|
369 |
-
if (attrib == 'style')
|
370 |
-
value = dom.serializeStyle(dom.parseStyle(value), 'a');
|
371 |
-
|
372 |
-
dom.setAttrib(elm, attrib, value);
|
373 |
-
}
|
374 |
-
|
375 |
-
function getAnchorListHTML(id, target) {
|
376 |
-
var ed = tinyMCEPopup.editor, nodes = ed.dom.select('a'), name, i, len, html = "";
|
377 |
-
|
378 |
-
for (i=0, len=nodes.length; i<len; i++) {
|
379 |
-
if ((name = ed.dom.getAttrib(nodes[i], "name")) != "")
|
380 |
-
html += '<option value="#' + name + '">' + name + '</option>';
|
381 |
-
|
382 |
-
if ((name = nodes[i].id) != "" && !nodes[i].href)
|
383 |
-
html += '<option value="#' + name + '">' + name + '</option>';
|
384 |
-
}
|
385 |
-
|
386 |
-
if (html == "")
|
387 |
-
return "";
|
388 |
-
|
389 |
-
html = '<select id="' + id + '" name="' + id + '" class="mceAnchorList"'
|
390 |
-
+ ' onchange="this.form.' + target + '.value=this.options[this.selectedIndex].value"'
|
391 |
-
+ '>'
|
392 |
-
+ '<option value="">---</option>'
|
393 |
-
+ html
|
394 |
-
+ '</select>';
|
395 |
-
|
396 |
-
return html;
|
397 |
-
}
|
398 |
-
|
399 |
-
function insertAction() {
|
400 |
-
var inst = tinyMCEPopup.editor;
|
401 |
-
var elm, elementArray, i;
|
402 |
-
|
403 |
-
elm = inst.selection.getNode();
|
404 |
-
checkPrefix(document.forms[0].href);
|
405 |
-
|
406 |
-
elm = inst.dom.getParent(elm, "A");
|
407 |
-
|
408 |
-
// Remove element if there is no href
|
409 |
-
if (!document.forms[0].href.value) {
|
410 |
-
i = inst.selection.getBookmark();
|
411 |
-
inst.dom.remove(elm, 1);
|
412 |
-
inst.selection.moveToBookmark(i);
|
413 |
-
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
414 |
-
tinyMCEPopup.close();
|
415 |
-
return;
|
416 |
-
}
|
417 |
-
|
418 |
-
// Create new anchor elements
|
419 |
-
if (elm == null) {
|
420 |
-
inst.getDoc().execCommand("unlink", false, null);
|
421 |
-
tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});
|
422 |
-
|
423 |
-
elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
|
424 |
-
for (i=0; i<elementArray.length; i++)
|
425 |
-
setAllAttribs(elm = elementArray[i]);
|
426 |
-
} else
|
427 |
-
setAllAttribs(elm);
|
428 |
-
|
429 |
-
// Don't move caret if selection was image
|
430 |
-
if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {
|
431 |
-
inst.focus();
|
432 |
-
inst.selection.select(elm);
|
433 |
-
inst.selection.collapse(0);
|
434 |
-
tinyMCEPopup.storeSelection();
|
435 |
-
}
|
436 |
-
|
437 |
-
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
438 |
-
tinyMCEPopup.close();
|
439 |
-
}
|
440 |
-
|
441 |
-
function setAllAttribs(elm) {
|
442 |
-
var formObj = document.forms[0];
|
443 |
-
var href = formObj.href.value.replace(/ /g, '%20');
|
444 |
-
var target = getSelectValue(formObj, 'targetlist');
|
445 |
-
|
446 |
-
setAttrib(elm, 'href', href);
|
447 |
-
setAttrib(elm, 'title');
|
448 |
-
setAttrib(elm, 'target', target == '_self' ? '' : target);
|
449 |
-
setAttrib(elm, 'id');
|
450 |
-
setAttrib(elm, 'style');
|
451 |
-
setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
|
452 |
-
setAttrib(elm, 'rel');
|
453 |
-
setAttrib(elm, 'rev');
|
454 |
-
setAttrib(elm, 'charset');
|
455 |
-
setAttrib(elm, 'hreflang');
|
456 |
-
setAttrib(elm, 'dir');
|
457 |
-
setAttrib(elm, 'lang');
|
458 |
-
setAttrib(elm, 'tabindex');
|
459 |
-
setAttrib(elm, 'accesskey');
|
460 |
-
setAttrib(elm, 'type');
|
461 |
-
setAttrib(elm, 'onfocus');
|
462 |
-
setAttrib(elm, 'onblur');
|
463 |
-
setAttrib(elm, 'onclick');
|
464 |
-
setAttrib(elm, 'ondblclick');
|
465 |
-
setAttrib(elm, 'onmousedown');
|
466 |
-
setAttrib(elm, 'onmouseup');
|
467 |
-
setAttrib(elm, 'onmouseover');
|
468 |
-
setAttrib(elm, 'onmousemove');
|
469 |
-
setAttrib(elm, 'onmouseout');
|
470 |
-
setAttrib(elm, 'onkeypress');
|
471 |
-
setAttrib(elm, 'onkeydown');
|
472 |
-
setAttrib(elm, 'onkeyup');
|
473 |
-
|
474 |
-
// Refresh in old MSIE
|
475 |
-
if (tinyMCE.isMSIE5)
|
476 |
-
elm.outerHTML = elm.outerHTML;
|
477 |
-
}
|
478 |
-
|
479 |
-
function getSelectValue(form_obj, field_name) {
|
480 |
-
var elm = form_obj.elements[field_name];
|
481 |
-
|
482 |
-
if (!elm || elm.options == null || elm.selectedIndex == -1)
|
483 |
-
return "";
|
484 |
-
|
485 |
-
return elm.options[elm.selectedIndex].value;
|
486 |
-
}
|
487 |
-
|
488 |
-
function getLinkListHTML(elm_id, target_form_element, onchange_func) {
|
489 |
-
if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
|
490 |
-
return "";
|
491 |
-
|
492 |
-
var html = "";
|
493 |
-
|
494 |
-
html += '<select id="' + elm_id + '" name="' + elm_id + '"';
|
495 |
-
html += ' class="mceLinkList" onchange="this.form.' + target_form_element + '.value=';
|
496 |
-
html += 'this.options[this.selectedIndex].value;';
|
497 |
-
|
498 |
-
if (typeof(onchange_func) != "undefined")
|
499 |
-
html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
|
500 |
-
|
501 |
-
html += '"><option value="">---</option>';
|
502 |
-
|
503 |
-
for (var i=0; i<tinyMCELinkList.length; i++)
|
504 |
-
html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
|
505 |
-
|
506 |
-
html += '</select>';
|
507 |
-
|
508 |
-
return html;
|
509 |
-
|
510 |
-
// tinyMCE.debug('-- image list start --', html, '-- image list end --');
|
511 |
-
}
|
512 |
-
|
513 |
-
function getTargetListHTML(elm_id, target_form_element) {
|
514 |
-
var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
|
515 |
-
var html = '';
|
516 |
-
|
517 |
-
html += '<select id="' + elm_id + '" name="' + elm_id + '" onchange="this.form.' + target_form_element + '.value=';
|
518 |
-
html += 'this.options[this.selectedIndex].value;">';
|
519 |
-
html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';
|
520 |
-
html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';
|
521 |
-
html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';
|
522 |
-
html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';
|
523 |
-
|
524 |
-
for (var i=0; i<targets.length; i++) {
|
525 |
-
var key, value;
|
526 |
-
|
527 |
-
if (targets[i] == "")
|
528 |
-
continue;
|
529 |
-
|
530 |
-
key = targets[i].split('=')[0];
|
531 |
-
value = targets[i].split('=')[1];
|
532 |
-
|
533 |
-
html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
|
534 |
-
}
|
535 |
-
|
536 |
-
html += '</select>';
|
537 |
-
|
538 |
-
return html;
|
539 |
-
}
|
540 |
-
|
541 |
-
// While loading
|
542 |
-
preinit();
|
543 |
-
tinyMCEPopup.onInit.add(init);
|
1 |
+
/* Functions for the advlink plugin popup */
|
2 |
+
|
3 |
+
tinyMCEPopup.requireLangPack();
|
4 |
+
|
5 |
+
var templates = {
|
6 |
+
"window.open" : "window.open('${url}','${target}','${options}')"
|
7 |
+
};
|
8 |
+
|
9 |
+
function preinit() {
|
10 |
+
var url;
|
11 |
+
|
12 |
+
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
13 |
+
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
14 |
+
}
|
15 |
+
|
16 |
+
function changeClass() {
|
17 |
+
var f = document.forms[0];
|
18 |
+
|
19 |
+
f.classes.value = getSelectValue(f, 'classlist');
|
20 |
+
}
|
21 |
+
|
22 |
+
function init() {
|
23 |
+
tinyMCEPopup.resizeToInnerSize();
|
24 |
+
|
25 |
+
var formObj = document.forms[0];
|
26 |
+
var inst = tinyMCEPopup.editor;
|
27 |
+
var elm = inst.selection.getNode();
|
28 |
+
var action = "insert";
|
29 |
+
var html;
|
30 |
+
|
31 |
+
document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
|
32 |
+
document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
|
33 |
+
document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
|
34 |
+
|
35 |
+
// Link list
|
36 |
+
html = getLinkListHTML('linklisthref','href');
|
37 |
+
if (html == "")
|
38 |
+
document.getElementById("linklisthrefrow").style.display = 'none';
|
39 |
+
else
|
40 |
+
document.getElementById("linklisthrefcontainer").innerHTML = html;
|
41 |
+
|
42 |
+
// Anchor list
|
43 |
+
html = getAnchorListHTML('anchorlist','href');
|
44 |
+
if (html == "")
|
45 |
+
document.getElementById("anchorlistrow").style.display = 'none';
|
46 |
+
else
|
47 |
+
document.getElementById("anchorlistcontainer").innerHTML = html;
|
48 |
+
|
49 |
+
// Resize some elements
|
50 |
+
if (isVisible('hrefbrowser'))
|
51 |
+
document.getElementById('href').style.width = '260px';
|
52 |
+
|
53 |
+
if (isVisible('popupurlbrowser'))
|
54 |
+
document.getElementById('popupurl').style.width = '180px';
|
55 |
+
|
56 |
+
elm = inst.dom.getParent(elm, "A");
|
57 |
+
if (elm == null) {
|
58 |
+
var prospect = inst.dom.create("p", null, inst.selection.getContent());
|
59 |
+
if (prospect.childNodes.length === 1) {
|
60 |
+
elm = prospect.firstChild;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
if (elm != null && elm.nodeName == "A")
|
65 |
+
action = "update";
|
66 |
+
|
67 |
+
formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
|
68 |
+
|
69 |
+
setPopupControlsDisabled(true);
|
70 |
+
|
71 |
+
if (action == "update") {
|
72 |
+
var href = inst.dom.getAttrib(elm, 'href');
|
73 |
+
var onclick = inst.dom.getAttrib(elm, 'onclick');
|
74 |
+
var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self";
|
75 |
+
|
76 |
+
// Setup form data
|
77 |
+
setFormValue('href', href);
|
78 |
+
setFormValue('title', inst.dom.getAttrib(elm, 'title'));
|
79 |
+
setFormValue('id', inst.dom.getAttrib(elm, 'id'));
|
80 |
+
setFormValue('style', inst.dom.getAttrib(elm, "style"));
|
81 |
+
setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));
|
82 |
+
setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));
|
83 |
+
setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));
|
84 |
+
setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));
|
85 |
+
setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));
|
86 |
+
setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));
|
87 |
+
setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
|
88 |
+
setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
|
89 |
+
setFormValue('type', inst.dom.getAttrib(elm, 'type'));
|
90 |
+
setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));
|
91 |
+
setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));
|
92 |
+
setFormValue('onclick', onclick);
|
93 |
+
setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));
|
94 |
+
setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));
|
95 |
+
setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));
|
96 |
+
setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));
|
97 |
+
setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));
|
98 |
+
setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));
|
99 |
+
setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
|
100 |
+
setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
|
101 |
+
setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
|
102 |
+
setFormValue('target', linkTarget);
|
103 |
+
setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
|
104 |
+
|
105 |
+
// Parse onclick data
|
106 |
+
if (onclick != null && onclick.indexOf('window.open') != -1)
|
107 |
+
parseWindowOpen(onclick);
|
108 |
+
else
|
109 |
+
parseFunction(onclick);
|
110 |
+
|
111 |
+
// Select by the values
|
112 |
+
selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));
|
113 |
+
selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));
|
114 |
+
selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));
|
115 |
+
selectByValue(formObj, 'linklisthref', href);
|
116 |
+
|
117 |
+
if (href.charAt(0) == '#')
|
118 |
+
selectByValue(formObj, 'anchorlist', href);
|
119 |
+
|
120 |
+
addClassesToList('classlist', 'advlink_styles');
|
121 |
+
|
122 |
+
selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
|
123 |
+
selectByValue(formObj, 'targetlist', linkTarget, true);
|
124 |
+
} else
|
125 |
+
addClassesToList('classlist', 'advlink_styles');
|
126 |
+
}
|
127 |
+
|
128 |
+
function checkPrefix(n) {
|
129 |
+
if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
|
130 |
+
n.value = 'mailto:' + n.value;
|
131 |
+
|
132 |
+
if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
|
133 |
+
n.value = 'http://' + n.value;
|
134 |
+
}
|
135 |
+
|
136 |
+
function setFormValue(name, value) {
|
137 |
+
document.forms[0].elements[name].value = value;
|
138 |
+
}
|
139 |
+
|
140 |
+
function parseWindowOpen(onclick) {
|
141 |
+
var formObj = document.forms[0];
|
142 |
+
|
143 |
+
// Preprocess center code
|
144 |
+
if (onclick.indexOf('return false;') != -1) {
|
145 |
+
formObj.popupreturn.checked = true;
|
146 |
+
onclick = onclick.replace('return false;', '');
|
147 |
+
} else
|
148 |
+
formObj.popupreturn.checked = false;
|
149 |
+
|
150 |
+
var onClickData = parseLink(onclick);
|
151 |
+
|
152 |
+
if (onClickData != null) {
|
153 |
+
formObj.ispopup.checked = true;
|
154 |
+
setPopupControlsDisabled(false);
|
155 |
+
|
156 |
+
var onClickWindowOptions = parseOptions(onClickData['options']);
|
157 |
+
var url = onClickData['url'];
|
158 |
+
|
159 |
+
formObj.popupname.value = onClickData['target'];
|
160 |
+
formObj.popupurl.value = url;
|
161 |
+
formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
|
162 |
+
formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
|
163 |
+
|
164 |
+
formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
|
165 |
+
formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
|
166 |
+
|
167 |
+
if (formObj.popupleft.value.indexOf('screen') != -1)
|
168 |
+
formObj.popupleft.value = "c";
|
169 |
+
|
170 |
+
if (formObj.popuptop.value.indexOf('screen') != -1)
|
171 |
+
formObj.popuptop.value = "c";
|
172 |
+
|
173 |
+
formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
|
174 |
+
formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
|
175 |
+
formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
|
176 |
+
formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
|
177 |
+
formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
|
178 |
+
formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
|
179 |
+
formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
|
180 |
+
|
181 |
+
buildOnClick();
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
function parseFunction(onclick) {
|
186 |
+
var formObj = document.forms[0];
|
187 |
+
var onClickData = parseLink(onclick);
|
188 |
+
|
189 |
+
// TODO: Add stuff here
|
190 |
+
}
|
191 |
+
|
192 |
+
function getOption(opts, name) {
|
193 |
+
return typeof(opts[name]) == "undefined" ? "" : opts[name];
|
194 |
+
}
|
195 |
+
|
196 |
+
function setPopupControlsDisabled(state) {
|
197 |
+
var formObj = document.forms[0];
|
198 |
+
|
199 |
+
formObj.popupname.disabled = state;
|
200 |
+
formObj.popupurl.disabled = state;
|
201 |
+
formObj.popupwidth.disabled = state;
|
202 |
+
formObj.popupheight.disabled = state;
|
203 |
+
formObj.popupleft.disabled = state;
|
204 |
+
formObj.popuptop.disabled = state;
|
205 |
+
formObj.popuplocation.disabled = state;
|
206 |
+
formObj.popupscrollbars.disabled = state;
|
207 |
+
formObj.popupmenubar.disabled = state;
|
208 |
+
formObj.popupresizable.disabled = state;
|
209 |
+
formObj.popuptoolbar.disabled = state;
|
210 |
+
formObj.popupstatus.disabled = state;
|
211 |
+
formObj.popupreturn.disabled = state;
|
212 |
+
formObj.popupdependent.disabled = state;
|
213 |
+
|
214 |
+
setBrowserDisabled('popupurlbrowser', state);
|
215 |
+
}
|
216 |
+
|
217 |
+
function parseLink(link) {
|
218 |
+
link = link.replace(new RegExp(''', 'g'), "'");
|
219 |
+
|
220 |
+
var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
|
221 |
+
|
222 |
+
// Is function name a template function
|
223 |
+
var template = templates[fnName];
|
224 |
+
if (template) {
|
225 |
+
// Build regexp
|
226 |
+
var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
|
227 |
+
var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
|
228 |
+
var replaceStr = "";
|
229 |
+
for (var i=0; i<variableNames.length; i++) {
|
230 |
+
// Is string value
|
231 |
+
if (variableNames[i].indexOf("'${") != -1)
|
232 |
+
regExp += "'(.*)'";
|
233 |
+
else // Number value
|
234 |
+
regExp += "([0-9]*)";
|
235 |
+
|
236 |
+
replaceStr += "$" + (i+1);
|
237 |
+
|
238 |
+
// Cleanup variable name
|
239 |
+
variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
|
240 |
+
|
241 |
+
if (i != variableNames.length-1) {
|
242 |
+
regExp += "\\s*,\\s*";
|
243 |
+
replaceStr += "<delim>";
|
244 |
+
} else
|
245 |
+
regExp += ".*";
|
246 |
+
}
|
247 |
+
|
248 |
+
regExp += "\\);?";
|
249 |
+
|
250 |
+
// Build variable array
|
251 |
+
var variables = [];
|
252 |
+
variables["_function"] = fnName;
|
253 |
+
var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
|
254 |
+
for (var i=0; i<variableNames.length; i++)
|
255 |
+
variables[variableNames[i]] = variableValues[i];
|
256 |
+
|
257 |
+
return variables;
|
258 |
+
}
|
259 |
+
|
260 |
+
return null;
|
261 |
+
}
|
262 |
+
|
263 |
+
function parseOptions(opts) {
|
264 |
+
if (opts == null || opts == "")
|
265 |
+
return [];
|
266 |
+
|
267 |
+
// Cleanup the options
|
268 |
+
opts = opts.toLowerCase();
|
269 |
+
opts = opts.replace(/;/g, ",");
|
270 |
+
opts = opts.replace(/[^0-9a-z=,]/g, "");
|
271 |
+
|
272 |
+
var optionChunks = opts.split(',');
|
273 |
+
var options = [];
|
274 |
+
|
275 |
+
for (var i=0; i<optionChunks.length; i++) {
|
276 |
+
var parts = optionChunks[i].split('=');
|
277 |
+
|
278 |
+
if (parts.length == 2)
|
279 |
+
options[parts[0]] = parts[1];
|
280 |
+
}
|
281 |
+
|
282 |
+
return options;
|
283 |
+
}
|
284 |
+
|
285 |
+
function buildOnClick() {
|
286 |
+
var formObj = document.forms[0];
|
287 |
+
|
288 |
+
if (!formObj.ispopup.checked) {
|
289 |
+
formObj.onclick.value = "";
|
290 |
+
return;
|
291 |
+
}
|
292 |
+
|
293 |
+
var onclick = "window.open('";
|
294 |
+
var url = formObj.popupurl.value;
|
295 |
+
|
296 |
+
onclick += url + "','";
|
297 |
+
onclick += formObj.popupname.value + "','";
|
298 |
+
|
299 |
+
if (formObj.popuplocation.checked)
|
300 |
+
onclick += "location=yes,";
|
301 |
+
|
302 |
+
if (formObj.popupscrollbars.checked)
|
303 |
+
onclick += "scrollbars=yes,";
|
304 |
+
|
305 |
+
if (formObj.popupmenubar.checked)
|
306 |
+
onclick += "menubar=yes,";
|
307 |
+
|
308 |
+
if (formObj.popupresizable.checked)
|
309 |
+
onclick += "resizable=yes,";
|
310 |
+
|
311 |
+
if (formObj.popuptoolbar.checked)
|
312 |
+
onclick += "toolbar=yes,";
|
313 |
+
|
314 |
+
if (formObj.popupstatus.checked)
|
315 |
+
onclick += "status=yes,";
|
316 |
+
|
317 |
+
if (formObj.popupdependent.checked)
|
318 |
+
onclick += "dependent=yes,";
|
319 |
+
|
320 |
+
if (formObj.popupwidth.value != "")
|
321 |
+
onclick += "width=" + formObj.popupwidth.value + ",";
|
322 |
+
|
323 |
+
if (formObj.popupheight.value != "")
|
324 |
+
onclick += "height=" + formObj.popupheight.value + ",";
|
325 |
+
|
326 |
+
if (formObj.popupleft.value != "") {
|
327 |
+
if (formObj.popupleft.value != "c")
|
328 |
+
onclick += "left=" + formObj.popupleft.value + ",";
|
329 |
+
else
|
330 |
+
onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
|
331 |
+
}
|
332 |
+
|
333 |
+
if (formObj.popuptop.value != "") {
|
334 |
+
if (formObj.popuptop.value != "c")
|
335 |
+
onclick += "top=" + formObj.popuptop.value + ",";
|
336 |
+
else
|
337 |
+
onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
|
338 |
+
}
|
339 |
+
|
340 |
+
if (onclick.charAt(onclick.length-1) == ',')
|
341 |
+
onclick = onclick.substring(0, onclick.length-1);
|
342 |
+
|
343 |
+
onclick += "');";
|
344 |
+
|
345 |
+
if (formObj.popupreturn.checked)
|
346 |
+
onclick += "return false;";
|
347 |
+
|
348 |
+
// tinyMCE.debug(onclick);
|
349 |
+
|
350 |
+
formObj.onclick.value = onclick;
|
351 |
+
|
352 |
+
if (formObj.href.value == "")
|
353 |
+
formObj.href.value = url;
|
354 |
+
}
|
355 |
+
|
356 |
+
function setAttrib(elm, attrib, value) {
|
357 |
+
var formObj = document.forms[0];
|
358 |
+
var valueElm = formObj.elements[attrib.toLowerCase()];
|
359 |
+
var dom = tinyMCEPopup.editor.dom;
|
360 |
+
|
361 |
+
if (typeof(value) == "undefined" || value == null) {
|
362 |
+
value = "";
|
363 |
+
|
364 |
+
if (valueElm)
|
365 |
+
value = valueElm.value;
|
366 |
+
}
|
367 |
+
|
368 |
+
// Clean up the style
|
369 |
+
if (attrib == 'style')
|
370 |
+
value = dom.serializeStyle(dom.parseStyle(value), 'a');
|
371 |
+
|
372 |
+
dom.setAttrib(elm, attrib, value);
|
373 |
+
}
|
374 |
+
|
375 |
+
function getAnchorListHTML(id, target) {
|
376 |
+
var ed = tinyMCEPopup.editor, nodes = ed.dom.select('a'), name, i, len, html = "";
|
377 |
+
|
378 |
+
for (i=0, len=nodes.length; i<len; i++) {
|
379 |
+
if ((name = ed.dom.getAttrib(nodes[i], "name")) != "")
|
380 |
+
html += '<option value="#' + name + '">' + name + '</option>';
|
381 |
+
|
382 |
+
if ((name = nodes[i].id) != "" && !nodes[i].href)
|
383 |
+
html += '<option value="#' + name + '">' + name + '</option>';
|
384 |
+
}
|
385 |
+
|
386 |
+
if (html == "")
|
387 |
+
return "";
|
388 |
+
|
389 |
+
html = '<select id="' + id + '" name="' + id + '" class="mceAnchorList"'
|
390 |
+
+ ' onchange="this.form.' + target + '.value=this.options[this.selectedIndex].value"'
|
391 |
+
+ '>'
|
392 |
+
+ '<option value="">---</option>'
|
393 |
+
+ html
|
394 |
+
+ '</select>';
|
395 |
+
|
396 |
+
return html;
|
397 |
+
}
|
398 |
+
|
399 |
+
function insertAction() {
|
400 |
+
var inst = tinyMCEPopup.editor;
|
401 |
+
var elm, elementArray, i;
|
402 |
+
|
403 |
+
elm = inst.selection.getNode();
|
404 |
+
checkPrefix(document.forms[0].href);
|
405 |
+
|
406 |
+
elm = inst.dom.getParent(elm, "A");
|
407 |
+
|
408 |
+
// Remove element if there is no href
|
409 |
+
if (!document.forms[0].href.value) {
|
410 |
+
i = inst.selection.getBookmark();
|
411 |
+
inst.dom.remove(elm, 1);
|
412 |
+
inst.selection.moveToBookmark(i);
|
413 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
414 |
+
tinyMCEPopup.close();
|
415 |
+
return;
|
416 |
+
}
|
417 |
+
|
418 |
+
// Create new anchor elements
|
419 |
+
if (elm == null) {
|
420 |
+
inst.getDoc().execCommand("unlink", false, null);
|
421 |
+
tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});
|
422 |
+
|
423 |
+
elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
|
424 |
+
for (i=0; i<elementArray.length; i++)
|
425 |
+
setAllAttribs(elm = elementArray[i]);
|
426 |
+
} else
|
427 |
+
setAllAttribs(elm);
|
428 |
+
|
429 |
+
// Don't move caret if selection was image
|
430 |
+
if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {
|
431 |
+
inst.focus();
|
432 |
+
inst.selection.select(elm);
|
433 |
+
inst.selection.collapse(0);
|
434 |
+
tinyMCEPopup.storeSelection();
|
435 |
+
}
|
436 |
+
|
437 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
438 |
+
tinyMCEPopup.close();
|
439 |
+
}
|
440 |
+
|
441 |
+
function setAllAttribs(elm) {
|
442 |
+
var formObj = document.forms[0];
|
443 |
+
var href = formObj.href.value.replace(/ /g, '%20');
|
444 |
+
var target = getSelectValue(formObj, 'targetlist');
|
445 |
+
|
446 |
+
setAttrib(elm, 'href', href);
|
447 |
+
setAttrib(elm, 'title');
|
448 |
+
setAttrib(elm, 'target', target == '_self' ? '' : target);
|
449 |
+
setAttrib(elm, 'id');
|
450 |
+
setAttrib(elm, 'style');
|
451 |
+
setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
|
452 |
+
setAttrib(elm, 'rel');
|
453 |
+
setAttrib(elm, 'rev');
|
454 |
+
setAttrib(elm, 'charset');
|
455 |
+
setAttrib(elm, 'hreflang');
|
456 |
+
setAttrib(elm, 'dir');
|
457 |
+
setAttrib(elm, 'lang');
|
458 |
+
setAttrib(elm, 'tabindex');
|
459 |
+
setAttrib(elm, 'accesskey');
|
460 |
+
setAttrib(elm, 'type');
|
461 |
+
setAttrib(elm, 'onfocus');
|
462 |
+
setAttrib(elm, 'onblur');
|
463 |
+
setAttrib(elm, 'onclick');
|
464 |
+
setAttrib(elm, 'ondblclick');
|
465 |
+
setAttrib(elm, 'onmousedown');
|
466 |
+
setAttrib(elm, 'onmouseup');
|
467 |
+
setAttrib(elm, 'onmouseover');
|
468 |
+
setAttrib(elm, 'onmousemove');
|
469 |
+
setAttrib(elm, 'onmouseout');
|
470 |
+
setAttrib(elm, 'onkeypress');
|
471 |
+
setAttrib(elm, 'onkeydown');
|
472 |
+
setAttrib(elm, 'onkeyup');
|
473 |
+
|
474 |
+
// Refresh in old MSIE
|
475 |
+
if (tinyMCE.isMSIE5)
|
476 |
+
elm.outerHTML = elm.outerHTML;
|
477 |
+
}
|
478 |
+
|
479 |
+
function getSelectValue(form_obj, field_name) {
|
480 |
+
var elm = form_obj.elements[field_name];
|
481 |
+
|
482 |
+
if (!elm || elm.options == null || elm.selectedIndex == -1)
|
483 |
+
return "";
|
484 |
+
|
485 |
+
return elm.options[elm.selectedIndex].value;
|
486 |
+
}
|
487 |
+
|
488 |
+
function getLinkListHTML(elm_id, target_form_element, onchange_func) {
|
489 |
+
if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
|
490 |
+
return "";
|
491 |
+
|
492 |
+
var html = "";
|
493 |
+
|
494 |
+
html += '<select id="' + elm_id + '" name="' + elm_id + '"';
|
495 |
+
html += ' class="mceLinkList" onchange="this.form.' + target_form_element + '.value=';
|
496 |
+
html += 'this.options[this.selectedIndex].value;';
|
497 |
+
|
498 |
+
if (typeof(onchange_func) != "undefined")
|
499 |
+
html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
|
500 |
+
|
501 |
+
html += '"><option value="">---</option>';
|
502 |
+
|
503 |
+
for (var i=0; i<tinyMCELinkList.length; i++)
|
504 |
+
html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
|
505 |
+
|
506 |
+
html += '</select>';
|
507 |
+
|
508 |
+
return html;
|
509 |
+
|
510 |
+
// tinyMCE.debug('-- image list start --', html, '-- image list end --');
|
511 |
+
}
|
512 |
+
|
513 |
+
function getTargetListHTML(elm_id, target_form_element) {
|
514 |
+
var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
|
515 |
+
var html = '';
|
516 |
+
|
517 |
+
html += '<select id="' + elm_id + '" name="' + elm_id + '" onchange="this.form.' + target_form_element + '.value=';
|
518 |
+
html += 'this.options[this.selectedIndex].value;">';
|
519 |
+
html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';
|
520 |
+
html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';
|
521 |
+
html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';
|
522 |
+
html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';
|
523 |
+
|
524 |
+
for (var i=0; i<targets.length; i++) {
|
525 |
+
var key, value;
|
526 |
+
|
527 |
+
if (targets[i] == "")
|
528 |
+
continue;
|
529 |
+
|
530 |
+
key = targets[i].split('=')[0];
|
531 |
+
value = targets[i].split('=')[1];
|
532 |
+
|
533 |
+
html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
|
534 |
+
}
|
535 |
+
|
536 |
+
html += '</select>';
|
537 |
+
|
538 |
+
return html;
|
539 |
+
}
|
540 |
+
|
541 |
+
// While loading
|
542 |
+
preinit();
|
543 |
+
tinyMCEPopup.onInit.add(init);
|
js/libraries/tiny_mce/plugins/advlink/link.htm
CHANGED
@@ -1,338 +1,338 @@
|
|
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 |
-
</head>
|
12 |
-
<body id="advlink" style="display: none" role="application" onload="javascript:mcTabs.displayTab('general_tab','general_panel', true);" aria-labelledby="app_label">
|
13 |
-
<span class="mceVoiceLabel" id="app_label" style="display:none;">{#advlink_dlg.title}</span>
|
14 |
-
<form onsubmit="insertAction();return false;" action="#">
|
15 |
-
<div class="tabs" role="presentation">
|
16 |
-
<ul>
|
17 |
-
<li id="general_tab" class="current" aria-controls="general_panel" ><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" aria-controls="popup_panel" ><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" aria-controls="events_panel"><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" aria-controls="advanced_panel"><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" role="presentation">
|
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" role="presentation">
|
30 |
-
<tr>
|
31 |
-
<td class="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);" aria-required="true" /></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"><select id="linklisthref"><option value=""></option></select></td>
|
42 |
-
</tr>
|
43 |
-
<tr id="anchorlistrow">
|
44 |
-
<td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>
|
45 |
-
<td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td>
|
46 |
-
</tr>
|
47 |
-
<tr>
|
48 |
-
<td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>
|
49 |
-
<td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td>
|
50 |
-
</tr>
|
51 |
-
<tr>
|
52 |
-
<td class="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="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" role="presentation" >
|
75 |
-
<tr>
|
76 |
-
<td class="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 class="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 role="group" aria-labelledby="popup_size_label">
|
91 |
-
<td class="nowrap"><label id="popup_size_label">{#advlink_dlg.popup_size}</label> </td>
|
92 |
-
<td class="nowrap">
|
93 |
-
<span style="display:none" id="width_voiceLabel">{#advlink_dlg.width}</span>
|
94 |
-
<input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" aria-labelledby="width_voiceLabel" /> x
|
95 |
-
<span style="display:none" id="height_voiceLabel">{#advlink_dlg.height}</span>
|
96 |
-
<input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" aria-labelledby="height_voiceLabel" /> px
|
97 |
-
</td>
|
98 |
-
</tr>
|
99 |
-
<tr role="group" aria-labelledby="popup_position_label center_hint">
|
100 |
-
<td class="nowrap" id="labelleft"><label id="popup_position_label">{#advlink_dlg.popup_position}</label> </td>
|
101 |
-
<td class="nowrap">
|
102 |
-
<span style="display:none" id="x_voiceLabel">X</span>
|
103 |
-
<input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" aria-labelledby="x_voiceLabel" /> /
|
104 |
-
<span style="display:none" id="y_voiceLabel">Y</span>
|
105 |
-
<input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" aria-labelledby="y_voiceLabel" /> <span id="center_hint">(c /c = center)</span>
|
106 |
-
</td>
|
107 |
-
</tr>
|
108 |
-
</table>
|
109 |
-
|
110 |
-
<fieldset>
|
111 |
-
<legend>{#advlink_dlg.popup_opts}</legend>
|
112 |
-
|
113 |
-
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
114 |
-
<tr>
|
115 |
-
<td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
|
116 |
-
<td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
|
117 |
-
<td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
|
118 |
-
<td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
|
119 |
-
</tr>
|
120 |
-
<tr>
|
121 |
-
<td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
|
122 |
-
<td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
|
123 |
-
<td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
|
124 |
-
<td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
|
125 |
-
</tr>
|
126 |
-
<tr>
|
127 |
-
<td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
|
128 |
-
<td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
|
129 |
-
<td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
|
130 |
-
<td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
|
131 |
-
</tr>
|
132 |
-
<tr>
|
133 |
-
<td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
|
134 |
-
<td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
|
135 |
-
<td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
|
136 |
-
<td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
|
137 |
-
</tr>
|
138 |
-
</table>
|
139 |
-
</fieldset>
|
140 |
-
</fieldset>
|
141 |
-
</div>
|
142 |
-
|
143 |
-
<div id="advanced_panel" class="panel">
|
144 |
-
<fieldset>
|
145 |
-
<legend>{#advlink_dlg.advanced_props}</legend>
|
146 |
-
|
147 |
-
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
148 |
-
<tr>
|
149 |
-
<td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td>
|
150 |
-
<td><input id="id" name="id" type="text" value="" /></td>
|
151 |
-
</tr>
|
152 |
-
|
153 |
-
<tr>
|
154 |
-
<td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>
|
155 |
-
<td><input type="text" id="style" name="style" value="" /></td>
|
156 |
-
</tr>
|
157 |
-
|
158 |
-
<tr>
|
159 |
-
<td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>
|
160 |
-
<td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
161 |
-
</tr>
|
162 |
-
|
163 |
-
<tr>
|
164 |
-
<td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>
|
165 |
-
<td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
|
166 |
-
</tr>
|
167 |
-
|
168 |
-
<tr>
|
169 |
-
<td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td>
|
170 |
-
<td>
|
171 |
-
<select id="dir" name="dir">
|
172 |
-
<option value="">{#not_set}</option>
|
173 |
-
<option value="ltr">{#advlink_dlg.ltr}</option>
|
174 |
-
<option value="rtl">{#advlink_dlg.rtl}</option>
|
175 |
-
</select>
|
176 |
-
</td>
|
177 |
-
</tr>
|
178 |
-
|
179 |
-
<tr>
|
180 |
-
<td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>
|
181 |
-
<td><input type="text" id="hreflang" name="hreflang" value="" /></td>
|
182 |
-
</tr>
|
183 |
-
|
184 |
-
<tr>
|
185 |
-
<td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td>
|
186 |
-
<td>
|
187 |
-
<input id="lang" name="lang" type="text" value="" />
|
188 |
-
</td>
|
189 |
-
</tr>
|
190 |
-
|
191 |
-
<tr>
|
192 |
-
<td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>
|
193 |
-
<td><input type="text" id="charset" name="charset" value="" /></td>
|
194 |
-
</tr>
|
195 |
-
|
196 |
-
<tr>
|
197 |
-
<td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>
|
198 |
-
<td><input type="text" id="type" name="type" value="" /></td>
|
199 |
-
</tr>
|
200 |
-
|
201 |
-
<tr>
|
202 |
-
<td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>
|
203 |
-
<td><select id="rel" name="rel">
|
204 |
-
<option value="">{#not_set}</option>
|
205 |
-
<option value="lightbox">Lightbox</option>
|
206 |
-
<option value="alternate">Alternate</option>
|
207 |
-
<option value="designates">Designates</option>
|
208 |
-
<option value="stylesheet">Stylesheet</option>
|
209 |
-
<option value="start">Start</option>
|
210 |
-
<option value="next">Next</option>
|
211 |
-
<option value="prev">Prev</option>
|
212 |
-
<option value="contents">Contents</option>
|
213 |
-
<option value="index">Index</option>
|
214 |
-
<option value="glossary">Glossary</option>
|
215 |
-
<option value="copyright">Copyright</option>
|
216 |
-
<option value="chapter">Chapter</option>
|
217 |
-
<option value="subsection">Subsection</option>
|
218 |
-
<option value="appendix">Appendix</option>
|
219 |
-
<option value="help">Help</option>
|
220 |
-
<option value="bookmark">Bookmark</option>
|
221 |
-
<option value="nofollow">No Follow</option>
|
222 |
-
<option value="tag">Tag</option>
|
223 |
-
</select>
|
224 |
-
</td>
|
225 |
-
</tr>
|
226 |
-
|
227 |
-
<tr>
|
228 |
-
<td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>
|
229 |
-
<td><select id="rev" name="rev">
|
230 |
-
<option value="">{#not_set}</option>
|
231 |
-
<option value="alternate">Alternate</option>
|
232 |
-
<option value="designates">Designates</option>
|
233 |
-
<option value="stylesheet">Stylesheet</option>
|
234 |
-
<option value="start">Start</option>
|
235 |
-
<option value="next">Next</option>
|
236 |
-
<option value="prev">Prev</option>
|
237 |
-
<option value="contents">Contents</option>
|
238 |
-
<option value="index">Index</option>
|
239 |
-
<option value="glossary">Glossary</option>
|
240 |
-
<option value="copyright">Copyright</option>
|
241 |
-
<option value="chapter">Chapter</option>
|
242 |
-
<option value="subsection">Subsection</option>
|
243 |
-
<option value="appendix">Appendix</option>
|
244 |
-
<option value="help">Help</option>
|
245 |
-
<option value="bookmark">Bookmark</option>
|
246 |
-
</select>
|
247 |
-
</td>
|
248 |
-
</tr>
|
249 |
-
|
250 |
-
<tr>
|
251 |
-
<td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>
|
252 |
-
<td><input type="text" id="tabindex" name="tabindex" value="" /></td>
|
253 |
-
</tr>
|
254 |
-
|
255 |
-
<tr>
|
256 |
-
<td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>
|
257 |
-
<td><input type="text" id="accesskey" name="accesskey" value="" /></td>
|
258 |
-
</tr>
|
259 |
-
</table>
|
260 |
-
</fieldset>
|
261 |
-
</div>
|
262 |
-
|
263 |
-
<div id="events_panel" class="panel">
|
264 |
-
<fieldset>
|
265 |
-
<legend>{#advlink_dlg.event_props}</legend>
|
266 |
-
|
267 |
-
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
268 |
-
<tr>
|
269 |
-
<td class="column1"><label for="onfocus">onfocus</label></td>
|
270 |
-
<td><input id="onfocus" name="onfocus" type="text" value="" /></td>
|
271 |
-
</tr>
|
272 |
-
|
273 |
-
<tr>
|
274 |
-
<td class="column1"><label for="onblur">onblur</label></td>
|
275 |
-
<td><input id="onblur" name="onblur" type="text" value="" /></td>
|
276 |
-
</tr>
|
277 |
-
|
278 |
-
<tr>
|
279 |
-
<td class="column1"><label for="onclick">onclick</label></td>
|
280 |
-
<td><input id="onclick" name="onclick" type="text" value="" /></td>
|
281 |
-
</tr>
|
282 |
-
|
283 |
-
<tr>
|
284 |
-
<td class="column1"><label for="ondblclick">ondblclick</label></td>
|
285 |
-
<td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
|
286 |
-
</tr>
|
287 |
-
|
288 |
-
<tr>
|
289 |
-
<td class="column1"><label for="onmousedown">onmousedown</label></td>
|
290 |
-
<td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
|
291 |
-
</tr>
|
292 |
-
|
293 |
-
<tr>
|
294 |
-
<td class="column1"><label for="onmouseup">onmouseup</label></td>
|
295 |
-
<td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
|
296 |
-
</tr>
|
297 |
-
|
298 |
-
<tr>
|
299 |
-
<td class="column1"><label for="onmouseover">onmouseover</label></td>
|
300 |
-
<td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
|
301 |
-
</tr>
|
302 |
-
|
303 |
-
<tr>
|
304 |
-
<td class="column1"><label for="onmousemove">onmousemove</label></td>
|
305 |
-
<td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
|
306 |
-
</tr>
|
307 |
-
|
308 |
-
<tr>
|
309 |
-
<td class="column1"><label for="onmouseout">onmouseout</label></td>
|
310 |
-
<td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
|
311 |
-
</tr>
|
312 |
-
|
313 |
-
<tr>
|
314 |
-
<td class="column1"><label for="onkeypress">onkeypress</label></td>
|
315 |
-
<td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
|
316 |
-
</tr>
|
317 |
-
|
318 |
-
<tr>
|
319 |
-
<td class="column1"><label for="onkeydown">onkeydown</label></td>
|
320 |
-
<td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
|
321 |
-
</tr>
|
322 |
-
|
323 |
-
<tr>
|
324 |
-
<td class="column1"><label for="onkeyup">onkeyup</label></td>
|
325 |
-
<td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
|
326 |
-
</tr>
|
327 |
-
</table>
|
328 |
-
</fieldset>
|
329 |
-
</div>
|
330 |
-
</div>
|
331 |
-
|
332 |
-
<div class="mceActionPanel">
|
333 |
-
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
334 |
-
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
335 |
-
</div>
|
336 |
-
</form>
|
337 |
-
</body>
|
338 |
-
</html>
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#advlink_dlg.title}</title>
|
5 |
+
<script type="text/javascript" src="../../tiny_mce_popup.js"></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 |
+
</head>
|
12 |
+
<body id="advlink" style="display: none" role="application" onload="javascript:mcTabs.displayTab('general_tab','general_panel', true);" aria-labelledby="app_label">
|
13 |
+
<span class="mceVoiceLabel" id="app_label" style="display:none;">{#advlink_dlg.title}</span>
|
14 |
+
<form onsubmit="insertAction();return false;" action="#">
|
15 |
+
<div class="tabs" role="presentation">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current" aria-controls="general_panel" ><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" aria-controls="popup_panel" ><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" aria-controls="events_panel"><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" aria-controls="advanced_panel"><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" role="presentation">
|
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" role="presentation">
|
30 |
+
<tr>
|
31 |
+
<td class="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);" aria-required="true" /></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"><select id="linklisthref"><option value=""></option></select></td>
|
42 |
+
</tr>
|
43 |
+
<tr id="anchorlistrow">
|
44 |
+
<td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>
|
45 |
+
<td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>
|
49 |
+
<td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td>
|
50 |
+
</tr>
|
51 |
+
<tr>
|
52 |
+
<td class="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="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" role="presentation" >
|
75 |
+
<tr>
|
76 |
+
<td class="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 class="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 role="group" aria-labelledby="popup_size_label">
|
91 |
+
<td class="nowrap"><label id="popup_size_label">{#advlink_dlg.popup_size}</label> </td>
|
92 |
+
<td class="nowrap">
|
93 |
+
<span style="display:none" id="width_voiceLabel">{#advlink_dlg.width}</span>
|
94 |
+
<input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" aria-labelledby="width_voiceLabel" /> x
|
95 |
+
<span style="display:none" id="height_voiceLabel">{#advlink_dlg.height}</span>
|
96 |
+
<input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" aria-labelledby="height_voiceLabel" /> px
|
97 |
+
</td>
|
98 |
+
</tr>
|
99 |
+
<tr role="group" aria-labelledby="popup_position_label center_hint">
|
100 |
+
<td class="nowrap" id="labelleft"><label id="popup_position_label">{#advlink_dlg.popup_position}</label> </td>
|
101 |
+
<td class="nowrap">
|
102 |
+
<span style="display:none" id="x_voiceLabel">X</span>
|
103 |
+
<input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" aria-labelledby="x_voiceLabel" /> /
|
104 |
+
<span style="display:none" id="y_voiceLabel">Y</span>
|
105 |
+
<input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" aria-labelledby="y_voiceLabel" /> <span id="center_hint">(c /c = center)</span>
|
106 |
+
</td>
|
107 |
+
</tr>
|
108 |
+
</table>
|
109 |
+
|
110 |
+
<fieldset>
|
111 |
+
<legend>{#advlink_dlg.popup_opts}</legend>
|
112 |
+
|
113 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
114 |
+
<tr>
|
115 |
+
<td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
|
116 |
+
<td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
|
117 |
+
<td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
|
118 |
+
<td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
|
119 |
+
</tr>
|
120 |
+
<tr>
|
121 |
+
<td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
|
122 |
+
<td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
|
123 |
+
<td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
|
124 |
+
<td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
|
128 |
+
<td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
|
129 |
+
<td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
|
130 |
+
<td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
|
131 |
+
</tr>
|
132 |
+
<tr>
|
133 |
+
<td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
|
134 |
+
<td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
|
135 |
+
<td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
|
136 |
+
<td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
|
137 |
+
</tr>
|
138 |
+
</table>
|
139 |
+
</fieldset>
|
140 |
+
</fieldset>
|
141 |
+
</div>
|
142 |
+
|
143 |
+
<div id="advanced_panel" class="panel">
|
144 |
+
<fieldset>
|
145 |
+
<legend>{#advlink_dlg.advanced_props}</legend>
|
146 |
+
|
147 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
148 |
+
<tr>
|
149 |
+
<td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td>
|
150 |
+
<td><input id="id" name="id" type="text" value="" /></td>
|
151 |
+
</tr>
|
152 |
+
|
153 |
+
<tr>
|
154 |
+
<td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>
|
155 |
+
<td><input type="text" id="style" name="style" value="" /></td>
|
156 |
+
</tr>
|
157 |
+
|
158 |
+
<tr>
|
159 |
+
<td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>
|
160 |
+
<td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
161 |
+
</tr>
|
162 |
+
|
163 |
+
<tr>
|
164 |
+
<td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>
|
165 |
+
<td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
|
166 |
+
</tr>
|
167 |
+
|
168 |
+
<tr>
|
169 |
+
<td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td>
|
170 |
+
<td>
|
171 |
+
<select id="dir" name="dir">
|
172 |
+
<option value="">{#not_set}</option>
|
173 |
+
<option value="ltr">{#advlink_dlg.ltr}</option>
|
174 |
+
<option value="rtl">{#advlink_dlg.rtl}</option>
|
175 |
+
</select>
|
176 |
+
</td>
|
177 |
+
</tr>
|
178 |
+
|
179 |
+
<tr>
|
180 |
+
<td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>
|
181 |
+
<td><input type="text" id="hreflang" name="hreflang" value="" /></td>
|
182 |
+
</tr>
|
183 |
+
|
184 |
+
<tr>
|
185 |
+
<td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td>
|
186 |
+
<td>
|
187 |
+
<input id="lang" name="lang" type="text" value="" />
|
188 |
+
</td>
|
189 |
+
</tr>
|
190 |
+
|
191 |
+
<tr>
|
192 |
+
<td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>
|
193 |
+
<td><input type="text" id="charset" name="charset" value="" /></td>
|
194 |
+
</tr>
|
195 |
+
|
196 |
+
<tr>
|
197 |
+
<td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>
|
198 |
+
<td><input type="text" id="type" name="type" value="" /></td>
|
199 |
+
</tr>
|
200 |
+
|
201 |
+
<tr>
|
202 |
+
<td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>
|
203 |
+
<td><select id="rel" name="rel">
|
204 |
+
<option value="">{#not_set}</option>
|
205 |
+
<option value="lightbox">Lightbox</option>
|
206 |
+
<option value="alternate">Alternate</option>
|
207 |
+
<option value="designates">Designates</option>
|
208 |
+
<option value="stylesheet">Stylesheet</option>
|
209 |
+
<option value="start">Start</option>
|
210 |
+
<option value="next">Next</option>
|
211 |
+
<option value="prev">Prev</option>
|
212 |
+
<option value="contents">Contents</option>
|
213 |
+
<option value="index">Index</option>
|
214 |
+
<option value="glossary">Glossary</option>
|
215 |
+
<option value="copyright">Copyright</option>
|
216 |
+
<option value="chapter">Chapter</option>
|
217 |
+
<option value="subsection">Subsection</option>
|
218 |
+
<option value="appendix">Appendix</option>
|
219 |
+
<option value="help">Help</option>
|
220 |
+
<option value="bookmark">Bookmark</option>
|
221 |
+
<option value="nofollow">No Follow</option>
|
222 |
+
<option value="tag">Tag</option>
|
223 |
+
</select>
|
224 |
+
</td>
|
225 |
+
</tr>
|
226 |
+
|
227 |
+
<tr>
|
228 |
+
<td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>
|
229 |
+
<td><select id="rev" name="rev">
|
230 |
+
<option value="">{#not_set}</option>
|
231 |
+
<option value="alternate">Alternate</option>
|
232 |
+
<option value="designates">Designates</option>
|
233 |
+
<option value="stylesheet">Stylesheet</option>
|
234 |
+
<option value="start">Start</option>
|
235 |
+
<option value="next">Next</option>
|
236 |
+
<option value="prev">Prev</option>
|
237 |
+
<option value="contents">Contents</option>
|
238 |
+
<option value="index">Index</option>
|
239 |
+
<option value="glossary">Glossary</option>
|
240 |
+
<option value="copyright">Copyright</option>
|
241 |
+
<option value="chapter">Chapter</option>
|
242 |
+
<option value="subsection">Subsection</option>
|
243 |
+
<option value="appendix">Appendix</option>
|
244 |
+
<option value="help">Help</option>
|
245 |
+
<option value="bookmark">Bookmark</option>
|
246 |
+
</select>
|
247 |
+
</td>
|
248 |
+
</tr>
|
249 |
+
|
250 |
+
<tr>
|
251 |
+
<td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>
|
252 |
+
<td><input type="text" id="tabindex" name="tabindex" value="" /></td>
|
253 |
+
</tr>
|
254 |
+
|
255 |
+
<tr>
|
256 |
+
<td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>
|
257 |
+
<td><input type="text" id="accesskey" name="accesskey" value="" /></td>
|
258 |
+
</tr>
|
259 |
+
</table>
|
260 |
+
</fieldset>
|
261 |
+
</div>
|
262 |
+
|
263 |
+
<div id="events_panel" class="panel">
|
264 |
+
<fieldset>
|
265 |
+
<legend>{#advlink_dlg.event_props}</legend>
|
266 |
+
|
267 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
268 |
+
<tr>
|
269 |
+
<td class="column1"><label for="onfocus">onfocus</label></td>
|
270 |
+
<td><input id="onfocus" name="onfocus" type="text" value="" /></td>
|
271 |
+
</tr>
|
272 |
+
|
273 |
+
<tr>
|
274 |
+
<td class="column1"><label for="onblur">onblur</label></td>
|
275 |
+
<td><input id="onblur" name="onblur" type="text" value="" /></td>
|
276 |
+
</tr>
|
277 |
+
|
278 |
+
<tr>
|
279 |
+
<td class="column1"><label for="onclick">onclick</label></td>
|
280 |
+
<td><input id="onclick" name="onclick" type="text" value="" /></td>
|
281 |
+
</tr>
|
282 |
+
|
283 |
+
<tr>
|
284 |
+
<td class="column1"><label for="ondblclick">ondblclick</label></td>
|
285 |
+
<td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
|
286 |
+
</tr>
|
287 |
+
|
288 |
+
<tr>
|
289 |
+
<td class="column1"><label for="onmousedown">onmousedown</label></td>
|
290 |
+
<td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
|
291 |
+
</tr>
|
292 |
+
|
293 |
+
<tr>
|
294 |
+
<td class="column1"><label for="onmouseup">onmouseup</label></td>
|
295 |
+
<td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
|
296 |
+
</tr>
|
297 |
+
|
298 |
+
<tr>
|
299 |
+
<td class="column1"><label for="onmouseover">onmouseover</label></td>
|
300 |
+
<td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
|
301 |
+
</tr>
|
302 |
+
|
303 |
+
<tr>
|
304 |
+
<td class="column1"><label for="onmousemove">onmousemove</label></td>
|
305 |
+
<td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
|
306 |
+
</tr>
|
307 |
+
|
308 |
+
<tr>
|
309 |
+
<td class="column1"><label for="onmouseout">onmouseout</label></td>
|
310 |
+
<td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
|
311 |
+
</tr>
|
312 |
+
|
313 |
+
<tr>
|
314 |
+
<td class="column1"><label for="onkeypress">onkeypress</label></td>
|
315 |
+
<td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
|
316 |
+
</tr>
|
317 |
+
|
318 |
+
<tr>
|
319 |
+
<td class="column1"><label for="onkeydown">onkeydown</label></td>
|
320 |
+
<td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
|
321 |
+
</tr>
|
322 |
+
|
323 |
+
<tr>
|
324 |
+
<td class="column1"><label for="onkeyup">onkeyup</label></td>
|
325 |
+
<td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
|
326 |
+
</tr>
|
327 |
+
</table>
|
328 |
+
</fieldset>
|
329 |
+
</div>
|
330 |
+
</div>
|
331 |
+
|
332 |
+
<div class="mceActionPanel">
|
333 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
334 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
335 |
+
</div>
|
336 |
+
</form>
|
337 |
+
</body>
|
338 |
+
</html>
|
js/libraries/tiny_mce/plugins/advlist/editor_plugin_src.js
CHANGED
@@ -1,176 +1,176 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
var each = tinymce.each;
|
13 |
-
|
14 |
-
tinymce.create('tinymce.plugins.AdvListPlugin', {
|
15 |
-
init : function(ed, url) {
|
16 |
-
var t = this;
|
17 |
-
|
18 |
-
t.editor = ed;
|
19 |
-
|
20 |
-
function buildFormats(str) {
|
21 |
-
var formats = [];
|
22 |
-
|
23 |
-
each(str.split(/,/), function(type) {
|
24 |
-
formats.push({
|
25 |
-
title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')),
|
26 |
-
styles : {
|
27 |
-
listStyleType : type == 'default' ? '' : type
|
28 |
-
}
|
29 |
-
});
|
30 |
-
});
|
31 |
-
|
32 |
-
return formats;
|
33 |
-
};
|
34 |
-
|
35 |
-
// Setup number formats from config or default
|
36 |
-
t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");
|
37 |
-
t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square");
|
38 |
-
|
39 |
-
if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent))
|
40 |
-
t.isIE7 = true;
|
41 |
-
},
|
42 |
-
|
43 |
-
createControl: function(name, cm) {
|
44 |
-
var t = this, btn, format, editor = t.editor;
|
45 |
-
|
46 |
-
if (name == 'numlist' || name == 'bullist') {
|
47 |
-
// Default to first item if it's a default item
|
48 |
-
if (t[name][0].title == 'advlist.def')
|
49 |
-
format = t[name][0];
|
50 |
-
|
51 |
-
function hasFormat(node, format) {
|
52 |
-
var state = true;
|
53 |
-
|
54 |
-
each(format.styles, function(value, name) {
|
55 |
-
// Format doesn't match
|
56 |
-
if (editor.dom.getStyle(node, name) != value) {
|
57 |
-
state = false;
|
58 |
-
return false;
|
59 |
-
}
|
60 |
-
});
|
61 |
-
|
62 |
-
return state;
|
63 |
-
};
|
64 |
-
|
65 |
-
function applyListFormat() {
|
66 |
-
var list, dom = editor.dom, sel = editor.selection;
|
67 |
-
|
68 |
-
// Check for existing list element
|
69 |
-
list = dom.getParent(sel.getNode(), 'ol,ul');
|
70 |
-
|
71 |
-
// Switch/add list type if needed
|
72 |
-
if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format))
|
73 |
-
editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList');
|
74 |
-
|
75 |
-
// Append styles to new list element
|
76 |
-
if (format) {
|
77 |
-
list = dom.getParent(sel.getNode(), 'ol,ul');
|
78 |
-
if (list) {
|
79 |
-
dom.setStyles(list, format.styles);
|
80 |
-
list.removeAttribute('data-mce-style');
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
editor.focus();
|
85 |
-
};
|
86 |
-
|
87 |
-
btn = cm.createSplitButton(name, {
|
88 |
-
title : 'advanced.' + name + '_desc',
|
89 |
-
'class' : 'mce_' + name,
|
90 |
-
onclick : function() {
|
91 |
-
applyListFormat();
|
92 |
-
}
|
93 |
-
});
|
94 |
-
|
95 |
-
btn.onRenderMenu.add(function(btn, menu) {
|
96 |
-
menu.onHideMenu.add(function() {
|
97 |
-
if (t.bookmark) {
|
98 |
-
editor.selection.moveToBookmark(t.bookmark);
|
99 |
-
t.bookmark = 0;
|
100 |
-
}
|
101 |
-
});
|
102 |
-
|
103 |
-
menu.onShowMenu.add(function() {
|
104 |
-
var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList;
|
105 |
-
|
106 |
-
if (list || format) {
|
107 |
-
fmtList = t[name];
|
108 |
-
|
109 |
-
// Unselect existing items
|
110 |
-
each(menu.items, function(item) {
|
111 |
-
var state = true;
|
112 |
-
|
113 |
-
item.setSelected(0);
|
114 |
-
|
115 |
-
if (list && !item.isDisabled()) {
|
116 |
-
each(fmtList, function(fmt) {
|
117 |
-
if (fmt.id == item.id) {
|
118 |
-
if (!hasFormat(list, fmt)) {
|
119 |
-
state = false;
|
120 |
-
return false;
|
121 |
-
}
|
122 |
-
}
|
123 |
-
});
|
124 |
-
|
125 |
-
if (state)
|
126 |
-
item.setSelected(1);
|
127 |
-
}
|
128 |
-
});
|
129 |
-
|
130 |
-
// Select the current format
|
131 |
-
if (!list)
|
132 |
-
menu.items[format.id].setSelected(1);
|
133 |
-
}
|
134 |
-
|
135 |
-
editor.focus();
|
136 |
-
|
137 |
-
// IE looses it's selection so store it away and restore it later
|
138 |
-
if (tinymce.isIE) {
|
139 |
-
t.bookmark = editor.selection.getBookmark(1);
|
140 |
-
}
|
141 |
-
});
|
142 |
-
|
143 |
-
menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1);
|
144 |
-
|
145 |
-
each(t[name], function(item) {
|
146 |
-
// IE<8 doesn't support lower-greek, skip it
|
147 |
-
if (t.isIE7 && item.styles.listStyleType == 'lower-greek')
|
148 |
-
return;
|
149 |
-
|
150 |
-
item.id = editor.dom.uniqueId();
|
151 |
-
|
152 |
-
menu.add({id : item.id, title : item.title, onclick : function() {
|
153 |
-
format = item;
|
154 |
-
applyListFormat();
|
155 |
-
}});
|
156 |
-
});
|
157 |
-
});
|
158 |
-
|
159 |
-
return btn;
|
160 |
-
}
|
161 |
-
},
|
162 |
-
|
163 |
-
getInfo : function() {
|
164 |
-
return {
|
165 |
-
longname : 'Advanced lists',
|
166 |
-
author : 'Moxiecode Systems AB',
|
167 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
168 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',
|
169 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
170 |
-
};
|
171 |
-
}
|
172 |
-
});
|
173 |
-
|
174 |
-
// Register plugin
|
175 |
-
tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin);
|
176 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var each = tinymce.each;
|
13 |
+
|
14 |
+
tinymce.create('tinymce.plugins.AdvListPlugin', {
|
15 |
+
init : function(ed, url) {
|
16 |
+
var t = this;
|
17 |
+
|
18 |
+
t.editor = ed;
|
19 |
+
|
20 |
+
function buildFormats(str) {
|
21 |
+
var formats = [];
|
22 |
+
|
23 |
+
each(str.split(/,/), function(type) {
|
24 |
+
formats.push({
|
25 |
+
title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')),
|
26 |
+
styles : {
|
27 |
+
listStyleType : type == 'default' ? '' : type
|
28 |
+
}
|
29 |
+
});
|
30 |
+
});
|
31 |
+
|
32 |
+
return formats;
|
33 |
+
};
|
34 |
+
|
35 |
+
// Setup number formats from config or default
|
36 |
+
t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");
|
37 |
+
t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square");
|
38 |
+
|
39 |
+
if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent))
|
40 |
+
t.isIE7 = true;
|
41 |
+
},
|
42 |
+
|
43 |
+
createControl: function(name, cm) {
|
44 |
+
var t = this, btn, format, editor = t.editor;
|
45 |
+
|
46 |
+
if (name == 'numlist' || name == 'bullist') {
|
47 |
+
// Default to first item if it's a default item
|
48 |
+
if (t[name][0].title == 'advlist.def')
|
49 |
+
format = t[name][0];
|
50 |
+
|
51 |
+
function hasFormat(node, format) {
|
52 |
+
var state = true;
|
53 |
+
|
54 |
+
each(format.styles, function(value, name) {
|
55 |
+
// Format doesn't match
|
56 |
+
if (editor.dom.getStyle(node, name) != value) {
|
57 |
+
state = false;
|
58 |
+
return false;
|
59 |
+
}
|
60 |
+
});
|
61 |
+
|
62 |
+
return state;
|
63 |
+
};
|
64 |
+
|
65 |
+
function applyListFormat() {
|
66 |
+
var list, dom = editor.dom, sel = editor.selection;
|
67 |
+
|
68 |
+
// Check for existing list element
|
69 |
+
list = dom.getParent(sel.getNode(), 'ol,ul');
|
70 |
+
|
71 |
+
// Switch/add list type if needed
|
72 |
+
if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format))
|
73 |
+
editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList');
|
74 |
+
|
75 |
+
// Append styles to new list element
|
76 |
+
if (format) {
|
77 |
+
list = dom.getParent(sel.getNode(), 'ol,ul');
|
78 |
+
if (list) {
|
79 |
+
dom.setStyles(list, format.styles);
|
80 |
+
list.removeAttribute('data-mce-style');
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
editor.focus();
|
85 |
+
};
|
86 |
+
|
87 |
+
btn = cm.createSplitButton(name, {
|
88 |
+
title : 'advanced.' + name + '_desc',
|
89 |
+
'class' : 'mce_' + name,
|
90 |
+
onclick : function() {
|
91 |
+
applyListFormat();
|
92 |
+
}
|
93 |
+
});
|
94 |
+
|
95 |
+
btn.onRenderMenu.add(function(btn, menu) {
|
96 |
+
menu.onHideMenu.add(function() {
|
97 |
+
if (t.bookmark) {
|
98 |
+
editor.selection.moveToBookmark(t.bookmark);
|
99 |
+
t.bookmark = 0;
|
100 |
+
}
|
101 |
+
});
|
102 |
+
|
103 |
+
menu.onShowMenu.add(function() {
|
104 |
+
var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList;
|
105 |
+
|
106 |
+
if (list || format) {
|
107 |
+
fmtList = t[name];
|
108 |
+
|
109 |
+
// Unselect existing items
|
110 |
+
each(menu.items, function(item) {
|
111 |
+
var state = true;
|
112 |
+
|
113 |
+
item.setSelected(0);
|
114 |
+
|
115 |
+
if (list && !item.isDisabled()) {
|
116 |
+
each(fmtList, function(fmt) {
|
117 |
+
if (fmt.id == item.id) {
|
118 |
+
if (!hasFormat(list, fmt)) {
|
119 |
+
state = false;
|
120 |
+
return false;
|
121 |
+
}
|
122 |
+
}
|
123 |
+
});
|
124 |
+
|
125 |
+
if (state)
|
126 |
+
item.setSelected(1);
|
127 |
+
}
|
128 |
+
});
|
129 |
+
|
130 |
+
// Select the current format
|
131 |
+
if (!list)
|
132 |
+
menu.items[format.id].setSelected(1);
|
133 |
+
}
|
134 |
+
|
135 |
+
editor.focus();
|
136 |
+
|
137 |
+
// IE looses it's selection so store it away and restore it later
|
138 |
+
if (tinymce.isIE) {
|
139 |
+
t.bookmark = editor.selection.getBookmark(1);
|
140 |
+
}
|
141 |
+
});
|
142 |
+
|
143 |
+
menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1);
|
144 |
+
|
145 |
+
each(t[name], function(item) {
|
146 |
+
// IE<8 doesn't support lower-greek, skip it
|
147 |
+
if (t.isIE7 && item.styles.listStyleType == 'lower-greek')
|
148 |
+
return;
|
149 |
+
|
150 |
+
item.id = editor.dom.uniqueId();
|
151 |
+
|
152 |
+
menu.add({id : item.id, title : item.title, onclick : function() {
|
153 |
+
format = item;
|
154 |
+
applyListFormat();
|
155 |
+
}});
|
156 |
+
});
|
157 |
+
});
|
158 |
+
|
159 |
+
return btn;
|
160 |
+
}
|
161 |
+
},
|
162 |
+
|
163 |
+
getInfo : function() {
|
164 |
+
return {
|
165 |
+
longname : 'Advanced lists',
|
166 |
+
author : 'Moxiecode Systems AB',
|
167 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
168 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',
|
169 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
170 |
+
};
|
171 |
+
}
|
172 |
+
});
|
173 |
+
|
174 |
+
// Register plugin
|
175 |
+
tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin);
|
176 |
})();
|
js/libraries/tiny_mce/plugins/autosave/editor_plugin_src.js
CHANGED
@@ -1,433 +1,433 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*
|
10 |
-
* Adds auto-save capability to the TinyMCE text editor to rescue content
|
11 |
-
* inadvertently lost. This plugin was originally developed by Speednet
|
12 |
-
* and that project can be found here: http://code.google.com/p/tinyautosave/
|
13 |
-
*
|
14 |
-
* TECHNOLOGY DISCUSSION:
|
15 |
-
*
|
16 |
-
* The plugin attempts to use the most advanced features available in the current browser to save
|
17 |
-
* as much content as possible. There are a total of four different methods used to autosave the
|
18 |
-
* content. In order of preference, they are:
|
19 |
-
*
|
20 |
-
* 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain
|
21 |
-
* on the client computer. Data stored in the localStorage area has no expiration date, so we must
|
22 |
-
* manage expiring the data ourselves. localStorage is fully supported by IE8, and it is supposed
|
23 |
-
* to be working in Firefox 3 and Safari 3.2, but in reality is is flaky in those browsers. As
|
24 |
-
* HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7,
|
25 |
-
* localStorage is stored in the following folder:
|
26 |
-
* C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder]
|
27 |
-
*
|
28 |
-
* 2. sessionStorage - A new feature of HTML 5, sessionStorage works similarly to localStorage,
|
29 |
-
* except it is designed to expire after a certain amount of time. Because the specification
|
30 |
-
* around expiration date/time is very loosely-described, it is preferrable to use locaStorage and
|
31 |
-
* manage the expiration ourselves. sessionStorage has similar storage characteristics to
|
32 |
-
* localStorage, although it seems to have better support by Firefox 3 at the moment. (That will
|
33 |
-
* certainly change as Firefox continues getting better at HTML 5 adoption.)
|
34 |
-
*
|
35 |
-
* 3. UserData - A very under-exploited feature of Microsoft Internet Explorer, UserData is a
|
36 |
-
* way to store up to 128K of data per "document", or up to 1MB of data per domain, on the client
|
37 |
-
* computer. The feature is available for IE 5+, which makes it available for every version of IE
|
38 |
-
* supported by TinyMCE. The content is persistent across browser restarts and expires on the
|
39 |
-
* date/time specified, just like a cookie. However, the data is not cleared when the user clears
|
40 |
-
* cookies on the browser, which makes it well-suited for rescuing autosaved content. UserData,
|
41 |
-
* like other Microsoft IE browser technologies, is implemented as a behavior attached to a
|
42 |
-
* specific DOM object, so in this case we attach the behavior to the same DOM element that the
|
43 |
-
* TinyMCE editor instance is attached to.
|
44 |
-
*/
|
45 |
-
|
46 |
-
(function(tinymce) {
|
47 |
-
// Setup constants to help the compressor to reduce script size
|
48 |
-
var PLUGIN_NAME = 'autosave',
|
49 |
-
RESTORE_DRAFT = 'restoredraft',
|
50 |
-
TRUE = true,
|
51 |
-
undefined,
|
52 |
-
unloadHandlerAdded,
|
53 |
-
Dispatcher = tinymce.util.Dispatcher;
|
54 |
-
|
55 |
-
/**
|
56 |
-
* This plugin adds auto-save capability to the TinyMCE text editor to rescue content
|
57 |
-
* inadvertently lost. By using localStorage.
|
58 |
-
*
|
59 |
-
* @class tinymce.plugins.AutoSave
|
60 |
-
*/
|
61 |
-
tinymce.create('tinymce.plugins.AutoSave', {
|
62 |
-
/**
|
63 |
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
64 |
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
65 |
-
* of the editor instance to intercept that event.
|
66 |
-
*
|
67 |
-
* @method init
|
68 |
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
69 |
-
* @param {string} url Absolute URL to where the plugin is located.
|
70 |
-
*/
|
71 |
-
init : function(ed, url) {
|
72 |
-
var self = this, settings = ed.settings;
|
73 |
-
|
74 |
-
self.editor = ed;
|
75 |
-
|
76 |
-
// Parses the specified time string into a milisecond number 10m, 10s etc.
|
77 |
-
function parseTime(time) {
|
78 |
-
var multipels = {
|
79 |
-
s : 1000,
|
80 |
-
m : 60000
|
81 |
-
};
|
82 |
-
|
83 |
-
time = /^(\d+)([ms]?)$/.exec('' + time);
|
84 |
-
|
85 |
-
return (time[2] ? multipels[time[2]] : 1) * parseInt(time);
|
86 |
-
};
|
87 |
-
|
88 |
-
// Default config
|
89 |
-
tinymce.each({
|
90 |
-
ask_before_unload : TRUE,
|
91 |
-
interval : '30s',
|
92 |
-
retention : '20m',
|
93 |
-
minlength : 50
|
94 |
-
}, function(value, key) {
|
95 |
-
key = PLUGIN_NAME + '_' + key;
|
96 |
-
|
97 |
-
if (settings[key] === undefined)
|
98 |
-
settings[key] = value;
|
99 |
-
});
|
100 |
-
|
101 |
-
// Parse times
|
102 |
-
settings.autosave_interval = parseTime(settings.autosave_interval);
|
103 |
-
settings.autosave_retention = parseTime(settings.autosave_retention);
|
104 |
-
|
105 |
-
// Register restore button
|
106 |
-
ed.addButton(RESTORE_DRAFT, {
|
107 |
-
title : PLUGIN_NAME + ".restore_content",
|
108 |
-
onclick : function() {
|
109 |
-
if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) {
|
110 |
-
// Show confirm dialog if the editor isn't empty
|
111 |
-
ed.windowManager.confirm(
|
112 |
-
PLUGIN_NAME + ".warning_message",
|
113 |
-
function(ok) {
|
114 |
-
if (ok)
|
115 |
-
self.restoreDraft();
|
116 |
-
}
|
117 |
-
);
|
118 |
-
} else
|
119 |
-
self.restoreDraft();
|
120 |
-
}
|
121 |
-
});
|
122 |
-
|
123 |
-
// Enable/disable restoredraft button depending on if there is a draft stored or not
|
124 |
-
ed.onNodeChange.add(function() {
|
125 |
-
var controlManager = ed.controlManager;
|
126 |
-
|
127 |
-
if (controlManager.get(RESTORE_DRAFT))
|
128 |
-
controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft());
|
129 |
-
});
|
130 |
-
|
131 |
-
ed.onInit.add(function() {
|
132 |
-
// Check if the user added the restore button, then setup auto storage logic
|
133 |
-
if (ed.controlManager.get(RESTORE_DRAFT)) {
|
134 |
-
// Setup storage engine
|
135 |
-
self.setupStorage(ed);
|
136 |
-
|
137 |
-
// Auto save contents each interval time
|
138 |
-
setInterval(function() {
|
139 |
-
if (!ed.removed) {
|
140 |
-
self.storeDraft();
|
141 |
-
ed.nodeChanged();
|
142 |
-
}
|
143 |
-
}, settings.autosave_interval);
|
144 |
-
}
|
145 |
-
});
|
146 |
-
|
147 |
-
/**
|
148 |
-
* This event gets fired when a draft is stored to local storage.
|
149 |
-
*
|
150 |
-
* @event onStoreDraft
|
151 |
-
* @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
|
152 |
-
* @param {Object} draft Draft object containing the HTML contents of the editor.
|
153 |
-
*/
|
154 |
-
self.onStoreDraft = new Dispatcher(self);
|
155 |
-
|
156 |
-
/**
|
157 |
-
* This event gets fired when a draft is restored from local storage.
|
158 |
-
*
|
159 |
-
* @event onStoreDraft
|
160 |
-
* @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
|
161 |
-
* @param {Object} draft Draft object containing the HTML contents of the editor.
|
162 |
-
*/
|
163 |
-
self.onRestoreDraft = new Dispatcher(self);
|
164 |
-
|
165 |
-
/**
|
166 |
-
* This event gets fired when a draft removed/expired.
|
167 |
-
*
|
168 |
-
* @event onRemoveDraft
|
169 |
-
* @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
|
170 |
-
* @param {Object} draft Draft object containing the HTML contents of the editor.
|
171 |
-
*/
|
172 |
-
self.onRemoveDraft = new Dispatcher(self);
|
173 |
-
|
174 |
-
// Add ask before unload dialog only add one unload handler
|
175 |
-
if (!unloadHandlerAdded) {
|
176 |
-
window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler;
|
177 |
-
unloadHandlerAdded = TRUE;
|
178 |
-
}
|
179 |
-
},
|
180 |
-
|
181 |
-
/**
|
182 |
-
* Returns information about the plugin as a name/value array.
|
183 |
-
* The current keys are longname, author, authorurl, infourl and version.
|
184 |
-
*
|
185 |
-
* @method getInfo
|
186 |
-
* @return {Object} Name/value array containing information about the plugin.
|
187 |
-
*/
|
188 |
-
getInfo : function() {
|
189 |
-
return {
|
190 |
-
longname : 'Auto save',
|
191 |
-
author : 'Moxiecode Systems AB',
|
192 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
193 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',
|
194 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
195 |
-
};
|
196 |
-
},
|
197 |
-
|
198 |
-
/**
|
199 |
-
* Returns an expiration date UTC string.
|
200 |
-
*
|
201 |
-
* @method getExpDate
|
202 |
-
* @return {String} Expiration date UTC string.
|
203 |
-
*/
|
204 |
-
getExpDate : function() {
|
205 |
-
return new Date(
|
206 |
-
new Date().getTime() + this.editor.settings.autosave_retention
|
207 |
-
).toUTCString();
|
208 |
-
},
|
209 |
-
|
210 |
-
/**
|
211 |
-
* This method will setup the storage engine. If the browser has support for it.
|
212 |
-
*
|
213 |
-
* @method setupStorage
|
214 |
-
*/
|
215 |
-
setupStorage : function(ed) {
|
216 |
-
var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK";
|
217 |
-
|
218 |
-
self.key = PLUGIN_NAME + ed.id;
|
219 |
-
|
220 |
-
// Loop though each storage engine type until we find one that works
|
221 |
-
tinymce.each([
|
222 |
-
function() {
|
223 |
-
// Try HTML5 Local Storage
|
224 |
-
if (localStorage) {
|
225 |
-
localStorage.setItem(testKey, testVal);
|
226 |
-
|
227 |
-
if (localStorage.getItem(testKey) === testVal) {
|
228 |
-
localStorage.removeItem(testKey);
|
229 |
-
|
230 |
-
return localStorage;
|
231 |
-
}
|
232 |
-
}
|
233 |
-
},
|
234 |
-
|
235 |
-
function() {
|
236 |
-
// Try HTML5 Session Storage
|
237 |
-
if (sessionStorage) {
|
238 |
-
sessionStorage.setItem(testKey, testVal);
|
239 |
-
|
240 |
-
if (sessionStorage.getItem(testKey) === testVal) {
|
241 |
-
sessionStorage.removeItem(testKey);
|
242 |
-
|
243 |
-
return sessionStorage;
|
244 |
-
}
|
245 |
-
}
|
246 |
-
},
|
247 |
-
|
248 |
-
function() {
|
249 |
-
// Try IE userData
|
250 |
-
if (tinymce.isIE) {
|
251 |
-
ed.getElement().style.behavior = "url('#default#userData')";
|
252 |
-
|
253 |
-
// Fake localStorage on old IE
|
254 |
-
return {
|
255 |
-
autoExpires : TRUE,
|
256 |
-
|
257 |
-
setItem : function(key, value) {
|
258 |
-
var userDataElement = ed.getElement();
|
259 |
-
|
260 |
-
userDataElement.setAttribute(key, value);
|
261 |
-
userDataElement.expires = self.getExpDate();
|
262 |
-
|
263 |
-
try {
|
264 |
-
userDataElement.save("TinyMCE");
|
265 |
-
} catch (e) {
|
266 |
-
// Ignore, saving might fail if "Userdata Persistence" is disabled in IE
|
267 |
-
}
|
268 |
-
},
|
269 |
-
|
270 |
-
getItem : function(key) {
|
271 |
-
var userDataElement = ed.getElement();
|
272 |
-
|
273 |
-
try {
|
274 |
-
userDataElement.load("TinyMCE");
|
275 |
-
return userDataElement.getAttribute(key);
|
276 |
-
} catch (e) {
|
277 |
-
// Ignore, loading might fail if "Userdata Persistence" is disabled in IE
|
278 |
-
return null;
|
279 |
-
}
|
280 |
-
},
|
281 |
-
|
282 |
-
removeItem : function(key) {
|
283 |
-
ed.getElement().removeAttribute(key);
|
284 |
-
}
|
285 |
-
};
|
286 |
-
}
|
287 |
-
},
|
288 |
-
], function(setup) {
|
289 |
-
// Try executing each function to find a suitable storage engine
|
290 |
-
try {
|
291 |
-
self.storage = setup();
|
292 |
-
|
293 |
-
if (self.storage)
|
294 |
-
return false;
|
295 |
-
} catch (e) {
|
296 |
-
// Ignore
|
297 |
-
}
|
298 |
-
});
|
299 |
-
},
|
300 |
-
|
301 |
-
/**
|
302 |
-
* This method will store the current contents in the the storage engine.
|
303 |
-
*
|
304 |
-
* @method storeDraft
|
305 |
-
*/
|
306 |
-
storeDraft : function() {
|
307 |
-
var self = this, storage = self.storage, editor = self.editor, expires, content;
|
308 |
-
|
309 |
-
// Is the contents dirty
|
310 |
-
if (storage) {
|
311 |
-
// If there is no existing key and the contents hasn't been changed since
|
312 |
-
// it's original value then there is no point in saving a draft
|
313 |
-
if (!storage.getItem(self.key) && !editor.isDirty())
|
314 |
-
return;
|
315 |
-
|
316 |
-
// Store contents if the contents if longer than the minlength of characters
|
317 |
-
content = editor.getContent({draft: true});
|
318 |
-
if (content.length > editor.settings.autosave_minlength) {
|
319 |
-
expires = self.getExpDate();
|
320 |
-
|
321 |
-
// Store expiration date if needed IE userData has auto expire built in
|
322 |
-
if (!self.storage.autoExpires)
|
323 |
-
self.storage.setItem(self.key + "_expires", expires);
|
324 |
-
|
325 |
-
self.storage.setItem(self.key, content);
|
326 |
-
self.onStoreDraft.dispatch(self, {
|
327 |
-
expires : expires,
|
328 |
-
content : content
|
329 |
-
});
|
330 |
-
}
|
331 |
-
}
|
332 |
-
},
|
333 |
-
|
334 |
-
/**
|
335 |
-
* This method will restore the contents from the storage engine back to the editor.
|
336 |
-
*
|
337 |
-
* @method restoreDraft
|
338 |
-
*/
|
339 |
-
restoreDraft : function() {
|
340 |
-
var self = this, storage = self.storage, content;
|
341 |
-
|
342 |
-
if (storage) {
|
343 |
-
content = storage.getItem(self.key);
|
344 |
-
|
345 |
-
if (content) {
|
346 |
-
self.editor.setContent(content);
|
347 |
-
self.onRestoreDraft.dispatch(self, {
|
348 |
-
content : content
|
349 |
-
});
|
350 |
-
}
|
351 |
-
}
|
352 |
-
},
|
353 |
-
|
354 |
-
/**
|
355 |
-
* This method will return true/false if there is a local storage draft available.
|
356 |
-
*
|
357 |
-
* @method hasDraft
|
358 |
-
* @return {boolean} true/false state if there is a local draft.
|
359 |
-
*/
|
360 |
-
hasDraft : function() {
|
361 |
-
var self = this, storage = self.storage, expDate, exists;
|
362 |
-
|
363 |
-
if (storage) {
|
364 |
-
// Does the item exist at all
|
365 |
-
exists = !!storage.getItem(self.key);
|
366 |
-
if (exists) {
|
367 |
-
// Storage needs autoexpire
|
368 |
-
if (!self.storage.autoExpires) {
|
369 |
-
expDate = new Date(storage.getItem(self.key + "_expires"));
|
370 |
-
|
371 |
-
// Contents hasn't expired
|
372 |
-
if (new Date().getTime() < expDate.getTime())
|
373 |
-
return TRUE;
|
374 |
-
|
375 |
-
// Remove it if it has
|
376 |
-
self.removeDraft();
|
377 |
-
} else
|
378 |
-
return TRUE;
|
379 |
-
}
|
380 |
-
}
|
381 |
-
|
382 |
-
return false;
|
383 |
-
},
|
384 |
-
|
385 |
-
/**
|
386 |
-
* Removes the currently stored draft.
|
387 |
-
*
|
388 |
-
* @method removeDraft
|
389 |
-
*/
|
390 |
-
removeDraft : function() {
|
391 |
-
var self = this, storage = self.storage, key = self.key, content;
|
392 |
-
|
393 |
-
if (storage) {
|
394 |
-
// Get current contents and remove the existing draft
|
395 |
-
content = storage.getItem(key);
|
396 |
-
storage.removeItem(key);
|
397 |
-
storage.removeItem(key + "_expires");
|
398 |
-
|
399 |
-
// Dispatch remove event if we had any contents
|
400 |
-
if (content) {
|
401 |
-
self.onRemoveDraft.dispatch(self, {
|
402 |
-
content : content
|
403 |
-
});
|
404 |
-
}
|
405 |
-
}
|
406 |
-
},
|
407 |
-
|
408 |
-
"static" : {
|
409 |
-
// Internal unload handler will be called before the page is unloaded
|
410 |
-
_beforeUnloadHandler : function(e) {
|
411 |
-
var msg;
|
412 |
-
|
413 |
-
tinymce.each(tinyMCE.editors, function(ed) {
|
414 |
-
// Store a draft for each editor instance
|
415 |
-
if (ed.plugins.autosave)
|
416 |
-
ed.plugins.autosave.storeDraft();
|
417 |
-
|
418 |
-
// Never ask in fullscreen mode
|
419 |
-
if (ed.getParam("fullscreen_is_enabled"))
|
420 |
-
return;
|
421 |
-
|
422 |
-
// Setup a return message if the editor is dirty
|
423 |
-
if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload"))
|
424 |
-
msg = ed.getLang("autosave.unload_msg");
|
425 |
-
});
|
426 |
-
|
427 |
-
return msg;
|
428 |
-
}
|
429 |
-
}
|
430 |
-
});
|
431 |
-
|
432 |
-
tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave);
|
433 |
-
})(tinymce);
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*
|
10 |
+
* Adds auto-save capability to the TinyMCE text editor to rescue content
|
11 |
+
* inadvertently lost. This plugin was originally developed by Speednet
|
12 |
+
* and that project can be found here: http://code.google.com/p/tinyautosave/
|
13 |
+
*
|
14 |
+
* TECHNOLOGY DISCUSSION:
|
15 |
+
*
|
16 |
+
* The plugin attempts to use the most advanced features available in the current browser to save
|
17 |
+
* as much content as possible. There are a total of four different methods used to autosave the
|
18 |
+
* content. In order of preference, they are:
|
19 |
+
*
|
20 |
+
* 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain
|
21 |
+
* on the client computer. Data stored in the localStorage area has no expiration date, so we must
|
22 |
+
* manage expiring the data ourselves. localStorage is fully supported by IE8, and it is supposed
|
23 |
+
* to be working in Firefox 3 and Safari 3.2, but in reality is is flaky in those browsers. As
|
24 |
+
* HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7,
|
25 |
+
* localStorage is stored in the following folder:
|
26 |
+
* C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder]
|
27 |
+
*
|
28 |
+
* 2. sessionStorage - A new feature of HTML 5, sessionStorage works similarly to localStorage,
|
29 |
+
* except it is designed to expire after a certain amount of time. Because the specification
|
30 |
+
* around expiration date/time is very loosely-described, it is preferrable to use locaStorage and
|
31 |
+
* manage the expiration ourselves. sessionStorage has similar storage characteristics to
|
32 |
+
* localStorage, although it seems to have better support by Firefox 3 at the moment. (That will
|
33 |
+
* certainly change as Firefox continues getting better at HTML 5 adoption.)
|
34 |
+
*
|
35 |
+
* 3. UserData - A very under-exploited feature of Microsoft Internet Explorer, UserData is a
|
36 |
+
* way to store up to 128K of data per "document", or up to 1MB of data per domain, on the client
|
37 |
+
* computer. The feature is available for IE 5+, which makes it available for every version of IE
|
38 |
+
* supported by TinyMCE. The content is persistent across browser restarts and expires on the
|
39 |
+
* date/time specified, just like a cookie. However, the data is not cleared when the user clears
|
40 |
+
* cookies on the browser, which makes it well-suited for rescuing autosaved content. UserData,
|
41 |
+
* like other Microsoft IE browser technologies, is implemented as a behavior attached to a
|
42 |
+
* specific DOM object, so in this case we attach the behavior to the same DOM element that the
|
43 |
+
* TinyMCE editor instance is attached to.
|
44 |
+
*/
|
45 |
+
|
46 |
+
(function(tinymce) {
|
47 |
+
// Setup constants to help the compressor to reduce script size
|
48 |
+
var PLUGIN_NAME = 'autosave',
|
49 |
+
RESTORE_DRAFT = 'restoredraft',
|
50 |
+
TRUE = true,
|
51 |
+
undefined,
|
52 |
+
unloadHandlerAdded,
|
53 |
+
Dispatcher = tinymce.util.Dispatcher;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* This plugin adds auto-save capability to the TinyMCE text editor to rescue content
|
57 |
+
* inadvertently lost. By using localStorage.
|
58 |
+
*
|
59 |
+
* @class tinymce.plugins.AutoSave
|
60 |
+
*/
|
61 |
+
tinymce.create('tinymce.plugins.AutoSave', {
|
62 |
+
/**
|
63 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
64 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
65 |
+
* of the editor instance to intercept that event.
|
66 |
+
*
|
67 |
+
* @method init
|
68 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
69 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
70 |
+
*/
|
71 |
+
init : function(ed, url) {
|
72 |
+
var self = this, settings = ed.settings;
|
73 |
+
|
74 |
+
self.editor = ed;
|
75 |
+
|
76 |
+
// Parses the specified time string into a milisecond number 10m, 10s etc.
|
77 |
+
function parseTime(time) {
|
78 |
+
var multipels = {
|
79 |
+
s : 1000,
|
80 |
+
m : 60000
|
81 |
+
};
|
82 |
+
|
83 |
+
time = /^(\d+)([ms]?)$/.exec('' + time);
|
84 |
+
|
85 |
+
return (time[2] ? multipels[time[2]] : 1) * parseInt(time);
|
86 |
+
};
|
87 |
+
|
88 |
+
// Default config
|
89 |
+
tinymce.each({
|
90 |
+
ask_before_unload : TRUE,
|
91 |
+
interval : '30s',
|
92 |
+
retention : '20m',
|
93 |
+
minlength : 50
|
94 |
+
}, function(value, key) {
|
95 |
+
key = PLUGIN_NAME + '_' + key;
|
96 |
+
|
97 |
+
if (settings[key] === undefined)
|
98 |
+
settings[key] = value;
|
99 |
+
});
|
100 |
+
|
101 |
+
// Parse times
|
102 |
+
settings.autosave_interval = parseTime(settings.autosave_interval);
|
103 |
+
settings.autosave_retention = parseTime(settings.autosave_retention);
|
104 |
+
|
105 |
+
// Register restore button
|
106 |
+
ed.addButton(RESTORE_DRAFT, {
|
107 |
+
title : PLUGIN_NAME + ".restore_content",
|
108 |
+
onclick : function() {
|
109 |
+
if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) {
|
110 |
+
// Show confirm dialog if the editor isn't empty
|
111 |
+
ed.windowManager.confirm(
|
112 |
+
PLUGIN_NAME + ".warning_message",
|
113 |
+
function(ok) {
|
114 |
+
if (ok)
|
115 |
+
self.restoreDraft();
|
116 |
+
}
|
117 |
+
);
|
118 |
+
} else
|
119 |
+
self.restoreDraft();
|
120 |
+
}
|
121 |
+
});
|
122 |
+
|
123 |
+
// Enable/disable restoredraft button depending on if there is a draft stored or not
|
124 |
+
ed.onNodeChange.add(function() {
|
125 |
+
var controlManager = ed.controlManager;
|
126 |
+
|
127 |
+
if (controlManager.get(RESTORE_DRAFT))
|
128 |
+
controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft());
|
129 |
+
});
|
130 |
+
|
131 |
+
ed.onInit.add(function() {
|
132 |
+
// Check if the user added the restore button, then setup auto storage logic
|
133 |
+
if (ed.controlManager.get(RESTORE_DRAFT)) {
|
134 |
+
// Setup storage engine
|
135 |
+
self.setupStorage(ed);
|
136 |
+
|
137 |
+
// Auto save contents each interval time
|
138 |
+
setInterval(function() {
|
139 |
+
if (!ed.removed) {
|
140 |
+
self.storeDraft();
|
141 |
+
ed.nodeChanged();
|
142 |
+
}
|
143 |
+
}, settings.autosave_interval);
|
144 |
+
}
|
145 |
+
});
|
146 |
+
|
147 |
+
/**
|
148 |
+
* This event gets fired when a draft is stored to local storage.
|
149 |
+
*
|
150 |
+
* @event onStoreDraft
|
151 |
+
* @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
|
152 |
+
* @param {Object} draft Draft object containing the HTML contents of the editor.
|
153 |
+
*/
|
154 |
+
self.onStoreDraft = new Dispatcher(self);
|
155 |
+
|
156 |
+
/**
|
157 |
+
* This event gets fired when a draft is restored from local storage.
|
158 |
+
*
|
159 |
+
* @event onStoreDraft
|
160 |
+
* @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
|
161 |
+
* @param {Object} draft Draft object containing the HTML contents of the editor.
|
162 |
+
*/
|
163 |
+
self.onRestoreDraft = new Dispatcher(self);
|
164 |
+
|
165 |
+
/**
|
166 |
+
* This event gets fired when a draft removed/expired.
|
167 |
+
*
|
168 |
+
* @event onRemoveDraft
|
169 |
+
* @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
|
170 |
+
* @param {Object} draft Draft object containing the HTML contents of the editor.
|
171 |
+
*/
|
172 |
+
self.onRemoveDraft = new Dispatcher(self);
|
173 |
+
|
174 |
+
// Add ask before unload dialog only add one unload handler
|
175 |
+
if (!unloadHandlerAdded) {
|
176 |
+
window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler;
|
177 |
+
unloadHandlerAdded = TRUE;
|
178 |
+
}
|
179 |
+
},
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Returns information about the plugin as a name/value array.
|
183 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
184 |
+
*
|
185 |
+
* @method getInfo
|
186 |
+
* @return {Object} Name/value array containing information about the plugin.
|
187 |
+
*/
|
188 |
+
getInfo : function() {
|
189 |
+
return {
|
190 |
+
longname : 'Auto save',
|
191 |
+
author : 'Moxiecode Systems AB',
|
192 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
193 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',
|
194 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
195 |
+
};
|
196 |
+
},
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Returns an expiration date UTC string.
|
200 |
+
*
|
201 |
+
* @method getExpDate
|
202 |
+
* @return {String} Expiration date UTC string.
|
203 |
+
*/
|
204 |
+
getExpDate : function() {
|
205 |
+
return new Date(
|
206 |
+
new Date().getTime() + this.editor.settings.autosave_retention
|
207 |
+
).toUTCString();
|
208 |
+
},
|
209 |
+
|
210 |
+
/**
|
211 |
+
* This method will setup the storage engine. If the browser has support for it.
|
212 |
+
*
|
213 |
+
* @method setupStorage
|
214 |
+
*/
|
215 |
+
setupStorage : function(ed) {
|
216 |
+
var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK";
|
217 |
+
|
218 |
+
self.key = PLUGIN_NAME + ed.id;
|
219 |
+
|
220 |
+
// Loop though each storage engine type until we find one that works
|
221 |
+
tinymce.each([
|
222 |
+
function() {
|
223 |
+
// Try HTML5 Local Storage
|
224 |
+
if (localStorage) {
|
225 |
+
localStorage.setItem(testKey, testVal);
|
226 |
+
|
227 |
+
if (localStorage.getItem(testKey) === testVal) {
|
228 |
+
localStorage.removeItem(testKey);
|
229 |
+
|
230 |
+
return localStorage;
|
231 |
+
}
|
232 |
+
}
|
233 |
+
},
|
234 |
+
|
235 |
+
function() {
|
236 |
+
// Try HTML5 Session Storage
|
237 |
+
if (sessionStorage) {
|
238 |
+
sessionStorage.setItem(testKey, testVal);
|
239 |
+
|
240 |
+
if (sessionStorage.getItem(testKey) === testVal) {
|
241 |
+
sessionStorage.removeItem(testKey);
|
242 |
+
|
243 |
+
return sessionStorage;
|
244 |
+
}
|
245 |
+
}
|
246 |
+
},
|
247 |
+
|
248 |
+
function() {
|
249 |
+
// Try IE userData
|
250 |
+
if (tinymce.isIE) {
|
251 |
+
ed.getElement().style.behavior = "url('#default#userData')";
|
252 |
+
|
253 |
+
// Fake localStorage on old IE
|
254 |
+
return {
|
255 |
+
autoExpires : TRUE,
|
256 |
+
|
257 |
+
setItem : function(key, value) {
|
258 |
+
var userDataElement = ed.getElement();
|
259 |
+
|
260 |
+
userDataElement.setAttribute(key, value);
|
261 |
+
userDataElement.expires = self.getExpDate();
|
262 |
+
|
263 |
+
try {
|
264 |
+
userDataElement.save("TinyMCE");
|
265 |
+
} catch (e) {
|
266 |
+
// Ignore, saving might fail if "Userdata Persistence" is disabled in IE
|
267 |
+
}
|
268 |
+
},
|
269 |
+
|
270 |
+
getItem : function(key) {
|
271 |
+
var userDataElement = ed.getElement();
|
272 |
+
|
273 |
+
try {
|
274 |
+
userDataElement.load("TinyMCE");
|
275 |
+
return userDataElement.getAttribute(key);
|
276 |
+
} catch (e) {
|
277 |
+
// Ignore, loading might fail if "Userdata Persistence" is disabled in IE
|
278 |
+
return null;
|
279 |
+
}
|
280 |
+
},
|
281 |
+
|
282 |
+
removeItem : function(key) {
|
283 |
+
ed.getElement().removeAttribute(key);
|
284 |
+
}
|
285 |
+
};
|
286 |
+
}
|
287 |
+
},
|
288 |
+
], function(setup) {
|
289 |
+
// Try executing each function to find a suitable storage engine
|
290 |
+
try {
|
291 |
+
self.storage = setup();
|
292 |
+
|
293 |
+
if (self.storage)
|
294 |
+
return false;
|
295 |
+
} catch (e) {
|
296 |
+
// Ignore
|
297 |
+
}
|
298 |
+
});
|
299 |
+
},
|
300 |
+
|
301 |
+
/**
|
302 |
+
* This method will store the current contents in the the storage engine.
|
303 |
+
*
|
304 |
+
* @method storeDraft
|
305 |
+
*/
|
306 |
+
storeDraft : function() {
|
307 |
+
var self = this, storage = self.storage, editor = self.editor, expires, content;
|
308 |
+
|
309 |
+
// Is the contents dirty
|
310 |
+
if (storage) {
|
311 |
+
// If there is no existing key and the contents hasn't been changed since
|
312 |
+
// it's original value then there is no point in saving a draft
|
313 |
+
if (!storage.getItem(self.key) && !editor.isDirty())
|
314 |
+
return;
|
315 |
+
|
316 |
+
// Store contents if the contents if longer than the minlength of characters
|
317 |
+
content = editor.getContent({draft: true});
|
318 |
+
if (content.length > editor.settings.autosave_minlength) {
|
319 |
+
expires = self.getExpDate();
|
320 |
+
|
321 |
+
// Store expiration date if needed IE userData has auto expire built in
|
322 |
+
if (!self.storage.autoExpires)
|
323 |
+
self.storage.setItem(self.key + "_expires", expires);
|
324 |
+
|
325 |
+
self.storage.setItem(self.key, content);
|
326 |
+
self.onStoreDraft.dispatch(self, {
|
327 |
+
expires : expires,
|
328 |
+
content : content
|
329 |
+
});
|
330 |
+
}
|
331 |
+
}
|
332 |
+
},
|
333 |
+
|
334 |
+
/**
|
335 |
+
* This method will restore the contents from the storage engine back to the editor.
|
336 |
+
*
|
337 |
+
* @method restoreDraft
|
338 |
+
*/
|
339 |
+
restoreDraft : function() {
|
340 |
+
var self = this, storage = self.storage, content;
|
341 |
+
|
342 |
+
if (storage) {
|
343 |
+
content = storage.getItem(self.key);
|
344 |
+
|
345 |
+
if (content) {
|
346 |
+
self.editor.setContent(content);
|
347 |
+
self.onRestoreDraft.dispatch(self, {
|
348 |
+
content : content
|
349 |
+
});
|
350 |
+
}
|
351 |
+
}
|
352 |
+
},
|
353 |
+
|
354 |
+
/**
|
355 |
+
* This method will return true/false if there is a local storage draft available.
|
356 |
+
*
|
357 |
+
* @method hasDraft
|
358 |
+
* @return {boolean} true/false state if there is a local draft.
|
359 |
+
*/
|
360 |
+
hasDraft : function() {
|
361 |
+
var self = this, storage = self.storage, expDate, exists;
|
362 |
+
|
363 |
+
if (storage) {
|
364 |
+
// Does the item exist at all
|
365 |
+
exists = !!storage.getItem(self.key);
|
366 |
+
if (exists) {
|
367 |
+
// Storage needs autoexpire
|
368 |
+
if (!self.storage.autoExpires) {
|
369 |
+
expDate = new Date(storage.getItem(self.key + "_expires"));
|
370 |
+
|
371 |
+
// Contents hasn't expired
|
372 |
+
if (new Date().getTime() < expDate.getTime())
|
373 |
+
return TRUE;
|
374 |
+
|
375 |
+
// Remove it if it has
|
376 |
+
self.removeDraft();
|
377 |
+
} else
|
378 |
+
return TRUE;
|
379 |
+
}
|
380 |
+
}
|
381 |
+
|
382 |
+
return false;
|
383 |
+
},
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Removes the currently stored draft.
|
387 |
+
*
|
388 |
+
* @method removeDraft
|
389 |
+
*/
|
390 |
+
removeDraft : function() {
|
391 |
+
var self = this, storage = self.storage, key = self.key, content;
|
392 |
+
|
393 |
+
if (storage) {
|
394 |
+
// Get current contents and remove the existing draft
|
395 |
+
content = storage.getItem(key);
|
396 |
+
storage.removeItem(key);
|
397 |
+
storage.removeItem(key + "_expires");
|
398 |
+
|
399 |
+
// Dispatch remove event if we had any contents
|
400 |
+
if (content) {
|
401 |
+
self.onRemoveDraft.dispatch(self, {
|
402 |
+
content : content
|
403 |
+
});
|
404 |
+
}
|
405 |
+
}
|
406 |
+
},
|
407 |
+
|
408 |
+
"static" : {
|
409 |
+
// Internal unload handler will be called before the page is unloaded
|
410 |
+
_beforeUnloadHandler : function(e) {
|
411 |
+
var msg;
|
412 |
+
|
413 |
+
tinymce.each(tinyMCE.editors, function(ed) {
|
414 |
+
// Store a draft for each editor instance
|
415 |
+
if (ed.plugins.autosave)
|
416 |
+
ed.plugins.autosave.storeDraft();
|
417 |
+
|
418 |
+
// Never ask in fullscreen mode
|
419 |
+
if (ed.getParam("fullscreen_is_enabled"))
|
420 |
+
return;
|
421 |
+
|
422 |
+
// Setup a return message if the editor is dirty
|
423 |
+
if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload"))
|
424 |
+
msg = ed.getLang("autosave.unload_msg");
|
425 |
+
});
|
426 |
+
|
427 |
+
return msg;
|
428 |
+
}
|
429 |
+
}
|
430 |
+
});
|
431 |
+
|
432 |
+
tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave);
|
433 |
+
})(tinymce);
|
js/libraries/tiny_mce/plugins/autosave/langs/en.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
tinyMCE.addI18n('en.autosave',{
|
2 |
-
restore_content: "Restore auto-saved content",
|
3 |
-
warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
|
4 |
});
|
1 |
+
tinyMCE.addI18n('en.autosave',{
|
2 |
+
restore_content: "Restore auto-saved content",
|
3 |
+
warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
|
4 |
});
|
js/libraries/tiny_mce/plugins/bbcode/editor_plugin_src.js
CHANGED
@@ -1,120 +1,120 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
|
15 |
-
|
16 |
-
ed.onBeforeSetContent.add(function(ed, o) {
|
17 |
-
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
18 |
-
});
|
19 |
-
|
20 |
-
ed.onPostProcess.add(function(ed, o) {
|
21 |
-
if (o.set)
|
22 |
-
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
23 |
-
|
24 |
-
if (o.get)
|
25 |
-
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
26 |
-
});
|
27 |
-
},
|
28 |
-
|
29 |
-
getInfo : function() {
|
30 |
-
return {
|
31 |
-
longname : 'BBCode Plugin',
|
32 |
-
author : 'Moxiecode Systems AB',
|
33 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
34 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
35 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
36 |
-
};
|
37 |
-
},
|
38 |
-
|
39 |
-
// Private methods
|
40 |
-
|
41 |
-
// HTML -> BBCode in PunBB dialect
|
42 |
-
_punbb_html2bbcode : function(s) {
|
43 |
-
s = tinymce.trim(s);
|
44 |
-
|
45 |
-
function rep(re, str) {
|
46 |
-
s = s.replace(re, str);
|
47 |
-
};
|
48 |
-
|
49 |
-
// example: <strong> to [b]
|
50 |
-
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
51 |
-
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
52 |
-
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
53 |
-
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
54 |
-
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
55 |
-
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
56 |
-
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
57 |
-
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
58 |
-
rep(/<font>(.*?)<\/font>/gi,"$1");
|
59 |
-
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
|
60 |
-
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
|
61 |
-
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
|
62 |
-
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
|
63 |
-
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
|
64 |
-
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
|
65 |
-
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
|
66 |
-
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
|
67 |
-
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
|
68 |
-
rep(/<\/(strong|b)>/gi,"[/b]");
|
69 |
-
rep(/<(strong|b)>/gi,"[b]");
|
70 |
-
rep(/<\/(em|i)>/gi,"[/i]");
|
71 |
-
rep(/<(em|i)>/gi,"[i]");
|
72 |
-
rep(/<\/u>/gi,"[/u]");
|
73 |
-
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
74 |
-
rep(/<u>/gi,"[u]");
|
75 |
-
rep(/<blockquote[^>]*>/gi,"[quote]");
|
76 |
-
rep(/<\/blockquote>/gi,"[/quote]");
|
77 |
-
rep(/<br \/>/gi,"\n");
|
78 |
-
rep(/<br\/>/gi,"\n");
|
79 |
-
rep(/<br>/gi,"\n");
|
80 |
-
rep(/<p>/gi,"");
|
81 |
-
rep(/<\/p>/gi,"\n");
|
82 |
-
rep(/ |\u00a0/gi," ");
|
83 |
-
rep(/"/gi,"\"");
|
84 |
-
rep(/</gi,"<");
|
85 |
-
rep(/>/gi,">");
|
86 |
-
rep(/&/gi,"&");
|
87 |
-
|
88 |
-
return s;
|
89 |
-
},
|
90 |
-
|
91 |
-
// BBCode -> HTML from PunBB dialect
|
92 |
-
_punbb_bbcode2html : function(s) {
|
93 |
-
s = tinymce.trim(s);
|
94 |
-
|
95 |
-
function rep(re, str) {
|
96 |
-
s = s.replace(re, str);
|
97 |
-
};
|
98 |
-
|
99 |
-
// example: [b] to <strong>
|
100 |
-
rep(/\n/gi,"<br />");
|
101 |
-
rep(/\[b\]/gi,"<strong>");
|
102 |
-
rep(/\[\/b\]/gi,"</strong>");
|
103 |
-
rep(/\[i\]/gi,"<em>");
|
104 |
-
rep(/\[\/i\]/gi,"</em>");
|
105 |
-
rep(/\[u\]/gi,"<u>");
|
106 |
-
rep(/\[\/u\]/gi,"</u>");
|
107 |
-
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
|
108 |
-
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
109 |
-
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
110 |
-
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
|
111 |
-
rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> ");
|
112 |
-
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> ");
|
113 |
-
|
114 |
-
return s;
|
115 |
-
}
|
116 |
-
});
|
117 |
-
|
118 |
-
// Register plugin
|
119 |
-
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
120 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
|
15 |
+
|
16 |
+
ed.onBeforeSetContent.add(function(ed, o) {
|
17 |
+
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
18 |
+
});
|
19 |
+
|
20 |
+
ed.onPostProcess.add(function(ed, o) {
|
21 |
+
if (o.set)
|
22 |
+
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
23 |
+
|
24 |
+
if (o.get)
|
25 |
+
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
26 |
+
});
|
27 |
+
},
|
28 |
+
|
29 |
+
getInfo : function() {
|
30 |
+
return {
|
31 |
+
longname : 'BBCode Plugin',
|
32 |
+
author : 'Moxiecode Systems AB',
|
33 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
34 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
35 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
36 |
+
};
|
37 |
+
},
|
38 |
+
|
39 |
+
// Private methods
|
40 |
+
|
41 |
+
// HTML -> BBCode in PunBB dialect
|
42 |
+
_punbb_html2bbcode : function(s) {
|
43 |
+
s = tinymce.trim(s);
|
44 |
+
|
45 |
+
function rep(re, str) {
|
46 |
+
s = s.replace(re, str);
|
47 |
+
};
|
48 |
+
|
49 |
+
// example: <strong> to [b]
|
50 |
+
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
51 |
+
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
52 |
+
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
53 |
+
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
54 |
+
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
55 |
+
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
56 |
+
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
57 |
+
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
58 |
+
rep(/<font>(.*?)<\/font>/gi,"$1");
|
59 |
+
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
|
60 |
+
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
|
61 |
+
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
|
62 |
+
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
|
63 |
+
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
|
64 |
+
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
|
65 |
+
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
|
66 |
+
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
|
67 |
+
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
|
68 |
+
rep(/<\/(strong|b)>/gi,"[/b]");
|
69 |
+
rep(/<(strong|b)>/gi,"[b]");
|
70 |
+
rep(/<\/(em|i)>/gi,"[/i]");
|
71 |
+
rep(/<(em|i)>/gi,"[i]");
|
72 |
+
rep(/<\/u>/gi,"[/u]");
|
73 |
+
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
74 |
+
rep(/<u>/gi,"[u]");
|
75 |
+
rep(/<blockquote[^>]*>/gi,"[quote]");
|
76 |
+
rep(/<\/blockquote>/gi,"[/quote]");
|
77 |
+
rep(/<br \/>/gi,"\n");
|
78 |
+
rep(/<br\/>/gi,"\n");
|
79 |
+
rep(/<br>/gi,"\n");
|
80 |
+
rep(/<p>/gi,"");
|
81 |
+
rep(/<\/p>/gi,"\n");
|
82 |
+
rep(/ |\u00a0/gi," ");
|
83 |
+
rep(/"/gi,"\"");
|
84 |
+
rep(/</gi,"<");
|
85 |
+
rep(/>/gi,">");
|
86 |
+
rep(/&/gi,"&");
|
87 |
+
|
88 |
+
return s;
|
89 |
+
},
|
90 |
+
|
91 |
+
// BBCode -> HTML from PunBB dialect
|
92 |
+
_punbb_bbcode2html : function(s) {
|
93 |
+
s = tinymce.trim(s);
|
94 |
+
|
95 |
+
function rep(re, str) {
|
96 |
+
s = s.replace(re, str);
|
97 |
+
};
|
98 |
+
|
99 |
+
// example: [b] to <strong>
|
100 |
+
rep(/\n/gi,"<br />");
|
101 |
+
rep(/\[b\]/gi,"<strong>");
|
102 |
+
rep(/\[\/b\]/gi,"</strong>");
|
103 |
+
rep(/\[i\]/gi,"<em>");
|
104 |
+
rep(/\[\/i\]/gi,"</em>");
|
105 |
+
rep(/\[u\]/gi,"<u>");
|
106 |
+
rep(/\[\/u\]/gi,"</u>");
|
107 |
+
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
|
108 |
+
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
109 |
+
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
110 |
+
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
|
111 |
+
rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> ");
|
112 |
+
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> ");
|
113 |
+
|
114 |
+
return s;
|
115 |
+
}
|
116 |
+
});
|
117 |
+
|
118 |
+
// Register plugin
|
119 |
+
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
120 |
})();
|
js/libraries/tiny_mce/plugins/contextmenu/editor_plugin_src.js
CHANGED
@@ -1,163 +1,163 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* This plugin a context menu to TinyMCE editor instances.
|
16 |
-
*
|
17 |
-
* @class tinymce.plugins.ContextMenu
|
18 |
-
*/
|
19 |
-
tinymce.create('tinymce.plugins.ContextMenu', {
|
20 |
-
/**
|
21 |
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
22 |
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
23 |
-
* of the editor instance to intercept that event.
|
24 |
-
*
|
25 |
-
* @method init
|
26 |
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
27 |
-
* @param {string} url Absolute URL to where the plugin is located.
|
28 |
-
*/
|
29 |
-
init : function(ed) {
|
30 |
-
var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu;
|
31 |
-
|
32 |
-
t.editor = ed;
|
33 |
-
|
34 |
-
contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* This event gets fired when the context menu is shown.
|
38 |
-
*
|
39 |
-
* @event onContextMenu
|
40 |
-
* @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event.
|
41 |
-
* @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed.
|
42 |
-
*/
|
43 |
-
t.onContextMenu = new tinymce.util.Dispatcher(this);
|
44 |
-
|
45 |
-
hideMenu = function(e) {
|
46 |
-
hide(ed, e);
|
47 |
-
};
|
48 |
-
|
49 |
-
showMenu = ed.onContextMenu.add(function(ed, e) {
|
50 |
-
// Block TinyMCE menu on ctrlKey and work around Safari issue
|
51 |
-
if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative)
|
52 |
-
return;
|
53 |
-
|
54 |
-
Event.cancel(e);
|
55 |
-
|
56 |
-
// Select the image if it's clicked. WebKit would other wise expand the selection
|
57 |
-
if (e.target.nodeName == 'IMG')
|
58 |
-
ed.selection.select(e.target);
|
59 |
-
|
60 |
-
t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);
|
61 |
-
Event.add(ed.getDoc(), 'click', hideMenu);
|
62 |
-
|
63 |
-
ed.nodeChanged();
|
64 |
-
});
|
65 |
-
|
66 |
-
ed.onRemove.add(function() {
|
67 |
-
if (t._menu)
|
68 |
-
t._menu.removeAll();
|
69 |
-
});
|
70 |
-
|
71 |
-
function hide(ed, e) {
|
72 |
-
realCtrlKey = 0;
|
73 |
-
|
74 |
-
// Since the contextmenu event moves
|
75 |
-
// the selection we need to store it away
|
76 |
-
if (e && e.button == 2) {
|
77 |
-
realCtrlKey = e.ctrlKey;
|
78 |
-
return;
|
79 |
-
}
|
80 |
-
|
81 |
-
if (t._menu) {
|
82 |
-
t._menu.removeAll();
|
83 |
-
t._menu.destroy();
|
84 |
-
Event.remove(ed.getDoc(), 'click', hideMenu);
|
85 |
-
t._menu = null;
|
86 |
-
}
|
87 |
-
};
|
88 |
-
|
89 |
-
ed.onMouseDown.add(hide);
|
90 |
-
ed.onKeyDown.add(hide);
|
91 |
-
ed.onKeyDown.add(function(ed, e) {
|
92 |
-
if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) {
|
93 |
-
Event.cancel(e);
|
94 |
-
showMenu(ed, e);
|
95 |
-
}
|
96 |
-
});
|
97 |
-
},
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Returns information about the plugin as a name/value array.
|
101 |
-
* The current keys are longname, author, authorurl, infourl and version.
|
102 |
-
*
|
103 |
-
* @method getInfo
|
104 |
-
* @return {Object} Name/value array containing information about the plugin.
|
105 |
-
*/
|
106 |
-
getInfo : function() {
|
107 |
-
return {
|
108 |
-
longname : 'Contextmenu',
|
109 |
-
author : 'Moxiecode Systems AB',
|
110 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
111 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
|
112 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
113 |
-
};
|
114 |
-
},
|
115 |
-
|
116 |
-
_getMenu : function(ed) {
|
117 |
-
var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p;
|
118 |
-
|
119 |
-
if (m) {
|
120 |
-
m.removeAll();
|
121 |
-
m.destroy();
|
122 |
-
}
|
123 |
-
|
124 |
-
p = DOM.getPos(ed.getContentAreaContainer());
|
125 |
-
|
126 |
-
m = ed.controlManager.createDropMenu('contextmenu', {
|
127 |
-
offset_x : p.x + ed.getParam('contextmenu_offset_x', 0),
|
128 |
-
offset_y : p.y + ed.getParam('contextmenu_offset_y', 0),
|
129 |
-
constrain : 1,
|
130 |
-
keyboard_focus: true
|
131 |
-
});
|
132 |
-
|
133 |
-
t._menu = m;
|
134 |
-
|
135 |
-
m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);
|
136 |
-
m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);
|
137 |
-
m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});
|
138 |
-
|
139 |
-
if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {
|
140 |
-
m.addSeparator();
|
141 |
-
m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
|
142 |
-
m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
|
143 |
-
}
|
144 |
-
|
145 |
-
m.addSeparator();
|
146 |
-
m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
|
147 |
-
|
148 |
-
m.addSeparator();
|
149 |
-
am = m.addMenu({title : 'contextmenu.align'});
|
150 |
-
am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});
|
151 |
-
am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});
|
152 |
-
am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});
|
153 |
-
am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});
|
154 |
-
|
155 |
-
t.onContextMenu.dispatch(t, m, el, col);
|
156 |
-
|
157 |
-
return m;
|
158 |
-
}
|
159 |
-
});
|
160 |
-
|
161 |
-
// Register plugin
|
162 |
-
tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);
|
163 |
-
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* This plugin a context menu to TinyMCE editor instances.
|
16 |
+
*
|
17 |
+
* @class tinymce.plugins.ContextMenu
|
18 |
+
*/
|
19 |
+
tinymce.create('tinymce.plugins.ContextMenu', {
|
20 |
+
/**
|
21 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
22 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
23 |
+
* of the editor instance to intercept that event.
|
24 |
+
*
|
25 |
+
* @method init
|
26 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
27 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
28 |
+
*/
|
29 |
+
init : function(ed) {
|
30 |
+
var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu;
|
31 |
+
|
32 |
+
t.editor = ed;
|
33 |
+
|
34 |
+
contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* This event gets fired when the context menu is shown.
|
38 |
+
*
|
39 |
+
* @event onContextMenu
|
40 |
+
* @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event.
|
41 |
+
* @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed.
|
42 |
+
*/
|
43 |
+
t.onContextMenu = new tinymce.util.Dispatcher(this);
|
44 |
+
|
45 |
+
hideMenu = function(e) {
|
46 |
+
hide(ed, e);
|
47 |
+
};
|
48 |
+
|
49 |
+
showMenu = ed.onContextMenu.add(function(ed, e) {
|
50 |
+
// Block TinyMCE menu on ctrlKey and work around Safari issue
|
51 |
+
if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative)
|
52 |
+
return;
|
53 |
+
|
54 |
+
Event.cancel(e);
|
55 |
+
|
56 |
+
// Select the image if it's clicked. WebKit would other wise expand the selection
|
57 |
+
if (e.target.nodeName == 'IMG')
|
58 |
+
ed.selection.select(e.target);
|
59 |
+
|
60 |
+
t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);
|
61 |
+
Event.add(ed.getDoc(), 'click', hideMenu);
|
62 |
+
|
63 |
+
ed.nodeChanged();
|
64 |
+
});
|
65 |
+
|
66 |
+
ed.onRemove.add(function() {
|
67 |
+
if (t._menu)
|
68 |
+
t._menu.removeAll();
|
69 |
+
});
|
70 |
+
|
71 |
+
function hide(ed, e) {
|
72 |
+
realCtrlKey = 0;
|
73 |
+
|
74 |
+
// Since the contextmenu event moves
|
75 |
+
// the selection we need to store it away
|
76 |
+
if (e && e.button == 2) {
|
77 |
+
realCtrlKey = e.ctrlKey;
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
|
81 |
+
if (t._menu) {
|
82 |
+
t._menu.removeAll();
|
83 |
+
t._menu.destroy();
|
84 |
+
Event.remove(ed.getDoc(), 'click', hideMenu);
|
85 |
+
t._menu = null;
|
86 |
+
}
|
87 |
+
};
|
88 |
+
|
89 |
+
ed.onMouseDown.add(hide);
|
90 |
+
ed.onKeyDown.add(hide);
|
91 |
+
ed.onKeyDown.add(function(ed, e) {
|
92 |
+
if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) {
|
93 |
+
Event.cancel(e);
|
94 |
+
showMenu(ed, e);
|
95 |
+
}
|
96 |
+
});
|
97 |
+
},
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Returns information about the plugin as a name/value array.
|
101 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
102 |
+
*
|
103 |
+
* @method getInfo
|
104 |
+
* @return {Object} Name/value array containing information about the plugin.
|
105 |
+
*/
|
106 |
+
getInfo : function() {
|
107 |
+
return {
|
108 |
+
longname : 'Contextmenu',
|
109 |
+
author : 'Moxiecode Systems AB',
|
110 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
111 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
|
112 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
113 |
+
};
|
114 |
+
},
|
115 |
+
|
116 |
+
_getMenu : function(ed) {
|
117 |
+
var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p;
|
118 |
+
|
119 |
+
if (m) {
|
120 |
+
m.removeAll();
|
121 |
+
m.destroy();
|
122 |
+
}
|
123 |
+
|
124 |
+
p = DOM.getPos(ed.getContentAreaContainer());
|
125 |
+
|
126 |
+
m = ed.controlManager.createDropMenu('contextmenu', {
|
127 |
+
offset_x : p.x + ed.getParam('contextmenu_offset_x', 0),
|
128 |
+
offset_y : p.y + ed.getParam('contextmenu_offset_y', 0),
|
129 |
+
constrain : 1,
|
130 |
+
keyboard_focus: true
|
131 |
+
});
|
132 |
+
|
133 |
+
t._menu = m;
|
134 |
+
|
135 |
+
m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);
|
136 |
+
m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);
|
137 |
+
m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});
|
138 |
+
|
139 |
+
if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {
|
140 |
+
m.addSeparator();
|
141 |
+
m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
|
142 |
+
m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
|
143 |
+
}
|
144 |
+
|
145 |
+
m.addSeparator();
|
146 |
+
m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
|
147 |
+
|
148 |
+
m.addSeparator();
|
149 |
+
am = m.addMenu({title : 'contextmenu.align'});
|
150 |
+
am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});
|
151 |
+
am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});
|
152 |
+
am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});
|
153 |
+
am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});
|
154 |
+
|
155 |
+
t.onContextMenu.dispatch(t, m, el, col);
|
156 |
+
|
157 |
+
return m;
|
158 |
+
}
|
159 |
+
});
|
160 |
+
|
161 |
+
// Register plugin
|
162 |
+
tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);
|
163 |
+
})();
|
js/libraries/tiny_mce/plugins/directionality/editor_plugin_src.js
CHANGED
@@ -1,85 +1,85 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.Directionality', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
var t = this;
|
15 |
-
|
16 |
-
t.editor = ed;
|
17 |
-
|
18 |
-
function setDir(dir) {
|
19 |
-
var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks();
|
20 |
-
|
21 |
-
if (blocks.length) {
|
22 |
-
curDir = dom.getAttrib(blocks[0], "dir");
|
23 |
-
|
24 |
-
tinymce.each(blocks, function(block) {
|
25 |
-
// Add dir to block if the parent block doesn't already have that dir
|
26 |
-
if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
|
27 |
-
if (curDir != dir) {
|
28 |
-
dom.setAttrib(block, "dir", dir);
|
29 |
-
} else {
|
30 |
-
dom.setAttrib(block, "dir", null);
|
31 |
-
}
|
32 |
-
}
|
33 |
-
});
|
34 |
-
|
35 |
-
ed.nodeChanged();
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
ed.addCommand('mceDirectionLTR', function() {
|
40 |
-
setDir("ltr");
|
41 |
-
});
|
42 |
-
|
43 |
-
ed.addCommand('mceDirectionRTL', function() {
|
44 |
-
setDir("rtl");
|
45 |
-
});
|
46 |
-
|
47 |
-
ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
|
48 |
-
ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
|
49 |
-
|
50 |
-
ed.onNodeChange.add(t._nodeChange, t);
|
51 |
-
},
|
52 |
-
|
53 |
-
getInfo : function() {
|
54 |
-
return {
|
55 |
-
longname : 'Directionality',
|
56 |
-
author : 'Moxiecode Systems AB',
|
57 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
58 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
|
59 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
60 |
-
};
|
61 |
-
},
|
62 |
-
|
63 |
-
// Private methods
|
64 |
-
|
65 |
-
_nodeChange : function(ed, cm, n) {
|
66 |
-
var dom = ed.dom, dir;
|
67 |
-
|
68 |
-
n = dom.getParent(n, dom.isBlock);
|
69 |
-
if (!n) {
|
70 |
-
cm.setDisabled('ltr', 1);
|
71 |
-
cm.setDisabled('rtl', 1);
|
72 |
-
return;
|
73 |
-
}
|
74 |
-
|
75 |
-
dir = dom.getAttrib(n, 'dir');
|
76 |
-
cm.setActive('ltr', dir == "ltr");
|
77 |
-
cm.setDisabled('ltr', 0);
|
78 |
-
cm.setActive('rtl', dir == "rtl");
|
79 |
-
cm.setDisabled('rtl', 0);
|
80 |
-
}
|
81 |
-
});
|
82 |
-
|
83 |
-
// Register plugin
|
84 |
-
tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
|
85 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.Directionality', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this;
|
15 |
+
|
16 |
+
t.editor = ed;
|
17 |
+
|
18 |
+
function setDir(dir) {
|
19 |
+
var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks();
|
20 |
+
|
21 |
+
if (blocks.length) {
|
22 |
+
curDir = dom.getAttrib(blocks[0], "dir");
|
23 |
+
|
24 |
+
tinymce.each(blocks, function(block) {
|
25 |
+
// Add dir to block if the parent block doesn't already have that dir
|
26 |
+
if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
|
27 |
+
if (curDir != dir) {
|
28 |
+
dom.setAttrib(block, "dir", dir);
|
29 |
+
} else {
|
30 |
+
dom.setAttrib(block, "dir", null);
|
31 |
+
}
|
32 |
+
}
|
33 |
+
});
|
34 |
+
|
35 |
+
ed.nodeChanged();
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
ed.addCommand('mceDirectionLTR', function() {
|
40 |
+
setDir("ltr");
|
41 |
+
});
|
42 |
+
|
43 |
+
ed.addCommand('mceDirectionRTL', function() {
|
44 |
+
setDir("rtl");
|
45 |
+
});
|
46 |
+
|
47 |
+
ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
|
48 |
+
ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
|
49 |
+
|
50 |
+
ed.onNodeChange.add(t._nodeChange, t);
|
51 |
+
},
|
52 |
+
|
53 |
+
getInfo : function() {
|
54 |
+
return {
|
55 |
+
longname : 'Directionality',
|
56 |
+
author : 'Moxiecode Systems AB',
|
57 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
58 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
|
59 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
60 |
+
};
|
61 |
+
},
|
62 |
+
|
63 |
+
// Private methods
|
64 |
+
|
65 |
+
_nodeChange : function(ed, cm, n) {
|
66 |
+
var dom = ed.dom, dir;
|
67 |
+
|
68 |
+
n = dom.getParent(n, dom.isBlock);
|
69 |
+
if (!n) {
|
70 |
+
cm.setDisabled('ltr', 1);
|
71 |
+
cm.setDisabled('rtl', 1);
|
72 |
+
return;
|
73 |
+
}
|
74 |
+
|
75 |
+
dir = dom.getAttrib(n, 'dir');
|
76 |
+
cm.setActive('ltr', dir == "ltr");
|
77 |
+
cm.setDisabled('ltr', 0);
|
78 |
+
cm.setActive('rtl', dir == "rtl");
|
79 |
+
cm.setDisabled('rtl', 0);
|
80 |
+
}
|
81 |
+
});
|
82 |
+
|
83 |
+
// Register plugin
|
84 |
+
tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
|
85 |
})();
|
js/libraries/tiny_mce/plugins/emotions/editor_plugin_src.js
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function(tinymce) {
|
12 |
-
tinymce.create('tinymce.plugins.EmotionsPlugin', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
// Register commands
|
15 |
-
ed.addCommand('mceEmotion', function() {
|
16 |
-
ed.windowManager.open({
|
17 |
-
file : url + '/emotions.htm',
|
18 |
-
width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),
|
19 |
-
height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),
|
20 |
-
inline : 1
|
21 |
-
}, {
|
22 |
-
plugin_url : url
|
23 |
-
});
|
24 |
-
});
|
25 |
-
|
26 |
-
// Register buttons
|
27 |
-
ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});
|
28 |
-
},
|
29 |
-
|
30 |
-
getInfo : function() {
|
31 |
-
return {
|
32 |
-
longname : 'Emotions',
|
33 |
-
author : 'Moxiecode Systems AB',
|
34 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
35 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
|
36 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
37 |
-
};
|
38 |
-
}
|
39 |
-
});
|
40 |
-
|
41 |
-
// Register plugin
|
42 |
-
tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);
|
43 |
})(tinymce);
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function(tinymce) {
|
12 |
+
tinymce.create('tinymce.plugins.EmotionsPlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
// Register commands
|
15 |
+
ed.addCommand('mceEmotion', function() {
|
16 |
+
ed.windowManager.open({
|
17 |
+
file : url + '/emotions.htm',
|
18 |
+
width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),
|
19 |
+
height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),
|
20 |
+
inline : 1
|
21 |
+
}, {
|
22 |
+
plugin_url : url
|
23 |
+
});
|
24 |
+
});
|
25 |
+
|
26 |
+
// Register buttons
|
27 |
+
ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});
|
28 |
+
},
|
29 |
+
|
30 |
+
getInfo : function() {
|
31 |
+
return {
|
32 |
+
longname : 'Emotions',
|
33 |
+
author : 'Moxiecode Systems AB',
|
34 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
35 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
|
36 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
37 |
+
};
|
38 |
+
}
|
39 |
+
});
|
40 |
+
|
41 |
+
// Register plugin
|
42 |
+
tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);
|
43 |
})(tinymce);
|
js/libraries/tiny_mce/plugins/emotions/emotions.htm
CHANGED
@@ -1,42 +1,42 @@
|
|
1 |
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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 |
-
</head>
|
8 |
-
<body style="display: none" role="application" aria-labelledby="app_title">
|
9 |
-
<span style="display:none;" id="app_title">{#emotions_dlg.title}</span>
|
10 |
-
<div align="center">
|
11 |
-
<div class="title">{#emotions_dlg.title}:<br /><br /></div>
|
12 |
-
|
13 |
-
<table id="emoticon_table" role="presentation" border="0" cellspacing="0" cellpadding="4">
|
14 |
-
<tr>
|
15 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.cool}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
16 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.cry}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
17 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.embarassed}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
18 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.foot_in_mouth}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
19 |
-
</tr>
|
20 |
-
<tr>
|
21 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.frown}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
22 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.innocent}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
23 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.kiss}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
24 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.laughing}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
25 |
-
</tr>
|
26 |
-
<tr>
|
27 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.money_mouth}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}"/></a></td>
|
28 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.sealed}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
29 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.smile}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
30 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.surprised}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
31 |
-
</tr>
|
32 |
-
<tr>
|
33 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.tongue_out}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
34 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.undecided}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
35 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.wink}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
36 |
-
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.yell}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
37 |
-
</tr>
|
38 |
-
</table>
|
39 |
-
<div>{#emotions_dlg.usage}</div>
|
40 |
-
</div>
|
41 |
-
</body>
|
42 |
-
</html>
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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 |
+
</head>
|
8 |
+
<body style="display: none" role="application" aria-labelledby="app_title">
|
9 |
+
<span style="display:none;" id="app_title">{#emotions_dlg.title}</span>
|
10 |
+
<div align="center">
|
11 |
+
<div class="title">{#emotions_dlg.title}:<br /><br /></div>
|
12 |
+
|
13 |
+
<table id="emoticon_table" role="presentation" border="0" cellspacing="0" cellpadding="4">
|
14 |
+
<tr>
|
15 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.cool}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
16 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.cry}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
17 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.embarassed}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
18 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.foot_in_mouth}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
19 |
+
</tr>
|
20 |
+
<tr>
|
21 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.frown}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
22 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.innocent}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
23 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.kiss}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
24 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.laughing}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
25 |
+
</tr>
|
26 |
+
<tr>
|
27 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.money_mouth}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}"/></a></td>
|
28 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.sealed}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
29 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.smile}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
30 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.surprised}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
31 |
+
</tr>
|
32 |
+
<tr>
|
33 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.tongue_out}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
34 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.undecided}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
35 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.wink}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
36 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.yell}. {#emotions_dlg.usage}" 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}. {#emotions_dlg.usage}" /></a></td>
|
37 |
+
</tr>
|
38 |
+
</table>
|
39 |
+
<div>{#emotions_dlg.usage}</div>
|
40 |
+
</div>
|
41 |
+
</body>
|
42 |
+
</html>
|
js/libraries/tiny_mce/plugins/emotions/js/emotions.js
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
tinyMCEPopup.requireLangPack();
|
2 |
-
|
3 |
-
var EmotionsDialog = {
|
4 |
-
addKeyboardNavigation: function(){
|
5 |
-
var tableElm, cells, settings;
|
6 |
-
|
7 |
-
cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table");
|
8 |
-
|
9 |
-
settings ={
|
10 |
-
root: "emoticon_table",
|
11 |
-
items: cells
|
12 |
-
};
|
13 |
-
cells[0].tabindex=0;
|
14 |
-
tinyMCEPopup.dom.addClass(cells[0], "mceFocus");
|
15 |
-
if (tinymce.isGecko) {
|
16 |
-
cells[0].focus();
|
17 |
-
} else {
|
18 |
-
setTimeout(function(){
|
19 |
-
cells[0].focus();
|
20 |
-
}, 100);
|
21 |
-
}
|
22 |
-
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);
|
23 |
-
},
|
24 |
-
init : function(ed) {
|
25 |
-
tinyMCEPopup.resizeToInnerSize();
|
26 |
-
this.addKeyboardNavigation();
|
27 |
-
},
|
28 |
-
|
29 |
-
insert : function(file, title) {
|
30 |
-
var ed = tinyMCEPopup.editor, dom = ed.dom;
|
31 |
-
|
32 |
-
tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
|
33 |
-
src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
|
34 |
-
alt : ed.getLang(title),
|
35 |
-
title : ed.getLang(title),
|
36 |
-
border : 0
|
37 |
-
}));
|
38 |
-
|
39 |
-
tinyMCEPopup.close();
|
40 |
-
}
|
41 |
-
};
|
42 |
-
|
43 |
-
tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);
|
1 |
+
tinyMCEPopup.requireLangPack();
|
2 |
+
|
3 |
+
var EmotionsDialog = {
|
4 |
+
addKeyboardNavigation: function(){
|
5 |
+
var tableElm, cells, settings;
|
6 |
+
|
7 |
+
cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table");
|
8 |
+
|
9 |
+
settings ={
|
10 |
+
root: "emoticon_table",
|
11 |
+
items: cells
|
12 |
+
};
|
13 |
+
cells[0].tabindex=0;
|
14 |
+
tinyMCEPopup.dom.addClass(cells[0], "mceFocus");
|
15 |
+
if (tinymce.isGecko) {
|
16 |
+
cells[0].focus();
|
17 |
+
} else {
|
18 |
+
setTimeout(function(){
|
19 |
+
cells[0].focus();
|
20 |
+
}, 100);
|
21 |
+
}
|
22 |
+
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);
|
23 |
+
},
|
24 |
+
init : function(ed) {
|
25 |
+
tinyMCEPopup.resizeToInnerSize();
|
26 |
+
this.addKeyboardNavigation();
|
27 |
+
},
|
28 |
+
|
29 |
+
insert : function(file, title) {
|
30 |
+
var ed = tinyMCEPopup.editor, dom = ed.dom;
|
31 |
+
|
32 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
|
33 |
+
src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
|
34 |
+
alt : ed.getLang(title),
|
35 |
+
title : ed.getLang(title),
|
36 |
+
border : 0
|
37 |
+
}));
|
38 |
+
|
39 |
+
tinyMCEPopup.close();
|
40 |
+
}
|
41 |
+
};
|
42 |
+
|
43 |
+
tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);
|
js/libraries/tiny_mce/plugins/example/dialog.htm
CHANGED
@@ -1,22 +1,22 @@
|
|
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 |
-
<input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" />
|
17 |
-
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
18 |
-
</div>
|
19 |
-
</form>
|
20 |
-
|
21 |
-
</body>
|
22 |
-
</html>
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#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 |
+
<input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" />
|
17 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
18 |
+
</div>
|
19 |
+
</form>
|
20 |
+
|
21 |
+
</body>
|
22 |
+
</html>
|
js/libraries/tiny_mce/plugins/example/editor_plugin_src.js
CHANGED
@@ -1,84 +1,84 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
// Load plugin specific language pack
|
13 |
-
tinymce.PluginManager.requireLangPack('example');
|
14 |
-
|
15 |
-
tinymce.create('tinymce.plugins.ExamplePlugin', {
|
16 |
-
/**
|
17 |
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
18 |
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
19 |
-
* of the editor instance to intercept that event.
|
20 |
-
*
|
21 |
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
22 |
-
* @param {string} url Absolute URL to where the plugin is located.
|
23 |
-
*/
|
24 |
-
init : function(ed, url) {
|
25 |
-
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
26 |
-
ed.addCommand('mceExample', function() {
|
27 |
-
ed.windowManager.open({
|
28 |
-
file : url + '/dialog.htm',
|
29 |
-
width : 320 + parseInt(ed.getLang('example.delta_width', 0)),
|
30 |
-
height : 120 + parseInt(ed.getLang('example.delta_height', 0)),
|
31 |
-
inline : 1
|
32 |
-
}, {
|
33 |
-
plugin_url : url, // Plugin absolute URL
|
34 |
-
some_custom_arg : 'custom arg' // Custom argument
|
35 |
-
});
|
36 |
-
});
|
37 |
-
|
38 |
-
// Register example button
|
39 |
-
ed.addButton('example', {
|
40 |
-
title : 'example.desc',
|
41 |
-
cmd : 'mceExample',
|
42 |
-
image : url + '/img/example.gif'
|
43 |
-
});
|
44 |
-
|
45 |
-
// Add a node change handler, selects the button in the UI when a image is selected
|
46 |
-
ed.onNodeChange.add(function(ed, cm, n) {
|
47 |
-
cm.setActive('example', n.nodeName == 'IMG');
|
48 |
-
});
|
49 |
-
},
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Creates control instances based in the incomming name. This method is normally not
|
53 |
-
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
54 |
-
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
55 |
-
* method can be used to create those.
|
56 |
-
*
|
57 |
-
* @param {String} n Name of the control to create.
|
58 |
-
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
59 |
-
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
60 |
-
*/
|
61 |
-
createControl : function(n, cm) {
|
62 |
-
return null;
|
63 |
-
},
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Returns information about the plugin as a name/value array.
|
67 |
-
* The current keys are longname, author, authorurl, infourl and version.
|
68 |
-
*
|
69 |
-
* @return {Object} Name/value array containing information about the plugin.
|
70 |
-
*/
|
71 |
-
getInfo : function() {
|
72 |
-
return {
|
73 |
-
longname : 'Example plugin',
|
74 |
-
author : 'Some author',
|
75 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
76 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
|
77 |
-
version : "1.0"
|
78 |
-
};
|
79 |
-
}
|
80 |
-
});
|
81 |
-
|
82 |
-
// Register plugin
|
83 |
-
tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
|
84 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
// Load plugin specific language pack
|
13 |
+
tinymce.PluginManager.requireLangPack('example');
|
14 |
+
|
15 |
+
tinymce.create('tinymce.plugins.ExamplePlugin', {
|
16 |
+
/**
|
17 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
18 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
19 |
+
* of the editor instance to intercept that event.
|
20 |
+
*
|
21 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
22 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
23 |
+
*/
|
24 |
+
init : function(ed, url) {
|
25 |
+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
26 |
+
ed.addCommand('mceExample', function() {
|
27 |
+
ed.windowManager.open({
|
28 |
+
file : url + '/dialog.htm',
|
29 |
+
width : 320 + parseInt(ed.getLang('example.delta_width', 0)),
|
30 |
+
height : 120 + parseInt(ed.getLang('example.delta_height', 0)),
|
31 |
+
inline : 1
|
32 |
+
}, {
|
33 |
+
plugin_url : url, // Plugin absolute URL
|
34 |
+
some_custom_arg : 'custom arg' // Custom argument
|
35 |
+
});
|
36 |
+
});
|
37 |
+
|
38 |
+
// Register example button
|
39 |
+
ed.addButton('example', {
|
40 |
+
title : 'example.desc',
|
41 |
+
cmd : 'mceExample',
|
42 |
+
image : url + '/img/example.gif'
|
43 |
+
});
|
44 |
+
|
45 |
+
// Add a node change handler, selects the button in the UI when a image is selected
|
46 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
47 |
+
cm.setActive('example', n.nodeName == 'IMG');
|
48 |
+
});
|
49 |
+
},
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Creates control instances based in the incomming name. This method is normally not
|
53 |
+
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
54 |
+
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
55 |
+
* method can be used to create those.
|
56 |
+
*
|
57 |
+
* @param {String} n Name of the control to create.
|
58 |
+
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
59 |
+
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
60 |
+
*/
|
61 |
+
createControl : function(n, cm) {
|
62 |
+
return null;
|
63 |
+
},
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Returns information about the plugin as a name/value array.
|
67 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
68 |
+
*
|
69 |
+
* @return {Object} Name/value array containing information about the plugin.
|
70 |
+
*/
|
71 |
+
getInfo : function() {
|
72 |
+
return {
|
73 |
+
longname : 'Example plugin',
|
74 |
+
author : 'Some author',
|
75 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
76 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
|
77 |
+
version : "1.0"
|
78 |
+
};
|
79 |
+
}
|
80 |
+
});
|
81 |
+
|
82 |
+
// Register plugin
|
83 |
+
tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
|
84 |
})();
|
js/libraries/tiny_mce/plugins/example/js/dialog.js
CHANGED
@@ -1,19 +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);
|
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);
|
js/libraries/tiny_mce/plugins/example/langs/en.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
tinyMCE.addI18n('en.example',{
|
2 |
-
desc : 'This is just a template button'
|
3 |
-
});
|
1 |
+
tinyMCE.addI18n('en.example',{
|
2 |
+
desc : 'This is just a template button'
|
3 |
+
});
|
js/libraries/tiny_mce/plugins/example/langs/en_dlg.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
tinyMCE.addI18n('en.example_dlg',{
|
2 |
-
title : 'This is just a example title'
|
3 |
-
});
|
1 |
+
tinyMCE.addI18n('en.example_dlg',{
|
2 |
+
title : 'This is just a example title'
|
3 |
+
});
|
js/libraries/tiny_mce/plugins/fullpage/css/fullpage.css
CHANGED
@@ -1,143 +1,143 @@
|
|
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 |
-
#doctypes {
|
39 |
-
width: 200px;
|
40 |
-
}
|
41 |
-
|
42 |
-
/* Head list classes */
|
43 |
-
|
44 |
-
.headlistwrapper {
|
45 |
-
width: 100%;
|
46 |
-
}
|
47 |
-
|
48 |
-
.selected {
|
49 |
-
border: 1px solid #0A246A;
|
50 |
-
background-color: #B6BDD2;
|
51 |
-
}
|
52 |
-
|
53 |
-
.toolbar {
|
54 |
-
width: 100%;
|
55 |
-
}
|
56 |
-
|
57 |
-
#headlist {
|
58 |
-
width: 100%;
|
59 |
-
margin-top: 3px;
|
60 |
-
font-size: 11px;
|
61 |
-
}
|
62 |
-
|
63 |
-
#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element {
|
64 |
-
display: none;
|
65 |
-
}
|
66 |
-
|
67 |
-
#addmenu {
|
68 |
-
position: absolute;
|
69 |
-
border: 1px solid gray;
|
70 |
-
display: none;
|
71 |
-
z-index: 100;
|
72 |
-
background-color: white;
|
73 |
-
}
|
74 |
-
|
75 |
-
#addmenu a {
|
76 |
-
display: block;
|
77 |
-
width: 100%;
|
78 |
-
line-height: 20px;
|
79 |
-
text-decoration: none;
|
80 |
-
background-color: white;
|
81 |
-
}
|
82 |
-
|
83 |
-
#addmenu a:hover {
|
84 |
-
background-color: #B6BDD2;
|
85 |
-
color: black;
|
86 |
-
}
|
87 |
-
|
88 |
-
#addmenu span {
|
89 |
-
padding-left: 10px;
|
90 |
-
padding-right: 10px;
|
91 |
-
}
|
92 |
-
|
93 |
-
#updateElementPanel {
|
94 |
-
display: none;
|
95 |
-
}
|
96 |
-
|
97 |
-
#script_element .panel_wrapper div.current {
|
98 |
-
height: 108px;
|
99 |
-
}
|
100 |
-
|
101 |
-
#style_element .panel_wrapper div.current {
|
102 |
-
height: 108px;
|
103 |
-
}
|
104 |
-
|
105 |
-
#link_element .panel_wrapper div.current {
|
106 |
-
height: 140px;
|
107 |
-
}
|
108 |
-
|
109 |
-
#element_script_value {
|
110 |
-
width: 100%;
|
111 |
-
height: 100px;
|
112 |
-
}
|
113 |
-
|
114 |
-
#element_comment_value {
|
115 |
-
width: 100%;
|
116 |
-
height: 120px;
|
117 |
-
}
|
118 |
-
|
119 |
-
#element_style_value {
|
120 |
-
width: 100%;
|
121 |
-
height: 100px;
|
122 |
-
}
|
123 |
-
|
124 |
-
#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title {
|
125 |
-
width: 250px;
|
126 |
-
}
|
127 |
-
|
128 |
-
.updateElementButton {
|
129 |
-
margin-top: 3px;
|
130 |
-
}
|
131 |
-
|
132 |
-
/* MSIE specific styles */
|
133 |
-
|
134 |
-
* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton {
|
135 |
-
width: 22px;
|
136 |
-
height: 22px;
|
137 |
-
}
|
138 |
-
|
139 |
-
textarea {
|
140 |
-
height: 55px;
|
141 |
-
}
|
142 |
-
|
143 |
.panel_wrapper div.current {height:420px;}
|
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 |
+
#doctypes {
|
39 |
+
width: 200px;
|
40 |
+
}
|
41 |
+
|
42 |
+
/* Head list classes */
|
43 |
+
|
44 |
+
.headlistwrapper {
|
45 |
+
width: 100%;
|
46 |
+
}
|
47 |
+
|
48 |
+
.selected {
|
49 |
+
border: 1px solid #0A246A;
|
50 |
+
background-color: #B6BDD2;
|
51 |
+
}
|
52 |
+
|
53 |
+
.toolbar {
|
54 |
+
width: 100%;
|
55 |
+
}
|
56 |
+
|
57 |
+
#headlist {
|
58 |
+
width: 100%;
|
59 |
+
margin-top: 3px;
|
60 |
+
font-size: 11px;
|
61 |
+
}
|
62 |
+
|
63 |
+
#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element {
|
64 |
+
display: none;
|
65 |
+
}
|
66 |
+
|
67 |
+
#addmenu {
|
68 |
+
position: absolute;
|
69 |
+
border: 1px solid gray;
|
70 |
+
display: none;
|
71 |
+
z-index: 100;
|
72 |
+
background-color: white;
|
73 |
+
}
|
74 |
+
|
75 |
+
#addmenu a {
|
76 |
+
display: block;
|
77 |
+
width: 100%;
|
78 |
+
line-height: 20px;
|
79 |
+
text-decoration: none;
|
80 |
+
background-color: white;
|
81 |
+
}
|
82 |
+
|
83 |
+
#addmenu a:hover {
|
84 |
+
background-color: #B6BDD2;
|
85 |
+
color: black;
|
86 |
+
}
|
87 |
+
|
88 |
+
#addmenu span {
|
89 |
+
padding-left: 10px;
|
90 |
+
padding-right: 10px;
|
91 |
+
}
|
92 |
+
|
93 |
+
#updateElementPanel {
|
94 |
+
display: none;
|
95 |
+
}
|
96 |
+
|
97 |
+
#script_element .panel_wrapper div.current {
|
98 |
+
height: 108px;
|
99 |
+
}
|
100 |
+
|
101 |
+
#style_element .panel_wrapper div.current {
|
102 |
+
height: 108px;
|
103 |
+
}
|
104 |
+
|
105 |
+
#link_element .panel_wrapper div.current {
|
106 |
+
height: 140px;
|
107 |
+
}
|
108 |
+
|
109 |
+
#element_script_value {
|
110 |
+
width: 100%;
|
111 |
+
height: 100px;
|
112 |
+
}
|
113 |
+
|
114 |
+
#element_comment_value {
|
115 |
+
width: 100%;
|
116 |
+
height: 120px;
|
117 |
+
}
|
118 |
+
|
119 |
+
#element_style_value {
|
120 |
+
width: 100%;
|
121 |
+
height: 100px;
|
122 |
+
}
|
123 |
+
|
124 |
+
#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title {
|
125 |
+
width: 250px;
|
126 |
+
}
|
127 |
+
|
128 |
+
.updateElementButton {
|
129 |
+
margin-top: 3px;
|
130 |
+
}
|
131 |
+
|
132 |
+
/* MSIE specific styles */
|
133 |
+
|
134 |
+
* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton {
|
135 |
+
width: 22px;
|
136 |
+
height: 22px;
|
137 |
+
}
|
138 |
+
|
139 |
+
textarea {
|
140 |
+
height: 55px;
|
141 |
+
}
|
142 |
+
|
143 |
.panel_wrapper div.current {height:420px;}
|
js/libraries/tiny_mce/plugins/fullpage/editor_plugin_src.js
CHANGED
@@ -1,405 +1,405 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
var each = tinymce.each, Node = tinymce.html.Node;
|
13 |
-
|
14 |
-
tinymce.create('tinymce.plugins.FullPagePlugin', {
|
15 |
-
init : function(ed, url) {
|
16 |
-
var t = this;
|
17 |
-
|
18 |
-
t.editor = ed;
|
19 |
-
|
20 |
-
// Register commands
|
21 |
-
ed.addCommand('mceFullPageProperties', function() {
|
22 |
-
ed.windowManager.open({
|
23 |
-
file : url + '/fullpage.htm',
|
24 |
-
width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)),
|
25 |
-
height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)),
|
26 |
-
inline : 1
|
27 |
-
}, {
|
28 |
-
plugin_url : url,
|
29 |
-
data : t._htmlToData()
|
30 |
-
});
|
31 |
-
});
|
32 |
-
|
33 |
-
// Register buttons
|
34 |
-
ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'});
|
35 |
-
|
36 |
-
ed.onBeforeSetContent.add(t._setContent, t);
|
37 |
-
ed.onGetContent.add(t._getContent, t);
|
38 |
-
},
|
39 |
-
|
40 |
-
getInfo : function() {
|
41 |
-
return {
|
42 |
-
longname : 'Fullpage',
|
43 |
-
author : 'Moxiecode Systems AB',
|
44 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
45 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',
|
46 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
47 |
-
};
|
48 |
-
},
|
49 |
-
|
50 |
-
// Private plugin internal methods
|
51 |
-
|
52 |
-
_htmlToData : function() {
|
53 |
-
var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor;
|
54 |
-
|
55 |
-
function getAttr(elm, name) {
|
56 |
-
var value = elm.attr(name);
|
57 |
-
|
58 |
-
return value || '';
|
59 |
-
};
|
60 |
-
|
61 |
-
// Default some values
|
62 |
-
data.fontface = editor.getParam("fullpage_default_fontface", "");
|
63 |
-
data.fontsize = editor.getParam("fullpage_default_fontsize", "");
|
64 |
-
|
65 |
-
// Parse XML PI
|
66 |
-
elm = headerFragment.firstChild;
|
67 |
-
if (elm.type == 7) {
|
68 |
-
data.xml_pi = true;
|
69 |
-
matches = /encoding="([^"]+)"/.exec(elm.value);
|
70 |
-
if (matches)
|
71 |
-
data.docencoding = matches[1];
|
72 |
-
}
|
73 |
-
|
74 |
-
// Parse doctype
|
75 |
-
elm = headerFragment.getAll('#doctype')[0];
|
76 |
-
if (elm)
|
77 |
-
data.doctype = '<!DOCTYPE' + elm.value + ">";
|
78 |
-
|
79 |
-
// Parse title element
|
80 |
-
elm = headerFragment.getAll('title')[0];
|
81 |
-
if (elm && elm.firstChild) {
|
82 |
-
data.metatitle = elm.firstChild.value;
|
83 |
-
}
|
84 |
-
|
85 |
-
// Parse meta elements
|
86 |
-
each(headerFragment.getAll('meta'), function(meta) {
|
87 |
-
var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
|
88 |
-
|
89 |
-
if (name)
|
90 |
-
data['meta' + name.toLowerCase()] = meta.attr('content');
|
91 |
-
else if (httpEquiv == "Content-Type") {
|
92 |
-
matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
|
93 |
-
|
94 |
-
if (matches)
|
95 |
-
data.docencoding = matches[1];
|
96 |
-
}
|
97 |
-
});
|
98 |
-
|
99 |
-
// Parse html attribs
|
100 |
-
elm = headerFragment.getAll('html')[0];
|
101 |
-
if (elm)
|
102 |
-
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
|
103 |
-
|
104 |
-
// Parse stylesheet
|
105 |
-
elm = headerFragment.getAll('link')[0];
|
106 |
-
if (elm && elm.attr('rel') == 'stylesheet')
|
107 |
-
data.stylesheet = elm.attr('href');
|
108 |
-
|
109 |
-
// Parse body parts
|
110 |
-
elm = headerFragment.getAll('body')[0];
|
111 |
-
if (elm) {
|
112 |
-
data.langdir = getAttr(elm, 'dir');
|
113 |
-
data.style = getAttr(elm, 'style');
|
114 |
-
data.visited_color = getAttr(elm, 'vlink');
|
115 |
-
data.link_color = getAttr(elm, 'link');
|
116 |
-
data.active_color = getAttr(elm, 'alink');
|
117 |
-
}
|
118 |
-
|
119 |
-
return data;
|
120 |
-
},
|
121 |
-
|
122 |
-
_dataToHtml : function(data) {
|
123 |
-
var headerFragment, headElement, html, elm, value, dom = this.editor.dom;
|
124 |
-
|
125 |
-
function setAttr(elm, name, value) {
|
126 |
-
elm.attr(name, value ? value : undefined);
|
127 |
-
};
|
128 |
-
|
129 |
-
function addHeadNode(node) {
|
130 |
-
if (headElement.firstChild)
|
131 |
-
headElement.insert(node, headElement.firstChild);
|
132 |
-
else
|
133 |
-
headElement.append(node);
|
134 |
-
};
|
135 |
-
|
136 |
-
headerFragment = this._parseHeader();
|
137 |
-
headElement = headerFragment.getAll('head')[0];
|
138 |
-
if (!headElement) {
|
139 |
-
elm = headerFragment.getAll('html')[0];
|
140 |
-
headElement = new Node('head', 1);
|
141 |
-
|
142 |
-
if (elm.firstChild)
|
143 |
-
elm.insert(headElement, elm.firstChild, true);
|
144 |
-
else
|
145 |
-
elm.append(headElement);
|
146 |
-
}
|
147 |
-
|
148 |
-
// Add/update/remove XML-PI
|
149 |
-
elm = headerFragment.firstChild;
|
150 |
-
if (data.xml_pi) {
|
151 |
-
value = 'version="1.0"';
|
152 |
-
|
153 |
-
if (data.docencoding)
|
154 |
-
value += ' encoding="' + data.docencoding + '"';
|
155 |
-
|
156 |
-
if (elm.type != 7) {
|
157 |
-
elm = new Node('xml', 7);
|
158 |
-
headerFragment.insert(elm, headerFragment.firstChild, true);
|
159 |
-
}
|
160 |
-
|
161 |
-
elm.value = value;
|
162 |
-
} else if (elm && elm.type == 7)
|
163 |
-
elm.remove();
|
164 |
-
|
165 |
-
// Add/update/remove doctype
|
166 |
-
elm = headerFragment.getAll('#doctype')[0];
|
167 |
-
if (data.doctype) {
|
168 |
-
if (!elm) {
|
169 |
-
elm = new Node('#doctype', 10);
|
170 |
-
|
171 |
-
if (data.xml_pi)
|
172 |
-
headerFragment.insert(elm, headerFragment.firstChild);
|
173 |
-
else
|
174 |
-
addHeadNode(elm);
|
175 |
-
}
|
176 |
-
|
177 |
-
elm.value = data.doctype.substring(9, data.doctype.length - 1);
|
178 |
-
} else if (elm)
|
179 |
-
elm.remove();
|
180 |
-
|
181 |
-
// Add/update/remove title
|
182 |
-
elm = headerFragment.getAll('title')[0];
|
183 |
-
if (data.metatitle) {
|
184 |
-
if (!elm) {
|
185 |
-
elm = new Node('title', 1);
|
186 |
-
elm.append(new Node('#text', 3)).value = data.metatitle;
|
187 |
-
addHeadNode(elm);
|
188 |
-
}
|
189 |
-
}
|
190 |
-
|
191 |
-
// Add meta encoding
|
192 |
-
if (data.docencoding) {
|
193 |
-
elm = null;
|
194 |
-
each(headerFragment.getAll('meta'), function(meta) {
|
195 |
-
if (meta.attr('http-equiv') == 'Content-Type')
|
196 |
-
elm = meta;
|
197 |
-
});
|
198 |
-
|
199 |
-
if (!elm) {
|
200 |
-
elm = new Node('meta', 1);
|
201 |
-
elm.attr('http-equiv', 'Content-Type');
|
202 |
-
elm.shortEnded = true;
|
203 |
-
addHeadNode(elm);
|
204 |
-
}
|
205 |
-
|
206 |
-
elm.attr('content', 'text/html; charset=' + data.docencoding);
|
207 |
-
}
|
208 |
-
|
209 |
-
// Add/update/remove meta
|
210 |
-
each('keywords,description,author,copyright,robots'.split(','), function(name) {
|
211 |
-
var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name];
|
212 |
-
|
213 |
-
for (i = 0; i < nodes.length; i++) {
|
214 |
-
meta = nodes[i];
|
215 |
-
|
216 |
-
if (meta.attr('name') == name) {
|
217 |
-
if (value)
|
218 |
-
meta.attr('content', value);
|
219 |
-
else
|
220 |
-
meta.remove();
|
221 |
-
|
222 |
-
return;
|
223 |
-
}
|
224 |
-
}
|
225 |
-
|
226 |
-
if (value) {
|
227 |
-
elm = new Node('meta', 1);
|
228 |
-
elm.attr('name', name);
|
229 |
-
elm.attr('content', value);
|
230 |
-
elm.shortEnded = true;
|
231 |
-
|
232 |
-
addHeadNode(elm);
|
233 |
-
}
|
234 |
-
});
|
235 |
-
|
236 |
-
// Add/update/delete link
|
237 |
-
elm = headerFragment.getAll('link')[0];
|
238 |
-
if (elm && elm.attr('rel') == 'stylesheet') {
|
239 |
-
if (data.stylesheet)
|
240 |
-
elm.attr('href', data.stylesheet);
|
241 |
-
else
|
242 |
-
elm.remove();
|
243 |
-
} else if (data.stylesheet) {
|
244 |
-
elm = new Node('link', 1);
|
245 |
-
elm.attr({
|
246 |
-
rel : 'stylesheet',
|
247 |
-
text : 'text/css',
|
248 |
-
href : data.stylesheet
|
249 |
-
});
|
250 |
-
elm.shortEnded = true;
|
251 |
-
|
252 |
-
addHeadNode(elm);
|
253 |
-
}
|
254 |
-
|
255 |
-
// Update body attributes
|
256 |
-
elm = headerFragment.getAll('body')[0];
|
257 |
-
if (elm) {
|
258 |
-
setAttr(elm, 'dir', data.langdir);
|
259 |
-
setAttr(elm, 'style', data.style);
|
260 |
-
setAttr(elm, 'vlink', data.visited_color);
|
261 |
-
setAttr(elm, 'link', data.link_color);
|
262 |
-
setAttr(elm, 'alink', data.active_color);
|
263 |
-
|
264 |
-
// Update iframe body as well
|
265 |
-
dom.setAttribs(this.editor.getBody(), {
|
266 |
-
style : data.style,
|
267 |
-
dir : data.dir,
|
268 |
-
vLink : data.visited_color,
|
269 |
-
link : data.link_color,
|
270 |
-
aLink : data.active_color
|
271 |
-
});
|
272 |
-
}
|
273 |
-
|
274 |
-
// Set html attributes
|
275 |
-
elm = headerFragment.getAll('html')[0];
|
276 |
-
if (elm) {
|
277 |
-
setAttr(elm, 'lang', data.langcode);
|
278 |
-
setAttr(elm, 'xml:lang', data.langcode);
|
279 |
-
}
|
280 |
-
|
281 |
-
// Serialize header fragment and crop away body part
|
282 |
-
html = new tinymce.html.Serializer({
|
283 |
-
validate: false,
|
284 |
-
indent: true,
|
285 |
-
apply_source_formatting : true,
|
286 |
-
indent_before: 'head,html,body,meta,title,script,link,style',
|
287 |
-
indent_after: 'head,html,body,meta,title,script,link,style'
|
288 |
-
}).serialize(headerFragment);
|
289 |
-
|
290 |
-
this.head = html.substring(0, html.indexOf('</body>'));
|
291 |
-
},
|
292 |
-
|
293 |
-
_parseHeader : function() {
|
294 |
-
// Parse the contents with a DOM parser
|
295 |
-
return new tinymce.html.DomParser({
|
296 |
-
validate: false,
|
297 |
-
root_name: '#document'
|
298 |
-
}).parse(this.head);
|
299 |
-
},
|
300 |
-
|
301 |
-
_setContent : function(ed, o) {
|
302 |
-
var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm;
|
303 |
-
|
304 |
-
function low(s) {
|
305 |
-
return s.replace(/<\/?[A-Z]+/g, function(a) {
|
306 |
-
return a.toLowerCase();
|
307 |
-
})
|
308 |
-
};
|
309 |
-
|
310 |
-
// Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate
|
311 |
-
if (o.format == 'raw' && self.head)
|
312 |
-
return;
|
313 |
-
|
314 |
-
if (o.source_view && ed.getParam('fullpage_hide_in_source_view'))
|
315 |
-
return;
|
316 |
-
|
317 |
-
// Parse out head, body and footer
|
318 |
-
content = content.replace(/<(\/?)BODY/gi, '<$1body');
|
319 |
-
startPos = content.indexOf('<body');
|
320 |
-
|
321 |
-
if (startPos != -1) {
|
322 |
-
startPos = content.indexOf('>', startPos);
|
323 |
-
self.head = low(content.substring(0, startPos + 1));
|
324 |
-
|
325 |
-
endPos = content.indexOf('</body', startPos);
|
326 |
-
if (endPos == -1)
|
327 |
-
endPos = content.length;
|
328 |
-
|
329 |
-
o.content = content.substring(startPos + 1, endPos);
|
330 |
-
self.foot = low(content.substring(endPos));
|
331 |
-
} else {
|
332 |
-
self.head = this._getDefaultHeader();
|
333 |
-
self.foot = '\n</body>\n</html>';
|
334 |
-
}
|
335 |
-
|
336 |
-
// Parse header and update iframe
|
337 |
-
headerFragment = self._parseHeader();
|
338 |
-
each(headerFragment.getAll('style'), function(node) {
|
339 |
-
if (node.firstChild)
|
340 |
-
styles += node.firstChild.value;
|
341 |
-
});
|
342 |
-
|
343 |
-
elm = headerFragment.getAll('body')[0];
|
344 |
-
if (elm) {
|
345 |
-
dom.setAttribs(self.editor.getBody(), {
|
346 |
-
style : elm.attr('style') || '',
|
347 |
-
dir : elm.attr('dir') || '',
|
348 |
-
vLink : elm.attr('vlink') || '',
|
349 |
-
link : elm.attr('link') || '',
|
350 |
-
aLink : elm.attr('alink') || ''
|
351 |
-
});
|
352 |
-
}
|
353 |
-
|
354 |
-
dom.remove('fullpage_styles');
|
355 |
-
|
356 |
-
if (styles) {
|
357 |
-
dom.add(self.editor.getDoc().getElementsByTagName('head')[0], 'style', {id : 'fullpage_styles'}, styles);
|
358 |
-
|
359 |
-
// Needed for IE 6/7
|
360 |
-
elm = dom.get('fullpage_styles');
|
361 |
-
if (elm.styleSheet)
|
362 |
-
elm.styleSheet.cssText = styles;
|
363 |
-
}
|
364 |
-
},
|
365 |
-
|
366 |
-
_getDefaultHeader : function() {
|
367 |
-
var header = '', editor = this.editor, value, styles = '';
|
368 |
-
|
369 |
-
if (editor.getParam('fullpage_default_xml_pi'))
|
370 |
-
header += '<?xml version="1.0" encoding="' + editor.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
|
371 |
-
|
372 |
-
header += editor.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
|
373 |
-
header += '\n<html>\n<head>\n';
|
374 |
-
|
375 |
-
if (value = editor.getParam('fullpage_default_title'))
|
376 |
-
header += '<title>' + value + '</title>\n';
|
377 |
-
|
378 |
-
if (value = editor.getParam('fullpage_default_encoding'))
|
379 |
-
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
|
380 |
-
|
381 |
-
if (value = editor.getParam('fullpage_default_font_family'))
|
382 |
-
styles += 'font-family: ' + value + ';';
|
383 |
-
|
384 |
-
if (value = editor.getParam('fullpage_default_font_size'))
|
385 |
-
styles += 'font-size: ' + value + ';';
|
386 |
-
|
387 |
-
if (value = editor.getParam('fullpage_default_text_color'))
|
388 |
-
styles += 'color: ' + value + ';';
|
389 |
-
|
390 |
-
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
|
391 |
-
|
392 |
-
return header;
|
393 |
-
},
|
394 |
-
|
395 |
-
_getContent : function(ed, o) {
|
396 |
-
var self = this;
|
397 |
-
|
398 |
-
if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view'))
|
399 |
-
o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot);
|
400 |
-
}
|
401 |
-
});
|
402 |
-
|
403 |
-
// Register plugin
|
404 |
-
tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);
|
405 |
-
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var each = tinymce.each, Node = tinymce.html.Node;
|
13 |
+
|
14 |
+
tinymce.create('tinymce.plugins.FullPagePlugin', {
|
15 |
+
init : function(ed, url) {
|
16 |
+
var t = this;
|
17 |
+
|
18 |
+
t.editor = ed;
|
19 |
+
|
20 |
+
// Register commands
|
21 |
+
ed.addCommand('mceFullPageProperties', function() {
|
22 |
+
ed.windowManager.open({
|
23 |
+
file : url + '/fullpage.htm',
|
24 |
+
width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)),
|
25 |
+
height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)),
|
26 |
+
inline : 1
|
27 |
+
}, {
|
28 |
+
plugin_url : url,
|
29 |
+
data : t._htmlToData()
|
30 |
+
});
|
31 |
+
});
|
32 |
+
|
33 |
+
// Register buttons
|
34 |
+
ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'});
|
35 |
+
|
36 |
+
ed.onBeforeSetContent.add(t._setContent, t);
|
37 |
+
ed.onGetContent.add(t._getContent, t);
|
38 |
+
},
|
39 |
+
|
40 |
+
getInfo : function() {
|
41 |
+
return {
|
42 |
+
longname : 'Fullpage',
|
43 |
+
author : 'Moxiecode Systems AB',
|
44 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
45 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',
|
46 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
47 |
+
};
|
48 |
+
},
|
49 |
+
|
50 |
+
// Private plugin internal methods
|
51 |
+
|
52 |
+
_htmlToData : function() {
|
53 |
+
var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor;
|
54 |
+
|
55 |
+
function getAttr(elm, name) {
|
56 |
+
var value = elm.attr(name);
|
57 |
+
|
58 |
+
return value || '';
|
59 |
+
};
|
60 |
+
|
61 |
+
// Default some values
|
62 |
+
data.fontface = editor.getParam("fullpage_default_fontface", "");
|
63 |
+
data.fontsize = editor.getParam("fullpage_default_fontsize", "");
|
64 |
+
|
65 |
+
// Parse XML PI
|
66 |
+
elm = headerFragment.firstChild;
|
67 |
+
if (elm.type == 7) {
|
68 |
+
data.xml_pi = true;
|
69 |
+
matches = /encoding="([^"]+)"/.exec(elm.value);
|
70 |
+
if (matches)
|
71 |
+
data.docencoding = matches[1];
|
72 |
+
}
|
73 |
+
|
74 |
+
// Parse doctype
|
75 |
+
elm = headerFragment.getAll('#doctype')[0];
|
76 |
+
if (elm)
|
77 |
+
data.doctype = '<!DOCTYPE' + elm.value + ">";
|
78 |
+
|
79 |
+
// Parse title element
|
80 |
+
elm = headerFragment.getAll('title')[0];
|
81 |
+
if (elm && elm.firstChild) {
|
82 |
+
data.metatitle = elm.firstChild.value;
|
83 |
+
}
|
84 |
+
|
85 |
+
// Parse meta elements
|
86 |
+
each(headerFragment.getAll('meta'), function(meta) {
|
87 |
+
var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
|
88 |
+
|
89 |
+
if (name)
|
90 |
+
data['meta' + name.toLowerCase()] = meta.attr('content');
|
91 |
+
else if (httpEquiv == "Content-Type") {
|
92 |
+
matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
|
93 |
+
|
94 |
+
if (matches)
|
95 |
+
data.docencoding = matches[1];
|
96 |
+
}
|
97 |
+
});
|
98 |
+
|
99 |
+
// Parse html attribs
|
100 |
+
elm = headerFragment.getAll('html')[0];
|
101 |
+
if (elm)
|
102 |
+
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
|
103 |
+
|
104 |
+
// Parse stylesheet
|
105 |
+
elm = headerFragment.getAll('link')[0];
|
106 |
+
if (elm && elm.attr('rel') == 'stylesheet')
|
107 |
+
data.stylesheet = elm.attr('href');
|
108 |
+
|
109 |
+
// Parse body parts
|
110 |
+
elm = headerFragment.getAll('body')[0];
|
111 |
+
if (elm) {
|
112 |
+
data.langdir = getAttr(elm, 'dir');
|
113 |
+
data.style = getAttr(elm, 'style');
|
114 |
+
data.visited_color = getAttr(elm, 'vlink');
|
115 |
+
data.link_color = getAttr(elm, 'link');
|
116 |
+
data.active_color = getAttr(elm, 'alink');
|
117 |
+
}
|
118 |
+
|
119 |
+
return data;
|
120 |
+
},
|
121 |
+
|
122 |
+
_dataToHtml : function(data) {
|
123 |
+
var headerFragment, headElement, html, elm, value, dom = this.editor.dom;
|
124 |
+
|
125 |
+
function setAttr(elm, name, value) {
|
126 |
+
elm.attr(name, value ? value : undefined);
|
127 |
+
};
|
128 |
+
|
129 |
+
function addHeadNode(node) {
|
130 |
+
if (headElement.firstChild)
|
131 |
+
headElement.insert(node, headElement.firstChild);
|
132 |
+
else
|
133 |
+
headElement.append(node);
|
134 |
+
};
|
135 |
+
|
136 |
+
headerFragment = this._parseHeader();
|
137 |
+
headElement = headerFragment.getAll('head')[0];
|
138 |
+
if (!headElement) {
|
139 |
+
elm = headerFragment.getAll('html')[0];
|
140 |
+
headElement = new Node('head', 1);
|
141 |
+
|
142 |
+
if (elm.firstChild)
|
143 |
+
elm.insert(headElement, elm.firstChild, true);
|
144 |
+
else
|
145 |
+
elm.append(headElement);
|
146 |
+
}
|
147 |
+
|
148 |
+
// Add/update/remove XML-PI
|
149 |
+
elm = headerFragment.firstChild;
|
150 |
+
if (data.xml_pi) {
|
151 |
+
value = 'version="1.0"';
|
152 |
+
|
153 |
+
if (data.docencoding)
|
154 |
+
value += ' encoding="' + data.docencoding + '"';
|
155 |
+
|
156 |
+
if (elm.type != 7) {
|
157 |
+
elm = new Node('xml', 7);
|
158 |
+
headerFragment.insert(elm, headerFragment.firstChild, true);
|
159 |
+
}
|
160 |
+
|
161 |
+
elm.value = value;
|
162 |
+
} else if (elm && elm.type == 7)
|
163 |
+
elm.remove();
|
164 |
+
|
165 |
+
// Add/update/remove doctype
|
166 |
+
elm = headerFragment.getAll('#doctype')[0];
|
167 |
+
if (data.doctype) {
|
168 |
+
if (!elm) {
|
169 |
+
elm = new Node('#doctype', 10);
|
170 |
+
|
171 |
+
if (data.xml_pi)
|
172 |
+
headerFragment.insert(elm, headerFragment.firstChild);
|
173 |
+
else
|
174 |
+
addHeadNode(elm);
|
175 |
+
}
|
176 |
+
|
177 |
+
elm.value = data.doctype.substring(9, data.doctype.length - 1);
|
178 |
+
} else if (elm)
|
179 |
+
elm.remove();
|
180 |
+
|
181 |
+
// Add/update/remove title
|
182 |
+
elm = headerFragment.getAll('title')[0];
|
183 |
+
if (data.metatitle) {
|
184 |
+
if (!elm) {
|
185 |
+
elm = new Node('title', 1);
|
186 |
+
elm.append(new Node('#text', 3)).value = data.metatitle;
|
187 |
+
addHeadNode(elm);
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
// Add meta encoding
|
192 |
+
if (data.docencoding) {
|
193 |
+
elm = null;
|
194 |
+
each(headerFragment.getAll('meta'), function(meta) {
|
195 |
+
if (meta.attr('http-equiv') == 'Content-Type')
|
196 |
+
elm = meta;
|
197 |
+
});
|
198 |
+
|
199 |
+
if (!elm) {
|
200 |
+
elm = new Node('meta', 1);
|
201 |
+
elm.attr('http-equiv', 'Content-Type');
|
202 |
+
elm.shortEnded = true;
|
203 |
+
addHeadNode(elm);
|
204 |
+
}
|
205 |
+
|
206 |
+
elm.attr('content', 'text/html; charset=' + data.docencoding);
|
207 |
+
}
|
208 |
+
|
209 |
+
// Add/update/remove meta
|
210 |
+
each('keywords,description,author,copyright,robots'.split(','), function(name) {
|
211 |
+
var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name];
|
212 |
+
|
213 |
+
for (i = 0; i < nodes.length; i++) {
|
214 |
+
meta = nodes[i];
|
215 |
+
|
216 |
+
if (meta.attr('name') == name) {
|
217 |
+
if (value)
|
218 |
+
meta.attr('content', value);
|
219 |
+
else
|
220 |
+
meta.remove();
|
221 |
+
|
222 |
+
return;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
if (value) {
|
227 |
+
elm = new Node('meta', 1);
|
228 |
+
elm.attr('name', name);
|
229 |
+
elm.attr('content', value);
|
230 |
+
elm.shortEnded = true;
|
231 |
+
|
232 |
+
addHeadNode(elm);
|
233 |
+
}
|
234 |
+
});
|
235 |
+
|
236 |
+
// Add/update/delete link
|
237 |
+
elm = headerFragment.getAll('link')[0];
|
238 |
+
if (elm && elm.attr('rel') == 'stylesheet') {
|
239 |
+
if (data.stylesheet)
|
240 |
+
elm.attr('href', data.stylesheet);
|
241 |
+
else
|
242 |
+
elm.remove();
|
243 |
+
} else if (data.stylesheet) {
|
244 |
+
elm = new Node('link', 1);
|
245 |
+
elm.attr({
|
246 |
+
rel : 'stylesheet',
|
247 |
+
text : 'text/css',
|
248 |
+
href : data.stylesheet
|
249 |
+
});
|
250 |
+
elm.shortEnded = true;
|
251 |
+
|
252 |
+
addHeadNode(elm);
|
253 |
+
}
|
254 |
+
|
255 |
+
// Update body attributes
|
256 |
+
elm = headerFragment.getAll('body')[0];
|
257 |
+
if (elm) {
|
258 |
+
setAttr(elm, 'dir', data.langdir);
|
259 |
+
setAttr(elm, 'style', data.style);
|
260 |
+
setAttr(elm, 'vlink', data.visited_color);
|
261 |
+
setAttr(elm, 'link', data.link_color);
|
262 |
+
setAttr(elm, 'alink', data.active_color);
|
263 |
+
|
264 |
+
// Update iframe body as well
|
265 |
+
dom.setAttribs(this.editor.getBody(), {
|
266 |
+
style : data.style,
|
267 |
+
dir : data.dir,
|
268 |
+
vLink : data.visited_color,
|
269 |
+
link : data.link_color,
|
270 |
+
aLink : data.active_color
|
271 |
+
});
|
272 |
+
}
|
273 |
+
|
274 |
+
// Set html attributes
|
275 |
+
elm = headerFragment.getAll('html')[0];
|
276 |
+
if (elm) {
|
277 |
+
setAttr(elm, 'lang', data.langcode);
|
278 |
+
setAttr(elm, 'xml:lang', data.langcode);
|
279 |
+
}
|
280 |
+
|
281 |
+
// Serialize header fragment and crop away body part
|
282 |
+
html = new tinymce.html.Serializer({
|
283 |
+
validate: false,
|
284 |
+
indent: true,
|
285 |
+
apply_source_formatting : true,
|
286 |
+
indent_before: 'head,html,body,meta,title,script,link,style',
|
287 |
+
indent_after: 'head,html,body,meta,title,script,link,style'
|
288 |
+
}).serialize(headerFragment);
|
289 |
+
|
290 |
+
this.head = html.substring(0, html.indexOf('</body>'));
|
291 |
+
},
|
292 |
+
|
293 |
+
_parseHeader : function() {
|
294 |
+
// Parse the contents with a DOM parser
|
295 |
+
return new tinymce.html.DomParser({
|
296 |
+
validate: false,
|
297 |
+
root_name: '#document'
|
298 |
+
}).parse(this.head);
|
299 |
+
},
|
300 |
+
|
301 |
+
_setContent : function(ed, o) {
|
302 |
+
var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm;
|
303 |
+
|
304 |
+
function low(s) {
|
305 |
+
return s.replace(/<\/?[A-Z]+/g, function(a) {
|
306 |
+
return a.toLowerCase();
|
307 |
+
})
|
308 |
+
};
|
309 |
+
|
310 |
+
// Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate
|
311 |
+
if (o.format == 'raw' && self.head)
|
312 |
+
return;
|
313 |
+
|
314 |
+
if (o.source_view && ed.getParam('fullpage_hide_in_source_view'))
|
315 |
+
return;
|
316 |
+
|
317 |
+
// Parse out head, body and footer
|
318 |
+
content = content.replace(/<(\/?)BODY/gi, '<$1body');
|
319 |
+
startPos = content.indexOf('<body');
|
320 |
+
|
321 |
+
if (startPos != -1) {
|
322 |
+
startPos = content.indexOf('>', startPos);
|
323 |
+
self.head = low(content.substring(0, startPos + 1));
|
324 |
+
|
325 |
+
endPos = content.indexOf('</body', startPos);
|
326 |
+
if (endPos == -1)
|
327 |
+
endPos = content.length;
|
328 |
+
|
329 |
+
o.content = content.substring(startPos + 1, endPos);
|
330 |
+
self.foot = low(content.substring(endPos));
|
331 |
+
} else {
|
332 |
+
self.head = this._getDefaultHeader();
|
333 |
+
self.foot = '\n</body>\n</html>';
|
334 |
+
}
|
335 |
+
|
336 |
+
// Parse header and update iframe
|
337 |
+
headerFragment = self._parseHeader();
|
338 |
+
each(headerFragment.getAll('style'), function(node) {
|
339 |
+
if (node.firstChild)
|
340 |
+
styles += node.firstChild.value;
|
341 |
+
});
|
342 |
+
|
343 |
+
elm = headerFragment.getAll('body')[0];
|
344 |
+
if (elm) {
|
345 |
+
dom.setAttribs(self.editor.getBody(), {
|
346 |
+
style : elm.attr('style') || '',
|
347 |
+
dir : elm.attr('dir') || '',
|
348 |
+
vLink : elm.attr('vlink') || '',
|
349 |
+
link : elm.attr('link') || '',
|
350 |
+
aLink : elm.attr('alink') || ''
|
351 |
+
});
|
352 |
+
}
|
353 |
+
|
354 |
+
dom.remove('fullpage_styles');
|
355 |
+
|
356 |
+
if (styles) {
|
357 |
+
dom.add(self.editor.getDoc().getElementsByTagName('head')[0], 'style', {id : 'fullpage_styles'}, styles);
|
358 |
+
|
359 |
+
// Needed for IE 6/7
|
360 |
+
elm = dom.get('fullpage_styles');
|
361 |
+
if (elm.styleSheet)
|
362 |
+
elm.styleSheet.cssText = styles;
|
363 |
+
}
|
364 |
+
},
|
365 |
+
|
366 |
+
_getDefaultHeader : function() {
|
367 |
+
var header = '', editor = this.editor, value, styles = '';
|
368 |
+
|
369 |
+
if (editor.getParam('fullpage_default_xml_pi'))
|
370 |
+
header += '<?xml version="1.0" encoding="' + editor.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
|
371 |
+
|
372 |
+
header += editor.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
|
373 |
+
header += '\n<html>\n<head>\n';
|
374 |
+
|
375 |
+
if (value = editor.getParam('fullpage_default_title'))
|
376 |
+
header += '<title>' + value + '</title>\n';
|
377 |
+
|
378 |
+
if (value = editor.getParam('fullpage_default_encoding'))
|
379 |
+
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
|
380 |
+
|
381 |
+
if (value = editor.getParam('fullpage_default_font_family'))
|
382 |
+
styles += 'font-family: ' + value + ';';
|
383 |
+
|
384 |
+
if (value = editor.getParam('fullpage_default_font_size'))
|
385 |
+
styles += 'font-size: ' + value + ';';
|
386 |
+
|
387 |
+
if (value = editor.getParam('fullpage_default_text_color'))
|
388 |
+
styles += 'color: ' + value + ';';
|
389 |
+
|
390 |
+
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
|
391 |
+
|
392 |
+
return header;
|
393 |
+
},
|
394 |
+
|
395 |
+
_getContent : function(ed, o) {
|
396 |
+
var self = this;
|
397 |
+
|
398 |
+
if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view'))
|
399 |
+
o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot);
|
400 |
+
}
|
401 |
+
});
|
402 |
+
|
403 |
+
// Register plugin
|
404 |
+
tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);
|
405 |
+
})();
|
js/libraries/tiny_mce/plugins/fullpage/fullpage.htm
CHANGED
@@ -1,259 +1,259 @@
|
|
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 |
-
</head>
|
11 |
-
<body id="fullpage" style="display: none">
|
12 |
-
<form onsubmit="FullPageDialog.update();return false;" name="fullpage" action="#">
|
13 |
-
<div class="tabs">
|
14 |
-
<ul>
|
15 |
-
<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>
|
16 |
-
<li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li>
|
17 |
-
</ul>
|
18 |
-
</div>
|
19 |
-
|
20 |
-
<div class="panel_wrapper">
|
21 |
-
<div id="meta_panel" class="panel current">
|
22 |
-
<fieldset>
|
23 |
-
<legend>{#fullpage_dlg.meta_props}</legend>
|
24 |
-
|
25 |
-
<table border="0" cellpadding="4" cellspacing="0">
|
26 |
-
<tr>
|
27 |
-
<td class="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label> </td>
|
28 |
-
<td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td>
|
29 |
-
</tr>
|
30 |
-
<tr>
|
31 |
-
<td class="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label> </td>
|
32 |
-
<td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td>
|
33 |
-
</tr>
|
34 |
-
<tr>
|
35 |
-
<td class="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label> </td>
|
36 |
-
<td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td>
|
37 |
-
</tr>
|
38 |
-
<tr>
|
39 |
-
<td class="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label> </td>
|
40 |
-
<td><input type="text" id="metaauthor" name="metaauthor" value="" /></td>
|
41 |
-
</tr>
|
42 |
-
<tr>
|
43 |
-
<td class="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label> </td>
|
44 |
-
<td><input type="text" id="metacopyright" name="metacopyright" value="" /></td>
|
45 |
-
</tr>
|
46 |
-
<tr>
|
47 |
-
<td class="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label> </td>
|
48 |
-
<td>
|
49 |
-
<select id="metarobots" name="metarobots">
|
50 |
-
<option value="">{#not_set}</option>
|
51 |
-
<option value="index,follow">{#fullpage_dlg.meta_index_follow}</option>
|
52 |
-
<option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option>
|
53 |
-
<option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option>
|
54 |
-
<option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option>
|
55 |
-
</select>
|
56 |
-
</td>
|
57 |
-
</tr>
|
58 |
-
</table>
|
59 |
-
</fieldset>
|
60 |
-
|
61 |
-
<fieldset>
|
62 |
-
<legend>{#fullpage_dlg.langprops}</legend>
|
63 |
-
|
64 |
-
<table border="0" cellpadding="4" cellspacing="0">
|
65 |
-
<tr>
|
66 |
-
<td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td>
|
67 |
-
<td>
|
68 |
-
<select id="docencoding" name="docencoding">
|
69 |
-
<option value="">{#not_set}</option>
|
70 |
-
</select>
|
71 |
-
</td>
|
72 |
-
</tr>
|
73 |
-
<tr>
|
74 |
-
<td class="nowrap"><label for="doctype">{#fullpage_dlg.doctypes}</label> </td>
|
75 |
-
<td>
|
76 |
-
<select id="doctype" name="doctype">
|
77 |
-
<option value="">{#not_set}</option>
|
78 |
-
</select>
|
79 |
-
</td>
|
80 |
-
</tr>
|
81 |
-
<tr>
|
82 |
-
<td class="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label> </td>
|
83 |
-
<td><input type="text" id="langcode" name="langcode" value="" /></td>
|
84 |
-
</tr>
|
85 |
-
<tr>
|
86 |
-
<td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td>
|
87 |
-
<td>
|
88 |
-
<select id="langdir" name="langdir">
|
89 |
-
<option value="">{#not_set}</option>
|
90 |
-
<option value="ltr">{#fullpage_dlg.ltr}</option>
|
91 |
-
<option value="rtl">{#fullpage_dlg.rtl}</option>
|
92 |
-
</select>
|
93 |
-
</td>
|
94 |
-
</tr>
|
95 |
-
<tr>
|
96 |
-
<td class="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label> </td>
|
97 |
-
<td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td>
|
98 |
-
</tr>
|
99 |
-
</table>
|
100 |
-
</fieldset>
|
101 |
-
</div>
|
102 |
-
|
103 |
-
<div id="appearance_panel" class="panel">
|
104 |
-
<fieldset>
|
105 |
-
<legend>{#fullpage_dlg.appearance_textprops}</legend>
|
106 |
-
|
107 |
-
<table border="0" cellpadding="4" cellspacing="0">
|
108 |
-
<tr>
|
109 |
-
<td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td>
|
110 |
-
<td>
|
111 |
-
<select id="fontface" name="fontface" onchange="FullPageDialog.changedStyleProp();">
|
112 |
-
<option value="">{#not_set}</option>
|
113 |
-
</select>
|
114 |
-
</td>
|
115 |
-
</tr>
|
116 |
-
|
117 |
-
<tr>
|
118 |
-
<td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td>
|
119 |
-
<td>
|
120 |
-
<select id="fontsize" name="fontsize" onchange="FullPageDialog.changedStyleProp();">
|
121 |
-
<option value="">{#not_set}</option>
|
122 |
-
</select>
|
123 |
-
</td>
|
124 |
-
</tr>
|
125 |
-
|
126 |
-
<tr>
|
127 |
-
<td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td>
|
128 |
-
<td>
|
129 |
-
<table border="0" cellpadding="0" cellspacing="0">
|
130 |
-
<tr>
|
131 |
-
<td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');FullPageDialog.changedStyleProp();" /></td>
|
132 |
-
<td id="textcolor_pickcontainer"> </td>
|
133 |
-
</tr>
|
134 |
-
</table>
|
135 |
-
</td>
|
136 |
-
</tr>
|
137 |
-
</table>
|
138 |
-
</fieldset>
|
139 |
-
|
140 |
-
<fieldset>
|
141 |
-
<legend>{#fullpage_dlg.appearance_bgprops}</legend>
|
142 |
-
|
143 |
-
<table border="0" cellpadding="4" cellspacing="0">
|
144 |
-
<tr>
|
145 |
-
<td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td>
|
146 |
-
<td>
|
147 |
-
<table border="0" cellpadding="0" cellspacing="0">
|
148 |
-
<tr>
|
149 |
-
<td><input id="bgimage" name="bgimage" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
150 |
-
<td id="bgimage_pickcontainer"> </td>
|
151 |
-
</tr>
|
152 |
-
</table>
|
153 |
-
</td>
|
154 |
-
</tr>
|
155 |
-
<tr>
|
156 |
-
<td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td>
|
157 |
-
<td>
|
158 |
-
<table border="0" cellpadding="0" cellspacing="0">
|
159 |
-
<tr>
|
160 |
-
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');FullPageDialog.changedStyleProp();" /></td>
|
161 |
-
<td id="bgcolor_pickcontainer"> </td>
|
162 |
-
</tr>
|
163 |
-
</table>
|
164 |
-
</td>
|
165 |
-
</tr>
|
166 |
-
</table>
|
167 |
-
</fieldset>
|
168 |
-
|
169 |
-
<fieldset>
|
170 |
-
<legend>{#fullpage_dlg.appearance_marginprops}</legend>
|
171 |
-
|
172 |
-
<table border="0" cellpadding="4" cellspacing="0">
|
173 |
-
<tr>
|
174 |
-
<td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td>
|
175 |
-
<td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
176 |
-
<td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td>
|
177 |
-
<td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
178 |
-
</tr>
|
179 |
-
<tr>
|
180 |
-
<td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td>
|
181 |
-
<td><input id="topmargin" name="topmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
182 |
-
<td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td>
|
183 |
-
<td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
184 |
-
</tr>
|
185 |
-
</table>
|
186 |
-
</fieldset>
|
187 |
-
|
188 |
-
<fieldset>
|
189 |
-
<legend>{#fullpage_dlg.appearance_linkprops}</legend>
|
190 |
-
|
191 |
-
<table border="0" cellpadding="4" cellspacing="0">
|
192 |
-
<tr>
|
193 |
-
<td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td>
|
194 |
-
<td>
|
195 |
-
<table border="0" cellpadding="0" cellspacing="0">
|
196 |
-
<tr>
|
197 |
-
<td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');FullPageDialog.changedStyleProp();" /></td>
|
198 |
-
<td id="link_color_pickcontainer"> </td>
|
199 |
-
</tr>
|
200 |
-
</table>
|
201 |
-
</td>
|
202 |
-
|
203 |
-
<td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td>
|
204 |
-
<td>
|
205 |
-
<table border="0" cellpadding="0" cellspacing="0">
|
206 |
-
<tr>
|
207 |
-
<td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');FullPageDialog.changedStyleProp();" /></td>
|
208 |
-
<td id="visited_color_pickcontainer"> </td>
|
209 |
-
</tr>
|
210 |
-
</table>
|
211 |
-
</td>
|
212 |
-
</tr>
|
213 |
-
|
214 |
-
<tr>
|
215 |
-
<td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td>
|
216 |
-
<td>
|
217 |
-
<table border="0" cellpadding="0" cellspacing="0">
|
218 |
-
<tr>
|
219 |
-
<td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');FullPageDialog.changedStyleProp();" /></td>
|
220 |
-
<td id="active_color_pickcontainer"> </td>
|
221 |
-
</tr>
|
222 |
-
</table>
|
223 |
-
</td>
|
224 |
-
|
225 |
-
<td> </td>
|
226 |
-
<td> </td>
|
227 |
-
</tr>
|
228 |
-
</table>
|
229 |
-
</fieldset>
|
230 |
-
|
231 |
-
<fieldset>
|
232 |
-
<legend>{#fullpage_dlg.appearance_style}</legend>
|
233 |
-
|
234 |
-
<table border="0" cellpadding="4" cellspacing="0">
|
235 |
-
<tr>
|
236 |
-
<td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td>
|
237 |
-
<td><table border="0" cellpadding="0" cellspacing="0">
|
238 |
-
<tr>
|
239 |
-
<td><input id="stylesheet" name="stylesheet" type="text" value="" /></td>
|
240 |
-
<td id="stylesheet_browsercontainer"> </td>
|
241 |
-
</tr>
|
242 |
-
</table></td>
|
243 |
-
</tr>
|
244 |
-
<tr>
|
245 |
-
<td class="column1"><label for="style">{#fullpage_dlg.style}</label></td>
|
246 |
-
<td><input id="style" name="style" type="text" value="" onchange="FullPageDialog.changedStyle();" /></td>
|
247 |
-
</tr>
|
248 |
-
</table>
|
249 |
-
</fieldset>
|
250 |
-
</div>
|
251 |
-
</div>
|
252 |
-
|
253 |
-
<div class="mceActionPanel">
|
254 |
-
<input type="submit" id="insert" name="update" value="{#update}" />
|
255 |
-
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
256 |
-
</div>
|
257 |
-
</form>
|
258 |
-
</body>
|
259 |
-
</html>
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#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 |
+
</head>
|
11 |
+
<body id="fullpage" style="display: none">
|
12 |
+
<form onsubmit="FullPageDialog.update();return false;" name="fullpage" action="#">
|
13 |
+
<div class="tabs">
|
14 |
+
<ul>
|
15 |
+
<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>
|
16 |
+
<li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li>
|
17 |
+
</ul>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
<div class="panel_wrapper">
|
21 |
+
<div id="meta_panel" class="panel current">
|
22 |
+
<fieldset>
|
23 |
+
<legend>{#fullpage_dlg.meta_props}</legend>
|
24 |
+
|
25 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
26 |
+
<tr>
|
27 |
+
<td class="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label> </td>
|
28 |
+
<td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td>
|
29 |
+
</tr>
|
30 |
+
<tr>
|
31 |
+
<td class="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label> </td>
|
32 |
+
<td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td>
|
33 |
+
</tr>
|
34 |
+
<tr>
|
35 |
+
<td class="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label> </td>
|
36 |
+
<td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td>
|
37 |
+
</tr>
|
38 |
+
<tr>
|
39 |
+
<td class="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label> </td>
|
40 |
+
<td><input type="text" id="metaauthor" name="metaauthor" value="" /></td>
|
41 |
+
</tr>
|
42 |
+
<tr>
|
43 |
+
<td class="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label> </td>
|
44 |
+
<td><input type="text" id="metacopyright" name="metacopyright" value="" /></td>
|
45 |
+
</tr>
|
46 |
+
<tr>
|
47 |
+
<td class="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label> </td>
|
48 |
+
<td>
|
49 |
+
<select id="metarobots" name="metarobots">
|
50 |
+
<option value="">{#not_set}</option>
|
51 |
+
<option value="index,follow">{#fullpage_dlg.meta_index_follow}</option>
|
52 |
+
<option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option>
|
53 |
+
<option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option>
|
54 |
+
<option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option>
|
55 |
+
</select>
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
+
</table>
|
59 |
+
</fieldset>
|
60 |
+
|
61 |
+
<fieldset>
|
62 |
+
<legend>{#fullpage_dlg.langprops}</legend>
|
63 |
+
|
64 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
65 |
+
<tr>
|
66 |
+
<td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td>
|
67 |
+
<td>
|
68 |
+
<select id="docencoding" name="docencoding">
|
69 |
+
<option value="">{#not_set}</option>
|
70 |
+
</select>
|
71 |
+
</td>
|
72 |
+
</tr>
|
73 |
+
<tr>
|
74 |
+
<td class="nowrap"><label for="doctype">{#fullpage_dlg.doctypes}</label> </td>
|
75 |
+
<td>
|
76 |
+
<select id="doctype" name="doctype">
|
77 |
+
<option value="">{#not_set}</option>
|
78 |
+
</select>
|
79 |
+
</td>
|
80 |
+
</tr>
|
81 |
+
<tr>
|
82 |
+
<td class="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label> </td>
|
83 |
+
<td><input type="text" id="langcode" name="langcode" value="" /></td>
|
84 |
+
</tr>
|
85 |
+
<tr>
|
86 |
+
<td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td>
|
87 |
+
<td>
|
88 |
+
<select id="langdir" name="langdir">
|
89 |
+
<option value="">{#not_set}</option>
|
90 |
+
<option value="ltr">{#fullpage_dlg.ltr}</option>
|
91 |
+
<option value="rtl">{#fullpage_dlg.rtl}</option>
|
92 |
+
</select>
|
93 |
+
</td>
|
94 |
+
</tr>
|
95 |
+
<tr>
|
96 |
+
<td class="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label> </td>
|
97 |
+
<td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td>
|
98 |
+
</tr>
|
99 |
+
</table>
|
100 |
+
</fieldset>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<div id="appearance_panel" class="panel">
|
104 |
+
<fieldset>
|
105 |
+
<legend>{#fullpage_dlg.appearance_textprops}</legend>
|
106 |
+
|
107 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
108 |
+
<tr>
|
109 |
+
<td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td>
|
110 |
+
<td>
|
111 |
+
<select id="fontface" name="fontface" onchange="FullPageDialog.changedStyleProp();">
|
112 |
+
<option value="">{#not_set}</option>
|
113 |
+
</select>
|
114 |
+
</td>
|
115 |
+
</tr>
|
116 |
+
|
117 |
+
<tr>
|
118 |
+
<td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td>
|
119 |
+
<td>
|
120 |
+
<select id="fontsize" name="fontsize" onchange="FullPageDialog.changedStyleProp();">
|
121 |
+
<option value="">{#not_set}</option>
|
122 |
+
</select>
|
123 |
+
</td>
|
124 |
+
</tr>
|
125 |
+
|
126 |
+
<tr>
|
127 |
+
<td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td>
|
128 |
+
<td>
|
129 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
130 |
+
<tr>
|
131 |
+
<td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');FullPageDialog.changedStyleProp();" /></td>
|
132 |
+
<td id="textcolor_pickcontainer"> </td>
|
133 |
+
</tr>
|
134 |
+
</table>
|
135 |
+
</td>
|
136 |
+
</tr>
|
137 |
+
</table>
|
138 |
+
</fieldset>
|
139 |
+
|
140 |
+
<fieldset>
|
141 |
+
<legend>{#fullpage_dlg.appearance_bgprops}</legend>
|
142 |
+
|
143 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
144 |
+
<tr>
|
145 |
+
<td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td>
|
146 |
+
<td>
|
147 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
148 |
+
<tr>
|
149 |
+
<td><input id="bgimage" name="bgimage" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
150 |
+
<td id="bgimage_pickcontainer"> </td>
|
151 |
+
</tr>
|
152 |
+
</table>
|
153 |
+
</td>
|
154 |
+
</tr>
|
155 |
+
<tr>
|
156 |
+
<td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td>
|
157 |
+
<td>
|
158 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
159 |
+
<tr>
|
160 |
+
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');FullPageDialog.changedStyleProp();" /></td>
|
161 |
+
<td id="bgcolor_pickcontainer"> </td>
|
162 |
+
</tr>
|
163 |
+
</table>
|
164 |
+
</td>
|
165 |
+
</tr>
|
166 |
+
</table>
|
167 |
+
</fieldset>
|
168 |
+
|
169 |
+
<fieldset>
|
170 |
+
<legend>{#fullpage_dlg.appearance_marginprops}</legend>
|
171 |
+
|
172 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
173 |
+
<tr>
|
174 |
+
<td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td>
|
175 |
+
<td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
176 |
+
<td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td>
|
177 |
+
<td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
178 |
+
</tr>
|
179 |
+
<tr>
|
180 |
+
<td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td>
|
181 |
+
<td><input id="topmargin" name="topmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
182 |
+
<td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td>
|
183 |
+
<td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
184 |
+
</tr>
|
185 |
+
</table>
|
186 |
+
</fieldset>
|
187 |
+
|
188 |
+
<fieldset>
|
189 |
+
<legend>{#fullpage_dlg.appearance_linkprops}</legend>
|
190 |
+
|
191 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
192 |
+
<tr>
|
193 |
+
<td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td>
|
194 |
+
<td>
|
195 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
196 |
+
<tr>
|
197 |
+
<td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');FullPageDialog.changedStyleProp();" /></td>
|
198 |
+
<td id="link_color_pickcontainer"> </td>
|
199 |
+
</tr>
|
200 |
+
</table>
|
201 |
+
</td>
|
202 |
+
|
203 |
+
<td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td>
|
204 |
+
<td>
|
205 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
206 |
+
<tr>
|
207 |
+
<td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');FullPageDialog.changedStyleProp();" /></td>
|
208 |
+
<td id="visited_color_pickcontainer"> </td>
|
209 |
+
</tr>
|
210 |
+
</table>
|
211 |
+
</td>
|
212 |
+
</tr>
|
213 |
+
|
214 |
+
<tr>
|
215 |
+
<td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td>
|
216 |
+
<td>
|
217 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
218 |
+
<tr>
|
219 |
+
<td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');FullPageDialog.changedStyleProp();" /></td>
|
220 |
+
<td id="active_color_pickcontainer"> </td>
|
221 |
+
</tr>
|
222 |
+
</table>
|
223 |
+
</td>
|
224 |
+
|
225 |
+
<td> </td>
|
226 |
+
<td> </td>
|
227 |
+
</tr>
|
228 |
+
</table>
|
229 |
+
</fieldset>
|
230 |
+
|
231 |
+
<fieldset>
|
232 |
+
<legend>{#fullpage_dlg.appearance_style}</legend>
|
233 |
+
|
234 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
235 |
+
<tr>
|
236 |
+
<td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td>
|
237 |
+
<td><table border="0" cellpadding="0" cellspacing="0">
|
238 |
+
<tr>
|
239 |
+
<td><input id="stylesheet" name="stylesheet" type="text" value="" /></td>
|
240 |
+
<td id="stylesheet_browsercontainer"> </td>
|
241 |
+
</tr>
|
242 |
+
</table></td>
|
243 |
+
</tr>
|
244 |
+
<tr>
|
245 |
+
<td class="column1"><label for="style">{#fullpage_dlg.style}</label></td>
|
246 |
+
<td><input id="style" name="style" type="text" value="" onchange="FullPageDialog.changedStyle();" /></td>
|
247 |
+
</tr>
|
248 |
+
</table>
|
249 |
+
</fieldset>
|
250 |
+
</div>
|
251 |
+
</div>
|
252 |
+
|
253 |
+
<div class="mceActionPanel">
|
254 |
+
<input type="submit" id="insert" name="update" value="{#update}" />
|
255 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
256 |
+
</div>
|
257 |
+
</form>
|
258 |
+
</body>
|
259 |
+
</html>
|
js/libraries/tiny_mce/plugins/fullpage/js/fullpage.js
CHANGED
@@ -1,232 +1,232 @@
|
|
1 |
-
/**
|
2 |
-
* fullpage.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinyMCEPopup.requireLangPack();
|
13 |
-
|
14 |
-
var defaultDocTypes =
|
15 |
-
'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +
|
16 |
-
'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +
|
17 |
-
'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +
|
18 |
-
'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +
|
19 |
-
'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +
|
20 |
-
'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
|
21 |
-
'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
|
22 |
-
|
23 |
-
var defaultEncodings =
|
24 |
-
'Western european (iso-8859-1)=iso-8859-1,' +
|
25 |
-
'Central European (iso-8859-2)=iso-8859-2,' +
|
26 |
-
'Unicode (UTF-8)=utf-8,' +
|
27 |
-
'Chinese traditional (Big5)=big5,' +
|
28 |
-
'Cyrillic (iso-8859-5)=iso-8859-5,' +
|
29 |
-
'Japanese (iso-2022-jp)=iso-2022-jp,' +
|
30 |
-
'Greek (iso-8859-7)=iso-8859-7,' +
|
31 |
-
'Korean (iso-2022-kr)=iso-2022-kr,' +
|
32 |
-
'ASCII (us-ascii)=us-ascii';
|
33 |
-
|
34 |
-
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';
|
35 |
-
var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
|
36 |
-
|
37 |
-
function setVal(id, value) {
|
38 |
-
var elm = document.getElementById(id);
|
39 |
-
|
40 |
-
if (elm) {
|
41 |
-
value = value || '';
|
42 |
-
|
43 |
-
if (elm.nodeName == "SELECT")
|
44 |
-
selectByValue(document.forms[0], id, value);
|
45 |
-
else if (elm.type == "checkbox")
|
46 |
-
elm.checked = !!value;
|
47 |
-
else
|
48 |
-
elm.value = value;
|
49 |
-
}
|
50 |
-
};
|
51 |
-
|
52 |
-
function getVal(id) {
|
53 |
-
var elm = document.getElementById(id);
|
54 |
-
|
55 |
-
if (elm.nodeName == "SELECT")
|
56 |
-
return elm.options[elm.selectedIndex].value;
|
57 |
-
|
58 |
-
if (elm.type == "checkbox")
|
59 |
-
return elm.checked;
|
60 |
-
|
61 |
-
return elm.value;
|
62 |
-
};
|
63 |
-
|
64 |
-
window.FullPageDialog = {
|
65 |
-
changedStyle : function() {
|
66 |
-
var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style'));
|
67 |
-
|
68 |
-
setVal('fontface', styles['font-face']);
|
69 |
-
setVal('fontsize', styles['font-size']);
|
70 |
-
setVal('textcolor', styles['color']);
|
71 |
-
|
72 |
-
if (val = styles['background-image'])
|
73 |
-
setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"));
|
74 |
-
else
|
75 |
-
setVal('bgimage', '');
|
76 |
-
|
77 |
-
setVal('bgcolor', styles['background-color']);
|
78 |
-
|
79 |
-
// Reset margin form elements
|
80 |
-
setVal('topmargin', '');
|
81 |
-
setVal('rightmargin', '');
|
82 |
-
setVal('bottommargin', '');
|
83 |
-
setVal('leftmargin', '');
|
84 |
-
|
85 |
-
// Expand margin
|
86 |
-
if (val = styles['margin']) {
|
87 |
-
val = val.split(' ');
|
88 |
-
styles['margin-top'] = val[0] || '';
|
89 |
-
styles['margin-right'] = val[1] || val[0] || '';
|
90 |
-
styles['margin-bottom'] = val[2] || val[0] || '';
|
91 |
-
styles['margin-left'] = val[3] || val[0] || '';
|
92 |
-
}
|
93 |
-
|
94 |
-
if (val = styles['margin-top'])
|
95 |
-
setVal('topmargin', val.replace(/px/, ''));
|
96 |
-
|
97 |
-
if (val = styles['margin-right'])
|
98 |
-
setVal('rightmargin', val.replace(/px/, ''));
|
99 |
-
|
100 |
-
if (val = styles['margin-bottom'])
|
101 |
-
setVal('bottommargin', val.replace(/px/, ''));
|
102 |
-
|
103 |
-
if (val = styles['margin-left'])
|
104 |
-
setVal('leftmargin', val.replace(/px/, ''));
|
105 |
-
|
106 |
-
updateColor('bgcolor_pick', 'bgcolor');
|
107 |
-
updateColor('textcolor_pick', 'textcolor');
|
108 |
-
},
|
109 |
-
|
110 |
-
changedStyleProp : function() {
|
111 |
-
var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style'));
|
112 |
-
|
113 |
-
styles['font-face'] = getVal('fontface');
|
114 |
-
styles['font-size'] = getVal('fontsize');
|
115 |
-
styles['color'] = getVal('textcolor');
|
116 |
-
styles['background-color'] = getVal('bgcolor');
|
117 |
-
|
118 |
-
if (val = getVal('bgimage'))
|
119 |
-
styles['background-image'] = "url('" + val + "')";
|
120 |
-
else
|
121 |
-
styles['background-image'] = '';
|
122 |
-
|
123 |
-
delete styles['margin'];
|
124 |
-
|
125 |
-
if (val = getVal('topmargin'))
|
126 |
-
styles['margin-top'] = val + "px";
|
127 |
-
else
|
128 |
-
styles['margin-top'] = '';
|
129 |
-
|
130 |
-
if (val = getVal('rightmargin'))
|
131 |
-
styles['margin-right'] = val + "px";
|
132 |
-
else
|
133 |
-
styles['margin-right'] = '';
|
134 |
-
|
135 |
-
if (val = getVal('bottommargin'))
|
136 |
-
styles['margin-bottom'] = val + "px";
|
137 |
-
else
|
138 |
-
styles['margin-bottom'] = '';
|
139 |
-
|
140 |
-
if (val = getVal('leftmargin'))
|
141 |
-
styles['margin-left'] = val + "px";
|
142 |
-
else
|
143 |
-
styles['margin-left'] = '';
|
144 |
-
|
145 |
-
// Serialize, parse and reserialize this will compress redundant styles
|
146 |
-
setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles))));
|
147 |
-
this.changedStyle();
|
148 |
-
},
|
149 |
-
|
150 |
-
update : function() {
|
151 |
-
var data = {};
|
152 |
-
|
153 |
-
tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) {
|
154 |
-
data[node.id] = getVal(node.id);
|
155 |
-
});
|
156 |
-
|
157 |
-
tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data);
|
158 |
-
tinyMCEPopup.close();
|
159 |
-
}
|
160 |
-
};
|
161 |
-
|
162 |
-
function init() {
|
163 |
-
var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor;
|
164 |
-
|
165 |
-
// Setup doctype select box
|
166 |
-
list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(',');
|
167 |
-
for (i = 0; i < list.length; i++) {
|
168 |
-
item = list[i].split('=');
|
169 |
-
|
170 |
-
if (item.length > 1)
|
171 |
-
addSelectValue(form, 'doctype', item[0], item[1]);
|
172 |
-
}
|
173 |
-
|
174 |
-
// Setup fonts select box
|
175 |
-
list = editor.getParam("fullpage_fonts", defaultFontNames).split(';');
|
176 |
-
for (i = 0; i < list.length; i++) {
|
177 |
-
item = list[i].split('=');
|
178 |
-
|
179 |
-
if (item.length > 1)
|
180 |
-
addSelectValue(form, 'fontface', item[0], item[1]);
|
181 |
-
}
|
182 |
-
|
183 |
-
// Setup fontsize select box
|
184 |
-
list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(',');
|
185 |
-
for (i = 0; i < list.length; i++)
|
186 |
-
addSelectValue(form, 'fontsize', list[i], list[i]);
|
187 |
-
|
188 |
-
// Setup encodings select box
|
189 |
-
list = editor.getParam("fullpage_encodings", defaultEncodings).split(',');
|
190 |
-
for (i = 0; i < list.length; i++) {
|
191 |
-
item = list[i].split('=');
|
192 |
-
|
193 |
-
if (item.length > 1)
|
194 |
-
addSelectValue(form, 'docencoding', item[0], item[1]);
|
195 |
-
}
|
196 |
-
|
197 |
-
// Setup color pickers
|
198 |
-
document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
|
199 |
-
document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');
|
200 |
-
document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');
|
201 |
-
document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');
|
202 |
-
document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');
|
203 |
-
document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');
|
204 |
-
document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');
|
205 |
-
|
206 |
-
// Resize some elements
|
207 |
-
if (isVisible('stylesheetbrowser'))
|
208 |
-
document.getElementById('stylesheet').style.width = '220px';
|
209 |
-
|
210 |
-
if (isVisible('link_href_browser'))
|
211 |
-
document.getElementById('element_link_href').style.width = '230px';
|
212 |
-
|
213 |
-
if (isVisible('bgimage_browser'))
|
214 |
-
document.getElementById('bgimage').style.width = '210px';
|
215 |
-
|
216 |
-
// Update form
|
217 |
-
tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) {
|
218 |
-
setVal(key, value);
|
219 |
-
});
|
220 |
-
|
221 |
-
FullPageDialog.changedStyle();
|
222 |
-
|
223 |
-
// Update colors
|
224 |
-
updateColor('textcolor_pick', 'textcolor');
|
225 |
-
updateColor('bgcolor_pick', 'bgcolor');
|
226 |
-
updateColor('visited_color_pick', 'visited_color');
|
227 |
-
updateColor('active_color_pick', 'active_color');
|
228 |
-
updateColor('link_color_pick', 'link_color');
|
229 |
-
};
|
230 |
-
|
231 |
-
tinyMCEPopup.onInit.add(init);
|
232 |
-
})();
|
1 |
+
/**
|
2 |
+
* fullpage.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinyMCEPopup.requireLangPack();
|
13 |
+
|
14 |
+
var defaultDocTypes =
|
15 |
+
'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +
|
16 |
+
'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +
|
17 |
+
'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +
|
18 |
+
'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +
|
19 |
+
'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +
|
20 |
+
'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
|
21 |
+
'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
|
22 |
+
|
23 |
+
var defaultEncodings =
|
24 |
+
'Western european (iso-8859-1)=iso-8859-1,' +
|
25 |
+
'Central European (iso-8859-2)=iso-8859-2,' +
|
26 |
+
'Unicode (UTF-8)=utf-8,' +
|
27 |
+
'Chinese traditional (Big5)=big5,' +
|
28 |
+
'Cyrillic (iso-8859-5)=iso-8859-5,' +
|
29 |
+
'Japanese (iso-2022-jp)=iso-2022-jp,' +
|
30 |
+
'Greek (iso-8859-7)=iso-8859-7,' +
|
31 |
+
'Korean (iso-2022-kr)=iso-2022-kr,' +
|
32 |
+
'ASCII (us-ascii)=us-ascii';
|
33 |
+
|
34 |
+
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';
|
35 |
+
var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
|
36 |
+
|
37 |
+
function setVal(id, value) {
|
38 |
+
var elm = document.getElementById(id);
|
39 |
+
|
40 |
+
if (elm) {
|
41 |
+
value = value || '';
|
42 |
+
|
43 |
+
if (elm.nodeName == "SELECT")
|
44 |
+
selectByValue(document.forms[0], id, value);
|
45 |
+
else if (elm.type == "checkbox")
|
46 |
+
elm.checked = !!value;
|
47 |
+
else
|
48 |
+
elm.value = value;
|
49 |
+
}
|
50 |
+
};
|
51 |
+
|
52 |
+
function getVal(id) {
|
53 |
+
var elm = document.getElementById(id);
|
54 |
+
|
55 |
+
if (elm.nodeName == "SELECT")
|
56 |
+
return elm.options[elm.selectedIndex].value;
|
57 |
+
|
58 |
+
if (elm.type == "checkbox")
|
59 |
+
return elm.checked;
|
60 |
+
|
61 |
+
return elm.value;
|
62 |
+
};
|
63 |
+
|
64 |
+
window.FullPageDialog = {
|
65 |
+
changedStyle : function() {
|
66 |
+
var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style'));
|
67 |
+
|
68 |
+
setVal('fontface', styles['font-face']);
|
69 |
+
setVal('fontsize', styles['font-size']);
|
70 |
+
setVal('textcolor', styles['color']);
|
71 |
+
|
72 |
+
if (val = styles['background-image'])
|
73 |
+
setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"));
|
74 |
+
else
|
75 |
+
setVal('bgimage', '');
|
76 |
+
|
77 |
+
setVal('bgcolor', styles['background-color']);
|
78 |
+
|
79 |
+
// Reset margin form elements
|
80 |
+
setVal('topmargin', '');
|
81 |
+
setVal('rightmargin', '');
|
82 |
+
setVal('bottommargin', '');
|
83 |
+
setVal('leftmargin', '');
|
84 |
+
|
85 |
+
// Expand margin
|
86 |
+
if (val = styles['margin']) {
|
87 |
+
val = val.split(' ');
|
88 |
+
styles['margin-top'] = val[0] || '';
|
89 |
+
styles['margin-right'] = val[1] || val[0] || '';
|
90 |
+
styles['margin-bottom'] = val[2] || val[0] || '';
|
91 |
+
styles['margin-left'] = val[3] || val[0] || '';
|
92 |
+
}
|
93 |
+
|
94 |
+
if (val = styles['margin-top'])
|
95 |
+
setVal('topmargin', val.replace(/px/, ''));
|
96 |
+
|
97 |
+
if (val = styles['margin-right'])
|
98 |
+
setVal('rightmargin', val.replace(/px/, ''));
|
99 |
+
|
100 |
+
if (val = styles['margin-bottom'])
|
101 |
+
setVal('bottommargin', val.replace(/px/, ''));
|
102 |
+
|
103 |
+
if (val = styles['margin-left'])
|
104 |
+
setVal('leftmargin', val.replace(/px/, ''));
|
105 |
+
|
106 |
+
updateColor('bgcolor_pick', 'bgcolor');
|
107 |
+
updateColor('textcolor_pick', 'textcolor');
|
108 |
+
},
|
109 |
+
|
110 |
+
changedStyleProp : function() {
|
111 |
+
var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style'));
|
112 |
+
|
113 |
+
styles['font-face'] = getVal('fontface');
|
114 |
+
styles['font-size'] = getVal('fontsize');
|
115 |
+
styles['color'] = getVal('textcolor');
|
116 |
+
styles['background-color'] = getVal('bgcolor');
|
117 |
+
|
118 |
+
if (val = getVal('bgimage'))
|
119 |
+
styles['background-image'] = "url('" + val + "')";
|
120 |
+
else
|
121 |
+
styles['background-image'] = '';
|
122 |
+
|
123 |
+
delete styles['margin'];
|
124 |
+
|
125 |
+
if (val = getVal('topmargin'))
|
126 |
+
styles['margin-top'] = val + "px";
|
127 |
+
else
|
128 |
+
styles['margin-top'] = '';
|
129 |
+
|
130 |
+
if (val = getVal('rightmargin'))
|
131 |
+
styles['margin-right'] = val + "px";
|
132 |
+
else
|
133 |
+
styles['margin-right'] = '';
|
134 |
+
|
135 |
+
if (val = getVal('bottommargin'))
|
136 |
+
styles['margin-bottom'] = val + "px";
|
137 |
+
else
|
138 |
+
styles['margin-bottom'] = '';
|
139 |
+
|
140 |
+
if (val = getVal('leftmargin'))
|
141 |
+
styles['margin-left'] = val + "px";
|
142 |
+
else
|
143 |
+
styles['margin-left'] = '';
|
144 |
+
|
145 |
+
// Serialize, parse and reserialize this will compress redundant styles
|
146 |
+
setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles))));
|
147 |
+
this.changedStyle();
|
148 |
+
},
|
149 |
+
|
150 |
+
update : function() {
|
151 |
+
var data = {};
|
152 |
+
|
153 |
+
tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) {
|
154 |
+
data[node.id] = getVal(node.id);
|
155 |
+
});
|
156 |
+
|
157 |
+
tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data);
|
158 |
+
tinyMCEPopup.close();
|
159 |
+
}
|
160 |
+
};
|
161 |
+
|
162 |
+
function init() {
|
163 |
+
var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor;
|
164 |
+
|
165 |
+
// Setup doctype select box
|
166 |
+
list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(',');
|
167 |
+
for (i = 0; i < list.length; i++) {
|
168 |
+
item = list[i].split('=');
|
169 |
+
|
170 |
+
if (item.length > 1)
|
171 |
+
addSelectValue(form, 'doctype', item[0], item[1]);
|
172 |
+
}
|
173 |
+
|
174 |
+
// Setup fonts select box
|
175 |
+
list = editor.getParam("fullpage_fonts", defaultFontNames).split(';');
|
176 |
+
for (i = 0; i < list.length; i++) {
|
177 |
+
item = list[i].split('=');
|
178 |
+
|
179 |
+
if (item.length > 1)
|
180 |
+
addSelectValue(form, 'fontface', item[0], item[1]);
|
181 |
+
}
|
182 |
+
|
183 |
+
// Setup fontsize select box
|
184 |
+
list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(',');
|
185 |
+
for (i = 0; i < list.length; i++)
|
186 |
+
addSelectValue(form, 'fontsize', list[i], list[i]);
|
187 |
+
|
188 |
+
// Setup encodings select box
|
189 |
+
list = editor.getParam("fullpage_encodings", defaultEncodings).split(',');
|
190 |
+
for (i = 0; i < list.length; i++) {
|
191 |
+
item = list[i].split('=');
|
192 |
+
|
193 |
+
if (item.length > 1)
|
194 |
+
addSelectValue(form, 'docencoding', item[0], item[1]);
|
195 |
+
}
|
196 |
+
|
197 |
+
// Setup color pickers
|
198 |
+
document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
|
199 |
+
document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');
|
200 |
+
document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');
|
201 |
+
document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');
|
202 |
+
document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');
|
203 |
+
document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');
|
204 |
+
document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');
|
205 |
+
|
206 |
+
// Resize some elements
|
207 |
+
if (isVisible('stylesheetbrowser'))
|
208 |
+
document.getElementById('stylesheet').style.width = '220px';
|
209 |
+
|
210 |
+
if (isVisible('link_href_browser'))
|
211 |
+
document.getElementById('element_link_href').style.width = '230px';
|
212 |
+
|
213 |
+
if (isVisible('bgimage_browser'))
|
214 |
+
document.getElementById('bgimage').style.width = '210px';
|
215 |
+
|
216 |
+
// Update form
|
217 |
+
tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) {
|
218 |
+
setVal(key, value);
|
219 |
+
});
|
220 |
+
|
221 |
+
FullPageDialog.changedStyle();
|
222 |
+
|
223 |
+
// Update colors
|
224 |
+
updateColor('textcolor_pick', 'textcolor');
|
225 |
+
updateColor('bgcolor_pick', 'bgcolor');
|
226 |
+
updateColor('visited_color_pick', 'visited_color');
|
227 |
+
updateColor('active_color_pick', 'active_color');
|
228 |
+
updateColor('link_color_pick', 'link_color');
|
229 |
+
};
|
230 |
+
|
231 |
+
tinyMCEPopup.onInit.add(init);
|
232 |
+
})();
|
js/libraries/tiny_mce/plugins/fullscreen/editor_plugin_src.js
CHANGED
@@ -1,159 +1,159 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
var DOM = tinymce.DOM;
|
13 |
-
|
14 |
-
tinymce.create('tinymce.plugins.FullScreenPlugin', {
|
15 |
-
init : function(ed, url) {
|
16 |
-
var t = this, s = {}, vp, posCss;
|
17 |
-
|
18 |
-
t.editor = ed;
|
19 |
-
|
20 |
-
// Register commands
|
21 |
-
ed.addCommand('mceFullScreen', function() {
|
22 |
-
var win, de = DOM.doc.documentElement;
|
23 |
-
|
24 |
-
if (ed.getParam('fullscreen_is_enabled')) {
|
25 |
-
if (ed.getParam('fullscreen_new_window'))
|
26 |
-
closeFullscreen(); // Call to close in new window
|
27 |
-
else {
|
28 |
-
DOM.win.setTimeout(function() {
|
29 |
-
tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
|
30 |
-
tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent());
|
31 |
-
tinyMCE.remove(ed);
|
32 |
-
DOM.remove('mce_fullscreen_container');
|
33 |
-
de.style.overflow = ed.getParam('fullscreen_html_overflow');
|
34 |
-
DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));
|
35 |
-
DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
|
36 |
-
tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
|
37 |
-
}, 10);
|
38 |
-
}
|
39 |
-
|
40 |
-
return;
|
41 |
-
}
|
42 |
-
|
43 |
-
if (ed.getParam('fullscreen_new_window')) {
|
44 |
-
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);
|
45 |
-
try {
|
46 |
-
win.resizeTo(screen.availWidth, screen.availHeight);
|
47 |
-
} catch (e) {
|
48 |
-
// Ignore
|
49 |
-
}
|
50 |
-
} else {
|
51 |
-
tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
|
52 |
-
s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
|
53 |
-
s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
|
54 |
-
vp = DOM.getViewPort();
|
55 |
-
s.fullscreen_scrollx = vp.x;
|
56 |
-
s.fullscreen_scrolly = vp.y;
|
57 |
-
|
58 |
-
// Fixes an Opera bug where the scrollbars doesn't reappear
|
59 |
-
if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
|
60 |
-
s.fullscreen_overflow = 'auto';
|
61 |
-
|
62 |
-
// Fixes an IE bug where horizontal scrollbars would appear
|
63 |
-
if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
|
64 |
-
s.fullscreen_overflow = 'auto';
|
65 |
-
|
66 |
-
// Fixes an IE bug where the scrollbars doesn't reappear
|
67 |
-
if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
|
68 |
-
s.fullscreen_html_overflow = 'auto';
|
69 |
-
|
70 |
-
if (s.fullscreen_overflow == '0px')
|
71 |
-
s.fullscreen_overflow = '';
|
72 |
-
|
73 |
-
DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
|
74 |
-
de.style.overflow = 'hidden'; //Fix for IE6/7
|
75 |
-
vp = DOM.getViewPort();
|
76 |
-
DOM.win.scrollTo(0, 0);
|
77 |
-
|
78 |
-
if (tinymce.isIE)
|
79 |
-
vp.h -= 1;
|
80 |
-
|
81 |
-
// Use fixed position if it exists
|
82 |
-
if (tinymce.isIE6 || document.compatMode == 'BackCompat')
|
83 |
-
posCss = 'absolute;top:' + vp.y;
|
84 |
-
else
|
85 |
-
posCss = 'fixed;top:0';
|
86 |
-
|
87 |
-
n = DOM.add(DOM.doc.body, 'div', {
|
88 |
-
id : 'mce_fullscreen_container',
|
89 |
-
style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
|
90 |
-
DOM.add(n, 'div', {id : 'mce_fullscreen'});
|
91 |
-
|
92 |
-
tinymce.each(ed.settings, function(v, n) {
|
93 |
-
s[n] = v;
|
94 |
-
});
|
95 |
-
|
96 |
-
s.id = 'mce_fullscreen';
|
97 |
-
s.width = n.clientWidth;
|
98 |
-
s.height = n.clientHeight - 15;
|
99 |
-
s.fullscreen_is_enabled = true;
|
100 |
-
s.fullscreen_editor_id = ed.id;
|
101 |
-
s.theme_advanced_resizing = false;
|
102 |
-
s.save_onsavecallback = function() {
|
103 |
-
ed.setContent(tinyMCE.get(s.id).getContent());
|
104 |
-
ed.execCommand('mceSave');
|
105 |
-
};
|
106 |
-
|
107 |
-
tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {
|
108 |
-
s[k] = v;
|
109 |
-
});
|
110 |
-
|
111 |
-
if (s.theme_advanced_toolbar_location === 'external')
|
112 |
-
s.theme_advanced_toolbar_location = 'top';
|
113 |
-
|
114 |
-
t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
|
115 |
-
t.fullscreenEditor.onInit.add(function() {
|
116 |
-
t.fullscreenEditor.setContent(ed.getContent());
|
117 |
-
t.fullscreenEditor.focus();
|
118 |
-
});
|
119 |
-
|
120 |
-
t.fullscreenEditor.render();
|
121 |
-
|
122 |
-
t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
|
123 |
-
t.fullscreenElement.update();
|
124 |
-
//document.body.overflow = 'hidden';
|
125 |
-
|
126 |
-
t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {
|
127 |
-
var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;
|
128 |
-
|
129 |
-
// Get outer/inner size to get a delta size that can be used to calc the new iframe size
|
130 |
-
outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]);
|
131 |
-
innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);
|
132 |
-
|
133 |
-
fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);
|
134 |
-
});
|
135 |
-
}
|
136 |
-
});
|
137 |
-
|
138 |
-
// Register buttons
|
139 |
-
ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});
|
140 |
-
|
141 |
-
ed.onNodeChange.add(function(ed, cm) {
|
142 |
-
cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
|
143 |
-
});
|
144 |
-
},
|
145 |
-
|
146 |
-
getInfo : function() {
|
147 |
-
return {
|
148 |
-
longname : 'Fullscreen',
|
149 |
-
author : 'Moxiecode Systems AB',
|
150 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
151 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',
|
152 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
153 |
-
};
|
154 |
-
}
|
155 |
-
});
|
156 |
-
|
157 |
-
// Register plugin
|
158 |
-
tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
|
159 |
-
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var DOM = tinymce.DOM;
|
13 |
+
|
14 |
+
tinymce.create('tinymce.plugins.FullScreenPlugin', {
|
15 |
+
init : function(ed, url) {
|
16 |
+
var t = this, s = {}, vp, posCss;
|
17 |
+
|
18 |
+
t.editor = ed;
|
19 |
+
|
20 |
+
// Register commands
|
21 |
+
ed.addCommand('mceFullScreen', function() {
|
22 |
+
var win, de = DOM.doc.documentElement;
|
23 |
+
|
24 |
+
if (ed.getParam('fullscreen_is_enabled')) {
|
25 |
+
if (ed.getParam('fullscreen_new_window'))
|
26 |
+
closeFullscreen(); // Call to close in new window
|
27 |
+
else {
|
28 |
+
DOM.win.setTimeout(function() {
|
29 |
+
tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
|
30 |
+
tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent());
|
31 |
+
tinyMCE.remove(ed);
|
32 |
+
DOM.remove('mce_fullscreen_container');
|
33 |
+
de.style.overflow = ed.getParam('fullscreen_html_overflow');
|
34 |
+
DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));
|
35 |
+
DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
|
36 |
+
tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
|
37 |
+
}, 10);
|
38 |
+
}
|
39 |
+
|
40 |
+
return;
|
41 |
+
}
|
42 |
+
|
43 |
+
if (ed.getParam('fullscreen_new_window')) {
|
44 |
+
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);
|
45 |
+
try {
|
46 |
+
win.resizeTo(screen.availWidth, screen.availHeight);
|
47 |
+
} catch (e) {
|
48 |
+
// Ignore
|
49 |
+
}
|
50 |
+
} else {
|
51 |
+
tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
|
52 |
+
s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
|
53 |
+
s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
|
54 |
+
vp = DOM.getViewPort();
|
55 |
+
s.fullscreen_scrollx = vp.x;
|
56 |
+
s.fullscreen_scrolly = vp.y;
|
57 |
+
|
58 |
+
// Fixes an Opera bug where the scrollbars doesn't reappear
|
59 |
+
if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
|
60 |
+
s.fullscreen_overflow = 'auto';
|
61 |
+
|
62 |
+
// Fixes an IE bug where horizontal scrollbars would appear
|
63 |
+
if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
|
64 |
+
s.fullscreen_overflow = 'auto';
|
65 |
+
|
66 |
+
// Fixes an IE bug where the scrollbars doesn't reappear
|
67 |
+
if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
|
68 |
+
s.fullscreen_html_overflow = 'auto';
|
69 |
+
|
70 |
+
if (s.fullscreen_overflow == '0px')
|
71 |
+
s.fullscreen_overflow = '';
|
72 |
+
|
73 |
+
DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
|
74 |
+
de.style.overflow = 'hidden'; //Fix for IE6/7
|
75 |
+
vp = DOM.getViewPort();
|
76 |
+
DOM.win.scrollTo(0, 0);
|
77 |
+
|
78 |
+
if (tinymce.isIE)
|
79 |
+
vp.h -= 1;
|
80 |
+
|
81 |
+
// Use fixed position if it exists
|
82 |
+
if (tinymce.isIE6 || document.compatMode == 'BackCompat')
|
83 |
+
posCss = 'absolute;top:' + vp.y;
|
84 |
+
else
|
85 |
+
posCss = 'fixed;top:0';
|
86 |
+
|
87 |
+
n = DOM.add(DOM.doc.body, 'div', {
|
88 |
+
id : 'mce_fullscreen_container',
|
89 |
+
style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
|
90 |
+
DOM.add(n, 'div', {id : 'mce_fullscreen'});
|
91 |
+
|
92 |
+
tinymce.each(ed.settings, function(v, n) {
|
93 |
+
s[n] = v;
|
94 |
+
});
|
95 |
+
|
96 |
+
s.id = 'mce_fullscreen';
|
97 |
+
s.width = n.clientWidth;
|
98 |
+
s.height = n.clientHeight - 15;
|
99 |
+
s.fullscreen_is_enabled = true;
|
100 |
+
s.fullscreen_editor_id = ed.id;
|
101 |
+
s.theme_advanced_resizing = false;
|
102 |
+
s.save_onsavecallback = function() {
|
103 |
+
ed.setContent(tinyMCE.get(s.id).getContent());
|
104 |
+
ed.execCommand('mceSave');
|
105 |
+
};
|
106 |
+
|
107 |
+
tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {
|
108 |
+
s[k] = v;
|
109 |
+
});
|
110 |
+
|
111 |
+
if (s.theme_advanced_toolbar_location === 'external')
|
112 |
+
s.theme_advanced_toolbar_location = 'top';
|
113 |
+
|
114 |
+
t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
|
115 |
+
t.fullscreenEditor.onInit.add(function() {
|
116 |
+
t.fullscreenEditor.setContent(ed.getContent());
|
117 |
+
t.fullscreenEditor.focus();
|
118 |
+
});
|
119 |
+
|
120 |
+
t.fullscreenEditor.render();
|
121 |
+
|
122 |
+
t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
|
123 |
+
t.fullscreenElement.update();
|
124 |
+
//document.body.overflow = 'hidden';
|
125 |
+
|
126 |
+
t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {
|
127 |
+
var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;
|
128 |
+
|
129 |
+
// Get outer/inner size to get a delta size that can be used to calc the new iframe size
|
130 |
+
outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]);
|
131 |
+
innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);
|
132 |
+
|
133 |
+
fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);
|
134 |
+
});
|
135 |
+
}
|
136 |
+
});
|
137 |
+
|
138 |
+
// Register buttons
|
139 |
+
ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});
|
140 |
+
|
141 |
+
ed.onNodeChange.add(function(ed, cm) {
|
142 |
+
cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
|
143 |
+
});
|
144 |
+
},
|
145 |
+
|
146 |
+
getInfo : function() {
|
147 |
+
return {
|
148 |
+
longname : 'Fullscreen',
|
149 |
+
author : 'Moxiecode Systems AB',
|
150 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
151 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',
|
152 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
153 |
+
};
|
154 |
+
}
|
155 |
+
});
|
156 |
+
|
157 |
+
// Register plugin
|
158 |
+
tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
|
159 |
+
})();
|
js/libraries/tiny_mce/plugins/fullscreen/fullscreen.htm
CHANGED
@@ -1,110 +1,110 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
-
<head>
|
4 |
-
<title></title>
|
5 |
-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
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 |
-
</head>
|
100 |
-
<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
|
101 |
-
<form onsubmit="doParentSubmit();">
|
102 |
-
<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>
|
103 |
-
</form>
|
104 |
-
|
105 |
-
<script type="text/javascript">
|
106 |
-
render();
|
107 |
-
</script>
|
108 |
-
|
109 |
-
</body>
|
110 |
-
</html>
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title></title>
|
5 |
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
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 |
+
</head>
|
100 |
+
<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
|
101 |
+
<form onsubmit="doParentSubmit();">
|
102 |
+
<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>
|
103 |
+
</form>
|
104 |
+
|
105 |
+
<script type="text/javascript">
|
106 |
+
render();
|
107 |
+
</script>
|
108 |
+
|
109 |
+
</body>
|
110 |
+
</html>
|
js/libraries/tiny_mce/plugins/iespell/editor_plugin_src.js
CHANGED
@@ -1,54 +1,54 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.IESpell', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
var t = this, sp;
|
15 |
-
|
16 |
-
if (!tinymce.isIE)
|
17 |
-
return;
|
18 |
-
|
19 |
-
t.editor = ed;
|
20 |
-
|
21 |
-
// Register commands
|
22 |
-
ed.addCommand('mceIESpell', function() {
|
23 |
-
try {
|
24 |
-
sp = new ActiveXObject("ieSpell.ieSpellExtension");
|
25 |
-
sp.CheckDocumentNode(ed.getDoc().documentElement);
|
26 |
-
} catch (e) {
|
27 |
-
if (e.number == -2146827859) {
|
28 |
-
ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {
|
29 |
-
if (s)
|
30 |
-
window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
|
31 |
-
});
|
32 |
-
} else
|
33 |
-
ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);
|
34 |
-
}
|
35 |
-
});
|
36 |
-
|
37 |
-
// Register buttons
|
38 |
-
ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});
|
39 |
-
},
|
40 |
-
|
41 |
-
getInfo : function() {
|
42 |
-
return {
|
43 |
-
longname : 'IESpell (IE Only)',
|
44 |
-
author : 'Moxiecode Systems AB',
|
45 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
46 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',
|
47 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
48 |
-
};
|
49 |
-
}
|
50 |
-
});
|
51 |
-
|
52 |
-
// Register plugin
|
53 |
-
tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);
|
54 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.IESpell', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this, sp;
|
15 |
+
|
16 |
+
if (!tinymce.isIE)
|
17 |
+
return;
|
18 |
+
|
19 |
+
t.editor = ed;
|
20 |
+
|
21 |
+
// Register commands
|
22 |
+
ed.addCommand('mceIESpell', function() {
|
23 |
+
try {
|
24 |
+
sp = new ActiveXObject("ieSpell.ieSpellExtension");
|
25 |
+
sp.CheckDocumentNode(ed.getDoc().documentElement);
|
26 |
+
} catch (e) {
|
27 |
+
if (e.number == -2146827859) {
|
28 |
+
ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {
|
29 |
+
if (s)
|
30 |
+
window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
|
31 |
+
});
|
32 |
+
} else
|
33 |
+
ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);
|
34 |
+
}
|
35 |
+
});
|
36 |
+
|
37 |
+
// Register buttons
|
38 |
+
ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});
|
39 |
+
},
|
40 |
+
|
41 |
+
getInfo : function() {
|
42 |
+
return {
|
43 |
+
longname : 'IESpell (IE Only)',
|
44 |
+
author : 'Moxiecode Systems AB',
|
45 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
46 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',
|
47 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
48 |
+
};
|
49 |
+
}
|
50 |
+
});
|
51 |
+
|
52 |
+
// Register plugin
|
53 |
+
tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);
|
54 |
})();
|
js/libraries/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
CHANGED
@@ -1,699 +1,699 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;
|
13 |
-
|
14 |
-
tinymce.create('tinymce.plugins.InlinePopups', {
|
15 |
-
init : function(ed, url) {
|
16 |
-
// Replace window manager
|
17 |
-
ed.onBeforeRenderUI.add(function() {
|
18 |
-
ed.windowManager = new tinymce.InlineWindowManager(ed);
|
19 |
-
DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css");
|
20 |
-
});
|
21 |
-
},
|
22 |
-
|
23 |
-
getInfo : function() {
|
24 |
-
return {
|
25 |
-
longname : 'InlinePopups',
|
26 |
-
author : 'Moxiecode Systems AB',
|
27 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
28 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
|
29 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
30 |
-
};
|
31 |
-
}
|
32 |
-
});
|
33 |
-
|
34 |
-
tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', {
|
35 |
-
InlineWindowManager : function(ed) {
|
36 |
-
var t = this;
|
37 |
-
|
38 |
-
t.parent(ed);
|
39 |
-
t.zIndex = 300000;
|
40 |
-
t.count = 0;
|
41 |
-
t.windows = {};
|
42 |
-
},
|
43 |
-
|
44 |
-
open : function(f, p) {
|
45 |
-
var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow;
|
46 |
-
|
47 |
-
f = f || {};
|
48 |
-
p = p || {};
|
49 |
-
|
50 |
-
// Run native windows
|
51 |
-
if (!f.inline)
|
52 |
-
return t.parent(f, p);
|
53 |
-
|
54 |
-
parentWindow = t._frontWindow();
|
55 |
-
if (parentWindow && DOM.get(parentWindow.id + '_ifr')) {
|
56 |
-
parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;
|
57 |
-
}
|
58 |
-
|
59 |
-
// Only store selection if the type is a normal window
|
60 |
-
if (!f.type)
|
61 |
-
t.bookmark = ed.selection.getBookmark(1);
|
62 |
-
|
63 |
-
id = DOM.uniqueId();
|
64 |
-
vp = DOM.getViewPort();
|
65 |
-
f.width = parseInt(f.width || 320);
|
66 |
-
f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
|
67 |
-
f.min_width = parseInt(f.min_width || 150);
|
68 |
-
f.min_height = parseInt(f.min_height || 100);
|
69 |
-
f.max_width = parseInt(f.max_width || 2000);
|
70 |
-
f.max_height = parseInt(f.max_height || 2000);
|
71 |
-
f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0)));
|
72 |
-
f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0)));
|
73 |
-
f.movable = f.resizable = true;
|
74 |
-
p.mce_width = f.width;
|
75 |
-
p.mce_height = f.height;
|
76 |
-
p.mce_inline = true;
|
77 |
-
p.mce_window_id = id;
|
78 |
-
p.mce_auto_focus = f.auto_focus;
|
79 |
-
|
80 |
-
// Transpose
|
81 |
-
// po = DOM.getPos(ed.getContainer());
|
82 |
-
// f.left -= po.x;
|
83 |
-
// f.top -= po.y;
|
84 |
-
|
85 |
-
t.features = f;
|
86 |
-
t.params = p;
|
87 |
-
t.onOpen.dispatch(t, f, p);
|
88 |
-
|
89 |
-
if (f.type) {
|
90 |
-
opt += ' mceModal';
|
91 |
-
|
92 |
-
if (f.type)
|
93 |
-
opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1);
|
94 |
-
|
95 |
-
f.resizable = false;
|
96 |
-
}
|
97 |
-
|
98 |
-
if (f.statusbar)
|
99 |
-
opt += ' mceStatusbar';
|
100 |
-
|
101 |
-
if (f.resizable)
|
102 |
-
opt += ' mceResizable';
|
103 |
-
|
104 |
-
if (f.minimizable)
|
105 |
-
opt += ' mceMinimizable';
|
106 |
-
|
107 |
-
if (f.maximizable)
|
108 |
-
opt += ' mceMaximizable';
|
109 |
-
|
110 |
-
if (f.movable)
|
111 |
-
opt += ' mceMovable';
|
112 |
-
|
113 |
-
// Create DOM objects
|
114 |
-
t._addAll(DOM.doc.body,
|
115 |
-
['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
|
116 |
-
['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
|
117 |
-
['div', {id : id + '_top', 'class' : 'mceTop'},
|
118 |
-
['div', {'class' : 'mceLeft'}],
|
119 |
-
['div', {'class' : 'mceCenter'}],
|
120 |
-
['div', {'class' : 'mceRight'}],
|
121 |
-
['span', {id : id + '_title'}, f.title || '']
|
122 |
-
],
|
123 |
-
|
124 |
-
['div', {id : id + '_middle', 'class' : 'mceMiddle'},
|
125 |
-
['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}],
|
126 |
-
['span', {id : id + '_content'}],
|
127 |
-
['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]
|
128 |
-
],
|
129 |
-
|
130 |
-
['div', {id : id + '_bottom', 'class' : 'mceBottom'},
|
131 |
-
['div', {'class' : 'mceLeft'}],
|
132 |
-
['div', {'class' : 'mceCenter'}],
|
133 |
-
['div', {'class' : 'mceRight'}],
|
134 |
-
['span', {id : id + '_status'}, 'Content']
|
135 |
-
],
|
136 |
-
|
137 |
-
['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}],
|
138 |
-
['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
|
139 |
-
['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
|
140 |
-
['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
|
141 |
-
['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
|
142 |
-
['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}],
|
143 |
-
['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}],
|
144 |
-
['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}],
|
145 |
-
['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}],
|
146 |
-
['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}],
|
147 |
-
['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}],
|
148 |
-
['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}],
|
149 |
-
['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}]
|
150 |
-
]
|
151 |
-
]
|
152 |
-
);
|
153 |
-
|
154 |
-
DOM.setStyles(id, {top : -10000, left : -10000});
|
155 |
-
|
156 |
-
// Fix gecko rendering bug, where the editors iframe messed with window contents
|
157 |
-
if (tinymce.isGecko)
|
158 |
-
DOM.setStyle(id, 'overflow', 'auto');
|
159 |
-
|
160 |
-
// Measure borders
|
161 |
-
if (!f.type) {
|
162 |
-
dw += DOM.get(id + '_left').clientWidth;
|
163 |
-
dw += DOM.get(id + '_right').clientWidth;
|
164 |
-
dh += DOM.get(id + '_top').clientHeight;
|
165 |
-
dh += DOM.get(id + '_bottom').clientHeight;
|
166 |
-
}
|
167 |
-
|
168 |
-
// Resize window
|
169 |
-
DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});
|
170 |
-
|
171 |
-
u = f.url || f.file;
|
172 |
-
if (u) {
|
173 |
-
if (tinymce.relaxedDomain)
|
174 |
-
u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;
|
175 |
-
|
176 |
-
u = tinymce._addVer(u);
|
177 |
-
}
|
178 |
-
|
179 |
-
if (!f.type) {
|
180 |
-
DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});
|
181 |
-
DOM.setStyles(id + '_ifr', {width : f.width, height : f.height});
|
182 |
-
DOM.setAttrib(id + '_ifr', 'src', u);
|
183 |
-
} else {
|
184 |
-
DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok');
|
185 |
-
|
186 |
-
if (f.type == 'confirm')
|
187 |
-
DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel');
|
188 |
-
|
189 |
-
DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
|
190 |
-
DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
|
191 |
-
|
192 |
-
Event.add(id, 'keyup', function(evt) {
|
193 |
-
var VK_ESCAPE = 27;
|
194 |
-
if (evt.keyCode === VK_ESCAPE) {
|
195 |
-
f.button_func(false);
|
196 |
-
return Event.cancel(evt);
|
197 |
-
}
|
198 |
-
});
|
199 |
-
|
200 |
-
Event.add(id, 'keydown', function(evt) {
|
201 |
-
var cancelButton, VK_TAB = 9;
|
202 |
-
if (evt.keyCode === VK_TAB) {
|
203 |
-
cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0];
|
204 |
-
if (cancelButton && cancelButton !== evt.target) {
|
205 |
-
cancelButton.focus();
|
206 |
-
} else {
|
207 |
-
DOM.get(id + '_ok').focus();
|
208 |
-
}
|
209 |
-
return Event.cancel(evt);
|
210 |
-
}
|
211 |
-
});
|
212 |
-
}
|
213 |
-
|
214 |
-
// Register events
|
215 |
-
mdf = Event.add(id, 'mousedown', function(e) {
|
216 |
-
var n = e.target, w, vp;
|
217 |
-
|
218 |
-
w = t.windows[id];
|
219 |
-
t.focus(id);
|
220 |
-
|
221 |
-
if (n.nodeName == 'A' || n.nodeName == 'a') {
|
222 |
-
if (n.className == 'mceClose') {
|
223 |
-
t.close(null, id);
|
224 |
-
return Event.cancel(e);
|
225 |
-
} else if (n.className == 'mceMax') {
|
226 |
-
w.oldPos = w.element.getXY();
|
227 |
-
w.oldSize = w.element.getSize();
|
228 |
-
|
229 |
-
vp = DOM.getViewPort();
|
230 |
-
|
231 |
-
// Reduce viewport size to avoid scrollbars
|
232 |
-
vp.w -= 2;
|
233 |
-
vp.h -= 2;
|
234 |
-
|
235 |
-
w.element.moveTo(vp.x, vp.y);
|
236 |
-
w.element.resizeTo(vp.w, vp.h);
|
237 |
-
DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight});
|
238 |
-
DOM.addClass(id + '_wrapper', 'mceMaximized');
|
239 |
-
} else if (n.className == 'mceMed') {
|
240 |
-
// Reset to old size
|
241 |
-
w.element.moveTo(w.oldPos.x, w.oldPos.y);
|
242 |
-
w.element.resizeTo(w.oldSize.w, w.oldSize.h);
|
243 |
-
w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight);
|
244 |
-
|
245 |
-
DOM.removeClass(id + '_wrapper', 'mceMaximized');
|
246 |
-
} else if (n.className == 'mceMove')
|
247 |
-
return t._startDrag(id, e, n.className);
|
248 |
-
else if (DOM.hasClass(n, 'mceResize'))
|
249 |
-
return t._startDrag(id, e, n.className.substring(13));
|
250 |
-
}
|
251 |
-
});
|
252 |
-
|
253 |
-
clf = Event.add(id, 'click', function(e) {
|
254 |
-
var n = e.target;
|
255 |
-
|
256 |
-
t.focus(id);
|
257 |
-
|
258 |
-
if (n.nodeName == 'A' || n.nodeName == 'a') {
|
259 |
-
switch (n.className) {
|
260 |
-
case 'mceClose':
|
261 |
-
t.close(null, id);
|
262 |
-
return Event.cancel(e);
|
263 |
-
|
264 |
-
case 'mceButton mceOk':
|
265 |
-
case 'mceButton mceCancel':
|
266 |
-
f.button_func(n.className == 'mceButton mceOk');
|
267 |
-
return Event.cancel(e);
|
268 |
-
}
|
269 |
-
}
|
270 |
-
});
|
271 |
-
|
272 |
-
// Make sure the tab order loops within the dialog.
|
273 |
-
Event.add([id + '_left', id + '_right'], 'focus', function(evt) {
|
274 |
-
var iframe = DOM.get(id + '_ifr');
|
275 |
-
if (iframe) {
|
276 |
-
var body = iframe.contentWindow.document.body;
|
277 |
-
var focusable = DOM.select(':input:enabled,*[tabindex=0]', body);
|
278 |
-
if (evt.target.id === (id + '_left')) {
|
279 |
-
focusable[focusable.length - 1].focus();
|
280 |
-
} else {
|
281 |
-
focusable[0].focus();
|
282 |
-
}
|
283 |
-
} else {
|
284 |
-
DOM.get(id + '_ok').focus();
|
285 |
-
}
|
286 |
-
});
|
287 |
-
|
288 |
-
// Add window
|
289 |
-
w = t.windows[id] = {
|
290 |
-
id : id,
|
291 |
-
mousedown_func : mdf,
|
292 |
-
click_func : clf,
|
293 |
-
element : new Element(id, {blocker : 1, container : ed.getContainer()}),
|
294 |
-
iframeElement : new Element(id + '_ifr'),
|
295 |
-
features : f,
|
296 |
-
deltaWidth : dw,
|
297 |
-
deltaHeight : dh
|
298 |
-
};
|
299 |
-
|
300 |
-
w.iframeElement.on('focus', function() {
|
301 |
-
t.focus(id);
|
302 |
-
});
|
303 |
-
|
304 |
-
// Setup blocker
|
305 |
-
if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {
|
306 |
-
DOM.add(DOM.doc.body, 'div', {
|
307 |
-
id : 'mceModalBlocker',
|
308 |
-
'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',
|
309 |
-
style : {zIndex : t.zIndex - 1}
|
310 |
-
});
|
311 |
-
|
312 |
-
DOM.show('mceModalBlocker'); // Reduces flicker in IE
|
313 |
-
DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true');
|
314 |
-
} else
|
315 |
-
DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);
|
316 |
-
|
317 |
-
if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel))
|
318 |
-
DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
|
319 |
-
|
320 |
-
DOM.setAttrib(id, 'aria-hidden', 'false');
|
321 |
-
t.focus(id);
|
322 |
-
t._fixIELayout(id, 1);
|
323 |
-
|
324 |
-
// Focus ok button
|
325 |
-
if (DOM.get(id + '_ok'))
|
326 |
-
DOM.get(id + '_ok').focus();
|
327 |
-
t.count++;
|
328 |
-
|
329 |
-
return w;
|
330 |
-
},
|
331 |
-
|
332 |
-
focus : function(id) {
|
333 |
-
var t = this, w;
|
334 |
-
|
335 |
-
if (w = t.windows[id]) {
|
336 |
-
w.zIndex = this.zIndex++;
|
337 |
-
w.element.setStyle('zIndex', w.zIndex);
|
338 |
-
w.element.update();
|
339 |
-
|
340 |
-
id = id + '_wrapper';
|
341 |
-
DOM.removeClass(t.lastId, 'mceFocus');
|
342 |
-
DOM.addClass(id, 'mceFocus');
|
343 |
-
t.lastId = id;
|
344 |
-
|
345 |
-
if (w.focussedElement) {
|
346 |
-
w.focussedElement.focus();
|
347 |
-
} else if (DOM.get(id + '_ok')) {
|
348 |
-
DOM.get(w.id + '_ok').focus();
|
349 |
-
} else if (DOM.get(w.id + '_ifr')) {
|
350 |
-
DOM.get(w.id + '_ifr').focus();
|
351 |
-
}
|
352 |
-
}
|
353 |
-
},
|
354 |
-
|
355 |
-
_addAll : function(te, ne) {
|
356 |
-
var i, n, t = this, dom = tinymce.DOM;
|
357 |
-
|
358 |
-
if (is(ne, 'string'))
|
359 |
-
te.appendChild(dom.doc.createTextNode(ne));
|
360 |
-
else if (ne.length) {
|
361 |
-
te = te.appendChild(dom.create(ne[0], ne[1]));
|
362 |
-
|
363 |
-
for (i=2; i<ne.length; i++)
|
364 |
-
t._addAll(te, ne[i]);
|
365 |
-
}
|
366 |
-
},
|
367 |
-
|
368 |
-
_startDrag : function(id, se, ac) {
|
369 |
-
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;
|
370 |
-
|
371 |
-
// Get positons and sizes
|
372 |
-
// cp = DOM.getPos(t.editor.getContainer());
|
373 |
-
cp = {x : 0, y : 0};
|
374 |
-
vp = DOM.getViewPort();
|
375 |
-
|
376 |
-
// Reduce viewport size to avoid scrollbars while dragging
|
377 |
-
vp.w -= 2;
|
378 |
-
vp.h -= 2;
|
379 |
-
|
380 |
-
sex = se.screenX;
|
381 |
-
sey = se.screenY;
|
382 |
-
dx = dy = dw = dh = 0;
|
383 |
-
|
384 |
-
// Handle mouse up
|
385 |
-
mu = Event.add(d, 'mouseup', function(e) {
|
386 |
-
Event.remove(d, 'mouseup', mu);
|
387 |
-
Event.remove(d, 'mousemove', mm);
|
388 |
-
|
389 |
-
if (eb)
|
390 |
-
eb.remove();
|
391 |
-
|
392 |
-
we.moveBy(dx, dy);
|
393 |
-
we.resizeBy(dw, dh);
|
394 |
-
sz = we.getSize();
|
395 |
-
DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight});
|
396 |
-
t._fixIELayout(id, 1);
|
397 |
-
|
398 |
-
return Event.cancel(e);
|
399 |
-
});
|
400 |
-
|
401 |
-
if (ac != 'Move')
|
402 |
-
startMove();
|
403 |
-
|
404 |
-
function startMove() {
|
405 |
-
if (eb)
|
406 |
-
return;
|
407 |
-
|
408 |
-
t._fixIELayout(id, 0);
|
409 |
-
|
410 |
-
// Setup event blocker
|
411 |
-
DOM.add(d.body, 'div', {
|
412 |
-
id : 'mceEventBlocker',
|
413 |
-
'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),
|
414 |
-
style : {zIndex : t.zIndex + 1}
|
415 |
-
});
|
416 |
-
|
417 |
-
if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))
|
418 |
-
DOM.setStyles('mceEventBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
|
419 |
-
|
420 |
-
eb = new Element('mceEventBlocker');
|
421 |
-
eb.update();
|
422 |
-
|
423 |
-
// Setup placeholder
|
424 |
-
p = we.getXY();
|
425 |
-
sz = we.getSize();
|
426 |
-
sx = cp.x + p.x - vp.x;
|
427 |
-
sy = cp.y + p.y - vp.y;
|
428 |
-
DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}});
|
429 |
-
ph = new Element('mcePlaceHolder');
|
430 |
-
};
|
431 |
-
|
432 |
-
// Handle mouse move/drag
|
433 |
-
mm = Event.add(d, 'mousemove', function(e) {
|
434 |
-
var x, y, v;
|
435 |
-
|
436 |
-
startMove();
|
437 |
-
|
438 |
-
x = e.screenX - sex;
|
439 |
-
y = e.screenY - sey;
|
440 |
-
|
441 |
-
switch (ac) {
|
442 |
-
case 'ResizeW':
|
443 |
-
dx = x;
|
444 |
-
dw = 0 - x;
|
445 |
-
break;
|
446 |
-
|
447 |
-
case 'ResizeE':
|
448 |
-
dw = x;
|
449 |
-
break;
|
450 |
-
|
451 |
-
case 'ResizeN':
|
452 |
-
case 'ResizeNW':
|
453 |
-
case 'ResizeNE':
|
454 |
-
if (ac == "ResizeNW") {
|
455 |
-
dx = x;
|
456 |
-
dw = 0 - x;
|
457 |
-
} else if (ac == "ResizeNE")
|
458 |
-
dw = x;
|
459 |
-
|
460 |
-
dy = y;
|
461 |
-
dh = 0 - y;
|
462 |
-
break;
|
463 |
-
|
464 |
-
case 'ResizeS':
|
465 |
-
case 'ResizeSW':
|
466 |
-
case 'ResizeSE':
|
467 |
-
if (ac == "ResizeSW") {
|
468 |
-
dx = x;
|
469 |
-
dw = 0 - x;
|
470 |
-
} else if (ac == "ResizeSE")
|
471 |
-
dw = x;
|
472 |
-
|
473 |
-
dh = y;
|
474 |
-
break;
|
475 |
-
|
476 |
-
case 'mceMove':
|
477 |
-
dx = x;
|
478 |
-
dy = y;
|
479 |
-
break;
|
480 |
-
}
|
481 |
-
|
482 |
-
// Boundary check
|
483 |
-
if (dw < (v = w.features.min_width - sz.w)) {
|
484 |
-
if (dx !== 0)
|
485 |
-
dx += dw - v;
|
486 |
-
|
487 |
-
dw = v;
|
488 |
-
}
|
489 |
-
|
490 |
-
if (dh < (v = w.features.min_height - sz.h)) {
|
491 |
-
if (dy !== 0)
|
492 |
-
dy += dh - v;
|
493 |
-
|
494 |
-
dh = v;
|
495 |
-
}
|
496 |
-
|
497 |
-
dw = Math.min(dw, w.features.max_width - sz.w);
|
498 |
-
dh = Math.min(dh, w.features.max_height - sz.h);
|
499 |
-
dx = Math.max(dx, vp.x - (sx + vp.x));
|
500 |
-
dy = Math.max(dy, vp.y - (sy + vp.y));
|
501 |
-
dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x));
|
502 |
-
dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y));
|
503 |
-
|
504 |
-
// Move if needed
|
505 |
-
if (dx + dy !== 0) {
|
506 |
-
if (sx + dx < 0)
|
507 |
-
dx = 0;
|
508 |
-
|
509 |
-
if (sy + dy < 0)
|
510 |
-
dy = 0;
|
511 |
-
|
512 |
-
ph.moveTo(sx + dx, sy + dy);
|
513 |
-
}
|
514 |
-
|
515 |
-
// Resize if needed
|
516 |
-
if (dw + dh !== 0)
|
517 |
-
ph.resizeTo(sz.w + dw, sz.h + dh);
|
518 |
-
|
519 |
-
return Event.cancel(e);
|
520 |
-
});
|
521 |
-
|
522 |
-
return Event.cancel(se);
|
523 |
-
},
|
524 |
-
|
525 |
-
resizeBy : function(dw, dh, id) {
|
526 |
-
var w = this.windows[id];
|
527 |
-
|
528 |
-
if (w) {
|
529 |
-
w.element.resizeBy(dw, dh);
|
530 |
-
w.iframeElement.resizeBy(dw, dh);
|
531 |
-
}
|
532 |
-
},
|
533 |
-
|
534 |
-
close : function(win, id) {
|
535 |
-
var t = this, w, d = DOM.doc, fw, id;
|
536 |
-
|
537 |
-
id = t._findId(id || win);
|
538 |
-
|
539 |
-
// Probably not inline
|
540 |
-
if (!t.windows[id]) {
|
541 |
-
t.parent(win);
|
542 |
-
return;
|
543 |
-
}
|
544 |
-
|
545 |
-
t.count--;
|
546 |
-
|
547 |
-
if (t.count == 0) {
|
548 |
-
DOM.remove('mceModalBlocker');
|
549 |
-
DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'false');
|
550 |
-
t.editor.focus();
|
551 |
-
}
|
552 |
-
|
553 |
-
if (w = t.windows[id]) {
|
554 |
-
t.onClose.dispatch(t);
|
555 |
-
Event.remove(d, 'mousedown', w.mousedownFunc);
|
556 |
-
Event.remove(d, 'click', w.clickFunc);
|
557 |
-
Event.clear(id);
|
558 |
-
Event.clear(id + '_ifr');
|
559 |
-
|
560 |
-
DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak
|
561 |
-
w.element.remove();
|
562 |
-
delete t.windows[id];
|
563 |
-
|
564 |
-
fw = t._frontWindow();
|
565 |
-
|
566 |
-
if (fw)
|
567 |
-
t.focus(fw.id);
|
568 |
-
}
|
569 |
-
},
|
570 |
-
|
571 |
-
// Find front most window
|
572 |
-
_frontWindow : function() {
|
573 |
-
var fw, ix = 0;
|
574 |
-
// Find front most window and focus that
|
575 |
-
each (this.windows, function(w) {
|
576 |
-
if (w.zIndex > ix) {
|
577 |
-
fw = w;
|
578 |
-
ix = w.zIndex;
|
579 |
-
}
|
580 |
-
});
|
581 |
-
return fw;
|
582 |
-
},
|
583 |
-
|
584 |
-
setTitle : function(w, ti) {
|
585 |
-
var e;
|
586 |
-
|
587 |
-
w = this._findId(w);
|
588 |
-
|
589 |
-
if (e = DOM.get(w + '_title'))
|
590 |
-
e.innerHTML = DOM.encode(ti);
|
591 |
-
},
|
592 |
-
|
593 |
-
alert : function(txt, cb, s) {
|
594 |
-
var t = this, w;
|
595 |
-
|
596 |
-
w = t.open({
|
597 |
-
title : t,
|
598 |
-
type : 'alert',
|
599 |
-
button_func : function(s) {
|
600 |
-
if (cb)
|
601 |
-
cb.call(s || t, s);
|
602 |
-
|
603 |
-
t.close(null, w.id);
|
604 |
-
},
|
605 |
-
content : DOM.encode(t.editor.getLang(txt, txt)),
|
606 |
-
inline : 1,
|
607 |
-
width : 400,
|
608 |
-
height : 130
|
609 |
-
});
|
610 |
-
},
|
611 |
-
|
612 |
-
confirm : function(txt, cb, s) {
|
613 |
-
var t = this, w;
|
614 |
-
|
615 |
-
w = t.open({
|
616 |
-
title : t,
|
617 |
-
type : 'confirm',
|
618 |
-
button_func : function(s) {
|
619 |
-
if (cb)
|
620 |
-
cb.call(s || t, s);
|
621 |
-
|
622 |
-
t.close(null, w.id);
|
623 |
-
},
|
624 |
-
content : DOM.encode(t.editor.getLang(txt, txt)),
|
625 |
-
inline : 1,
|
626 |
-
width : 400,
|
627 |
-
height : 130
|
628 |
-
});
|
629 |
-
},
|
630 |
-
|
631 |
-
// Internal functions
|
632 |
-
|
633 |
-
_findId : function(w) {
|
634 |
-
var t = this;
|
635 |
-
|
636 |
-
if (typeof(w) == 'string')
|
637 |
-
return w;
|
638 |
-
|
639 |
-
each(t.windows, function(wo) {
|
640 |
-
var ifr = DOM.get(wo.id + '_ifr');
|
641 |
-
|
642 |
-
if (ifr && w == ifr.contentWindow) {
|
643 |
-
w = wo.id;
|
644 |
-
return false;
|
645 |
-
}
|
646 |
-
});
|
647 |
-
|
648 |
-
return w;
|
649 |
-
},
|
650 |
-
|
651 |
-
_fixIELayout : function(id, s) {
|
652 |
-
var w, img;
|
653 |
-
|
654 |
-
if (!tinymce.isIE6)
|
655 |
-
return;
|
656 |
-
|
657 |
-
// Fixes the bug where hover flickers and does odd things in IE6
|
658 |
-
each(['n','s','w','e','nw','ne','sw','se'], function(v) {
|
659 |
-
var e = DOM.get(id + '_resize_' + v);
|
660 |
-
|
661 |
-
DOM.setStyles(e, {
|
662 |
-
width : s ? e.clientWidth : '',
|
663 |
-
height : s ? e.clientHeight : '',
|
664 |
-
cursor : DOM.getStyle(e, 'cursor', 1)
|
665 |
-
});
|
666 |
-
|
667 |
-
DOM.setStyle(id + "_bottom", 'bottom', '-1px');
|
668 |
-
|
669 |
-
e = 0;
|
670 |
-
});
|
671 |
-
|
672 |
-
// Fixes graphics glitch
|
673 |
-
if (w = this.windows[id]) {
|
674 |
-
// Fixes rendering bug after resize
|
675 |
-
w.element.hide();
|
676 |
-
w.element.show();
|
677 |
-
|
678 |
-
// Forced a repaint of the window
|
679 |
-
//DOM.get(id).style.filter = '';
|
680 |
-
|
681 |
-
// IE has a bug where images used in CSS won't get loaded
|
682 |
-
// sometimes when the cache in the browser is disabled
|
683 |
-
// This fix tries to solve it by loading the images using the image object
|
684 |
-
each(DOM.select('div,a', id), function(e, i) {
|
685 |
-
if (e.currentStyle.backgroundImage != 'none') {
|
686 |
-
img = new Image();
|
687 |
-
img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1');
|
688 |
-
}
|
689 |
-
});
|
690 |
-
|
691 |
-
DOM.get(id).style.filter = '';
|
692 |
-
}
|
693 |
-
}
|
694 |
-
});
|
695 |
-
|
696 |
-
// Register plugin
|
697 |
-
tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups);
|
698 |
-
})();
|
699 |
-
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;
|
13 |
+
|
14 |
+
tinymce.create('tinymce.plugins.InlinePopups', {
|
15 |
+
init : function(ed, url) {
|
16 |
+
// Replace window manager
|
17 |
+
ed.onBeforeRenderUI.add(function() {
|
18 |
+
ed.windowManager = new tinymce.InlineWindowManager(ed);
|
19 |
+
DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css");
|
20 |
+
});
|
21 |
+
},
|
22 |
+
|
23 |
+
getInfo : function() {
|
24 |
+
return {
|
25 |
+
longname : 'InlinePopups',
|
26 |
+
author : 'Moxiecode Systems AB',
|
27 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
28 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
|
29 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
30 |
+
};
|
31 |
+
}
|
32 |
+
});
|
33 |
+
|
34 |
+
tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', {
|
35 |
+
InlineWindowManager : function(ed) {
|
36 |
+
var t = this;
|
37 |
+
|
38 |
+
t.parent(ed);
|
39 |
+
t.zIndex = 300000;
|
40 |
+
t.count = 0;
|
41 |
+
t.windows = {};
|
42 |
+
},
|
43 |
+
|
44 |
+
open : function(f, p) {
|
45 |
+
var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow;
|
46 |
+
|
47 |
+
f = f || {};
|
48 |
+
p = p || {};
|
49 |
+
|
50 |
+
// Run native windows
|
51 |
+
if (!f.inline)
|
52 |
+
return t.parent(f, p);
|
53 |
+
|
54 |
+
parentWindow = t._frontWindow();
|
55 |
+
if (parentWindow && DOM.get(parentWindow.id + '_ifr')) {
|
56 |
+
parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;
|
57 |
+
}
|
58 |
+
|
59 |
+
// Only store selection if the type is a normal window
|
60 |
+
if (!f.type)
|
61 |
+
t.bookmark = ed.selection.getBookmark(1);
|
62 |
+
|
63 |
+
id = DOM.uniqueId();
|
64 |
+
vp = DOM.getViewPort();
|
65 |
+
f.width = parseInt(f.width || 320);
|
66 |
+
f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
|
67 |
+
f.min_width = parseInt(f.min_width || 150);
|
68 |
+
f.min_height = parseInt(f.min_height || 100);
|
69 |
+
f.max_width = parseInt(f.max_width || 2000);
|
70 |
+
f.max_height = parseInt(f.max_height || 2000);
|
71 |
+
f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0)));
|
72 |
+
f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0)));
|
73 |
+
f.movable = f.resizable = true;
|
74 |
+
p.mce_width = f.width;
|
75 |
+
p.mce_height = f.height;
|
76 |
+
p.mce_inline = true;
|
77 |
+
p.mce_window_id = id;
|
78 |
+
p.mce_auto_focus = f.auto_focus;
|
79 |
+
|
80 |
+
// Transpose
|
81 |
+
// po = DOM.getPos(ed.getContainer());
|
82 |
+
// f.left -= po.x;
|
83 |
+
// f.top -= po.y;
|
84 |
+
|
85 |
+
t.features = f;
|
86 |
+
t.params = p;
|
87 |
+
t.onOpen.dispatch(t, f, p);
|
88 |
+
|
89 |
+
if (f.type) {
|
90 |
+
opt += ' mceModal';
|
91 |
+
|
92 |
+
if (f.type)
|
93 |
+
opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1);
|
94 |
+
|
95 |
+
f.resizable = false;
|
96 |
+
}
|
97 |
+
|
98 |
+
if (f.statusbar)
|
99 |
+
opt += ' mceStatusbar';
|
100 |
+
|
101 |
+
if (f.resizable)
|
102 |
+
opt += ' mceResizable';
|
103 |
+
|
104 |
+
if (f.minimizable)
|
105 |
+
opt += ' mceMinimizable';
|
106 |
+
|
107 |
+
if (f.maximizable)
|
108 |
+
opt += ' mceMaximizable';
|
109 |
+
|
110 |
+
if (f.movable)
|
111 |
+
opt += ' mceMovable';
|
112 |
+
|
113 |
+
// Create DOM objects
|
114 |
+
t._addAll(DOM.doc.body,
|
115 |
+
['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'},
|
116 |
+
['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
|
117 |
+
['div', {id : id + '_top', 'class' : 'mceTop'},
|
118 |
+
['div', {'class' : 'mceLeft'}],
|
119 |
+
['div', {'class' : 'mceCenter'}],
|
120 |
+
['div', {'class' : 'mceRight'}],
|
121 |
+
['span', {id : id + '_title'}, f.title || '']
|
122 |
+
],
|
123 |
+
|
124 |
+
['div', {id : id + '_middle', 'class' : 'mceMiddle'},
|
125 |
+
['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}],
|
126 |
+
['span', {id : id + '_content'}],
|
127 |
+
['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]
|
128 |
+
],
|
129 |
+
|
130 |
+
['div', {id : id + '_bottom', 'class' : 'mceBottom'},
|
131 |
+
['div', {'class' : 'mceLeft'}],
|
132 |
+
['div', {'class' : 'mceCenter'}],
|
133 |
+
['div', {'class' : 'mceRight'}],
|
134 |
+
['span', {id : id + '_status'}, 'Content']
|
135 |
+
],
|
136 |
+
|
137 |
+
['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}],
|
138 |
+
['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
|
139 |
+
['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
|
140 |
+
['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
|
141 |
+
['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
|
142 |
+
['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}],
|
143 |
+
['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}],
|
144 |
+
['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}],
|
145 |
+
['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}],
|
146 |
+
['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}],
|
147 |
+
['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}],
|
148 |
+
['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}],
|
149 |
+
['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}]
|
150 |
+
]
|
151 |
+
]
|
152 |
+
);
|
153 |
+
|
154 |
+
DOM.setStyles(id, {top : -10000, left : -10000});
|
155 |
+
|
156 |
+
// Fix gecko rendering bug, where the editors iframe messed with window contents
|
157 |
+
if (tinymce.isGecko)
|
158 |
+
DOM.setStyle(id, 'overflow', 'auto');
|
159 |
+
|
160 |
+
// Measure borders
|
161 |
+
if (!f.type) {
|
162 |
+
dw += DOM.get(id + '_left').clientWidth;
|
163 |
+
dw += DOM.get(id + '_right').clientWidth;
|
164 |
+
dh += DOM.get(id + '_top').clientHeight;
|
165 |
+
dh += DOM.get(id + '_bottom').clientHeight;
|
166 |
+
}
|
167 |
+
|
168 |
+
// Resize window
|
169 |
+
DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});
|
170 |
+
|
171 |
+
u = f.url || f.file;
|
172 |
+
if (u) {
|
173 |
+
if (tinymce.relaxedDomain)
|
174 |
+
u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;
|
175 |
+
|
176 |
+
u = tinymce._addVer(u);
|
177 |
+
}
|
178 |
+
|
179 |
+
if (!f.type) {
|
180 |
+
DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});
|
181 |
+
DOM.setStyles(id + '_ifr', {width : f.width, height : f.height});
|
182 |
+
DOM.setAttrib(id + '_ifr', 'src', u);
|
183 |
+
} else {
|
184 |
+
DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok');
|
185 |
+
|
186 |
+
if (f.type == 'confirm')
|
187 |
+
DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel');
|
188 |
+
|
189 |
+
DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
|
190 |
+
DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
|
191 |
+
|
192 |
+
Event.add(id, 'keyup', function(evt) {
|
193 |
+
var VK_ESCAPE = 27;
|
194 |
+
if (evt.keyCode === VK_ESCAPE) {
|
195 |
+
f.button_func(false);
|
196 |
+
return Event.cancel(evt);
|
197 |
+
}
|
198 |
+
});
|
199 |
+
|
200 |
+
Event.add(id, 'keydown', function(evt) {
|
201 |
+
var cancelButton, VK_TAB = 9;
|
202 |
+
if (evt.keyCode === VK_TAB) {
|
203 |
+
cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0];
|
204 |
+
if (cancelButton && cancelButton !== evt.target) {
|
205 |
+
cancelButton.focus();
|
206 |
+
} else {
|
207 |
+
DOM.get(id + '_ok').focus();
|
208 |
+
}
|
209 |
+
return Event.cancel(evt);
|
210 |
+
}
|
211 |
+
});
|
212 |
+
}
|
213 |
+
|
214 |
+
// Register events
|
215 |
+
mdf = Event.add(id, 'mousedown', function(e) {
|
216 |
+
var n = e.target, w, vp;
|
217 |
+
|
218 |
+
w = t.windows[id];
|
219 |
+
t.focus(id);
|
220 |
+
|
221 |
+
if (n.nodeName == 'A' || n.nodeName == 'a') {
|
222 |
+
if (n.className == 'mceClose') {
|
223 |
+
t.close(null, id);
|
224 |
+
return Event.cancel(e);
|
225 |
+
} else if (n.className == 'mceMax') {
|
226 |
+
w.oldPos = w.element.getXY();
|
227 |
+
w.oldSize = w.element.getSize();
|
228 |
+
|
229 |
+
vp = DOM.getViewPort();
|
230 |
+
|
231 |
+
// Reduce viewport size to avoid scrollbars
|
232 |
+
vp.w -= 2;
|
233 |
+
vp.h -= 2;
|
234 |
+
|
235 |
+
w.element.moveTo(vp.x, vp.y);
|
236 |
+
w.element.resizeTo(vp.w, vp.h);
|
237 |
+
DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight});
|
238 |
+
DOM.addClass(id + '_wrapper', 'mceMaximized');
|
239 |
+
} else if (n.className == 'mceMed') {
|
240 |
+
// Reset to old size
|
241 |
+
w.element.moveTo(w.oldPos.x, w.oldPos.y);
|
242 |
+
w.element.resizeTo(w.oldSize.w, w.oldSize.h);
|
243 |
+
w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight);
|
244 |
+
|
245 |
+
DOM.removeClass(id + '_wrapper', 'mceMaximized');
|
246 |
+
} else if (n.className == 'mceMove')
|
247 |
+
return t._startDrag(id, e, n.className);
|
248 |
+
else if (DOM.hasClass(n, 'mceResize'))
|
249 |
+
return t._startDrag(id, e, n.className.substring(13));
|
250 |
+
}
|
251 |
+
});
|
252 |
+
|
253 |
+
clf = Event.add(id, 'click', function(e) {
|
254 |
+
var n = e.target;
|
255 |
+
|
256 |
+
t.focus(id);
|
257 |
+
|
258 |
+
if (n.nodeName == 'A' || n.nodeName == 'a') {
|
259 |
+
switch (n.className) {
|
260 |
+
case 'mceClose':
|
261 |
+
t.close(null, id);
|
262 |
+
return Event.cancel(e);
|
263 |
+
|
264 |
+
case 'mceButton mceOk':
|
265 |
+
case 'mceButton mceCancel':
|
266 |
+
f.button_func(n.className == 'mceButton mceOk');
|
267 |
+
return Event.cancel(e);
|
268 |
+
}
|
269 |
+
}
|
270 |
+
});
|
271 |
+
|
272 |
+
// Make sure the tab order loops within the dialog.
|
273 |
+
Event.add([id + '_left', id + '_right'], 'focus', function(evt) {
|
274 |
+
var iframe = DOM.get(id + '_ifr');
|
275 |
+
if (iframe) {
|
276 |
+
var body = iframe.contentWindow.document.body;
|
277 |
+
var focusable = DOM.select(':input:enabled,*[tabindex=0]', body);
|
278 |
+
if (evt.target.id === (id + '_left')) {
|
279 |
+
focusable[focusable.length - 1].focus();
|
280 |
+
} else {
|
281 |
+
focusable[0].focus();
|
282 |
+
}
|
283 |
+
} else {
|
284 |
+
DOM.get(id + '_ok').focus();
|
285 |
+
}
|
286 |
+
});
|
287 |
+
|
288 |
+
// Add window
|
289 |
+
w = t.windows[id] = {
|
290 |
+
id : id,
|
291 |
+
mousedown_func : mdf,
|
292 |
+
click_func : clf,
|
293 |
+
element : new Element(id, {blocker : 1, container : ed.getContainer()}),
|
294 |
+
iframeElement : new Element(id + '_ifr'),
|
295 |
+
features : f,
|
296 |
+
deltaWidth : dw,
|
297 |
+
deltaHeight : dh
|
298 |
+
};
|
299 |
+
|
300 |
+
w.iframeElement.on('focus', function() {
|
301 |
+
t.focus(id);
|
302 |
+
});
|
303 |
+
|
304 |
+
// Setup blocker
|
305 |
+
if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {
|
306 |
+
DOM.add(DOM.doc.body, 'div', {
|
307 |
+
id : 'mceModalBlocker',
|
308 |
+
'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',
|
309 |
+
style : {zIndex : t.zIndex - 1}
|
310 |
+
});
|
311 |
+
|
312 |
+
DOM.show('mceModalBlocker'); // Reduces flicker in IE
|
313 |
+
DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true');
|
314 |
+
} else
|
315 |
+
DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);
|
316 |
+
|
317 |
+
if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel))
|
318 |
+
DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
|
319 |
+
|
320 |
+
DOM.setAttrib(id, 'aria-hidden', 'false');
|
321 |
+
t.focus(id);
|
322 |
+
t._fixIELayout(id, 1);
|
323 |
+
|
324 |
+
// Focus ok button
|
325 |
+
if (DOM.get(id + '_ok'))
|
326 |
+
DOM.get(id + '_ok').focus();
|
327 |
+
t.count++;
|
328 |
+
|
329 |
+
return w;
|
330 |
+
},
|
331 |
+
|
332 |
+
focus : function(id) {
|
333 |
+
var t = this, w;
|
334 |
+
|
335 |
+
if (w = t.windows[id]) {
|
336 |
+
w.zIndex = this.zIndex++;
|
337 |
+
w.element.setStyle('zIndex', w.zIndex);
|
338 |
+
w.element.update();
|
339 |
+
|
340 |
+
id = id + '_wrapper';
|
341 |
+
DOM.removeClass(t.lastId, 'mceFocus');
|
342 |
+
DOM.addClass(id, 'mceFocus');
|
343 |
+
t.lastId = id;
|
344 |
+
|
345 |
+
if (w.focussedElement) {
|
346 |
+
w.focussedElement.focus();
|
347 |
+
} else if (DOM.get(id + '_ok')) {
|
348 |
+
DOM.get(w.id + '_ok').focus();
|
349 |
+
} else if (DOM.get(w.id + '_ifr')) {
|
350 |
+
DOM.get(w.id + '_ifr').focus();
|
351 |
+
}
|
352 |
+
}
|
353 |
+
},
|
354 |
+
|
355 |
+
_addAll : function(te, ne) {
|
356 |
+
var i, n, t = this, dom = tinymce.DOM;
|
357 |
+
|
358 |
+
if (is(ne, 'string'))
|
359 |
+
te.appendChild(dom.doc.createTextNode(ne));
|
360 |
+
else if (ne.length) {
|
361 |
+
te = te.appendChild(dom.create(ne[0], ne[1]));
|
362 |
+
|
363 |
+
for (i=2; i<ne.length; i++)
|
364 |
+
t._addAll(te, ne[i]);
|
365 |
+
}
|
366 |
+
},
|
367 |
+
|
368 |
+
_startDrag : function(id, se, ac) {
|
369 |
+
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;
|
370 |
+
|
371 |
+
// Get positons and sizes
|
372 |
+
// cp = DOM.getPos(t.editor.getContainer());
|
373 |
+
cp = {x : 0, y : 0};
|
374 |
+
vp = DOM.getViewPort();
|
375 |
+
|
376 |
+
// Reduce viewport size to avoid scrollbars while dragging
|
377 |
+
vp.w -= 2;
|
378 |
+
vp.h -= 2;
|
379 |
+
|
380 |
+
sex = se.screenX;
|
381 |
+
sey = se.screenY;
|
382 |
+
dx = dy = dw = dh = 0;
|
383 |
+
|
384 |
+
// Handle mouse up
|
385 |
+
mu = Event.add(d, 'mouseup', function(e) {
|
386 |
+
Event.remove(d, 'mouseup', mu);
|
387 |
+
Event.remove(d, 'mousemove', mm);
|
388 |
+
|
389 |
+
if (eb)
|
390 |
+
eb.remove();
|
391 |
+
|
392 |
+
we.moveBy(dx, dy);
|
393 |
+
we.resizeBy(dw, dh);
|
394 |
+
sz = we.getSize();
|
395 |
+
DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight});
|
396 |
+
t._fixIELayout(id, 1);
|
397 |
+
|
398 |
+
return Event.cancel(e);
|
399 |
+
});
|
400 |
+
|
401 |
+
if (ac != 'Move')
|
402 |
+
startMove();
|
403 |
+
|
404 |
+
function startMove() {
|
405 |
+
if (eb)
|
406 |
+
return;
|
407 |
+
|
408 |
+
t._fixIELayout(id, 0);
|
409 |
+
|
410 |
+
// Setup event blocker
|
411 |
+
DOM.add(d.body, 'div', {
|
412 |
+
id : 'mceEventBlocker',
|
413 |
+
'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),
|
414 |
+
style : {zIndex : t.zIndex + 1}
|
415 |
+
});
|
416 |
+
|
417 |
+
if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))
|
418 |
+
DOM.setStyles('mceEventBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
|
419 |
+
|
420 |
+
eb = new Element('mceEventBlocker');
|
421 |
+
eb.update();
|
422 |
+
|
423 |
+
// Setup placeholder
|
424 |
+
p = we.getXY();
|
425 |
+
sz = we.getSize();
|
426 |
+
sx = cp.x + p.x - vp.x;
|
427 |
+
sy = cp.y + p.y - vp.y;
|
428 |
+
DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}});
|
429 |
+
ph = new Element('mcePlaceHolder');
|
430 |
+
};
|
431 |
+
|
432 |
+
// Handle mouse move/drag
|
433 |
+
mm = Event.add(d, 'mousemove', function(e) {
|
434 |
+
var x, y, v;
|
435 |
+
|
436 |
+
startMove();
|
437 |
+
|
438 |
+
x = e.screenX - sex;
|
439 |
+
y = e.screenY - sey;
|
440 |
+
|
441 |
+
switch (ac) {
|
442 |
+
case 'ResizeW':
|
443 |
+
dx = x;
|
444 |
+
dw = 0 - x;
|
445 |
+
break;
|
446 |
+
|
447 |
+
case 'ResizeE':
|
448 |
+
dw = x;
|
449 |
+
break;
|
450 |
+
|
451 |
+
case 'ResizeN':
|
452 |
+
case 'ResizeNW':
|
453 |
+
case 'ResizeNE':
|
454 |
+
if (ac == "ResizeNW") {
|
455 |
+
dx = x;
|
456 |
+
dw = 0 - x;
|
457 |
+
} else if (ac == "ResizeNE")
|
458 |
+
dw = x;
|
459 |
+
|
460 |
+
dy = y;
|
461 |
+
dh = 0 - y;
|
462 |
+
break;
|
463 |
+
|
464 |
+
case 'ResizeS':
|
465 |
+
case 'ResizeSW':
|
466 |
+
case 'ResizeSE':
|
467 |
+
if (ac == "ResizeSW") {
|
468 |
+
dx = x;
|
469 |
+
dw = 0 - x;
|
470 |
+
} else if (ac == "ResizeSE")
|
471 |
+
dw = x;
|
472 |
+
|
473 |
+
dh = y;
|
474 |
+
break;
|
475 |
+
|
476 |
+
case 'mceMove':
|
477 |
+
dx = x;
|
478 |
+
dy = y;
|
479 |
+
break;
|
480 |
+
}
|
481 |
+
|
482 |
+
// Boundary check
|
483 |
+
if (dw < (v = w.features.min_width - sz.w)) {
|
484 |
+
if (dx !== 0)
|
485 |
+
dx += dw - v;
|
486 |
+
|
487 |
+
dw = v;
|
488 |
+
}
|
489 |
+
|
490 |
+
if (dh < (v = w.features.min_height - sz.h)) {
|
491 |
+
if (dy !== 0)
|
492 |
+
dy += dh - v;
|
493 |
+
|
494 |
+
dh = v;
|
495 |
+
}
|
496 |
+
|
497 |
+
dw = Math.min(dw, w.features.max_width - sz.w);
|
498 |
+
dh = Math.min(dh, w.features.max_height - sz.h);
|
499 |
+
dx = Math.max(dx, vp.x - (sx + vp.x));
|
500 |
+
dy = Math.max(dy, vp.y - (sy + vp.y));
|
501 |
+
dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x));
|
502 |
+
dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y));
|
503 |
+
|
504 |
+
// Move if needed
|
505 |
+
if (dx + dy !== 0) {
|
506 |
+
if (sx + dx < 0)
|
507 |
+
dx = 0;
|
508 |
+
|
509 |
+
if (sy + dy < 0)
|
510 |
+
dy = 0;
|
511 |
+
|
512 |
+
ph.moveTo(sx + dx, sy + dy);
|
513 |
+
}
|
514 |
+
|
515 |
+
// Resize if needed
|
516 |
+
if (dw + dh !== 0)
|
517 |
+
ph.resizeTo(sz.w + dw, sz.h + dh);
|
518 |
+
|
519 |
+
return Event.cancel(e);
|
520 |
+
});
|
521 |
+
|
522 |
+
return Event.cancel(se);
|
523 |
+
},
|
524 |
+
|
525 |
+
resizeBy : function(dw, dh, id) {
|
526 |
+
var w = this.windows[id];
|
527 |
+
|
528 |
+
if (w) {
|
529 |
+
w.element.resizeBy(dw, dh);
|
530 |
+
w.iframeElement.resizeBy(dw, dh);
|
531 |
+
}
|
532 |
+
},
|
533 |
+
|
534 |
+
close : function(win, id) {
|
535 |
+
var t = this, w, d = DOM.doc, fw, id;
|
536 |
+
|
537 |
+
id = t._findId(id || win);
|
538 |
+
|
539 |
+
// Probably not inline
|
540 |
+
if (!t.windows[id]) {
|
541 |
+
t.parent(win);
|
542 |
+
return;
|
543 |
+
}
|
544 |
+
|
545 |
+
t.count--;
|
546 |
+
|
547 |
+
if (t.count == 0) {
|
548 |
+
DOM.remove('mceModalBlocker');
|
549 |
+
DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'false');
|
550 |
+
t.editor.focus();
|
551 |
+
}
|
552 |
+
|
553 |
+
if (w = t.windows[id]) {
|
554 |
+
t.onClose.dispatch(t);
|
555 |
+
Event.remove(d, 'mousedown', w.mousedownFunc);
|
556 |
+
Event.remove(d, 'click', w.clickFunc);
|
557 |
+
Event.clear(id);
|
558 |
+
Event.clear(id + '_ifr');
|
559 |
+
|
560 |
+
DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak
|
561 |
+
w.element.remove();
|
562 |
+
delete t.windows[id];
|
563 |
+
|
564 |
+
fw = t._frontWindow();
|
565 |
+
|
566 |
+
if (fw)
|
567 |
+
t.focus(fw.id);
|
568 |
+
}
|
569 |
+
},
|
570 |
+
|
571 |
+
// Find front most window
|
572 |
+
_frontWindow : function() {
|
573 |
+
var fw, ix = 0;
|
574 |
+
// Find front most window and focus that
|
575 |
+
each (this.windows, function(w) {
|
576 |
+
if (w.zIndex > ix) {
|
577 |
+
fw = w;
|
578 |
+
ix = w.zIndex;
|
579 |
+
}
|
580 |
+
});
|
581 |
+
return fw;
|
582 |
+
},
|
583 |
+
|
584 |
+
setTitle : function(w, ti) {
|
585 |
+
var e;
|
586 |
+
|
587 |
+
w = this._findId(w);
|
588 |
+
|
589 |
+
if (e = DOM.get(w + '_title'))
|
590 |
+
e.innerHTML = DOM.encode(ti);
|
591 |
+
},
|
592 |
+
|
593 |
+
alert : function(txt, cb, s) {
|
594 |
+
var t = this, w;
|
595 |
+
|
596 |
+
w = t.open({
|
597 |
+
title : t,
|
598 |
+
type : 'alert',
|
599 |
+
button_func : function(s) {
|
600 |
+
if (cb)
|
601 |
+
cb.call(s || t, s);
|
602 |
+
|
603 |
+
t.close(null, w.id);
|
604 |
+
},
|
605 |
+
content : DOM.encode(t.editor.getLang(txt, txt)),
|
606 |
+
inline : 1,
|
607 |
+
width : 400,
|
608 |
+
height : 130
|
609 |
+
});
|
610 |
+
},
|
611 |
+
|
612 |
+
confirm : function(txt, cb, s) {
|
613 |
+
var t = this, w;
|
614 |
+
|
615 |
+
w = t.open({
|
616 |
+
title : t,
|
617 |
+
type : 'confirm',
|
618 |
+
button_func : function(s) {
|
619 |
+
if (cb)
|
620 |
+
cb.call(s || t, s);
|
621 |
+
|
622 |
+
t.close(null, w.id);
|
623 |
+
},
|
624 |
+
content : DOM.encode(t.editor.getLang(txt, txt)),
|
625 |
+
inline : 1,
|
626 |
+
width : 400,
|
627 |
+
height : 130
|
628 |
+
});
|
629 |
+
},
|
630 |
+
|
631 |
+
// Internal functions
|
632 |
+
|
633 |
+
_findId : function(w) {
|
634 |
+
var t = this;
|
635 |
+
|
636 |
+
if (typeof(w) == 'string')
|
637 |
+
return w;
|
638 |
+
|
639 |
+
each(t.windows, function(wo) {
|
640 |
+
var ifr = DOM.get(wo.id + '_ifr');
|
641 |
+
|
642 |
+
if (ifr && w == ifr.contentWindow) {
|
643 |
+
w = wo.id;
|
644 |
+
return false;
|
645 |
+
}
|
646 |
+
});
|
647 |
+
|
648 |
+
return w;
|
649 |
+
},
|
650 |
+
|
651 |
+
_fixIELayout : function(id, s) {
|
652 |
+
var w, img;
|
653 |
+
|
654 |
+
if (!tinymce.isIE6)
|
655 |
+
return;
|
656 |
+
|
657 |
+
// Fixes the bug where hover flickers and does odd things in IE6
|
658 |
+
each(['n','s','w','e','nw','ne','sw','se'], function(v) {
|
659 |
+
var e = DOM.get(id + '_resize_' + v);
|
660 |
+
|
661 |
+
DOM.setStyles(e, {
|
662 |
+
width : s ? e.clientWidth : '',
|
663 |
+
height : s ? e.clientHeight : '',
|
664 |
+
cursor : DOM.getStyle(e, 'cursor', 1)
|
665 |
+
});
|
666 |
+
|
667 |
+
DOM.setStyle(id + "_bottom", 'bottom', '-1px');
|
668 |
+
|
669 |
+
e = 0;
|
670 |
+
});
|
671 |
+
|
672 |
+
// Fixes graphics glitch
|
673 |
+
if (w = this.windows[id]) {
|
674 |
+
// Fixes rendering bug after resize
|
675 |
+
w.element.hide();
|
676 |
+
w.element.show();
|
677 |
+
|
678 |
+
// Forced a repaint of the window
|
679 |
+
//DOM.get(id).style.filter = '';
|
680 |
+
|
681 |
+
// IE has a bug where images used in CSS won't get loaded
|
682 |
+
// sometimes when the cache in the browser is disabled
|
683 |
+
// This fix tries to solve it by loading the images using the image object
|
684 |
+
each(DOM.select('div,a', id), function(e, i) {
|
685 |
+
if (e.currentStyle.backgroundImage != 'none') {
|
686 |
+
img = new Image();
|
687 |
+
img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1');
|
688 |
+
}
|
689 |
+
});
|
690 |
+
|
691 |
+
DOM.get(id).style.filter = '';
|
692 |
+
}
|
693 |
+
}
|
694 |
+
});
|
695 |
+
|
696 |
+
// Register plugin
|
697 |
+
tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups);
|
698 |
+
})();
|
699 |
+
|
js/libraries/tiny_mce/plugins/inlinepopups/template.htm
CHANGED
@@ -1,387 +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>
|
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>
|
js/libraries/tiny_mce/plugins/insertdatetime/editor_plugin_src.js
CHANGED
@@ -1,83 +1,83 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.InsertDateTime', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
var t = this;
|
15 |
-
|
16 |
-
t.editor = ed;
|
17 |
-
|
18 |
-
ed.addCommand('mceInsertDate', function() {
|
19 |
-
var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));
|
20 |
-
|
21 |
-
ed.execCommand('mceInsertContent', false, str);
|
22 |
-
});
|
23 |
-
|
24 |
-
ed.addCommand('mceInsertTime', function() {
|
25 |
-
var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));
|
26 |
-
|
27 |
-
ed.execCommand('mceInsertContent', false, str);
|
28 |
-
});
|
29 |
-
|
30 |
-
ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'});
|
31 |
-
ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'});
|
32 |
-
},
|
33 |
-
|
34 |
-
getInfo : function() {
|
35 |
-
return {
|
36 |
-
longname : 'Insert date/time',
|
37 |
-
author : 'Moxiecode Systems AB',
|
38 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
39 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',
|
40 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
41 |
-
};
|
42 |
-
},
|
43 |
-
|
44 |
-
// Private methods
|
45 |
-
|
46 |
-
_getDateTime : function(d, fmt) {
|
47 |
-
var ed = this.editor;
|
48 |
-
|
49 |
-
function addZeros(value, len) {
|
50 |
-
value = "" + value;
|
51 |
-
|
52 |
-
if (value.length < len) {
|
53 |
-
for (var i=0; i<(len-value.length); i++)
|
54 |
-
value = "0" + value;
|
55 |
-
}
|
56 |
-
|
57 |
-
return value;
|
58 |
-
};
|
59 |
-
|
60 |
-
fmt = fmt.replace("%D", "%m/%d/%y");
|
61 |
-
fmt = fmt.replace("%r", "%I:%M:%S %p");
|
62 |
-
fmt = fmt.replace("%Y", "" + d.getFullYear());
|
63 |
-
fmt = fmt.replace("%y", "" + d.getYear());
|
64 |
-
fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
|
65 |
-
fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
|
66 |
-
fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
|
67 |
-
fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
|
68 |
-
fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
|
69 |
-
fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
|
70 |
-
fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
|
71 |
-
fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);
|
72 |
-
fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);
|
73 |
-
fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);
|
74 |
-
fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);
|
75 |
-
fmt = fmt.replace("%%", "%");
|
76 |
-
|
77 |
-
return fmt;
|
78 |
-
}
|
79 |
-
});
|
80 |
-
|
81 |
-
// Register plugin
|
82 |
-
tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);
|
83 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.InsertDateTime', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this;
|
15 |
+
|
16 |
+
t.editor = ed;
|
17 |
+
|
18 |
+
ed.addCommand('mceInsertDate', function() {
|
19 |
+
var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));
|
20 |
+
|
21 |
+
ed.execCommand('mceInsertContent', false, str);
|
22 |
+
});
|
23 |
+
|
24 |
+
ed.addCommand('mceInsertTime', function() {
|
25 |
+
var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));
|
26 |
+
|
27 |
+
ed.execCommand('mceInsertContent', false, str);
|
28 |
+
});
|
29 |
+
|
30 |
+
ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'});
|
31 |
+
ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'});
|
32 |
+
},
|
33 |
+
|
34 |
+
getInfo : function() {
|
35 |
+
return {
|
36 |
+
longname : 'Insert date/time',
|
37 |
+
author : 'Moxiecode Systems AB',
|
38 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
39 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',
|
40 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
41 |
+
};
|
42 |
+
},
|
43 |
+
|
44 |
+
// Private methods
|
45 |
+
|
46 |
+
_getDateTime : function(d, fmt) {
|
47 |
+
var ed = this.editor;
|
48 |
+
|
49 |
+
function addZeros(value, len) {
|
50 |
+
value = "" + value;
|
51 |
+
|
52 |
+
if (value.length < len) {
|
53 |
+
for (var i=0; i<(len-value.length); i++)
|
54 |
+
value = "0" + value;
|
55 |
+
}
|
56 |
+
|
57 |
+
return value;
|
58 |
+
};
|
59 |
+
|
60 |
+
fmt = fmt.replace("%D", "%m/%d/%y");
|
61 |
+
fmt = fmt.replace("%r", "%I:%M:%S %p");
|
62 |
+
fmt = fmt.replace("%Y", "" + d.getFullYear());
|
63 |
+
fmt = fmt.replace("%y", "" + d.getYear());
|
64 |
+
fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
|
65 |
+
fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
|
66 |
+
fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
|
67 |
+
fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
|
68 |
+
fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
|
69 |
+
fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
|
70 |
+
fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
|
71 |
+
fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);
|
72 |
+
fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);
|
73 |
+
fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);
|
74 |
+
fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);
|
75 |
+
fmt = fmt.replace("%%", "%");
|
76 |
+
|
77 |
+
return fmt;
|
78 |
+
}
|
79 |
+
});
|
80 |
+
|
81 |
+
// Register plugin
|
82 |
+
tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);
|
83 |
})();
|
js/libraries/tiny_mce/plugins/layer/editor_plugin_src.js
CHANGED
@@ -1,262 +1,262 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
function findParentLayer(node) {
|
13 |
-
do {
|
14 |
-
if (node.className && node.className.indexOf('mceItemLayer') != -1) {
|
15 |
-
return node;
|
16 |
-
}
|
17 |
-
} while (node = node.parentNode);
|
18 |
-
};
|
19 |
-
|
20 |
-
tinymce.create('tinymce.plugins.Layer', {
|
21 |
-
init : function(ed, url) {
|
22 |
-
var t = this;
|
23 |
-
|
24 |
-
t.editor = ed;
|
25 |
-
|
26 |
-
// Register commands
|
27 |
-
ed.addCommand('mceInsertLayer', t._insertLayer, t);
|
28 |
-
|
29 |
-
ed.addCommand('mceMoveForward', function() {
|
30 |
-
t._move(1);
|
31 |
-
});
|
32 |
-
|
33 |
-
ed.addCommand('mceMoveBackward', function() {
|
34 |
-
t._move(-1);
|
35 |
-
});
|
36 |
-
|
37 |
-
ed.addCommand('mceMakeAbsolute', function() {
|
38 |
-
t._toggleAbsolute();
|
39 |
-
});
|
40 |
-
|
41 |
-
// Register buttons
|
42 |
-
ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'});
|
43 |
-
ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'});
|
44 |
-
ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'});
|
45 |
-
ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});
|
46 |
-
|
47 |
-
ed.onInit.add(function() {
|
48 |
-
var dom = ed.dom;
|
49 |
-
|
50 |
-
if (tinymce.isIE)
|
51 |
-
ed.getDoc().execCommand('2D-Position', false, true);
|
52 |
-
});
|
53 |
-
|
54 |
-
// Remove serialized styles when selecting a layer since it might be changed by a drag operation
|
55 |
-
ed.onMouseUp.add(function(ed, e) {
|
56 |
-
var layer = findParentLayer(e.target);
|
57 |
-
|
58 |
-
if (layer) {
|
59 |
-
ed.dom.setAttrib(layer, 'data-mce-style', '');
|
60 |
-
}
|
61 |
-
});
|
62 |
-
|
63 |
-
// Fixes edit focus issues with layers on Gecko
|
64 |
-
// This will enable designMode while inside a layer and disable it when outside
|
65 |
-
ed.onMouseDown.add(function(ed, e) {
|
66 |
-
var node = e.target, doc = ed.getDoc(), parent;
|
67 |
-
|
68 |
-
if (tinymce.isGecko) {
|
69 |
-
if (findParentLayer(node)) {
|
70 |
-
if (doc.designMode !== 'on') {
|
71 |
-
doc.designMode = 'on';
|
72 |
-
|
73 |
-
// Repaint caret
|
74 |
-
node = doc.body;
|
75 |
-
parent = node.parentNode;
|
76 |
-
parent.removeChild(node);
|
77 |
-
parent.appendChild(node);
|
78 |
-
}
|
79 |
-
} else if (doc.designMode == 'on') {
|
80 |
-
doc.designMode = 'off';
|
81 |
-
}
|
82 |
-
}
|
83 |
-
});
|
84 |
-
|
85 |
-
ed.onNodeChange.add(t._nodeChange, t);
|
86 |
-
ed.onVisualAid.add(t._visualAid, t);
|
87 |
-
},
|
88 |
-
|
89 |
-
getInfo : function() {
|
90 |
-
return {
|
91 |
-
longname : 'Layer',
|
92 |
-
author : 'Moxiecode Systems AB',
|
93 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
94 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',
|
95 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
96 |
-
};
|
97 |
-
},
|
98 |
-
|
99 |
-
// Private methods
|
100 |
-
|
101 |
-
_nodeChange : function(ed, cm, n) {
|
102 |
-
var le, p;
|
103 |
-
|
104 |
-
le = this._getParentLayer(n);
|
105 |
-
p = ed.dom.getParent(n, 'DIV,P,IMG');
|
106 |
-
|
107 |
-
if (!p) {
|
108 |
-
cm.setDisabled('absolute', 1);
|
109 |
-
cm.setDisabled('moveforward', 1);
|
110 |
-
cm.setDisabled('movebackward', 1);
|
111 |
-
} else {
|
112 |
-
cm.setDisabled('absolute', 0);
|
113 |
-
cm.setDisabled('moveforward', !le);
|
114 |
-
cm.setDisabled('movebackward', !le);
|
115 |
-
cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");
|
116 |
-
}
|
117 |
-
},
|
118 |
-
|
119 |
-
// Private methods
|
120 |
-
|
121 |
-
_visualAid : function(ed, e, s) {
|
122 |
-
var dom = ed.dom;
|
123 |
-
|
124 |
-
tinymce.each(dom.select('div,p', e), function(e) {
|
125 |
-
if (/^(absolute|relative|fixed)$/i.test(e.style.position)) {
|
126 |
-
if (s)
|
127 |
-
dom.addClass(e, 'mceItemVisualAid');
|
128 |
-
else
|
129 |
-
dom.removeClass(e, 'mceItemVisualAid');
|
130 |
-
|
131 |
-
dom.addClass(e, 'mceItemLayer');
|
132 |
-
}
|
133 |
-
});
|
134 |
-
},
|
135 |
-
|
136 |
-
_move : function(d) {
|
137 |
-
var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;
|
138 |
-
|
139 |
-
nl = [];
|
140 |
-
tinymce.walk(ed.getBody(), function(n) {
|
141 |
-
if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))
|
142 |
-
nl.push(n);
|
143 |
-
}, 'childNodes');
|
144 |
-
|
145 |
-
// Find z-indexes
|
146 |
-
for (i=0; i<nl.length; i++) {
|
147 |
-
z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;
|
148 |
-
|
149 |
-
if (ci < 0 && nl[i] == le)
|
150 |
-
ci = i;
|
151 |
-
}
|
152 |
-
|
153 |
-
if (d < 0) {
|
154 |
-
// Move back
|
155 |
-
|
156 |
-
// Try find a lower one
|
157 |
-
for (i=0; i<z.length; i++) {
|
158 |
-
if (z[i] < z[ci]) {
|
159 |
-
fi = i;
|
160 |
-
break;
|
161 |
-
}
|
162 |
-
}
|
163 |
-
|
164 |
-
if (fi > -1) {
|
165 |
-
nl[ci].style.zIndex = z[fi];
|
166 |
-
nl[fi].style.zIndex = z[ci];
|
167 |
-
} else {
|
168 |
-
if (z[ci] > 0)
|
169 |
-
nl[ci].style.zIndex = z[ci] - 1;
|
170 |
-
}
|
171 |
-
} else {
|
172 |
-
// Move forward
|
173 |
-
|
174 |
-
// Try find a higher one
|
175 |
-
for (i=0; i<z.length; i++) {
|
176 |
-
if (z[i] > z[ci]) {
|
177 |
-
fi = i;
|
178 |
-
break;
|
179 |
-
}
|
180 |
-
}
|
181 |
-
|
182 |
-
if (fi > -1) {
|
183 |
-
nl[ci].style.zIndex = z[fi];
|
184 |
-
nl[fi].style.zIndex = z[ci];
|
185 |
-
} else
|
186 |
-
nl[ci].style.zIndex = z[ci] + 1;
|
187 |
-
}
|
188 |
-
|
189 |
-
ed.execCommand('mceRepaint');
|
190 |
-
},
|
191 |
-
|
192 |
-
_getParentLayer : function(n) {
|
193 |
-
return this.editor.dom.getParent(n, function(n) {
|
194 |
-
return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);
|
195 |
-
});
|
196 |
-
},
|
197 |
-
|
198 |
-
_insertLayer : function() {
|
199 |
-
var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody();
|
200 |
-
|
201 |
-
ed.dom.add(body, 'div', {
|
202 |
-
style : {
|
203 |
-
position : 'absolute',
|
204 |
-
left : p.x,
|
205 |
-
top : (p.y > 20 ? p.y : 20),
|
206 |
-
width : 100,
|
207 |
-
height : 100
|
208 |
-
},
|
209 |
-
'class' : 'mceItemVisualAid mceItemLayer'
|
210 |
-
}, ed.selection.getContent() || ed.getLang('layer.content'));
|
211 |
-
|
212 |
-
// Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7
|
213 |
-
if (tinymce.isIE)
|
214 |
-
dom.setHTML(body, body.innerHTML);
|
215 |
-
},
|
216 |
-
|
217 |
-
_toggleAbsolute : function() {
|
218 |
-
var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());
|
219 |
-
|
220 |
-
if (!le)
|
221 |
-
le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');
|
222 |
-
|
223 |
-
if (le) {
|
224 |
-
if (le.style.position.toLowerCase() == "absolute") {
|
225 |
-
ed.dom.setStyles(le, {
|
226 |
-
position : '',
|
227 |
-
left : '',
|
228 |
-
top : '',
|
229 |
-
width : '',
|
230 |
-
height : ''
|
231 |
-
});
|
232 |
-
|
233 |
-
ed.dom.removeClass(le, 'mceItemVisualAid');
|
234 |
-
ed.dom.removeClass(le, 'mceItemLayer');
|
235 |
-
} else {
|
236 |
-
if (le.style.left == "")
|
237 |
-
le.style.left = 20 + 'px';
|
238 |
-
|
239 |
-
if (le.style.top == "")
|
240 |
-
le.style.top = 20 + 'px';
|
241 |
-
|
242 |
-
if (le.style.width == "")
|
243 |
-
le.style.width = le.width ? (le.width + 'px') : '100px';
|
244 |
-
|
245 |
-
if (le.style.height == "")
|
246 |
-
le.style.height = le.height ? (le.height + 'px') : '100px';
|
247 |
-
|
248 |
-
le.style.position = "absolute";
|
249 |
-
|
250 |
-
ed.dom.setAttrib(le, 'data-mce-style', '');
|
251 |
-
ed.addVisual(ed.getBody());
|
252 |
-
}
|
253 |
-
|
254 |
-
ed.execCommand('mceRepaint');
|
255 |
-
ed.nodeChanged();
|
256 |
-
}
|
257 |
-
}
|
258 |
-
});
|
259 |
-
|
260 |
-
// Register plugin
|
261 |
-
tinymce.PluginManager.add('layer', tinymce.plugins.Layer);
|
262 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
function findParentLayer(node) {
|
13 |
+
do {
|
14 |
+
if (node.className && node.className.indexOf('mceItemLayer') != -1) {
|
15 |
+
return node;
|
16 |
+
}
|
17 |
+
} while (node = node.parentNode);
|
18 |
+
};
|
19 |
+
|
20 |
+
tinymce.create('tinymce.plugins.Layer', {
|
21 |
+
init : function(ed, url) {
|
22 |
+
var t = this;
|
23 |
+
|
24 |
+
t.editor = ed;
|
25 |
+
|
26 |
+
// Register commands
|
27 |
+
ed.addCommand('mceInsertLayer', t._insertLayer, t);
|
28 |
+
|
29 |
+
ed.addCommand('mceMoveForward', function() {
|
30 |
+
t._move(1);
|
31 |
+
});
|
32 |
+
|
33 |
+
ed.addCommand('mceMoveBackward', function() {
|
34 |
+
t._move(-1);
|
35 |
+
});
|
36 |
+
|
37 |
+
ed.addCommand('mceMakeAbsolute', function() {
|
38 |
+
t._toggleAbsolute();
|
39 |
+
});
|
40 |
+
|
41 |
+
// Register buttons
|
42 |
+
ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'});
|
43 |
+
ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'});
|
44 |
+
ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'});
|
45 |
+
ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});
|
46 |
+
|
47 |
+
ed.onInit.add(function() {
|
48 |
+
var dom = ed.dom;
|
49 |
+
|
50 |
+
if (tinymce.isIE)
|
51 |
+
ed.getDoc().execCommand('2D-Position', false, true);
|
52 |
+
});
|
53 |
+
|
54 |
+
// Remove serialized styles when selecting a layer since it might be changed by a drag operation
|
55 |
+
ed.onMouseUp.add(function(ed, e) {
|
56 |
+
var layer = findParentLayer(e.target);
|
57 |
+
|
58 |
+
if (layer) {
|
59 |
+
ed.dom.setAttrib(layer, 'data-mce-style', '');
|
60 |
+
}
|
61 |
+
});
|
62 |
+
|
63 |
+
// Fixes edit focus issues with layers on Gecko
|
64 |
+
// This will enable designMode while inside a layer and disable it when outside
|
65 |
+
ed.onMouseDown.add(function(ed, e) {
|
66 |
+
var node = e.target, doc = ed.getDoc(), parent;
|
67 |
+
|
68 |
+
if (tinymce.isGecko) {
|
69 |
+
if (findParentLayer(node)) {
|
70 |
+
if (doc.designMode !== 'on') {
|
71 |
+
doc.designMode = 'on';
|
72 |
+
|
73 |
+
// Repaint caret
|
74 |
+
node = doc.body;
|
75 |
+
parent = node.parentNode;
|
76 |
+
parent.removeChild(node);
|
77 |
+
parent.appendChild(node);
|
78 |
+
}
|
79 |
+
} else if (doc.designMode == 'on') {
|
80 |
+
doc.designMode = 'off';
|
81 |
+
}
|
82 |
+
}
|
83 |
+
});
|
84 |
+
|
85 |
+
ed.onNodeChange.add(t._nodeChange, t);
|
86 |
+
ed.onVisualAid.add(t._visualAid, t);
|
87 |
+
},
|
88 |
+
|
89 |
+
getInfo : function() {
|
90 |
+
return {
|
91 |
+
longname : 'Layer',
|
92 |
+
author : 'Moxiecode Systems AB',
|
93 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
94 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',
|
95 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
96 |
+
};
|
97 |
+
},
|
98 |
+
|
99 |
+
// Private methods
|
100 |
+
|
101 |
+
_nodeChange : function(ed, cm, n) {
|
102 |
+
var le, p;
|
103 |
+
|
104 |
+
le = this._getParentLayer(n);
|
105 |
+
p = ed.dom.getParent(n, 'DIV,P,IMG');
|
106 |
+
|
107 |
+
if (!p) {
|
108 |
+
cm.setDisabled('absolute', 1);
|
109 |
+
cm.setDisabled('moveforward', 1);
|
110 |
+
cm.setDisabled('movebackward', 1);
|
111 |
+
} else {
|
112 |
+
cm.setDisabled('absolute', 0);
|
113 |
+
cm.setDisabled('moveforward', !le);
|
114 |
+
cm.setDisabled('movebackward', !le);
|
115 |
+
cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");
|
116 |
+
}
|
117 |
+
},
|
118 |
+
|
119 |
+
// Private methods
|
120 |
+
|
121 |
+
_visualAid : function(ed, e, s) {
|
122 |
+
var dom = ed.dom;
|
123 |
+
|
124 |
+
tinymce.each(dom.select('div,p', e), function(e) {
|
125 |
+
if (/^(absolute|relative|fixed)$/i.test(e.style.position)) {
|
126 |
+
if (s)
|
127 |
+
dom.addClass(e, 'mceItemVisualAid');
|
128 |
+
else
|
129 |
+
dom.removeClass(e, 'mceItemVisualAid');
|
130 |
+
|
131 |
+
dom.addClass(e, 'mceItemLayer');
|
132 |
+
}
|
133 |
+
});
|
134 |
+
},
|
135 |
+
|
136 |
+
_move : function(d) {
|
137 |
+
var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;
|
138 |
+
|
139 |
+
nl = [];
|
140 |
+
tinymce.walk(ed.getBody(), function(n) {
|
141 |
+
if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))
|
142 |
+
nl.push(n);
|
143 |
+
}, 'childNodes');
|
144 |
+
|
145 |
+
// Find z-indexes
|
146 |
+
for (i=0; i<nl.length; i++) {
|
147 |
+
z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;
|
148 |
+
|
149 |
+
if (ci < 0 && nl[i] == le)
|
150 |
+
ci = i;
|
151 |
+
}
|
152 |
+
|
153 |
+
if (d < 0) {
|
154 |
+
// Move back
|
155 |
+
|
156 |
+
// Try find a lower one
|
157 |
+
for (i=0; i<z.length; i++) {
|
158 |
+
if (z[i] < z[ci]) {
|
159 |
+
fi = i;
|
160 |
+
break;
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
if (fi > -1) {
|
165 |
+
nl[ci].style.zIndex = z[fi];
|
166 |
+
nl[fi].style.zIndex = z[ci];
|
167 |
+
} else {
|
168 |
+
if (z[ci] > 0)
|
169 |
+
nl[ci].style.zIndex = z[ci] - 1;
|
170 |
+
}
|
171 |
+
} else {
|
172 |
+
// Move forward
|
173 |
+
|
174 |
+
// Try find a higher one
|
175 |
+
for (i=0; i<z.length; i++) {
|
176 |
+
if (z[i] > z[ci]) {
|
177 |
+
fi = i;
|
178 |
+
break;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
if (fi > -1) {
|
183 |
+
nl[ci].style.zIndex = z[fi];
|
184 |
+
nl[fi].style.zIndex = z[ci];
|
185 |
+
} else
|
186 |
+
nl[ci].style.zIndex = z[ci] + 1;
|
187 |
+
}
|
188 |
+
|
189 |
+
ed.execCommand('mceRepaint');
|
190 |
+
},
|
191 |
+
|
192 |
+
_getParentLayer : function(n) {
|
193 |
+
return this.editor.dom.getParent(n, function(n) {
|
194 |
+
return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);
|
195 |
+
});
|
196 |
+
},
|
197 |
+
|
198 |
+
_insertLayer : function() {
|
199 |
+
var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody();
|
200 |
+
|
201 |
+
ed.dom.add(body, 'div', {
|
202 |
+
style : {
|
203 |
+
position : 'absolute',
|
204 |
+
left : p.x,
|
205 |
+
top : (p.y > 20 ? p.y : 20),
|
206 |
+
width : 100,
|
207 |
+
height : 100
|
208 |
+
},
|
209 |
+
'class' : 'mceItemVisualAid mceItemLayer'
|
210 |
+
}, ed.selection.getContent() || ed.getLang('layer.content'));
|
211 |
+
|
212 |
+
// Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7
|
213 |
+
if (tinymce.isIE)
|
214 |
+
dom.setHTML(body, body.innerHTML);
|
215 |
+
},
|
216 |
+
|
217 |
+
_toggleAbsolute : function() {
|
218 |
+
var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());
|
219 |
+
|
220 |
+
if (!le)
|
221 |
+
le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');
|
222 |
+
|
223 |
+
if (le) {
|
224 |
+
if (le.style.position.toLowerCase() == "absolute") {
|
225 |
+
ed.dom.setStyles(le, {
|
226 |
+
position : '',
|
227 |
+
left : '',
|
228 |
+
top : '',
|
229 |
+
width : '',
|
230 |
+
height : ''
|
231 |
+
});
|
232 |
+
|
233 |
+
ed.dom.removeClass(le, 'mceItemVisualAid');
|
234 |
+
ed.dom.removeClass(le, 'mceItemLayer');
|
235 |
+
} else {
|
236 |
+
if (le.style.left == "")
|
237 |
+
le.style.left = 20 + 'px';
|
238 |
+
|
239 |
+
if (le.style.top == "")
|
240 |
+
le.style.top = 20 + 'px';
|
241 |
+
|
242 |
+
if (le.style.width == "")
|
243 |
+
le.style.width = le.width ? (le.width + 'px') : '100px';
|
244 |
+
|
245 |
+
if (le.style.height == "")
|
246 |
+
le.style.height = le.height ? (le.height + 'px') : '100px';
|
247 |
+
|
248 |
+
le.style.position = "absolute";
|
249 |
+
|
250 |
+
ed.dom.setAttrib(le, 'data-mce-style', '');
|
251 |
+
ed.addVisual(ed.getBody());
|
252 |
+
}
|
253 |
+
|
254 |
+
ed.execCommand('mceRepaint');
|
255 |
+
ed.nodeChanged();
|
256 |
+
}
|
257 |
+
}
|
258 |
+
});
|
259 |
+
|
260 |
+
// Register plugin
|
261 |
+
tinymce.PluginManager.add('layer', tinymce.plugins.Layer);
|
262 |
})();
|
js/libraries/tiny_mce/plugins/legacyoutput/editor_plugin_src.js
CHANGED
@@ -1,139 +1,139 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*
|
10 |
-
* This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align
|
11 |
-
* attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash
|
12 |
-
*
|
13 |
-
* However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are
|
14 |
-
* not apart of the newer specifications for HTML and XHTML.
|
15 |
-
*/
|
16 |
-
|
17 |
-
(function(tinymce) {
|
18 |
-
// Override inline_styles setting to force TinyMCE to produce deprecated contents
|
19 |
-
tinymce.onAddEditor.addToTop(function(tinymce, editor) {
|
20 |
-
editor.settings.inline_styles = false;
|
21 |
-
});
|
22 |
-
|
23 |
-
// Create the legacy ouput plugin
|
24 |
-
tinymce.create('tinymce.plugins.LegacyOutput', {
|
25 |
-
init : function(editor) {
|
26 |
-
editor.onInit.add(function() {
|
27 |
-
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',
|
28 |
-
fontSizes = tinymce.explode(editor.settings.font_size_style_values),
|
29 |
-
schema = editor.schema;
|
30 |
-
|
31 |
-
// Override some internal formats to produce legacy elements and attributes
|
32 |
-
editor.formatter.register({
|
33 |
-
// Change alignment formats to use the deprecated align attribute
|
34 |
-
alignleft : {selector : alignElements, attributes : {align : 'left'}},
|
35 |
-
aligncenter : {selector : alignElements, attributes : {align : 'center'}},
|
36 |
-
alignright : {selector : alignElements, attributes : {align : 'right'}},
|
37 |
-
alignfull : {selector : alignElements, attributes : {align : 'justify'}},
|
38 |
-
|
39 |
// Change the basic formatting elements to use deprecated element types
|
40 |
-
bold : [
|
41 |
-
{inline : 'b', remove : 'all'},
|
42 |
-
{inline : 'strong', remove : 'all'},
|
43 |
-
{inline : 'span', styles : {fontWeight : 'bold'}}
|
44 |
-
],
|
45 |
-
italic : [
|
46 |
-
{inline : 'i', remove : 'all'},
|
47 |
-
{inline : 'em', remove : 'all'},
|
48 |
-
{inline : 'span', styles : {fontStyle : 'italic'}}
|
49 |
-
],
|
50 |
-
underline : [
|
51 |
-
{inline : 'u', remove : 'all'},
|
52 |
-
{inline : 'span', styles : {textDecoration : 'underline'}, exact : true}
|
53 |
-
],
|
54 |
-
strikethrough : [
|
55 |
-
{inline : 'strike', remove : 'all'},
|
56 |
-
{inline : 'span', styles : {textDecoration: 'line-through'}, exact : true}
|
57 |
],
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
if (
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*
|
10 |
+
* This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align
|
11 |
+
* attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash
|
12 |
+
*
|
13 |
+
* However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are
|
14 |
+
* not apart of the newer specifications for HTML and XHTML.
|
15 |
+
*/
|
16 |
+
|
17 |
+
(function(tinymce) {
|
18 |
+
// Override inline_styles setting to force TinyMCE to produce deprecated contents
|
19 |
+
tinymce.onAddEditor.addToTop(function(tinymce, editor) {
|
20 |
+
editor.settings.inline_styles = false;
|
21 |
+
});
|
22 |
+
|
23 |
+
// Create the legacy ouput plugin
|
24 |
+
tinymce.create('tinymce.plugins.LegacyOutput', {
|
25 |
+
init : function(editor) {
|
26 |
+
editor.onInit.add(function() {
|
27 |
+
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',
|
28 |
+
fontSizes = tinymce.explode(editor.settings.font_size_style_values),
|
29 |
+
schema = editor.schema;
|
30 |
+
|
31 |
+
// Override some internal formats to produce legacy elements and attributes
|
32 |
+
editor.formatter.register({
|
33 |
+
// Change alignment formats to use the deprecated align attribute
|
34 |
+
alignleft : {selector : alignElements, attributes : {align : 'left'}},
|
35 |
+
aligncenter : {selector : alignElements, attributes : {align : 'center'}},
|
36 |
+
alignright : {selector : alignElements, attributes : {align : 'right'}},
|
37 |
+
alignfull : {selector : alignElements, attributes : {align : 'justify'}},
|
38 |
+
|
39 |
// Change the basic formatting elements to use deprecated element types
|
40 |
+
bold : [
|
41 |
+
{inline : 'b', remove : 'all'},
|
42 |
+
{inline : 'strong', remove : 'all'},
|
43 |
+
{inline : 'span', styles : {fontWeight : 'bold'}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
],
|
45 |
+
italic : [
|
46 |
+
{inline : 'i', remove : 'all'},
|
47 |
+
{inline : 'em', remove : 'all'},
|
48 |
+
{inline : 'span', styles : {fontStyle : 'italic'}}
|
49 |
+
],
|
50 |
+
underline : [
|
51 |
+
{inline : 'u', remove : 'all'},
|
52 |
+
{inline : 'span', styles : {textDecoration : 'underline'}, exact : true}
|
53 |
+
],
|
54 |
+
strikethrough : [
|
55 |
+
{inline : 'strike', remove : 'all'},
|
56 |
+
{inline : 'span', styles : {textDecoration: 'line-through'}, exact : true}
|
57 |
+
],
|
58 |
+
|
59 |
+
// Change font size and font family to use the deprecated font element
|
60 |
+
fontname : {inline : 'font', attributes : {face : '%value'}},
|
61 |
+
fontsize : {
|
62 |
+
inline : 'font',
|
63 |
+
attributes : {
|
64 |
+
size : function(vars) {
|
65 |
+
return tinymce.inArray(fontSizes, vars.value) + 1;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
},
|
69 |
+
|
70 |
+
// Setup font elements for colors as well
|
71 |
+
forecolor : {inline : 'font', attributes : {color : '%value'}},
|
72 |
+
hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}}
|
73 |
+
});
|
74 |
+
|
75 |
+
// Check that deprecated elements are allowed if not add them
|
76 |
+
tinymce.each('b,i,u,strike'.split(','), function(name) {
|
77 |
+
schema.addValidElements(name + '[*]');
|
78 |
+
});
|
79 |
+
|
80 |
+
// Add font element if it's missing
|
81 |
+
if (!schema.getElementRule("font"))
|
82 |
+
schema.addValidElements("font[face|size|color|style]");
|
83 |
+
|
84 |
+
// Add the missing and depreacted align attribute for the serialization engine
|
85 |
+
tinymce.each(alignElements.split(','), function(name) {
|
86 |
+
var rule = schema.getElementRule(name), found;
|
87 |
+
|
88 |
+
if (rule) {
|
89 |
+
if (!rule.attributes.align) {
|
90 |
+
rule.attributes.align = {};
|
91 |
+
rule.attributesOrder.push('align');
|
92 |
+
}
|
93 |
+
}
|
94 |
+
});
|
95 |
+
|
96 |
+
// Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes
|
97 |
+
editor.onNodeChange.add(function(editor, control_manager) {
|
98 |
+
var control, fontElm, fontName, fontSize;
|
99 |
+
|
100 |
+
// Find font element get it's name and size
|
101 |
+
fontElm = editor.dom.getParent(editor.selection.getNode(), 'font');
|
102 |
+
if (fontElm) {
|
103 |
+
fontName = fontElm.face;
|
104 |
+
fontSize = fontElm.size;
|
105 |
+
}
|
106 |
+
|
107 |
+
// Select/unselect the font name in droplist
|
108 |
+
if (control = control_manager.get('fontselect')) {
|
109 |
+
control.select(function(value) {
|
110 |
+
return value == fontName;
|
111 |
+
});
|
112 |
+
}
|
113 |
+
|
114 |
+
// Select/unselect the font size in droplist
|
115 |
+
if (control = control_manager.get('fontsizeselect')) {
|
116 |
+
control.select(function(value) {
|
117 |
+
var index = tinymce.inArray(fontSizes, value.fontSize);
|
118 |
+
|
119 |
+
return index + 1 == fontSize;
|
120 |
+
});
|
121 |
+
}
|
122 |
+
});
|
123 |
+
});
|
124 |
+
},
|
125 |
+
|
126 |
+
getInfo : function() {
|
127 |
+
return {
|
128 |
+
longname : 'LegacyOutput',
|
129 |
+
author : 'Moxiecode Systems AB',
|
130 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
131 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput',
|
132 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
133 |
+
};
|
134 |
+
}
|
135 |
+
});
|
136 |
+
|
137 |
+
// Register plugin
|
138 |
+
tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput);
|
139 |
+
})(tinymce);
|
js/libraries/tiny_mce/plugins/media/css/media.css
CHANGED
@@ -1,17 +1,17 @@
|
|
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, #html5_altsource1, #html5_altsource2, #html5_poster { 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: 260px; overflow: auto }
|
9 |
-
.panel_wrapper div.current { height: 420px; 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 }
|
17 |
-
iframe {border: 1px solid gray}
|
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, #html5_altsource1, #html5_altsource2, #html5_poster { 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: 260px; overflow: auto }
|
9 |
+
.panel_wrapper div.current { height: 420px; 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 }
|
17 |
+
iframe {border: 1px solid gray}
|
js/libraries/tiny_mce/plugins/media/editor_plugin_src.js
CHANGED
@@ -1,898 +1,898 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
var rootAttributes = tinymce.explode('id,name,width,height,style,align,class,hspace,vspace,bgcolor,type'), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node,
|
13 |
-
mediaTypes, scriptRegExp, JSON = tinymce.util.JSON, mimeTypes;
|
14 |
-
|
15 |
-
// Media types supported by this plugin
|
16 |
-
mediaTypes = [
|
17 |
-
// Type, clsid:s, mime types, codebase
|
18 |
-
["Flash", "d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],
|
19 |
-
["ShockWave", "166b1bca-3f9c-11cf-8075-444553540000", "application/x-director", "http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],
|
20 |
-
["WindowsMedia", "6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a", "application/x-mplayer2", "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],
|
21 |
-
["QuickTime", "02bf25d5-8c17-4b23-bc80-d3488abddc6b", "video/quicktime", "http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],
|
22 |
-
["RealMedia", "cfcdaa03-8be4-11cf-b84b-0020afbbccfa", "audio/x-pn-realaudio-plugin", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],
|
23 |
-
["Java", "8ad9c840-044e-11d1-b3e9-00805f499d93", "application/x-java-applet", "http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],
|
24 |
-
["Silverlight", "dfeaf541-f3e1-4c24-acac-99c30715084a", "application/x-silverlight-2"],
|
25 |
-
["Iframe"],
|
26 |
-
["Video"],
|
27 |
-
["EmbeddedAudio"],
|
28 |
-
["Audio"]
|
29 |
-
];
|
30 |
-
|
31 |
-
function normalizeSize(size) {
|
32 |
-
return typeof(size) == "string" ? size.replace(/[^0-9%]/g, '') : size;
|
33 |
-
}
|
34 |
-
|
35 |
-
function toArray(obj) {
|
36 |
-
var undef, out, i;
|
37 |
-
|
38 |
-
if (obj && !obj.splice) {
|
39 |
-
out = [];
|
40 |
-
|
41 |
-
for (i = 0; true; i++) {
|
42 |
-
if (obj[i])
|
43 |
-
out[i] = obj[i];
|
44 |
-
else
|
45 |
-
break;
|
46 |
-
}
|
47 |
-
|
48 |
-
return out;
|
49 |
-
}
|
50 |
-
|
51 |
-
return obj;
|
52 |
-
};
|
53 |
-
|
54 |
-
tinymce.create('tinymce.plugins.MediaPlugin', {
|
55 |
-
init : function(ed, url) {
|
56 |
-
var self = this, lookup = {}, i, y, item, name;
|
57 |
-
|
58 |
-
function isMediaImg(node) {
|
59 |
-
return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');
|
60 |
-
};
|
61 |
-
|
62 |
-
self.editor = ed;
|
63 |
-
self.url = url;
|
64 |
-
|
65 |
-
// Parse media types into a lookup table
|
66 |
-
scriptRegExp = '';
|
67 |
-
for (i = 0; i < mediaTypes.length; i++) {
|
68 |
-
name = mediaTypes[i][0];
|
69 |
-
|
70 |
-
item = {
|
71 |
-
name : name,
|
72 |
-
clsids : tinymce.explode(mediaTypes[i][1] || ''),
|
73 |
-
mimes : tinymce.explode(mediaTypes[i][2] || ''),
|
74 |
-
codebase : mediaTypes[i][3]
|
75 |
-
};
|
76 |
-
|
77 |
-
for (y = 0; y < item.clsids.length; y++)
|
78 |
-
lookup['clsid:' + item.clsids[y]] = item;
|
79 |
-
|
80 |
-
for (y = 0; y < item.mimes.length; y++)
|
81 |
-
lookup[item.mimes[y]] = item;
|
82 |
-
|
83 |
-
lookup['mceItem' + name] = item;
|
84 |
-
lookup[name.toLowerCase()] = item;
|
85 |
-
|
86 |
-
scriptRegExp += (scriptRegExp ? '|' : '') + name;
|
87 |
-
}
|
88 |
-
|
89 |
-
// Handle the media_types setting
|
90 |
-
tinymce.each(ed.getParam("media_types",
|
91 |
-
"video=mp4,m4v,ogv,webm;" +
|
92 |
-
"silverlight=xap;" +
|
93 |
-
"flash=swf,flv;" +
|
94 |
-
"shockwave=dcr;" +
|
95 |
-
"quicktime=mov,qt,mpg,mpeg;" +
|
96 |
-
"shockwave=dcr;" +
|
97 |
-
"windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" +
|
98 |
-
"realmedia=rm,ra,ram;" +
|
99 |
-
"java=jar;" +
|
100 |
-
"audio=mp3,ogg"
|
101 |
-
).split(';'), function(item) {
|
102 |
-
var i, extensions, type;
|
103 |
-
|
104 |
-
item = item.split(/=/);
|
105 |
-
extensions = tinymce.explode(item[1].toLowerCase());
|
106 |
-
for (i = 0; i < extensions.length; i++) {
|
107 |
-
type = lookup[item[0].toLowerCase()];
|
108 |
-
|
109 |
-
if (type)
|
110 |
-
lookup[extensions[i]] = type;
|
111 |
-
}
|
112 |
-
});
|
113 |
-
|
114 |
-
scriptRegExp = new RegExp('write(' + scriptRegExp + ')\\(([^)]+)\\)');
|
115 |
-
self.lookup = lookup;
|
116 |
-
|
117 |
-
ed.onPreInit.add(function() {
|
118 |
-
// Allow video elements
|
119 |
-
ed.schema.addValidElements('object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]');
|
120 |
-
|
121 |
-
// Convert video elements to image placeholder
|
122 |
-
ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) {
|
123 |
-
var i = nodes.length;
|
124 |
-
|
125 |
-
while (i--)
|
126 |
-
self.objectToImg(nodes[i]);
|
127 |
-
});
|
128 |
-
|
129 |
-
// Convert image placeholders to video elements
|
130 |
-
ed.serializer.addNodeFilter('img', function(nodes, name, args) {
|
131 |
-
var i = nodes.length, node;
|
132 |
-
|
133 |
-
while (i--) {
|
134 |
-
node = nodes[i];
|
135 |
-
if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1)
|
136 |
-
self.imgToObject(node, args);
|
137 |
-
}
|
138 |
-
});
|
139 |
-
});
|
140 |
-
|
141 |
-
ed.onInit.add(function() {
|
142 |
-
// Display "media" instead of "img" in element path
|
143 |
-
if (ed.theme && ed.theme.onResolveName) {
|
144 |
-
ed.theme.onResolveName.add(function(theme, path_object) {
|
145 |
-
if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia'))
|
146 |
-
path_object.name = 'media';
|
147 |
-
});
|
148 |
-
}
|
149 |
-
|
150 |
-
// Add contect menu if it's loaded
|
151 |
-
if (ed && ed.plugins.contextmenu) {
|
152 |
-
ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) {
|
153 |
-
if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1)
|
154 |
-
menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
|
155 |
-
});
|
156 |
-
}
|
157 |
-
});
|
158 |
-
|
159 |
-
// Register commands
|
160 |
-
ed.addCommand('mceMedia', function() {
|
161 |
-
var data, img;
|
162 |
-
|
163 |
-
img = ed.selection.getNode();
|
164 |
-
if (isMediaImg(img)) {
|
165 |
-
data = ed.dom.getAttrib(img, 'data-mce-json');
|
166 |
-
if (data) {
|
167 |
-
data = JSON.parse(data);
|
168 |
-
|
169 |
-
// Add some extra properties to the data object
|
170 |
-
tinymce.each(rootAttributes, function(name) {
|
171 |
-
var value = ed.dom.getAttrib(img, name);
|
172 |
-
|
173 |
-
if (value)
|
174 |
-
data[name] = value;
|
175 |
-
});
|
176 |
-
|
177 |
-
data.type = self.getType(img.className).name.toLowerCase();
|
178 |
-
}
|
179 |
-
}
|
180 |
-
|
181 |
-
if (!data) {
|
182 |
-
data = {
|
183 |
-
type : 'flash',
|
184 |
-
video: {sources:[]},
|
185 |
-
params: {}
|
186 |
-
};
|
187 |
-
}
|
188 |
-
|
189 |
-
ed.windowManager.open({
|
190 |
-
file : url + '/media.htm',
|
191 |
-
width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
|
192 |
-
height : 500 + parseInt(ed.getLang('media.delta_height', 0)),
|
193 |
-
inline : 1
|
194 |
-
}, {
|
195 |
-
plugin_url : url,
|
196 |
-
data : data
|
197 |
-
});
|
198 |
-
});
|
199 |
-
|
200 |
-
// Register buttons
|
201 |
-
ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});
|
202 |
-
|
203 |
-
// Update media selection status
|
204 |
-
ed.onNodeChange.add(function(ed, cm, node) {
|
205 |
-
cm.setActive('media', isMediaImg(node));
|
206 |
-
});
|
207 |
-
},
|
208 |
-
|
209 |
-
convertUrl : function(url, force_absolute) {
|
210 |
-
var self = this, editor = self.editor, settings = editor.settings,
|
211 |
-
urlConverter = settings.url_converter,
|
212 |
-
urlConverterScope = settings.url_converter_scope || self;
|
213 |
-
|
214 |
-
if (!url)
|
215 |
-
return url;
|
216 |
-
|
217 |
-
if (force_absolute)
|
218 |
-
return editor.documentBaseURI.toAbsolute(url);
|
219 |
-
|
220 |
-
return urlConverter.call(urlConverterScope, url, 'src', 'object');
|
221 |
-
},
|
222 |
-
|
223 |
-
getInfo : function() {
|
224 |
-
return {
|
225 |
-
longname : 'Media',
|
226 |
-
author : 'Moxiecode Systems AB',
|
227 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
228 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',
|
229 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
230 |
-
};
|
231 |
-
},
|
232 |
-
|
233 |
-
/**
|
234 |
-
* Converts the JSON data object to an img node.
|
235 |
-
*/
|
236 |
-
dataToImg : function(data, force_absolute) {
|
237 |
-
var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i;
|
238 |
-
|
239 |
-
data.params.src = self.convertUrl(data.params.src, force_absolute);
|
240 |
-
|
241 |
-
attrs = data.video.attrs;
|
242 |
-
if (attrs)
|
243 |
-
attrs.src = self.convertUrl(attrs.src, force_absolute);
|
244 |
-
|
245 |
-
if (attrs)
|
246 |
-
attrs.poster = self.convertUrl(attrs.poster, force_absolute);
|
247 |
-
|
248 |
-
sources = toArray(data.video.sources);
|
249 |
-
if (sources) {
|
250 |
-
for (i = 0; i < sources.length; i++)
|
251 |
-
sources[i].src = self.convertUrl(sources[i].src, force_absolute);
|
252 |
-
}
|
253 |
-
|
254 |
-
img = self.editor.dom.create('img', {
|
255 |
-
id : data.id,
|
256 |
-
style : data.style,
|
257 |
-
align : data.align,
|
258 |
-
hspace : data.hspace,
|
259 |
-
vspace : data.vspace,
|
260 |
-
src : self.editor.theme.url + '/img/trans.gif',
|
261 |
-
'class' : 'mceItemMedia mceItem' + self.getType(data.type).name,
|
262 |
-
'data-mce-json' : JSON.serialize(data, "'")
|
263 |
-
});
|
264 |
-
|
265 |
-
img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320"));
|
266 |
-
img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240"));
|
267 |
-
|
268 |
-
return img;
|
269 |
-
},
|
270 |
-
|
271 |
-
/**
|
272 |
-
* Converts the JSON data object to a HTML string.
|
273 |
-
*/
|
274 |
-
dataToHtml : function(data, force_absolute) {
|
275 |
-
return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute});
|
276 |
-
},
|
277 |
-
|
278 |
-
/**
|
279 |
-
* Converts the JSON data object to a HTML string.
|
280 |
-
*/
|
281 |
-
htmlToData : function(html) {
|
282 |
-
var fragment, img, data;
|
283 |
-
|
284 |
-
data = {
|
285 |
-
type : 'flash',
|
286 |
-
video: {sources:[]},
|
287 |
-
params: {}
|
288 |
-
};
|
289 |
-
|
290 |
-
fragment = this.editor.parser.parse(html);
|
291 |
-
img = fragment.getAll('img')[0];
|
292 |
-
|
293 |
-
if (img) {
|
294 |
-
data = JSON.parse(img.attr('data-mce-json'));
|
295 |
-
data.type = this.getType(img.attr('class')).name.toLowerCase();
|
296 |
-
|
297 |
-
// Add some extra properties to the data object
|
298 |
-
tinymce.each(rootAttributes, function(name) {
|
299 |
-
var value = img.attr(name);
|
300 |
-
|
301 |
-
if (value)
|
302 |
-
data[name] = value;
|
303 |
-
});
|
304 |
-
}
|
305 |
-
|
306 |
-
return data;
|
307 |
-
},
|
308 |
-
|
309 |
-
/**
|
310 |
-
* Get type item by extension, class, clsid or mime type.
|
311 |
-
*
|
312 |
-
* @method getType
|
313 |
-
* @param {String} value Value to get type item by.
|
314 |
-
* @return {Object} Type item object or undefined.
|
315 |
-
*/
|
316 |
-
getType : function(value) {
|
317 |
-
var i, values, typeItem;
|
318 |
-
|
319 |
-
// Find type by checking the classes
|
320 |
-
values = tinymce.explode(value, ' ');
|
321 |
-
for (i = 0; i < values.length; i++) {
|
322 |
-
typeItem = this.lookup[values[i]];
|
323 |
-
|
324 |
-
if (typeItem)
|
325 |
-
return typeItem;
|
326 |
-
}
|
327 |
-
},
|
328 |
-
|
329 |
-
/**
|
330 |
-
* Converts a tinymce.html.Node image element to video/object/embed.
|
331 |
-
*/
|
332 |
-
imgToObject : function(node, args) {
|
333 |
-
var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,
|
334 |
-
source, sources, params, param, typeItem, i, item, mp4Source, replacement,
|
335 |
-
posterSrc, style, audio;
|
336 |
-
|
337 |
-
// Adds the flash player
|
338 |
-
function addPlayer(video_src, poster_src) {
|
339 |
-
var baseUri, flashVars, flashVarsOutput, params, flashPlayer;
|
340 |
-
|
341 |
-
flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf'));
|
342 |
-
if (flashPlayer) {
|
343 |
-
baseUri = editor.documentBaseURI;
|
344 |
-
data.params.src = flashPlayer;
|
345 |
-
|
346 |
-
// Convert the movie url to absolute urls
|
347 |
-
if (editor.getParam('flash_video_player_absvideourl', true)) {
|
348 |
-
video_src = baseUri.toAbsolute(video_src || '', true);
|
349 |
-
poster_src = baseUri.toAbsolute(poster_src || '', true);
|
350 |
-
}
|
351 |
-
|
352 |
-
// Generate flash vars
|
353 |
-
flashVarsOutput = '';
|
354 |
-
flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'});
|
355 |
-
tinymce.each(flashVars, function(value, name) {
|
356 |
-
// Replace $url and $poster variables in flashvars value
|
357 |
-
value = value.replace(/\$url/, video_src || '');
|
358 |
-
value = value.replace(/\$poster/, poster_src || '');
|
359 |
-
|
360 |
-
if (value.length > 0)
|
361 |
-
flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);
|
362 |
-
});
|
363 |
-
|
364 |
-
if (flashVarsOutput.length)
|
365 |
-
data.params.flashvars = flashVarsOutput;
|
366 |
-
|
367 |
-
params = editor.getParam('flash_video_player_params', {
|
368 |
-
allowfullscreen: true,
|
369 |
-
allowscriptaccess: true
|
370 |
-
});
|
371 |
-
|
372 |
-
tinymce.each(params, function(value, name) {
|
373 |
-
data.params[name] = "" + value;
|
374 |
-
});
|
375 |
-
}
|
376 |
-
};
|
377 |
-
|
378 |
-
data = node.attr('data-mce-json');
|
379 |
-
if (!data)
|
380 |
-
return;
|
381 |
-
|
382 |
-
data = JSON.parse(data);
|
383 |
-
typeItem = this.getType(node.attr('class'));
|
384 |
-
|
385 |
-
style = node.attr('data-mce-style');
|
386 |
-
if (!style) {
|
387 |
-
style = node.attr('style');
|
388 |
-
|
389 |
-
if (style)
|
390 |
-
style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
|
391 |
-
}
|
392 |
-
|
393 |
-
// Use node width/height to override the data width/height when the placeholder is resized
|
394 |
-
data.width = node.attr('width') || data.width;
|
395 |
-
data.height = node.attr('height') || data.height;
|
396 |
-
|
397 |
-
// Handle iframe
|
398 |
-
if (typeItem.name === 'Iframe') {
|
399 |
-
replacement = new Node('iframe', 1);
|
400 |
-
|
401 |
-
tinymce.each(rootAttributes, function(name) {
|
402 |
-
var value = node.attr(name);
|
403 |
-
|
404 |
-
if (name == 'class' && value)
|
405 |
-
value = value.replace(/mceItem.+ ?/g, '');
|
406 |
-
|
407 |
-
if (value && value.length > 0)
|
408 |
-
replacement.attr(name, value);
|
409 |
-
});
|
410 |
-
|
411 |
-
for (name in data.params)
|
412 |
-
replacement.attr(name, data.params[name]);
|
413 |
-
|
414 |
-
replacement.attr({
|
415 |
-
style: style,
|
416 |
-
src: data.params.src
|
417 |
-
});
|
418 |
-
|
419 |
-
node.replace(replacement);
|
420 |
-
|
421 |
-
return;
|
422 |
-
}
|
423 |
-
|
424 |
-
// Handle scripts
|
425 |
-
if (this.editor.settings.media_use_script) {
|
426 |
-
replacement = new Node('script', 1).attr('type', 'text/javascript');
|
427 |
-
|
428 |
-
value = new Node('#text', 3);
|
429 |
-
value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, {
|
430 |
-
width: node.attr('width'),
|
431 |
-
height: node.attr('height')
|
432 |
-
})) + ');';
|
433 |
-
|
434 |
-
replacement.append(value);
|
435 |
-
node.replace(replacement);
|
436 |
-
|
437 |
-
return;
|
438 |
-
}
|
439 |
-
|
440 |
-
// Add HTML5 video element
|
441 |
-
if (typeItem.name === 'Video' && data.video.sources[0]) {
|
442 |
-
// Create new object element
|
443 |
-
video = new Node('video', 1).attr(tinymce.extend({
|
444 |
-
id : node.attr('id'),
|
445 |
-
width: normalizeSize(node.attr('width')),
|
446 |
-
height: normalizeSize(node.attr('height')),
|
447 |
-
style : style
|
448 |
-
}, data.video.attrs));
|
449 |
-
|
450 |
-
// Get poster source and use that for flash fallback
|
451 |
-
if (data.video.attrs)
|
452 |
-
posterSrc = data.video.attrs.poster;
|
453 |
-
|
454 |
-
sources = data.video.sources = toArray(data.video.sources);
|
455 |
-
for (i = 0; i < sources.length; i++) {
|
456 |
-
if (/\.mp4$/.test(sources[i].src))
|
457 |
-
mp4Source = sources[i].src;
|
458 |
-
}
|
459 |
-
|
460 |
-
if (!sources[0].type) {
|
461 |
-
video.attr('src', sources[0].src);
|
462 |
-
sources.splice(0, 1);
|
463 |
-
}
|
464 |
-
|
465 |
-
for (i = 0; i < sources.length; i++) {
|
466 |
-
source = new Node('source', 1).attr(sources[i]);
|
467 |
-
source.shortEnded = true;
|
468 |
-
video.append(source);
|
469 |
-
}
|
470 |
-
|
471 |
-
// Create flash fallback for video if we have a mp4 source
|
472 |
-
if (mp4Source) {
|
473 |
-
addPlayer(mp4Source, posterSrc);
|
474 |
-
typeItem = self.getType('flash');
|
475 |
-
} else
|
476 |
-
data.params.src = '';
|
477 |
-
}
|
478 |
-
|
479 |
-
// Add HTML5 audio element
|
480 |
-
if (typeItem.name === 'Audio' && data.video.sources[0]) {
|
481 |
-
// Create new object element
|
482 |
-
audio = new Node('audio', 1).attr(tinymce.extend({
|
483 |
-
id : node.attr('id'),
|
484 |
-
width: normalizeSize(node.attr('width')),
|
485 |
-
height: normalizeSize(node.attr('height')),
|
486 |
-
style : style
|
487 |
-
}, data.video.attrs));
|
488 |
-
|
489 |
-
// Get poster source and use that for flash fallback
|
490 |
-
if (data.video.attrs)
|
491 |
-
posterSrc = data.video.attrs.poster;
|
492 |
-
|
493 |
-
sources = data.video.sources = toArray(data.video.sources);
|
494 |
-
if (!sources[0].type) {
|
495 |
-
audio.attr('src', sources[0].src);
|
496 |
-
sources.splice(0, 1);
|
497 |
-
}
|
498 |
-
|
499 |
-
for (i = 0; i < sources.length; i++) {
|
500 |
-
source = new Node('source', 1).attr(sources[i]);
|
501 |
-
source.shortEnded = true;
|
502 |
-
audio.append(source);
|
503 |
-
}
|
504 |
-
|
505 |
-
data.params.src = '';
|
506 |
-
}
|
507 |
-
|
508 |
-
if (typeItem.name === 'EmbeddedAudio') {
|
509 |
-
embed = new Node('embed', 1);
|
510 |
-
embed.shortEnded = true;
|
511 |
-
embed.attr({
|
512 |
-
id: node.attr('id'),
|
513 |
-
width: normalizeSize(node.attr('width')),
|
514 |
-
height: normalizeSize(node.attr('height')),
|
515 |
-
style : style,
|
516 |
-
type: node.attr('type')
|
517 |
-
});
|
518 |
-
|
519 |
-
for (name in data.params)
|
520 |
-
embed.attr(name, data.params[name]);
|
521 |
-
|
522 |
-
tinymce.each(rootAttributes, function(name) {
|
523 |
-
if (data[name] && name != 'type')
|
524 |
-
embed.attr(name, data[name]);
|
525 |
-
});
|
526 |
-
|
527 |
-
data.params.src = '';
|
528 |
-
}
|
529 |
-
|
530 |
-
// Do we have a params src then we can generate object
|
531 |
-
if (data.params.src) {
|
532 |
-
// Is flv movie add player for it
|
533 |
-
if (/\.flv$/i.test(data.params.src))
|
534 |
-
addPlayer(data.params.src, '');
|
535 |
-
|
536 |
-
if (args && args.force_absolute)
|
537 |
-
data.params.src = editor.documentBaseURI.toAbsolute(data.params.src);
|
538 |
-
|
539 |
-
// Create new object element
|
540 |
-
object = new Node('object', 1).attr({
|
541 |
-
id : node.attr('id'),
|
542 |
-
width: normalizeSize(node.attr('width')),
|
543 |
-
height: normalizeSize(node.attr('height')),
|
544 |
-
style : style
|
545 |
-
});
|
546 |
-
|
547 |
-
tinymce.each(rootAttributes, function(name) {
|
548 |
-
var value = data[name];
|
549 |
-
|
550 |
-
if (name == 'class' && value)
|
551 |
-
value = value.replace(/mceItem.+ ?/g, '');
|
552 |
-
|
553 |
-
if (value && name != 'type')
|
554 |
-
object.attr(name, value);
|
555 |
-
});
|
556 |
-
|
557 |
-
// Add params
|
558 |
-
for (name in data.params) {
|
559 |
-
param = new Node('param', 1);
|
560 |
-
param.shortEnded = true;
|
561 |
-
value = data.params[name];
|
562 |
-
|
563 |
-
// Windows media needs to use url instead of src for the media URL
|
564 |
-
if (name === 'src' && typeItem.name === 'WindowsMedia')
|
565 |
-
name = 'url';
|
566 |
-
|
567 |
-
param.attr({name: name, value: value});
|
568 |
-
object.append(param);
|
569 |
-
}
|
570 |
-
|
571 |
-
// Setup add type and classid if strict is disabled
|
572 |
-
if (this.editor.getParam('media_strict', true)) {
|
573 |
-
object.attr({
|
574 |
-
data: data.params.src,
|
575 |
-
type: typeItem.mimes[0]
|
576 |
-
});
|
577 |
-
} else {
|
578 |
-
object.attr({
|
579 |
-
classid: "clsid:" + typeItem.clsids[0],
|
580 |
-
codebase: typeItem.codebase
|
581 |
-
});
|
582 |
-
|
583 |
-
embed = new Node('embed', 1);
|
584 |
-
embed.shortEnded = true;
|
585 |
-
embed.attr({
|
586 |
-
id: node.attr('id'),
|
587 |
-
width: normalizeSize(node.attr('width')),
|
588 |
-
height: normalizeSize(node.attr('height')),
|
589 |
-
style : style,
|
590 |
-
type: typeItem.mimes[0]
|
591 |
-
});
|
592 |
-
|
593 |
-
for (name in data.params)
|
594 |
-
embed.attr(name, data.params[name]);
|
595 |
-
|
596 |
-
tinymce.each(rootAttributes, function(name) {
|
597 |
-
if (data[name] && name != 'type')
|
598 |
-
embed.attr(name, data[name]);
|
599 |
-
});
|
600 |
-
|
601 |
-
object.append(embed);
|
602 |
-
}
|
603 |
-
|
604 |
-
// Insert raw HTML
|
605 |
-
if (data.object_html) {
|
606 |
-
value = new Node('#text', 3);
|
607 |
-
value.raw = true;
|
608 |
-
value.value = data.object_html;
|
609 |
-
object.append(value);
|
610 |
-
}
|
611 |
-
|
612 |
-
// Append object to video element if it exists
|
613 |
-
if (video)
|
614 |
-
video.append(object);
|
615 |
-
}
|
616 |
-
|
617 |
-
if (video) {
|
618 |
-
// Insert raw HTML
|
619 |
-
if (data.video_html) {
|
620 |
-
value = new Node('#text', 3);
|
621 |
-
value.raw = true;
|
622 |
-
value.value = data.video_html;
|
623 |
-
video.append(value);
|
624 |
-
}
|
625 |
-
}
|
626 |
-
|
627 |
-
if (audio) {
|
628 |
-
// Insert raw HTML
|
629 |
-
if (data.video_html) {
|
630 |
-
value = new Node('#text', 3);
|
631 |
-
value.raw = true;
|
632 |
-
value.value = data.video_html;
|
633 |
-
audio.append(value);
|
634 |
-
}
|
635 |
-
}
|
636 |
-
|
637 |
-
var n = video || audio || object || embed;
|
638 |
-
if (n)
|
639 |
-
node.replace(n);
|
640 |
-
else
|
641 |
-
node.remove();
|
642 |
-
},
|
643 |
-
|
644 |
-
/**
|
645 |
-
* Converts a tinymce.html.Node video/object/embed to an img element.
|
646 |
-
*
|
647 |
-
* The video/object/embed will be converted into an image placeholder with a JSON data attribute like this:
|
648 |
-
* <img class="mceItemMedia mceItemFlash" width="100" height="100" data-mce-json="{..}" />
|
649 |
-
*
|
650 |
-
* The JSON structure will be like this:
|
651 |
-
* {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}}
|
652 |
-
*/
|
653 |
-
objectToImg : function(node) {
|
654 |
-
var object, embed, video, iframe, img, name, id, width, height, style, i, html,
|
655 |
-
param, params, source, sources, data, type, lookup = this.lookup,
|
656 |
-
matches, attrs, urlConverter = this.editor.settings.url_converter,
|
657 |
-
urlConverterScope = this.editor.settings.url_converter_scope,
|
658 |
-
hspace, vspace, align, bgcolor;
|
659 |
-
|
660 |
-
function getInnerHTML(node) {
|
661 |
-
return new tinymce.html.Serializer({
|
662 |
-
inner: true,
|
663 |
-
validate: false
|
664 |
-
}).serialize(node);
|
665 |
-
};
|
666 |
-
|
667 |
-
function lookupAttribute(o, attr) {
|
668 |
-
return lookup[(o.attr(attr) || '').toLowerCase()];
|
669 |
-
}
|
670 |
-
|
671 |
-
function lookupExtension(src) {
|
672 |
-
var ext = src.replace(/^.*\.([^.]+)$/, '$1');
|
673 |
-
return lookup[ext.toLowerCase() || ''];
|
674 |
-
}
|
675 |
-
|
676 |
-
// If node isn't in document
|
677 |
-
if (!node.parent)
|
678 |
-
return;
|
679 |
-
|
680 |
-
// Handle media scripts
|
681 |
-
if (node.name === 'script') {
|
682 |
-
if (node.firstChild)
|
683 |
-
matches = scriptRegExp.exec(node.firstChild.value);
|
684 |
-
|
685 |
-
if (!matches)
|
686 |
-
return;
|
687 |
-
|
688 |
-
type = matches[1];
|
689 |
-
data = {video : {}, params : JSON.parse(matches[2])};
|
690 |
-
width = data.params.width;
|
691 |
-
height = data.params.height;
|
692 |
-
}
|
693 |
-
|
694 |
-
// Setup data objects
|
695 |
-
data = data || {
|
696 |
-
video : {},
|
697 |
-
params : {}
|
698 |
-
};
|
699 |
-
|
700 |
-
// Setup new image object
|
701 |
-
img = new Node('img', 1);
|
702 |
-
img.attr({
|
703 |
-
src : this.editor.theme.url + '/img/trans.gif'
|
704 |
-
});
|
705 |
-
|
706 |
-
// Video element
|
707 |
-
name = node.name;
|
708 |
-
if (name === 'video' || name == 'audio') {
|
709 |
-
video = node;
|
710 |
-
object = node.getAll('object')[0];
|
711 |
-
embed = node.getAll('embed')[0];
|
712 |
-
width = video.attr('width');
|
713 |
-
height = video.attr('height');
|
714 |
-
id = video.attr('id');
|
715 |
-
data.video = {attrs : {}, sources : []};
|
716 |
-
|
717 |
-
// Get all video attributes
|
718 |
-
attrs = data.video.attrs;
|
719 |
-
for (name in video.attributes.map)
|
720 |
-
attrs[name] = video.attributes.map[name];
|
721 |
-
|
722 |
-
source = node.attr('src');
|
723 |
-
if (source)
|
724 |
-
data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)});
|
725 |
-
|
726 |
-
// Get all sources
|
727 |
-
sources = video.getAll("source");
|
728 |
-
for (i = 0; i < sources.length; i++) {
|
729 |
-
source = sources[i].remove();
|
730 |
-
|
731 |
-
data.video.sources.push({
|
732 |
-
src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'),
|
733 |
-
type: source.attr('type'),
|
734 |
-
media: source.attr('media')
|
735 |
-
});
|
736 |
-
}
|
737 |
-
|
738 |
-
// Convert the poster URL
|
739 |
-
if (attrs.poster)
|
740 |
-
attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name);
|
741 |
-
}
|
742 |
-
|
743 |
-
// Object element
|
744 |
-
if (node.name === 'object') {
|
745 |
-
object = node;
|
746 |
-
embed = node.getAll('embed')[0];
|
747 |
-
}
|
748 |
-
|
749 |
-
// Embed element
|
750 |
-
if (node.name === 'embed')
|
751 |
-
embed = node;
|
752 |
-
|
753 |
-
// Iframe element
|
754 |
-
if (node.name === 'iframe') {
|
755 |
-
iframe = node;
|
756 |
-
type = 'Iframe';
|
757 |
-
}
|
758 |
-
|
759 |
-
if (object) {
|
760 |
-
// Get width/height
|
761 |
-
width = width || object.attr('width');
|
762 |
-
height = height || object.attr('height');
|
763 |
-
style = style || object.attr('style');
|
764 |
-
id = id || object.attr('id');
|
765 |
-
hspace = hspace || object.attr('hspace');
|
766 |
-
vspace = vspace || object.attr('vspace');
|
767 |
-
align = align || object.attr('align');
|
768 |
-
bgcolor = bgcolor || object.attr('bgcolor');
|
769 |
-
data.name = object.attr('name');
|
770 |
-
|
771 |
-
// Get all object params
|
772 |
-
params = object.getAll("param");
|
773 |
-
for (i = 0; i < params.length; i++) {
|
774 |
-
param = params[i];
|
775 |
-
name = param.remove().attr('name');
|
776 |
-
|
777 |
-
if (!excludedAttrs[name])
|
778 |
-
data.params[name] = param.attr('value');
|
779 |
-
}
|
780 |
-
|
781 |
-
data.params.src = data.params.src || object.attr('data');
|
782 |
-
}
|
783 |
-
|
784 |
-
if (embed) {
|
785 |
-
// Get width/height
|
786 |
-
width = width || embed.attr('width');
|
787 |
-
height = height || embed.attr('height');
|
788 |
-
style = style || embed.attr('style');
|
789 |
-
id = id || embed.attr('id');
|
790 |
-
hspace = hspace || embed.attr('hspace');
|
791 |
-
vspace = vspace || embed.attr('vspace');
|
792 |
-
align = align || embed.attr('align');
|
793 |
-
bgcolor = bgcolor || embed.attr('bgcolor');
|
794 |
-
|
795 |
-
// Get all embed attributes
|
796 |
-
for (name in embed.attributes.map) {
|
797 |
-
if (!excludedAttrs[name] && !data.params[name])
|
798 |
-
data.params[name] = embed.attributes.map[name];
|
799 |
-
}
|
800 |
-
}
|
801 |
-
|
802 |
-
if (iframe) {
|
803 |
-
// Get width/height
|
804 |
-
width = normalizeSize(iframe.attr('width'));
|
805 |
-
height = normalizeSize(iframe.attr('height'));
|
806 |
-
style = style || iframe.attr('style');
|
807 |
-
id = iframe.attr('id');
|
808 |
-
hspace = iframe.attr('hspace');
|
809 |
-
vspace = iframe.attr('vspace');
|
810 |
-
align = iframe.attr('align');
|
811 |
-
bgcolor = iframe.attr('bgcolor');
|
812 |
-
|
813 |
-
tinymce.each(rootAttributes, function(name) {
|
814 |
-
img.attr(name, iframe.attr(name));
|
815 |
-
});
|
816 |
-
|
817 |
-
// Get all iframe attributes
|
818 |
-
for (name in iframe.attributes.map) {
|
819 |
-
if (!excludedAttrs[name] && !data.params[name])
|
820 |
-
data.params[name] = iframe.attributes.map[name];
|
821 |
-
}
|
822 |
-
}
|
823 |
-
|
824 |
-
// Use src not movie
|
825 |
-
if (data.params.movie) {
|
826 |
-
data.params.src = data.params.src || data.params.movie;
|
827 |
-
delete data.params.movie;
|
828 |
-
}
|
829 |
-
|
830 |
-
// Convert the URL to relative/absolute depending on configuration
|
831 |
-
if (data.params.src)
|
832 |
-
data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');
|
833 |
-
|
834 |
-
if (video) {
|
835 |
-
if (node.name === 'video')
|
836 |
-
type = lookup.video.name;
|
837 |
-
else if (node.name === 'audio')
|
838 |
-
type = lookup.audio.name;
|
839 |
-
}
|
840 |
-
|
841 |
-
if (object && !type)
|
842 |
-
type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name;
|
843 |
-
|
844 |
-
if (embed && !type)
|
845 |
-
type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name;
|
846 |
-
|
847 |
-
// for embedded audio we preserve the original specified type
|
848 |
-
if (embed && type == 'EmbeddedAudio') {
|
849 |
-
data.params.type = embed.attr('type');
|
850 |
-
}
|
851 |
-
|
852 |
-
// Replace the video/object/embed element with a placeholder image containing the data
|
853 |
-
node.replace(img);
|
854 |
-
|
855 |
-
// Remove embed
|
856 |
-
if (embed)
|
857 |
-
embed.remove();
|
858 |
-
|
859 |
-
// Serialize the inner HTML of the object element
|
860 |
-
if (object) {
|
861 |
-
html = getInnerHTML(object.remove());
|
862 |
-
|
863 |
-
if (html)
|
864 |
-
data.object_html = html;
|
865 |
-
}
|
866 |
-
|
867 |
-
// Serialize the inner HTML of the video element
|
868 |
-
if (video) {
|
869 |
-
html = getInnerHTML(video.remove());
|
870 |
-
|
871 |
-
if (html)
|
872 |
-
data.video_html = html;
|
873 |
-
}
|
874 |
-
|
875 |
-
data.hspace = hspace;
|
876 |
-
data.vspace = vspace;
|
877 |
-
data.align = align;
|
878 |
-
data.bgcolor = bgcolor;
|
879 |
-
|
880 |
-
// Set width/height of placeholder
|
881 |
-
img.attr({
|
882 |
-
id : id,
|
883 |
-
'class' : 'mceItemMedia mceItem' + (type || 'Flash'),
|
884 |
-
style : style,
|
885 |
-
width : width || (node.name == 'audio' ? "300" : "320"),
|
886 |
-
height : height || (node.name == 'audio' ? "32" : "240"),
|
887 |
-
hspace : hspace,
|
888 |
-
vspace : vspace,
|
889 |
-
align : align,
|
890 |
-
bgcolor : bgcolor,
|
891 |
-
"data-mce-json" : JSON.serialize(data, "'")
|
892 |
-
});
|
893 |
-
}
|
894 |
-
});
|
895 |
-
|
896 |
-
// Register plugin
|
897 |
-
tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);
|
898 |
-
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var rootAttributes = tinymce.explode('id,name,width,height,style,align,class,hspace,vspace,bgcolor,type'), excludedAttrs = tinymce.makeMap(rootAttributes.join(',')), Node = tinymce.html.Node,
|
13 |
+
mediaTypes, scriptRegExp, JSON = tinymce.util.JSON, mimeTypes;
|
14 |
+
|
15 |
+
// Media types supported by this plugin
|
16 |
+
mediaTypes = [
|
17 |
+
// Type, clsid:s, mime types, codebase
|
18 |
+
["Flash", "d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],
|
19 |
+
["ShockWave", "166b1bca-3f9c-11cf-8075-444553540000", "application/x-director", "http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],
|
20 |
+
["WindowsMedia", "6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a", "application/x-mplayer2", "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],
|
21 |
+
["QuickTime", "02bf25d5-8c17-4b23-bc80-d3488abddc6b", "video/quicktime", "http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],
|
22 |
+
["RealMedia", "cfcdaa03-8be4-11cf-b84b-0020afbbccfa", "audio/x-pn-realaudio-plugin", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],
|
23 |
+
["Java", "8ad9c840-044e-11d1-b3e9-00805f499d93", "application/x-java-applet", "http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],
|
24 |
+
["Silverlight", "dfeaf541-f3e1-4c24-acac-99c30715084a", "application/x-silverlight-2"],
|
25 |
+
["Iframe"],
|
26 |
+
["Video"],
|
27 |
+
["EmbeddedAudio"],
|
28 |
+
["Audio"]
|
29 |
+
];
|
30 |
+
|
31 |
+
function normalizeSize(size) {
|
32 |
+
return typeof(size) == "string" ? size.replace(/[^0-9%]/g, '') : size;
|
33 |
+
}
|
34 |
+
|
35 |
+
function toArray(obj) {
|
36 |
+
var undef, out, i;
|
37 |
+
|
38 |
+
if (obj && !obj.splice) {
|
39 |
+
out = [];
|
40 |
+
|
41 |
+
for (i = 0; true; i++) {
|
42 |
+
if (obj[i])
|
43 |
+
out[i] = obj[i];
|
44 |
+
else
|
45 |
+
break;
|
46 |
+
}
|
47 |
+
|
48 |
+
return out;
|
49 |
+
}
|
50 |
+
|
51 |
+
return obj;
|
52 |
+
};
|
53 |
+
|
54 |
+
tinymce.create('tinymce.plugins.MediaPlugin', {
|
55 |
+
init : function(ed, url) {
|
56 |
+
var self = this, lookup = {}, i, y, item, name;
|
57 |
+
|
58 |
+
function isMediaImg(node) {
|
59 |
+
return node && node.nodeName === 'IMG' && ed.dom.hasClass(node, 'mceItemMedia');
|
60 |
+
};
|
61 |
+
|
62 |
+
self.editor = ed;
|
63 |
+
self.url = url;
|
64 |
+
|
65 |
+
// Parse media types into a lookup table
|
66 |
+
scriptRegExp = '';
|
67 |
+
for (i = 0; i < mediaTypes.length; i++) {
|
68 |
+
name = mediaTypes[i][0];
|
69 |
+
|
70 |
+
item = {
|
71 |
+
name : name,
|
72 |
+
clsids : tinymce.explode(mediaTypes[i][1] || ''),
|
73 |
+
mimes : tinymce.explode(mediaTypes[i][2] || ''),
|
74 |
+
codebase : mediaTypes[i][3]
|
75 |
+
};
|
76 |
+
|
77 |
+
for (y = 0; y < item.clsids.length; y++)
|
78 |
+
lookup['clsid:' + item.clsids[y]] = item;
|
79 |
+
|
80 |
+
for (y = 0; y < item.mimes.length; y++)
|
81 |
+
lookup[item.mimes[y]] = item;
|
82 |
+
|
83 |
+
lookup['mceItem' + name] = item;
|
84 |
+
lookup[name.toLowerCase()] = item;
|
85 |
+
|
86 |
+
scriptRegExp += (scriptRegExp ? '|' : '') + name;
|
87 |
+
}
|
88 |
+
|
89 |
+
// Handle the media_types setting
|
90 |
+
tinymce.each(ed.getParam("media_types",
|
91 |
+
"video=mp4,m4v,ogv,webm;" +
|
92 |
+
"silverlight=xap;" +
|
93 |
+
"flash=swf,flv;" +
|
94 |
+
"shockwave=dcr;" +
|
95 |
+
"quicktime=mov,qt,mpg,mpeg;" +
|
96 |
+
"shockwave=dcr;" +
|
97 |
+
"windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" +
|
98 |
+
"realmedia=rm,ra,ram;" +
|
99 |
+
"java=jar;" +
|
100 |
+
"audio=mp3,ogg"
|
101 |
+
).split(';'), function(item) {
|
102 |
+
var i, extensions, type;
|
103 |
+
|
104 |
+
item = item.split(/=/);
|
105 |
+
extensions = tinymce.explode(item[1].toLowerCase());
|
106 |
+
for (i = 0; i < extensions.length; i++) {
|
107 |
+
type = lookup[item[0].toLowerCase()];
|
108 |
+
|
109 |
+
if (type)
|
110 |
+
lookup[extensions[i]] = type;
|
111 |
+
}
|
112 |
+
});
|
113 |
+
|
114 |
+
scriptRegExp = new RegExp('write(' + scriptRegExp + ')\\(([^)]+)\\)');
|
115 |
+
self.lookup = lookup;
|
116 |
+
|
117 |
+
ed.onPreInit.add(function() {
|
118 |
+
// Allow video elements
|
119 |
+
ed.schema.addValidElements('object[id|style|width|height|classid|codebase|*],param[name|value],embed[id|style|width|height|type|src|*],video[*],audio[*],source[*]');
|
120 |
+
|
121 |
+
// Convert video elements to image placeholder
|
122 |
+
ed.parser.addNodeFilter('object,embed,video,audio,script,iframe', function(nodes) {
|
123 |
+
var i = nodes.length;
|
124 |
+
|
125 |
+
while (i--)
|
126 |
+
self.objectToImg(nodes[i]);
|
127 |
+
});
|
128 |
+
|
129 |
+
// Convert image placeholders to video elements
|
130 |
+
ed.serializer.addNodeFilter('img', function(nodes, name, args) {
|
131 |
+
var i = nodes.length, node;
|
132 |
+
|
133 |
+
while (i--) {
|
134 |
+
node = nodes[i];
|
135 |
+
if ((node.attr('class') || '').indexOf('mceItemMedia') !== -1)
|
136 |
+
self.imgToObject(node, args);
|
137 |
+
}
|
138 |
+
});
|
139 |
+
});
|
140 |
+
|
141 |
+
ed.onInit.add(function() {
|
142 |
+
// Display "media" instead of "img" in element path
|
143 |
+
if (ed.theme && ed.theme.onResolveName) {
|
144 |
+
ed.theme.onResolveName.add(function(theme, path_object) {
|
145 |
+
if (path_object.name === 'img' && ed.dom.hasClass(path_object.node, 'mceItemMedia'))
|
146 |
+
path_object.name = 'media';
|
147 |
+
});
|
148 |
+
}
|
149 |
+
|
150 |
+
// Add contect menu if it's loaded
|
151 |
+
if (ed && ed.plugins.contextmenu) {
|
152 |
+
ed.plugins.contextmenu.onContextMenu.add(function(plugin, menu, element) {
|
153 |
+
if (element.nodeName === 'IMG' && element.className.indexOf('mceItemMedia') !== -1)
|
154 |
+
menu.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
|
155 |
+
});
|
156 |
+
}
|
157 |
+
});
|
158 |
+
|
159 |
+
// Register commands
|
160 |
+
ed.addCommand('mceMedia', function() {
|
161 |
+
var data, img;
|
162 |
+
|
163 |
+
img = ed.selection.getNode();
|
164 |
+
if (isMediaImg(img)) {
|
165 |
+
data = ed.dom.getAttrib(img, 'data-mce-json');
|
166 |
+
if (data) {
|
167 |
+
data = JSON.parse(data);
|
168 |
+
|
169 |
+
// Add some extra properties to the data object
|
170 |
+
tinymce.each(rootAttributes, function(name) {
|
171 |
+
var value = ed.dom.getAttrib(img, name);
|
172 |
+
|
173 |
+
if (value)
|
174 |
+
data[name] = value;
|
175 |
+
});
|
176 |
+
|
177 |
+
data.type = self.getType(img.className).name.toLowerCase();
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
if (!data) {
|
182 |
+
data = {
|
183 |
+
type : 'flash',
|
184 |
+
video: {sources:[]},
|
185 |
+
params: {}
|
186 |
+
};
|
187 |
+
}
|
188 |
+
|
189 |
+
ed.windowManager.open({
|
190 |
+
file : url + '/media.htm',
|
191 |
+
width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
|
192 |
+
height : 500 + parseInt(ed.getLang('media.delta_height', 0)),
|
193 |
+
inline : 1
|
194 |
+
}, {
|
195 |
+
plugin_url : url,
|
196 |
+
data : data
|
197 |
+
});
|
198 |
+
});
|
199 |
+
|
200 |
+
// Register buttons
|
201 |
+
ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});
|
202 |
+
|
203 |
+
// Update media selection status
|
204 |
+
ed.onNodeChange.add(function(ed, cm, node) {
|
205 |
+
cm.setActive('media', isMediaImg(node));
|
206 |
+
});
|
207 |
+
},
|
208 |
+
|
209 |
+
convertUrl : function(url, force_absolute) {
|
210 |
+
var self = this, editor = self.editor, settings = editor.settings,
|
211 |
+
urlConverter = settings.url_converter,
|
212 |
+
urlConverterScope = settings.url_converter_scope || self;
|
213 |
+
|
214 |
+
if (!url)
|
215 |
+
return url;
|
216 |
+
|
217 |
+
if (force_absolute)
|
218 |
+
return editor.documentBaseURI.toAbsolute(url);
|
219 |
+
|
220 |
+
return urlConverter.call(urlConverterScope, url, 'src', 'object');
|
221 |
+
},
|
222 |
+
|
223 |
+
getInfo : function() {
|
224 |
+
return {
|
225 |
+
longname : 'Media',
|
226 |
+
author : 'Moxiecode Systems AB',
|
227 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
228 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',
|
229 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
230 |
+
};
|
231 |
+
},
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Converts the JSON data object to an img node.
|
235 |
+
*/
|
236 |
+
dataToImg : function(data, force_absolute) {
|
237 |
+
var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i;
|
238 |
+
|
239 |
+
data.params.src = self.convertUrl(data.params.src, force_absolute);
|
240 |
+
|
241 |
+
attrs = data.video.attrs;
|
242 |
+
if (attrs)
|
243 |
+
attrs.src = self.convertUrl(attrs.src, force_absolute);
|
244 |
+
|
245 |
+
if (attrs)
|
246 |
+
attrs.poster = self.convertUrl(attrs.poster, force_absolute);
|
247 |
+
|
248 |
+
sources = toArray(data.video.sources);
|
249 |
+
if (sources) {
|
250 |
+
for (i = 0; i < sources.length; i++)
|
251 |
+
sources[i].src = self.convertUrl(sources[i].src, force_absolute);
|
252 |
+
}
|
253 |
+
|
254 |
+
img = self.editor.dom.create('img', {
|
255 |
+
id : data.id,
|
256 |
+
style : data.style,
|
257 |
+
align : data.align,
|
258 |
+
hspace : data.hspace,
|
259 |
+
vspace : data.vspace,
|
260 |
+
src : self.editor.theme.url + '/img/trans.gif',
|
261 |
+
'class' : 'mceItemMedia mceItem' + self.getType(data.type).name,
|
262 |
+
'data-mce-json' : JSON.serialize(data, "'")
|
263 |
+
});
|
264 |
+
|
265 |
+
img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320"));
|
266 |
+
img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240"));
|
267 |
+
|
268 |
+
return img;
|
269 |
+
},
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Converts the JSON data object to a HTML string.
|
273 |
+
*/
|
274 |
+
dataToHtml : function(data, force_absolute) {
|
275 |
+
return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute});
|
276 |
+
},
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Converts the JSON data object to a HTML string.
|
280 |
+
*/
|
281 |
+
htmlToData : function(html) {
|
282 |
+
var fragment, img, data;
|
283 |
+
|
284 |
+
data = {
|
285 |
+
type : 'flash',
|
286 |
+
video: {sources:[]},
|
287 |
+
params: {}
|
288 |
+
};
|
289 |
+
|
290 |
+
fragment = this.editor.parser.parse(html);
|
291 |
+
img = fragment.getAll('img')[0];
|
292 |
+
|
293 |
+
if (img) {
|
294 |
+
data = JSON.parse(img.attr('data-mce-json'));
|
295 |
+
data.type = this.getType(img.attr('class')).name.toLowerCase();
|
296 |
+
|
297 |
+
// Add some extra properties to the data object
|
298 |
+
tinymce.each(rootAttributes, function(name) {
|
299 |
+
var value = img.attr(name);
|
300 |
+
|
301 |
+
if (value)
|
302 |
+
data[name] = value;
|
303 |
+
});
|
304 |
+
}
|
305 |
+
|
306 |
+
return data;
|
307 |
+
},
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Get type item by extension, class, clsid or mime type.
|
311 |
+
*
|
312 |
+
* @method getType
|
313 |
+
* @param {String} value Value to get type item by.
|
314 |
+
* @return {Object} Type item object or undefined.
|
315 |
+
*/
|
316 |
+
getType : function(value) {
|
317 |
+
var i, values, typeItem;
|
318 |
+
|
319 |
+
// Find type by checking the classes
|
320 |
+
values = tinymce.explode(value, ' ');
|
321 |
+
for (i = 0; i < values.length; i++) {
|
322 |
+
typeItem = this.lookup[values[i]];
|
323 |
+
|
324 |
+
if (typeItem)
|
325 |
+
return typeItem;
|
326 |
+
}
|
327 |
+
},
|
328 |
+
|
329 |
+
/**
|
330 |
+
* Converts a tinymce.html.Node image element to video/object/embed.
|
331 |
+
*/
|
332 |
+
imgToObject : function(node, args) {
|
333 |
+
var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,
|
334 |
+
source, sources, params, param, typeItem, i, item, mp4Source, replacement,
|
335 |
+
posterSrc, style, audio;
|
336 |
+
|
337 |
+
// Adds the flash player
|
338 |
+
function addPlayer(video_src, poster_src) {
|
339 |
+
var baseUri, flashVars, flashVarsOutput, params, flashPlayer;
|
340 |
+
|
341 |
+
flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf'));
|
342 |
+
if (flashPlayer) {
|
343 |
+
baseUri = editor.documentBaseURI;
|
344 |
+
data.params.src = flashPlayer;
|
345 |
+
|
346 |
+
// Convert the movie url to absolute urls
|
347 |
+
if (editor.getParam('flash_video_player_absvideourl', true)) {
|
348 |
+
video_src = baseUri.toAbsolute(video_src || '', true);
|
349 |
+
poster_src = baseUri.toAbsolute(poster_src || '', true);
|
350 |
+
}
|
351 |
+
|
352 |
+
// Generate flash vars
|
353 |
+
flashVarsOutput = '';
|
354 |
+
flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'});
|
355 |
+
tinymce.each(flashVars, function(value, name) {
|
356 |
+
// Replace $url and $poster variables in flashvars value
|
357 |
+
value = value.replace(/\$url/, video_src || '');
|
358 |
+
value = value.replace(/\$poster/, poster_src || '');
|
359 |
+
|
360 |
+
if (value.length > 0)
|
361 |
+
flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);
|
362 |
+
});
|
363 |
+
|
364 |
+
if (flashVarsOutput.length)
|
365 |
+
data.params.flashvars = flashVarsOutput;
|
366 |
+
|
367 |
+
params = editor.getParam('flash_video_player_params', {
|
368 |
+
allowfullscreen: true,
|
369 |
+
allowscriptaccess: true
|
370 |
+
});
|
371 |
+
|
372 |
+
tinymce.each(params, function(value, name) {
|
373 |
+
data.params[name] = "" + value;
|
374 |
+
});
|
375 |
+
}
|
376 |
+
};
|
377 |
+
|
378 |
+
data = node.attr('data-mce-json');
|
379 |
+
if (!data)
|
380 |
+
return;
|
381 |
+
|
382 |
+
data = JSON.parse(data);
|
383 |
+
typeItem = this.getType(node.attr('class'));
|
384 |
+
|
385 |
+
style = node.attr('data-mce-style');
|
386 |
+
if (!style) {
|
387 |
+
style = node.attr('style');
|
388 |
+
|
389 |
+
if (style)
|
390 |
+
style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
|
391 |
+
}
|
392 |
+
|
393 |
+
// Use node width/height to override the data width/height when the placeholder is resized
|
394 |
+
data.width = node.attr('width') || data.width;
|
395 |
+
data.height = node.attr('height') || data.height;
|
396 |
+
|
397 |
+
// Handle iframe
|
398 |
+
if (typeItem.name === 'Iframe') {
|
399 |
+
replacement = new Node('iframe', 1);
|
400 |
+
|
401 |
+
tinymce.each(rootAttributes, function(name) {
|
402 |
+
var value = node.attr(name);
|
403 |
+
|
404 |
+
if (name == 'class' && value)
|
405 |
+
value = value.replace(/mceItem.+ ?/g, '');
|
406 |
+
|
407 |
+
if (value && value.length > 0)
|
408 |
+
replacement.attr(name, value);
|
409 |
+
});
|
410 |
+
|
411 |
+
for (name in data.params)
|
412 |
+
replacement.attr(name, data.params[name]);
|
413 |
+
|
414 |
+
replacement.attr({
|
415 |
+
style: style,
|
416 |
+
src: data.params.src
|
417 |
+
});
|
418 |
+
|
419 |
+
node.replace(replacement);
|
420 |
+
|
421 |
+
return;
|
422 |
+
}
|
423 |
+
|
424 |
+
// Handle scripts
|
425 |
+
if (this.editor.settings.media_use_script) {
|
426 |
+
replacement = new Node('script', 1).attr('type', 'text/javascript');
|
427 |
+
|
428 |
+
value = new Node('#text', 3);
|
429 |
+
value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, {
|
430 |
+
width: node.attr('width'),
|
431 |
+
height: node.attr('height')
|
432 |
+
})) + ');';
|
433 |
+
|
434 |
+
replacement.append(value);
|
435 |
+
node.replace(replacement);
|
436 |
+
|
437 |
+
return;
|
438 |
+
}
|
439 |
+
|
440 |
+
// Add HTML5 video element
|
441 |
+
if (typeItem.name === 'Video' && data.video.sources[0]) {
|
442 |
+
// Create new object element
|
443 |
+
video = new Node('video', 1).attr(tinymce.extend({
|
444 |
+
id : node.attr('id'),
|
445 |
+
width: normalizeSize(node.attr('width')),
|
446 |
+
height: normalizeSize(node.attr('height')),
|
447 |
+
style : style
|
448 |
+
}, data.video.attrs));
|
449 |
+
|
450 |
+
// Get poster source and use that for flash fallback
|
451 |
+
if (data.video.attrs)
|
452 |
+
posterSrc = data.video.attrs.poster;
|
453 |
+
|
454 |
+
sources = data.video.sources = toArray(data.video.sources);
|
455 |
+
for (i = 0; i < sources.length; i++) {
|
456 |
+
if (/\.mp4$/.test(sources[i].src))
|
457 |
+
mp4Source = sources[i].src;
|
458 |
+
}
|
459 |
+
|
460 |
+
if (!sources[0].type) {
|
461 |
+
video.attr('src', sources[0].src);
|
462 |
+
sources.splice(0, 1);
|
463 |
+
}
|
464 |
+
|
465 |
+
for (i = 0; i < sources.length; i++) {
|
466 |
+
source = new Node('source', 1).attr(sources[i]);
|
467 |
+
source.shortEnded = true;
|
468 |
+
video.append(source);
|
469 |
+
}
|
470 |
+
|
471 |
+
// Create flash fallback for video if we have a mp4 source
|
472 |
+
if (mp4Source) {
|
473 |
+
addPlayer(mp4Source, posterSrc);
|
474 |
+
typeItem = self.getType('flash');
|
475 |
+
} else
|
476 |
+
data.params.src = '';
|
477 |
+
}
|
478 |
+
|
479 |
+
// Add HTML5 audio element
|
480 |
+
if (typeItem.name === 'Audio' && data.video.sources[0]) {
|
481 |
+
// Create new object element
|
482 |
+
audio = new Node('audio', 1).attr(tinymce.extend({
|
483 |
+
id : node.attr('id'),
|
484 |
+
width: normalizeSize(node.attr('width')),
|
485 |
+
height: normalizeSize(node.attr('height')),
|
486 |
+
style : style
|
487 |
+
}, data.video.attrs));
|
488 |
+
|
489 |
+
// Get poster source and use that for flash fallback
|
490 |
+
if (data.video.attrs)
|
491 |
+
posterSrc = data.video.attrs.poster;
|
492 |
+
|
493 |
+
sources = data.video.sources = toArray(data.video.sources);
|
494 |
+
if (!sources[0].type) {
|
495 |
+
audio.attr('src', sources[0].src);
|
496 |
+
sources.splice(0, 1);
|
497 |
+
}
|
498 |
+
|
499 |
+
for (i = 0; i < sources.length; i++) {
|
500 |
+
source = new Node('source', 1).attr(sources[i]);
|
501 |
+
source.shortEnded = true;
|
502 |
+
audio.append(source);
|
503 |
+
}
|
504 |
+
|
505 |
+
data.params.src = '';
|
506 |
+
}
|
507 |
+
|
508 |
+
if (typeItem.name === 'EmbeddedAudio') {
|
509 |
+
embed = new Node('embed', 1);
|
510 |
+
embed.shortEnded = true;
|
511 |
+
embed.attr({
|
512 |
+
id: node.attr('id'),
|
513 |
+
width: normalizeSize(node.attr('width')),
|
514 |
+
height: normalizeSize(node.attr('height')),
|
515 |
+
style : style,
|
516 |
+
type: node.attr('type')
|
517 |
+
});
|
518 |
+
|
519 |
+
for (name in data.params)
|
520 |
+
embed.attr(name, data.params[name]);
|
521 |
+
|
522 |
+
tinymce.each(rootAttributes, function(name) {
|
523 |
+
if (data[name] && name != 'type')
|
524 |
+
embed.attr(name, data[name]);
|
525 |
+
});
|
526 |
+
|
527 |
+
data.params.src = '';
|
528 |
+
}
|
529 |
+
|
530 |
+
// Do we have a params src then we can generate object
|
531 |
+
if (data.params.src) {
|
532 |
+
// Is flv movie add player for it
|
533 |
+
if (/\.flv$/i.test(data.params.src))
|
534 |
+
addPlayer(data.params.src, '');
|
535 |
+
|
536 |
+
if (args && args.force_absolute)
|
537 |
+
data.params.src = editor.documentBaseURI.toAbsolute(data.params.src);
|
538 |
+
|
539 |
+
// Create new object element
|
540 |
+
object = new Node('object', 1).attr({
|
541 |
+
id : node.attr('id'),
|
542 |
+
width: normalizeSize(node.attr('width')),
|
543 |
+
height: normalizeSize(node.attr('height')),
|
544 |
+
style : style
|
545 |
+
});
|
546 |
+
|
547 |
+
tinymce.each(rootAttributes, function(name) {
|
548 |
+
var value = data[name];
|
549 |
+
|
550 |
+
if (name == 'class' && value)
|
551 |
+
value = value.replace(/mceItem.+ ?/g, '');
|
552 |
+
|
553 |
+
if (value && name != 'type')
|
554 |
+
object.attr(name, value);
|
555 |
+
});
|
556 |
+
|
557 |
+
// Add params
|
558 |
+
for (name in data.params) {
|
559 |
+
param = new Node('param', 1);
|
560 |
+
param.shortEnded = true;
|
561 |
+
value = data.params[name];
|
562 |
+
|
563 |
+
// Windows media needs to use url instead of src for the media URL
|
564 |
+
if (name === 'src' && typeItem.name === 'WindowsMedia')
|
565 |
+
name = 'url';
|
566 |
+
|
567 |
+
param.attr({name: name, value: value});
|
568 |
+
object.append(param);
|
569 |
+
}
|
570 |
+
|
571 |
+
// Setup add type and classid if strict is disabled
|
572 |
+
if (this.editor.getParam('media_strict', true)) {
|
573 |
+
object.attr({
|
574 |
+
data: data.params.src,
|
575 |
+
type: typeItem.mimes[0]
|
576 |
+
});
|
577 |
+
} else {
|
578 |
+
object.attr({
|
579 |
+
classid: "clsid:" + typeItem.clsids[0],
|
580 |
+
codebase: typeItem.codebase
|
581 |
+
});
|
582 |
+
|
583 |
+
embed = new Node('embed', 1);
|
584 |
+
embed.shortEnded = true;
|
585 |
+
embed.attr({
|
586 |
+
id: node.attr('id'),
|
587 |
+
width: normalizeSize(node.attr('width')),
|
588 |
+
height: normalizeSize(node.attr('height')),
|
589 |
+
style : style,
|
590 |
+
type: typeItem.mimes[0]
|
591 |
+
});
|
592 |
+
|
593 |
+
for (name in data.params)
|
594 |
+
embed.attr(name, data.params[name]);
|
595 |
+
|
596 |
+
tinymce.each(rootAttributes, function(name) {
|
597 |
+
if (data[name] && name != 'type')
|
598 |
+
embed.attr(name, data[name]);
|
599 |
+
});
|
600 |
+
|
601 |
+
object.append(embed);
|
602 |
+
}
|
603 |
+
|
604 |
+
// Insert raw HTML
|
605 |
+
if (data.object_html) {
|
606 |
+
value = new Node('#text', 3);
|
607 |
+
value.raw = true;
|
608 |
+
value.value = data.object_html;
|
609 |
+
object.append(value);
|
610 |
+
}
|
611 |
+
|
612 |
+
// Append object to video element if it exists
|
613 |
+
if (video)
|
614 |
+
video.append(object);
|
615 |
+
}
|
616 |
+
|
617 |
+
if (video) {
|
618 |
+
// Insert raw HTML
|
619 |
+
if (data.video_html) {
|
620 |
+
value = new Node('#text', 3);
|
621 |
+
value.raw = true;
|
622 |
+
value.value = data.video_html;
|
623 |
+
video.append(value);
|
624 |
+
}
|
625 |
+
}
|
626 |
+
|
627 |
+
if (audio) {
|
628 |
+
// Insert raw HTML
|
629 |
+
if (data.video_html) {
|
630 |
+
value = new Node('#text', 3);
|
631 |
+
value.raw = true;
|
632 |
+
value.value = data.video_html;
|
633 |
+
audio.append(value);
|
634 |
+
}
|
635 |
+
}
|
636 |
+
|
637 |
+
var n = video || audio || object || embed;
|
638 |
+
if (n)
|
639 |
+
node.replace(n);
|
640 |
+
else
|
641 |
+
node.remove();
|
642 |
+
},
|
643 |
+
|
644 |
+
/**
|
645 |
+
* Converts a tinymce.html.Node video/object/embed to an img element.
|
646 |
+
*
|
647 |
+
* The video/object/embed will be converted into an image placeholder with a JSON data attribute like this:
|
648 |
+
* <img class="mceItemMedia mceItemFlash" width="100" height="100" data-mce-json="{..}" />
|
649 |
+
*
|
650 |
+
* The JSON structure will be like this:
|
651 |
+
* {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}}
|
652 |
+
*/
|
653 |
+
objectToImg : function(node) {
|
654 |
+
var object, embed, video, iframe, img, name, id, width, height, style, i, html,
|
655 |
+
param, params, source, sources, data, type, lookup = this.lookup,
|
656 |
+
matches, attrs, urlConverter = this.editor.settings.url_converter,
|
657 |
+
urlConverterScope = this.editor.settings.url_converter_scope,
|
658 |
+
hspace, vspace, align, bgcolor;
|
659 |
+
|
660 |
+
function getInnerHTML(node) {
|
661 |
+
return new tinymce.html.Serializer({
|
662 |
+
inner: true,
|
663 |
+
validate: false
|
664 |
+
}).serialize(node);
|
665 |
+
};
|
666 |
+
|
667 |
+
function lookupAttribute(o, attr) {
|
668 |
+
return lookup[(o.attr(attr) || '').toLowerCase()];
|
669 |
+
}
|
670 |
+
|
671 |
+
function lookupExtension(src) {
|
672 |
+
var ext = src.replace(/^.*\.([^.]+)$/, '$1');
|
673 |
+
return lookup[ext.toLowerCase() || ''];
|
674 |
+
}
|
675 |
+
|
676 |
+
// If node isn't in document
|
677 |
+
if (!node.parent)
|
678 |
+
return;
|
679 |
+
|
680 |
+
// Handle media scripts
|
681 |
+
if (node.name === 'script') {
|
682 |
+
if (node.firstChild)
|
683 |
+
matches = scriptRegExp.exec(node.firstChild.value);
|
684 |
+
|
685 |
+
if (!matches)
|
686 |
+
return;
|
687 |
+
|
688 |
+
type = matches[1];
|
689 |
+
data = {video : {}, params : JSON.parse(matches[2])};
|
690 |
+
width = data.params.width;
|
691 |
+
height = data.params.height;
|
692 |
+
}
|
693 |
+
|
694 |
+
// Setup data objects
|
695 |
+
data = data || {
|
696 |
+
video : {},
|
697 |
+
params : {}
|
698 |
+
};
|
699 |
+
|
700 |
+
// Setup new image object
|
701 |
+
img = new Node('img', 1);
|
702 |
+
img.attr({
|
703 |
+
src : this.editor.theme.url + '/img/trans.gif'
|
704 |
+
});
|
705 |
+
|
706 |
+
// Video element
|
707 |
+
name = node.name;
|
708 |
+
if (name === 'video' || name == 'audio') {
|
709 |
+
video = node;
|
710 |
+
object = node.getAll('object')[0];
|
711 |
+
embed = node.getAll('embed')[0];
|
712 |
+
width = video.attr('width');
|
713 |
+
height = video.attr('height');
|
714 |
+
id = video.attr('id');
|
715 |
+
data.video = {attrs : {}, sources : []};
|
716 |
+
|
717 |
+
// Get all video attributes
|
718 |
+
attrs = data.video.attrs;
|
719 |
+
for (name in video.attributes.map)
|
720 |
+
attrs[name] = video.attributes.map[name];
|
721 |
+
|
722 |
+
source = node.attr('src');
|
723 |
+
if (source)
|
724 |
+
data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)});
|
725 |
+
|
726 |
+
// Get all sources
|
727 |
+
sources = video.getAll("source");
|
728 |
+
for (i = 0; i < sources.length; i++) {
|
729 |
+
source = sources[i].remove();
|
730 |
+
|
731 |
+
data.video.sources.push({
|
732 |
+
src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'),
|
733 |
+
type: source.attr('type'),
|
734 |
+
media: source.attr('media')
|
735 |
+
});
|
736 |
+
}
|
737 |
+
|
738 |
+
// Convert the poster URL
|
739 |
+
if (attrs.poster)
|
740 |
+
attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name);
|
741 |
+
}
|
742 |
+
|
743 |
+
// Object element
|
744 |
+
if (node.name === 'object') {
|
745 |
+
object = node;
|
746 |
+
embed = node.getAll('embed')[0];
|
747 |
+
}
|
748 |
+
|
749 |
+
// Embed element
|
750 |
+
if (node.name === 'embed')
|
751 |
+
embed = node;
|
752 |
+
|
753 |
+
// Iframe element
|
754 |
+
if (node.name === 'iframe') {
|
755 |
+
iframe = node;
|
756 |
+
type = 'Iframe';
|
757 |
+
}
|
758 |
+
|
759 |
+
if (object) {
|
760 |
+
// Get width/height
|
761 |
+
width = width || object.attr('width');
|
762 |
+
height = height || object.attr('height');
|
763 |
+
style = style || object.attr('style');
|
764 |
+
id = id || object.attr('id');
|
765 |
+
hspace = hspace || object.attr('hspace');
|
766 |
+
vspace = vspace || object.attr('vspace');
|
767 |
+
align = align || object.attr('align');
|
768 |
+
bgcolor = bgcolor || object.attr('bgcolor');
|
769 |
+
data.name = object.attr('name');
|
770 |
+
|
771 |
+
// Get all object params
|
772 |
+
params = object.getAll("param");
|
773 |
+
for (i = 0; i < params.length; i++) {
|
774 |
+
param = params[i];
|
775 |
+
name = param.remove().attr('name');
|
776 |
+
|
777 |
+
if (!excludedAttrs[name])
|
778 |
+
data.params[name] = param.attr('value');
|
779 |
+
}
|
780 |
+
|
781 |
+
data.params.src = data.params.src || object.attr('data');
|
782 |
+
}
|
783 |
+
|
784 |
+
if (embed) {
|
785 |
+
// Get width/height
|
786 |
+
width = width || embed.attr('width');
|
787 |
+
height = height || embed.attr('height');
|
788 |
+
style = style || embed.attr('style');
|
789 |
+
id = id || embed.attr('id');
|
790 |
+
hspace = hspace || embed.attr('hspace');
|
791 |
+
vspace = vspace || embed.attr('vspace');
|
792 |
+
align = align || embed.attr('align');
|
793 |
+
bgcolor = bgcolor || embed.attr('bgcolor');
|
794 |
+
|
795 |
+
// Get all embed attributes
|
796 |
+
for (name in embed.attributes.map) {
|
797 |
+
if (!excludedAttrs[name] && !data.params[name])
|
798 |
+
data.params[name] = embed.attributes.map[name];
|
799 |
+
}
|
800 |
+
}
|
801 |
+
|
802 |
+
if (iframe) {
|
803 |
+
// Get width/height
|
804 |
+
width = normalizeSize(iframe.attr('width'));
|
805 |
+
height = normalizeSize(iframe.attr('height'));
|
806 |
+
style = style || iframe.attr('style');
|
807 |
+
id = iframe.attr('id');
|
808 |
+
hspace = iframe.attr('hspace');
|
809 |
+
vspace = iframe.attr('vspace');
|
810 |
+
align = iframe.attr('align');
|
811 |
+
bgcolor = iframe.attr('bgcolor');
|
812 |
+
|
813 |
+
tinymce.each(rootAttributes, function(name) {
|
814 |
+
img.attr(name, iframe.attr(name));
|
815 |
+
});
|
816 |
+
|
817 |
+
// Get all iframe attributes
|
818 |
+
for (name in iframe.attributes.map) {
|
819 |
+
if (!excludedAttrs[name] && !data.params[name])
|
820 |
+
data.params[name] = iframe.attributes.map[name];
|
821 |
+
}
|
822 |
+
}
|
823 |
+
|
824 |
+
// Use src not movie
|
825 |
+
if (data.params.movie) {
|
826 |
+
data.params.src = data.params.src || data.params.movie;
|
827 |
+
delete data.params.movie;
|
828 |
+
}
|
829 |
+
|
830 |
+
// Convert the URL to relative/absolute depending on configuration
|
831 |
+
if (data.params.src)
|
832 |
+
data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');
|
833 |
+
|
834 |
+
if (video) {
|
835 |
+
if (node.name === 'video')
|
836 |
+
type = lookup.video.name;
|
837 |
+
else if (node.name === 'audio')
|
838 |
+
type = lookup.audio.name;
|
839 |
+
}
|
840 |
+
|
841 |
+
if (object && !type)
|
842 |
+
type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name;
|
843 |
+
|
844 |
+
if (embed && !type)
|
845 |
+
type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name;
|
846 |
+
|
847 |
+
// for embedded audio we preserve the original specified type
|
848 |
+
if (embed && type == 'EmbeddedAudio') {
|
849 |
+
data.params.type = embed.attr('type');
|
850 |
+
}
|
851 |
+
|
852 |
+
// Replace the video/object/embed element with a placeholder image containing the data
|
853 |
+
node.replace(img);
|
854 |
+
|
855 |
+
// Remove embed
|
856 |
+
if (embed)
|
857 |
+
embed.remove();
|
858 |
+
|
859 |
+
// Serialize the inner HTML of the object element
|
860 |
+
if (object) {
|
861 |
+
html = getInnerHTML(object.remove());
|
862 |
+
|
863 |
+
if (html)
|
864 |
+
data.object_html = html;
|
865 |
+
}
|
866 |
+
|
867 |
+
// Serialize the inner HTML of the video element
|
868 |
+
if (video) {
|
869 |
+
html = getInnerHTML(video.remove());
|
870 |
+
|
871 |
+
if (html)
|
872 |
+
data.video_html = html;
|
873 |
+
}
|
874 |
+
|
875 |
+
data.hspace = hspace;
|
876 |
+
data.vspace = vspace;
|
877 |
+
data.align = align;
|
878 |
+
data.bgcolor = bgcolor;
|
879 |
+
|
880 |
+
// Set width/height of placeholder
|
881 |
+
img.attr({
|
882 |
+
id : id,
|
883 |
+
'class' : 'mceItemMedia mceItem' + (type || 'Flash'),
|
884 |
+
style : style,
|
885 |
+
width : width || (node.name == 'audio' ? "300" : "320"),
|
886 |
+
height : height || (node.name == 'audio' ? "32" : "240"),
|
887 |
+
hspace : hspace,
|
888 |
+
vspace : vspace,
|
889 |
+
align : align,
|
890 |
+
bgcolor : bgcolor,
|
891 |
+
"data-mce-json" : JSON.serialize(data, "'")
|
892 |
+
});
|
893 |
+
}
|
894 |
+
});
|
895 |
+
|
896 |
+
// Register plugin
|
897 |
+
tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);
|
898 |
+
})();
|
js/libraries/tiny_mce/plugins/media/js/embed.js
CHANGED
@@ -1,73 +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 |
-
}
|
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 |
+
}
|
js/libraries/tiny_mce/plugins/media/js/media.js
CHANGED
@@ -1,503 +1,503 @@
|
|
1 |
-
(function() {
|
2 |
-
var url;
|
3 |
-
|
4 |
-
if (url = tinyMCEPopup.getParam("media_external_list_url"))
|
5 |
-
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
6 |
-
|
7 |
-
function get(id) {
|
8 |
-
return document.getElementById(id);
|
9 |
-
}
|
10 |
-
|
11 |
-
function clone(obj) {
|
12 |
-
var i, len, copy, attr;
|
13 |
-
|
14 |
-
if (null == obj || "object" != typeof obj)
|
15 |
-
return obj;
|
16 |
-
|
17 |
-
// Handle Array
|
18 |
-
if ('length' in obj) {
|
19 |
-
copy = [];
|
20 |
-
|
21 |
-
for (i = 0, len = obj.length; i < len; ++i) {
|
22 |
-
copy[i] = clone(obj[i]);
|
23 |
-
}
|
24 |
-
|
25 |
-
return copy;
|
26 |
-
}
|
27 |
-
|
28 |
-
// Handle Object
|
29 |
-
copy = {};
|
30 |
-
for (attr in obj) {
|
31 |
-
if (obj.hasOwnProperty(attr))
|
32 |
-
copy[attr] = clone(obj[attr]);
|
33 |
-
}
|
34 |
-
|
35 |
-
return copy;
|
36 |
-
}
|
37 |
-
|
38 |
-
function getVal(id) {
|
39 |
-
var elm = get(id);
|
40 |
-
|
41 |
-
if (elm.nodeName == "SELECT")
|
42 |
-
return elm.options[elm.selectedIndex].value;
|
43 |
-
|
44 |
-
if (elm.type == "checkbox")
|
45 |
-
return elm.checked;
|
46 |
-
|
47 |
-
return elm.value;
|
48 |
-
}
|
49 |
-
|
50 |
-
function setVal(id, value, name) {
|
51 |
-
if (typeof(value) != 'undefined' && value != null) {
|
52 |
-
var elm = get(id);
|
53 |
-
|
54 |
-
if (elm.nodeName == "SELECT")
|
55 |
-
selectByValue(document.forms[0], id, value);
|
56 |
-
else if (elm.type == "checkbox") {
|
57 |
-
if (typeof(value) == 'string') {
|
58 |
-
value = value.toLowerCase();
|
59 |
-
value = (!name && value === 'true') || (name && value === name.toLowerCase());
|
60 |
-
}
|
61 |
-
elm.checked = !!value;
|
62 |
-
} else
|
63 |
-
elm.value = value;
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
window.Media = {
|
68 |
-
init : function() {
|
69 |
-
var html, editor, self = this;
|
70 |
-
|
71 |
-
self.editor = editor = tinyMCEPopup.editor;
|
72 |
-
|
73 |
-
// Setup file browsers and color pickers
|
74 |
-
get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
|
75 |
-
get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media');
|
76 |
-
get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
|
77 |
-
get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media');
|
78 |
-
get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media');
|
79 |
-
get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media');
|
80 |
-
get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media');
|
81 |
-
get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media');
|
82 |
-
|
83 |
-
html = self.getMediaListHTML('medialist', 'src', 'media', 'media');
|
84 |
-
if (html == "")
|
85 |
-
get("linklistrow").style.display = 'none';
|
86 |
-
else
|
87 |
-
get("linklistcontainer").innerHTML = html;
|
88 |
-
|
89 |
-
if (isVisible('filebrowser'))
|
90 |
-
get('src').style.width = '230px';
|
91 |
-
|
92 |
-
if (isVisible('video_filebrowser_altsource1'))
|
93 |
-
get('video_altsource1').style.width = '220px';
|
94 |
-
|
95 |
-
if (isVisible('video_filebrowser_altsource2'))
|
96 |
-
get('video_altsource2').style.width = '220px';
|
97 |
-
|
98 |
-
if (isVisible('audio_filebrowser_altsource1'))
|
99 |
-
get('audio_altsource1').style.width = '220px';
|
100 |
-
|
101 |
-
if (isVisible('audio_filebrowser_altsource2'))
|
102 |
-
get('audio_altsource2').style.width = '220px';
|
103 |
-
|
104 |
-
if (isVisible('filebrowser_poster'))
|
105 |
-
get('video_poster').style.width = '220px';
|
106 |
-
|
107 |
-
editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor));
|
108 |
-
|
109 |
-
self.setDefaultDialogSettings(editor);
|
110 |
-
self.data = clone(tinyMCEPopup.getWindowArg('data'));
|
111 |
-
self.dataToForm();
|
112 |
-
self.preview();
|
113 |
-
|
114 |
-
updateColor('bgcolor_pick', 'bgcolor');
|
115 |
-
},
|
116 |
-
|
117 |
-
insert : function() {
|
118 |
-
var editor = tinyMCEPopup.editor;
|
119 |
-
|
120 |
-
this.formToData();
|
121 |
-
editor.execCommand('mceRepaint');
|
122 |
-
tinyMCEPopup.restoreSelection();
|
123 |
-
editor.selection.setNode(editor.plugins.media.dataToImg(this.data));
|
124 |
-
tinyMCEPopup.close();
|
125 |
-
},
|
126 |
-
|
127 |
-
preview : function() {
|
128 |
-
get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true);
|
129 |
-
},
|
130 |
-
|
131 |
-
moveStates : function(to_form, field) {
|
132 |
-
var data = this.data, editor = this.editor,
|
133 |
-
mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src;
|
134 |
-
|
135 |
-
defaultStates = {
|
136 |
-
// QuickTime
|
137 |
-
quicktime_autoplay : true,
|
138 |
-
quicktime_controller : true,
|
139 |
-
|
140 |
-
// Flash
|
141 |
-
flash_play : true,
|
142 |
-
flash_loop : true,
|
143 |
-
flash_menu : true,
|
144 |
-
|
145 |
-
// WindowsMedia
|
146 |
-
windowsmedia_autostart : true,
|
147 |
-
windowsmedia_enablecontextmenu : true,
|
148 |
-
windowsmedia_invokeurls : true,
|
149 |
-
|
150 |
-
// RealMedia
|
151 |
-
realmedia_autogotourl : true,
|
152 |
-
realmedia_imagestatus : true
|
153 |
-
};
|
154 |
-
|
155 |
-
function parseQueryParams(str) {
|
156 |
-
var out = {};
|
157 |
-
|
158 |
-
if (str) {
|
159 |
-
tinymce.each(str.split('&'), function(item) {
|
160 |
-
var parts = item.split('=');
|
161 |
-
|
162 |
-
out[unescape(parts[0])] = unescape(parts[1]);
|
163 |
-
});
|
164 |
-
}
|
165 |
-
|
166 |
-
return out;
|
167 |
-
};
|
168 |
-
|
169 |
-
function setOptions(type, names) {
|
170 |
-
var i, name, formItemName, value, list;
|
171 |
-
|
172 |
-
if (type == data.type || type == 'global') {
|
173 |
-
names = tinymce.explode(names);
|
174 |
-
for (i = 0; i < names.length; i++) {
|
175 |
-
name = names[i];
|
176 |
-
formItemName = type == 'global' ? name : type + '_' + name;
|
177 |
-
|
178 |
-
if (type == 'global')
|
179 |
-
list = data;
|
180 |
-
else if (type == 'video' || type == 'audio') {
|
181 |
-
list = data.video.attrs;
|
182 |
-
|
183 |
-
if (!list && !to_form)
|
184 |
-
data.video.attrs = list = {};
|
185 |
-
} else
|
186 |
-
list = data.params;
|
187 |
-
|
188 |
-
if (list) {
|
189 |
-
if (to_form) {
|
190 |
-
setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : '');
|
191 |
-
} else {
|
192 |
-
delete list[name];
|
193 |
-
|
194 |
-
value = getVal(formItemName);
|
195 |
-
if ((type == 'video' || type == 'audio') && value === true)
|
196 |
-
value = name;
|
197 |
-
|
198 |
-
if (defaultStates[formItemName]) {
|
199 |
-
if (value !== defaultStates[formItemName]) {
|
200 |
-
value = "" + value;
|
201 |
-
list[name] = value;
|
202 |
-
}
|
203 |
-
} else if (value) {
|
204 |
-
value = "" + value;
|
205 |
-
list[name] = value;
|
206 |
-
}
|
207 |
-
}
|
208 |
-
}
|
209 |
-
}
|
210 |
-
}
|
211 |
-
}
|
212 |
-
|
213 |
-
if (!to_form) {
|
214 |
-
data.type = get('media_type').options[get('media_type').selectedIndex].value;
|
215 |
-
data.width = getVal('width');
|
216 |
-
data.height = getVal('height');
|
217 |
-
|
218 |
-
// Switch type based on extension
|
219 |
-
src = getVal('src');
|
220 |
-
if (field == 'src') {
|
221 |
-
ext = src.replace(/^.*\.([^.]+)$/, '$1');
|
222 |
-
if (typeInfo = mediaPlugin.getType(ext))
|
223 |
-
data.type = typeInfo.name.toLowerCase();
|
224 |
-
|
225 |
-
setVal('media_type', data.type);
|
226 |
-
}
|
227 |
-
|
228 |
-
if (data.type == "video" || data.type == "audio") {
|
229 |
-
if (!data.video.sources)
|
230 |
-
data.video.sources = [];
|
231 |
-
|
232 |
-
data.video.sources[0] = {src: getVal('src')};
|
233 |
-
}
|
234 |
-
}
|
235 |
-
|
236 |
-
// Hide all fieldsets and show the one active
|
237 |
-
get('video_options').style.display = 'none';
|
238 |
-
get('audio_options').style.display = 'none';
|
239 |
-
get('flash_options').style.display = 'none';
|
240 |
-
get('quicktime_options').style.display = 'none';
|
241 |
-
get('shockwave_options').style.display = 'none';
|
242 |
-
get('windowsmedia_options').style.display = 'none';
|
243 |
-
get('realmedia_options').style.display = 'none';
|
244 |
-
get('embeddedaudio_options').style.display = 'none';
|
245 |
-
|
246 |
-
if (get(data.type + '_options'))
|
247 |
-
get(data.type + '_options').style.display = 'block';
|
248 |
-
|
249 |
-
setVal('media_type', data.type);
|
250 |
-
|
251 |
-
setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars');
|
252 |
-
setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc');
|
253 |
-
setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign');
|
254 |
-
setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume');
|
255 |
-
setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks');
|
256 |
-
setOptions('video', 'poster,autoplay,loop,muted,preload,controls');
|
257 |
-
setOptions('audio', 'autoplay,loop,preload,controls');
|
258 |
-
setOptions('embeddedaudio', 'autoplay,loop,controls');
|
259 |
-
setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height');
|
260 |
-
|
261 |
-
if (to_form) {
|
262 |
-
if (data.type == 'video') {
|
263 |
-
if (data.video.sources[0])
|
264 |
-
setVal('src', data.video.sources[0].src);
|
265 |
-
|
266 |
-
src = data.video.sources[1];
|
267 |
-
if (src)
|
268 |
-
setVal('video_altsource1', src.src);
|
269 |
-
|
270 |
-
src = data.video.sources[2];
|
271 |
-
if (src)
|
272 |
-
setVal('video_altsource2', src.src);
|
273 |
-
} else if (data.type == 'audio') {
|
274 |
-
if (data.video.sources[0])
|
275 |
-
setVal('src', data.video.sources[0].src);
|
276 |
-
|
277 |
-
src = data.video.sources[1];
|
278 |
-
if (src)
|
279 |
-
setVal('audio_altsource1', src.src);
|
280 |
-
|
281 |
-
src = data.video.sources[2];
|
282 |
-
if (src)
|
283 |
-
setVal('audio_altsource2', src.src);
|
284 |
-
} else {
|
285 |
-
// Check flash vars
|
286 |
-
if (data.type == 'flash') {
|
287 |
-
tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) {
|
288 |
-
if (value == '$url')
|
289 |
-
data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || '';
|
290 |
-
});
|
291 |
-
}
|
292 |
-
|
293 |
-
setVal('src', data.params.src);
|
294 |
-
}
|
295 |
-
} else {
|
296 |
-
src = getVal("src");
|
297 |
-
|
298 |
-
// YouTube *NEW*
|
299 |
-
if (src.match(/youtu.be\/[a-z1-9.-_]+/)) {
|
300 |
-
data.width = 425;
|
301 |
-
data.height = 350;
|
302 |
-
data.params.frameborder = '0';
|
303 |
-
data.type = 'iframe';
|
304 |
-
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
|
305 |
-
setVal('src', src);
|
306 |
-
setVal('media_type', data.type);
|
307 |
-
}
|
308 |
-
|
309 |
-
// YouTube
|
310 |
-
if (src.match(/youtube.com(.+)v=([^&]+)/)) {
|
311 |
-
data.width = 425;
|
312 |
-
data.height = 350;
|
313 |
-
data.params.frameborder = '0';
|
314 |
-
data.type = 'iframe';
|
315 |
-
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
|
316 |
-
setVal('src', src);
|
317 |
-
setVal('media_type', data.type);
|
318 |
-
}
|
319 |
-
|
320 |
-
// Google video
|
321 |
-
if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
|
322 |
-
data.width = 425;
|
323 |
-
data.height = 326;
|
324 |
-
data.type = 'flash';
|
325 |
-
src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en';
|
326 |
-
setVal('src', src);
|
327 |
-
setVal('media_type', data.type);
|
328 |
-
}
|
329 |
-
|
330 |
-
// Vimeo
|
331 |
-
if (src.match(/vimeo.com\/([0-9]+)/)) {
|
332 |
-
data.width = 425;
|
333 |
-
data.height = 350;
|
334 |
-
data.params.frameborder = '0';
|
335 |
-
data.type = 'iframe';
|
336 |
-
src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1];
|
337 |
-
setVal('src', src);
|
338 |
-
setVal('media_type', data.type);
|
339 |
-
}
|
340 |
-
|
341 |
-
// stream.cz
|
342 |
-
if (src.match(/stream.cz\/((?!object).)*\/([0-9]+)/)) {
|
343 |
-
data.width = 425;
|
344 |
-
data.height = 350;
|
345 |
-
data.params.frameborder = '0';
|
346 |
-
data.type = 'iframe';
|
347 |
-
src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1];
|
348 |
-
setVal('src', src);
|
349 |
-
setVal('media_type', data.type);
|
350 |
-
}
|
351 |
-
|
352 |
-
// Google maps
|
353 |
-
if (src.match(/maps.google.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) {
|
354 |
-
data.width = 425;
|
355 |
-
data.height = 350;
|
356 |
-
data.params.frameborder = '0';
|
357 |
-
data.type = 'iframe';
|
358 |
-
src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed";
|
359 |
-
setVal('src', src);
|
360 |
-
setVal('media_type', data.type);
|
361 |
-
}
|
362 |
-
|
363 |
-
if (data.type == 'video') {
|
364 |
-
if (!data.video.sources)
|
365 |
-
data.video.sources = [];
|
366 |
-
|
367 |
-
data.video.sources[0] = {src : src};
|
368 |
-
|
369 |
-
src = getVal("video_altsource1");
|
370 |
-
if (src)
|
371 |
-
data.video.sources[1] = {src : src};
|
372 |
-
|
373 |
-
src = getVal("video_altsource2");
|
374 |
-
if (src)
|
375 |
-
data.video.sources[2] = {src : src};
|
376 |
-
} else if (data.type == 'audio') {
|
377 |
-
if (!data.video.sources)
|
378 |
-
data.video.sources = [];
|
379 |
-
|
380 |
-
data.video.sources[0] = {src : src};
|
381 |
-
|
382 |
-
src = getVal("audio_altsource1");
|
383 |
-
if (src)
|
384 |
-
data.video.sources[1] = {src : src};
|
385 |
-
|
386 |
-
src = getVal("audio_altsource2");
|
387 |
-
if (src)
|
388 |
-
data.video.sources[2] = {src : src};
|
389 |
-
} else
|
390 |
-
data.params.src = src;
|
391 |
-
|
392 |
-
// Set default size
|
393 |
-
setVal('width', data.width || (data.type == 'audio' ? 300 : 320));
|
394 |
-
setVal('height', data.height || (data.type == 'audio' ? 32 : 240));
|
395 |
-
}
|
396 |
-
},
|
397 |
-
|
398 |
-
dataToForm : function() {
|
399 |
-
this.moveStates(true);
|
400 |
-
},
|
401 |
-
|
402 |
-
formToData : function(field) {
|
403 |
-
if (field == "width" || field == "height")
|
404 |
-
this.changeSize(field);
|
405 |
-
|
406 |
-
if (field == 'source') {
|
407 |
-
this.moveStates(false, field);
|
408 |
-
setVal('source', this.editor.plugins.media.dataToHtml(this.data));
|
409 |
-
this.panel = 'source';
|
410 |
-
} else {
|
411 |
-
if (this.panel == 'source') {
|
412 |
-
this.data = clone(this.editor.plugins.media.htmlToData(getVal('source')));
|
413 |
-
this.dataToForm();
|
414 |
-
this.panel = '';
|
415 |
-
}
|
416 |
-
|
417 |
-
this.moveStates(false, field);
|
418 |
-
this.preview();
|
419 |
-
}
|
420 |
-
},
|
421 |
-
|
422 |
-
beforeResize : function() {
|
423 |
-
this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);
|
424 |
-
this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);
|
425 |
-
},
|
426 |
-
|
427 |
-
changeSize : function(type) {
|
428 |
-
var width, height, scale, size;
|
429 |
-
|
430 |
-
if (get('constrain').checked) {
|
431 |
-
width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);
|
432 |
-
height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);
|
433 |
-
|
434 |
-
if (type == 'width') {
|
435 |
-
this.height = Math.round((width / this.width) * height);
|
436 |
-
setVal('height', this.height);
|
437 |
-
} else {
|
438 |
-
this.width = Math.round((height / this.height) * width);
|
439 |
-
setVal('width', this.width);
|
440 |
-
}
|
441 |
-
}
|
442 |
-
},
|
443 |
-
|
444 |
-
getMediaListHTML : function() {
|
445 |
-
if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
|
446 |
-
var html = "";
|
447 |
-
|
448 |
-
html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;Media.formToData(\'src\');">';
|
449 |
-
html += '<option value="">---</option>';
|
450 |
-
|
451 |
-
for (var i=0; i<tinyMCEMediaList.length; i++)
|
452 |
-
html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
|
453 |
-
|
454 |
-
html += '</select>';
|
455 |
-
|
456 |
-
return html;
|
457 |
-
}
|
458 |
-
|
459 |
-
return "";
|
460 |
-
},
|
461 |
-
|
462 |
-
getMediaTypeHTML : function(editor) {
|
463 |
-
function option(media_type, element) {
|
464 |
-
if (!editor.schema.getElementRule(element || media_type)) {
|
465 |
-
return '';
|
466 |
-
}
|
467 |
-
|
468 |
-
return '<option value="'+media_type+'">'+tinyMCEPopup.editor.translate("media_dlg."+media_type)+'</option>'
|
469 |
-
}
|
470 |
-
|
471 |
-
var html = "";
|
472 |
-
|
473 |
-
html += '<select id="media_type" name="media_type" onchange="Media.formToData(\'type\');">';
|
474 |
-
html += option("video");
|
475 |
-
html += option("audio");
|
476 |
-
html += option("flash", "object");
|
477 |
-
html += option("quicktime", "object");
|
478 |
-
html += option("shockwave", "object");
|
479 |
-
html += option("windowsmedia", "object");
|
480 |
-
html += option("realmedia", "object");
|
481 |
-
html += option("iframe");
|
482 |
-
|
483 |
-
if (editor.getParam('media_embedded_audio', false)) {
|
484 |
-
html += option('embeddedaudio', "object");
|
485 |
-
}
|
486 |
-
|
487 |
-
html += '</select>';
|
488 |
-
return html;
|
489 |
-
},
|
490 |
-
|
491 |
-
setDefaultDialogSettings : function(editor) {
|
492 |
-
var defaultDialogSettings = editor.getParam("media_dialog_defaults", {});
|
493 |
-
tinymce.each(defaultDialogSettings, function(v, k) {
|
494 |
-
setVal(k, v);
|
495 |
-
});
|
496 |
-
}
|
497 |
-
};
|
498 |
-
|
499 |
-
tinyMCEPopup.requireLangPack();
|
500 |
-
tinyMCEPopup.onInit.add(function() {
|
501 |
-
Media.init();
|
502 |
-
});
|
503 |
-
})();
|
1 |
+
(function() {
|
2 |
+
var url;
|
3 |
+
|
4 |
+
if (url = tinyMCEPopup.getParam("media_external_list_url"))
|
5 |
+
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
6 |
+
|
7 |
+
function get(id) {
|
8 |
+
return document.getElementById(id);
|
9 |
+
}
|
10 |
+
|
11 |
+
function clone(obj) {
|
12 |
+
var i, len, copy, attr;
|
13 |
+
|
14 |
+
if (null == obj || "object" != typeof obj)
|
15 |
+
return obj;
|
16 |
+
|
17 |
+
// Handle Array
|
18 |
+
if ('length' in obj) {
|
19 |
+
copy = [];
|
20 |
+
|
21 |
+
for (i = 0, len = obj.length; i < len; ++i) {
|
22 |
+
copy[i] = clone(obj[i]);
|
23 |
+
}
|
24 |
+
|
25 |
+
return copy;
|
26 |
+
}
|
27 |
+
|
28 |
+
// Handle Object
|
29 |
+
copy = {};
|
30 |
+
for (attr in obj) {
|
31 |
+
if (obj.hasOwnProperty(attr))
|
32 |
+
copy[attr] = clone(obj[attr]);
|
33 |
+
}
|
34 |
+
|
35 |
+
return copy;
|
36 |
+
}
|
37 |
+
|
38 |
+
function getVal(id) {
|
39 |
+
var elm = get(id);
|
40 |
+
|
41 |
+
if (elm.nodeName == "SELECT")
|
42 |
+
return elm.options[elm.selectedIndex].value;
|
43 |
+
|
44 |
+
if (elm.type == "checkbox")
|
45 |
+
return elm.checked;
|
46 |
+
|
47 |
+
return elm.value;
|
48 |
+
}
|
49 |
+
|
50 |
+
function setVal(id, value, name) {
|
51 |
+
if (typeof(value) != 'undefined' && value != null) {
|
52 |
+
var elm = get(id);
|
53 |
+
|
54 |
+
if (elm.nodeName == "SELECT")
|
55 |
+
selectByValue(document.forms[0], id, value);
|
56 |
+
else if (elm.type == "checkbox") {
|
57 |
+
if (typeof(value) == 'string') {
|
58 |
+
value = value.toLowerCase();
|
59 |
+
value = (!name && value === 'true') || (name && value === name.toLowerCase());
|
60 |
+
}
|
61 |
+
elm.checked = !!value;
|
62 |
+
} else
|
63 |
+
elm.value = value;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
window.Media = {
|
68 |
+
init : function() {
|
69 |
+
var html, editor, self = this;
|
70 |
+
|
71 |
+
self.editor = editor = tinyMCEPopup.editor;
|
72 |
+
|
73 |
+
// Setup file browsers and color pickers
|
74 |
+
get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
|
75 |
+
get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media');
|
76 |
+
get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
|
77 |
+
get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media');
|
78 |
+
get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media');
|
79 |
+
get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media');
|
80 |
+
get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media');
|
81 |
+
get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media');
|
82 |
+
|
83 |
+
html = self.getMediaListHTML('medialist', 'src', 'media', 'media');
|
84 |
+
if (html == "")
|
85 |
+
get("linklistrow").style.display = 'none';
|
86 |
+
else
|
87 |
+
get("linklistcontainer").innerHTML = html;
|
88 |
+
|
89 |
+
if (isVisible('filebrowser'))
|
90 |
+
get('src').style.width = '230px';
|
91 |
+
|
92 |
+
if (isVisible('video_filebrowser_altsource1'))
|
93 |
+
get('video_altsource1').style.width = '220px';
|
94 |
+
|
95 |
+
if (isVisible('video_filebrowser_altsource2'))
|
96 |
+
get('video_altsource2').style.width = '220px';
|
97 |
+
|
98 |
+
if (isVisible('audio_filebrowser_altsource1'))
|
99 |
+
get('audio_altsource1').style.width = '220px';
|
100 |
+
|
101 |
+
if (isVisible('audio_filebrowser_altsource2'))
|
102 |
+
get('audio_altsource2').style.width = '220px';
|
103 |
+
|
104 |
+
if (isVisible('filebrowser_poster'))
|
105 |
+
get('video_poster').style.width = '220px';
|
106 |
+
|
107 |
+
editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor));
|
108 |
+
|
109 |
+
self.setDefaultDialogSettings(editor);
|
110 |
+
self.data = clone(tinyMCEPopup.getWindowArg('data'));
|
111 |
+
self.dataToForm();
|
112 |
+
self.preview();
|
113 |
+
|
114 |
+
updateColor('bgcolor_pick', 'bgcolor');
|
115 |
+
},
|
116 |
+
|
117 |
+
insert : function() {
|
118 |
+
var editor = tinyMCEPopup.editor;
|
119 |
+
|
120 |
+
this.formToData();
|
121 |
+
editor.execCommand('mceRepaint');
|
122 |
+
tinyMCEPopup.restoreSelection();
|
123 |
+
editor.selection.setNode(editor.plugins.media.dataToImg(this.data));
|
124 |
+
tinyMCEPopup.close();
|
125 |
+
},
|
126 |
+
|
127 |
+
preview : function() {
|
128 |
+
get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true);
|
129 |
+
},
|
130 |
+
|
131 |
+
moveStates : function(to_form, field) {
|
132 |
+
var data = this.data, editor = this.editor,
|
133 |
+
mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src;
|
134 |
+
|
135 |
+
defaultStates = {
|
136 |
+
// QuickTime
|
137 |
+
quicktime_autoplay : true,
|
138 |
+
quicktime_controller : true,
|
139 |
+
|
140 |
+
// Flash
|
141 |
+
flash_play : true,
|
142 |
+
flash_loop : true,
|
143 |
+
flash_menu : true,
|
144 |
+
|
145 |
+
// WindowsMedia
|
146 |
+
windowsmedia_autostart : true,
|
147 |
+
windowsmedia_enablecontextmenu : true,
|
148 |
+
windowsmedia_invokeurls : true,
|
149 |
+
|
150 |
+
// RealMedia
|
151 |
+
realmedia_autogotourl : true,
|
152 |
+
realmedia_imagestatus : true
|
153 |
+
};
|
154 |
+
|
155 |
+
function parseQueryParams(str) {
|
156 |
+
var out = {};
|
157 |
+
|
158 |
+
if (str) {
|
159 |
+
tinymce.each(str.split('&'), function(item) {
|
160 |
+
var parts = item.split('=');
|
161 |
+
|
162 |
+
out[unescape(parts[0])] = unescape(parts[1]);
|
163 |
+
});
|
164 |
+
}
|
165 |
+
|
166 |
+
return out;
|
167 |
+
};
|
168 |
+
|
169 |
+
function setOptions(type, names) {
|
170 |
+
var i, name, formItemName, value, list;
|
171 |
+
|
172 |
+
if (type == data.type || type == 'global') {
|
173 |
+
names = tinymce.explode(names);
|
174 |
+
for (i = 0; i < names.length; i++) {
|
175 |
+
name = names[i];
|
176 |
+
formItemName = type == 'global' ? name : type + '_' + name;
|
177 |
+
|
178 |
+
if (type == 'global')
|
179 |
+
list = data;
|
180 |
+
else if (type == 'video' || type == 'audio') {
|
181 |
+
list = data.video.attrs;
|
182 |
+
|
183 |
+
if (!list && !to_form)
|
184 |
+
data.video.attrs = list = {};
|
185 |
+
} else
|
186 |
+
list = data.params;
|
187 |
+
|
188 |
+
if (list) {
|
189 |
+
if (to_form) {
|
190 |
+
setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : '');
|
191 |
+
} else {
|
192 |
+
delete list[name];
|
193 |
+
|
194 |
+
value = getVal(formItemName);
|
195 |
+
if ((type == 'video' || type == 'audio') && value === true)
|
196 |
+
value = name;
|
197 |
+
|
198 |
+
if (defaultStates[formItemName]) {
|
199 |
+
if (value !== defaultStates[formItemName]) {
|
200 |
+
value = "" + value;
|
201 |
+
list[name] = value;
|
202 |
+
}
|
203 |
+
} else if (value) {
|
204 |
+
value = "" + value;
|
205 |
+
list[name] = value;
|
206 |
+
}
|
207 |
+
}
|
208 |
+
}
|
209 |
+
}
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
if (!to_form) {
|
214 |
+
data.type = get('media_type').options[get('media_type').selectedIndex].value;
|
215 |
+
data.width = getVal('width');
|
216 |
+
data.height = getVal('height');
|
217 |
+
|
218 |
+
// Switch type based on extension
|
219 |
+
src = getVal('src');
|
220 |
+
if (field == 'src') {
|
221 |
+
ext = src.replace(/^.*\.([^.]+)$/, '$1');
|
222 |
+
if (typeInfo = mediaPlugin.getType(ext))
|
223 |
+
data.type = typeInfo.name.toLowerCase();
|
224 |
+
|
225 |
+
setVal('media_type', data.type);
|
226 |
+
}
|
227 |
+
|
228 |
+
if (data.type == "video" || data.type == "audio") {
|
229 |
+
if (!data.video.sources)
|
230 |
+
data.video.sources = [];
|
231 |
+
|
232 |
+
data.video.sources[0] = {src: getVal('src')};
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
// Hide all fieldsets and show the one active
|
237 |
+
get('video_options').style.display = 'none';
|
238 |
+
get('audio_options').style.display = 'none';
|
239 |
+
get('flash_options').style.display = 'none';
|
240 |
+
get('quicktime_options').style.display = 'none';
|
241 |
+
get('shockwave_options').style.display = 'none';
|
242 |
+
get('windowsmedia_options').style.display = 'none';
|
243 |
+
get('realmedia_options').style.display = 'none';
|
244 |
+
get('embeddedaudio_options').style.display = 'none';
|
245 |
+
|
246 |
+
if (get(data.type + '_options'))
|
247 |
+
get(data.type + '_options').style.display = 'block';
|
248 |
+
|
249 |
+
setVal('media_type', data.type);
|
250 |
+
|
251 |
+
setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars');
|
252 |
+
setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc');
|
253 |
+
setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign');
|
254 |
+
setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume');
|
255 |
+
setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks');
|
256 |
+
setOptions('video', 'poster,autoplay,loop,muted,preload,controls');
|
257 |
+
setOptions('audio', 'autoplay,loop,preload,controls');
|
258 |
+
setOptions('embeddedaudio', 'autoplay,loop,controls');
|
259 |
+
setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height');
|
260 |
+
|
261 |
+
if (to_form) {
|
262 |
+
if (data.type == 'video') {
|
263 |
+
if (data.video.sources[0])
|
264 |
+
setVal('src', data.video.sources[0].src);
|
265 |
+
|
266 |
+
src = data.video.sources[1];
|
267 |
+
if (src)
|
268 |
+
setVal('video_altsource1', src.src);
|
269 |
+
|
270 |
+
src = data.video.sources[2];
|
271 |
+
if (src)
|
272 |
+
setVal('video_altsource2', src.src);
|
273 |
+
} else if (data.type == 'audio') {
|
274 |
+
if (data.video.sources[0])
|
275 |
+
setVal('src', data.video.sources[0].src);
|
276 |
+
|
277 |
+
src = data.video.sources[1];
|
278 |
+
if (src)
|
279 |
+
setVal('audio_altsource1', src.src);
|
280 |
+
|
281 |
+
src = data.video.sources[2];
|
282 |
+
if (src)
|
283 |
+
setVal('audio_altsource2', src.src);
|
284 |
+
} else {
|
285 |
+
// Check flash vars
|
286 |
+
if (data.type == 'flash') {
|
287 |
+
tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) {
|
288 |
+
if (value == '$url')
|
289 |
+
data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || '';
|
290 |
+
});
|
291 |
+
}
|
292 |
+
|
293 |
+
setVal('src', data.params.src);
|
294 |
+
}
|
295 |
+
} else {
|
296 |
+
src = getVal("src");
|
297 |
+
|
298 |
+
// YouTube *NEW*
|
299 |
+
if (src.match(/youtu.be\/[a-z1-9.-_]+/)) {
|
300 |
+
data.width = 425;
|
301 |
+
data.height = 350;
|
302 |
+
data.params.frameborder = '0';
|
303 |
+
data.type = 'iframe';
|
304 |
+
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
|
305 |
+
setVal('src', src);
|
306 |
+
setVal('media_type', data.type);
|
307 |
+
}
|
308 |
+
|
309 |
+
// YouTube
|
310 |
+
if (src.match(/youtube.com(.+)v=([^&]+)/)) {
|
311 |
+
data.width = 425;
|
312 |
+
data.height = 350;
|
313 |
+
data.params.frameborder = '0';
|
314 |
+
data.type = 'iframe';
|
315 |
+
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
|
316 |
+
setVal('src', src);
|
317 |
+
setVal('media_type', data.type);
|
318 |
+
}
|
319 |
+
|
320 |
+
// Google video
|
321 |
+
if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
|
322 |
+
data.width = 425;
|
323 |
+
data.height = 326;
|
324 |
+
data.type = 'flash';
|
325 |
+
src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en';
|
326 |
+
setVal('src', src);
|
327 |
+
setVal('media_type', data.type);
|
328 |
+
}
|
329 |
+
|
330 |
+
// Vimeo
|
331 |
+
if (src.match(/vimeo.com\/([0-9]+)/)) {
|
332 |
+
data.width = 425;
|
333 |
+
data.height = 350;
|
334 |
+
data.params.frameborder = '0';
|
335 |
+
data.type = 'iframe';
|
336 |
+
src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1];
|
337 |
+
setVal('src', src);
|
338 |
+
setVal('media_type', data.type);
|
339 |
+
}
|
340 |
+
|
341 |
+
// stream.cz
|
342 |
+
if (src.match(/stream.cz\/((?!object).)*\/([0-9]+)/)) {
|
343 |
+
data.width = 425;
|
344 |
+
data.height = 350;
|
345 |
+
data.params.frameborder = '0';
|
346 |
+
data.type = 'iframe';
|
347 |
+
src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1];
|
348 |
+
setVal('src', src);
|
349 |
+
setVal('media_type', data.type);
|
350 |
+
}
|
351 |
+
|
352 |
+
// Google maps
|
353 |
+
if (src.match(/maps.google.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) {
|
354 |
+
data.width = 425;
|
355 |
+
data.height = 350;
|
356 |
+
data.params.frameborder = '0';
|
357 |
+
data.type = 'iframe';
|
358 |
+
src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed";
|
359 |
+
setVal('src', src);
|
360 |
+
setVal('media_type', data.type);
|
361 |
+
}
|
362 |
+
|
363 |
+
if (data.type == 'video') {
|
364 |
+
if (!data.video.sources)
|
365 |
+
data.video.sources = [];
|
366 |
+
|
367 |
+
data.video.sources[0] = {src : src};
|
368 |
+
|
369 |
+
src = getVal("video_altsource1");
|
370 |
+
if (src)
|
371 |
+
data.video.sources[1] = {src : src};
|
372 |
+
|
373 |
+
src = getVal("video_altsource2");
|
374 |
+
if (src)
|
375 |
+
data.video.sources[2] = {src : src};
|
376 |
+
} else if (data.type == 'audio') {
|
377 |
+
if (!data.video.sources)
|
378 |
+
data.video.sources = [];
|
379 |
+
|
380 |
+
data.video.sources[0] = {src : src};
|
381 |
+
|
382 |
+
src = getVal("audio_altsource1");
|
383 |
+
if (src)
|
384 |
+
data.video.sources[1] = {src : src};
|
385 |
+
|
386 |
+
src = getVal("audio_altsource2");
|
387 |
+
if (src)
|
388 |
+
data.video.sources[2] = {src : src};
|
389 |
+
} else
|
390 |
+
data.params.src = src;
|
391 |
+
|
392 |
+
// Set default size
|
393 |
+
setVal('width', data.width || (data.type == 'audio' ? 300 : 320));
|
394 |
+
setVal('height', data.height || (data.type == 'audio' ? 32 : 240));
|
395 |
+
}
|
396 |
+
},
|
397 |
+
|
398 |
+
dataToForm : function() {
|
399 |
+
this.moveStates(true);
|
400 |
+
},
|
401 |
+
|
402 |
+
formToData : function(field) {
|
403 |
+
if (field == "width" || field == "height")
|
404 |
+
this.changeSize(field);
|
405 |
+
|
406 |
+
if (field == 'source') {
|
407 |
+
this.moveStates(false, field);
|
408 |
+
setVal('source', this.editor.plugins.media.dataToHtml(this.data));
|
409 |
+
this.panel = 'source';
|
410 |
+
} else {
|
411 |
+
if (this.panel == 'source') {
|
412 |
+
this.data = clone(this.editor.plugins.media.htmlToData(getVal('source')));
|
413 |
+
this.dataToForm();
|
414 |
+
this.panel = '';
|
415 |
+
}
|
416 |
+
|
417 |
+
this.moveStates(false, field);
|
418 |
+
this.preview();
|
419 |
+
}
|
420 |
+
},
|
421 |
+
|
422 |
+
beforeResize : function() {
|
423 |
+
this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);
|
424 |
+
this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);
|
425 |
+
},
|
426 |
+
|
427 |
+
changeSize : function(type) {
|
428 |
+
var width, height, scale, size;
|
429 |
+
|
430 |
+
if (get('constrain').checked) {
|
431 |
+
width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);
|
432 |
+
height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);
|
433 |
+
|
434 |
+
if (type == 'width') {
|
435 |
+
this.height = Math.round((width / this.width) * height);
|
436 |
+
setVal('height', this.height);
|
437 |
+
} else {
|
438 |
+
this.width = Math.round((height / this.height) * width);
|
439 |
+
setVal('width', this.width);
|
440 |
+
}
|
441 |
+
}
|
442 |
+
},
|
443 |
+
|
444 |
+
getMediaListHTML : function() {
|
445 |
+
if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
|
446 |
+
var html = "";
|
447 |
+
|
448 |
+
html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;Media.formToData(\'src\');">';
|
449 |
+
html += '<option value="">---</option>';
|
450 |
+
|
451 |
+
for (var i=0; i<tinyMCEMediaList.length; i++)
|
452 |
+
html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
|
453 |
+
|
454 |
+
html += '</select>';
|
455 |
+
|
456 |
+
return html;
|
457 |
+
}
|
458 |
+
|
459 |
+
return "";
|
460 |
+
},
|
461 |
+
|
462 |
+
getMediaTypeHTML : function(editor) {
|
463 |
+
function option(media_type, element) {
|
464 |
+
if (!editor.schema.getElementRule(element || media_type)) {
|
465 |
+
return '';
|
466 |
+
}
|
467 |
+
|
468 |
+
return '<option value="'+media_type+'">'+tinyMCEPopup.editor.translate("media_dlg."+media_type)+'</option>'
|
469 |
+
}
|
470 |
+
|
471 |
+
var html = "";
|
472 |
+
|
473 |
+
html += '<select id="media_type" name="media_type" onchange="Media.formToData(\'type\');">';
|
474 |
+
html += option("video");
|
475 |
+
html += option("audio");
|
476 |
+
html += option("flash", "object");
|
477 |
+
html += option("quicktime", "object");
|
478 |
+
html += option("shockwave", "object");
|
479 |
+
html += option("windowsmedia", "object");
|
480 |
+
html += option("realmedia", "object");
|
481 |
+
html += option("iframe");
|
482 |
+
|
483 |
+
if (editor.getParam('media_embedded_audio', false)) {
|
484 |
+
html += option('embeddedaudio', "object");
|
485 |
+
}
|
486 |
+
|
487 |
+
html += '</select>';
|
488 |
+
return html;
|
489 |
+
},
|
490 |
+
|
491 |
+
setDefaultDialogSettings : function(editor) {
|
492 |
+
var defaultDialogSettings = editor.getParam("media_dialog_defaults", {});
|
493 |
+
tinymce.each(defaultDialogSettings, function(v, k) {
|
494 |
+
setVal(k, v);
|
495 |
+
});
|
496 |
+
}
|
497 |
+
};
|
498 |
+
|
499 |
+
tinyMCEPopup.requireLangPack();
|
500 |
+
tinyMCEPopup.onInit.add(function() {
|
501 |
+
Media.init();
|
502 |
+
});
|
503 |
+
})();
|
js/libraries/tiny_mce/plugins/media/media.htm
CHANGED
@@ -1,922 +1,922 @@
|
|
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 |
-
</head>
|
13 |
-
<body style="display: none" role="application">
|
14 |
-
<form onsubmit="Media.insert();return false;" action="#">
|
15 |
-
<div class="tabs" role="presentation">
|
16 |
-
<ul>
|
17 |
-
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.general}</a></span></li>
|
18 |
-
<li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>
|
19 |
-
<li id="source_tab" aria-controls="source_panel"><span><a href="javascript:mcTabs.displayTab('source_tab','source_panel');Media.formToData('source');" onmousedown="return false;">{#media_dlg.source}</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 role="presentation" 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"></select>
|
33 |
-
</td>
|
34 |
-
</tr>
|
35 |
-
<tr>
|
36 |
-
<td><label for="src">{#media_dlg.file}</label></td>
|
37 |
-
<td>
|
38 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
39 |
-
<tr>
|
40 |
-
<td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="Media.formToData();" /></td>
|
41 |
-
<td id="filebrowsercontainer"> </td>
|
42 |
-
</tr>
|
43 |
-
</table>
|
44 |
-
</td>
|
45 |
-
</tr>
|
46 |
-
<tr id="linklistrow">
|
47 |
-
<td><label for="linklist">{#media_dlg.list}</label></td>
|
48 |
-
<td id="linklistcontainer"><select id="linklist"><option value=""></option></select></td>
|
49 |
-
</tr>
|
50 |
-
<tr>
|
51 |
-
<td><label for="width">{#media_dlg.size}</label></td>
|
52 |
-
<td>
|
53 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
54 |
-
<tr>
|
55 |
-
<td><input type="text" id="width" name="width" value="" class="size" onchange="Media.formToData('width');" onfocus="Media.beforeResize();" /> x <input type="text" id="height" name="height" value="" class="size" onfocus="Media.beforeResize();" onchange="Media.formToData('height');" /></td>
|
56 |
-
<td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" checked="checked" /></td>
|
57 |
-
<td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>
|
58 |
-
</tr>
|
59 |
-
</table>
|
60 |
-
</td>
|
61 |
-
</tr>
|
62 |
-
</table>
|
63 |
-
</fieldset>
|
64 |
-
|
65 |
-
<fieldset>
|
66 |
-
<legend>{#media_dlg.preview}</legend>
|
67 |
-
<div id="prev"></div>
|
68 |
-
</fieldset>
|
69 |
-
</div>
|
70 |
-
|
71 |
-
<div id="advanced_panel" class="panel">
|
72 |
-
<fieldset>
|
73 |
-
<legend>{#media_dlg.advanced}</legend>
|
74 |
-
|
75 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
|
76 |
-
<tr>
|
77 |
-
<td><label for="id">{#media_dlg.id}</label></td>
|
78 |
-
<td><input type="text" id="id" name="id" onchange="Media.formToData();" /></td>
|
79 |
-
<td><label for="name">{#media_dlg.name}</label></td>
|
80 |
-
<td><input type="text" id="name" name="name" onchange="Media.formToData();" /></td>
|
81 |
-
</tr>
|
82 |
-
|
83 |
-
<tr>
|
84 |
-
<td><label for="align">{#media_dlg.align}</label></td>
|
85 |
-
<td>
|
86 |
-
<select id="align" name="align" onchange="Media.formToData();">
|
87 |
-
<option value="">{#not_set}</option>
|
88 |
-
<option value="top">{#media_dlg.align_top}</option>
|
89 |
-
<option value="right">{#media_dlg.align_right}</option>
|
90 |
-
<option value="bottom">{#media_dlg.align_bottom}</option>
|
91 |
-
<option value="left">{#media_dlg.align_left}</option>
|
92 |
-
</select>
|
93 |
-
</td>
|
94 |
-
|
95 |
-
<td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>
|
96 |
-
<td>
|
97 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
98 |
-
<tr>
|
99 |
-
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');Media.formToData();" /></td>
|
100 |
-
<td id="bgcolor_pickcontainer"> </td>
|
101 |
-
</tr>
|
102 |
-
</table>
|
103 |
-
</td>
|
104 |
-
</tr>
|
105 |
-
|
106 |
-
<tr>
|
107 |
-
<td><label for="vspace">{#media_dlg.vspace}</label></td>
|
108 |
-
<td><input type="text" id="vspace" name="vspace" class="number" onchange="Media.formToData();" /></td>
|
109 |
-
<td><label for="hspace">{#media_dlg.hspace}</label></td>
|
110 |
-
<td><input type="text" id="hspace" name="hspace" class="number" onchange="Media.formToData();" /></td>
|
111 |
-
</tr>
|
112 |
-
</table>
|
113 |
-
</fieldset>
|
114 |
-
|
115 |
-
<fieldset id="video_options">
|
116 |
-
<legend>{#media_dlg.html5_video_options}</legend>
|
117 |
-
|
118 |
-
<table role="presentation">
|
119 |
-
<tr>
|
120 |
-
<td><label for="video_altsource1">{#media_dlg.altsource1}</label></td>
|
121 |
-
<td>
|
122 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
123 |
-
<tr>
|
124 |
-
<td><input type="text" id="video_altsource1" name="video_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>
|
125 |
-
<td id="video_altsource1_filebrowser"> </td>
|
126 |
-
</tr>
|
127 |
-
</table>
|
128 |
-
</td>
|
129 |
-
</tr>
|
130 |
-
|
131 |
-
<tr>
|
132 |
-
<td><label for="video_altsource2">{#media_dlg.altsource2}</label></td>
|
133 |
-
<td>
|
134 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
135 |
-
<tr>
|
136 |
-
<td><input type="text" id="video_altsource2" name="video_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>
|
137 |
-
<td id="video_altsource2_filebrowser"> </td>
|
138 |
-
</tr>
|
139 |
-
</table>
|
140 |
-
</td>
|
141 |
-
</tr>
|
142 |
-
|
143 |
-
<tr>
|
144 |
-
<td><label for="video_poster">{#media_dlg.poster}</label></td>
|
145 |
-
<td>
|
146 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
147 |
-
<tr>
|
148 |
-
<td><input type="text" id="video_poster" name="video_poster" onchange="Media.formToData();" style="width: 240px" /></td>
|
149 |
-
<td id="video_poster_filebrowser"> </td>
|
150 |
-
</tr>
|
151 |
-
</table>
|
152 |
-
</td>
|
153 |
-
</tr>
|
154 |
-
|
155 |
-
<tr>
|
156 |
-
<td><label for="video_preload">{#media_dlg.preload}</label></td>
|
157 |
-
<td>
|
158 |
-
<select id="video_preload" name="video_preload" onchange="Media.formToData();">
|
159 |
-
<option value="none">{#media_dlg.preload_none}</option>
|
160 |
-
<option value="metadata">{#media_dlg.preload_metadata}</option>
|
161 |
-
<option value="auto">{#media_dlg.preload_auto}</option>
|
162 |
-
</select>
|
163 |
-
</td>
|
164 |
-
</tr>
|
165 |
-
</table>
|
166 |
-
|
167 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
168 |
-
<tr>
|
169 |
-
<td>
|
170 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
171 |
-
<tr>
|
172 |
-
<td><input type="checkbox" class="checkbox" id="video_autoplay" name="video_autoplay" onchange="Media.formToData();" /></td>
|
173 |
-
<td><label for="video_autoplay">{#media_dlg.play}</label></td>
|
174 |
-
</tr>
|
175 |
-
</table>
|
176 |
-
</td>
|
177 |
-
|
178 |
-
<td>
|
179 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
180 |
-
<tr>
|
181 |
-
<td><input type="checkbox" class="checkbox" id="video_muted" name="video_muted" onchange="Media.formToData();" /></td>
|
182 |
-
<td><label for="video_muted">{#media_dlg.mute}</label></td>
|
183 |
-
</tr>
|
184 |
-
</table>
|
185 |
-
</td>
|
186 |
-
|
187 |
-
<td>
|
188 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
189 |
-
<tr>
|
190 |
-
<td><input type="checkbox" class="checkbox" id="video_loop" name="video_loop" onchange="Media.formToData();" /></td>
|
191 |
-
<td><label for="video_loop">{#media_dlg.loop}</label></td>
|
192 |
-
</tr>
|
193 |
-
</table>
|
194 |
-
</td>
|
195 |
-
|
196 |
-
<td>
|
197 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
198 |
-
<tr>
|
199 |
-
<td><input type="checkbox" class="checkbox" id="video_controls" name="video_controls" onchange="Media.formToData();" /></td>
|
200 |
-
<td><label for="video_controls">{#media_dlg.controls}</label></td>
|
201 |
-
</tr>
|
202 |
-
</table>
|
203 |
-
</td>
|
204 |
-
</tr>
|
205 |
-
</table>
|
206 |
-
</fieldset>
|
207 |
-
|
208 |
-
<fieldset id="embeddedaudio_options">
|
209 |
-
<legend>{#media_dlg.embedded_audio_options}</legend>
|
210 |
-
|
211 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
212 |
-
<tr>
|
213 |
-
<td>
|
214 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
215 |
-
<tr>
|
216 |
-
<td><input type="checkbox" class="checkbox" id="embeddedaudio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>
|
217 |
-
<td><label for="audio_autoplay">{#media_dlg.play}</label></td>
|
218 |
-
</tr>
|
219 |
-
</table>
|
220 |
-
</td>
|
221 |
-
|
222 |
-
<td>
|
223 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
224 |
-
<tr>
|
225 |
-
<td><input type="checkbox" class="checkbox" id="embeddedaudio_loop" name="audio_loop" onchange="Media.formToData();" /></td>
|
226 |
-
<td><label for="audio_loop">{#media_dlg.loop}</label></td>
|
227 |
-
</tr>
|
228 |
-
</table>
|
229 |
-
</td>
|
230 |
-
|
231 |
-
<td>
|
232 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
233 |
-
<tr>
|
234 |
-
<td><input type="checkbox" class="checkbox" id="embeddedaudio_controls" name="audio_controls" onchange="Media.formToData();" /></td>
|
235 |
-
<td><label for="audio_controls">{#media_dlg.controls}</label></td>
|
236 |
-
</tr>
|
237 |
-
</table>
|
238 |
-
</td>
|
239 |
-
</tr>
|
240 |
-
</table>
|
241 |
-
</fieldset>
|
242 |
-
|
243 |
-
<fieldset id="audio_options">
|
244 |
-
<legend>{#media_dlg.html5_audio_options}</legend>
|
245 |
-
|
246 |
-
<table role="presentation">
|
247 |
-
<tr>
|
248 |
-
<td><label for="audio_altsource1">{#media_dlg.altsource1}</label></td>
|
249 |
-
<td>
|
250 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
251 |
-
<tr>
|
252 |
-
<td><input type="text" id="audio_altsource1" name="audio_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>
|
253 |
-
<td id="audio_altsource1_filebrowser"> </td>
|
254 |
-
</tr>
|
255 |
-
</table>
|
256 |
-
</td>
|
257 |
-
</tr>
|
258 |
-
|
259 |
-
<tr>
|
260 |
-
<td><label for="audio_altsource2">{#media_dlg.altsource2}</label></td>
|
261 |
-
<td>
|
262 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
263 |
-
<tr>
|
264 |
-
<td><input type="text" id="audio_altsource2" name="audio_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>
|
265 |
-
<td id="audio_altsource2_filebrowser"> </td>
|
266 |
-
</tr>
|
267 |
-
</table>
|
268 |
-
</td>
|
269 |
-
</tr>
|
270 |
-
|
271 |
-
<tr>
|
272 |
-
<td><label for="audio_preload">{#media_dlg.preload}</label></td>
|
273 |
-
<td>
|
274 |
-
<select id="audio_preload" name="audio_preload" onchange="Media.formToData();">
|
275 |
-
<option value="none">{#media_dlg.preload_none}</option>
|
276 |
-
<option value="metadata">{#media_dlg.preload_metadata}</option>
|
277 |
-
<option value="auto">{#media_dlg.preload_auto}</option>
|
278 |
-
</select>
|
279 |
-
</td>
|
280 |
-
</tr>
|
281 |
-
</table>
|
282 |
-
|
283 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
284 |
-
<tr>
|
285 |
-
<td>
|
286 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
287 |
-
<tr>
|
288 |
-
<td><input type="checkbox" class="checkbox" id="audio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>
|
289 |
-
<td><label for="audio_autoplay">{#media_dlg.play}</label></td>
|
290 |
-
</tr>
|
291 |
-
</table>
|
292 |
-
</td>
|
293 |
-
|
294 |
-
<td>
|
295 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
296 |
-
<tr>
|
297 |
-
<td><input type="checkbox" class="checkbox" id="audio_loop" name="audio_loop" onchange="Media.formToData();" /></td>
|
298 |
-
<td><label for="audio_loop">{#media_dlg.loop}</label></td>
|
299 |
-
</tr>
|
300 |
-
</table>
|
301 |
-
</td>
|
302 |
-
|
303 |
-
<td>
|
304 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
305 |
-
<tr>
|
306 |
-
<td><input type="checkbox" class="checkbox" id="audio_controls" name="audio_controls" onchange="Media.formToData();" /></td>
|
307 |
-
<td><label for="audio_controls">{#media_dlg.controls}</label></td>
|
308 |
-
</tr>
|
309 |
-
</table>
|
310 |
-
</td>
|
311 |
-
</tr>
|
312 |
-
</table>
|
313 |
-
</fieldset>
|
314 |
-
|
315 |
-
<fieldset id="flash_options">
|
316 |
-
<legend>{#media_dlg.flash_options}</legend>
|
317 |
-
|
318 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
319 |
-
<tr>
|
320 |
-
<td><label for="flash_quality">{#media_dlg.quality}</label></td>
|
321 |
-
<td>
|
322 |
-
<select id="flash_quality" name="flash_quality" onchange="Media.formToData();">
|
323 |
-
<option value="">{#not_set}</option>
|
324 |
-
<option value="high">high</option>
|
325 |
-
<option value="low">low</option>
|
326 |
-
<option value="autolow">autolow</option>
|
327 |
-
<option value="autohigh">autohigh</option>
|
328 |
-
<option value="best">best</option>
|
329 |
-
</select>
|
330 |
-
</td>
|
331 |
-
|
332 |
-
<td><label for="flash_scale">{#media_dlg.scale}</label></td>
|
333 |
-
<td>
|
334 |
-
<select id="flash_scale" name="flash_scale" onchange="Media.formToData();">
|
335 |
-
<option value="">{#not_set}</option>
|
336 |
-
<option value="showall">showall</option>
|
337 |
-
<option value="noborder">noborder</option>
|
338 |
-
<option value="exactfit">exactfit</option>
|
339 |
-
<option value="noscale">noscale</option>
|
340 |
-
</select>
|
341 |
-
</td>
|
342 |
-
</tr>
|
343 |
-
|
344 |
-
<tr>
|
345 |
-
<td><label for="flash_wmode">{#media_dlg.wmode}</label></td>
|
346 |
-
<td>
|
347 |
-
<select id="flash_wmode" name="flash_wmode" onchange="Media.formToData();">
|
348 |
-
<option value="">{#not_set}</option>
|
349 |
-
<option value="window">window</option>
|
350 |
-
<option value="opaque">opaque</option>
|
351 |
-
<option value="transparent">transparent</option>
|
352 |
-
</select>
|
353 |
-
</td>
|
354 |
-
|
355 |
-
<td><label for="flash_salign">{#media_dlg.salign}</label></td>
|
356 |
-
<td>
|
357 |
-
<select id="flash_salign" name="flash_salign" onchange="Media.formToData();">
|
358 |
-
<option value="">{#not_set}</option>
|
359 |
-
<option value="l">{#media_dlg.align_left}</option>
|
360 |
-
<option value="t">{#media_dlg.align_top}</option>
|
361 |
-
<option value="r">{#media_dlg.align_right}</option>
|
362 |
-
<option value="b">{#media_dlg.align_bottom}</option>
|
363 |
-
<option value="tl">{#media_dlg.align_top_left}</option>
|
364 |
-
<option value="tr">{#media_dlg.align_top_right}</option>
|
365 |
-
<option value="bl">{#media_dlg.align_bottom_left}</option>
|
366 |
-
<option value="br">{#media_dlg.align_bottom_right}</option>
|
367 |
-
</select>
|
368 |
-
</td>
|
369 |
-
</tr>
|
370 |
-
|
371 |
-
<tr>
|
372 |
-
<td colspan="2">
|
373 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
374 |
-
<tr>
|
375 |
-
<td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="Media.formToData();" /></td>
|
376 |
-
<td><label for="flash_play">{#media_dlg.play}</label></td>
|
377 |
-
</tr>
|
378 |
-
</table>
|
379 |
-
</td>
|
380 |
-
|
381 |
-
<td colspan="2">
|
382 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
383 |
-
<tr>
|
384 |
-
<td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="Media.formToData();" /></td>
|
385 |
-
<td><label for="flash_loop">{#media_dlg.loop}</label></td>
|
386 |
-
</tr>
|
387 |
-
</table>
|
388 |
-
</td>
|
389 |
-
</tr>
|
390 |
-
|
391 |
-
<tr>
|
392 |
-
<td colspan="2">
|
393 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
394 |
-
<tr>
|
395 |
-
<td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="Media.formToData();" /></td>
|
396 |
-
<td><label for="flash_menu">{#media_dlg.menu}</label></td>
|
397 |
-
</tr>
|
398 |
-
</table>
|
399 |
-
</td>
|
400 |
-
|
401 |
-
<td colspan="2">
|
402 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
403 |
-
<tr>
|
404 |
-
<td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="Media.formToData();" /></td>
|
405 |
-
<td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>
|
406 |
-
</tr>
|
407 |
-
</table>
|
408 |
-
</td>
|
409 |
-
</tr>
|
410 |
-
</table>
|
411 |
-
|
412 |
-
<table role="presentation">
|
413 |
-
<tr>
|
414 |
-
<td><label for="flash_base">{#media_dlg.base}</label></td>
|
415 |
-
<td><input type="text" id="flash_base" name="flash_base" onchange="Media.formToData();" /></td>
|
416 |
-
</tr>
|
417 |
-
|
418 |
-
<tr>
|
419 |
-
<td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>
|
420 |
-
<td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="Media.formToData();" /></td>
|
421 |
-
</tr>
|
422 |
-
</table>
|
423 |
-
</fieldset>
|
424 |
-
|
425 |
-
<fieldset id="quicktime_options">
|
426 |
-
<legend>{#media_dlg.qt_options}</legend>
|
427 |
-
|
428 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
429 |
-
<tr>
|
430 |
-
<td colspan="2">
|
431 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
432 |
-
<tr>
|
433 |
-
<td><input type="checkbox" class="checkbox" id="quicktime_loop" name="quicktime_loop" onchange="Media.formToData();" /></td>
|
434 |
-
<td><label for="quicktime_loop">{#media_dlg.loop}</label></td>
|
435 |
-
</tr>
|
436 |
-
</table>
|
437 |
-
</td>
|
438 |
-
|
439 |
-
<td colspan="2">
|
440 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
441 |
-
<tr>
|
442 |
-
<td><input type="checkbox" class="checkbox" id="quicktime_autoplay" name="quicktime_autoplay" checked="checked" onchange="Media.formToData();" /></td>
|
443 |
-
<td><label for="quicktime_autoplay">{#media_dlg.play}</label></td>
|
444 |
-
</tr>
|
445 |
-
</table>
|
446 |
-
</td>
|
447 |
-
</tr>
|
448 |
-
|
449 |
-
<tr>
|
450 |
-
<td colspan="2">
|
451 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
452 |
-
<tr>
|
453 |
-
<td><input type="checkbox" class="checkbox" id="quicktime_cache" name="quicktime_cache" onchange="Media.formToData();" /></td>
|
454 |
-
<td><label for="quicktime_cache">{#media_dlg.cache}</label></td>
|
455 |
-
</tr>
|
456 |
-
</table>
|
457 |
-
</td>
|
458 |
-
|
459 |
-
<td colspan="2">
|
460 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
461 |
-
<tr>
|
462 |
-
<td><input type="checkbox" class="checkbox" id="quicktime_controller" name="quicktime_controller" checked="checked" onchange="Media.formToData();" /></td>
|
463 |
-
<td><label for="quicktime_controller">{#media_dlg.controller}</label></td>
|
464 |
-
</tr>
|
465 |
-
</table>
|
466 |
-
</td>
|
467 |
-
</tr>
|
468 |
-
|
469 |
-
<tr>
|
470 |
-
<td colspan="2">
|
471 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
472 |
-
<tr>
|
473 |
-
<td><input type="checkbox" class="checkbox" id="quicktime_correction" name="quicktime_correction" onchange="Media.formToData();" /></td>
|
474 |
-
<td><label for="quicktime_correction">{#media_dlg.correction}</label></td>
|
475 |
-
</tr>
|
476 |
-
</table>
|
477 |
-
</td>
|
478 |
-
|
479 |
-
<td colspan="2">
|
480 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
481 |
-
<tr>
|
482 |
-
<td><input type="checkbox" class="checkbox" id="quicktime_enablejavascript" name="quicktime_enablejavascript" onchange="Media.formToData();" /></td>
|
483 |
-
<td><label for="quicktime_enablejavascript">{#media_dlg.enablejavascript}</label></td>
|
484 |
-
</tr>
|
485 |
-
</table>
|
486 |
-
</td>
|
487 |
-
</tr>
|
488 |
-
|
489 |
-
<tr>
|
490 |
-
<td colspan="2">
|
491 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
492 |
-
<tr>
|
493 |
-
<td><input type="checkbox" class="checkbox" id="quicktime_kioskmode" name="quicktime_kioskmode" onchange="Media.formToData();" /></td>
|
494 |
-
<td><label for="quicktime_kioskmode">{#media_dlg.kioskmode}</label></td>
|
495 |
-
</tr>
|
496 |
-
</table>
|
497 |
-
</td>
|
498 |
-
|
499 |
-
<td colspan="2">
|
500 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
501 |
-
<tr>
|
502 |
-
<td><input type="checkbox" class="checkbox" id="quicktime_autohref" name="quicktime_autohref" onchange="Media.formToData();" /></td>
|
503 |
-
<td><label for="quicktime_autohref">{#media_dlg.autohref}</label></td>
|
504 |
-
</tr>
|
505 |
-
</table>
|
506 |
-
</td>
|
507 |
-
</tr>
|
508 |
-
|
509 |
-
<tr>
|
510 |
-
<td colspan="2">
|
511 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
512 |
-
<tr>
|
513 |
-
<td><input type="checkbox" class="checkbox" id="quicktime_playeveryframe" name="quicktime_playeveryframe" onchange="Media.formToData();" /></td>
|
514 |
-
<td><label for="quicktime_playeveryframe">{#media_dlg.playeveryframe}</label></td>
|
515 |
-
</tr>
|
516 |
-
</table>
|
517 |
-
</td>
|
518 |
-
|
519 |
-
<td colspan="2">
|
520 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
521 |
-
<tr>
|
522 |
-
<td><input type="checkbox" class="checkbox" id="quicktime_targetcache" name="quicktime_targetcache" onchange="Media.formToData();" /></td>
|
523 |
-
<td><label for="quicktime_targetcache">{#media_dlg.targetcache}</label></td>
|
524 |
-
</tr>
|
525 |
-
</table>
|
526 |
-
</td>
|
527 |
-
</tr>
|
528 |
-
|
529 |
-
<tr>
|
530 |
-
<td><label for="quicktime_scale">{#media_dlg.scale}</label></td>
|
531 |
-
<td><select id="quicktime_scale" name="quicktime_scale" class="mceEditableSelect" onchange="Media.formToData();">
|
532 |
-
<option value="">{#not_set}</option>
|
533 |
-
<option value="tofit">tofit</option>
|
534 |
-
<option value="aspect">aspect</option>
|
535 |
-
</select>
|
536 |
-
</td>
|
537 |
-
|
538 |
-
<td colspan="2"> </td>
|
539 |
-
</tr>
|
540 |
-
|
541 |
-
<tr>
|
542 |
-
<td><label for="quicktime_starttime">{#media_dlg.starttime}</label></td>
|
543 |
-
<td><input type="text" id="quicktime_starttime" name="quicktime_starttime" onchange="Media.formToData();" /></td>
|
544 |
-
|
545 |
-
<td><label for="quicktime_endtime">{#media_dlg.endtime}</label></td>
|
546 |
-
<td><input type="text" id="quicktime_endtime" name="quicktime_endtime" onchange="Media.formToData();" /></td>
|
547 |
-
</tr>
|
548 |
-
|
549 |
-
<tr>
|
550 |
-
<td><label for="quicktime_target">{#media_dlg.target}</label></td>
|
551 |
-
<td><input type="text" id="quicktime_target" name="quicktime_target" onchange="Media.formToData();" /></td>
|
552 |
-
|
553 |
-
<td><label for="quicktime_href">{#media_dlg.href}</label></td>
|
554 |
-
<td><input type="text" id="quicktime_href" name="quicktime_href" onchange="Media.formToData();" /></td>
|
555 |
-
</tr>
|
556 |
-
|
557 |
-
<tr>
|
558 |
-
<td><label for="quicktime_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>
|
559 |
-
<td><input type="text" id="quicktime_qtsrcchokespeed" name="quicktime_qtsrcchokespeed" onchange="Media.formToData();" /></td>
|
560 |
-
|
561 |
-
<td><label for="quicktime_volume">{#media_dlg.volume}</label></td>
|
562 |
-
<td><input type="text" id="quicktime_volume" name="quicktime_volume" onchange="Media.formToData();" /></td>
|
563 |
-
</tr>
|
564 |
-
|
565 |
-
<tr>
|
566 |
-
<td><label for="quicktime_qtsrc">{#media_dlg.qtsrc}</label></td>
|
567 |
-
<td colspan="4">
|
568 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
569 |
-
<tr>
|
570 |
-
<td><input type="text" id="quicktime_qtsrc" name="quicktime_qtsrc" onchange="Media.formToData();" /></td>
|
571 |
-
<td id="qtsrcfilebrowsercontainer"> </td>
|
572 |
-
</tr>
|
573 |
-
</table>
|
574 |
-
</td>
|
575 |
-
</tr>
|
576 |
-
</table>
|
577 |
-
</fieldset>
|
578 |
-
|
579 |
-
<fieldset id="windowsmedia_options">
|
580 |
-
<legend>{#media_dlg.wmp_options}</legend>
|
581 |
-
|
582 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
583 |
-
<tr>
|
584 |
-
<td colspan="2">
|
585 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
586 |
-
<tr>
|
587 |
-
<td><input type="checkbox" class="checkbox" id="windowsmedia_autostart" name="windowsmedia_autostart" checked="checked" onchange="Media.formToData();" /></td>
|
588 |
-
<td><label for="windowsmedia_autostart">{#media_dlg.autostart}</label></td>
|
589 |
-
</tr>
|
590 |
-
</table>
|
591 |
-
</td>
|
592 |
-
|
593 |
-
<td colspan="2">
|
594 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
595 |
-
<tr>
|
596 |
-
<td><input type="checkbox" class="checkbox" id="windowsmedia_enabled" name="windowsmedia_enabled" onchange="Media.formToData();" /></td>
|
597 |
-
<td><label for="windowsmedia_enabled">{#media_dlg.enabled}</label></td>
|
598 |
-
</tr>
|
599 |
-
</table>
|
600 |
-
</td>
|
601 |
-
</tr>
|
602 |
-
|
603 |
-
<tr>
|
604 |
-
<td colspan="2">
|
605 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
606 |
-
<tr>
|
607 |
-
<td><input type="checkbox" class="checkbox" id="windowsmedia_enablecontextmenu" name="windowsmedia_enablecontextmenu" checked="checked" onchange="Media.formToData();" /></td>
|
608 |
-
<td><label for="windowsmedia_enablecontextmenu">{#media_dlg.menu}</label></td>
|
609 |
-
</tr>
|
610 |
-
</table>
|
611 |
-
</td>
|
612 |
-
|
613 |
-
<td colspan="2">
|
614 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
615 |
-
<tr>
|
616 |
-
<td><input type="checkbox" class="checkbox" id="windowsmedia_fullscreen" name="windowsmedia_fullscreen" onchange="Media.formToData();" /></td>
|
617 |
-
<td><label for="windowsmedia_fullscreen">{#media_dlg.fullscreen}</label></td>
|
618 |
-
</tr>
|
619 |
-
</table>
|
620 |
-
</td>
|
621 |
-
</tr>
|
622 |
-
|
623 |
-
<tr>
|
624 |
-
<td colspan="2">
|
625 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
626 |
-
<tr>
|
627 |
-
<td><input type="checkbox" class="checkbox" id="windowsmedia_invokeurls" name="windowsmedia_invokeurls" checked="checked" onchange="Media.formToData();" /></td>
|
628 |
-
<td><label for="windowsmedia_invokeurls">{#media_dlg.invokeurls}</label></td>
|
629 |
-
</tr>
|
630 |
-
</table>
|
631 |
-
</td>
|
632 |
-
|
633 |
-
<td colspan="2">
|
634 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
635 |
-
<tr>
|
636 |
-
<td><input type="checkbox" class="checkbox" id="windowsmedia_mute" name="windowsmedia_mute" onchange="Media.formToData();" /></td>
|
637 |
-
<td><label for="windowsmedia_mute">{#media_dlg.mute}</label></td>
|
638 |
-
</tr>
|
639 |
-
</table>
|
640 |
-
</td>
|
641 |
-
</tr>
|
642 |
-
|
643 |
-
<tr>
|
644 |
-
<td colspan="2">
|
645 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
646 |
-
<tr>
|
647 |
-
<td><input type="checkbox" class="checkbox" id="windowsmedia_stretchtofit" name="windowsmedia_stretchtofit" onchange="Media.formToData();" /></td>
|
648 |
-
<td><label for="windowsmedia_stretchtofit">{#media_dlg.stretchtofit}</label></td>
|
649 |
-
</tr>
|
650 |
-
</table>
|
651 |
-
</td>
|
652 |
-
|
653 |
-
<td colspan="2">
|
654 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
655 |
-
<tr>
|
656 |
-
<td><input type="checkbox" class="checkbox" id="windowsmedia_windowlessvideo" name="windowsmedia_windowlessvideo" onchange="Media.formToData();" /></td>
|
657 |
-
<td><label for="windowsmedia_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>
|
658 |
-
</tr>
|
659 |
-
</table>
|
660 |
-
</td>
|
661 |
-
</tr>
|
662 |
-
|
663 |
-
<tr>
|
664 |
-
<td><label for="windowsmedia_balance">{#media_dlg.balance}</label></td>
|
665 |
-
<td><input type="text" id="windowsmedia_balance" name="windowsmedia_balance" onchange="Media.formToData();" /></td>
|
666 |
-
|
667 |
-
<td><label for="windowsmedia_baseurl">{#media_dlg.baseurl}</label></td>
|
668 |
-
<td><input type="text" id="windowsmedia_baseurl" name="windowsmedia_baseurl" onchange="Media.formToData();" /></td>
|
669 |
-
</tr>
|
670 |
-
|
671 |
-
<tr>
|
672 |
-
<td><label for="windowsmedia_captioningid">{#media_dlg.captioningid}</label></td>
|
673 |
-
<td><input type="text" id="windowsmedia_captioningid" name="windowsmedia_captioningid" onchange="Media.formToData();" /></td>
|
674 |
-
|
675 |
-
<td><label for="windowsmedia_currentmarker">{#media_dlg.currentmarker}</label></td>
|
676 |
-
<td><input type="text" id="windowsmedia_currentmarker" name="windowsmedia_currentmarker" onchange="Media.formToData();" /></td>
|
677 |
-
</tr>
|
678 |
-
|
679 |
-
<tr>
|
680 |
-
<td><label for="windowsmedia_currentposition">{#media_dlg.currentposition}</label></td>
|
681 |
-
<td><input type="text" id="windowsmedia_currentposition" name="windowsmedia_currentposition" onchange="Media.formToData();" /></td>
|
682 |
-
|
683 |
-
<td><label for="windowsmedia_defaultframe">{#media_dlg.defaultframe}</label></td>
|
684 |
-
<td><input type="text" id="windowsmedia_defaultframe" name="windowsmedia_defaultframe" onchange="Media.formToData();" /></td>
|
685 |
-
</tr>
|
686 |
-
|
687 |
-
<tr>
|
688 |
-
<td><label for="windowsmedia_playcount">{#media_dlg.playcount}</label></td>
|
689 |
-
<td><input type="text" id="windowsmedia_playcount" name="windowsmedia_playcount" onchange="Media.formToData();" /></td>
|
690 |
-
|
691 |
-
<td><label for="windowsmedia_rate">{#media_dlg.rate}</label></td>
|
692 |
-
<td><input type="text" id="windowsmedia_rate" name="windowsmedia_rate" onchange="Media.formToData();" /></td>
|
693 |
-
</tr>
|
694 |
-
|
695 |
-
<tr>
|
696 |
-
<td><label for="windowsmedia_uimode">{#media_dlg.uimode}</label></td>
|
697 |
-
<td><input type="text" id="windowsmedia_uimode" name="windowsmedia_uimode" onchange="Media.formToData();" /></td>
|
698 |
-
|
699 |
-
<td><label for="windowsmedia_volume">{#media_dlg.volume}</label></td>
|
700 |
-
<td><input type="text" id="windowsmedia_volume" name="windowsmedia_volume" onchange="Media.formToData();" /></td>
|
701 |
-
</tr>
|
702 |
-
|
703 |
-
</table>
|
704 |
-
</fieldset>
|
705 |
-
|
706 |
-
<fieldset id="realmedia_options">
|
707 |
-
<legend>{#media_dlg.rmp_options}</legend>
|
708 |
-
|
709 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
710 |
-
<tr>
|
711 |
-
<td colspan="2">
|
712 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
713 |
-
<tr>
|
714 |
-
<td><input type="checkbox" class="checkbox" id="realmedia_autostart" name="realmedia_autostart" onchange="Media.formToData();" /></td>
|
715 |
-
<td><label for="realmedia_autostart">{#media_dlg.autostart}</label></td>
|
716 |
-
</tr>
|
717 |
-
</table>
|
718 |
-
</td>
|
719 |
-
|
720 |
-
<td colspan="2">
|
721 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
722 |
-
<tr>
|
723 |
-
<td><input type="checkbox" class="checkbox" id="realmedia_loop" name="realmedia_loop" onchange="Media.formToData();" /></td>
|
724 |
-
<td><label for="realmedia_loop">{#media_dlg.loop}</label></td>
|
725 |
-
</tr>
|
726 |
-
</table>
|
727 |
-
</td>
|
728 |
-
</tr>
|
729 |
-
|
730 |
-
<tr>
|
731 |
-
<td colspan="2">
|
732 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
733 |
-
<tr>
|
734 |
-
<td><input type="checkbox" class="checkbox" id="realmedia_autogotourl" name="realmedia_autogotourl" checked="checked" onchange="Media.formToData();" /></td>
|
735 |
-
<td><label for="realmedia_autogotourl">{#media_dlg.autogotourl}</label></td>
|
736 |
-
</tr>
|
737 |
-
</table>
|
738 |
-
</td>
|
739 |
-
|
740 |
-
<td colspan="2">
|
741 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
742 |
-
<tr>
|
743 |
-
<td><input type="checkbox" class="checkbox" id="realmedia_center" name="realmedia_center" onchange="Media.formToData();" /></td>
|
744 |
-
<td><label for="realmedia_center">{#media_dlg.center}</label></td>
|
745 |
-
</tr>
|
746 |
-
</table>
|
747 |
-
</td>
|
748 |
-
</tr>
|
749 |
-
|
750 |
-
<tr>
|
751 |
-
<td colspan="2">
|
752 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
753 |
-
<tr>
|
754 |
-
<td><input type="checkbox" class="checkbox" id="realmedia_imagestatus" name="realmedia_imagestatus" checked="checked" onchange="Media.formToData();" /></td>
|
755 |
-
<td><label for="realmedia_imagestatus">{#media_dlg.imagestatus}</label></td>
|
756 |
-
</tr>
|
757 |
-
</table>
|
758 |
-
</td>
|
759 |
-
|
760 |
-
<td colspan="2">
|
761 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
762 |
-
<tr>
|
763 |
-
<td><input type="checkbox" class="checkbox" id="realmedia_maintainaspect" name="realmedia_maintainaspect" onchange="Media.formToData();" /></td>
|
764 |
-
<td><label for="realmedia_maintainaspect">{#media_dlg.maintainaspect}</label></td>
|
765 |
-
</tr>
|
766 |
-
</table>
|
767 |
-
</td>
|
768 |
-
</tr>
|
769 |
-
|
770 |
-
<tr>
|
771 |
-
<td colspan="2">
|
772 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
773 |
-
<tr>
|
774 |
-
<td><input type="checkbox" class="checkbox" id="realmedia_nojava" name="realmedia_nojava" onchange="Media.formToData();" /></td>
|
775 |
-
<td><label for="realmedia_nojava">{#media_dlg.nojava}</label></td>
|
776 |
-
</tr>
|
777 |
-
</table>
|
778 |
-
</td>
|
779 |
-
|
780 |
-
<td colspan="2">
|
781 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
782 |
-
<tr>
|
783 |
-
<td><input type="checkbox" class="checkbox" id="realmedia_prefetch" name="realmedia_prefetch" onchange="Media.formToData();" /></td>
|
784 |
-
<td><label for="realmedia_prefetch">{#media_dlg.prefetch}</label></td>
|
785 |
-
</tr>
|
786 |
-
</table>
|
787 |
-
</td>
|
788 |
-
</tr>
|
789 |
-
|
790 |
-
<tr>
|
791 |
-
<td colspan="2">
|
792 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
793 |
-
<tr>
|
794 |
-
<td><input type="checkbox" class="checkbox" id="realmedia_shuffle" name="realmedia_shuffle" onchange="Media.formToData();" /></td>
|
795 |
-
<td><label for="realmedia_shuffle">{#media_dlg.shuffle}</label></td>
|
796 |
-
</tr>
|
797 |
-
</table>
|
798 |
-
</td>
|
799 |
-
|
800 |
-
<td colspan="2">
|
801 |
-
|
802 |
-
</td>
|
803 |
-
</tr>
|
804 |
-
|
805 |
-
<tr>
|
806 |
-
<td><label for="realmedia_console">{#media_dlg.console}</label></td>
|
807 |
-
<td><input type="text" id="realmedia_console" name="realmedia_console" onchange="Media.formToData();" /></td>
|
808 |
-
|
809 |
-
<td><label for="realmedia_controls">{#media_dlg.controls}</label></td>
|
810 |
-
<td><input type="text" id="realmedia_controls" name="realmedia_controls" onchange="Media.formToData();" /></td>
|
811 |
-
</tr>
|
812 |
-
|
813 |
-
<tr>
|
814 |
-
<td><label for="realmedia_numloop">{#media_dlg.numloop}</label></td>
|
815 |
-
<td><input type="text" id="realmedia_numloop" name="realmedia_numloop" onchange="Media.formToData();" /></td>
|
816 |
-
|
817 |
-
<td><label for="realmedia_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>
|
818 |
-
<td><input type="text" id="realmedia_scriptcallbacks" name="realmedia_scriptcallbacks" onchange="Media.formToData();" /></td>
|
819 |
-
</tr>
|
820 |
-
</table>
|
821 |
-
</fieldset>
|
822 |
-
|
823 |
-
<fieldset id="shockwave_options">
|
824 |
-
<legend>{#media_dlg.shockwave_options}</legend>
|
825 |
-
|
826 |
-
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
827 |
-
<tr>
|
828 |
-
<td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>
|
829 |
-
<td>
|
830 |
-
<select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="Media.formToData();">
|
831 |
-
<option value="none">{#not_set}</option>
|
832 |
-
<option value="meet">Meet</option>
|
833 |
-
<option value="fill">Fill</option>
|
834 |
-
<option value="stage">Stage</option>
|
835 |
-
</select>
|
836 |
-
</td>
|
837 |
-
|
838 |
-
<td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>
|
839 |
-
<td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="Media.formToData();" /></td>
|
840 |
-
</tr>
|
841 |
-
|
842 |
-
<tr>
|
843 |
-
<td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>
|
844 |
-
<td>
|
845 |
-
<select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="Media.formToData();">
|
846 |
-
<option value="none">{#not_set}</option>
|
847 |
-
<option value="left">{#media_dlg.align_left}</option>
|
848 |
-
<option value="center">{#media_dlg.align_center}</option>
|
849 |
-
<option value="right">{#media_dlg.align_right}</option>
|
850 |
-
</select>
|
851 |
-
</td>
|
852 |
-
|
853 |
-
<td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>
|
854 |
-
<td>
|
855 |
-
<select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="Media.formToData();">
|
856 |
-
<option value="none">{#not_set}</option>
|
857 |
-
<option value="meet">Meet</option>
|
858 |
-
<option value="fill">Fill</option>
|
859 |
-
<option value="stage">Stage</option>
|
860 |
-
</select>
|
861 |
-
</td>
|
862 |
-
</tr>
|
863 |
-
|
864 |
-
<tr>
|
865 |
-
<td colspan="2">
|
866 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
867 |
-
<tr>
|
868 |
-
<td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="Media.formToData();" checked="checked" /></td>
|
869 |
-
<td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>
|
870 |
-
</tr>
|
871 |
-
</table>
|
872 |
-
</td>
|
873 |
-
|
874 |
-
<td colspan="2">
|
875 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
876 |
-
<tr>
|
877 |
-
<td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="Media.formToData();" checked="checked" /></td>
|
878 |
-
<td><label for="shockwave_sound">{#media_dlg.sound}</label></td>
|
879 |
-
</tr>
|
880 |
-
</table>
|
881 |
-
</td>
|
882 |
-
</tr>
|
883 |
-
|
884 |
-
|
885 |
-
<tr>
|
886 |
-
<td colspan="2">
|
887 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
888 |
-
<tr>
|
889 |
-
<td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="Media.formToData();" /></td>
|
890 |
-
<td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>
|
891 |
-
</tr>
|
892 |
-
</table>
|
893 |
-
</td>
|
894 |
-
|
895 |
-
<td colspan="2">
|
896 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
897 |
-
<tr>
|
898 |
-
<td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="Media.formToData();" checked="checked" /></td>
|
899 |
-
<td><label for="shockwave_progress">{#media_dlg.progress}</label></td>
|
900 |
-
</tr>
|
901 |
-
</table>
|
902 |
-
</td>
|
903 |
-
</tr>
|
904 |
-
</table>
|
905 |
-
</fieldset>
|
906 |
-
</div>
|
907 |
-
|
908 |
-
<div id="source_panel" class="panel">
|
909 |
-
<fieldset>
|
910 |
-
<legend>{#media_dlg.source}</legend>
|
911 |
-
<textarea id="source" style="width: 99%; height: 390px"></textarea>
|
912 |
-
</fieldset>
|
913 |
-
</div>
|
914 |
-
</div>
|
915 |
-
|
916 |
-
<div class="mceActionPanel">
|
917 |
-
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
918 |
-
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
919 |
-
</div>
|
920 |
-
</form>
|
921 |
-
</body>
|
922 |
-
</html>
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#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 |
+
</head>
|
13 |
+
<body style="display: none" role="application">
|
14 |
+
<form onsubmit="Media.insert();return false;" action="#">
|
15 |
+
<div class="tabs" role="presentation">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.general}</a></span></li>
|
18 |
+
<li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');Media.formToData();" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>
|
19 |
+
<li id="source_tab" aria-controls="source_panel"><span><a href="javascript:mcTabs.displayTab('source_tab','source_panel');Media.formToData('source');" onmousedown="return false;">{#media_dlg.source}</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 role="presentation" 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"></select>
|
33 |
+
</td>
|
34 |
+
</tr>
|
35 |
+
<tr>
|
36 |
+
<td><label for="src">{#media_dlg.file}</label></td>
|
37 |
+
<td>
|
38 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
39 |
+
<tr>
|
40 |
+
<td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="Media.formToData();" /></td>
|
41 |
+
<td id="filebrowsercontainer"> </td>
|
42 |
+
</tr>
|
43 |
+
</table>
|
44 |
+
</td>
|
45 |
+
</tr>
|
46 |
+
<tr id="linklistrow">
|
47 |
+
<td><label for="linklist">{#media_dlg.list}</label></td>
|
48 |
+
<td id="linklistcontainer"><select id="linklist"><option value=""></option></select></td>
|
49 |
+
</tr>
|
50 |
+
<tr>
|
51 |
+
<td><label for="width">{#media_dlg.size}</label></td>
|
52 |
+
<td>
|
53 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
54 |
+
<tr>
|
55 |
+
<td><input type="text" id="width" name="width" value="" class="size" onchange="Media.formToData('width');" onfocus="Media.beforeResize();" /> x <input type="text" id="height" name="height" value="" class="size" onfocus="Media.beforeResize();" onchange="Media.formToData('height');" /></td>
|
56 |
+
<td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" checked="checked" /></td>
|
57 |
+
<td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>
|
58 |
+
</tr>
|
59 |
+
</table>
|
60 |
+
</td>
|
61 |
+
</tr>
|
62 |
+
</table>
|
63 |
+
</fieldset>
|
64 |
+
|
65 |
+
<fieldset>
|
66 |
+
<legend>{#media_dlg.preview}</legend>
|
67 |
+
<div id="prev"></div>
|
68 |
+
</fieldset>
|
69 |
+
</div>
|
70 |
+
|
71 |
+
<div id="advanced_panel" class="panel">
|
72 |
+
<fieldset>
|
73 |
+
<legend>{#media_dlg.advanced}</legend>
|
74 |
+
|
75 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
|
76 |
+
<tr>
|
77 |
+
<td><label for="id">{#media_dlg.id}</label></td>
|
78 |
+
<td><input type="text" id="id" name="id" onchange="Media.formToData();" /></td>
|
79 |
+
<td><label for="name">{#media_dlg.name}</label></td>
|
80 |
+
<td><input type="text" id="name" name="name" onchange="Media.formToData();" /></td>
|
81 |
+
</tr>
|
82 |
+
|
83 |
+
<tr>
|
84 |
+
<td><label for="align">{#media_dlg.align}</label></td>
|
85 |
+
<td>
|
86 |
+
<select id="align" name="align" onchange="Media.formToData();">
|
87 |
+
<option value="">{#not_set}</option>
|
88 |
+
<option value="top">{#media_dlg.align_top}</option>
|
89 |
+
<option value="right">{#media_dlg.align_right}</option>
|
90 |
+
<option value="bottom">{#media_dlg.align_bottom}</option>
|
91 |
+
<option value="left">{#media_dlg.align_left}</option>
|
92 |
+
</select>
|
93 |
+
</td>
|
94 |
+
|
95 |
+
<td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>
|
96 |
+
<td>
|
97 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
98 |
+
<tr>
|
99 |
+
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');Media.formToData();" /></td>
|
100 |
+
<td id="bgcolor_pickcontainer"> </td>
|
101 |
+
</tr>
|
102 |
+
</table>
|
103 |
+
</td>
|
104 |
+
</tr>
|
105 |
+
|
106 |
+
<tr>
|
107 |
+
<td><label for="vspace">{#media_dlg.vspace}</label></td>
|
108 |
+
<td><input type="text" id="vspace" name="vspace" class="number" onchange="Media.formToData();" /></td>
|
109 |
+
<td><label for="hspace">{#media_dlg.hspace}</label></td>
|
110 |
+
<td><input type="text" id="hspace" name="hspace" class="number" onchange="Media.formToData();" /></td>
|
111 |
+
</tr>
|
112 |
+
</table>
|
113 |
+
</fieldset>
|
114 |
+
|
115 |
+
<fieldset id="video_options">
|
116 |
+
<legend>{#media_dlg.html5_video_options}</legend>
|
117 |
+
|
118 |
+
<table role="presentation">
|
119 |
+
<tr>
|
120 |
+
<td><label for="video_altsource1">{#media_dlg.altsource1}</label></td>
|
121 |
+
<td>
|
122 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
123 |
+
<tr>
|
124 |
+
<td><input type="text" id="video_altsource1" name="video_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>
|
125 |
+
<td id="video_altsource1_filebrowser"> </td>
|
126 |
+
</tr>
|
127 |
+
</table>
|
128 |
+
</td>
|
129 |
+
</tr>
|
130 |
+
|
131 |
+
<tr>
|
132 |
+
<td><label for="video_altsource2">{#media_dlg.altsource2}</label></td>
|
133 |
+
<td>
|
134 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
135 |
+
<tr>
|
136 |
+
<td><input type="text" id="video_altsource2" name="video_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>
|
137 |
+
<td id="video_altsource2_filebrowser"> </td>
|
138 |
+
</tr>
|
139 |
+
</table>
|
140 |
+
</td>
|
141 |
+
</tr>
|
142 |
+
|
143 |
+
<tr>
|
144 |
+
<td><label for="video_poster">{#media_dlg.poster}</label></td>
|
145 |
+
<td>
|
146 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
147 |
+
<tr>
|
148 |
+
<td><input type="text" id="video_poster" name="video_poster" onchange="Media.formToData();" style="width: 240px" /></td>
|
149 |
+
<td id="video_poster_filebrowser"> </td>
|
150 |
+
</tr>
|
151 |
+
</table>
|
152 |
+
</td>
|
153 |
+
</tr>
|
154 |
+
|
155 |
+
<tr>
|
156 |
+
<td><label for="video_preload">{#media_dlg.preload}</label></td>
|
157 |
+
<td>
|
158 |
+
<select id="video_preload" name="video_preload" onchange="Media.formToData();">
|
159 |
+
<option value="none">{#media_dlg.preload_none}</option>
|
160 |
+
<option value="metadata">{#media_dlg.preload_metadata}</option>
|
161 |
+
<option value="auto">{#media_dlg.preload_auto}</option>
|
162 |
+
</select>
|
163 |
+
</td>
|
164 |
+
</tr>
|
165 |
+
</table>
|
166 |
+
|
167 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
168 |
+
<tr>
|
169 |
+
<td>
|
170 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
171 |
+
<tr>
|
172 |
+
<td><input type="checkbox" class="checkbox" id="video_autoplay" name="video_autoplay" onchange="Media.formToData();" /></td>
|
173 |
+
<td><label for="video_autoplay">{#media_dlg.play}</label></td>
|
174 |
+
</tr>
|
175 |
+
</table>
|
176 |
+
</td>
|
177 |
+
|
178 |
+
<td>
|
179 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
180 |
+
<tr>
|
181 |
+
<td><input type="checkbox" class="checkbox" id="video_muted" name="video_muted" onchange="Media.formToData();" /></td>
|
182 |
+
<td><label for="video_muted">{#media_dlg.mute}</label></td>
|
183 |
+
</tr>
|
184 |
+
</table>
|
185 |
+
</td>
|
186 |
+
|
187 |
+
<td>
|
188 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
189 |
+
<tr>
|
190 |
+
<td><input type="checkbox" class="checkbox" id="video_loop" name="video_loop" onchange="Media.formToData();" /></td>
|
191 |
+
<td><label for="video_loop">{#media_dlg.loop}</label></td>
|
192 |
+
</tr>
|
193 |
+
</table>
|
194 |
+
</td>
|
195 |
+
|
196 |
+
<td>
|
197 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
198 |
+
<tr>
|
199 |
+
<td><input type="checkbox" class="checkbox" id="video_controls" name="video_controls" onchange="Media.formToData();" /></td>
|
200 |
+
<td><label for="video_controls">{#media_dlg.controls}</label></td>
|
201 |
+
</tr>
|
202 |
+
</table>
|
203 |
+
</td>
|
204 |
+
</tr>
|
205 |
+
</table>
|
206 |
+
</fieldset>
|
207 |
+
|
208 |
+
<fieldset id="embeddedaudio_options">
|
209 |
+
<legend>{#media_dlg.embedded_audio_options}</legend>
|
210 |
+
|
211 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
212 |
+
<tr>
|
213 |
+
<td>
|
214 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
215 |
+
<tr>
|
216 |
+
<td><input type="checkbox" class="checkbox" id="embeddedaudio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>
|
217 |
+
<td><label for="audio_autoplay">{#media_dlg.play}</label></td>
|
218 |
+
</tr>
|
219 |
+
</table>
|
220 |
+
</td>
|
221 |
+
|
222 |
+
<td>
|
223 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
224 |
+
<tr>
|
225 |
+
<td><input type="checkbox" class="checkbox" id="embeddedaudio_loop" name="audio_loop" onchange="Media.formToData();" /></td>
|
226 |
+
<td><label for="audio_loop">{#media_dlg.loop}</label></td>
|
227 |
+
</tr>
|
228 |
+
</table>
|
229 |
+
</td>
|
230 |
+
|
231 |
+
<td>
|
232 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
233 |
+
<tr>
|
234 |
+
<td><input type="checkbox" class="checkbox" id="embeddedaudio_controls" name="audio_controls" onchange="Media.formToData();" /></td>
|
235 |
+
<td><label for="audio_controls">{#media_dlg.controls}</label></td>
|
236 |
+
</tr>
|
237 |
+
</table>
|
238 |
+
</td>
|
239 |
+
</tr>
|
240 |
+
</table>
|
241 |
+
</fieldset>
|
242 |
+
|
243 |
+
<fieldset id="audio_options">
|
244 |
+
<legend>{#media_dlg.html5_audio_options}</legend>
|
245 |
+
|
246 |
+
<table role="presentation">
|
247 |
+
<tr>
|
248 |
+
<td><label for="audio_altsource1">{#media_dlg.altsource1}</label></td>
|
249 |
+
<td>
|
250 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
251 |
+
<tr>
|
252 |
+
<td><input type="text" id="audio_altsource1" name="audio_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>
|
253 |
+
<td id="audio_altsource1_filebrowser"> </td>
|
254 |
+
</tr>
|
255 |
+
</table>
|
256 |
+
</td>
|
257 |
+
</tr>
|
258 |
+
|
259 |
+
<tr>
|
260 |
+
<td><label for="audio_altsource2">{#media_dlg.altsource2}</label></td>
|
261 |
+
<td>
|
262 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
263 |
+
<tr>
|
264 |
+
<td><input type="text" id="audio_altsource2" name="audio_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>
|
265 |
+
<td id="audio_altsource2_filebrowser"> </td>
|
266 |
+
</tr>
|
267 |
+
</table>
|
268 |
+
</td>
|
269 |
+
</tr>
|
270 |
+
|
271 |
+
<tr>
|
272 |
+
<td><label for="audio_preload">{#media_dlg.preload}</label></td>
|
273 |
+
<td>
|
274 |
+
<select id="audio_preload" name="audio_preload" onchange="Media.formToData();">
|
275 |
+
<option value="none">{#media_dlg.preload_none}</option>
|
276 |
+
<option value="metadata">{#media_dlg.preload_metadata}</option>
|
277 |
+
<option value="auto">{#media_dlg.preload_auto}</option>
|
278 |
+
</select>
|
279 |
+
</td>
|
280 |
+
</tr>
|
281 |
+
</table>
|
282 |
+
|
283 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
284 |
+
<tr>
|
285 |
+
<td>
|
286 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
287 |
+
<tr>
|
288 |
+
<td><input type="checkbox" class="checkbox" id="audio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>
|
289 |
+
<td><label for="audio_autoplay">{#media_dlg.play}</label></td>
|
290 |
+
</tr>
|
291 |
+
</table>
|
292 |
+
</td>
|
293 |
+
|
294 |
+
<td>
|
295 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
296 |
+
<tr>
|
297 |
+
<td><input type="checkbox" class="checkbox" id="audio_loop" name="audio_loop" onchange="Media.formToData();" /></td>
|
298 |
+
<td><label for="audio_loop">{#media_dlg.loop}</label></td>
|
299 |
+
</tr>
|
300 |
+
</table>
|
301 |
+
</td>
|
302 |
+
|
303 |
+
<td>
|
304 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
305 |
+
<tr>
|
306 |
+
<td><input type="checkbox" class="checkbox" id="audio_controls" name="audio_controls" onchange="Media.formToData();" /></td>
|
307 |
+
<td><label for="audio_controls">{#media_dlg.controls}</label></td>
|
308 |
+
</tr>
|
309 |
+
</table>
|
310 |
+
</td>
|
311 |
+
</tr>
|
312 |
+
</table>
|
313 |
+
</fieldset>
|
314 |
+
|
315 |
+
<fieldset id="flash_options">
|
316 |
+
<legend>{#media_dlg.flash_options}</legend>
|
317 |
+
|
318 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
319 |
+
<tr>
|
320 |
+
<td><label for="flash_quality">{#media_dlg.quality}</label></td>
|
321 |
+
<td>
|
322 |
+
<select id="flash_quality" name="flash_quality" onchange="Media.formToData();">
|
323 |
+
<option value="">{#not_set}</option>
|
324 |
+
<option value="high">high</option>
|
325 |
+
<option value="low">low</option>
|
326 |
+
<option value="autolow">autolow</option>
|
327 |
+
<option value="autohigh">autohigh</option>
|
328 |
+
<option value="best">best</option>
|
329 |
+
</select>
|
330 |
+
</td>
|
331 |
+
|
332 |
+
<td><label for="flash_scale">{#media_dlg.scale}</label></td>
|
333 |
+
<td>
|
334 |
+
<select id="flash_scale" name="flash_scale" onchange="Media.formToData();">
|
335 |
+
<option value="">{#not_set}</option>
|
336 |
+
<option value="showall">showall</option>
|
337 |
+
<option value="noborder">noborder</option>
|
338 |
+
<option value="exactfit">exactfit</option>
|
339 |
+
<option value="noscale">noscale</option>
|
340 |
+
</select>
|
341 |
+
</td>
|
342 |
+
</tr>
|
343 |
+
|
344 |
+
<tr>
|
345 |
+
<td><label for="flash_wmode">{#media_dlg.wmode}</label></td>
|
346 |
+
<td>
|
347 |
+
<select id="flash_wmode" name="flash_wmode" onchange="Media.formToData();">
|
348 |
+
<option value="">{#not_set}</option>
|
349 |
+
<option value="window">window</option>
|
350 |
+
<option value="opaque">opaque</option>
|
351 |
+
<option value="transparent">transparent</option>
|
352 |
+
</select>
|
353 |
+
</td>
|
354 |
+
|
355 |
+
<td><label for="flash_salign">{#media_dlg.salign}</label></td>
|
356 |
+
<td>
|
357 |
+
<select id="flash_salign" name="flash_salign" onchange="Media.formToData();">
|
358 |
+
<option value="">{#not_set}</option>
|
359 |
+
<option value="l">{#media_dlg.align_left}</option>
|
360 |
+
<option value="t">{#media_dlg.align_top}</option>
|
361 |
+
<option value="r">{#media_dlg.align_right}</option>
|
362 |
+
<option value="b">{#media_dlg.align_bottom}</option>
|
363 |
+
<option value="tl">{#media_dlg.align_top_left}</option>
|
364 |
+
<option value="tr">{#media_dlg.align_top_right}</option>
|
365 |
+
<option value="bl">{#media_dlg.align_bottom_left}</option>
|
366 |
+
<option value="br">{#media_dlg.align_bottom_right}</option>
|
367 |
+
</select>
|
368 |
+
</td>
|
369 |
+
</tr>
|
370 |
+
|
371 |
+
<tr>
|
372 |
+
<td colspan="2">
|
373 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
374 |
+
<tr>
|
375 |
+
<td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="Media.formToData();" /></td>
|
376 |
+
<td><label for="flash_play">{#media_dlg.play}</label></td>
|
377 |
+
</tr>
|
378 |
+
</table>
|
379 |
+
</td>
|
380 |
+
|
381 |
+
<td colspan="2">
|
382 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
383 |
+
<tr>
|
384 |
+
<td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="Media.formToData();" /></td>
|
385 |
+
<td><label for="flash_loop">{#media_dlg.loop}</label></td>
|
386 |
+
</tr>
|
387 |
+
</table>
|
388 |
+
</td>
|
389 |
+
</tr>
|
390 |
+
|
391 |
+
<tr>
|
392 |
+
<td colspan="2">
|
393 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
394 |
+
<tr>
|
395 |
+
<td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="Media.formToData();" /></td>
|
396 |
+
<td><label for="flash_menu">{#media_dlg.menu}</label></td>
|
397 |
+
</tr>
|
398 |
+
</table>
|
399 |
+
</td>
|
400 |
+
|
401 |
+
<td colspan="2">
|
402 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
403 |
+
<tr>
|
404 |
+
<td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="Media.formToData();" /></td>
|
405 |
+
<td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>
|
406 |
+
</tr>
|
407 |
+
</table>
|
408 |
+
</td>
|
409 |
+
</tr>
|
410 |
+
</table>
|
411 |
+
|
412 |
+
<table role="presentation">
|
413 |
+
<tr>
|
414 |
+
<td><label for="flash_base">{#media_dlg.base}</label></td>
|
415 |
+
<td><input type="text" id="flash_base" name="flash_base" onchange="Media.formToData();" /></td>
|
416 |
+
</tr>
|
417 |
+
|
418 |
+
<tr>
|
419 |
+
<td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>
|
420 |
+
<td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="Media.formToData();" /></td>
|
421 |
+
</tr>
|
422 |
+
</table>
|
423 |
+
</fieldset>
|
424 |
+
|
425 |
+
<fieldset id="quicktime_options">
|
426 |
+
<legend>{#media_dlg.qt_options}</legend>
|
427 |
+
|
428 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
429 |
+
<tr>
|
430 |
+
<td colspan="2">
|
431 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
432 |
+
<tr>
|
433 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_loop" name="quicktime_loop" onchange="Media.formToData();" /></td>
|
434 |
+
<td><label for="quicktime_loop">{#media_dlg.loop}</label></td>
|
435 |
+
</tr>
|
436 |
+
</table>
|
437 |
+
</td>
|
438 |
+
|
439 |
+
<td colspan="2">
|
440 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
441 |
+
<tr>
|
442 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_autoplay" name="quicktime_autoplay" checked="checked" onchange="Media.formToData();" /></td>
|
443 |
+
<td><label for="quicktime_autoplay">{#media_dlg.play}</label></td>
|
444 |
+
</tr>
|
445 |
+
</table>
|
446 |
+
</td>
|
447 |
+
</tr>
|
448 |
+
|
449 |
+
<tr>
|
450 |
+
<td colspan="2">
|
451 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
452 |
+
<tr>
|
453 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_cache" name="quicktime_cache" onchange="Media.formToData();" /></td>
|
454 |
+
<td><label for="quicktime_cache">{#media_dlg.cache}</label></td>
|
455 |
+
</tr>
|
456 |
+
</table>
|
457 |
+
</td>
|
458 |
+
|
459 |
+
<td colspan="2">
|
460 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
461 |
+
<tr>
|
462 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_controller" name="quicktime_controller" checked="checked" onchange="Media.formToData();" /></td>
|
463 |
+
<td><label for="quicktime_controller">{#media_dlg.controller}</label></td>
|
464 |
+
</tr>
|
465 |
+
</table>
|
466 |
+
</td>
|
467 |
+
</tr>
|
468 |
+
|
469 |
+
<tr>
|
470 |
+
<td colspan="2">
|
471 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
472 |
+
<tr>
|
473 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_correction" name="quicktime_correction" onchange="Media.formToData();" /></td>
|
474 |
+
<td><label for="quicktime_correction">{#media_dlg.correction}</label></td>
|
475 |
+
</tr>
|
476 |
+
</table>
|
477 |
+
</td>
|
478 |
+
|
479 |
+
<td colspan="2">
|
480 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
481 |
+
<tr>
|
482 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_enablejavascript" name="quicktime_enablejavascript" onchange="Media.formToData();" /></td>
|
483 |
+
<td><label for="quicktime_enablejavascript">{#media_dlg.enablejavascript}</label></td>
|
484 |
+
</tr>
|
485 |
+
</table>
|
486 |
+
</td>
|
487 |
+
</tr>
|
488 |
+
|
489 |
+
<tr>
|
490 |
+
<td colspan="2">
|
491 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
492 |
+
<tr>
|
493 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_kioskmode" name="quicktime_kioskmode" onchange="Media.formToData();" /></td>
|
494 |
+
<td><label for="quicktime_kioskmode">{#media_dlg.kioskmode}</label></td>
|
495 |
+
</tr>
|
496 |
+
</table>
|
497 |
+
</td>
|
498 |
+
|
499 |
+
<td colspan="2">
|
500 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
501 |
+
<tr>
|
502 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_autohref" name="quicktime_autohref" onchange="Media.formToData();" /></td>
|
503 |
+
<td><label for="quicktime_autohref">{#media_dlg.autohref}</label></td>
|
504 |
+
</tr>
|
505 |
+
</table>
|
506 |
+
</td>
|
507 |
+
</tr>
|
508 |
+
|
509 |
+
<tr>
|
510 |
+
<td colspan="2">
|
511 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
512 |
+
<tr>
|
513 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_playeveryframe" name="quicktime_playeveryframe" onchange="Media.formToData();" /></td>
|
514 |
+
<td><label for="quicktime_playeveryframe">{#media_dlg.playeveryframe}</label></td>
|
515 |
+
</tr>
|
516 |
+
</table>
|
517 |
+
</td>
|
518 |
+
|
519 |
+
<td colspan="2">
|
520 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
521 |
+
<tr>
|
522 |
+
<td><input type="checkbox" class="checkbox" id="quicktime_targetcache" name="quicktime_targetcache" onchange="Media.formToData();" /></td>
|
523 |
+
<td><label for="quicktime_targetcache">{#media_dlg.targetcache}</label></td>
|
524 |
+
</tr>
|
525 |
+
</table>
|
526 |
+
</td>
|
527 |
+
</tr>
|
528 |
+
|
529 |
+
<tr>
|
530 |
+
<td><label for="quicktime_scale">{#media_dlg.scale}</label></td>
|
531 |
+
<td><select id="quicktime_scale" name="quicktime_scale" class="mceEditableSelect" onchange="Media.formToData();">
|
532 |
+
<option value="">{#not_set}</option>
|
533 |
+
<option value="tofit">tofit</option>
|
534 |
+
<option value="aspect">aspect</option>
|
535 |
+
</select>
|
536 |
+
</td>
|
537 |
+
|
538 |
+
<td colspan="2"> </td>
|
539 |
+
</tr>
|
540 |
+
|
541 |
+
<tr>
|
542 |
+
<td><label for="quicktime_starttime">{#media_dlg.starttime}</label></td>
|
543 |
+
<td><input type="text" id="quicktime_starttime" name="quicktime_starttime" onchange="Media.formToData();" /></td>
|
544 |
+
|
545 |
+
<td><label for="quicktime_endtime">{#media_dlg.endtime}</label></td>
|
546 |
+
<td><input type="text" id="quicktime_endtime" name="quicktime_endtime" onchange="Media.formToData();" /></td>
|
547 |
+
</tr>
|
548 |
+
|
549 |
+
<tr>
|
550 |
+
<td><label for="quicktime_target">{#media_dlg.target}</label></td>
|
551 |
+
<td><input type="text" id="quicktime_target" name="quicktime_target" onchange="Media.formToData();" /></td>
|
552 |
+
|
553 |
+
<td><label for="quicktime_href">{#media_dlg.href}</label></td>
|
554 |
+
<td><input type="text" id="quicktime_href" name="quicktime_href" onchange="Media.formToData();" /></td>
|
555 |
+
</tr>
|
556 |
+
|
557 |
+
<tr>
|
558 |
+
<td><label for="quicktime_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>
|
559 |
+
<td><input type="text" id="quicktime_qtsrcchokespeed" name="quicktime_qtsrcchokespeed" onchange="Media.formToData();" /></td>
|
560 |
+
|
561 |
+
<td><label for="quicktime_volume">{#media_dlg.volume}</label></td>
|
562 |
+
<td><input type="text" id="quicktime_volume" name="quicktime_volume" onchange="Media.formToData();" /></td>
|
563 |
+
</tr>
|
564 |
+
|
565 |
+
<tr>
|
566 |
+
<td><label for="quicktime_qtsrc">{#media_dlg.qtsrc}</label></td>
|
567 |
+
<td colspan="4">
|
568 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
569 |
+
<tr>
|
570 |
+
<td><input type="text" id="quicktime_qtsrc" name="quicktime_qtsrc" onchange="Media.formToData();" /></td>
|
571 |
+
<td id="qtsrcfilebrowsercontainer"> </td>
|
572 |
+
</tr>
|
573 |
+
</table>
|
574 |
+
</td>
|
575 |
+
</tr>
|
576 |
+
</table>
|
577 |
+
</fieldset>
|
578 |
+
|
579 |
+
<fieldset id="windowsmedia_options">
|
580 |
+
<legend>{#media_dlg.wmp_options}</legend>
|
581 |
+
|
582 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
583 |
+
<tr>
|
584 |
+
<td colspan="2">
|
585 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
586 |
+
<tr>
|
587 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_autostart" name="windowsmedia_autostart" checked="checked" onchange="Media.formToData();" /></td>
|
588 |
+
<td><label for="windowsmedia_autostart">{#media_dlg.autostart}</label></td>
|
589 |
+
</tr>
|
590 |
+
</table>
|
591 |
+
</td>
|
592 |
+
|
593 |
+
<td colspan="2">
|
594 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
595 |
+
<tr>
|
596 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_enabled" name="windowsmedia_enabled" onchange="Media.formToData();" /></td>
|
597 |
+
<td><label for="windowsmedia_enabled">{#media_dlg.enabled}</label></td>
|
598 |
+
</tr>
|
599 |
+
</table>
|
600 |
+
</td>
|
601 |
+
</tr>
|
602 |
+
|
603 |
+
<tr>
|
604 |
+
<td colspan="2">
|
605 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
606 |
+
<tr>
|
607 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_enablecontextmenu" name="windowsmedia_enablecontextmenu" checked="checked" onchange="Media.formToData();" /></td>
|
608 |
+
<td><label for="windowsmedia_enablecontextmenu">{#media_dlg.menu}</label></td>
|
609 |
+
</tr>
|
610 |
+
</table>
|
611 |
+
</td>
|
612 |
+
|
613 |
+
<td colspan="2">
|
614 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
615 |
+
<tr>
|
616 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_fullscreen" name="windowsmedia_fullscreen" onchange="Media.formToData();" /></td>
|
617 |
+
<td><label for="windowsmedia_fullscreen">{#media_dlg.fullscreen}</label></td>
|
618 |
+
</tr>
|
619 |
+
</table>
|
620 |
+
</td>
|
621 |
+
</tr>
|
622 |
+
|
623 |
+
<tr>
|
624 |
+
<td colspan="2">
|
625 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
626 |
+
<tr>
|
627 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_invokeurls" name="windowsmedia_invokeurls" checked="checked" onchange="Media.formToData();" /></td>
|
628 |
+
<td><label for="windowsmedia_invokeurls">{#media_dlg.invokeurls}</label></td>
|
629 |
+
</tr>
|
630 |
+
</table>
|
631 |
+
</td>
|
632 |
+
|
633 |
+
<td colspan="2">
|
634 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
635 |
+
<tr>
|
636 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_mute" name="windowsmedia_mute" onchange="Media.formToData();" /></td>
|
637 |
+
<td><label for="windowsmedia_mute">{#media_dlg.mute}</label></td>
|
638 |
+
</tr>
|
639 |
+
</table>
|
640 |
+
</td>
|
641 |
+
</tr>
|
642 |
+
|
643 |
+
<tr>
|
644 |
+
<td colspan="2">
|
645 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
646 |
+
<tr>
|
647 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_stretchtofit" name="windowsmedia_stretchtofit" onchange="Media.formToData();" /></td>
|
648 |
+
<td><label for="windowsmedia_stretchtofit">{#media_dlg.stretchtofit}</label></td>
|
649 |
+
</tr>
|
650 |
+
</table>
|
651 |
+
</td>
|
652 |
+
|
653 |
+
<td colspan="2">
|
654 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
655 |
+
<tr>
|
656 |
+
<td><input type="checkbox" class="checkbox" id="windowsmedia_windowlessvideo" name="windowsmedia_windowlessvideo" onchange="Media.formToData();" /></td>
|
657 |
+
<td><label for="windowsmedia_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>
|
658 |
+
</tr>
|
659 |
+
</table>
|
660 |
+
</td>
|
661 |
+
</tr>
|
662 |
+
|
663 |
+
<tr>
|
664 |
+
<td><label for="windowsmedia_balance">{#media_dlg.balance}</label></td>
|
665 |
+
<td><input type="text" id="windowsmedia_balance" name="windowsmedia_balance" onchange="Media.formToData();" /></td>
|
666 |
+
|
667 |
+
<td><label for="windowsmedia_baseurl">{#media_dlg.baseurl}</label></td>
|
668 |
+
<td><input type="text" id="windowsmedia_baseurl" name="windowsmedia_baseurl" onchange="Media.formToData();" /></td>
|
669 |
+
</tr>
|
670 |
+
|
671 |
+
<tr>
|
672 |
+
<td><label for="windowsmedia_captioningid">{#media_dlg.captioningid}</label></td>
|
673 |
+
<td><input type="text" id="windowsmedia_captioningid" name="windowsmedia_captioningid" onchange="Media.formToData();" /></td>
|
674 |
+
|
675 |
+
<td><label for="windowsmedia_currentmarker">{#media_dlg.currentmarker}</label></td>
|
676 |
+
<td><input type="text" id="windowsmedia_currentmarker" name="windowsmedia_currentmarker" onchange="Media.formToData();" /></td>
|
677 |
+
</tr>
|
678 |
+
|
679 |
+
<tr>
|
680 |
+
<td><label for="windowsmedia_currentposition">{#media_dlg.currentposition}</label></td>
|
681 |
+
<td><input type="text" id="windowsmedia_currentposition" name="windowsmedia_currentposition" onchange="Media.formToData();" /></td>
|
682 |
+
|
683 |
+
<td><label for="windowsmedia_defaultframe">{#media_dlg.defaultframe}</label></td>
|
684 |
+
<td><input type="text" id="windowsmedia_defaultframe" name="windowsmedia_defaultframe" onchange="Media.formToData();" /></td>
|
685 |
+
</tr>
|
686 |
+
|
687 |
+
<tr>
|
688 |
+
<td><label for="windowsmedia_playcount">{#media_dlg.playcount}</label></td>
|
689 |
+
<td><input type="text" id="windowsmedia_playcount" name="windowsmedia_playcount" onchange="Media.formToData();" /></td>
|
690 |
+
|
691 |
+
<td><label for="windowsmedia_rate">{#media_dlg.rate}</label></td>
|
692 |
+
<td><input type="text" id="windowsmedia_rate" name="windowsmedia_rate" onchange="Media.formToData();" /></td>
|
693 |
+
</tr>
|
694 |
+
|
695 |
+
<tr>
|
696 |
+
<td><label for="windowsmedia_uimode">{#media_dlg.uimode}</label></td>
|
697 |
+
<td><input type="text" id="windowsmedia_uimode" name="windowsmedia_uimode" onchange="Media.formToData();" /></td>
|
698 |
+
|
699 |
+
<td><label for="windowsmedia_volume">{#media_dlg.volume}</label></td>
|
700 |
+
<td><input type="text" id="windowsmedia_volume" name="windowsmedia_volume" onchange="Media.formToData();" /></td>
|
701 |
+
</tr>
|
702 |
+
|
703 |
+
</table>
|
704 |
+
</fieldset>
|
705 |
+
|
706 |
+
<fieldset id="realmedia_options">
|
707 |
+
<legend>{#media_dlg.rmp_options}</legend>
|
708 |
+
|
709 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
710 |
+
<tr>
|
711 |
+
<td colspan="2">
|
712 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
713 |
+
<tr>
|
714 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_autostart" name="realmedia_autostart" onchange="Media.formToData();" /></td>
|
715 |
+
<td><label for="realmedia_autostart">{#media_dlg.autostart}</label></td>
|
716 |
+
</tr>
|
717 |
+
</table>
|
718 |
+
</td>
|
719 |
+
|
720 |
+
<td colspan="2">
|
721 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
722 |
+
<tr>
|
723 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_loop" name="realmedia_loop" onchange="Media.formToData();" /></td>
|
724 |
+
<td><label for="realmedia_loop">{#media_dlg.loop}</label></td>
|
725 |
+
</tr>
|
726 |
+
</table>
|
727 |
+
</td>
|
728 |
+
</tr>
|
729 |
+
|
730 |
+
<tr>
|
731 |
+
<td colspan="2">
|
732 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
733 |
+
<tr>
|
734 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_autogotourl" name="realmedia_autogotourl" checked="checked" onchange="Media.formToData();" /></td>
|
735 |
+
<td><label for="realmedia_autogotourl">{#media_dlg.autogotourl}</label></td>
|
736 |
+
</tr>
|
737 |
+
</table>
|
738 |
+
</td>
|
739 |
+
|
740 |
+
<td colspan="2">
|
741 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
742 |
+
<tr>
|
743 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_center" name="realmedia_center" onchange="Media.formToData();" /></td>
|
744 |
+
<td><label for="realmedia_center">{#media_dlg.center}</label></td>
|
745 |
+
</tr>
|
746 |
+
</table>
|
747 |
+
</td>
|
748 |
+
</tr>
|
749 |
+
|
750 |
+
<tr>
|
751 |
+
<td colspan="2">
|
752 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
753 |
+
<tr>
|
754 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_imagestatus" name="realmedia_imagestatus" checked="checked" onchange="Media.formToData();" /></td>
|
755 |
+
<td><label for="realmedia_imagestatus">{#media_dlg.imagestatus}</label></td>
|
756 |
+
</tr>
|
757 |
+
</table>
|
758 |
+
</td>
|
759 |
+
|
760 |
+
<td colspan="2">
|
761 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
762 |
+
<tr>
|
763 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_maintainaspect" name="realmedia_maintainaspect" onchange="Media.formToData();" /></td>
|
764 |
+
<td><label for="realmedia_maintainaspect">{#media_dlg.maintainaspect}</label></td>
|
765 |
+
</tr>
|
766 |
+
</table>
|
767 |
+
</td>
|
768 |
+
</tr>
|
769 |
+
|
770 |
+
<tr>
|
771 |
+
<td colspan="2">
|
772 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
773 |
+
<tr>
|
774 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_nojava" name="realmedia_nojava" onchange="Media.formToData();" /></td>
|
775 |
+
<td><label for="realmedia_nojava">{#media_dlg.nojava}</label></td>
|
776 |
+
</tr>
|
777 |
+
</table>
|
778 |
+
</td>
|
779 |
+
|
780 |
+
<td colspan="2">
|
781 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
782 |
+
<tr>
|
783 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_prefetch" name="realmedia_prefetch" onchange="Media.formToData();" /></td>
|
784 |
+
<td><label for="realmedia_prefetch">{#media_dlg.prefetch}</label></td>
|
785 |
+
</tr>
|
786 |
+
</table>
|
787 |
+
</td>
|
788 |
+
</tr>
|
789 |
+
|
790 |
+
<tr>
|
791 |
+
<td colspan="2">
|
792 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
793 |
+
<tr>
|
794 |
+
<td><input type="checkbox" class="checkbox" id="realmedia_shuffle" name="realmedia_shuffle" onchange="Media.formToData();" /></td>
|
795 |
+
<td><label for="realmedia_shuffle">{#media_dlg.shuffle}</label></td>
|
796 |
+
</tr>
|
797 |
+
</table>
|
798 |
+
</td>
|
799 |
+
|
800 |
+
<td colspan="2">
|
801 |
+
|
802 |
+
</td>
|
803 |
+
</tr>
|
804 |
+
|
805 |
+
<tr>
|
806 |
+
<td><label for="realmedia_console">{#media_dlg.console}</label></td>
|
807 |
+
<td><input type="text" id="realmedia_console" name="realmedia_console" onchange="Media.formToData();" /></td>
|
808 |
+
|
809 |
+
<td><label for="realmedia_controls">{#media_dlg.controls}</label></td>
|
810 |
+
<td><input type="text" id="realmedia_controls" name="realmedia_controls" onchange="Media.formToData();" /></td>
|
811 |
+
</tr>
|
812 |
+
|
813 |
+
<tr>
|
814 |
+
<td><label for="realmedia_numloop">{#media_dlg.numloop}</label></td>
|
815 |
+
<td><input type="text" id="realmedia_numloop" name="realmedia_numloop" onchange="Media.formToData();" /></td>
|
816 |
+
|
817 |
+
<td><label for="realmedia_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>
|
818 |
+
<td><input type="text" id="realmedia_scriptcallbacks" name="realmedia_scriptcallbacks" onchange="Media.formToData();" /></td>
|
819 |
+
</tr>
|
820 |
+
</table>
|
821 |
+
</fieldset>
|
822 |
+
|
823 |
+
<fieldset id="shockwave_options">
|
824 |
+
<legend>{#media_dlg.shockwave_options}</legend>
|
825 |
+
|
826 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
827 |
+
<tr>
|
828 |
+
<td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>
|
829 |
+
<td>
|
830 |
+
<select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="Media.formToData();">
|
831 |
+
<option value="none">{#not_set}</option>
|
832 |
+
<option value="meet">Meet</option>
|
833 |
+
<option value="fill">Fill</option>
|
834 |
+
<option value="stage">Stage</option>
|
835 |
+
</select>
|
836 |
+
</td>
|
837 |
+
|
838 |
+
<td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>
|
839 |
+
<td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="Media.formToData();" /></td>
|
840 |
+
</tr>
|
841 |
+
|
842 |
+
<tr>
|
843 |
+
<td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>
|
844 |
+
<td>
|
845 |
+
<select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="Media.formToData();">
|
846 |
+
<option value="none">{#not_set}</option>
|
847 |
+
<option value="left">{#media_dlg.align_left}</option>
|
848 |
+
<option value="center">{#media_dlg.align_center}</option>
|
849 |
+
<option value="right">{#media_dlg.align_right}</option>
|
850 |
+
</select>
|
851 |
+
</td>
|
852 |
+
|
853 |
+
<td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>
|
854 |
+
<td>
|
855 |
+
<select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="Media.formToData();">
|
856 |
+
<option value="none">{#not_set}</option>
|
857 |
+
<option value="meet">Meet</option>
|
858 |
+
<option value="fill">Fill</option>
|
859 |
+
<option value="stage">Stage</option>
|
860 |
+
</select>
|
861 |
+
</td>
|
862 |
+
</tr>
|
863 |
+
|
864 |
+
<tr>
|
865 |
+
<td colspan="2">
|
866 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
867 |
+
<tr>
|
868 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="Media.formToData();" checked="checked" /></td>
|
869 |
+
<td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>
|
870 |
+
</tr>
|
871 |
+
</table>
|
872 |
+
</td>
|
873 |
+
|
874 |
+
<td colspan="2">
|
875 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
876 |
+
<tr>
|
877 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="Media.formToData();" checked="checked" /></td>
|
878 |
+
<td><label for="shockwave_sound">{#media_dlg.sound}</label></td>
|
879 |
+
</tr>
|
880 |
+
</table>
|
881 |
+
</td>
|
882 |
+
</tr>
|
883 |
+
|
884 |
+
|
885 |
+
<tr>
|
886 |
+
<td colspan="2">
|
887 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
888 |
+
<tr>
|
889 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="Media.formToData();" /></td>
|
890 |
+
<td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>
|
891 |
+
</tr>
|
892 |
+
</table>
|
893 |
+
</td>
|
894 |
+
|
895 |
+
<td colspan="2">
|
896 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
897 |
+
<tr>
|
898 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="Media.formToData();" checked="checked" /></td>
|
899 |
+
<td><label for="shockwave_progress">{#media_dlg.progress}</label></td>
|
900 |
+
</tr>
|
901 |
+
</table>
|
902 |
+
</td>
|
903 |
+
</tr>
|
904 |
+
</table>
|
905 |
+
</fieldset>
|
906 |
+
</div>
|
907 |
+
|
908 |
+
<div id="source_panel" class="panel">
|
909 |
+
<fieldset>
|
910 |
+
<legend>{#media_dlg.source}</legend>
|
911 |
+
<textarea id="source" style="width: 99%; height: 390px"></textarea>
|
912 |
+
</fieldset>
|
913 |
+
</div>
|
914 |
+
</div>
|
915 |
+
|
916 |
+
<div class="mceActionPanel">
|
917 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
918 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
919 |
+
</div>
|
920 |
+
</form>
|
921 |
+
</body>
|
922 |
+
</html>
|
js/libraries/tiny_mce/plugins/nonbreaking/editor_plugin_src.js
CHANGED
@@ -1,54 +1,54 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.Nonbreaking', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
var t = this;
|
15 |
-
|
16 |
-
t.editor = ed;
|
17 |
-
|
18 |
-
// Register commands
|
19 |
-
ed.addCommand('mceNonBreaking', function() {
|
20 |
-
ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp"> </span>' : ' ');
|
21 |
-
});
|
22 |
-
|
23 |
-
// Register buttons
|
24 |
-
ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});
|
25 |
-
|
26 |
-
if (ed.getParam('nonbreaking_force_tab')) {
|
27 |
-
ed.onKeyDown.add(function(ed, e) {
|
28 |
-
if (e.keyCode == 9) {
|
29 |
-
e.preventDefault();
|
30 |
-
|
31 |
-
ed.execCommand('mceNonBreaking');
|
32 |
-
ed.execCommand('mceNonBreaking');
|
33 |
-
ed.execCommand('mceNonBreaking');
|
34 |
-
}
|
35 |
-
});
|
36 |
-
}
|
37 |
-
},
|
38 |
-
|
39 |
-
getInfo : function() {
|
40 |
-
return {
|
41 |
-
longname : 'Nonbreaking space',
|
42 |
-
author : 'Moxiecode Systems AB',
|
43 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
44 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
|
45 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
46 |
-
};
|
47 |
-
}
|
48 |
-
|
49 |
-
// Private methods
|
50 |
-
});
|
51 |
-
|
52 |
-
// Register plugin
|
53 |
-
tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);
|
54 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.Nonbreaking', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this;
|
15 |
+
|
16 |
+
t.editor = ed;
|
17 |
+
|
18 |
+
// Register commands
|
19 |
+
ed.addCommand('mceNonBreaking', function() {
|
20 |
+
ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp"> </span>' : ' ');
|
21 |
+
});
|
22 |
+
|
23 |
+
// Register buttons
|
24 |
+
ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});
|
25 |
+
|
26 |
+
if (ed.getParam('nonbreaking_force_tab')) {
|
27 |
+
ed.onKeyDown.add(function(ed, e) {
|
28 |
+
if (e.keyCode == 9) {
|
29 |
+
e.preventDefault();
|
30 |
+
|
31 |
+
ed.execCommand('mceNonBreaking');
|
32 |
+
ed.execCommand('mceNonBreaking');
|
33 |
+
ed.execCommand('mceNonBreaking');
|
34 |
+
}
|
35 |
+
});
|
36 |
+
}
|
37 |
+
},
|
38 |
+
|
39 |
+
getInfo : function() {
|
40 |
+
return {
|
41 |
+
longname : 'Nonbreaking space',
|
42 |
+
author : 'Moxiecode Systems AB',
|
43 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
44 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
|
45 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
46 |
+
};
|
47 |
+
}
|
48 |
+
|
49 |
+
// Private methods
|
50 |
+
});
|
51 |
+
|
52 |
+
// Register plugin
|
53 |
+
tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);
|
54 |
})();
|
js/libraries/tiny_mce/plugins/noneditable/editor_plugin_src.js
CHANGED
@@ -1,537 +1,537 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
var TreeWalker = tinymce.dom.TreeWalker;
|
13 |
-
var externalName = 'contenteditable', internalName = 'data-mce-' + externalName;
|
14 |
-
var VK = tinymce.VK;
|
15 |
-
|
16 |
-
function handleContentEditableSelection(ed) {
|
17 |
-
var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF';
|
18 |
-
|
19 |
-
// Returns the content editable state of a node "true/false" or null
|
20 |
-
function getContentEditable(node) {
|
21 |
-
var contentEditable;
|
22 |
-
|
23 |
-
// Ignore non elements
|
24 |
-
if (node.nodeType === 1) {
|
25 |
-
// Check for fake content editable
|
26 |
-
contentEditable = node.getAttribute(internalName);
|
27 |
-
if (contentEditable && contentEditable !== "inherit") {
|
28 |
-
return contentEditable;
|
29 |
-
}
|
30 |
-
|
31 |
-
// Check for real content editable
|
32 |
-
contentEditable = node.contentEditable;
|
33 |
-
if (contentEditable !== "inherit") {
|
34 |
-
return contentEditable;
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
return null;
|
39 |
-
};
|
40 |
-
|
41 |
-
// Returns the noneditable parent or null if there is a editable before it or if it wasn't found
|
42 |
-
function getNonEditableParent(node) {
|
43 |
-
var state;
|
44 |
-
|
45 |
-
while (node) {
|
46 |
-
state = getContentEditable(node);
|
47 |
-
if (state) {
|
48 |
-
return state === "false" ? node : null;
|
49 |
-
}
|
50 |
-
|
51 |
-
node = node.parentNode;
|
52 |
-
}
|
53 |
-
};
|
54 |
-
|
55 |
-
// Get caret container parent for the specified node
|
56 |
-
function getParentCaretContainer(node) {
|
57 |
-
while (node) {
|
58 |
-
if (node.id === caretContainerId) {
|
59 |
-
return node;
|
60 |
-
}
|
61 |
-
|
62 |
-
node = node.parentNode;
|
63 |
-
}
|
64 |
-
};
|
65 |
-
|
66 |
-
// Finds the first text node in the specified node
|
67 |
-
function findFirstTextNode(node) {
|
68 |
-
var walker;
|
69 |
-
|
70 |
-
if (node) {
|
71 |
-
walker = new TreeWalker(node, node);
|
72 |
-
|
73 |
-
for (node = walker.current(); node; node = walker.next()) {
|
74 |
-
if (node.nodeType === 3) {
|
75 |
-
return node;
|
76 |
-
}
|
77 |
-
}
|
78 |
-
}
|
79 |
-
};
|
80 |
-
|
81 |
-
// Insert caret container before/after target or expand selection to include block
|
82 |
-
function insertCaretContainerOrExpandToBlock(target, before) {
|
83 |
-
var caretContainer, rng;
|
84 |
-
|
85 |
-
// Select block
|
86 |
-
if (getContentEditable(target) === "false") {
|
87 |
-
if (dom.isBlock(target)) {
|
88 |
-
selection.select(target);
|
89 |
-
return;
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
rng = dom.createRng();
|
94 |
-
|
95 |
-
if (getContentEditable(target) === "true") {
|
96 |
-
if (!target.firstChild) {
|
97 |
-
target.appendChild(ed.getDoc().createTextNode('\u00a0'));
|
98 |
-
}
|
99 |
-
|
100 |
-
target = target.firstChild;
|
101 |
-
before = true;
|
102 |
-
}
|
103 |
-
|
104 |
-
//caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style:'border: 1px solid red'}, invisibleChar);
|
105 |
-
caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true}, invisibleChar);
|
106 |
-
|
107 |
-
if (before) {
|
108 |
-
target.parentNode.insertBefore(caretContainer, target);
|
109 |
-
} else {
|
110 |
-
dom.insertAfter(caretContainer, target);
|
111 |
-
}
|
112 |
-
|
113 |
-
rng.setStart(caretContainer.firstChild, 1);
|
114 |
-
rng.collapse(true);
|
115 |
-
selection.setRng(rng);
|
116 |
-
|
117 |
-
return caretContainer;
|
118 |
-
};
|
119 |
-
|
120 |
-
// Removes any caret container except the one we might be in
|
121 |
-
function removeCaretContainer(caretContainer) {
|
122 |
-
var child, currentCaretContainer, lastContainer;
|
123 |
-
|
124 |
-
if (caretContainer) {
|
125 |
-
rng = selection.getRng(true);
|
126 |
-
rng.setStartBefore(caretContainer);
|
127 |
-
rng.setEndBefore(caretContainer);
|
128 |
-
|
129 |
-
child = findFirstTextNode(caretContainer);
|
130 |
-
if (child && child.nodeValue.charAt(0) == invisibleChar) {
|
131 |
-
child = child.deleteData(0, 1);
|
132 |
-
}
|
133 |
-
|
134 |
-
dom.remove(caretContainer, true);
|
135 |
-
|
136 |
-
selection.setRng(rng);
|
137 |
-
} else {
|
138 |
-
currentCaretContainer = getParentCaretContainer(selection.getStart());
|
139 |
-
while ((caretContainer = dom.get(caretContainerId)) && caretContainer !== lastContainer) {
|
140 |
-
if (currentCaretContainer !== caretContainer) {
|
141 |
-
child = findFirstTextNode(caretContainer);
|
142 |
-
if (child && child.nodeValue.charAt(0) == invisibleChar) {
|
143 |
-
child = child.deleteData(0, 1);
|
144 |
-
}
|
145 |
-
|
146 |
-
dom.remove(caretContainer, true);
|
147 |
-
}
|
148 |
-
|
149 |
-
lastContainer = caretContainer;
|
150 |
-
}
|
151 |
-
}
|
152 |
-
};
|
153 |
-
|
154 |
-
// Modifies the selection to include contentEditable false elements or insert caret containers
|
155 |
-
function moveSelection() {
|
156 |
-
var nonEditableStart, nonEditableEnd, isCollapsed, rng, element;
|
157 |
-
|
158 |
-
// Checks if there is any contents to the left/right side of caret returns the noneditable element or any editable element if it finds one inside
|
159 |
-
function hasSideContent(element, left) {
|
160 |
-
var container, offset, walker, node, len;
|
161 |
-
|
162 |
-
container = rng.startContainer;
|
163 |
-
offset = rng.startOffset;
|
164 |
-
|
165 |
-
// If endpoint is in middle of text node then expand to beginning/end of element
|
166 |
-
if (container.nodeType == 3) {
|
167 |
-
len = container.nodeValue.length;
|
168 |
-
if ((offset > 0 && offset < len) || (left ? offset == len : offset == 0)) {
|
169 |
-
return;
|
170 |
-
}
|
171 |
-
} else {
|
172 |
-
// Can we resolve the node by index
|
173 |
-
if (offset < container.childNodes.length) {
|
174 |
-
// Browser represents caret position as the offset at the start of an element. When moving right
|
175 |
-
// this is the element we are moving into so we consider our container to be child node at offset-1
|
176 |
-
var pos = !left && offset > 0 ? offset-1 : offset;
|
177 |
-
container = container.childNodes[pos];
|
178 |
-
if (container.hasChildNodes()) {
|
179 |
-
container = container.firstChild;
|
180 |
-
}
|
181 |
-
} else {
|
182 |
-
// If not then the caret is at the last position in it's container and the caret container should be inserted after the noneditable element
|
183 |
-
return !left ? element : null;
|
184 |
-
}
|
185 |
-
}
|
186 |
-
|
187 |
-
// Walk left/right to look for contents
|
188 |
-
walker = new TreeWalker(container, element);
|
189 |
-
while (node = walker[left ? 'prev' : 'next']()) {
|
190 |
-
if (node.nodeType === 3 && node.nodeValue.length > 0) {
|
191 |
-
return;
|
192 |
-
} else if (getContentEditable(node) === "true") {
|
193 |
-
// Found contentEditable=true element return this one to we can move the caret inside it
|
194 |
-
return node;
|
195 |
-
}
|
196 |
-
}
|
197 |
-
|
198 |
-
return element;
|
199 |
-
};
|
200 |
-
|
201 |
-
// Remove any existing caret containers
|
202 |
-
removeCaretContainer();
|
203 |
-
|
204 |
-
// Get noneditable start/end elements
|
205 |
-
isCollapsed = selection.isCollapsed();
|
206 |
-
nonEditableStart = getNonEditableParent(selection.getStart());
|
207 |
-
nonEditableEnd = getNonEditableParent(selection.getEnd());
|
208 |
-
|
209 |
-
// Is any fo the range endpoints noneditable
|
210 |
-
if (nonEditableStart || nonEditableEnd) {
|
211 |
-
rng = selection.getRng(true);
|
212 |
-
|
213 |
-
// If it's a caret selection then look left/right to see if we need to move the caret out side or expand
|
214 |
-
if (isCollapsed) {
|
215 |
-
nonEditableStart = nonEditableStart || nonEditableEnd;
|
216 |
-
var start = selection.getStart();
|
217 |
-
if (element = hasSideContent(nonEditableStart, true)) {
|
218 |
-
// We have no contents to the left of the caret then insert a caret container before the noneditable element
|
219 |
-
insertCaretContainerOrExpandToBlock(element, true);
|
220 |
-
} else if (element = hasSideContent(nonEditableStart, false)) {
|
221 |
-
// We have no contents to the right of the caret then insert a caret container after the noneditable element
|
222 |
-
insertCaretContainerOrExpandToBlock(element, false);
|
223 |
-
} else {
|
224 |
-
// We are in the middle of a noneditable so expand to select it
|
225 |
-
selection.select(nonEditableStart);
|
226 |
-
}
|
227 |
-
} else {
|
228 |
-
rng = selection.getRng(true);
|
229 |
-
|
230 |
-
// Expand selection to include start non editable element
|
231 |
-
if (nonEditableStart) {
|
232 |
-
rng.setStartBefore(nonEditableStart);
|
233 |
-
}
|
234 |
-
|
235 |
-
// Expand selection to include end non editable element
|
236 |
-
if (nonEditableEnd) {
|
237 |
-
rng.setEndAfter(nonEditableEnd);
|
238 |
-
}
|
239 |
-
|
240 |
-
selection.setRng(rng);
|
241 |
-
}
|
242 |
-
}
|
243 |
-
};
|
244 |
-
|
245 |
-
function handleKey(ed, e) {
|
246 |
-
var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement;
|
247 |
-
|
248 |
-
function getNonEmptyTextNodeSibling(node, prev) {
|
249 |
-
while (node = node[prev ? 'previousSibling' : 'nextSibling']) {
|
250 |
-
if (node.nodeType !== 3 || node.nodeValue.length > 0) {
|
251 |
-
return node;
|
252 |
-
}
|
253 |
-
}
|
254 |
-
};
|
255 |
-
|
256 |
-
function positionCaretOnElement(element, start) {
|
257 |
-
selection.select(element);
|
258 |
-
selection.collapse(start);
|
259 |
-
}
|
260 |
-
|
261 |
-
function canDelete(backspace) {
|
262 |
-
var rng, container, offset, nonEditableParent;
|
263 |
-
|
264 |
-
function removeNodeIfNotParent(node) {
|
265 |
-
var parent = container;
|
266 |
-
|
267 |
-
while (parent) {
|
268 |
-
if (parent === node) {
|
269 |
-
return;
|
270 |
-
}
|
271 |
-
|
272 |
-
parent = parent.parentNode;
|
273 |
-
}
|
274 |
-
|
275 |
-
dom.remove(node);
|
276 |
-
moveSelection();
|
277 |
-
}
|
278 |
-
|
279 |
-
function isNextPrevTreeNodeNonEditable() {
|
280 |
-
var node, walker, nonEmptyElements = ed.schema.getNonEmptyElements();
|
281 |
-
|
282 |
-
walker = new tinymce.dom.TreeWalker(container, ed.getBody());
|
283 |
-
while (node = (backspace ? walker.prev() : walker.next())) {
|
284 |
-
// Found IMG/INPUT etc
|
285 |
-
if (nonEmptyElements[node.nodeName.toLowerCase()]) {
|
286 |
-
break;
|
287 |
-
}
|
288 |
-
|
289 |
-
// Found text node with contents
|
290 |
-
if (node.nodeType === 3 && tinymce.trim(node.nodeValue).length > 0) {
|
291 |
-
break;
|
292 |
-
}
|
293 |
-
|
294 |
-
// Found non editable node
|
295 |
-
if (getContentEditable(node) === "false") {
|
296 |
-
removeNodeIfNotParent(node);
|
297 |
-
return true;
|
298 |
-
}
|
299 |
-
}
|
300 |
-
|
301 |
-
// Check if the content node is within a non editable parent
|
302 |
-
if (getNonEditableParent(node)) {
|
303 |
-
return true;
|
304 |
-
}
|
305 |
-
|
306 |
-
return false;
|
307 |
-
}
|
308 |
-
|
309 |
-
if (selection.isCollapsed()) {
|
310 |
-
rng = selection.getRng(true);
|
311 |
-
container = rng.startContainer;
|
312 |
-
offset = rng.startOffset;
|
313 |
-
container = getParentCaretContainer(container) || container;
|
314 |
-
|
315 |
-
// Is in noneditable parent
|
316 |
-
if (nonEditableParent = getNonEditableParent(container)) {
|
317 |
-
removeNodeIfNotParent(nonEditableParent);
|
318 |
-
return false;
|
319 |
-
}
|
320 |
-
|
321 |
-
// Check if the caret is in the middle of a text node
|
322 |
-
if (container.nodeType == 3 && (backspace ? offset > 0 : offset < container.nodeValue.length)) {
|
323 |
-
return true;
|
324 |
-
}
|
325 |
-
|
326 |
-
// Resolve container index
|
327 |
-
if (container.nodeType == 1) {
|
328 |
-
container = container.childNodes[offset] || container;
|
329 |
-
}
|
330 |
-
|
331 |
-
// Check if previous or next tree node is non editable then block the event
|
332 |
-
if (isNextPrevTreeNodeNonEditable()) {
|
333 |
-
return false;
|
334 |
-
}
|
335 |
-
}
|
336 |
-
|
337 |
-
return true;
|
338 |
-
}
|
339 |
-
|
340 |
-
startElement = selection.getStart()
|
341 |
-
endElement = selection.getEnd();
|
342 |
-
|
343 |
-
// Disable all key presses in contentEditable=false except delete or backspace
|
344 |
-
nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement);
|
345 |
-
if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) {
|
346 |
-
// Is Ctrl+c, Ctrl+v or Ctrl+x then use default browser behavior
|
347 |
-
if ((tinymce.isMac ? e.metaKey : e.ctrlKey) && (keyCode == 67 || keyCode == 88 || keyCode == 86)) {
|
348 |
-
return;
|
349 |
-
}
|
350 |
-
|
351 |
-
e.preventDefault();
|
352 |
-
|
353 |
-
// Arrow left/right select the element and collapse left/right
|
354 |
-
if (keyCode == VK.LEFT || keyCode == VK.RIGHT) {
|
355 |
-
var left = keyCode == VK.LEFT;
|
356 |
-
// If a block element find previous or next element to position the caret
|
357 |
-
if (ed.dom.isBlock(nonEditableParent)) {
|
358 |
-
var targetElement = left ? nonEditableParent.previousSibling : nonEditableParent.nextSibling;
|
359 |
-
var walker = new TreeWalker(targetElement, targetElement);
|
360 |
-
var caretElement = left ? walker.prev() : walker.next();
|
361 |
-
positionCaretOnElement(caretElement, !left);
|
362 |
-
} else {
|
363 |
-
positionCaretOnElement(nonEditableParent, left);
|
364 |
-
}
|
365 |
-
}
|
366 |
-
} else {
|
367 |
-
// Is arrow left/right, backspace or delete
|
368 |
-
if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) {
|
369 |
-
caretContainer = getParentCaretContainer(startElement);
|
370 |
-
if (caretContainer) {
|
371 |
-
// Arrow left or backspace
|
372 |
-
if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) {
|
373 |
-
nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true);
|
374 |
-
|
375 |
-
if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
|
376 |
-
e.preventDefault();
|
377 |
-
|
378 |
-
if (keyCode == VK.LEFT) {
|
379 |
-
positionCaretOnElement(nonEditableParent, true);
|
380 |
-
} else {
|
381 |
-
dom.remove(nonEditableParent);
|
382 |
-
return;
|
383 |
-
}
|
384 |
-
} else {
|
385 |
-
removeCaretContainer(caretContainer);
|
386 |
-
}
|
387 |
-
}
|
388 |
-
|
389 |
-
// Arrow right or delete
|
390 |
-
if (keyCode == VK.RIGHT || keyCode == VK.DELETE) {
|
391 |
-
nonEditableParent = getNonEmptyTextNodeSibling(caretContainer);
|
392 |
-
|
393 |
-
if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
|
394 |
-
e.preventDefault();
|
395 |
-
|
396 |
-
if (keyCode == VK.RIGHT) {
|
397 |
-
positionCaretOnElement(nonEditableParent, false);
|
398 |
-
} else {
|
399 |
-
dom.remove(nonEditableParent);
|
400 |
-
return;
|
401 |
-
}
|
402 |
-
} else {
|
403 |
-
removeCaretContainer(caretContainer);
|
404 |
-
}
|
405 |
-
}
|
406 |
-
}
|
407 |
-
|
408 |
-
if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) {
|
409 |
-
e.preventDefault();
|
410 |
-
return false;
|
411 |
-
}
|
412 |
-
}
|
413 |
-
}
|
414 |
-
};
|
415 |
-
|
416 |
-
ed.onMouseDown.addToTop(function(ed, e) {
|
417 |
-
var node = ed.selection.getNode();
|
418 |
-
|
419 |
-
if (getContentEditable(node) === "false" && node == e.target) {
|
420 |
-
// Expand selection on mouse down we can't block the default event since it's used for drag/drop
|
421 |
-
moveSelection();
|
422 |
-
}
|
423 |
-
});
|
424 |
-
|
425 |
-
ed.onMouseUp.addToTop(moveSelection);
|
426 |
-
ed.onKeyDown.addToTop(handleKey);
|
427 |
-
ed.onKeyUp.addToTop(moveSelection);
|
428 |
-
};
|
429 |
-
|
430 |
-
tinymce.create('tinymce.plugins.NonEditablePlugin', {
|
431 |
-
init : function(ed, url) {
|
432 |
-
var editClass, nonEditClass, nonEditableRegExps;
|
433 |
-
|
434 |
-
// Converts configured regexps to noneditable span items
|
435 |
-
function convertRegExpsToNonEditable(ed, args) {
|
436 |
-
var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass);
|
437 |
-
|
438 |
-
// Don't replace the variables when raw is used for example on undo/redo
|
439 |
-
if (args.format == "raw") {
|
440 |
-
return;
|
441 |
-
}
|
442 |
-
|
443 |
-
while (i--) {
|
444 |
-
content = content.replace(nonEditableRegExps[i], function(match) {
|
445 |
-
var args = arguments, index = args[args.length - 2];
|
446 |
-
|
447 |
-
// Is value inside an attribute then don't replace
|
448 |
-
if (index > 0 && content.charAt(index - 1) == '"') {
|
449 |
-
return match;
|
450 |
-
}
|
451 |
-
|
452 |
-
return '<span class="' + cls + '" data-mce-content="' + ed.dom.encode(args[0]) + '">' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + '</span>';
|
453 |
-
});
|
454 |
-
}
|
455 |
-
|
456 |
-
args.content = content;
|
457 |
-
};
|
458 |
-
|
459 |
-
editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " ";
|
460 |
-
nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " ";
|
461 |
-
|
462 |
-
// Setup noneditable regexps array
|
463 |
-
nonEditableRegExps = ed.getParam("noneditable_regexp");
|
464 |
-
if (nonEditableRegExps && !nonEditableRegExps.length) {
|
465 |
-
nonEditableRegExps = [nonEditableRegExps];
|
466 |
-
}
|
467 |
-
|
468 |
-
ed.onPreInit.add(function() {
|
469 |
-
handleContentEditableSelection(ed);
|
470 |
-
|
471 |
-
if (nonEditableRegExps) {
|
472 |
-
ed.selection.onBeforeSetContent.add(convertRegExpsToNonEditable);
|
473 |
-
ed.onBeforeSetContent.add(convertRegExpsToNonEditable);
|
474 |
-
}
|
475 |
-
|
476 |
-
// Apply contentEditable true/false on elements with the noneditable/editable classes
|
477 |
-
ed.parser.addAttributeFilter('class', function(nodes) {
|
478 |
-
var i = nodes.length, className, node;
|
479 |
-
|
480 |
-
while (i--) {
|
481 |
-
node = nodes[i];
|
482 |
-
className = " " + node.attr("class") + " ";
|
483 |
-
|
484 |
-
if (className.indexOf(editClass) !== -1) {
|
485 |
-
node.attr(internalName, "true");
|
486 |
-
} else if (className.indexOf(nonEditClass) !== -1) {
|
487 |
-
node.attr(internalName, "false");
|
488 |
-
}
|
489 |
-
}
|
490 |
-
});
|
491 |
-
|
492 |
-
// Remove internal name
|
493 |
-
ed.serializer.addAttributeFilter(internalName, function(nodes, name) {
|
494 |
-
var i = nodes.length, node;
|
495 |
-
|
496 |
-
while (i--) {
|
497 |
-
node = nodes[i];
|
498 |
-
|
499 |
-
if (nonEditableRegExps && node.attr('data-mce-content')) {
|
500 |
-
node.name = "#text";
|
501 |
-
node.type = 3;
|
502 |
-
node.raw = true;
|
503 |
-
node.value = node.attr('data-mce-content');
|
504 |
-
} else {
|
505 |
-
node.attr(externalName, null);
|
506 |
-
node.attr(internalName, null);
|
507 |
-
}
|
508 |
-
}
|
509 |
-
});
|
510 |
-
|
511 |
-
// Convert external name into internal name
|
512 |
-
ed.parser.addAttributeFilter(externalName, function(nodes, name) {
|
513 |
-
var i = nodes.length, node;
|
514 |
-
|
515 |
-
while (i--) {
|
516 |
-
node = nodes[i];
|
517 |
-
node.attr(internalName, node.attr(externalName));
|
518 |
-
node.attr(externalName, null);
|
519 |
-
}
|
520 |
-
});
|
521 |
-
});
|
522 |
-
},
|
523 |
-
|
524 |
-
getInfo : function() {
|
525 |
-
return {
|
526 |
-
longname : 'Non editable elements',
|
527 |
-
author : 'Moxiecode Systems AB',
|
528 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
529 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',
|
530 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
531 |
-
};
|
532 |
-
}
|
533 |
-
});
|
534 |
-
|
535 |
-
// Register plugin
|
536 |
-
tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin);
|
537 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var TreeWalker = tinymce.dom.TreeWalker;
|
13 |
+
var externalName = 'contenteditable', internalName = 'data-mce-' + externalName;
|
14 |
+
var VK = tinymce.VK;
|
15 |
+
|
16 |
+
function handleContentEditableSelection(ed) {
|
17 |
+
var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF';
|
18 |
+
|
19 |
+
// Returns the content editable state of a node "true/false" or null
|
20 |
+
function getContentEditable(node) {
|
21 |
+
var contentEditable;
|
22 |
+
|
23 |
+
// Ignore non elements
|
24 |
+
if (node.nodeType === 1) {
|
25 |
+
// Check for fake content editable
|
26 |
+
contentEditable = node.getAttribute(internalName);
|
27 |
+
if (contentEditable && contentEditable !== "inherit") {
|
28 |
+
return contentEditable;
|
29 |
+
}
|
30 |
+
|
31 |
+
// Check for real content editable
|
32 |
+
contentEditable = node.contentEditable;
|
33 |
+
if (contentEditable !== "inherit") {
|
34 |
+
return contentEditable;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
return null;
|
39 |
+
};
|
40 |
+
|
41 |
+
// Returns the noneditable parent or null if there is a editable before it or if it wasn't found
|
42 |
+
function getNonEditableParent(node) {
|
43 |
+
var state;
|
44 |
+
|
45 |
+
while (node) {
|
46 |
+
state = getContentEditable(node);
|
47 |
+
if (state) {
|
48 |
+
return state === "false" ? node : null;
|
49 |
+
}
|
50 |
+
|
51 |
+
node = node.parentNode;
|
52 |
+
}
|
53 |
+
};
|
54 |
+
|
55 |
+
// Get caret container parent for the specified node
|
56 |
+
function getParentCaretContainer(node) {
|
57 |
+
while (node) {
|
58 |
+
if (node.id === caretContainerId) {
|
59 |
+
return node;
|
60 |
+
}
|
61 |
+
|
62 |
+
node = node.parentNode;
|
63 |
+
}
|
64 |
+
};
|
65 |
+
|
66 |
+
// Finds the first text node in the specified node
|
67 |
+
function findFirstTextNode(node) {
|
68 |
+
var walker;
|
69 |
+
|
70 |
+
if (node) {
|
71 |
+
walker = new TreeWalker(node, node);
|
72 |
+
|
73 |
+
for (node = walker.current(); node; node = walker.next()) {
|
74 |
+
if (node.nodeType === 3) {
|
75 |
+
return node;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
};
|
80 |
+
|
81 |
+
// Insert caret container before/after target or expand selection to include block
|
82 |
+
function insertCaretContainerOrExpandToBlock(target, before) {
|
83 |
+
var caretContainer, rng;
|
84 |
+
|
85 |
+
// Select block
|
86 |
+
if (getContentEditable(target) === "false") {
|
87 |
+
if (dom.isBlock(target)) {
|
88 |
+
selection.select(target);
|
89 |
+
return;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
rng = dom.createRng();
|
94 |
+
|
95 |
+
if (getContentEditable(target) === "true") {
|
96 |
+
if (!target.firstChild) {
|
97 |
+
target.appendChild(ed.getDoc().createTextNode('\u00a0'));
|
98 |
+
}
|
99 |
+
|
100 |
+
target = target.firstChild;
|
101 |
+
before = true;
|
102 |
+
}
|
103 |
+
|
104 |
+
//caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style:'border: 1px solid red'}, invisibleChar);
|
105 |
+
caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true}, invisibleChar);
|
106 |
+
|
107 |
+
if (before) {
|
108 |
+
target.parentNode.insertBefore(caretContainer, target);
|
109 |
+
} else {
|
110 |
+
dom.insertAfter(caretContainer, target);
|
111 |
+
}
|
112 |
+
|
113 |
+
rng.setStart(caretContainer.firstChild, 1);
|
114 |
+
rng.collapse(true);
|
115 |
+
selection.setRng(rng);
|
116 |
+
|
117 |
+
return caretContainer;
|
118 |
+
};
|
119 |
+
|
120 |
+
// Removes any caret container except the one we might be in
|
121 |
+
function removeCaretContainer(caretContainer) {
|
122 |
+
var child, currentCaretContainer, lastContainer;
|
123 |
+
|
124 |
+
if (caretContainer) {
|
125 |
+
rng = selection.getRng(true);
|
126 |
+
rng.setStartBefore(caretContainer);
|
127 |
+
rng.setEndBefore(caretContainer);
|
128 |
+
|
129 |
+
child = findFirstTextNode(caretContainer);
|
130 |
+
if (child && child.nodeValue.charAt(0) == invisibleChar) {
|
131 |
+
child = child.deleteData(0, 1);
|
132 |
+
}
|
133 |
+
|
134 |
+
dom.remove(caretContainer, true);
|
135 |
+
|
136 |
+
selection.setRng(rng);
|
137 |
+
} else {
|
138 |
+
currentCaretContainer = getParentCaretContainer(selection.getStart());
|
139 |
+
while ((caretContainer = dom.get(caretContainerId)) && caretContainer !== lastContainer) {
|
140 |
+
if (currentCaretContainer !== caretContainer) {
|
141 |
+
child = findFirstTextNode(caretContainer);
|
142 |
+
if (child && child.nodeValue.charAt(0) == invisibleChar) {
|
143 |
+
child = child.deleteData(0, 1);
|
144 |
+
}
|
145 |
+
|
146 |
+
dom.remove(caretContainer, true);
|
147 |
+
}
|
148 |
+
|
149 |
+
lastContainer = caretContainer;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
};
|
153 |
+
|
154 |
+
// Modifies the selection to include contentEditable false elements or insert caret containers
|
155 |
+
function moveSelection() {
|
156 |
+
var nonEditableStart, nonEditableEnd, isCollapsed, rng, element;
|
157 |
+
|
158 |
+
// Checks if there is any contents to the left/right side of caret returns the noneditable element or any editable element if it finds one inside
|
159 |
+
function hasSideContent(element, left) {
|
160 |
+
var container, offset, walker, node, len;
|
161 |
+
|
162 |
+
container = rng.startContainer;
|
163 |
+
offset = rng.startOffset;
|
164 |
+
|
165 |
+
// If endpoint is in middle of text node then expand to beginning/end of element
|
166 |
+
if (container.nodeType == 3) {
|
167 |
+
len = container.nodeValue.length;
|
168 |
+
if ((offset > 0 && offset < len) || (left ? offset == len : offset == 0)) {
|
169 |
+
return;
|
170 |
+
}
|
171 |
+
} else {
|
172 |
+
// Can we resolve the node by index
|
173 |
+
if (offset < container.childNodes.length) {
|
174 |
+
// Browser represents caret position as the offset at the start of an element. When moving right
|
175 |
+
// this is the element we are moving into so we consider our container to be child node at offset-1
|
176 |
+
var pos = !left && offset > 0 ? offset-1 : offset;
|
177 |
+
container = container.childNodes[pos];
|
178 |
+
if (container.hasChildNodes()) {
|
179 |
+
container = container.firstChild;
|
180 |
+
}
|
181 |
+
} else {
|
182 |
+
// If not then the caret is at the last position in it's container and the caret container should be inserted after the noneditable element
|
183 |
+
return !left ? element : null;
|
184 |
+
}
|
185 |
+
}
|
186 |
+
|
187 |
+
// Walk left/right to look for contents
|
188 |
+
walker = new TreeWalker(container, element);
|
189 |
+
while (node = walker[left ? 'prev' : 'next']()) {
|
190 |
+
if (node.nodeType === 3 && node.nodeValue.length > 0) {
|
191 |
+
return;
|
192 |
+
} else if (getContentEditable(node) === "true") {
|
193 |
+
// Found contentEditable=true element return this one to we can move the caret inside it
|
194 |
+
return node;
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
return element;
|
199 |
+
};
|
200 |
+
|
201 |
+
// Remove any existing caret containers
|
202 |
+
removeCaretContainer();
|
203 |
+
|
204 |
+
// Get noneditable start/end elements
|
205 |
+
isCollapsed = selection.isCollapsed();
|
206 |
+
nonEditableStart = getNonEditableParent(selection.getStart());
|
207 |
+
nonEditableEnd = getNonEditableParent(selection.getEnd());
|
208 |
+
|
209 |
+
// Is any fo the range endpoints noneditable
|
210 |
+
if (nonEditableStart || nonEditableEnd) {
|
211 |
+
rng = selection.getRng(true);
|
212 |
+
|
213 |
+
// If it's a caret selection then look left/right to see if we need to move the caret out side or expand
|
214 |
+
if (isCollapsed) {
|
215 |
+
nonEditableStart = nonEditableStart || nonEditableEnd;
|
216 |
+
var start = selection.getStart();
|
217 |
+
if (element = hasSideContent(nonEditableStart, true)) {
|
218 |
+
// We have no contents to the left of the caret then insert a caret container before the noneditable element
|
219 |
+
insertCaretContainerOrExpandToBlock(element, true);
|
220 |
+
} else if (element = hasSideContent(nonEditableStart, false)) {
|
221 |
+
// We have no contents to the right of the caret then insert a caret container after the noneditable element
|
222 |
+
insertCaretContainerOrExpandToBlock(element, false);
|
223 |
+
} else {
|
224 |
+
// We are in the middle of a noneditable so expand to select it
|
225 |
+
selection.select(nonEditableStart);
|
226 |
+
}
|
227 |
+
} else {
|
228 |
+
rng = selection.getRng(true);
|
229 |
+
|
230 |
+
// Expand selection to include start non editable element
|
231 |
+
if (nonEditableStart) {
|
232 |
+
rng.setStartBefore(nonEditableStart);
|
233 |
+
}
|
234 |
+
|
235 |
+
// Expand selection to include end non editable element
|
236 |
+
if (nonEditableEnd) {
|
237 |
+
rng.setEndAfter(nonEditableEnd);
|
238 |
+
}
|
239 |
+
|
240 |
+
selection.setRng(rng);
|
241 |
+
}
|
242 |
+
}
|
243 |
+
};
|
244 |
+
|
245 |
+
function handleKey(ed, e) {
|
246 |
+
var keyCode = e.keyCode, nonEditableParent, caretContainer, startElement, endElement;
|
247 |
+
|
248 |
+
function getNonEmptyTextNodeSibling(node, prev) {
|
249 |
+
while (node = node[prev ? 'previousSibling' : 'nextSibling']) {
|
250 |
+
if (node.nodeType !== 3 || node.nodeValue.length > 0) {
|
251 |
+
return node;
|
252 |
+
}
|
253 |
+
}
|
254 |
+
};
|
255 |
+
|
256 |
+
function positionCaretOnElement(element, start) {
|
257 |
+
selection.select(element);
|
258 |
+
selection.collapse(start);
|
259 |
+
}
|
260 |
+
|
261 |
+
function canDelete(backspace) {
|
262 |
+
var rng, container, offset, nonEditableParent;
|
263 |
+
|
264 |
+
function removeNodeIfNotParent(node) {
|
265 |
+
var parent = container;
|
266 |
+
|
267 |
+
while (parent) {
|
268 |
+
if (parent === node) {
|
269 |
+
return;
|
270 |
+
}
|
271 |
+
|
272 |
+
parent = parent.parentNode;
|
273 |
+
}
|
274 |
+
|
275 |
+
dom.remove(node);
|
276 |
+
moveSelection();
|
277 |
+
}
|
278 |
+
|
279 |
+
function isNextPrevTreeNodeNonEditable() {
|
280 |
+
var node, walker, nonEmptyElements = ed.schema.getNonEmptyElements();
|
281 |
+
|
282 |
+
walker = new tinymce.dom.TreeWalker(container, ed.getBody());
|
283 |
+
while (node = (backspace ? walker.prev() : walker.next())) {
|
284 |
+
// Found IMG/INPUT etc
|
285 |
+
if (nonEmptyElements[node.nodeName.toLowerCase()]) {
|
286 |
+
break;
|
287 |
+
}
|
288 |
+
|
289 |
+
// Found text node with contents
|
290 |
+
if (node.nodeType === 3 && tinymce.trim(node.nodeValue).length > 0) {
|
291 |
+
break;
|
292 |
+
}
|
293 |
+
|
294 |
+
// Found non editable node
|
295 |
+
if (getContentEditable(node) === "false") {
|
296 |
+
removeNodeIfNotParent(node);
|
297 |
+
return true;
|
298 |
+
}
|
299 |
+
}
|
300 |
+
|
301 |
+
// Check if the content node is within a non editable parent
|
302 |
+
if (getNonEditableParent(node)) {
|
303 |
+
return true;
|
304 |
+
}
|
305 |
+
|
306 |
+
return false;
|
307 |
+
}
|
308 |
+
|
309 |
+
if (selection.isCollapsed()) {
|
310 |
+
rng = selection.getRng(true);
|
311 |
+
container = rng.startContainer;
|
312 |
+
offset = rng.startOffset;
|
313 |
+
container = getParentCaretContainer(container) || container;
|
314 |
+
|
315 |
+
// Is in noneditable parent
|
316 |
+
if (nonEditableParent = getNonEditableParent(container)) {
|
317 |
+
removeNodeIfNotParent(nonEditableParent);
|
318 |
+
return false;
|
319 |
+
}
|
320 |
+
|
321 |
+
// Check if the caret is in the middle of a text node
|
322 |
+
if (container.nodeType == 3 && (backspace ? offset > 0 : offset < container.nodeValue.length)) {
|
323 |
+
return true;
|
324 |
+
}
|
325 |
+
|
326 |
+
// Resolve container index
|
327 |
+
if (container.nodeType == 1) {
|
328 |
+
container = container.childNodes[offset] || container;
|
329 |
+
}
|
330 |
+
|
331 |
+
// Check if previous or next tree node is non editable then block the event
|
332 |
+
if (isNextPrevTreeNodeNonEditable()) {
|
333 |
+
return false;
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
return true;
|
338 |
+
}
|
339 |
+
|
340 |
+
startElement = selection.getStart()
|
341 |
+
endElement = selection.getEnd();
|
342 |
+
|
343 |
+
// Disable all key presses in contentEditable=false except delete or backspace
|
344 |
+
nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement);
|
345 |
+
if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) {
|
346 |
+
// Is Ctrl+c, Ctrl+v or Ctrl+x then use default browser behavior
|
347 |
+
if ((tinymce.isMac ? e.metaKey : e.ctrlKey) && (keyCode == 67 || keyCode == 88 || keyCode == 86)) {
|
348 |
+
return;
|
349 |
+
}
|
350 |
+
|
351 |
+
e.preventDefault();
|
352 |
+
|
353 |
+
// Arrow left/right select the element and collapse left/right
|
354 |
+
if (keyCode == VK.LEFT || keyCode == VK.RIGHT) {
|
355 |
+
var left = keyCode == VK.LEFT;
|
356 |
+
// If a block element find previous or next element to position the caret
|
357 |
+
if (ed.dom.isBlock(nonEditableParent)) {
|
358 |
+
var targetElement = left ? nonEditableParent.previousSibling : nonEditableParent.nextSibling;
|
359 |
+
var walker = new TreeWalker(targetElement, targetElement);
|
360 |
+
var caretElement = left ? walker.prev() : walker.next();
|
361 |
+
positionCaretOnElement(caretElement, !left);
|
362 |
+
} else {
|
363 |
+
positionCaretOnElement(nonEditableParent, left);
|
364 |
+
}
|
365 |
+
}
|
366 |
+
} else {
|
367 |
+
// Is arrow left/right, backspace or delete
|
368 |
+
if (keyCode == VK.LEFT || keyCode == VK.RIGHT || keyCode == VK.BACKSPACE || keyCode == VK.DELETE) {
|
369 |
+
caretContainer = getParentCaretContainer(startElement);
|
370 |
+
if (caretContainer) {
|
371 |
+
// Arrow left or backspace
|
372 |
+
if (keyCode == VK.LEFT || keyCode == VK.BACKSPACE) {
|
373 |
+
nonEditableParent = getNonEmptyTextNodeSibling(caretContainer, true);
|
374 |
+
|
375 |
+
if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
|
376 |
+
e.preventDefault();
|
377 |
+
|
378 |
+
if (keyCode == VK.LEFT) {
|
379 |
+
positionCaretOnElement(nonEditableParent, true);
|
380 |
+
} else {
|
381 |
+
dom.remove(nonEditableParent);
|
382 |
+
return;
|
383 |
+
}
|
384 |
+
} else {
|
385 |
+
removeCaretContainer(caretContainer);
|
386 |
+
}
|
387 |
+
}
|
388 |
+
|
389 |
+
// Arrow right or delete
|
390 |
+
if (keyCode == VK.RIGHT || keyCode == VK.DELETE) {
|
391 |
+
nonEditableParent = getNonEmptyTextNodeSibling(caretContainer);
|
392 |
+
|
393 |
+
if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
|
394 |
+
e.preventDefault();
|
395 |
+
|
396 |
+
if (keyCode == VK.RIGHT) {
|
397 |
+
positionCaretOnElement(nonEditableParent, false);
|
398 |
+
} else {
|
399 |
+
dom.remove(nonEditableParent);
|
400 |
+
return;
|
401 |
+
}
|
402 |
+
} else {
|
403 |
+
removeCaretContainer(caretContainer);
|
404 |
+
}
|
405 |
+
}
|
406 |
+
}
|
407 |
+
|
408 |
+
if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) {
|
409 |
+
e.preventDefault();
|
410 |
+
return false;
|
411 |
+
}
|
412 |
+
}
|
413 |
+
}
|
414 |
+
};
|
415 |
+
|
416 |
+
ed.onMouseDown.addToTop(function(ed, e) {
|
417 |
+
var node = ed.selection.getNode();
|
418 |
+
|
419 |
+
if (getContentEditable(node) === "false" && node == e.target) {
|
420 |
+
// Expand selection on mouse down we can't block the default event since it's used for drag/drop
|
421 |
+
moveSelection();
|
422 |
+
}
|
423 |
+
});
|
424 |
+
|
425 |
+
ed.onMouseUp.addToTop(moveSelection);
|
426 |
+
ed.onKeyDown.addToTop(handleKey);
|
427 |
+
ed.onKeyUp.addToTop(moveSelection);
|
428 |
+
};
|
429 |
+
|
430 |
+
tinymce.create('tinymce.plugins.NonEditablePlugin', {
|
431 |
+
init : function(ed, url) {
|
432 |
+
var editClass, nonEditClass, nonEditableRegExps;
|
433 |
+
|
434 |
+
// Converts configured regexps to noneditable span items
|
435 |
+
function convertRegExpsToNonEditable(ed, args) {
|
436 |
+
var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass);
|
437 |
+
|
438 |
+
// Don't replace the variables when raw is used for example on undo/redo
|
439 |
+
if (args.format == "raw") {
|
440 |
+
return;
|
441 |
+
}
|
442 |
+
|
443 |
+
while (i--) {
|
444 |
+
content = content.replace(nonEditableRegExps[i], function(match) {
|
445 |
+
var args = arguments, index = args[args.length - 2];
|
446 |
+
|
447 |
+
// Is value inside an attribute then don't replace
|
448 |
+
if (index > 0 && content.charAt(index - 1) == '"') {
|
449 |
+
return match;
|
450 |
+
}
|
451 |
+
|
452 |
+
return '<span class="' + cls + '" data-mce-content="' + ed.dom.encode(args[0]) + '">' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + '</span>';
|
453 |
+
});
|
454 |
+
}
|
455 |
+
|
456 |
+
args.content = content;
|
457 |
+
};
|
458 |
+
|
459 |
+
editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " ";
|
460 |
+
nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " ";
|
461 |
+
|
462 |
+
// Setup noneditable regexps array
|
463 |
+
nonEditableRegExps = ed.getParam("noneditable_regexp");
|
464 |
+
if (nonEditableRegExps && !nonEditableRegExps.length) {
|
465 |
+
nonEditableRegExps = [nonEditableRegExps];
|
466 |
+
}
|
467 |
+
|
468 |
+
ed.onPreInit.add(function() {
|
469 |
+
handleContentEditableSelection(ed);
|
470 |
+
|
471 |
+
if (nonEditableRegExps) {
|
472 |
+
ed.selection.onBeforeSetContent.add(convertRegExpsToNonEditable);
|
473 |
+
ed.onBeforeSetContent.add(convertRegExpsToNonEditable);
|
474 |
+
}
|
475 |
+
|
476 |
+
// Apply contentEditable true/false on elements with the noneditable/editable classes
|
477 |
+
ed.parser.addAttributeFilter('class', function(nodes) {
|
478 |
+
var i = nodes.length, className, node;
|
479 |
+
|
480 |
+
while (i--) {
|
481 |
+
node = nodes[i];
|
482 |
+
className = " " + node.attr("class") + " ";
|
483 |
+
|
484 |
+
if (className.indexOf(editClass) !== -1) {
|
485 |
+
node.attr(internalName, "true");
|
486 |
+
} else if (className.indexOf(nonEditClass) !== -1) {
|
487 |
+
node.attr(internalName, "false");
|
488 |
+
}
|
489 |
+
}
|
490 |
+
});
|
491 |
+
|
492 |
+
// Remove internal name
|
493 |
+
ed.serializer.addAttributeFilter(internalName, function(nodes, name) {
|
494 |
+
var i = nodes.length, node;
|
495 |
+
|
496 |
+
while (i--) {
|
497 |
+
node = nodes[i];
|
498 |
+
|
499 |
+
if (nonEditableRegExps && node.attr('data-mce-content')) {
|
500 |
+
node.name = "#text";
|
501 |
+
node.type = 3;
|
502 |
+
node.raw = true;
|
503 |
+
node.value = node.attr('data-mce-content');
|
504 |
+
} else {
|
505 |
+
node.attr(externalName, null);
|
506 |
+
node.attr(internalName, null);
|
507 |
+
}
|
508 |
+
}
|
509 |
+
});
|
510 |
+
|
511 |
+
// Convert external name into internal name
|
512 |
+
ed.parser.addAttributeFilter(externalName, function(nodes, name) {
|
513 |
+
var i = nodes.length, node;
|
514 |
+
|
515 |
+
while (i--) {
|
516 |
+
node = nodes[i];
|
517 |
+
node.attr(internalName, node.attr(externalName));
|
518 |
+
node.attr(externalName, null);
|
519 |
+
}
|
520 |
+
});
|
521 |
+
});
|
522 |
+
},
|
523 |
+
|
524 |
+
getInfo : function() {
|
525 |
+
return {
|
526 |
+
longname : 'Non editable elements',
|
527 |
+
author : 'Moxiecode Systems AB',
|
528 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
529 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',
|
530 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
531 |
+
};
|
532 |
+
}
|
533 |
+
});
|
534 |
+
|
535 |
+
// Register plugin
|
536 |
+
tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin);
|
537 |
})();
|
js/libraries/tiny_mce/plugins/pagebreak/editor_plugin_src.js
CHANGED
@@ -1,74 +1,74 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.PageBreakPlugin', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
var pb = '<img src="' + ed.theme.url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE;
|
15 |
-
|
16 |
-
pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');
|
17 |
-
|
18 |
-
// Register commands
|
19 |
-
ed.addCommand('mcePageBreak', function() {
|
20 |
-
ed.execCommand('mceInsertContent', 0, pb);
|
21 |
-
});
|
22 |
-
|
23 |
-
// Register buttons
|
24 |
-
ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});
|
25 |
-
|
26 |
-
ed.onInit.add(function() {
|
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 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.PageBreakPlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var pb = '<img src="' + ed.theme.url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE;
|
15 |
+
|
16 |
+
pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');
|
17 |
+
|
18 |
+
// Register commands
|
19 |
+
ed.addCommand('mcePageBreak', function() {
|
20 |
+
ed.execCommand('mceInsertContent', 0, pb);
|
21 |
+
});
|
22 |
+
|
23 |
+
// Register buttons
|
24 |
+
ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});
|
25 |
+
|
26 |
+
ed.onInit.add(function() {
|
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 |
})();
|
js/libraries/tiny_mce/plugins/paste/editor_plugin_src.js
CHANGED
@@ -1,885 +1,885 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
var each = tinymce.each,
|
13 |
-
defs = {
|
14 |
-
paste_auto_cleanup_on_paste : true,
|
15 |
-
paste_enable_default_filters : true,
|
16 |
-
paste_block_drop : false,
|
17 |
-
paste_retain_style_properties : "none",
|
18 |
-
paste_strip_class_attributes : "mso",
|
19 |
-
paste_remove_spans : false,
|
20 |
-
paste_remove_styles : false,
|
21 |
-
paste_remove_styles_if_webkit : true,
|
22 |
-
paste_convert_middot_lists : true,
|
23 |
-
paste_convert_headers_to_strong : false,
|
24 |
-
paste_dialog_width : "450",
|
25 |
-
paste_dialog_height : "400",
|
26 |
-
paste_max_consecutive_linebreaks: 2,
|
27 |
-
paste_text_use_dialog : false,
|
28 |
-
paste_text_sticky : false,
|
29 |
-
paste_text_sticky_default : false,
|
30 |
-
paste_text_notifyalways : false,
|
31 |
-
paste_text_linebreaktype : "combined",
|
32 |
-
paste_text_replacements : [
|
33 |
-
[/\u2026/g, "..."],
|
34 |
-
[/[\x93\x94\u201c\u201d]/g, '"'],
|
35 |
-
[/[\x60\x91\x92\u2018\u2019]/g, "'"]
|
36 |
-
]
|
37 |
-
};
|
38 |
-
|
39 |
-
function getParam(ed, name) {
|
40 |
-
return ed.getParam(name, defs[name]);
|
41 |
-
}
|
42 |
-
|
43 |
-
tinymce.create('tinymce.plugins.PastePlugin', {
|
44 |
-
init : function(ed, url) {
|
45 |
-
var t = this;
|
46 |
-
|
47 |
-
t.editor = ed;
|
48 |
-
t.url = url;
|
49 |
-
|
50 |
-
// Setup plugin events
|
51 |
-
t.onPreProcess = new tinymce.util.Dispatcher(t);
|
52 |
-
t.onPostProcess = new tinymce.util.Dispatcher(t);
|
53 |
-
|
54 |
-
// Register default handlers
|
55 |
-
t.onPreProcess.add(t._preProcess);
|
56 |
-
t.onPostProcess.add(t._postProcess);
|
57 |
-
|
58 |
-
// Register optional preprocess handler
|
59 |
-
t.onPreProcess.add(function(pl, o) {
|
60 |
-
ed.execCallback('paste_preprocess', pl, o);
|
61 |
-
});
|
62 |
-
|
63 |
-
// Register optional postprocess
|
64 |
-
t.onPostProcess.add(function(pl, o) {
|
65 |
-
ed.execCallback('paste_postprocess', pl, o);
|
66 |
-
});
|
67 |
-
|
68 |
-
ed.onKeyDown.addToTop(function(ed, e) {
|
69 |
-
// Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that
|
70 |
-
if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
|
71 |
-
return false; // Stop other listeners
|
72 |
-
});
|
73 |
-
|
74 |
-
// Initialize plain text flag
|
75 |
-
ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default');
|
76 |
-
|
77 |
-
// This function executes the process handlers and inserts the contents
|
78 |
-
// force_rich overrides plain text mode set by user, important for pasting with execCommand
|
79 |
-
function process(o, force_rich) {
|
80 |
-
var dom = ed.dom, rng;
|
81 |
-
|
82 |
-
// Execute pre process handlers
|
83 |
-
t.onPreProcess.dispatch(t, o);
|
84 |
-
|
85 |
-
// Create DOM structure
|
86 |
-
o.node = dom.create('div', 0, o.content);
|
87 |
-
|
88 |
-
// If pasting inside the same element and the contents is only one block
|
89 |
-
// remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element
|
90 |
-
if (tinymce.isGecko) {
|
91 |
-
rng = ed.selection.getRng(true);
|
92 |
-
if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) {
|
93 |
-
// Is only one block node and it doesn't contain word stuff
|
94 |
-
if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1)
|
95 |
-
dom.remove(o.node.firstChild, true);
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
// Execute post process handlers
|
100 |
-
t.onPostProcess.dispatch(t, o);
|
101 |
-
|
102 |
-
// Serialize content
|
103 |
-
o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''});
|
104 |
-
|
105 |
-
// Plain text option active?
|
106 |
-
if ((!force_rich) && (ed.pasteAsPlainText)) {
|
107 |
-
t._insertPlainText(o.content);
|
108 |
-
|
109 |
-
if (!getParam(ed, "paste_text_sticky")) {
|
110 |
-
ed.pasteAsPlainText = false;
|
111 |
-
ed.controlManager.setActive("pastetext", false);
|
112 |
-
}
|
113 |
-
} else {
|
114 |
-
t._insert(o.content);
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
// Add command for external usage
|
119 |
-
ed.addCommand('mceInsertClipboardContent', function(u, o) {
|
120 |
-
process(o, true);
|
121 |
-
});
|
122 |
-
|
123 |
-
if (!getParam(ed, "paste_text_use_dialog")) {
|
124 |
-
ed.addCommand('mcePasteText', function(u, v) {
|
125 |
-
var cookie = tinymce.util.Cookie;
|
126 |
-
|
127 |
-
ed.pasteAsPlainText = !ed.pasteAsPlainText;
|
128 |
-
ed.controlManager.setActive('pastetext', ed.pasteAsPlainText);
|
129 |
-
|
130 |
-
if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) {
|
131 |
-
if (getParam(ed, "paste_text_sticky")) {
|
132 |
-
ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));
|
133 |
-
} else {
|
134 |
-
ed.windowManager.alert(ed.translate('paste.plaintext_mode'));
|
135 |
-
}
|
136 |
-
|
137 |
-
if (!getParam(ed, "paste_text_notifyalways")) {
|
138 |
-
cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31))
|
139 |
-
}
|
140 |
-
}
|
141 |
-
});
|
142 |
-
}
|
143 |
-
|
144 |
-
ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'});
|
145 |
-
ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'});
|
146 |
-
|
147 |
-
// This function grabs the contents from the clipboard by adding a
|
148 |
-
// hidden div and placing the caret inside it and after the browser paste
|
149 |
-
// is done it grabs that contents and processes that
|
150 |
-
function grabContent(e) {
|
151 |
-
var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent;
|
152 |
-
|
153 |
-
// Check if browser supports direct plaintext access
|
154 |
-
if (e.clipboardData || dom.doc.dataTransfer) {
|
155 |
-
textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text');
|
156 |
-
|
157 |
-
if (ed.pasteAsPlainText) {
|
158 |
-
e.preventDefault();
|
159 |
-
process({content : dom.encode(textContent).replace(/\r?\n/g, '<br />')});
|
160 |
-
return;
|
161 |
-
}
|
162 |
-
}
|
163 |
-
|
164 |
-
if (dom.get('_mcePaste'))
|
165 |
-
return;
|
166 |
-
|
167 |
-
// Create container to paste into
|
168 |
-
n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF');
|
169 |
-
|
170 |
-
// If contentEditable mode we need to find out the position of the closest element
|
171 |
-
if (body != ed.getDoc().body)
|
172 |
-
posY = dom.getPos(ed.selection.getStart(), body).y;
|
173 |
-
else
|
174 |
-
posY = body.scrollTop + dom.getViewPort(ed.getWin()).y;
|
175 |
-
|
176 |
-
// Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles
|
177 |
-
// If also needs to be in view on IE or the paste would fail
|
178 |
-
dom.setStyles(n, {
|
179 |
-
position : 'absolute',
|
180 |
-
left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div
|
181 |
-
top : posY - 25,
|
182 |
-
width : 1,
|
183 |
-
height : 1,
|
184 |
-
overflow : 'hidden'
|
185 |
-
});
|
186 |
-
|
187 |
-
if (tinymce.isIE) {
|
188 |
-
// Store away the old range
|
189 |
-
oldRng = sel.getRng();
|
190 |
-
|
191 |
-
// Select the container
|
192 |
-
rng = dom.doc.body.createTextRange();
|
193 |
-
rng.moveToElementText(n);
|
194 |
-
rng.execCommand('Paste');
|
195 |
-
|
196 |
-
// Remove container
|
197 |
-
dom.remove(n);
|
198 |
-
|
199 |
-
// Check if the contents was changed, if it wasn't then clipboard extraction failed probably due
|
200 |
-
// to IE security settings so we pass the junk though better than nothing right
|
201 |
-
if (n.innerHTML === '\uFEFF\uFEFF') {
|
202 |
-
ed.execCommand('mcePasteWord');
|
203 |
-
e.preventDefault();
|
204 |
-
return;
|
205 |
-
}
|
206 |
-
|
207 |
-
// Restore the old range and clear the contents before pasting
|
208 |
-
sel.setRng(oldRng);
|
209 |
-
sel.setContent('');
|
210 |
-
|
211 |
-
// For some odd reason we need to detach the the mceInsertContent call from the paste event
|
212 |
-
// It's like IE has a reference to the parent element that you paste in and the selection gets messed up
|
213 |
-
// when it tries to restore the selection
|
214 |
-
setTimeout(function() {
|
215 |
-
// Process contents
|
216 |
-
process({content : n.innerHTML});
|
217 |
-
}, 0);
|
218 |
-
|
219 |
-
// Block the real paste event
|
220 |
-
return tinymce.dom.Event.cancel(e);
|
221 |
-
} else {
|
222 |
-
function block(e) {
|
223 |
-
e.preventDefault();
|
224 |
-
};
|
225 |
-
|
226 |
-
// Block mousedown and click to prevent selection change
|
227 |
-
dom.bind(ed.getDoc(), 'mousedown', block);
|
228 |
-
dom.bind(ed.getDoc(), 'keydown', block);
|
229 |
-
|
230 |
-
or = ed.selection.getRng();
|
231 |
-
|
232 |
-
// Move select contents inside DIV
|
233 |
-
n = n.firstChild;
|
234 |
-
rng = ed.getDoc().createRange();
|
235 |
-
rng.setStart(n, 0);
|
236 |
-
rng.setEnd(n, 2);
|
237 |
-
sel.setRng(rng);
|
238 |
-
|
239 |
-
// Wait a while and grab the pasted contents
|
240 |
-
window.setTimeout(function() {
|
241 |
-
var h = '', nl;
|
242 |
-
|
243 |
-
// Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit
|
244 |
-
if (!dom.select('div.mcePaste > div.mcePaste').length) {
|
245 |
-
nl = dom.select('div.mcePaste');
|
246 |
-
|
247 |
-
// WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string
|
248 |
-
each(nl, function(n) {
|
249 |
-
var child = n.firstChild;
|
250 |
-
|
251 |
-
// WebKit inserts a DIV container with lots of odd styles
|
252 |
-
if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) {
|
253 |
-
dom.remove(child, 1);
|
254 |
-
}
|
255 |
-
|
256 |
-
// Remove apply style spans
|
257 |
-
each(dom.select('span.Apple-style-span', n), function(n) {
|
258 |
-
dom.remove(n, 1);
|
259 |
-
});
|
260 |
-
|
261 |
-
// Remove bogus br elements
|
262 |
-
each(dom.select('br[data-mce-bogus]', n), function(n) {
|
263 |
-
dom.remove(n);
|
264 |
-
});
|
265 |
-
|
266 |
-
// WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV
|
267 |
-
if (n.parentNode.className != 'mcePaste')
|
268 |
-
h += n.innerHTML;
|
269 |
-
});
|
270 |
-
} else {
|
271 |
-
// Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc
|
272 |
-
// So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same
|
273 |
-
h = '<p>' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '</p><p>').replace(/\r?\n/g, '<br />') + '</p>';
|
274 |
-
}
|
275 |
-
|
276 |
-
// Remove the nodes
|
277 |
-
each(dom.select('div.mcePaste'), function(n) {
|
278 |
-
dom.remove(n);
|
279 |
-
});
|
280 |
-
|
281 |
-
// Restore the old selection
|
282 |
-
if (or)
|
283 |
-
sel.setRng(or);
|
284 |
-
|
285 |
-
process({content : h});
|
286 |
-
|
287 |
-
// Unblock events ones we got the contents
|
288 |
-
dom.unbind(ed.getDoc(), 'mousedown', block);
|
289 |
-
dom.unbind(ed.getDoc(), 'keydown', block);
|
290 |
-
}, 0);
|
291 |
-
}
|
292 |
-
}
|
293 |
-
|
294 |
-
// Check if we should use the new auto process method
|
295 |
-
if (getParam(ed, "paste_auto_cleanup_on_paste")) {
|
296 |
-
// Is it's Opera or older FF use key handler
|
297 |
-
if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
|
298 |
-
ed.onKeyDown.addToTop(function(ed, e) {
|
299 |
-
if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
|
300 |
-
grabContent(e);
|
301 |
-
});
|
302 |
-
} else {
|
303 |
-
// Grab contents on paste event on Gecko and WebKit
|
304 |
-
ed.onPaste.addToTop(function(ed, e) {
|
305 |
-
return grabContent(e);
|
306 |
-
});
|
307 |
-
}
|
308 |
-
}
|
309 |
-
|
310 |
-
ed.onInit.add(function() {
|
311 |
-
ed.controlManager.setActive("pastetext", ed.pasteAsPlainText);
|
312 |
-
|
313 |
-
// Block all drag/drop events
|
314 |
-
if (getParam(ed, "paste_block_drop")) {
|
315 |
-
ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {
|
316 |
-
e.preventDefault();
|
317 |
-
e.stopPropagation();
|
318 |
-
|
319 |
-
return false;
|
320 |
-
});
|
321 |
-
}
|
322 |
-
});
|
323 |
-
|
324 |
-
// Add legacy support
|
325 |
-
t._legacySupport();
|
326 |
-
},
|
327 |
-
|
328 |
-
getInfo : function() {
|
329 |
-
return {
|
330 |
-
longname : 'Paste text/word',
|
331 |
-
author : 'Moxiecode Systems AB',
|
332 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
333 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',
|
334 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
335 |
-
};
|
336 |
-
},
|
337 |
-
|
338 |
-
_preProcess : function(pl, o) {
|
339 |
-
var ed = this.editor,
|
340 |
-
h = o.content,
|
341 |
-
grep = tinymce.grep,
|
342 |
-
explode = tinymce.explode,
|
343 |
-
trim = tinymce.trim,
|
344 |
-
len, stripClass;
|
345 |
-
|
346 |
-
//console.log('Before preprocess:' + o.content);
|
347 |
-
|
348 |
-
function process(items) {
|
349 |
-
each(items, function(v) {
|
350 |
-
// Remove or replace
|
351 |
-
if (v.constructor == RegExp)
|
352 |
-
h = h.replace(v, '');
|
353 |
-
else
|
354 |
-
h = h.replace(v[0], v[1]);
|
355 |
-
});
|
356 |
-
}
|
357 |
-
|
358 |
-
if (ed.settings.paste_enable_default_filters == false) {
|
359 |
-
return;
|
360 |
-
}
|
361 |
-
|
362 |
-
// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
|
363 |
-
if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) {
|
364 |
-
// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
|
365 |
-
process([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g, '$1']]);
|
366 |
-
|
367 |
-
// IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
|
368 |
-
process([
|
369 |
-
[/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
|
370 |
-
[/<br>/g, ' '], // Replace single br elements with space since they are word wrap BR:s
|
371 |
-
[/<BR><BR>/g, '<br>'] // Replace back the double brs but into a single BR
|
372 |
-
]);
|
373 |
-
}
|
374 |
-
|
375 |
-
// Detect Word content and process it more aggressive
|
376 |
-
if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {
|
377 |
-
o.wordContent = true; // Mark the pasted contents as word specific content
|
378 |
-
//console.log('Word contents detected.');
|
379 |
-
|
380 |
-
// Process away some basic content
|
381 |
-
process([
|
382 |
-
/^\s*( )+/gi, // entities at the start of contents
|
383 |
-
/( |<br[^>]*>)+\s*$/gi // entities at the end of contents
|
384 |
-
]);
|
385 |
-
|
386 |
-
if (getParam(ed, "paste_convert_headers_to_strong")) {
|
387 |
-
h = h.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>");
|
388 |
-
}
|
389 |
-
|
390 |
-
if (getParam(ed, "paste_convert_middot_lists")) {
|
391 |
-
process([
|
392 |
-
[/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker
|
393 |
-
[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers
|
394 |
-
[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF)
|
395 |
-
]);
|
396 |
-
}
|
397 |
-
|
398 |
-
process([
|
399 |
-
// Word comments like conditional comments etc
|
400 |
-
/<!--[\s\S]+?-->/gi,
|
401 |
-
|
402 |
-
// Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags
|
403 |
-
/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
|
404 |
-
|
405 |
-
// Convert <s> into <strike> for line-though
|
406 |
-
[/<(\/?)s>/gi, "<$1strike>"],
|
407 |
-
|
408 |
-
// Replace nsbp entites to char since it's easier to handle
|
409 |
-
[/ /gi, "\u00a0"]
|
410 |
-
]);
|
411 |
-
|
412 |
-
// Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag.
|
413 |
-
// If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.
|
414 |
-
do {
|
415 |
-
len = h.length;
|
416 |
-
h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
|
417 |
-
} while (len != h.length);
|
418 |
-
|
419 |
-
// Remove all spans if no styles is to be retained
|
420 |
-
if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) {
|
421 |
-
h = h.replace(/<\/?span[^>]*>/gi, "");
|
422 |
-
} else {
|
423 |
-
// We're keeping styles, so at least clean them up.
|
424 |
-
// CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx
|
425 |
-
|
426 |
-
process([
|
427 |
-
// Convert <span style="mso-spacerun:yes">___</span> to string of alternating breaking/non-breaking spaces of same length
|
428 |
-
[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
|
429 |
-
function(str, spaces) {
|
430 |
-
return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";
|
431 |
-
}
|
432 |
-
],
|
433 |
-
|
434 |
-
// Examine all styles: delete junk, transform some, and keep the rest
|
435 |
-
[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,
|
436 |
-
function(str, tag, style) {
|
437 |
-
var n = [],
|
438 |
-
i = 0,
|
439 |
-
s = explode(trim(style).replace(/"/gi, "'"), ";");
|
440 |
-
|
441 |
-
// Examine each style definition within the tag's style attribute
|
442 |
-
each(s, function(v) {
|
443 |
-
var name, value,
|
444 |
-
parts = explode(v, ":");
|
445 |
-
|
446 |
-
function ensureUnits(v) {
|
447 |
-
return v + ((v !== "0") && (/\d$/.test(v)))? "px" : "";
|
448 |
-
}
|
449 |
-
|
450 |
-
if (parts.length == 2) {
|
451 |
-
name = parts[0].toLowerCase();
|
452 |
-
value = parts[1].toLowerCase();
|
453 |
-
|
454 |
-
// Translate certain MS Office styles into their CSS equivalents
|
455 |
-
switch (name) {
|
456 |
-
case "mso-padding-alt":
|
457 |
-
case "mso-padding-top-alt":
|
458 |
-
case "mso-padding-right-alt":
|
459 |
-
case "mso-padding-bottom-alt":
|
460 |
-
case "mso-padding-left-alt":
|
461 |
-
case "mso-margin-alt":
|
462 |
-
case "mso-margin-top-alt":
|
463 |
-
case "mso-margin-right-alt":
|
464 |
-
case "mso-margin-bottom-alt":
|
465 |
-
case "mso-margin-left-alt":
|
466 |
-
case "mso-table-layout-alt":
|
467 |
-
case "mso-height":
|
468 |
-
case "mso-width":
|
469 |
-
case "mso-vertical-align-alt":
|
470 |
-
n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value);
|
471 |
-
return;
|
472 |
-
|
473 |
-
case "horiz-align":
|
474 |
-
n[i++] = "text-align:" + value;
|
475 |
-
return;
|
476 |
-
|
477 |
-
case "vert-align":
|
478 |
-
n[i++] = "vertical-align:" + value;
|
479 |
-
return;
|
480 |
-
|
481 |
-
case "font-color":
|
482 |
-
case "mso-foreground":
|
483 |
-
n[i++] = "color:" + value;
|
484 |
-
return;
|
485 |
-
|
486 |
-
case "mso-background":
|
487 |
-
case "mso-highlight":
|
488 |
-
n[i++] = "background:" + value;
|
489 |
-
return;
|
490 |
-
|
491 |
-
case "mso-default-height":
|
492 |
-
n[i++] = "min-height:" + ensureUnits(value);
|
493 |
-
return;
|
494 |
-
|
495 |
-
case "mso-default-width":
|
496 |
-
n[i++] = "min-width:" + ensureUnits(value);
|
497 |
-
return;
|
498 |
-
|
499 |
-
case "mso-padding-between-alt":
|
500 |
-
n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value);
|
501 |
-
return;
|
502 |
-
|
503 |
-
case "text-line-through":
|
504 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|