From f336d22da7667ebe18e44a118e56afb4f87e5a2e Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 21 Nov 2006 00:55:06 +0000 Subject: [PATCH] TinyMCE 2.0.8 git-svn-id: http://svn.automattic.com/wordpress/trunk@4506 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/upload-js.php | 18 +- wp-includes/js/autosave.js.php | 10 +- wp-includes/js/tinymce/license.txt | 245 +- .../tinymce/plugins/autosave/editor_plugin.js | 8 +- .../plugins/directionality/editor_plugin.js | 8 +- .../plugins/inlinepopups/editor_plugin.js | 10 +- .../inlinepopups/jscripts/mcwindows.js | 4 +- .../js/tinymce/plugins/paste/editor_plugin.js | 386 ++- .../plugins/paste/jscripts/pastetext.js | 4 + .../plugins/paste/jscripts/pasteword.js | 6 + .../js/tinymce/themes/advanced/charmap.htm | 2 +- .../tinymce/themes/advanced/color_picker.htm | 2 +- .../themes/advanced/css/editor_content.css | 5 + .../themes/advanced/css/editor_popup.css | 4 + .../tinymce/themes/advanced/css/editor_ui.css | 415 +--- .../themes/advanced/editor_template.js | 211 +- .../themes/advanced/editor_template_src.js | 0 .../themes/advanced/images/backcolor.gif | Bin 174 -> 359 bytes .../themes/advanced/images/buttons.gif | Bin 8399 -> 5662 bytes .../themes/advanced/images/forecolor.gif | Bin 272 -> 342 bytes .../themes/advanced/jscripts/source_editor.js | 33 +- .../js/tinymce/themes/advanced/langs/en.js | 8 +- wp-includes/js/tinymce/tiny_mce.js | 2103 +++++++++++------ wp-includes/js/tinymce/tiny_mce_popup.js | 448 ++-- wp-includes/js/tinymce/utils/form_utils.js | 29 +- wp-includes/js/tinymce/utils/mclayer.js | 6 +- wp-includes/js/tinymce/utils/mctabs.js | 4 +- wp-includes/js/tinymce/utils/validate.js | 235 +- wp-includes/script-loader.php | 5 +- 29 files changed, 2649 insertions(+), 1560 deletions(-) delete mode 100644 wp-includes/js/tinymce/themes/advanced/editor_template_src.js diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index 25748eb1e..e221f57f4 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -97,20 +97,20 @@ addLoadEvent( function() { h += "
"; h += ""; if ( this.currentImage.thumb ) { - h += ""; } - h += ""; h += "
Show:"; - h += "
"; - h += ""; + h += "
"; + h += "
"; + h += ""; h += "
Link to:"; - h += "
"; - h += "
"; - h += ""; + h += "
"; + h += "
"; + h += "
"; + h += ""; h += "

"; - h += ""; + h += " »' />"; h += "

"; h += "
"; @@ -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("") { $('action-value').value = 'delete'; $('upload-file').submit(); return true; diff --git a/wp-includes/js/autosave.js.php b/wp-includes/js/autosave.js.php index c36031885..ec5e2e569 100644 --- a/wp-includes/js/autosave.js.php +++ b/wp-includes/js/autosave.js.php @@ -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, ); + autosavePeriodical = new PeriodicalExecuter(autosave, ); + //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) diff --git a/wp-includes/js/tinymce/license.txt b/wp-includes/js/tinymce/license.txt index 3b0396a2b..60d6d4c8f 100644 --- a/wp-includes/js/tinymce/license.txt +++ b/wp-includes/js/tinymce/license.txt @@ -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. + + + Copyright (C) + + 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. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js b/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js index 4b88d2ecf..68563f96e 100644 --- a/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js @@ -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 diff --git a/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js b/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js index ad0fa87e9..c8a629594 100644 --- a/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js @@ -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 diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js b/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js index 74d18059c..c005a9e7b 100644 --- a/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js @@ -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(); diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js b/wp-includes/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js index a88ffd731..325d29399 100644 --- a/wp-includes/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js +++ b/wp-includes/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js @@ -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. * diff --git a/wp-includes/js/tinymce/plugins/paste/editor_plugin.js b/wp-includes/js/tinymce/plugins/paste/editor_plugin.js index 42f95b901..1e2583678 100644 --- a/wp-includes/js/tinymce/plugins/paste/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/paste/editor_plugin.js @@ -1 +1,385 @@ -tinyMCE.importPluginLanguagePack('paste','en,tr,sv,cs,zh_cn,fr_ca,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,pl,nl,fr,pt_br');var TinyMCE_PastePlugin={getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_paste.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isMSIE&&tinyMCE.getParam("paste_auto_cleanup_on_paste",false))tinyMCE.addEvent(inst.getBody(),"paste",TinyMCE_PastePlugin._handlePasteEvent);},getControlHTML:function(cn){switch(cn){case"pastetext":return tinyMCE.getButtonHTML(cn,'lang_paste_text_desc','{$pluginurl}/images/pastetext.gif','mcePasteText',true);case"pasteword":return tinyMCE.getButtonHTML(cn,'lang_paste_word_desc','{$pluginurl}/images/pasteword.gif','mcePasteWord',true);case"selectall":return tinyMCE.getButtonHTML(cn,'lang_selectall_desc','{$pluginurl}/images/selectall.gif','mceSelectAll',true);}return'';},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mcePasteText":if(user_interface){if((tinyMCE.isMSIE&&!tinyMCE.isOpera)&&!tinyMCE.getParam('paste_use_dialog',false))TinyMCE_PastePlugin._insertText(clipboardData.getData("Text"),true);else{var template=new Array();template['file']='../../plugins/paste/pastetext.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",inline:"yes",mceDo:'insert'});}}else TinyMCE_PastePlugin._insertText(value['html'],value['linebreaks']);return true;case"mcePasteWord":if(user_interface){if((tinyMCE.isMSIE&&!tinyMCE.isOpera)&&!tinyMCE.getParam('paste_use_dialog',false)){var html=TinyMCE_PastePlugin._clipboardHTML();if(html&&html.length>0)TinyMCE_PastePlugin._insertWordContent(html);}else{var template=new Array();template['file']='../../plugins/paste/pasteword.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",inline:"yes",mceDo:'insert'});}}else TinyMCE_PastePlugin._insertWordContent(value);return true;case"mceSelectAll":tinyMCE.execInstanceCommand(editor_id,'selectall');return true;}return false;},_handlePasteEvent:function(e){switch(e.type){case"paste":var html=TinyMCE_PastePlugin._clipboardHTML();var r,inst=tinyMCE.selectedInstance;if(inst&&(r=inst.getRng())&&r.text.length>0)tinyMCE.execCommand('delete');if(html&&html.length>0)tinyMCE.execCommand('mcePasteWord',false,html);tinyMCE.cancelEvent(e);return false;}return true;},_insertText:function(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(tinyMCE.getParam("paste_create_paragraphs",true)){var rl=tinyMCE.getParam("paste_replace_list",'\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i

","gi");content=tinyMCE.regexpReplace(content,"\r\r","

","gi");content=tinyMCE.regexpReplace(content,"\n\n","

","gi");if((pos=content.indexOf('

'))!=-1){tinyMCE.execCommand("Delete");var node=tinyMCE.selectedInstance.getFocusElement();var breakElms=new Array();do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="

";before+=content.substring(0,pos);for(var i=0;i";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="

";content=before+content.substring(pos+7)+after;}}if(tinyMCE.getParam("paste_create_linebreaks",true)){content=tinyMCE.regexpReplace(content,"\r\n","
","gi");content=tinyMCE.regexpReplace(content,"\r","
","gi");content=tinyMCE.regexpReplace(content,"\n","
","gi");}}tinyMCE.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);var cb;if((cb=tinyMCE.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('before', content)");var rl=tinyMCE.getParam("paste_replace_list",'\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i(.*?)<\/p>','gi'),'

$1

');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)
","gi"),"

"+middot+"$1

");content=content.replace(new RegExp('','gi'),""+bull);content=content.replace(/<\/o:p>/gi,"");content=content.replace(new RegExp('
]*>/gi,"");if(tinyMCE.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(tinyMCE.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+TinyMCE_PastePlugin._reEscape(""+document.location)+'','gi'),'href="'+tinyMCE.settings['document_base_url']);content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*

 <\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!tinyMCE.settings['force_p_newlines']){content=content.replace('','','gi');content=content.replace('

','

','gi');}if(!tinyMCE.isMSIE&&!tinyMCE.settings['force_p_newlines']){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(tinyMCE.getParam("paste_convert_middot_lists",true)){var div=document.createElement("div");div.innerHTML=content;var className=tinyMCE.getParam("paste_unindented_list_class","unIndentedList");while(TinyMCE_PastePlugin._convertMiddots(div,"--list--"));while(TinyMCE_PastePlugin._convertMiddots(div,middot,className));while(TinyMCE_PastePlugin._convertMiddots(div,bull));content=div.innerHTML;}if(tinyMCE.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/ <\/h[1-6]>/gi,'

  

');content=content.replace(//gi,'

');content=content.replace(/<\/h[1-6]>/gi,'

');content=content.replace(/ <\/b>/gi,'  ');content=content.replace(/^( )*/gi,'');}content=content.replace(/--list--/gi,"");if((cb=tinyMCE.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('after', content)");tinyMCE.execCommand("mceInsertContent",false,content);window.setTimeout('tinyMCE.execCommand("mceCleanup");',1);}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i 0) + tinyMCE.execCommand('delete'); + + if (html && html.length > 0) + tinyMCE.execCommand('mcePasteWord', false, html); + + tinyMCE.cancelEvent(e); + return false; + } + + return true; + }, + + _insertText : function(content, bLinebreaks) { + if (content && content.length > 0) { + if (bLinebreaks) { + // Special paragraph treatment + if (tinyMCE.getParam("paste_create_paragraphs", true)) { + var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); + for (var i=0; i

", "gi"); + content = tinyMCE.regexpReplace(content, "\r\r", "

", "gi"); + content = tinyMCE.regexpReplace(content, "\n\n", "

", "gi"); + + // Has paragraphs + if ((pos = content.indexOf('

')) != -1) { + tinyMCE.execCommand("Delete"); + + var node = tinyMCE.selectedInstance.getFocusElement(); + + // Get list of elements to break + var breakElms = new Array(); + + do { + if (node.nodeType == 1) { + // Don't break tables and break at body + if (node.nodeName == "TD" || node.nodeName == "BODY") + break; + + breakElms[breakElms.length] = node; + } + } while(node = node.parentNode); + + var before = "", after = "

