TinyMCE 2.0.8

git-svn-id: http://svn.automattic.com/wordpress/trunk@4506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-11-21 00:55:06 +00:00
parent 84bef56f9d
commit f336d22da7
29 changed files with 2649 additions and 1560 deletions

View File

@ -97,20 +97,20 @@ addLoadEvent( function() {
h += "<form name='uploadoptions' id='uploadoptions' class='alignleft'>";
h += "<table>";
if ( this.currentImage.thumb ) {
h += "<tr><th style='padding-bottom:.5em'>Show:</th><td style='padding-bottom:.5em'>";
h += "<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' checked='checked' /> Thumbnail</label><br />";
h += "<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> Full size</label>";
h += "<tr><th style='padding-bottom:.5em'><?php echo addslashes(__('Show:')); ?></th><td style='padding-bottom:.5em'>";
h += "<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' checked='checked' /> <?php echo addslashes(__('Thumbnail')); ?></label><br />";
h += "<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php echo addslashes(__('Full size')); ?></label>";
h += "</td></tr>";
}
h += "<tr><th>Link to:</th><td>";
h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> File</label><br />";
h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> Page</label><br />";
h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> None</label>";
h += "<tr><th><?php echo addslashes(__('Link to:')); ?></th><td>";
h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> <?php echo addslashes(__('File')); ?></label><br />";
h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> <?php echo addslashes(__('Page')); ?></label><br />";
h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> <?php echo addslashes(__('None')); ?></label>";
h += "</td></tr>";
h += "<tr><td colspan='2'><p class='submit'>";
h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='Send to editor &raquo;' />";
h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='<?php echo addslashes(__('Send to editor')); ?> &raquo;' />";
h += "</p></td></tr></table>";
h += "</form>";
@ -243,7 +243,7 @@ addLoadEvent( function() {
},
deleteFile: function(id) {
if ( confirm("Are you sure you want to delete the file '" + this.currentImage.title + "'?\nClick ok to delete or cancel to go back.") ) {
if ( confirm("<?php printf(addslashes(__("Are you sure you want to delete the file %s?\nClick ok to delete or cancel to go back.")), '" + this.currentImage.title + "'); ?>") {
$('action-value').value = 'delete';
$('upload-file').submit();
return true;

View File

@ -3,10 +3,18 @@ cache_javascript_headers();
?>
var autosaveLast = '';
var autosavePeriodical;
function autosave_start_timer() {
var form = $('post');
autosaveLast = form.post_title.value+form.content.value;
autosavePeriodical = new PeriodicalExecuter(autosave, <?php echo apply_filters('autosave_interval', '60'); ?>);
autosavePeriodical = new PeriodicalExecuter(autosave, <?php echo apply_filters('autosave_interval', '16'); ?>);
//Disable autosave after the form has been submitted
// if(form.addEventListener) {
// form.addEventListener("submit", function () { autosavePeriodical.currentlyExecuting = true; }, false);
// }
if(form.attachEvent) {
form.attachEvent("onsubmit", function () { autosavePeriodical.currentlyExecuting = true; });
}
}
addLoadEvent(autosave_start_timer)

View File

@ -1,13 +1,14 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
@ -16,97 +17,109 @@ freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
.
GNU LIBRARY GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
@ -145,7 +158,7 @@ Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
@ -203,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@ -254,8 +267,8 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
.
6. As an exception to the Sections above, you may also compile or
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
@ -282,23 +295,31 @@ of these things:
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
@ -308,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@ -347,9 +368,9 @@ Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
You are not responsible for enforcing compliance by third parties with
this License.
.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@ -390,7 +411,7 @@ excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
@ -401,7 +422,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@ -435,3 +456,49 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -1,20 +1,18 @@
/**
* $RCSfile: editor_plugin_src.js,v $
* $Revision: 1.11 $
* $Date: 2006/03/22 12:21:21 $
* $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('autosave', 'en,tr,sv,cs,he,nb,hu,de,da,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl,pt_br');
tinyMCE.importPluginLanguagePack('autosave');
var TinyMCE_AutoSavePlugin = {
getInfo : function() {
return {
longname : 'Auto save',
author : 'Moxiecode Systems',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion

View File

@ -1,20 +1,18 @@
/**
* $RCSfile: editor_plugin_src.js,v $
* $Revision: 1.16 $
* $Date: 2006/02/10 21:34:28 $
* $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('directionality', 'en,tr,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');
tinyMCE.importPluginLanguagePack('directionality');
var TinyMCE_DirectionalityPlugin = {
getInfo : function() {
return {
longname : 'Directionality',
author : 'Moxiecode Systems',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion

View File

@ -1,7 +1,5 @@
/**
* $RCSfile: editor_plugin_src.js,v $
* $Revision: 1.8 $
* $Date: 2006/02/06 20:02:38 $
* $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
*
* Moxiecode DHTML Windows script.
*
@ -15,7 +13,7 @@ var TinyMCE_InlinePopupsPlugin = {
getInfo : function() {
return {
longname : 'Inline Popups',
author : 'Moxiecode Systems',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_inlinepopups.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
@ -436,7 +434,7 @@ TinyMCE_Windows.prototype.onLoad = function(name) {
TinyMCE_Windows.prototype.createFloatingIFrame = function(id_prefix, left, top, width, height, html) {
var iframe = document.createElement("iframe");
var div = document.createElement("div");
var div = document.createElement("div"), doc;
width = parseInt(width);
height = parseInt(height)+1;
@ -488,7 +486,7 @@ TinyMCE_Windows.prototype.createFloatingIFrame = function(id_prefix, left, top,
if (this.isSafari) {
// Give Safari some time to setup
window.setTimeout(function() {
doc = window.frames[id_prefix + '_iframe'].document;
var doc = window.frames[id_prefix + '_iframe'].document;
doc.open();
doc.write(html);
doc.close();

View File

@ -1,7 +1,5 @@
/**
* $RCSfile: mcwindows.js,v $
* $Revision: 1.2 $
* $Date: 2005/10/18 13:59:43 $
* $Id: mcwindows.js 18 2006-06-29 14:11:23Z spocke $
*
* Moxiecode DHTML Windows script.
*

File diff suppressed because one or more lines are too long

View File

@ -15,6 +15,10 @@ function saveContent() {
function onLoadInit() {
tinyMCEPopup.resizeToInnerSize();
// Remove Gecko spellchecking
if (tinyMCE.isGecko)
document.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");
resizeInputs();
}

View File

@ -25,7 +25,13 @@ var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
function initIframe(doc) {
var dir = tinyMCE.selectedInstance.settings['directionality'];
doc.body.dir = dir;
// Remove Gecko spellchecking
if (tinyMCE.isGecko)
doc.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");
resizeInputs();
}

View File

@ -6,7 +6,7 @@
<script language="javascript" type="text/javascript" src="jscripts/charmap.js"></script>
<base target="_self" />
</head>
<body onload="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';document.getElementById('insert').focus();" style="display: none">
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
<table align="center" border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="2" class="title">{$lang_theme_charmap_title}</td>

View File

@ -5,7 +5,7 @@
<script language="javascript" type="text/javascript" src="jscripts/color_picker.js"></script>
<base target="_self" />
</head>
<body onload="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';document.getElementById('insert').focus();" style="margin: 3px; display: none">
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="margin: 3px; display: none">
<div align="center">
<script language="javascript" type="text/javascript">renderColorMap();</script>
</div>

View File

@ -14,6 +14,11 @@ body {
border: 1px dashed #BBBBBB !important;
}
div.mceVisualAid {
background-image:url('../images/spacer.gif');
visibility: visible !important;
}
.mceItemAnchor {
width: 12px;
line-height: 6px;

View File

@ -312,6 +312,10 @@ h3 {
height: 190px;
}
label.msg { display: none; }
label.invalid { color: #EE0000; display: inline; }
input.invalid { border: 1px solid #EE0000; }
/* Disables the advanced tab in the table plugin. */
/*
#table #advanced_tab {

View File

@ -1,348 +1,97 @@
/* This file contains the CSS data for the editor UI of TinyMCE instances */
.mceToolbarTop a, .mceToolbarTop a:visited, .mceToolbarTop a:hover, .mceToolbarBottom a, .mceToolbarBottom a:visited, .mceToolbarBottom a:hover {
border: 0; margin: 0; padding: 0; background: transparent;
}
.mceSeparatorLine {
border: 0;
padding: 0;
margin-left: 4px;
margin-right: 2px;
}
.mceSelectList {
font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
font-size: 7pt !important;
font-weight: normal;
margin-top: 3px;
padding: 0;
display: inline;
vertical-align: top;
background-color: #F0F0EE;
}
.mceLabel, .mceLabelDisabled {
font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
font-size: 9pt;
}
.mceLabel {
color: #000000;
}
.mceLabelDisabled {
cursor: text;
color: #999999;
}
.mceEditor {
background: #F0F0EE;
border: 1px solid #cccccc;
padding: 0;
margin: 0;
}
.mceEditorArea {
font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
background: #FFFFFF;
padding: 0;
margin: 0;
}
.mceToolbarTop, .mceToolbarBottom {
background: #F0F0EE;
line-height: 1px;
font-size: 1px;
}
.mceToolbarTop {
border-bottom: 1px solid #cccccc;
padding-bottom: 1px;
}
.mceToolbarBottom {
border-top: 1px solid #cccccc;
}
.mceStatusbarTop, .mceStatusbarBottom, .mceStatusbar {
height: 20px;
}
.mceStatusbarTop .mceStatusbarPathText, .mceStatusbarBottom .mceStatusbarPathText, .mceStatusbar .mceStatusbarPathText {
font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
font-size: 9pt;
padding: 2px;
line-height: 16px;
overflow: visible;
}
.mceStatusbarTop {
border-bottom: 1px solid #cccccc;
}
.mceStatusbarBottom {
border-top: 1px solid #cccccc;
}
.mceStatusbar {
border-bottom: 1px solid #cccccc;
}
.mcePathItem, .mcePathItem:link, .mcePathItem:visited, .mcePathItem:hover {
text-decoration: none;
font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
font-size: 9pt;
color: #000000;
}
.mcePathItem:hover {
text-decoration: underline;
}
.mceStatusbarPathText {
float: left;
}
.mceStatusbarResize {
float: right;
background-image: url('../images/statusbar_resize.gif');
background-repeat: no-repeat;
width: 11px;
height: 20px;
cursor: se-resize;
}
.mceResizeBox {
width: 10px;
height: 10px;
display: none;
border: 1px dotted gray;
margin: 0;
padding: 0;
}
.mceToolbarTop a, .mceToolbarTop a:visited, .mceToolbarTop a:hover, .mceToolbarBottom a, .mceToolbarBottom a:visited, .mceToolbarBottom a:hover {border: 0; margin: 0; padding: 0; background: transparent;}
.mceSeparatorLine {border: 0; padding: 0; margin-left: 4px; margin-right: 2px;}
.mceSelectList {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 7pt !important; font-weight: normal; margin-top: 3px; padding: 0; display: inline; vertical-align: top; background-color: #F0F0EE;}
.mceLabel, .mceLabelDisabled {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt;}
.mceLabel {color: #000000;}
.mceLabelDisabled {cursor: text; color: #999999;}
.mceEditor {background: #F0F0EE; border: 1px solid #cccccc; padding: 0; margin: 0;}
.mceEditorArea { font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; background: #FFFFFF; padding: 0; margin: 0; }
.mceToolbarTop, .mceToolbarBottom {background: #F0F0EE; line-height: 1px; font-size: 1px;}
.mceToolbarTop {border-bottom: 1px solid #cccccc; padding-bottom: 1px;}
.mceToolbarBottom {border-top: 1px solid #cccccc;}
.mceToolbarContainer {position: relative; left: 0; top: 0; display: block;}
.mceStatusbarTop, .mceStatusbarBottom, .mceStatusbar {height: 20px;}
.mceStatusbarTop .mceStatusbarPathText, .mceStatusbarBottom .mceStatusbarPathText, .mceStatusbar .mceStatusbarPathText {font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt; padding: 2px; line-height: 16px; overflow: visible;}
.mceStatusbarTop {border-bottom: 1px solid #cccccc;}
.mceStatusbarBottom {border-top: 1px solid #cccccc;}
.mceStatusbar {border-bottom: 1px solid #cccccc;}
.mcePathItem, .mcePathItem:link, .mcePathItem:visited, .mcePathItem:hover {text-decoration: none; font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; font-size: 9pt; color: #000000;}
.mcePathItem:hover {text-decoration: underline;}
.mceStatusbarPathText {float: left;}
.mceStatusbarResize {float: right; background-image: url('../images/statusbar_resize.gif'); background-repeat: no-repeat; width: 11px; height: 20px; cursor: se-resize;}
.mceResizeBox {width: 10px; height: 10px; display: none; border: 1px dotted gray; margin: 0; padding: 0;}
.mceEditorIframe {border: 0;}
/* Button CSS rules */
a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {
width: 20px;
height: 20px;
cursor: default;
margin-top: 1px;
margin-left: 1px;
}
a.mceButtonDisabled img {
border: 0 !important;
}
a.mceButtonNormal img, a.mceButtonSelected img {
border: 1px solid #F0F0EE !important;
}
a.mceButtonSelected img {
border: 1px solid #6779AA !important;
background-color: #D4D5D8;
}
a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {
border: 1px solid #0A246A !important;
cursor: default;
background-color: #B6BDD2;
}
a.mceButtonDisabled img {
-moz-opacity:0.3;
opacity: 0.3;
border: 1px solid #F0F0EE !important;
cursor: default;
}
a.mceTiledButton img {
background-image: url('../images/buttons.gif');
background-repeat: no-repeat;
}
/* MSIE specific rules */
* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {
border: 0 !important;
margin-top: 2px;
margin-bottom: 1px;
}
* html a.mceButtonDisabled img {
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
border: 0 !important;
}
* html a.mceButtonDisabled {
border: 1px solid #F0F0EE !important;
}
* html a.mceButtonNormal, * html a.mceButtonSelected {
border: 1px solid #F0F0EE !important;
cursor: default;
}
* html a.mceButtonSelected {
border: 1px solid #6779AA !important;
background-color: #D4D5D8;
}
* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {
border: 1px solid #0A246A !important;
cursor: default;
background-color: #B6BDD2;
}
* html .mceSelectList {
margin-top: 2px;
}
a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {width: 20px; height: 20px; cursor: default; margin-top: 1px; margin-left: 1px;}
a.mceButtonDisabled img {border: 0 !important;}
a.mceButtonNormal img, a.mceButtonSelected img {border: 1px solid #F0F0EE !important;}
a.mceButtonSelected img {border: 1px solid #6779AA !important; background-color: #D4D5D8;}
a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {border: 1px solid #0A246A !important; cursor: default; background-color: #B6BDD2;}
a.mceButtonDisabled img {-moz-opacity:0.3; opacity: 0.3; border: 1px solid #F0F0EE !important; cursor: default;}
a.mceTiledButton img {background-image: url('../images/buttons.gif'); background-repeat: no-repeat;}
/* Menu button CSS rules */
span.mceMenuButton img, span.mceMenuButtonSelected img {
border: 1px solid #F0F0EE;
margin-left: 1px;
}
span.mceMenuButtonSelected img {
border: 1px solid #6779AA;
background-color: #B6BDD2;
}
span.mceMenuButtonSelected img.mceMenuButton {
border: 1px solid #F0F0EE;
background-color: transparent;
}
span.mceMenuButton img.mceMenuButton, span.mceMenuButtonSelected img.mceMenuButton {
border-left: 0;
margin-left: 0;
}
span.mceMenuButton:hover img, span.mceMenuButtonSelected:hover img {
border: 1px solid #0A246A;
background-color: #B6BDD2;
}
span.mceMenuButton:hover img.mceMenuButton, span.mceMenuButtonSelected:hover img.mceMenuButton {
border-left: 0;
}
span.mceMenuButtonFocus img {
border: 1px solid gray;
border-right: 0;
margin-left: 1px;
background-color: #F5F4F2;
}
span.mceMenuButtonFocus img.mceMenuButton {
border: 1px solid gray;
border-left: 1px solid #F5F4F2;
margin-left: 0;
}
/* Menu button MSIE specific rules */
* html span.mceMenuButton, * html span.mceMenuButtonFocus {
position: relative;
left: 0;
top: 0;
}
* html span.mceMenuButton img, * html span.mceMenuButtonSelected img, * html span.mceMenuButtonFocus img {
position: relative;
top: 1px;
}
* html span.mceMenuHover img {
border: 1px solid #0A246A;
background-color: #B6BDD2;
}
* html span.mceMenuButtonSelected.mceMenuHover img.mceMenuButton {
border: 1px solid #0A246A;
background-color: #B6BDD2;
border-left: 0;
}
span.mceMenuButton img, span.mceMenuButtonSelected img {border: 1px solid #F0F0EE; margin-left: 1px;}
span.mceMenuButtonSelected img {border: 1px solid #6779AA; background-color: #B6BDD2;}
span.mceMenuButtonSelected img.mceMenuButton {border: 1px solid #F0F0EE; background-color: transparent;}
span.mceMenuButton img.mceMenuButton, span.mceMenuButtonSelected img.mceMenuButton {border-left: 0; margin-left: 0;}
span.mceMenuButton:hover img, span.mceMenuButtonSelected:hover img {border: 1px solid #0A246A; background-color: #B6BDD2;}
span.mceMenuButton:hover img.mceMenuButton, span.mceMenuButtonSelected:hover img.mceMenuButton {border-left: 0;}
span.mceMenuButtonFocus img {border: 1px solid gray; border-right: 0; margin-left: 1px; background-color: #F5F4F2;}
span.mceMenuButtonFocus img.mceMenuButton {border: 1px solid gray; border-left: 1px solid #F5F4F2; margin-left: 0;}
span.mceMenuHover img {border: 1px solid #0A246A; background-color: #B6BDD2;}
span.mceMenuButtonSelected.mceMenuHover img.mceMenuButton {border: 1px solid #0A246A; background-color: #B6BDD2; border-left: 0;}
/* Menu */
.mceMenu {
position: absolute;
left: 0;
top: 0;
display: none;
z-index: 100;
background-color: white;
border: 1px solid gray;
font-weight: normal;
}
.mceMenu {position: absolute; left: 0; top: 0; display: none; z-index: 100; background-color: white; border: 1px solid gray; font-weight: normal;}
.mceMenu a, .mceMenuTitle, .mceMenuDisabled {display: block; width: 100%; text-decoration: none; background-color: white; font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 11px; line-height: 20px; color: black;}
.mceMenu a:hover {background-color: #B6BDD2; color: black; text-decoration: none !important;}
.mceMenu span {padding-left: 10px; padding-right: 10px; display: block; line-height: 20px;}
.mceMenuSeparator {border-bottom: 1px solid gray; background-color: gray; height: 1px;}
.mceMenuTitle span {padding-left: 5px;}
.mceMenuTitle {background-color: #DDDDDD; font-weight: bold;}
.mceMenuDisabled {color: gray;}
span.mceMenuSelectedItem {background-image: url('../images/menu_check.gif'); background-repeat: no-repeat; background-position: 5px 8px; padding-left: 20px;}
span.mceMenuCheckItem {padding-left: 20px;}
span.mceMenuLine {display: block; position: absolute; left: 0; top: -1px; background-color: #F5F4F2; width: 30px; height: 1px; overflow: hidden; padding-left: 0; padding-right: 0;}
.mceColors table, .mceColors td {margin: 0; padding: 2px;}
a.mceMoreColors {width: 130px; margin: 0; padding: 0; margin-left: 3px; margin-bottom: 3px; text-align: center; border: 1px solid white;}
.mceColorPreview {position: absolute; left: 0; top: 0; margin-left: 3px; margin-top: 15px; width: 16px; height: 4px; background-color: red;}
a.mceMoreColors:hover {border: 1px solid #0A246A;}
.mceColors td a {width: 9px; height: 9px; overflow: hidden; border: 1px solid #808080;}
.mceMenu a, .mceMenuTitle, .mceMenuDisabled {
display: block;
width: 100%;
text-decoration: none;
background-color: white;
font-family: Tahoma, Verdana, Arial, Helvetica;
font-size: 11px;
line-height: 20px;
color: black;
}
/* MSIE 6 specific rules */
.mceMenu a:hover {
background-color: #B6BDD2;
color: black;
}
* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {border: 0 !important; margin-top: 2px; margin-bottom: 1px;}
* html a.mceButtonDisabled img {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); border: 0 !important;}
* html a.mceButtonDisabled {border: 1px solid #F0F0EE !important;}
* html a.mceButtonNormal, * html a.mceButtonSelected {border: 1px solid #F0F0EE !important; cursor: default;}
* html a.mceButtonSelected {border: 1px solid #6779AA !important; background-color: #D4D5D8;}
* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {border: 1px solid #0A246A !important; background-color: #B6BDD2; cursor: default;}
* html .mceSelectList {margin-top: 2px;}
* html span.mceMenuButton, * html span.mceMenuButtonFocus {position: relative; left: 0; top: 0;}
* html span.mceMenuButton img, * html span.mceMenuButtonSelected img, * html span.mceMenuButtonFocus img {position: relative; top: 1px;}
* html a.mceMoreColors {width: 132px;}
* html .mceColors td a {width: 10px; height: 10px;}
* html .mceColorPreview {margin-left: 2px; margin-top: 14px;}
.mceMenu span {
padding-left: 10px;
padding-right: 10px;
display: block;
line-height: 20px;
}
/* MSIE 7 specific rules */
.mceMenuSeparator {
border-bottom: 1px solid gray;
background-color: gray;
height: 1px;
}
.mceMenuTitle span {
padding-left: 5px;
}
.mceMenuTitle {
background-color: #DDDDDD;
font-weight: bold;
}
.mceMenuDisabled {
color: gray;
}
span.mceMenuSelectedItem {
background-image: url('../images/menu_check.gif');
background-repeat: no-repeat;
background-position: 5px 8px;
padding-left: 20px;
}
span.mceMenuCheckItem {
padding-left: 20px;
}
span.mceMenuLine {
display: block;
position: absolute;
left: 0;
top: -1px;
background-color: #F5F4F2;
width: 30px;
height: 1px;
overflow: hidden;
padding-left: 0;
padding-right: 0;
}
*:first-child+html a.mceButtonNormal img, *:first-child+html a.mceButtonSelected img, *:first-child+html a.mceButtonDisabled img {border: 0 !important; margin-top: 2px; margin-bottom: 1px;}
*:first-child+html a.mceButtonDisabled img {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); border: 0 !important;}
*:first-child+html a.mceButtonDisabled {border: 1px solid #F0F0EE !important;}
*:first-child+html a.mceButtonNormal, *:first-child+html a.mceButtonSelected {border: 1px solid #F0F0EE !important; cursor: default;}
*:first-child+html a.mceButtonSelected {border: 1px solid #6779AA !important; background-color: #D4D5D8;}
*:first-child+html a.mceButtonNormal:hover, *:first-child+html a.mceButtonSelected:hover {border: 1px solid #0A246A !important; background-color: #B6BDD2; cursor: default;}
*:first-child+html .mceSelectList {margin-top: 2px;}
*:first-child+html span.mceMenuButton, *:first-child+html span.mceMenuButtonFocus {position: relative; left: 0; top: 0;}
*:first-child+html span.mceMenuButton img, *:first-child+html span.mceMenuButtonSelected img, *:first-child+html span.mceMenuButtonFocus img {position: relative; top: 1px;}
*:first-child+html a.mceMoreColors {width: 132px;}
*:first-child+html .mceColors td a {width: 10px; height: 10px;}
*:first-child+html .mceColorPreview {margin: 0; padding-left: 4px; margin-top: 14px; width: 14px;}

View File

@ -1,7 +1,5 @@
/**
* $RCSfile: editor_template_src.js,v $
* $Revision: 1.96 $
* $Date: 2006/04/18 13:32:52 $
* $Id: editor_template_src.js 129 2006-10-23 09:45:17Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
@ -12,6 +10,7 @@ tinyMCE.importThemeLanguagePack('advanced');
var TinyMCE_AdvancedTheme = {
// Private theme fields
_defColors : "000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",
_autoImportCSSClasses : true,
_resizer : {},
_buttons : [
@ -43,25 +42,28 @@ var TinyMCE_AdvancedTheme = {
['removeformat', 'removeformat.gif', 'lang_theme_removeformat_desc', 'removeformat'],
['sub', 'sub.gif', 'lang_theme_sub_desc', 'subscript'],
['sup', 'sup.gif', 'lang_theme_sup_desc', 'superscript'],
['forecolor', 'forecolor.gif', 'lang_theme_forecolor_desc', 'mceForeColor', true],
['backcolor', 'backcolor.gif', 'lang_theme_backcolor_desc', 'mceBackColor', true],
['forecolor', 'forecolor.gif', 'lang_theme_forecolor_desc', 'forecolor', true],
['backcolor', 'backcolor.gif', 'lang_theme_backcolor_desc', 'HiliteColor', true],
['charmap', 'charmap.gif', 'lang_theme_charmap_desc', 'mceCharMap'],
['visualaid', 'visualaid.gif', 'lang_theme_visualaid_desc', 'mceToggleVisualAid'],
['anchor', 'anchor.gif', 'lang_theme_anchor_desc', 'mceInsertAnchor'],
['newdocument', 'newdocument.gif', 'lang_newdocument_desc', 'mceNewDocument']
],
_buttonMap : 'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells',
_buttonMap : 'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells,delete_table',
/**
* Returns HTML code for the specificed control.
*/
getControlHTML : function(button_name) {
var i, x;
var i, x, but;
// Lookup button in button list
for (i=0; i<TinyMCE_AdvancedTheme._buttons.length; i++) {
var but = TinyMCE_AdvancedTheme._buttons[i];
but = TinyMCE_AdvancedTheme._buttons[i];
if (but[0] == button_name && (button_name == "forecolor" || button_name == "backcolor"))
return tinyMCE.getMenuButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3] + "Menu", but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null));
if (but[0] == button_name)
return tinyMCE.getButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null));
@ -153,6 +155,18 @@ var TinyMCE_AdvancedTheme = {
*/
execCommand : function(editor_id, element, command, user_interface, value) {
switch (command) {
case 'mceHelp':
tinyMCE.openWindow({
file : 'about.htm',
width : 480,
height : 380
}, {
tinymce_version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion,
tinymce_releasedate : tinyMCE.releaseDate,
inline : "yes"
});
return true;
case "mceLink":
var inst = tinyMCE.getInstanceById(editor_id);
var doc = inst.getDoc();
@ -317,41 +331,94 @@ var TinyMCE_AdvancedTheme = {
return true;
case "mceForeColor":
var template = new Array();
var elm = tinyMCE.selectedInstance.getFocusElement();
var inputColor = tinyMCE.getAttrib(elm, "color");
case "forecolor":
var fcp = new TinyMCE_Layer(editor_id + '_fcPreview', false), p, img, elm;
if (inputColor == '')
inputColor = elm.style.color;
TinyMCE_AdvancedTheme._hideMenus(editor_id);
if (!inputColor)
inputColor = "#000000";
if (!fcp.exists()) {
fcp.create('div', 'mceColorPreview', document.getElementById(editor_id + '_toolbar'));
elm = fcp.getElement();
elm._editor_id = editor_id;
elm._command = "forecolor";
elm._switchId = editor_id + "_forecolor";
tinyMCE.addEvent(elm, 'click', TinyMCE_AdvancedTheme._handleMenuEvent);
tinyMCE.addEvent(elm, 'mouseover', TinyMCE_AdvancedTheme._handleMenuEvent);
tinyMCE.addEvent(elm, 'mouseout', TinyMCE_AdvancedTheme._handleMenuEvent);
}
template['file'] = 'color_picker.htm';
template['width'] = 220;
template['height'] = 190;
img = tinyMCE.selectNodes(document.getElementById(editor_id + "_forecolor"), function(n) {return n.nodeName == "IMG";})[0];
p = tinyMCE.getAbsPosition(img, document.getElementById(editor_id + '_toolbar'));
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "forecolor", input_color : inputColor});
fcp.moveTo(p.absLeft, p.absTop);
fcp.getElement().style.backgroundColor = value != null ? value : tinyMCE.getInstanceById(editor_id).foreColor;
fcp.show();
return false;
case "forecolorMenu":
TinyMCE_AdvancedTheme._hideMenus(editor_id);
// Create color layer
var ml = new TinyMCE_Layer(editor_id + '_fcMenu');
if (!ml.exists())
ml.create('div', 'mceMenu', document.body, TinyMCE_AdvancedTheme._getColorHTML(editor_id, 'theme_advanced_text_colors', 'forecolor'));
tinyMCE.switchClass(editor_id + '_forecolor', 'mceMenuButtonFocus');
ml.moveRelativeTo(document.getElementById(editor_id + "_forecolor"), 'bl');
ml.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? -1 : 1, -1);
if (tinyMCE.isOpera)
ml.moveBy(0, -2);
ml.show();
return true;
case "mceBackColor":
var template = new Array();
var elm = tinyMCE.selectedInstance.getFocusElement();
var inputColor = elm.style.backgroundColor;
case "HiliteColor":
var bcp = new TinyMCE_Layer(editor_id + '_bcPreview', false), p, img;
if (!inputColor)
inputColor = "#000000";
TinyMCE_AdvancedTheme._hideMenus(editor_id);
template['file'] = 'color_picker.htm';
template['width'] = 220;
template['height'] = 190;
if (!bcp.exists()) {
bcp.create('div', 'mceColorPreview', document.getElementById(editor_id + '_toolbar'));
elm = bcp.getElement();
elm._editor_id = editor_id;
elm._command = "HiliteColor";
elm._switchId = editor_id + "_backcolor";
tinyMCE.addEvent(elm, 'click', TinyMCE_AdvancedTheme._handleMenuEvent);
tinyMCE.addEvent(elm, 'mouseover', TinyMCE_AdvancedTheme._handleMenuEvent);
tinyMCE.addEvent(elm, 'mouseout', TinyMCE_AdvancedTheme._handleMenuEvent);
}
template['width'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height', 0);
img = tinyMCE.selectNodes(document.getElementById(editor_id + "_backcolor"), function(n) {return n.nodeName == "IMG";})[0];
p = tinyMCE.getAbsPosition(img, document.getElementById(editor_id + '_toolbar'));
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "HiliteColor", input_color : inputColor});
//mceBackColor
bcp.moveTo(p.absLeft, p.absTop);
bcp.getElement().style.backgroundColor = value != null ? value : tinyMCE.getInstanceById(editor_id).backColor;
bcp.show();
return false;
case "HiliteColorMenu":
TinyMCE_AdvancedTheme._hideMenus(editor_id);
// Create color layer
var ml = new TinyMCE_Layer(editor_id + '_bcMenu');
if (!ml.exists())
ml.create('div', 'mceMenu', document.body, TinyMCE_AdvancedTheme._getColorHTML(editor_id, 'theme_advanced_background_colors', 'HiliteColor'));
tinyMCE.switchClass(editor_id + '_backcolor', 'mceMenuButtonFocus');
ml.moveRelativeTo(document.getElementById(editor_id + "_backcolor"), 'bl');
ml.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? -1 : 1, -1);
if (tinyMCE.isOpera)
ml.moveBy(0, -2);
ml.show();
return true;
case "mceColorPicker":
@ -433,7 +500,7 @@ var TinyMCE_AdvancedTheme = {
*/
getEditorTemplate : function(settings, editorId) {
function removeFromArray(in_array, remove_array) {
var outArray = new Array();
var outArray = new Array(), skip;
for (var i=0; i<in_array.length; i++) {
skip = false;
@ -530,10 +597,10 @@ var TinyMCE_AdvancedTheme = {
toolbarHTML += '<a href="#" accesskey="z" onfocus="tinyMCE.getInstanceById(\'' + editorId + '\').getWin().focus();"></a>';
// Setup template html
template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';
template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width_style};height:{$height_style}"><tbody>';
if (toolbarLocation == "top") {
template['html'] += '<tr><td class="mceToolbarTop" align="' + toolbarAlign + '" height="1" nowrap="nowrap">' + toolbarHTML + '</td></tr>';
template['html'] += '<tr><td class="mceToolbarTop" align="' + toolbarAlign + '" height="1" nowrap="nowrap"><span id="' + editorId + '_toolbar" class="mceToolbarContainer">' + toolbarHTML + '</span></td></tr>';
}
if (statusbarLocation == "top") {
@ -544,7 +611,7 @@ var TinyMCE_AdvancedTheme = {
template['html'] += '<tr><td align="center"><span id="{$editor_id}"></span></td></tr>';
if (toolbarLocation == "bottom") {
template['html'] += '<tr><td class="mceToolbarBottom" align="' + toolbarAlign + '" height="1">' + toolbarHTML + '</td></tr>';
template['html'] += '<tr><td class="mceToolbarBottom" align="' + toolbarAlign + '" height="1"><span id="' + editorId + '_toolbar" class="mceToolbarContainer">' + toolbarHTML + '</span></td></tr>';
}
// External toolbar changes
@ -615,9 +682,10 @@ var TinyMCE_AdvancedTheme = {
var curAlign = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align", defaultContainerAlign);
var curCSS = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class", defaultContainerCSS);
for (var j=0; j<curContainer.length; j++) {
curContainer = removeFromArray(curContainer, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
for (var j=0; j<curContainer.length; j++)
curContainerHTML += tinyMCE.getControlHTML(curContainer[j]);
}
if (curContainer.length > 0) {
curContainerHTML += "<br />";
@ -664,10 +732,34 @@ var TinyMCE_AdvancedTheme = {
inst.addShortcut('ctrl', 'k', 'lang_link_desc', 'mceLink');
},
_handleMenuEvent : function(e) {
var te = tinyMCE.isMSIE ? window.event.srcElement : e.target;
tinyMCE._menuButtonEvent(e.type == "mouseover" ? "over" : "out", document.getElementById(te._switchId));
if (e.type == "click")
tinyMCE.execInstanceCommand(te._editor_id, te._command);
},
_hideMenus : function(id) {
var fcml = new TinyMCE_Layer(id + '_fcMenu'), bcml = new TinyMCE_Layer(id + '_bcMenu');
if (fcml.exists() && fcml.isVisible()) {
tinyMCE.switchClass(id + '_forecolor', 'mceMenuButton');
fcml.hide();
}
if (bcml.exists() && bcml.isVisible()) {
tinyMCE.switchClass(id + '_backcolor', 'mceMenuButton');
bcml.hide();
}
},
/**
* Node change handler.
*/
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) {
var alignNode, breakOut, classNode;
function selectByValue(select_elm, value, first_index) {
first_index = typeof(first_index) == "undefined" ? false : true;
@ -702,6 +794,7 @@ var TinyMCE_AdvancedTheme = {
var pathElm = document.getElementById(editor_id + "_path");
var inst = tinyMCE.getInstanceById(editor_id);
var doc = inst.getDoc();
TinyMCE_AdvancedTheme._hideMenus(editor_id);
if (pathElm) {
// Get node path
@ -727,6 +820,9 @@ var TinyMCE_AdvancedTheme = {
var nodeName = path[i].nodeName.toLowerCase();
var nodeData = "";
if (nodeName.indexOf("html:") == 0)
nodeName = nodeName.substring(5);
if (nodeName == "b") {
nodeName = "strong";
}
@ -781,7 +877,7 @@ var TinyMCE_AdvancedTheme = {
nodeData += "src: " + src + " ";
}
if (getAttrib(path[i], 'href') != "") {
if (path[i].nodeName == 'A' && getAttrib(path[i], 'href') != "") {
var href = tinyMCE.getAttrib(path[i], "mce_href");
if (href == "")
@ -790,9 +886,10 @@ var TinyMCE_AdvancedTheme = {
nodeData += "href: " + href + " ";
}
if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) {
nodeName = "flash";
nodeData = "src: " + path[i].getAttribute('title');
className = tinyMCE.getAttrib(path[i], "class");
if ((nodeName == "img" || nodeName == "span") && className.indexOf('mceItem') != -1) {
nodeName = className.replace(/mceItem([a-z]+)/gi, '$1').toLowerCase();
nodeData = path[i].getAttribute('title');
}
if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") {
@ -1027,7 +1124,7 @@ var TinyMCE_AdvancedTheme = {
break;
case "IMG":
if (getAttrib(node, 'name').indexOf('mce_') != 0) {
if (getAttrib(node, 'name').indexOf('mce_') != 0 && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
tinyMCE.switchClass(editor_id + '_image', 'mceButtonSelected');
}
break;
@ -1148,6 +1245,9 @@ var TinyMCE_AdvancedTheme = {
inst.iframeElement.style.width = (iw + dx) + "px";
}
}
// Remove pesky table controls
inst.useCSS = false;
},
/**
@ -1255,6 +1355,29 @@ var TinyMCE_AdvancedTheme = {
}
},
_getColorHTML : function(id, n, cm) {
var i, h, cl;
h = '<span class="mceMenuLine"></span>';
cl = tinyMCE.getParam(n, TinyMCE_AdvancedTheme._defColors).split(',');
h += '<table class="mceColors"><tr>';
for (i=0; i<cl.length; i++) {
c = 'tinyMCE.execInstanceCommand(\'' + id + '\', \'' + cm + '\', false, \'#' + cl[i] + '\');';
h += '<td><a href="javascript:' + c + '" style="background-color: #' + cl[i] + '" onclick="' + c + ';return false;"></a></td>';
if ((i+1) % 8 == 0)
h += '</tr><tr>';
}
h += '</tr></table>';
/*
h += '<a href="" class="mceMoreColors">More colors</a>';
*/
return h;
},
_insertImage : function(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout) {
tinyMCE.execCommand('mceBeginUndoLevel');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 342 B

View File

@ -3,24 +3,25 @@ function saveContent() {
tinyMCE.closeWindow(window);
}
// Fixes some charcode issues
function fixContent(html) {
/* html = html.replace(new RegExp('<(p|hr|table|tr|td|ol|ul|object|embed|li|blockquote)', 'gi'),'\n<$1');
html = html.replace(new RegExp('<\/(p|ol|ul|li|table|tr|td|blockquote|object)>', 'gi'),'</$1>\n');
html = tinyMCE.regexpReplace(html, '<br />','<br />\n','gi');
html = tinyMCE.regexpReplace(html, '\n\n','\n','gi');*/
return html;
}
function onLoadInit() {
tinyMCEPopup.resizeToInnerSize();
document.forms[0].htmlSource.value = fixContent(tinyMCE.getContent(tinyMCE.getWindowArg('editor_id')));
// Remove Gecko spellchecking
if (tinyMCE.isGecko)
document.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");
document.getElementById('htmlSource').value = tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'));
resizeInputs();
if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
setWrap('soft');
document.getElementById('wraped').checked = true;
}
}
function setWrap(val) {
var s = document.forms[0].htmlSource;
var s = document.getElementById('htmlSource');
s.wrap = val;
@ -43,6 +44,8 @@ function toggleWordWrap(elm) {
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
function resizeInputs() {
var el = document.getElementById('htmlSource');
if (!tinyMCE.isMSIE) {
wHeight = self.innerHeight-80;
wWidth = self.innerWidth-16;
@ -51,11 +54,7 @@ function resizeInputs() {
wWidth = document.body.clientWidth - 16;
}
document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px';
el.style.height = Math.abs(wHeight) + 'px';
el.style.width = Math.abs(wWidth) + 'px';
}
function renderWordWrap() {
if (tinyMCE.isMSIE || tinyMCE.isGecko)
document.write('<input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{$lang_theme_code_wordwrap}</label>');
}

View File

@ -38,6 +38,11 @@ theme_h3 : 'Heading 3',
theme_h4 : 'Heading 4',
theme_h5 : 'Heading 5',
theme_h6 : 'Heading 6',
theme_blockquote : 'Blockquote',
theme_code : 'Code',
theme_samp : 'Code sample',
theme_dt : 'Definition term ',
theme_dd : 'Definition description',
theme_colorpicker_title : 'Select a color',
theme_colorpicker_apply : 'Apply',
theme_forecolor_desc : 'Select text color',
@ -72,5 +77,6 @@ loaded_plugins : 'Loaded plugins',
help : 'Help',
not_set : '-- Not set --',
close : 'Close',
toolbar_focus : 'Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X'
toolbar_focus : 'Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X',
invalid_data : 'Error: Invalid values entered, these are marked in red.'
});

File diff suppressed because it is too large Load Diff

View File

@ -1,276 +1,286 @@
// Some global instances, this will be filled later
var tinyMCE = null, tinyMCELang = null;
function TinyMCE_Popup() {
};
TinyMCE_Popup.prototype = {
findWin : function(w) {
var c;
TinyMCE_Popup.prototype.init = function() {
var win = window.opener ? window.opener : window.dialogArguments;
var inst;
// Check parents
c = w;
while (c && (c = c.parent) != null) {
if (typeof(c.tinyMCE) != "undefined")
return c;
}
if (!win) {
// Try parent
win = parent.parent;
// Check openers
c = w;
while (c && (c = c.opener) != null) {
if (typeof(c.tinyMCE) != "undefined")
return c;
}
// Try top
if (typeof(win.tinyMCE) == "undefined")
win = top;
}
if (typeof(top.tinyMCE) != "undefined")
return top;
window.opener = win;
this.windowOpener = win;
this.onLoadEval = "";
return null;
},
// Setup parent references
tinyMCE = win.tinyMCE;
tinyMCELang = win.tinyMCELang;
init : function() {
var win = window.opener ? window.opener : window.dialogArguments, c;
var inst;
if (!tinyMCE) {
alert("tinyMCE object reference not found from popup.");
return;
}
if (!win)
win = this.findWin(window);
inst = tinyMCE.selectedInstance;
this.isWindow = tinyMCE.getWindowArg('mce_inside_iframe', false) == false;
this.storeSelection = (tinyMCE.isMSIE && !tinyMCE.isOpera) && !this.isWindow && tinyMCE.getWindowArg('mce_store_selection', true);
if (this.isWindow)
window.focus();
// Store selection
if (this.storeSelection)
inst.selectionBookmark = inst.selection.getBookmark(true);
// Setup dir
if (tinyMCELang['lang_dir'])
document.dir = tinyMCELang['lang_dir'];
// Setup title
var re = new RegExp('{|\\\$|}', 'g');
var title = document.title.replace(re, "");
if (typeof tinyMCELang[title] != "undefined") {
var divElm = document.createElement("div");
divElm.innerHTML = tinyMCELang[title];
document.title = divElm.innerHTML;
if (tinyMCE.setWindowTitle != null)
tinyMCE.setWindowTitle(window, divElm.innerHTML);
}
// Output Popup CSS class
document.write('<link href="' + tinyMCE.getParam("popups_css") + '" rel="stylesheet" type="text/css">');
tinyMCE.addEvent(window, "load", this.onLoad);
};
TinyMCE_Popup.prototype.onLoad = function() {
var dir, i, elms, body = document.body;
body.onkeydown = function (e) {
e = e ? e : window.event;
if ( e.keyCode == 27 && !e.shiftKey && !e.controlKey && !e.altKey ) {
tinyMCE.closeWindow(window);
if (!win) {
alert("tinyMCE object reference not found from popup.");
return;
}
}
if (tinyMCE.getWindowArg('mce_replacevariables', true))
body.innerHTML = tinyMCE.applyTemplate(body.innerHTML, tinyMCE.windowArgs);
window.opener = win;
this.windowOpener = win;
this.onLoadEval = "";
dir = tinyMCE.selectedInstance.settings['directionality'];
if (dir == "rtl" && document.forms && document.forms.length > 0) {
elms = document.forms[0].elements;
for (i=0; i<elms.length; i++) {
if ((elms[i].type == "text" || elms[i].type == "textarea") && elms[i].getAttribute("dir") != "ltr")
elms[i].dir = dir;
// Setup parent references
tinyMCE = win.tinyMCE;
tinyMCELang = win.tinyMCELang;
inst = tinyMCE.selectedInstance;
this.isWindow = tinyMCE.getWindowArg('mce_inside_iframe', false) == false;
this.storeSelection = (tinyMCE.isRealIE) && !this.isWindow && tinyMCE.getWindowArg('mce_store_selection', true);
if (this.isWindow)
window.focus();
// Store selection
if (this.storeSelection)
inst.selectionBookmark = inst.selection.getBookmark(true);
// Setup dir
if (tinyMCELang['lang_dir'])
document.dir = tinyMCELang['lang_dir'];
// Setup title
var re = new RegExp('{|\\\$|}', 'g');
var title = document.title.replace(re, "");
if (typeof tinyMCELang[title] != "undefined") {
var divElm = document.createElement("div");
divElm.innerHTML = tinyMCELang[title];
document.title = divElm.innerHTML;
if (tinyMCE.setWindowTitle != null)
tinyMCE.setWindowTitle(window, divElm.innerHTML);
}
}
if (body.style.display == 'none')
body.style.display = 'block';
// Output Popup CSS class
document.write('<link href="' + tinyMCE.getParam("popups_css") + '" rel="stylesheet" type="text/css">');
// Execute real onload (Opera fix)
if (tinyMCEPopup.onLoadEval != "")
eval(tinyMCEPopup.onLoadEval);
};
if (tinyMCE.getParam("popups_css_add")) {
c = tinyMCE.getParam("popups_css_add");
// Is relative
if (c.indexOf('://') == -1 && c.charAt(0) != '/')
c = tinyMCE.documentBasePath + "/" + c;
TinyMCE_Popup.prototype.executeOnLoad = function(str) {
if (tinyMCE.isOpera)
this.onLoadEval = str;
else
eval(str);
};
document.write('<link href="' + c + '" rel="stylesheet" type="text/css">');
}
tinyMCE.addEvent(window, "load", this.onLoad);
},
TinyMCE_Popup.prototype.resizeToInnerSize = function() {
// Netscape 7.1 workaround
if (this.isWindow && tinyMCE.isNS71) {
window.resizeBy(0, 10);
return;
}
onLoad : function() {
var dir, i, elms, body = document.body;
if (this.isWindow) {
var doc = document;
var body = doc.body;
var oldMargin, wrapper, iframe, nodes, dx, dy;
if (tinyMCE.getWindowArg('mce_replacevariables', true))
body.innerHTML = tinyMCE.applyTemplate(body.innerHTML, tinyMCE.windowArgs);
dir = tinyMCE.selectedInstance.settings['directionality'];
if (dir == "rtl" && document.forms && document.forms.length > 0) {
elms = document.forms[0].elements;
for (i=0; i<elms.length; i++) {
if ((elms[i].type == "text" || elms[i].type == "textarea") && elms[i].getAttribute("dir") != "ltr")
elms[i].dir = dir;
}
}
if (body.style.display == 'none')
body.style.display = 'block';
// Remove margin
oldMargin = body.style.margin;
body.style.margin = '0';
// Execute real onload (Opera fix)
if (tinyMCEPopup.onLoadEval != "")
eval(tinyMCEPopup.onLoadEval);
},
// Create wrapper
wrapper = doc.createElement("div");
wrapper.id = 'mcBodyWrapper';
wrapper.style.display = 'none';
wrapper.style.margin = '0';
executeOnLoad : function(str) {
if (tinyMCE.isOpera)
this.onLoadEval = str;
else
eval(str);
},
// Wrap body elements
nodes = doc.body.childNodes;
for (var i=nodes.length-1; i>=0; i--) {
if (wrapper.hasChildNodes())
wrapper.insertBefore(nodes[i].cloneNode(true), wrapper.firstChild);
else
wrapper.appendChild(nodes[i].cloneNode(true));
nodes[i].parentNode.removeChild(nodes[i]);
resizeToInnerSize : function() {
// Netscape 7.1 workaround
if (this.isWindow && tinyMCE.isNS71) {
window.resizeBy(0, 10);
return;
}
// Add wrapper
doc.body.appendChild(wrapper);
if (this.isWindow) {
var doc = document;
var body = doc.body;
var oldMargin, wrapper, iframe, nodes, dx, dy;
// Create iframe
iframe = document.createElement("iframe");
iframe.id = "mcWinIframe";
iframe.src = document.location.href.toLowerCase().indexOf('https') == -1 ? "about:blank" : tinyMCE.settings['default_document'];
iframe.width = "100%";
iframe.height = "100%";
iframe.style.margin = '0';
if (body.style.display == 'none')
body.style.display = 'block';
// Add iframe
doc.body.appendChild(iframe);
// Remove margin
oldMargin = body.style.margin;
body.style.margin = '0';
// Measure iframe
iframe = document.getElementById('mcWinIframe');
dx = tinyMCE.getWindowArg('mce_width') - iframe.clientWidth;
dy = tinyMCE.getWindowArg('mce_height') - iframe.clientHeight;
// Create wrapper
wrapper = doc.createElement("div");
wrapper.id = 'mcBodyWrapper';
wrapper.style.display = 'none';
wrapper.style.margin = '0';
// Resize window
// tinyMCE.debug(tinyMCE.getWindowArg('mce_width') + "," + tinyMCE.getWindowArg('mce_height') + " - " + dx + "," + dy);
window.resizeBy(dx, dy);
// Wrap body elements
nodes = doc.body.childNodes;
for (var i=nodes.length-1; i>=0; i--) {
if (wrapper.hasChildNodes())
wrapper.insertBefore(nodes[i].cloneNode(true), wrapper.firstChild);
else
wrapper.appendChild(nodes[i].cloneNode(true));
// Hide iframe and show wrapper
body.style.margin = oldMargin;
iframe.style.display = 'none';
wrapper.style.display = 'block';
}
};
nodes[i].parentNode.removeChild(nodes[i]);
}
// Add wrapper
doc.body.appendChild(wrapper);
TinyMCE_Popup.prototype.resizeToContent = function() {
var isMSIE = (navigator.appName == "Microsoft Internet Explorer");
var isOpera = (navigator.userAgent.indexOf("Opera") != -1);
// Create iframe
iframe = document.createElement("iframe");
iframe.id = "mcWinIframe";
iframe.src = document.location.href.toLowerCase().indexOf('https') == -1 ? "about:blank" : tinyMCE.settings['default_document'];
iframe.width = "100%";
iframe.height = "100%";
iframe.style.margin = '0';
if (isOpera)
return;
// Add iframe
doc.body.appendChild(iframe);
if (isMSIE) {
try { window.resizeTo(10, 10); } catch (e) {}
// Measure iframe
iframe = document.getElementById('mcWinIframe');
dx = tinyMCE.getWindowArg('mce_width') - iframe.clientWidth;
dy = tinyMCE.getWindowArg('mce_height') - iframe.clientHeight;
var elm = document.body;
var width = elm.offsetWidth;
var height = elm.offsetHeight;
var dx = (elm.scrollWidth - width) + 4;
var dy = elm.scrollHeight - height;
// Resize window
// tinyMCE.debug(tinyMCE.getWindowArg('mce_width') + "," + tinyMCE.getWindowArg('mce_height') + " - " + dx + "," + dy);
window.resizeBy(dx, dy);
try { window.resizeBy(dx, dy); } catch (e) {}
} else {
window.scrollBy(1000, 1000);
if (window.scrollX > 0 || window.scrollY > 0) {
window.resizeBy(window.innerWidth * 2, window.innerHeight * 2);
window.sizeToContent();
window.scrollTo(0, 0);
var x = parseInt(screen.width / 2.0) - (window.outerWidth / 2.0);
var y = parseInt(screen.height / 2.0) - (window.outerHeight / 2.0);
window.moveTo(x, y);
// Hide iframe and show wrapper
body.style.margin = oldMargin;
iframe.style.display = 'none';
wrapper.style.display = 'block';
}
}
};
},
resizeToContent : function() {
var isMSIE = (navigator.appName == "Microsoft Internet Explorer");
var isOpera = (navigator.userAgent.indexOf("Opera") != -1);
TinyMCE_Popup.prototype.getWindowArg = function(name, default_value) {
return tinyMCE.getWindowArg(name, default_value);
};
if (isOpera)
return;
if (isMSIE) {
try { window.resizeTo(10, 10); } catch (e) {}
TinyMCE_Popup.prototype.restoreSelection = function() {
if (this.storeSelection) {
var elm = document.body;
var width = elm.offsetWidth;
var height = elm.offsetHeight;
var dx = (elm.scrollWidth - width) + 4;
var dy = elm.scrollHeight - height;
try { window.resizeBy(dx, dy); } catch (e) {}
} else {
window.scrollBy(1000, 1000);
if (window.scrollX > 0 || window.scrollY > 0) {
window.resizeBy(window.innerWidth * 2, window.innerHeight * 2);
window.sizeToContent();
window.scrollTo(0, 0);
var x = parseInt(screen.width / 2.0) - (window.outerWidth / 2.0);
var y = parseInt(screen.height / 2.0) - (window.outerHeight / 2.0);
window.moveTo(x, y);
}
}
},
getWindowArg : function(name, default_value) {
return tinyMCE.getWindowArg(name, default_value);
},
restoreSelection : function() {
if (this.storeSelection) {
var inst = tinyMCE.selectedInstance;
inst.getWin().focus();
if (inst.selectionBookmark)
inst.selection.moveToBookmark(inst.selectionBookmark);
}
},
execCommand : function(command, user_interface, value) {
var inst = tinyMCE.selectedInstance;
inst.getWin().focus();
this.restoreSelection();
inst.execCommand(command, user_interface, value);
if (inst.selectionBookmark)
inst.selection.moveToBookmark(inst.selectionBookmark);
// Store selection
if (this.storeSelection)
inst.selectionBookmark = inst.selection.getBookmark(true);
},
close : function() {
tinyMCE.closeWindow(window);
},
pickColor : function(e, element_id) {
tinyMCE.selectedInstance.execCommand('mceColorPicker', true, {
element_id : element_id,
document : document,
window : window,
store_selection : false
});
},
openBrowser : function(element_id, type, option) {
var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback"));
var url = document.getElementById(element_id).value;
tinyMCE.setWindowArg("window", window);
tinyMCE.setWindowArg("document", document);
// Call to external callback
if (eval('typeof(tinyMCEPopup.windowOpener.' + cb + ')') == "undefined")
alert("Callback function: " + cb + " could not be found.");
else
eval("tinyMCEPopup.windowOpener." + cb + "(element_id, url, type, window);");
},
importClass : function(c) {
window[c] = function() {};
for (var n in window.opener[c].prototype)
window[c].prototype[n] = window.opener[c].prototype[n];
window[c].constructor = window.opener[c].constructor;
}
};
TinyMCE_Popup.prototype.execCommand = function(command, user_interface, value) {
var inst = tinyMCE.selectedInstance;
this.restoreSelection();
inst.execCommand(command, user_interface, value);
// Store selection
if (this.storeSelection)
inst.selectionBookmark = inst.selection.getBookmark(true);
};
TinyMCE_Popup.prototype.close = function() {
tinyMCE.closeWindow(window);
};
TinyMCE_Popup.prototype.pickColor = function(e, element_id) {
tinyMCE.selectedInstance.execCommand('mceColorPicker', true, {
element_id : element_id,
document : document,
window : window,
store_selection : false
});
};
TinyMCE_Popup.prototype.openBrowser = function(element_id, type, option) {
var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback"));
var url = document.getElementById(element_id).value;
tinyMCE.setWindowArg("window", window);
tinyMCE.setWindowArg("document", document);
// Call to external callback
if (eval('typeof(tinyMCEPopup.windowOpener.' + cb + ')') == "undefined")
alert("Callback function: " + cb + " could not be found.");
else
eval("tinyMCEPopup.windowOpener." + cb + "(element_id, url, type, window);");
};
TinyMCE_Popup.prototype.importClass = function(c) {
window[c] = function() {};
for (var n in window.opener[c].prototype)
window[c].prototype[n] = window.opener[c].prototype[n];
window[c].constructor = window.opener[c].constructor;
};
};
// Setup global instance
var tinyMCEPopup = new TinyMCE_Popup();

View File

@ -1,7 +1,5 @@
/**
* $RCSfile: form_utils.js,v $
* $Revision: 1.10 $
* $Date: 2006/03/22 12:21:24 $
* $Id: form_utils.js 43 2006-08-08 16:10:07Z spocke $
*
* Various form utilitiy functions.
*
@ -9,18 +7,20 @@
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
var themeBaseURL = tinyMCE.baseURL + '/themes/' + tinyMCE.getParam("theme");
function getColorPickerHTML(id, target_form_element) {
var html = "";
var h = "";
html += '<a id="' + id + '_link" href="javascript:void(0);" onkeydown="pickColor(event,\'' + target_form_element +'\');" onmousedown="pickColor(event,\'' + target_form_element +'\');return false;">';
html += '<img id="' + id + '" src="../../themes/' + tinyMCE.getParam("theme") + '/images/color.gif"';
html += ' onmouseover="this.className=\'mceButtonOver\'"';
html += ' onmouseout="this.className=\'mceButtonNormal\'"';
html += ' onmousedown="this.className=\'mceButtonDown\'"';
html += ' width="20" height="16" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
html += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" /></a>';
h += '<a id="' + id + '_link" href="javascript:void(0);" onkeydown="pickColor(event,\'' + target_form_element +'\');" onmousedown="pickColor(event,\'' + target_form_element +'\');return false;">';
h += '<img id="' + id + '" src="' + themeBaseURL + '/images/color.gif"';
h += ' onmouseover="this.className=\'mceButtonOver\'"';
h += ' onmouseout="this.className=\'mceButtonNormal\'"';
h += ' onmousedown="this.className=\'mceButtonDown\'"';
h += ' width="20" height="16" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
h += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" /></a>';
return html;
return h;
}
function pickColor(e, target_form_element) {
@ -57,7 +57,7 @@ function getBrowserHTML(id, target_form_element, type, prefix) {
var html = "";
html += '<a id="' + id + '_link" href="javascript:openBrower(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;">';
html += '<img id="' + id + '" src="../../themes/' + tinyMCE.getParam("theme") + '/images/browse.gif"';
html += '<img id="' + id + '" src="' + themeBaseURL + '/images/browse.gif"';
html += ' onmouseover="this.className=\'mceButtonOver\';"';
html += ' onmouseout="this.className=\'mceButtonNormal\';"';
html += ' onmousedown="this.className=\'mceButtonDown\';"';
@ -92,9 +92,10 @@ function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
}
if (!found && add_custom && value != '') {
var option = new Option('Value: ' + value, value);
var option = new Option(value, value);
option.selected = true;
sel.options[sel.options.length] = option;
sel.selectedIndex = sel.options.length - 1;
}
return found;

View File

@ -1,7 +1,5 @@
/**
* $RCSfile: mclayer.js,v $
* $Revision: 1.2 $
* $Date: 2006/02/06 20:11:09 $
* $Id: mclayer.js 18 2006-06-29 14:11:23Z spocke $
*
* Moxiecode floating layer script.
*
@ -209,4 +207,4 @@ MCLayer.prototype = {
return parseInt(s);
}
}
}

View File

@ -1,7 +1,5 @@
/**
* $RCSfile: mctabs.js,v $
* $Revision: 1.2 $
* $Date: 2006/02/06 20:11:09 $
* $Id: mctabs.js 18 2006-06-29 14:11:23Z spocke $
*
* Moxiecode DHTML Tabs script.
*

View File

@ -1,7 +1,5 @@
/**
* $RCSfile: validate.js,v $
* $Revision: 1.3 $
* $Date: 2006/02/06 20:11:09 $
* $Id: validate.js 65 2006-08-24 15:54:55Z spocke $
*
* Various form validation methods.
*
@ -9,42 +7,213 @@
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
function testRegExp(form_name, element_name, re) {
return new RegExp(re).test(document.forms[form_name].elements[element_name].value);
}
/**
// String validation:
function validateString(form_name, element_name) {
return (document.forms[form_name].elements[element_name].value.length > 0);
}
if (!Validator.isEmail('myemail'))
alert('Invalid email.');
function validateSelection(form_name, element_name) {
return (document.forms[form_name].elements[element_name].selectedIndex > 0);
}
// Form validation:
function validateCheckBox(form_name, element_name) {
return document.forms[form_name].elements[element_name].checked;
}
var f = document.forms['myform'];
function validateCleanString(form_name, element_name) {
return testRegExp(form_name, element_name, '^[A-Za-z0-9_]+$');
}
if (!Validator.isEmail(f.myemail))
alert('Invalid email.');
*/
function validateEmail(form_name, element_name) {
return testRegExp(form_name, element_name, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
}
var Validator = {
isEmail : function(s) {
return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
},
function validateAbsUrl(form_name, element_name) {
return testRegExp(form_name, element_name, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+$');
}
isAbsUrl : function(s) {
return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
},
function validateNumber(form_name, element_name, allow_blank) {
return (!allow_blank && value == '') ? false : testRegExp(form_name, element_name, '^-?[0-9]*\\.?[0-9]*$');
}
isSize : function(s) {
return this.test(s, '^[0-9]+(px|%)?$');
},
function validateSize(form_name, element_name,) {
return testRegExp(form_name, element_name, '^[0-9]+(px|%)?$');
}
isId : function(s) {
return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
},
function validateID(form_name, element_name,) {
return testRegExp(form_name, element_name, '^[A-Za-z_]([A-Za-z0-9_])*$');
}
isEmpty : function(s) {
var nl, i;
if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
return true;
if (s.type == 'checkbox' && !s.checked)
return true;
if (s.type == 'radio') {
for (i=0, nl = s.form.elements; i<nl.length; i++) {
if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
return false;
}
return true;
}
return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
},
isNumber : function(s, d) {
return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
},
test : function(s, p) {
s = s.nodeType == 1 ? s.value : s;
return s == '' || new RegExp(p).test(s);
}
};
var AutoValidator = {
settings : {
id_cls : 'id',
int_cls : 'int',
url_cls : 'url',
number_cls : 'number',
email_cls : 'email',
size_cls : 'size',
required_cls : 'required',
invalid_cls : 'invalid',
min_cls : 'min',
max_cls : 'max'
},
init : function(s) {
var n;
for (n in s)
this.settings[n] = s[n];
},
validate : function(f) {
var i, nl, s = this.settings, c = 0;
nl = this.tags(f, 'label');
for (i=0; i<nl.length; i++)
this.removeClass(nl[i], s.invalid_cls);
c += this.validateElms(f, 'input');
c += this.validateElms(f, 'select');
c += this.validateElms(f, 'textarea');
return c == 3;
},
invalidate : function(n) {
this.mark(n.form, n);
},
reset : function(e) {
var t = new Array('label', 'input', 'select', 'textarea');
var i, j, nl, s = this.settings;
if (e == null)
return;
for (i=0; i<t.length; i++) {
nl = this.tags(e.form ? e.form : e, t[i]);
for (j=0; j<nl.length; j++)
this.removeClass(nl[j], s.invalid_cls);
}
},
validateElms : function(f, e) {
var nl, i, n, s = this.settings, st = true, va = Validator, v;
nl = this.tags(f, e);
for (i=0; i<nl.length; i++) {
n = nl[i];
this.removeClass(n, s.invalid_cls);
if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
st = this.mark(f, n);
if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
st = this.mark(f, n);
if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
st = this.mark(f, n);
if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
st = this.mark(f, n);
if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
st = this.mark(f, n);
if (this.hasClass(n, s.size_cls) && !va.isSize(n))
st = this.mark(f, n);
if (this.hasClass(n, s.id_cls) && !va.isId(n))
st = this.mark(f, n);
if (this.hasClass(n, s.min_cls, true)) {
v = this.getNum(n, s.min_cls);
if (isNaN(v) || parseInt(n.value) < parseInt(v))
st = this.mark(f, n);
}
if (this.hasClass(n, s.max_cls, true)) {
v = this.getNum(n, s.max_cls);
if (isNaN(v) || parseInt(n.value) > parseInt(v))
st = this.mark(f, n);
}
}
return st;
},
hasClass : function(n, c, d) {
return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
},
getNum : function(n, c) {
c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
c = c.replace(/[^0-9]/g, '');
return c;
},
addClass : function(n, c, b) {
var o = this.removeClass(n, c);
n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
},
removeClass : function(n, c) {
c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
return n.className = c != ' ' ? c : '';
},
tags : function(f, s) {
return f.getElementsByTagName(s);
},
mark : function(f, n) {
var s = this.settings;
this.addClass(n, s.invalid_cls);
this.markLabels(f, n, s.invalid_cls);
return false;
},
markLabels : function(f, n, ic) {
var nl, i;
nl = this.tags(f, "label");
for (i=0; i<nl.length; i++) {
if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
this.addClass(nl[i], ic);
}
return null;
}
};

View File

@ -15,8 +15,9 @@ class WP_Scripts {
$this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
$this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3517' );
$this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' );
$this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '09212006' );
$this->add( 'wp_tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('tiny_mce'), '09212006' );
$this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20061113' );
$mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php');
$this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20061113' );
$this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.0');
$this->add( 'autosave', '/wp-includes/js/autosave.js.php', array('prototype', 'sack'), '4206');
$this->add( 'wp-ajax', '/wp-includes/js/wp-ajax-js.php', array('prototype'), '4459');