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 += "
"; @@ -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. + +","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";content=before+content.substring(pos+7)+after;}}if(tinyMCE.getParam("paste_create_linebreaks",true)){content=tinyMCE.regexpReplace(content,"\r\n"," $1 "+middot+"$1 <\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!tinyMCE.settings['force_p_newlines']){content=content.replace('','','gi');content=content.replace(' ');content=content.replace(/<\/h[1-6]>/gi,' ", "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 = " ";
+ content = before + content.substring(pos+7) + after;
+ }
+ }
+
+ if (tinyMCE.getParam("paste_create_linebreaks", true)) {
+ content = tinyMCE.regexpReplace(content, "\r\n", " $1 " + middot + "$1 <\/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(' ');
+ content = content.replace(/<\/h[1-6]>/gi, ' ');
+ inst.addShortcut('ctrl', '8', '', '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 += '' + en + '>';
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(/
","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
","gi"),"
]*>/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*
','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(/
", "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
", "gi"), "
]*>/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*
' ,'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(/
{$lang_theme_charmap_title}
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 @@
';
+ template['html'] = '
';
if (toolbarLocation == "top") {
- template['html'] += '
';
+ template['html'] += '' + toolbarHTML + ' ';
}
if (statusbarLocation == "top") {
@@ -544,7 +611,7 @@ var TinyMCE_AdvancedTheme = {
template['html'] += ' ';
if (toolbarLocation == "bottom") {
- template['html'] += ' ';
+ template['html'] += '' + toolbarHTML + ' ';
}
// 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
";
@@ -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 += '
';
+ /*
+ 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 8a532e5e6..d03e206a3 100644
Binary files a/wp-includes/js/tinymce/themes/advanced/images/backcolor.gif and b/wp-includes/js/tinymce/themes/advanced/images/backcolor.gif differ
diff --git a/wp-includes/js/tinymce/themes/advanced/images/buttons.gif b/wp-includes/js/tinymce/themes/advanced/images/buttons.gif
index 6196350de..5ad99a7c4 100644
Binary files a/wp-includes/js/tinymce/themes/advanced/images/buttons.gif and b/wp-includes/js/tinymce/themes/advanced/images/buttons.gif differ
diff --git a/wp-includes/js/tinymce/themes/advanced/images/forecolor.gif b/wp-includes/js/tinymce/themes/advanced/images/forecolor.gif
index d5e381425..8b7036160 100644
Binary files a/wp-includes/js/tinymce/themes/advanced/images/forecolor.gif and b/wp-includes/js/tinymce/themes/advanced/images/forecolor.gif differ
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'),'$1>\n');
- html = tinyMCE.regexpReplace(html, '';
+ for (i=0; i ';
+ }
+
+ h += '
','
\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" + 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, ']*)>(.*?)<\/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
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' + 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' + t + '';
}
h += '