"; + before += content.substring(0, pos); + + for (var i=0; i"; + after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">"; + } + + before += "

"; + content = before + content.substring(pos+7) + after; + } + } + + if (tinyMCE.getParam("paste_create_linebreaks", true)) { + content = tinyMCE.regexpReplace(content, "\r\n", "
", "gi"); + content = tinyMCE.regexpReplace(content, "\r", "
", "gi"); + content = tinyMCE.regexpReplace(content, "\n", "
", "gi"); + } + } + + tinyMCE.execCommand("mceInsertRawHTML", false, content); + } + }, + + _insertWordContent : function(content) { + if (content && content.length > 0) { + // Cleanup Word content + var bull = String.fromCharCode(8226); + var middot = String.fromCharCode(183); + var cb; + + if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "") + content = eval(cb + "('before', content)"); + + var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); + for (var i=0; i(.*?)<\/p>', 'gi'), '

$1

'); + } + + content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--"); + content = content.replace(new RegExp(bull + "(.*?)
", "gi"), "

" + middot + "$1

"); + content = content.replace(new RegExp('', 'gi'), "" + bull); // Covert to bull list + content = content.replace(/<\/o:p>/gi, ""); + content = content.replace(new RegExp('
]*>/gi, ""); + + if (tinyMCE.getParam("paste_remove_styles", true)) + content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3"); + + content = content.replace(/<\/?font[^>]*>/gi, ""); + + // Strips class attributes. + switch (tinyMCE.getParam("paste_strip_class_attributes", "all")) { + case "all": + content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3"); + break; + + case "mso": + content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3"); + break; + } + + content = content.replace(new RegExp('href="?' + TinyMCE_PastePlugin._reEscape("" + document.location) + '', 'gi'), 'href="' + tinyMCE.settings['document_base_url']); + content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); + content = content.replace(/<\\?\?xml[^>]*>/gi, ""); + content = content.replace(/<\/?\w+:[^>]*>/gi, ""); + content = content.replace(/-- page break --\s*

 <\/p>/gi, ""); // Remove pagebreaks + content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks + + // content = content.replace(/\/? */gi, "");   + // content = content.replace(/

 <\/p>/gi, ''); + + if (!tinyMCE.settings['force_p_newlines']) { + content = content.replace('', '' ,'gi'); + content = content.replace('

', '

' ,'gi'); + } + + if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) { + content = content.replace(/<\/?p[^>]*>/gi, ""); + } + + content = content.replace(/<\/?div[^>]*>/gi, ""); + + // Convert all middlot lists to UL lists + if (tinyMCE.getParam("paste_convert_middot_lists", true)) { + var div = document.createElement("div"); + div.innerHTML = content; + + // Convert all middot paragraphs to li elements + var className = tinyMCE.getParam("paste_unindented_list_class", "unIndentedList"); + + while (TinyMCE_PastePlugin._convertMiddots(div, "--list--")) ; // bull + while (TinyMCE_PastePlugin._convertMiddots(div, middot, className)) ; // Middot + while (TinyMCE_PastePlugin._convertMiddots(div, bull)) ; // bull + + content = div.innerHTML; + } + + // Replace all headers with strong and fix some other issues + if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) { + content = content.replace(/ <\/h[1-6]>/gi, '

  

'); + content = content.replace(//gi, '

'); + content = content.replace(/<\/h[1-6]>/gi, '

'); + content = content.replace(/ <\/b>/gi, '  '); + content = content.replace(/^( )*/gi, ''); + } + + content = content.replace(/--list--/gi, ""); // Remove --list-- + + if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "") + content = eval(cb + "('after', content)"); + + // Insert cleaned content + tinyMCE.execCommand("mceInsertContent", false, content); + + if (tinyMCE.getParam('paste_force_cleanup_wordpaste', true)) + window.setTimeout('tinyMCE.execCommand("mceCleanup");', 1); // Do normal cleanup detached from this thread + } + }, + + _reEscape : function(s) { + var l = "?.\\*[](){}+^$:"; + var o = ""; + + for (var i=0; i - + diff --git a/wp-includes/js/tinymce/themes/advanced/color_picker.htm b/wp-includes/js/tinymce/themes/advanced/color_picker.htm index 725466ee7..e5fdc9f5d 100644 --- a/wp-includes/js/tinymce/themes/advanced/color_picker.htm +++ b/wp-includes/js/tinymce/themes/advanced/color_picker.htm @@ -5,7 +5,7 @@ - +
diff --git a/wp-includes/js/tinymce/themes/advanced/css/editor_content.css b/wp-includes/js/tinymce/themes/advanced/css/editor_content.css index 11f75dfad..182e79121 100644 --- a/wp-includes/js/tinymce/themes/advanced/css/editor_content.css +++ b/wp-includes/js/tinymce/themes/advanced/css/editor_content.css @@ -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; diff --git a/wp-includes/js/tinymce/themes/advanced/css/editor_popup.css b/wp-includes/js/tinymce/themes/advanced/css/editor_popup.css index 3b42925ed..079470c65 100644 --- a/wp-includes/js/tinymce/themes/advanced/css/editor_popup.css +++ b/wp-includes/js/tinymce/themes/advanced/css/editor_popup.css @@ -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 { diff --git a/wp-includes/js/tinymce/themes/advanced/css/editor_ui.css b/wp-includes/js/tinymce/themes/advanced/css/editor_ui.css index 04fccc72c..e70405db1 100644 --- a/wp-includes/js/tinymce/themes/advanced/css/editor_ui.css +++ b/wp-includes/js/tinymce/themes/advanced/css/editor_ui.css @@ -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;} diff --git a/wp-includes/js/tinymce/themes/advanced/editor_template.js b/wp-includes/js/tinymce/themes/advanced/editor_template.js index 052914ea4..2285832df 100644 --- a/wp-includes/js/tinymce/themes/advanced/editor_template.js +++ b/wp-includes/js/tinymce/themes/advanced/editor_template.js @@ -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 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'; // Setup template html - template['html'] = '
{$lang_theme_charmap_title}
'; + template['html'] = '
'; if (toolbarLocation == "top") { - template['html'] += ''; + template['html'] += ''; } if (statusbarLocation == "top") { @@ -544,7 +611,7 @@ var TinyMCE_AdvancedTheme = { template['html'] += ''; if (toolbarLocation == "bottom") { - template['html'] += ''; + template['html'] += ''; } // 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 0) { curContainerHTML += "
"; @@ -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 = ''; + cl = tinyMCE.getParam(n, TinyMCE_AdvancedTheme._defColors).split(','); + + h += '
' + toolbarHTML + '
' + toolbarHTML + '
' + toolbarHTML + '
' + toolbarHTML + '
'; + for (i=0; i'; + + if ((i+1) % 8 == 0) + h += ''; + } + + h += '
'; + /* + h += 'More colors'; + */ + + return h; + }, + _insertImage : function(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout) { tinyMCE.execCommand('mceBeginUndoLevel'); diff --git a/wp-includes/js/tinymce/themes/advanced/editor_template_src.js b/wp-includes/js/tinymce/themes/advanced/editor_template_src.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/wp-includes/js/tinymce/themes/advanced/images/backcolor.gif b/wp-includes/js/tinymce/themes/advanced/images/backcolor.gif index 8a532e5e62903230d7da3919a9300d99fad8bdde..d03e206a35300e5bc8fc26b760809ee715e14fba 100644 GIT binary patch literal 359 zcmZ?wbhEHb6k!lyxXJ(m|NsA=u;B2DE$130Y$$GDb>PC=h8YL;9lhufQV@{Qv1;Q^ z1CN9aCpLWeabVHPfD1Po9zQKUa3H|IK=i|h0tE$u0|yFDoLI16K|_GA>4F&r|37SK zt%&~c;lqUs7iP|!2{asR39SglpDc_F3@91(378K)^W9w}6@)4Ah7U!&=7r01TP(pNhpv(qI;dOyqUFCP|+_hWY WWzYVd`wr|sba?l+6DOS=8LR=)wsG75 literal 174 zcmV;f08#%(Nk%w1VH5xq0K*CZBO?>3t6qtjy*E#3&d$!w&zD+OKB~ULl7eEw((m;2 z^kQ<7@$qtYhNk=Uwg3PCA^8LW000jFEC2ui02BZe000DA@X1N5y*TU5`(_{rgp5Wq zV<-tiQw0DJpz-{)hcHm#IKm8pA~9I(Ca@SvR8S0cm6VSWFgTt^N>UaxG!szEiFzP_ cvz1f8Q5b|bYX=qJK_CnUx@XVt`!Nv!J5VM>-~a#s diff --git a/wp-includes/js/tinymce/themes/advanced/images/buttons.gif b/wp-includes/js/tinymce/themes/advanced/images/buttons.gif index 6196350de88f382e73bec4906572229b66c5c548..5ad99a7c4321610124833ba05bdf0df236f5d5a9 100644 GIT binary patch literal 5662 zcmd6q=|7YYk|LS!egFQ7-+6EzpZDuLIIm-EW2L9>y9pNrJ_G*~o6YX&I%Ki-3YuB^ z{(~uXTdfaf+)|cl4Xm=>-_whm5@s0yc+O&lXwZ zv#TFBf9KacxXm2YJszlO>tE13=;$57sA9Gc&ipy}8?$)Vv<7)|O3=tixxBoTwH~nZ zo%!C<9<*|pHw+d@Ok7)dc~d8~DmhjCMN6(<0YU@!p?B*I`U6l$7}?=}w)1_Y=0 z_*^aCo0{*m+-<$bY-{i6?CQSX^Psoy;Ul^L>ha*v@W|-c)A3HZ$w`&xa?c)Pv8i*{ zu$Y;*OYhzfqmZ-#3i9KJTxF%NO3Jw+q9_(hRAl{Ej==sO0jxl$IKPl+YzPf0!tVYj zDG4w&F+)lihg#%{bMgLmw2Wn-F>VU2b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o6Ki*zzplxA@2pwH3OcU9HpgKzNAvf+`bl|8>Uf$NMg4_-Y)R?d@22?|$W zWWd0keN(-fp%n1lDm1=nrqLz|9mxq`5TA~VULhwVJWa-;!o!8_D_kn{Fl>>-LEZht z??O;bnxJ!4ZfYH7BHiyfeAaGF6?M0DO=GiqMv!L}l`3>MACAReF2c9GxL4%9lM!e* zPZMRsM7q|^ti(2Vl8Ts5ZI%E>ZMYc4v8esCfm!Q|JPJZNgBm2qH?7Z&gk~;%1C9)Y ze3*O6OyQBdw@Dkvk1M|R=Z+mx)qZYZvaio?(EgbEnJP^I4a4}hPQR~EveFwqO^aXI zKfb9eDwqbzcVli^f;u}kxH3-0=RDS}N+U`4eobs}KbpTm`*DYPMcAv+*XfV%Q2F+` zO3Sv)f+qzJxbd(aK{O;q?t3Mp^FuV74U*1eI`*kV)rD=7I?KQCk-d3ZU zUW~4t&u(>~c3fo-+k>%(uA6jbE8V{1C*hgdSVvEjtm^dA| zzkP9L^?m-5qU~fStX460Fd410Kvy1_HPFoj=lMM X^3c@}+y6QC;n>@S#Y1)o46OP;pSlB8 diff --git a/wp-includes/js/tinymce/themes/advanced/images/forecolor.gif b/wp-includes/js/tinymce/themes/advanced/images/forecolor.gif index d5e381425fe0f58a146d8d68141686aa517c3391..8b703616081fa7e20cb176d77a750ef15006d390 100644 GIT binary patch literal 342 zcmZ?wbhEHb6k!lyxXJ(m|NsAYh*&Ub?(TUjPtI9(XvV^wi`N`ox9#kjEvEvKCobQ3 zYW=89Y{dsA6nN-J^`B6g*bt~B zFW$NN#Eux9U?sNXl?9uexSfIv8!TrB90~4BF=tVXHjL#k;p<)QXlbD+EzHc!$}3yq z$sxz#A|N8`$t}$*?=0CbE5hl{!7425%qh&aWVVaKij}KYD=c5Le#N>CYc_3Om9Qhy Hk--`Oc8y|F literal 272 zcmV+r0q_1tNk%w1VH5xq0MrHmVgdq!0s^>+A(FDP-mWX|+>7q%%Knm4;nJw;$6E00 zq5^UP@!4qj@34~ELeii*Vv@1~0%EdyB3-fv0%8IZO0wc20s(+4wP$kLBD|J7 zDvko>y+!`AasU7TA^8LW0018VEC2ui02BZe000Gz;3tk`X`X1Rsz$-QOtXFlqcphk z8fksw4TYkR;GGIL&%qNEW(vkqtZ}da8Ux6n@PL|Z4NSmNfK(!kj37En{Dy_fq91iUI{G1P_oC3mgd#5-J3RFrN~4DUKZp W2^|}!GYA_35_SkPxVgGBApkpwVP<>) diff --git a/wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js b/wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js index c266c8283..8395340ce 100644 --- a/wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js +++ b/wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js @@ -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'),'\n'); - html = tinyMCE.regexpReplace(html, '
','
\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(''); -} diff --git a/wp-includes/js/tinymce/themes/advanced/langs/en.js b/wp-includes/js/tinymce/themes/advanced/langs/en.js index ca726768a..fd915ea41 100644 --- a/wp-includes/js/tinymce/themes/advanced/langs/en.js +++ b/wp-includes/js/tinymce/themes/advanced/langs/en.js @@ -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.' }); diff --git a/wp-includes/js/tinymce/tiny_mce.js b/wp-includes/js/tinymce/tiny_mce.js index 643aab481..ecd78a231 100644 --- a/wp-includes/js/tinymce/tiny_mce.js +++ b/wp-includes/js/tinymce/tiny_mce.js @@ -2,9 +2,11 @@ /* file:jscripts/tiny_mce/classes/TinyMCE_Engine.class.js */ function TinyMCE_Engine() { + var ua; + this.majorVersion = "2"; - this.minorVersion = "0.6.1"; - this.releaseDate = "2006-05-04"; + this.minorVersion = "0.8"; + this.releaseDate = "2006-10-23"; this.instances = new Array(); this.switchClassCache = new Array(); @@ -15,12 +17,17 @@ function TinyMCE_Engine() { this.configs = new Array(); this.currentConfig = 0; this.eventHandlers = new Array(); + this.log = new Array(); + this.undoLevels = []; + this.undoIndex = 0; + this.typingUndoIndex = -1; // Browser check - var ua = navigator.userAgent; + ua = navigator.userAgent; this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1); this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1); + this.isMSIE7 = this.isMSIE && (ua.indexOf('MSIE 7') != -1); this.isGecko = ua.indexOf('Gecko') != -1; this.isSafari = ua.indexOf('Safari') != -1; this.isOpera = ua.indexOf('Opera') != -1; @@ -42,13 +49,20 @@ function TinyMCE_Engine() { this.isSafari = false; } + this.isIE = this.isMSIE; + this.isRealIE = this.isMSIE && !this.isOpera; + // TinyMCE editor id instance counter this.idCounter = 0; }; TinyMCE_Engine.prototype = { init : function(settings) { - var theme; + var theme, nl, baseHREF = "", i; + + // IE 5.0x is no longer supported since 5.5, 6.0 and 7.0 now exists. We can't support old browsers forever, sorry. + if (this.isMSIE5_0) + return; this.settings = settings; @@ -60,6 +74,13 @@ TinyMCE_Engine.prototype = { if (!tinyMCE.baseURL) { var elements = document.getElementsByTagName('script'); + // If base element found, add that infront of baseURL + nl = document.getElementsByTagName('base'); + for (i=0; i 0 && document.location.protocol != "file:") { @@ -207,7 +235,10 @@ TinyMCE_Engine.prototype = { this.settings['base_href'] = baseHREF.substring(0, baseHREF.lastIndexOf('/')) + "/"; theme = this.settings['theme']; - this.blockRegExp = new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dt|dd|dir|fieldset|form|noscript|noframes|menu|isindex|samp)$", "i"); + this.inlineStrict = 'A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment'; + this.inlineTransitional = 'A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment'; + this.blockElms = 'H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP'; + this.blockRegExp = new RegExp("^(" + this.blockElms + ")$", "i"); this.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40); this.uniqueURL = 'javascript:TINYMCE_UNIQUEURL();'; // Make unique URL non real URL this.uniqueTag = '

'; @@ -216,7 +247,7 @@ TinyMCE_Engine.prototype = { // Theme url this.settings['theme_href'] = tinyMCE.baseURL + "/themes/" + theme; - if (!tinyMCE.isMSIE) + if (!tinyMCE.isIE || tinyMCE.isOpera) this.settings['force_br_newlines'] = false; if (tinyMCE.getParam("popups_css", false)) { @@ -238,8 +269,10 @@ TinyMCE_Engine.prototype = { this.settings['editor_css'] = this.documentBasePath + "/" + cssPath; else this.settings['editor_css'] = cssPath; - } else - this.settings['editor_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_ui.css"; + } else { + if (this.settings.editor_css != '') + this.settings['editor_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_ui.css"; + } if (tinyMCE.settings['debug']) { var msg = "Debug: \n"; @@ -255,14 +288,10 @@ TinyMCE_Engine.prototype = { // Only do this once if (this.configs.length == 0) { - // Is Safari enabled - if (this.isSafari && this.getParam('safari_warning', false)) - alert("Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false"); - if (typeof(TinyMCECompressed) == "undefined") { tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCE_Engine.prototype.onLoad); - if (tinyMCE.isMSIE && !tinyMCE.isOpera) { + if (tinyMCE.isRealIE) { if (document.body) tinyMCE.addEvent(document.body, "readystatechange", TinyMCE_Engine.prototype.onLoad); else @@ -288,10 +317,12 @@ TinyMCE_Engine.prototype = { } // Setup entities - settings['cleanup_entities'] = new Array(); - var entities = tinyMCE.getParam('entities', '', true, ','); - for (var i=0; i 0) { /* Make sure it doesn't exist. */ for (i=0, lflen=this.loadedFiles.length; i 0) { + tinyMCE.nextUndoRedoAction = 'Undo'; + inst = this.undoLevels[--this.undoIndex]; + inst.select(); + + if (!tinyMCE.nextUndoRedoInstanceId) + inst.execCommand('Undo'); + } + } else + inst.execCommand('Undo'); + return true; + + case "Redo": + if (this.getParam('custom_undo_redo_global')) { + if (this.undoIndex <= this.undoLevels.length - 1) { + tinyMCE.nextUndoRedoAction = 'Redo'; + inst = this.undoLevels[this.undoIndex++]; + inst.select(); + + if (!tinyMCE.nextUndoRedoInstanceId) + inst.execCommand('Redo'); + } + } else + inst.execCommand('Redo'); + + return true; case 'mceFocus': var inst = tinyMCE.getInstanceById(value); if (inst) - inst.contentWindow.focus(); + inst.getWin().focus(); return; case "mceAddControl": @@ -657,7 +733,7 @@ TinyMCE_Engine.prototype = { case "mceResetDesignMode": // Resets the designmode state of the editors in Gecko - if (!tinyMCE.isMSIE) { + if (!tinyMCE.isIE) { for (var n in tinyMCE.instances) { if (!tinyMCE.isInstance(tinyMCE.instances[n])) continue; @@ -673,8 +749,8 @@ TinyMCE_Engine.prototype = { return; } - if (this.selectedInstance) { - this.selectedInstance.execCommand(command, user_interface, value); + if (inst) { + inst.execCommand(command, user_interface, value); } else if (tinyMCE.settings['focus_alert']) alert(tinyMCELang['lang_focus_alert']); }, @@ -696,17 +772,18 @@ TinyMCE_Engine.prototype = { if (aw.indexOf('%') == -1) { aw = parseInt(aw); - aw = aw < 0 ? 300 : aw; + aw = (isNaN(aw) || aw < 0) ? 300 : aw; aw = aw + "px"; } if (ah.indexOf('%') == -1) { ah = parseInt(ah); - ah = ah < 0 ? 240 : ah; + ah = (isNaN(ah) || ah < 0) ? 240 : ah; ah = ah + "px"; } iframe.setAttribute("id", id); + iframe.setAttribute("name", id); iframe.setAttribute("class", "mceEditorIframe"); iframe.setAttribute("border", "0"); iframe.setAttribute("frameBorder", "0"); @@ -723,7 +800,7 @@ TinyMCE_Engine.prototype = { iframe.setAttribute("scrolling", "no"); // Must have a src element in MSIE HTTPs breaks aswell as absoute URLs - if (tinyMCE.isMSIE && !tinyMCE.isOpera) + if (tinyMCE.isRealIE) iframe.setAttribute("src", this.settings['default_document']); iframe.style.width = aw; @@ -734,19 +811,19 @@ TinyMCE_Engine.prototype = { iframe.style.marginBottom = '-5px'; // MSIE 5.0 issue - if (tinyMCE.isMSIE && !tinyMCE.isOpera) + if (tinyMCE.isRealIE) replace_element.outerHTML = iframe.outerHTML; else replace_element.parentNode.replaceChild(iframe, replace_element); - if (tinyMCE.isMSIE && !tinyMCE.isOpera) + if (tinyMCE.isRealIE) return win.frames[id]; else return iframe; }, setupContent : function(editor_id) { - var inst = tinyMCE.instances[editor_id]; + var inst = tinyMCE.instances[editor_id], i; var doc = inst.getDoc(); var head = doc.getElementsByTagName('head').item(0); var content = inst.startContent; @@ -762,7 +839,7 @@ TinyMCE_Engine.prototype = { inst.switchSettings(); // Not loaded correctly hit it again, Mozilla bug #997860 - if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { + if (!tinyMCE.isIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { // This part will remove the designMode status // Failes first time in Firefox 1.5b2 on Mac try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} @@ -786,6 +863,14 @@ TinyMCE_Engine.prototype = { inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); } + // BlockFormat shortcuts keys + for (i=1; i<=6; i++) + inst.addShortcut('ctrl', '' + i, '', 'FormatBlock', false, ''); + + inst.addShortcut('ctrl', '7', '', 'FormatBlock', false, '

'); + inst.addShortcut('ctrl', '8', '', 'FormatBlock', false, '

'); + inst.addShortcut('ctrl', '9', '', 'FormatBlock', false, '
'); + // Add default shortcuts for gecko if (tinyMCE.isGecko) { inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); @@ -795,7 +880,7 @@ TinyMCE_Engine.prototype = { // Setup span styles if (tinyMCE.getParam("convert_fonts_to_spans")) - inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); + inst.getBody().setAttribute('id', 'mceSpanFonts'); if (tinyMCE.settings['nowrap']) doc.body.style.whiteSpace = "nowrap"; @@ -804,7 +889,7 @@ TinyMCE_Engine.prototype = { doc.editorId = editor_id; // Add on document element in Mozilla - if (!tinyMCE.isMSIE) + if (!tinyMCE.isIE) doc.documentElement.editorId = editor_id; inst.setBaseHREF(tinyMCE.settings['base_href']); @@ -823,7 +908,7 @@ TinyMCE_Engine.prototype = { content = tinyMCE.storeAwayURLs(content); content = tinyMCE._customCleanup(inst, "insert_to_editor", content); - if (tinyMCE.isMSIE) { + if (tinyMCE.isIE) { // Ugly!!! window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); @@ -837,7 +922,7 @@ TinyMCE_Engine.prototype = { content = tinyMCE.cleanupHTMLCode(content); // Fix for bug #958637 - if (!tinyMCE.isMSIE) { + if (!tinyMCE.isIE) { var contentElement = inst.getDoc().createElement("body"); var doc = inst.getDoc(); @@ -849,15 +934,8 @@ TinyMCE_Engine.prototype = { if (tinyMCE.settings['cleanup_on_startup']) tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); - else { - // Convert all strong/em to b/i - content = tinyMCE.regexpReplace(content, "", "", "gi"); - content = tinyMCE.regexpReplace(content, "", "", "gi"); - content = tinyMCE.regexpReplace(content, "", "", "gi"); + else tinyMCE.setInnerHTML(inst.getBody(), content); - } tinyMCE.convertAllRelativeURLs(inst.getBody()); } else { @@ -881,11 +959,11 @@ TinyMCE_Engine.prototype = { tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); // Re-add design mode on mozilla - if (!tinyMCE.isMSIE) + if (!tinyMCE.isIE) tinyMCE.addEventHandlers(inst); // Add blur handler - if (tinyMCE.isMSIE) { + if (tinyMCE.isIE) { tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 @@ -898,7 +976,7 @@ TinyMCE_Engine.prototype = { } // Trigger node change, this call locks buttons for tables and so forth - tinyMCE.selectedInstance = inst; + inst.select(); tinyMCE.selectedElement = inst.contentWindow.document.body; // Call custom DOM cleanup @@ -917,19 +995,21 @@ TinyMCE_Engine.prototype = { if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(inst.getBody(), function(n) { - if (n.nodeType == 3 || n.nodeType == 8) { - n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); - n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); - } + if (n.nodeType == 3 || n.nodeType == 8) + n.nodeValue = n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"', 'gi'), ""); return false; }); } + // Remove Gecko spellchecking + if (tinyMCE.isGecko) + inst.getBody().spellcheck = tinyMCE.getParam("gecko_spellcheck"); + // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(inst.getBody()); - tinyMCE.selectedInstance = inst; + inst.select(); tinyMCE.triggerNodeChange(false, true); }, @@ -950,42 +1030,14 @@ TinyMCE_Engine.prototype = { if (tinyMCE.isGecko) { // Remove mce_src from textnodes and comments tinyMCE.selectNodes(n, function(n) { - if (n.nodeType == 3 || n.nodeType == 8) { - n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); - n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); - } + if (n.nodeType == 3 || n.nodeType == 8) + n.nodeValue = n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)=\"[^\"]*\"', 'gi'), ""); return false; }); } }, - removeTinyMCEFormElements : function(form_obj) { - // Check if form is valid - if (typeof(form_obj) == "undefined" || form_obj == null) - return; - - // If not a form, find the form - if (form_obj.nodeName != "FORM") { - if (form_obj.form) - form_obj = form_obj.form; - else - form_obj = tinyMCE.getParentElement(form_obj, "form"); - } - - // Still nothing - if (form_obj == null) - return; - - // Disable all UI form elements that TinyMCE created - for (var i=0; i'; + h += ''; h += ''; h += ''; } else { // Normal button - h += ''; + h += ''; h += ''; h += ''; } @@ -1334,6 +1373,58 @@ TinyMCE_Engine.prototype = { return h; }, + getMenuButtonHTML : function(id, lang, img, mcmd, cmd, ui, val) { + var h = '', m, x; + + mcmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + mcmd + '\');'; + cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + cmd + '\''; + + if (typeof(ui) != "undefined" && ui != null) + cmd += ',' + ui; + + if (typeof(val) != "undefined" && val != null) + cmd += ",'" + val + "'"; + + cmd += ');'; + + // Use tilemaps when enabled and found and never in MSIE since it loads the tile each time from cache if cahce is disabled + if (tinyMCE.getParam('button_tile_map') && (!tinyMCE.isIE || tinyMCE.isOpera) && (m = tinyMCE.buttonMap[id]) != null && (tinyMCE.getParam("language") == "en" || img.indexOf('$lang') == -1)) { + x = 0 - (m * 20) == 0 ? '0' : 0 - (m * 20); + + if (tinyMCE.isRealIE) + h += ''; + else + h += ''; + + h += ''; + h += ''; + h += ''; + h += ''; + } else { + if (tinyMCE.isRealIE) + h += ''; + else + h += ''; + + h += ''; + h += ''; + h += ''; + h += ''; + } + + return h; + }, + + _menuButtonEvent : function(e, o) { + if (o.className == 'mceMenuButtonFocus') + return; + + if (e == 'over') + o.className = o.className + ' mceMenuHover'; + else + o.className = o.className.replace(/\s.*$/, ''); + }, + addButtonMap : function(m) { var i, a = m.replace(/\s+/, '').split(','); @@ -1342,20 +1433,21 @@ TinyMCE_Engine.prototype = { }, submitPatch : function() { - tinyMCE.removeTinyMCEFormElements(this); tinyMCE.triggerSave(); - this.mceOldSubmit(); tinyMCE.isNotDirty = true; + this.mceOldSubmit(); }, onLoad : function() { + var r; + // Wait for everything to be loaded first if (tinyMCE.settings.strict_loading_mode && this.loadingIndex != -1) { window.setTimeout('tinyMCE.onLoad();', 1); return; } - if (tinyMCE.isMSIE && !tinyMCE.isOpera && window.event.type == "readystatechange" && document.readyState != "complete") + if (tinyMCE.isRealIE && window.event.type == "readystatechange" && document.readyState != "complete") return true; if (tinyMCE.isLoaded) @@ -1363,6 +1455,15 @@ TinyMCE_Engine.prototype = { tinyMCE.isLoaded = true; + // IE produces JS error if TinyMCE is placed in a frame + // It seems to have something to do with the selection not beeing + // correctly initialized in IE so this hack solves the problem + if (tinyMCE.isRealIE && document.body) { + r = document.body.createTextRange(); + r.collapse(true); + r.select(); + } + tinyMCE.dispatchCallback(null, 'onpageload', 'onPageLoad'); for (var c=0; c 0); @@ -1590,6 +1689,11 @@ TinyMCE_Engine.prototype = { if (customCleanup != "" && eval("typeof(" + customCleanup + ")") != "undefined") content = eval(customCleanup + "(type, content, inst);"); + // Trigger theme cleanup + po = tinyMCE.themes[tinyMCE.settings['theme']]; + if (po && po.cleanup) + content = po.cleanup(type, content, inst); + // Trigger plugin cleanups pl = inst.plugins; for (i=0; i 0) { - for (i=ar.length-1; i>=0; i--) { - s = ar[i].substring(2, ar[i].length-1); + if (as && as[s]) + return as[s]; - if (s.indexOf('lang_') == 0 && tinyMCELang[s]) - h = tinyMCE.replaceVar(h, s, tinyMCELang[s]); - else if (as && as[s]) - h = tinyMCE.replaceVar(h, s, as[s]); - else if (tinyMCE.settings[s]) - h = tinyMCE.replaceVar(h, s, tinyMCE.settings[s]); - } - } + if (tinyMCE.settings[s]) + return tinyMCE.settings[s]; - h = tinyMCE.replaceVar(h, "themeurl", tinyMCE.themeURL); + if (m == 'themeurl') + return tinyMCE.themeURL; - return h; + return m; + }); }, replaceVar : function(h, r, v) { @@ -1672,7 +1767,7 @@ TinyMCE_Engine.prototype = { height = 200; // Add to height in M$ due to SP2 WHY DON'T YOU GUYS IMPLEMENT innerWidth of windows!! - if (tinyMCE.isMSIE) + if (tinyMCE.isIE) height += 40; else height += 20; @@ -1711,7 +1806,7 @@ TinyMCE_Engine.prototype = { win.resizeTo(width, height); win.focus(); } else { - if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && resizable != 'yes' && tinyMCE.settings["dialog_type"] == "modal") { + if ((tinyMCE.isRealIE) && resizable != 'yes' && tinyMCE.settings["dialog_type"] == "modal") { height += 10; var features = "resizable:" + resizable @@ -1823,7 +1918,7 @@ TinyMCE_Engine.prototype = { if (anchorName != '' && state) { el.title = anchorName; - el.className = 'mceItemAnchor'; + tinyMCE.addCSSClass(el, 'mceItemAnchor'); } else if (anchorName != '' && !state) el.className = ''; @@ -1870,7 +1965,7 @@ TinyMCE_Engine.prototype = { */ fixGeckoBaseHREFBug : function(m, e, h) { - var nl, i, a, n, xsrc, xhref, el; + var xsrc, xhref; if (tinyMCE.isGecko) { if (m == 1) { @@ -1879,38 +1974,40 @@ TinyMCE_Engine.prototype = { return h; } else { - el = new Array('a','img','select','area','iframe','base','input','script','embed','object','link'); + // Why bother if there is no src or href broken + if (!new RegExp('(src|href)=', 'g').test(h)) + return h; - for (a=0; a 0) + if (o[n] && (v = tinyMCE.evalFunc(n, 3, a, o)) == s && m > 0) return true; } } @@ -2208,7 +2305,7 @@ TinyMCE_Engine.prototype = { for (on in l) { o = l[on]; - if (o[n] && (v = tinyMCE.evalFunc(o[n], 3, a)) == s && m > 0) + if (o[n] && (v = tinyMCE.evalFunc(n, 3, a, o)) == s && m > 0) return true; } @@ -2216,14 +2313,26 @@ TinyMCE_Engine.prototype = { }, xmlEncode : function(s) { - s = "" + s; - s = s.replace(/&/g, '&'); - s = s.replace(new RegExp('"', 'g'), '"'); - s = s.replace(/\'/g, '''); // ' is not working in MSIE - s = s.replace(//g, '>'); + return s ? ('' + s).replace(new RegExp('[<>&"\']', 'g'), function (c, b) { + switch (c) { + case '&': + return '&'; - return s; + case '"': + return '"'; + + case '\'': + return '''; // ' is not working in MSIE + + case '<': + return '<'; + + case '>': + return '>'; + } + + return c; + }) : s; }, extend : function(p, np) { @@ -2252,19 +2361,9 @@ TinyMCE_Engine.prototype = { tinyMCE.switchClass(e, tinyMCE.lastMenuBtnClass); tinyMCE.lastSelectedMenuBtn = null; } - }, - - explode : function(d, s) { - var ar = s.split(d), oar = new Array(), i; - - for (i = 0; i
  •  
  • <" + tag + ">"); - else - this.getDoc().execCommand(command, user_interface, value); - + this.getDoc().execCommand(command, user_interface, value); tinyMCE.triggerNodeChange(); break; case "Strikethrough": - if (tinyMCE.isSafari) - this.execCommand("mceInsertContent", false, "" + this.selection.getSelectedHTML() + ""); - else - this.getDoc().execCommand(command, user_interface, value); - + this.getDoc().execCommand(command, user_interface, value); tinyMCE.triggerNodeChange(); break; @@ -2691,7 +2860,7 @@ TinyMCE_Control.prototype = { if (tinyMCE.isGecko && new RegExp('<(div|blockquote|code|dt|dd|dl|samp)>', 'gi').test(value)) value = value.replace(/[^a-z]/gi, ''); - if (tinyMCE.isMSIE && new RegExp('blockquote|code|samp', 'gi').test(value)) { + if (tinyMCE.isIE && new RegExp('blockquote|code|samp', 'gi').test(value)) { var b = this.selection.getBookmark(); this.getDoc().execCommand("FormatBlock", false, '

    '); tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()), value); @@ -2708,7 +2877,7 @@ TinyMCE_Control.prototype = { if (!value) value = tinyMCE.getParentElement(this.getFocusElement()); - if (tinyMCE.isMSIE) { + if (tinyMCE.isIE) { value.outerHTML = value.innerHTML; } else { var rng = value.ownerDocument.createRange(); @@ -2759,7 +2928,7 @@ TinyMCE_Control.prototype = { var invalidParentsRe = tinyMCE.settings['merge_styles_invalid_parents'] != '' ? new RegExp(tinyMCE.settings['merge_styles_invalid_parents'], "gi") : null; // Whole element selected check - if (tinyMCE.isMSIE) { + if (tinyMCE.isIE) { // Control range if (rng.item) parentElm = rng.item(0); @@ -2953,10 +3122,20 @@ TinyMCE_Control.prototype = { return; case "forecolor": + value = value == null ? this.foreColor : value; + value = tinyMCE.trim(value); + value = value.charAt(0) != '#' ? (isNaN('0x' + value) ? value : '#' + value) : value; + + this.foreColor = value; this.getDoc().execCommand('forecolor', false, value); break; case "HiliteColor": + value = value == null ? this.backColor : value; + value = tinyMCE.trim(value); + value = value.charAt(0) != '#' ? (isNaN('0x' + value) ? value : '#' + value) : value; + this.backColor = value; + if (tinyMCE.isGecko) { this._setUseCSS(true); this.getDoc().execCommand('hilitecolor', false, value); @@ -2994,9 +3173,14 @@ TinyMCE_Control.prototype = { // Call custom cleanup code value = tinyMCE.storeAwayURLs(value); value = tinyMCE._customCleanup(this, "insert_to_editor", value); - tinyMCE._setHTML(doc, value); - tinyMCE.setInnerHTML(doc.body, tinyMCE._cleanupHTML(this, doc, tinyMCE.settings, doc.body)); - tinyMCE.convertAllRelativeURLs(doc.body); + + if (this.getBody().nodeName == 'BODY') + tinyMCE._setHTML(doc, value); + else + this.getBody().innerHTML = value; + + tinyMCE.setInnerHTML(this.getBody(), tinyMCE._cleanupHTML(this, doc, this.settings, this.getBody(), false, false, false, true)); + tinyMCE.convertAllRelativeURLs(this.getBody()); // Cleanup any mess left from storyAwayURLs tinyMCE._removeInternal(this.getBody()); @@ -3005,8 +3189,8 @@ TinyMCE_Control.prototype = { if (tinyMCE.getParam("convert_fonts_to_spans")) tinyMCE.convertSpansToFonts(doc); - tinyMCE.handleVisualAid(doc.body, true, this.visualAid, this); - tinyMCE._setEventsEnabled(doc.body, false); + tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this); + tinyMCE._setEventsEnabled(this.getBody(), false); return true; case "mceCleanup": @@ -3035,7 +3219,7 @@ TinyMCE_Control.prototype = { var selectedText = ""; - if (tinyMCE.isMSIE) { + if (tinyMCE.isIE) { var rng = doc.selection.createRange(); selectedText = rng.text; } else @@ -3074,8 +3258,8 @@ TinyMCE_Control.prototype = { this.execCommand('mceInsertContent', false, key); // Store away scroll pos - var scrollX = this.getDoc().body.scrollLeft + this.getDoc().documentElement.scrollLeft; - var scrollY = this.getDoc().body.scrollTop + this.getDoc().documentElement.scrollTop; + var scrollX = this.getBody().scrollLeft + this.getDoc().documentElement.scrollLeft; + var scrollY = this.getBody().scrollTop + this.getDoc().documentElement.scrollTop; // Find marker and replace with RAW HTML var html = this.getBody().innerHTML; @@ -3095,7 +3279,9 @@ TinyMCE_Control.prototype = { value = ''; var insertHTMLFailed = false; - this.getWin().focus(); + + // Removed since it produced problems in IE + // this.getWin().focus(); if (tinyMCE.isGecko || tinyMCE.isOpera) { try { @@ -3131,15 +3317,7 @@ TinyMCE_Control.prototype = { } } - // Ugly hack in Opera due to non working "inserthtml" - if (tinyMCE.isOpera && insertHTMLFailed) { - this.getDoc().execCommand("insertimage", false, tinyMCE.uniqueURL); - var ar = tinyMCE.getElementsByAttributeValue(this.getBody(), "img", "src", tinyMCE.uniqueURL); - ar[0].outerHTML = value; - return; - } - - if (!tinyMCE.isMSIE) { + if (!tinyMCE.isIE) { var isHTML = value.indexOf('<') != -1; var sel = this.getSel(); var rng = this.getRng(); @@ -3200,18 +3378,23 @@ TinyMCE_Control.prototype = { tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value); } else { - var rng = doc.selection.createRange(); + var rng = doc.selection.createRange(), tmpRng = null; var c = value.indexOf('"; } @@ -4451,7 +4767,7 @@ TinyMCE_Cleanup.prototype = { h += this.fillStr; // End element - if (va) + if (t != null && va) h += ''; return h; @@ -4488,8 +4804,12 @@ TinyMCE_Cleanup.prototype = { if (av.length != 0 && av == "{$uid}") av = "uid_" + (this.idCount++); - if (av.length != 0) - return " " + an + "=" + '"' + this.xmlEncode(av) + '"'; + if (av.length != 0) { + if (an.indexOf('on') != 0) + av = this.xmlEncode(av); + + return " " + an + "=" + '"' + av + '"'; + } return ""; }, @@ -4497,6 +4817,12 @@ TinyMCE_Cleanup.prototype = { formatHTML : function(h) { var s = this.settings, p = '', i = 0, li = 0, o = '', l; + // Replace BR in pre elements to \n + h = h.replace(/]*)>(.*?)<\/pre>/gi, function (a, b, c) { + c = c.replace(//gi, '\n'); + return '' + c + ''; + }); + h = h.replace(/\r/g, ''); // Windows sux, isn't carriage return a thing of the past :) h = '\n' + h; h = h.replace(new RegExp('\\n\\s+', 'gi'), '\n'); // Remove previous formatting @@ -4527,7 +4853,7 @@ TinyMCE_Cleanup.prototype = { }, xmlEncode : function(s) { - var i, l, e, o = '', c; + var cl = this; this._setupEntities(); // Will intialize lookup table @@ -4536,29 +4862,16 @@ TinyMCE_Cleanup.prototype = { return tinyMCE.xmlEncode(s); case "named": - for (i=0, l=s.length; i&"\']', 'g'), function (c, b) { + b = cl.entities[c.charCodeAt(0)]; - if (e && e != '') - o += '&' + e + ';'; - else - o += String.fromCharCode(c); - } - - return o; + return b ? '&' + b + ';' : c; + }); case "numeric": - for (i=0, l=s.length; i 127 || c == 60 || c == 62 || c == 38 || c == 39 || c == 34) - o += '&#' + c + ";"; - else - o += String.fromCharCode(c); - } - - return o; + return s.replace(new RegExp('[\u007F-\uFFFF<>&"\']', 'g'), function (c, b) { + return b ? '&#' + c.charCodeAt(0) + ';' : c; + }); } return s; @@ -4596,16 +4909,16 @@ TinyMCE_Cleanup.prototype = { if (n == "class" && !v) v = e.className; - if (this.isMSIE && n == "http-equiv") + if (this.isIE && n == "http-equiv") v = e.httpEquiv; - if (this.isMSIE && e.nodeName == "FORM" && n == "enctype" && v == "application/x-www-form-urlencoded") + if (this.isIE && e.nodeName == "FORM" && n == "enctype" && v == "application/x-www-form-urlencoded") v = ""; - if (this.isMSIE && e.nodeName == "INPUT" && n == "size" && v == "20") + if (this.isIE && e.nodeName == "INPUT" && n == "size" && v == "20") v = ""; - if (this.isMSIE && e.nodeName == "INPUT" && n == "maxlength" && v == "2147483647") + if (this.isIE && e.nodeName == "INPUT" && n == "maxlength" && v == "2147483647") v = ""; if (n == "style" && !tinyMCE.isOpera) @@ -4679,6 +4992,7 @@ TinyMCE_Cleanup.prototype = { if (!this.rulesDone) { this.addRuleStr(s.valid_elements); this.addRuleStr(s.extended_valid_elements); + this.addChildRemoveRuleStr(s.valid_child_elements); this.rulesDone = true; } @@ -4690,7 +5004,7 @@ TinyMCE_Cleanup.prototype = { if (!this.settings.fix_content_duplication) return false; - if (tinyMCE.isMSIE && !tinyMCE.isOpera && n.nodeType == 1) { + if (tinyMCE.isRealIE && n.nodeType == 1) { // Mark elements if (n.mce_serialized == this.serializationId) return true; @@ -4708,10 +5022,44 @@ TinyMCE_Cleanup.prototype = { return false; } -}; + + }; /* file:jscripts/tiny_mce/classes/TinyMCE_DOMUtils.class.js */ +TinyMCE_Engine.prototype.createTagHTML = function(tn, a, h) { + var o = '', f = tinyMCE.xmlEncode; + + o = '<' + tn; + + if (a) { + for (n in a) { + if (typeof(a[n]) != 'function' && a[n] != null) + o += ' ' + f(n) + '="' + f('' + a[n]) + '"'; + } + } + + o += !h ? ' />' : '>' + h + ''; + + return o; +}; + +TinyMCE_Engine.prototype.createTag = function(d, tn, a, h) { + var o = d.createElement(tn); + + if (a) { + for (n in a) { + if (typeof(a[n]) != 'function' && a[n] != null) + tinyMCE.setAttrib(o, n, a[n]); + } + } + + if (h) + o.innerHTML = h; + + return o; +}; + TinyMCE_Engine.prototype.getElementByAttributeValue = function(n, e, a, v) { return (n = this.getElementsByAttributeValue(n, e, a, v)).length == 0 ? null : n[0]; }; @@ -4731,13 +5079,10 @@ TinyMCE_Engine.prototype.isBlockElement = function(n) { return n != null && n.nodeType == 1 && this.blockRegExp.test(n.nodeName); }; -TinyMCE_Engine.prototype.getParentBlockElement = function(n) { - while (n) { - if (this.isBlockElement(n)) - return n; - - n = n.parentNode; - } +TinyMCE_Engine.prototype.getParentBlockElement = function(n, r) { + return this.getParentNode(n, function(n) { + return tinyMCE.isBlockElement(n); + }, r); return null; }; @@ -4752,7 +5097,16 @@ TinyMCE_Engine.prototype.insertAfter = function(n, r){ TinyMCE_Engine.prototype.setInnerHTML = function(e, h) { var i, nl, n; - if (tinyMCE.isMSIE && !tinyMCE.isOpera) { + // Convert all strong/em to b/i in Gecko + if (tinyMCE.isGecko) { + h = h.replace(//gi, ''); + h = h.replace(/<\/em>/gi, ''); + } + + if (tinyMCE.isRealIE) { // Since MSIE handles invalid HTML better that valid XHTML we // need to make some things invalid.


    gets converted to
    . h = h.replace(/\s\/>/g, '>'); @@ -4782,23 +5136,28 @@ TinyMCE_Engine.prototype.setInnerHTML = function(e, h) { }; TinyMCE_Engine.prototype.getOuterHTML = function(e) { - if (tinyMCE.isMSIE) + if (tinyMCE.isIE) return e.outerHTML; var d = e.ownerDocument.createElement("body"); - d.appendChild(e); + d.appendChild(e.cloneNode(true)); return d.innerHTML; }; -TinyMCE_Engine.prototype.setOuterHTML = function(e, h) { - if (tinyMCE.isMSIE) { - e.outerHTML = h; - return; - } +TinyMCE_Engine.prototype.setOuterHTML = function(e, h, d) { + var d = typeof(d) == "undefined" ? e.ownerDocument : d, i, nl, t; - var d = e.ownerDocument.createElement("body"); - d.innerHTML = h; - e.parentNode.replaceChild(d.firstChild, e); + if (tinyMCE.isIE && e.nodeType == 1) + e.outerHTML = h; + else { + t = d.createElement("body"); + t.innerHTML = h; + + for (i=0, nl=t.childNodes; i bookmark.index) { try { @@ -5787,11 +6228,20 @@ TinyMCE_Selection.prototype = { } } } else { - rng = inst.getSel().createRange(); - rng.moveToElementText(inst.getBody()); - rng.collapse(true); - rng.moveStart('character', bookmark.start); - rng.moveEnd('character', bookmark.length); + // Try/catch needed since this operation breaks when TinyMCE is placed in hidden divs/tabs + try { + // Incorrect bookmark + if (bookmark.start < 0) + return true; + + rng = inst.getSel().createRange(); + rng.moveToElementText(inst.getBody()); + rng.collapse(true); + rng.moveStart('character', bookmark.start); + rng.moveEnd('character', bookmark.length); + } catch (ex) { + return true; + } } rng.select(); @@ -5800,30 +6250,37 @@ TinyMCE_Selection.prototype = { return true; } - if (tinyMCE.isGecko && bookmark.rng) { - sel.removeAllRanges(); - sel.addRange(bookmark.rng); - win.scrollTo(bookmark.scrollX, bookmark.scrollY); - return true; - } - - if (tinyMCE.isGecko) { - // try { - rng = doc.createRange(); - - nl = doc.getElementsByTagName(bookmark.startTag); - if (nl.length > bookmark.start) - rng.setStart(nl[bookmark.start].childNodes[bookmark.startIndex], bookmark.startOffset); - - nl = doc.getElementsByTagName(bookmark.endTag); - if (nl.length > bookmark.end) - rng.setEnd(nl[bookmark.end].childNodes[bookmark.endIndex], bookmark.endOffset); - + if (tinyMCE.isGecko || tinyMCE.isOpera) { + if (bookmark.rng) { sel.removeAllRanges(); - sel.addRange(rng); - /* } catch { - // Ignore - }*/ + sel.addRange(bookmark.rng); + } + + if (bookmark.start != -1 && bookmark.end != -1) { + try { + sd = this._getTextPos(b, bookmark.start, bookmark.end); + rng = doc.createRange(); + rng.setStart(sd.startNode, sd.startOffset); + rng.setEnd(sd.endNode, sd.endOffset); + sel.removeAllRanges(); + sel.addRange(rng); + win.focus(); + } catch (ex) { + // Ignore + } + } + + /* + if (typeof(bookmark.index) != 'undefined') { + tinyMCE.selectElements(b, 'IMG', function (n) { + if (bookmark.index-- == 0) { + // Select image in Gecko here + } + + return false; + }); + } + */ win.scrollTo(bookmark.scrollX, bookmark.scrollY); return true; @@ -5832,6 +6289,46 @@ TinyMCE_Selection.prototype = { return false; }, + _getPosText : function(r, sn, en) { + var w = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}; + + while ((n = w.nextNode()) != null) { + if (n == sn) + d.start = p; + + if (n == en) { + d.end = p; + return d; + } + + p += n.nodeValue ? n.nodeValue.length : 0; + } + + return null; + }, + + _getTextPos : function(r, sp, ep) { + var w = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}; + + while ((n = w.nextNode()) != null) { + p += n.nodeValue ? n.nodeValue.length : 0; + + if (p >= sp && !d.startNode) { + d.startNode = n; + d.startOffset = sp - (p - n.nodeValue.length); + } + + if (p >= ep) { + d.endNode = n; + d.endOffset = ep - (p - n.nodeValue.length); + + return d; + } + } + + return null; + }, + selectNode : function(node, collapse, select_text_node, to_start) { var inst = this.instance, sel, rng, nodes; @@ -5847,8 +6344,11 @@ TinyMCE_Selection.prototype = { if (typeof(to_start) == "undefined") to_start = true; - if (tinyMCE.isMSIE) { - rng = inst.getBody().createTextRange(); + if (inst.settings.auto_resize) + inst.resizeToContent(); + + if (tinyMCE.isRealIE) { + rng = inst.getDoc().body.createTextRange(); try { rng.moveToElementText(node); @@ -5915,69 +6415,79 @@ TinyMCE_Selection.prototype = { }, scrollToNode : function(node) { - var inst = this.instance; - var pos, doc, scrollX, scrollY, height; - - // Scroll to node position - pos = tinyMCE.getAbsPosition(node); - doc = inst.getDoc(); - scrollX = doc.body.scrollLeft + doc.documentElement.scrollLeft; - scrollY = doc.body.scrollTop + doc.documentElement.scrollTop; - height = tinyMCE.isMSIE ? document.getElementById(inst.editorId).style.pixelHeight : inst.targetElement.clientHeight; + var inst = this.instance, w = inst.getWin(), vp = inst.getViewPort(), pos = tinyMCE.getAbsPosition(node), cvp, p, cwin; // Only scroll if out of visible area - if (!tinyMCE.settings['auto_resize'] && !(pos.absTop > scrollY && pos.absTop < (scrollY - 25 + height))) - inst.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25); + if (pos.absLeft < vp.left || pos.absLeft > vp.left + vp.width || pos.absTop < vp.top || pos.absTop > vp.top + (vp.height-25)) + w.scrollTo(pos.absLeft, pos.absTop - vp.height + 25); + + // Scroll container window + if (inst.settings.auto_resize) { + cwin = inst.getContainerWin(); + cvp = tinyMCE.getViewPort(cwin); + p = this.getAbsPosition(node); + + if (p.absLeft < cvp.left || p.absLeft > cvp.left + cvp.width || p.absTop < cvp.top || p.absTop > cvp.top + cvp.height) + cwin.scrollTo(p.absLeft, p.absTop - cvp.height + 25); + } + }, + + getAbsPosition : function(n) { + var pos = tinyMCE.getAbsPosition(n), ipos = tinyMCE.getAbsPosition(this.instance.iframeElement); + + return { + absLeft : ipos.absLeft + pos.absLeft, + absTop : ipos.absTop + pos.absTop + }; }, getSel : function() { var inst = this.instance; - if (tinyMCE.isMSIE && !tinyMCE.isOpera) + if (tinyMCE.isRealIE) return inst.getDoc().selection; return inst.contentWindow.getSelection(); }, getRng : function() { - var inst = this.instance; - var sel = this.getSel(); + var s = this.getSel(); - if (sel == null) + if (s == null) return null; - if (tinyMCE.isMSIE && !tinyMCE.isOpera) - return sel.createRange(); + if (tinyMCE.isRealIE) + return s.createRange(); - if (tinyMCE.isSafari && !sel.getRangeAt) + if (tinyMCE.isSafari && !s.getRangeAt) return '' + window.getSelection(); - return sel.getRangeAt(0); + return s.getRangeAt(0); }, getFocusElement : function() { - var inst = this.instance; + var inst = this.instance, doc, rng, sel, elm; - if (tinyMCE.isMSIE && !tinyMCE.isOpera) { - var doc = inst.getDoc(); - var rng = doc.selection.createRange(); + if (tinyMCE.isRealIE) { + doc = inst.getDoc(); + rng = doc.selection.createRange(); // if (rng.collapse) // rng.collapse(true); - var elm = rng.item ? rng.item(0) : rng.parentElement(); + elm = rng.item ? rng.item(0) : rng.parentElement(); } else { - if (inst.isHidden()) + if (!tinyMCE.isSafari && inst.isHidden()) return inst.getBody(); - var sel = this.getSel(); - var rng = this.getRng(); + sel = this.getSel(); + rng = this.getRng(); if (!sel || !rng) return null; - var elm = rng.commonAncestorContainer; - //var elm = (sel && sel.anchorNode) ? sel.anchorNode : null; + elm = rng.commonAncestorContainer; + //elm = (sel && sel.anchorNode) ? sel.anchorNode : null; // Handle selection a image or other control like element such as anchors if (!rng.collapsed) { @@ -5999,7 +6509,8 @@ TinyMCE_Selection.prototype = { return elm; } -}; + + }; /* file:jscripts/tiny_mce/classes/TinyMCE_UndoRedo.class.js */ @@ -6013,39 +6524,40 @@ function TinyMCE_UndoRedo(inst) { TinyMCE_UndoRedo.prototype = { add : function(l) { - var b; + var b, customUndoLevels, newHTML, inst = this.instance, i, ul, ur; if (l) { this.undoLevels[this.undoLevels.length] = l; return true; } - var inst = this.instance; - if (this.typingUndoIndex != -1) { this.undoIndex = this.typingUndoIndex; - // tinyMCE.debug("Override: " + this.undoIndex); + + if (tinyMCE.typingUndoIndex != -1) + tinyMCE.undoIndex = tinyMCE.typingUndoIndex; } - var newHTML = tinyMCE.trim(inst.getBody().innerHTML); + newHTML = tinyMCE.trim(inst.getBody().innerHTML); if (this.undoLevels[this.undoIndex] && newHTML != this.undoLevels[this.undoIndex].content) { - //tinyMCE.debug(newHTML, this.undoLevels[this.undoIndex]); + //tinyMCE.debug(newHTML, this.undoLevels[this.undoIndex].content); tinyMCE.dispatchCallback(inst, 'onchange_callback', 'onChange', inst); // Time to compress - var customUndoLevels = tinyMCE.settings['custom_undo_redo_levels']; + customUndoLevels = tinyMCE.settings['custom_undo_redo_levels']; if (customUndoLevels != -1 && this.undoLevels.length > customUndoLevels) { - for (var i=0; i 0) { this.undoIndex--; + tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content); inst.repaint(); + if (inst.settings.custom_undo_redo_restore_selection) inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark); } - - // tinyMCE.debug("Undo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex); }, redo : function() { @@ -6088,23 +6612,28 @@ TinyMCE_UndoRedo.prototype = { if (this.undoIndex < (this.undoLevels.length-1)) { this.undoIndex++; + tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content); inst.repaint(); -// if (this.undoIndex > 0) -// inst.selection.moveToBookmark(this.undoLevels[this.undoIndex-1].bookmark); + if (inst.settings.custom_undo_redo_restore_selection) inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark); - // tinyMCE.debug("Redo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex); } tinyMCE.triggerNodeChange(); } -}; + + }; /* file:jscripts/tiny_mce/classes/TinyMCE_ForceParagraphs.class.js */ var TinyMCE_ForceParagraphs = { _insertPara : function(inst, e) { + var doc = inst.getDoc(), sel = inst.getSel(), body = inst.getBody(), win = inst.contentWindow, rng = sel.getRangeAt(0); + var rootElm = doc.documentElement, blockName = "P", startNode, endNode, startBlock, endBlock; + var rngBefore, rngAfter, direct, startNode, startOffset, endNode, endOffset, b = tinyMCE.isOpera ? inst.selection.getBookmark() : null; + var paraBefore, paraAfter, startChop, endChop, contents; + function isEmpty(para) { function isEmptyHTML(html) { return html.replace(new RegExp('[ \t\r\n]+', 'g'), '').toLowerCase() == ""; @@ -6133,43 +6662,33 @@ var TinyMCE_ForceParagraphs = { return true; } - var doc = inst.getDoc(); - var sel = inst.getSel(); - var win = inst.contentWindow; - var rng = sel.getRangeAt(0); - var body = doc.body; - var rootElm = doc.documentElement; - var blockName = "P"; - // tinyMCE.debug(body.innerHTML); // debug(e.target, sel.anchorNode.nodeName, sel.focusNode.nodeName, rng.startContainer, rng.endContainer, rng.commonAncestorContainer, sel.anchorOffset, sel.focusOffset, rng.toString()); // Setup before range - var rngBefore = doc.createRange(); + rngBefore = doc.createRange(); rngBefore.setStart(sel.anchorNode, sel.anchorOffset); rngBefore.collapse(true); // Setup after range - var rngAfter = doc.createRange(); + rngAfter = doc.createRange(); rngAfter.setStart(sel.focusNode, sel.focusOffset); rngAfter.collapse(true); // Setup start/end points - var direct = rngBefore.compareBoundaryPoints(rngBefore.START_TO_END, rngAfter) < 0; - var startNode = direct ? sel.anchorNode : sel.focusNode; - var startOffset = direct ? sel.anchorOffset : sel.focusOffset; - var endNode = direct ? sel.focusNode : sel.anchorNode; - var endOffset = direct ? sel.focusOffset : sel.anchorOffset; + direct = rngBefore.compareBoundaryPoints(rngBefore.START_TO_END, rngAfter) < 0; + startNode = direct ? sel.anchorNode : sel.focusNode; + startOffset = direct ? sel.anchorOffset : sel.focusOffset; + endNode = direct ? sel.focusNode : sel.anchorNode; + endOffset = direct ? sel.focusOffset : sel.anchorOffset; startNode = startNode.nodeName == "BODY" ? startNode.firstChild : startNode; endNode = endNode.nodeName == "BODY" ? endNode.firstChild : endNode; - // tinyMCE.debug(startNode, endNode); - // Get block elements - var startBlock = tinyMCE.getParentBlockElement(startNode); - var endBlock = tinyMCE.getParentBlockElement(endNode); + startBlock = inst.getParentBlockElement(startNode); + endBlock = inst.getParentBlockElement(endNode); // If absolute force paragraph generation within if (startBlock && new RegExp('absolute|relative|static', 'gi').test(startBlock.style.position)) @@ -6188,7 +6707,7 @@ var TinyMCE_ForceParagraphs = { } // Within a list use normal behaviour - if (tinyMCE.getParentElement(startBlock, "OL,UL") != null) + if (tinyMCE.getParentElement(startBlock, "OL,UL", null, body) != null) return false; // Within a table create new paragraphs @@ -6196,16 +6715,16 @@ var TinyMCE_ForceParagraphs = { startBlock = endBlock = null; // Setup new paragraphs - var paraBefore = (startBlock != null && startBlock.nodeName == blockName) ? startBlock.cloneNode(false) : doc.createElement(blockName); - var paraAfter = (endBlock != null && endBlock.nodeName == blockName) ? endBlock.cloneNode(false) : doc.createElement(blockName); + paraBefore = (startBlock != null && startBlock.nodeName == blockName) ? startBlock.cloneNode(false) : doc.createElement(blockName); + paraAfter = (endBlock != null && endBlock.nodeName == blockName) ? endBlock.cloneNode(false) : doc.createElement(blockName); // Is header, then force paragraph under if (/^(H[1-6])$/.test(blockName)) paraAfter = doc.createElement("p"); // Setup chop nodes - var startChop = startNode; - var endChop = endNode; + startChop = startNode; + endChop = endNode; // Get startChop node node = startChop; @@ -6236,7 +6755,9 @@ var TinyMCE_ForceParagraphs = { if (startBlock == null) { // Delete selection rng.deleteContents(); - sel.removeAllRanges(); + + if (!tinyMCE.isSafari) + sel.removeAllRanges(); if (startChop != rootElm && endChop != rootElm) { // Insert paragraph before @@ -6260,7 +6781,7 @@ var TinyMCE_ForceParagraphs = { if (endChop.nodeName != "#text" && endChop.nodeName != "BODY") rngBefore.setEndAfter(endChop); - var contents = rng.cloneContents(); + contents = rng.cloneContents(); if (contents.firstChild && (contents.firstChild.nodeName == blockName || contents.firstChild.nodeName == "BODY")) paraAfter.innerHTML = contents.firstChild.innerHTML; else @@ -6280,17 +6801,25 @@ var TinyMCE_ForceParagraphs = { rngBefore.deleteContents(); // Insert new paragraphs - paraAfter.normalize(); - rngBefore.insertNode(paraAfter); - paraBefore.normalize(); - rngBefore.insertNode(paraBefore); + if (tinyMCE.isOpera) { + paraBefore.normalize(); + rngBefore.insertNode(paraBefore); + paraAfter.normalize(); + rngBefore.insertNode(paraAfter); + } else { + paraAfter.normalize(); + rngBefore.insertNode(paraAfter); + paraBefore.normalize(); + rngBefore.insertNode(paraBefore); + } - // tinyMCE.debug("1: ", paraBefore.innerHTML, paraAfter.innerHTML); + //tinyMCE.debug("1: ", paraBefore.innerHTML, paraAfter.innerHTML); } else { body.innerHTML = "<" + blockName + "> <" + blockName + "> "; paraAfter = body.childNodes[1]; } + inst.selection.moveToBookmark(b); inst.selection.selectNode(paraAfter, true, true); return true; @@ -6308,7 +6837,7 @@ var TinyMCE_ForceParagraphs = { // Place secound part within new paragraph rngAfter.setEndAfter(endChop); rngAfter.setStart(endNode, endOffset); - var contents = rngAfter.cloneContents(); + contents = rngAfter.cloneContents(); if (contents.firstChild && contents.firstChild.nodeName == blockName) { /* var nodes = contents.firstChild.childNodes; @@ -6331,7 +6860,7 @@ var TinyMCE_ForceParagraphs = { paraAfter.innerHTML = " "; // Create a range around everything - var rng = doc.createRange(); + rng = doc.createRange(); if (!startChop.previousSibling && startChop.parentNode.nodeName.toUpperCase() == blockName) { rng.setStartBefore(startChop.parentNode); @@ -6349,14 +6878,22 @@ var TinyMCE_ForceParagraphs = { // Delete all contents and insert new paragraphs rng.deleteContents(); - rng.insertNode(paraAfter); - rng.insertNode(paraBefore); + + if (tinyMCE.isOpera) { + rng.insertNode(paraBefore); + rng.insertNode(paraAfter); + } else { + rng.insertNode(paraAfter); + rng.insertNode(paraBefore); + } + //tinyMCE.debug("2", paraBefore.innerHTML, paraAfter.innerHTML); // Normalize paraAfter.normalize(); paraBefore.normalize(); + inst.selection.moveToBookmark(b); inst.selection.selectNode(paraAfter, true, true); return true; @@ -6365,21 +6902,26 @@ var TinyMCE_ForceParagraphs = { _handleBackSpace : function(inst) { var r = inst.getRng(), sn = r.startContainer, nv, s = false; - if (sn && sn.nextSibling && sn.nextSibling.nodeName == "BR") { + // Added body check for bug #1527787 + if (sn && sn.nextSibling && sn.nextSibling.nodeName == "BR" && sn.parentNode.nodeName != "BODY") { nv = sn.nodeValue; - // Handle if a backspace is pressed after a space character #bug 1466054 - if (nv != null && nv.length >= r.startOffset && nv.charAt(r.startOffset - 1) == ' ') - s = true; + // Handle if a backspace is pressed after a space character #bug 1466054 removed since fix for #1527787 + /*if (nv != null && nv.length >= r.startOffset && nv.charAt(r.startOffset - 1) == ' ') + s = true;*/ // Only remove BRs if we are at the end of line #bug 1464152 if (nv != null && r.startOffset == nv.length) sn.nextSibling.parentNode.removeChild(sn.nextSibling); } + if (inst.settings.auto_resize) + inst.resizeToContent(); + return s; } -}; + + }; /* file:jscripts/tiny_mce/classes/TinyMCE_Layer.class.js */ @@ -6515,14 +7057,20 @@ TinyMCE_Layer.prototype = { if (!this.blockerElement && this.blockMode) { d = this.doc; - b = d.createElement("iframe"); + b = d.getElementById(this.id + "_blocker"); - b.style.cssText = 'display: none; position: absolute; left: 0; top: 0'; - b.src = 'javascript:false;'; - b.frameBorder = '0'; - b.scrolling = 'no'; + if (!b) { + b = d.createElement("iframe"); + + b.setAttribute('id', this.id + "_blocker"); + b.style.cssText = 'display: none; position: absolute; left: 0; top: 0'; + b.src = 'javascript:false;'; + b.frameBorder = '0'; + b.scrolling = 'no'; + + d.body.appendChild(b); + } - d.body.appendChild(b); this.blockerElement = b; } @@ -6541,7 +7089,7 @@ TinyMCE_Layer.prototype = { return p; }, - create : function(n, c, p) { + create : function(n, c, p, h) { var d = this.doc, e = d.createElement(n); e.setAttribute('id', this.id); @@ -6552,18 +7100,26 @@ TinyMCE_Layer.prototype = { if (!p) p = d.body; + if (h) + e.innerHTML = h; + p.appendChild(e); return this.element = e; }, + exists : function() { + return this.doc.getElementById(this.id) != null; + }, + parseInt : function(s) { if (s == null || s == '') return 0; return parseInt(s); } -}; + + }; /* file:jscripts/tiny_mce/classes/TinyMCE_Menu.class.js */ @@ -6582,7 +7138,6 @@ function TinyMCE_Menu() { this.needsUpdate = true; }; -// Extends the TinyMCE_Layer class TinyMCE_Menu.prototype = tinyMCE.extend(TinyMCE_Layer.prototype, { init : function(s) { var n; @@ -6653,7 +7208,7 @@ TinyMCE_Menu.prototype = tinyMCE.extend(TinyMCE_Layer.prototype, { break; default: - h += '' + t + ''; + h += '' + t + ''; } h += ''; @@ -6690,30 +7245,40 @@ TinyMCE_Menu.prototype = tinyMCE.extend(TinyMCE_Layer.prototype, { tinyMCE.lastMenu = this; } -}); + + }); + +/* file:jscripts/tiny_mce/classes/TinyMCE_Compatibility.class.js */ + +if (!Function.prototype.call) { + Function.prototype.call = function() { + var a = arguments, s = a[0], i, as = '', r, o; + + for (i=1; i 1 ? ',' : '') + 'a[' + i + ']'; + + o = s._fu; + s._fu = this; + r = eval('s._fu(' + as + ')'); + s._fu = o; + + return r; + }; +}; /* file:jscripts/tiny_mce/classes/TinyMCE_Debug.class.js */ TinyMCE_Engine.prototype.debug = function() { - var m = "", e, a, i; + var m = "", a, i, l = tinyMCE.log.length; - e = document.getElementById("tinymce_debug"); - if (!e) { - var d = document.createElement("div"); - d.setAttribute("className", "debugger"); - d.className = "debugger"; - d.innerHTML = 'Debug output:'; - - document.body.appendChild(d); - e = document.getElementById("tinymce_debug"); - } - - a = this.debug.arguments; - for (i=0; i'); - - 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'); - // 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(''); + } + 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=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(); diff --git a/wp-includes/js/tinymce/utils/form_utils.js b/wp-includes/js/tinymce/utils/form_utils.js index 0481815a8..c502943d2 100644 --- a/wp-includes/js/tinymce/utils/form_utils.js +++ b/wp-includes/js/tinymce/utils/form_utils.js @@ -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 += ''; - html += ''; + h += ''; + h += ''; - 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 += ''; - html += ' 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 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; iadd( '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');