whoami7 - Manager
:
/
home
/
topsuzmw
/
public_html
/
wp-includes
/
private
/
Upload File:
files >> //home/topsuzmw/public_html/wp-includes/private/tinymce.zip
PK D$�Zk��Ig Ig license.txtnu �[��� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 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 Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your 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 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 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 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 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. 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. 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. 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. 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. 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. 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, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 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 (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the 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 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, 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. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may 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 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 modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) 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. 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. 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 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. It may happen that this requirement contradicts the license 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 library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the 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 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 otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus 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 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. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and 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 copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! PK D$�Zl�s wp-tinymce.phpnu �[��� <?php /** * Not used in core since 5.1. * This is a back-compat for plugins that may be using this method of loading directly. */ /** * Disable error reporting * * Set this to error_reporting( -1 ) for debugging. */ error_reporting( 0 ); $basepath = __DIR__; function get_file( $path ) { if ( function_exists( 'realpath' ) ) { $path = realpath( $path ); } if ( ! $path || ! @is_file( $path ) ) { return false; } return @file_get_contents( $path ); } $expires_offset = 31536000; // 1 year. header( 'Content-Type: application/javascript; charset=UTF-8' ); header( 'Vary: Accept-Encoding' ); // Handle proxies. header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); header( "Cache-Control: public, max-age=$expires_offset" ); $file = get_file( $basepath . '/wp-tinymce.js' ); if ( isset( $_GET['c'] ) && $file ) { echo $file; } else { // Even further back compat. echo get_file( $basepath . '/tinymce.min.js' ); echo get_file( $basepath . '/plugins/compat3x/plugin.min.js' ); } exit; PK D$�Zr�f* * plugins/wpdialogs/plugin.min.jsnu �[��� tinymce.WPWindowManager=tinymce.InlineWindowManager=function(a){if(this.wp)return this;this.wp={},this.parent=a.windowManager,this.editor=a,tinymce.extend(this,this.parent),this.open=function(e,i){var n,o=this,t=this.wp;if(!e.wpDialog)return this.parent.open.apply(this,arguments);e.id&&("undefined"!=typeof jQuery&&jQuery.wp&&jQuery.wp.wpdialog?(t.$element=n=jQuery("#"+e.id),n.length&&(window.console&&window.console.log&&window.console.log("tinymce.WPWindowManager is deprecated. Use the default editor.windowManager to open dialogs with inline HTML."),t.features=e,t.params=i,a.nodeChanged(),n.data("wpdialog")||n.wpdialog({title:e.title,width:e.width,height:e.height,modal:!0,dialogClass:"wp-dialog",zIndex:3e5}),n.wpdialog("open"),n.on("wpdialogclose",function(){o.wp.$element&&(o.wp={})}))):window.console&&window.console.error&&window.console.error('wpdialog.js is not loaded. Please set "wpdialogs" as dependency for your script when calling wp_enqueue_script(). You may also want to enqueue the "wp-jquery-ui-dialog" stylesheet.'))},this.close=function(){if(!this.wp.features||!this.wp.features.wpDialog)return this.parent.close.apply(this,arguments);this.wp.$element.wpdialog("close")}},tinymce.PluginManager.add("wpdialogs",function(e){e.on("init",function(){e.windowManager=new tinymce.WPWindowManager(e)})});PK D$�Z�Ќy� � plugins/wpdialogs/plugin.jsnu �[��� /* global tinymce */ /** * Included for back-compat. * The default WindowManager in TinyMCE 4.0 supports three types of dialogs: * - With HTML created from JS. * - With inline HTML (like WPWindowManager). * - Old type iframe based dialogs. * For examples see the default plugins: https://github.com/tinymce/tinymce/tree/master/js/tinymce/plugins */ tinymce.WPWindowManager = tinymce.InlineWindowManager = function( editor ) { if ( this.wp ) { return this; } this.wp = {}; this.parent = editor.windowManager; this.editor = editor; tinymce.extend( this, this.parent ); this.open = function( args, params ) { var $element, self = this, wp = this.wp; if ( ! args.wpDialog ) { return this.parent.open.apply( this, arguments ); } else if ( ! args.id ) { return; } if ( typeof jQuery === 'undefined' || ! jQuery.wp || ! jQuery.wp.wpdialog ) { // wpdialog.js is not loaded. if ( window.console && window.console.error ) { window.console.error('wpdialog.js is not loaded. Please set "wpdialogs" as dependency for your script when calling wp_enqueue_script(). You may also want to enqueue the "wp-jquery-ui-dialog" stylesheet.'); } return; } wp.$element = $element = jQuery( '#' + args.id ); if ( ! $element.length ) { return; } if ( window.console && window.console.log ) { window.console.log('tinymce.WPWindowManager is deprecated. Use the default editor.windowManager to open dialogs with inline HTML.'); } wp.features = args; wp.params = params; // Store selection. Takes a snapshot in the FocusManager of the selection before focus is moved to the dialog. editor.nodeChanged(); // Create the dialog if necessary. if ( ! $element.data('wpdialog') ) { $element.wpdialog({ title: args.title, width: args.width, height: args.height, modal: true, dialogClass: 'wp-dialog', zIndex: 300000 }); } $element.wpdialog('open'); $element.on( 'wpdialogclose', function() { if ( self.wp.$element ) { self.wp = {}; } }); }; this.close = function() { if ( ! this.wp.features || ! this.wp.features.wpDialog ) { return this.parent.close.apply( this, arguments ); } this.wp.$element.wpdialog('close'); }; }; tinymce.PluginManager.add( 'wpdialogs', function( editor ) { // Replace window manager. editor.on( 'init', function() { editor.windowManager = new tinymce.WPWindowManager( editor ); }); }); PK D$�Z���E E ! plugins/colorpicker/plugin.min.jsnu �[��� !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Color"),a=function(e,n){e.find("#preview")[0].getEl().style.background=n},o=function(e,n){var i=l(n),t=i.toRgb();e.fromJSON({r:t.r,g:t.g,b:t.b,hex:i.toHex().substr(1)}),a(e,i.toHex())},t=function(e,n,i){var t=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:i,onchange:function(){var e=this.rgb();t&&(t.find("#r").value(e.r),t.find("#g").value(e.g),t.find("#b").value(e.b),t.find("#hex").value(this.value().substr(1)),a(t,this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,n,i=t.find("colorpicker")[0];if(e=this.name(),n=this.value(),"hex"===e)return o(t,n="#"+n),void i.value(n);n={r:t.find("#r").value(),g:t.find("#g").value(),b:t.find("#b").value()},i.value(n),o(t,n)}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){n("#"+t.toJSON().hex)}});o(t,i)};e.add("colorpicker",function(i){i.settings.color_picker_callback||(i.settings.color_picker_callback=function(e,n){t(i,e,n)})})}();PK D$�Z��a�� � plugins/colorpicker/plugin.jsnu �[��� (function () { var colorpicker = (function () { 'use strict'; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var global$1 = tinymce.util.Tools.resolve('tinymce.util.Color'); var showPreview = function (win, hexColor) { win.find('#preview')[0].getEl().style.background = hexColor; }; var setColor = function (win, value) { var color = global$1(value), rgb = color.toRgb(); win.fromJSON({ r: rgb.r, g: rgb.g, b: rgb.b, hex: color.toHex().substr(1) }); showPreview(win, color.toHex()); }; var open = function (editor, callback, value) { var win = editor.windowManager.open({ title: 'Color', items: { type: 'container', layout: 'flex', direction: 'row', align: 'stretch', padding: 5, spacing: 10, items: [ { type: 'colorpicker', value: value, onchange: function () { var rgb = this.rgb(); if (win) { win.find('#r').value(rgb.r); win.find('#g').value(rgb.g); win.find('#b').value(rgb.b); win.find('#hex').value(this.value().substr(1)); showPreview(win, this.value()); } } }, { type: 'form', padding: 0, labelGap: 5, defaults: { type: 'textbox', size: 7, value: '0', flex: 1, spellcheck: false, onchange: function () { var colorPickerCtrl = win.find('colorpicker')[0]; var name, value; name = this.name(); value = this.value(); if (name === 'hex') { value = '#' + value; setColor(win, value); colorPickerCtrl.value(value); return; } value = { r: win.find('#r').value(), g: win.find('#g').value(), b: win.find('#b').value() }; colorPickerCtrl.value(value); setColor(win, value); } }, items: [ { name: 'r', label: 'R', autofocus: 1 }, { name: 'g', label: 'G' }, { name: 'b', label: 'B' }, { name: 'hex', label: '#', value: '000000' }, { name: 'preview', type: 'container', border: 1 } ] } ] }, onSubmit: function () { callback('#' + win.toJSON().hex); } }); setColor(win, value); }; var Dialog = { open: open }; global.add('colorpicker', function (editor) { if (!editor.settings.color_picker_callback) { editor.settings.color_picker_callback = function (callback, value) { Dialog.open(editor, callback, value); }; } }); function Plugin () { } return Plugin; }()); })(); PK D$�Z�@ @ plugins/wordpress/plugin.min.jsnu �[��� !function(k){(!k.ui.FloatPanel.zIndex||k.ui.FloatPanel.zIndex<100100)&&(k.ui.FloatPanel.zIndex=100100),k.PluginManager.add("wordpress",function(p){var a,t,E=k.DOM,m=k.each,u=p.editorManager.i18n.translate,i=window.jQuery,o=window.wp,r=o&&o.editor&&o.editor.autop&&p.getParam("wpautop",!0),s=!1;function e(n){var e,t,o=0,i=k.$(".block-library-classic__toolbar");"hide"===n?e=!0:i.length&&!i.hasClass("has-advanced-toolbar")&&(i.addClass("has-advanced-toolbar"),n="show"),(t=p.theme.panel?p.theme.panel.find(".toolbar:not(.menubar)"):t)&&1<t.length&&(!n&&t[1].visible()&&(n="hide"),m(t,function(e,t){0<t&&("hide"===n?(e.hide(),o+=34):(e.show(),o-=34))})),o&&!k.Env.iOS&&p.iframeElement&&p.iframeElement.clientHeight&&50<(i=p.iframeElement.clientHeight+o)&&E.setStyle(p.iframeElement,"height",i),e||("hide"===n?(setUserSetting("hidetb","0"),a&&a.active(!1)):(setUserSetting("hidetb","1"),a&&a.active(!0))),p.fire("wp-toolbar-toggle")}function d(e){var t,o,i,n=p.translate(e);return s||(o="Shift+Alt+",i="Ctrl+",s={},k.Env.mac&&(o="\u2303\u2325",i="\u2318"),p.settings.wp_shortcut_labels&&m(p.settings.wp_shortcut_labels,function(e,t){var n=p.translate(t);e=e.replace("access",o).replace("meta",i),s[t]=e,t!==n&&(s[n]=e)})),s.hasOwnProperty(n)?t=s[n]:s.hasOwnProperty(e)&&(t=s[e]),t?n+" ("+t+")":n}function n(){}return i&&i(document).triggerHandler("tinymce-editor-setup",[p]),p.addButton("wp_adv",{tooltip:"Toolbar Toggle",cmd:"WP_Adv",onPostRender:function(){(a=this).active("1"===getUserSetting("hidetb"))}}),p.on("PostRender",function(){p.getParam("wordpress_adv_hidden",!0)&&"0"===getUserSetting("hidetb","0")?e("hide"):k.$(".block-library-classic__toolbar").addClass("has-advanced-toolbar")}),p.addCommand("WP_Adv",function(){e()}),p.on("focus",function(){window.wpActiveEditor=p.id}),p.on("BeforeSetContent",function(e){var n;e.content&&(-1!==e.content.indexOf("\x3c!--more")&&(n=u("Read more..."),e.content=e.content.replace(/<!--more(.*?)-->/g,function(e,t){return'<img src="'+k.Env.transparentSrc+'" data-wp-more="more" data-wp-more-text="'+t+'" class="wp-more-tag mce-wp-more" alt="'+n+'" data-mce-resize="false" data-mce-placeholder="1" />'})),-1!==e.content.indexOf("\x3c!--nextpage--\x3e")&&(n=u("Page break"),e.content=e.content.replace(/<!--nextpage-->/g,'<img src="'+k.Env.transparentSrc+'" data-wp-more="nextpage" class="wp-more-tag mce-wp-nextpage" alt="'+n+'" data-mce-resize="false" data-mce-placeholder="1" />')),e.load&&"raw"!==e.format&&(e.content=r?o.editor.autop(e.content):e.content.replace(/-->\s+<!--/g,"--\x3e\x3c!--")),-1===e.content.indexOf("<script")&&-1===e.content.indexOf("<style")||(e.content=e.content.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(e,t){return'<img src="'+k.Env.transparentSrc+'" data-wp-preserve="'+encodeURIComponent(e)+'" data-mce-resize="false" data-mce-placeholder="1" class="mce-object mce-object-'+t+'" width="20" height="20" alt="<'+t+'>" />'})))}),p.on("setcontent",function(){p.$("p").each(function(e,t){var n;t.innerHTML&&t.innerHTML.length<10&&((n=k.trim(t.innerHTML))&&" "!==n||(t.innerHTML=k.Env.ie&&k.Env.ie<11?"":'<br data-mce-bogus="1">'))})}),p.on("PostProcess",function(e){e.get&&(e.content=e.content.replace(/<img[^>]+>/g,function(e){var t,n,o="";return-1!==e.indexOf('data-wp-more="more"')?n="\x3c!--more"+(o=(t=e.match(/data-wp-more-text="([^"]+)"/))?t[1]:o)+"--\x3e":-1!==e.indexOf('data-wp-more="nextpage"')?n="\x3c!--nextpage--\x3e":-1!==e.indexOf("data-wp-preserve")&&(t=e.match(/ data-wp-preserve="([^"]+)"/))&&(n=decodeURIComponent(t[1])),n||e}))}),p.on("ResolveName",function(e){var t;"IMG"===e.target.nodeName&&(t=p.dom.getAttrib(e.target,"data-wp-more"))&&(e.name=t)}),p.addCommand("WP_More",function(e){var t,n="wp-more-tag",o=p.dom,i=p.selection.getNode(),a=p.getBody();n+=" mce-wp-"+(e=e||"more"),t=u("more"===e?"Read more...":"Next page"),t='<img src="'+k.Env.transparentSrc+'" alt="'+t+'" class="'+n+'" data-wp-more="'+e+'" data-mce-resize="false" data-mce-placeholder="1" />',i===a||"P"===i.nodeName&&i.parentNode===a?p.insertContent(t):(n=o.getParent(i,function(e){return!(!e.parentNode||e.parentNode!==a)},p.getBody()))&&("P"===n.nodeName?n.appendChild(o.create("p",null,t).firstChild):o.insertAfter(o.create("p",null,t),n),p.nodeChanged())}),p.addCommand("WP_Code",function(){p.formatter.toggle("code")}),p.addCommand("WP_Page",function(){p.execCommand("WP_More","nextpage")}),p.addCommand("WP_Help",function(){var e,t=k.Env.mac?u("Ctrl + Alt + letter:"):u("Shift + Alt + letter:"),n=k.Env.mac?u("\u2318 + letter:"):u("Ctrl + letter:"),o=[],i=[],a={},r={},s=0,d=0,l=p.settings.wp_shortcut_labels;function c(e,t){var n="<tr>",o=0;for(t=t||1,m(e,function(e,t){n+="<td><kbd>"+t+"</kbd></td><td>"+u(e)+"</td>",o++});o<t;)n+="<td></td><td></td>",o++;return n+"</tr>"}l&&(m(l,function(e,t){var n;-1!==e.indexOf("meta")?(s++,(n=e.replace("meta","").toLowerCase())&&(a[n]=t,s%2==0)&&(o.push(c(a,2)),a={})):-1!==e.indexOf("access")&&(d++,n=e.replace("access","").toLowerCase())&&(r[n]=t,d%2==0)&&(i.push(c(r,2)),r={})}),0<s%2&&o.push(c(a,2)),0<d%2&&i.push(c(r,2)),l="<tr><th>"+(l=[u("Letter"),u("Action"),u("Letter"),u("Action")]).join("</th><th>")+"</th></tr>",e=(e='<div class="wp-editor-help">')+"<h2>"+u("Default shortcuts,")+" "+n+'</h2><table class="wp-help-th-center fixed">'+l+o.join("")+"</table><h2>"+u("Additional shortcuts,")+" "+t+'</h2><table class="wp-help-th-center fixed">'+l+i.join("")+"</table>",e=(e=p.plugins.wptextpattern&&(!k.Env.ie||8<k.Env.ie)?(e=e+"<h2>"+u("When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.")+'</h2><table class="wp-help-th-center fixed">'+c({"*":"Bullet list","1.":"Numbered list"})+c({"-":"Bullet list","1)":"Numbered list"})+"</table>")+"<h2>"+u("The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.")+'</h2><table class="wp-help-single">'+c({">":"Blockquote"})+c({"##":"Heading 2"})+c({"###":"Heading 3"})+c({"####":"Heading 4"})+c({"#####":"Heading 5"})+c({"######":"Heading 6"})+c({"---":"Horizontal line"})+"</table>":e)+"<h2>"+u("Focus shortcuts:")+'</h2><table class="wp-help-single">'+c({"Alt + F8":"Inline toolbar (when an image, link or preview is selected)"})+c({"Alt + F9":"Editor menu (when enabled)"})+c({"Alt + F10":"Editor toolbar"})+c({"Alt + F11":"Elements path"})+"</table><p>"+u("To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.")+"</p>",(n=p.windowManager.open({title:p.settings.classic_block_editor?"Classic Block Keyboard Shortcuts":"Keyboard Shortcuts",items:{type:"container",classes:"wp-help",html:e+="</div>"},buttons:{text:"Close",onclick:"close"}})).$el)&&(n.$el.find('div[role="application"]').attr("role","document"),(t=n.$el.find(".mce-wp-help"))[0])&&(t.attr("tabindex","0"),t[0].focus(),t.on("keydown",function(e){33<=e.keyCode&&e.keyCode<=40&&e.stopPropagation()}))}),p.addCommand("WP_Medialib",function(){o&&o.media&&o.media.editor&&o.media.editor.open(p.id)}),p.addButton("wp_more",{tooltip:"Insert Read More tag",onclick:function(){p.execCommand("WP_More","more")}}),p.addButton("wp_page",{tooltip:"Page break",onclick:function(){p.execCommand("WP_More","nextpage")}}),p.addButton("wp_help",{tooltip:"Keyboard Shortcuts",cmd:"WP_Help"}),p.addButton("wp_code",{tooltip:"Code",cmd:"WP_Code",stateSelector:"code"}),o&&o.media&&o.media.editor&&(p.addButton("wp_add_media",{tooltip:"Add Media",icon:"dashicon dashicons-admin-media",cmd:"WP_Medialib"}),p.addMenuItem("add_media",{text:"Add Media",icon:"wp-media-library",context:"insert",cmd:"WP_Medialib"})),p.addMenuItem("wp_more",{text:"Insert Read More tag",icon:"wp_more",context:"insert",onclick:function(){p.execCommand("WP_More","more")}}),p.addMenuItem("wp_page",{text:"Page break",icon:"wp_page",context:"insert",onclick:function(){p.execCommand("WP_More","nextpage")}}),p.on("BeforeExecCommand",function(e){!k.Env.webkit||"InsertUnorderedList"!==e.command&&"InsertOrderedList"!==e.command||(t=t||p.dom.create("style",{type:"text/css"},"#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}"),p.getDoc().head.appendChild(t))}),p.on("ExecCommand",function(e){k.Env.webkit&&t&&("InsertUnorderedList"===e.command||"InsertOrderedList"===e.command)&&p.dom.remove(t)}),p.on("init",function(){var e=k.Env,t=["mceContentBody"],n=p.getDoc(),o=p.dom;e.iOS&&o.addClass(n.documentElement,"ios"),"rtl"===p.getParam("directionality")&&(t.push("rtl"),o.setAttrib(n.documentElement,"dir","rtl")),o.setAttrib(n.documentElement,"lang",p.getParam("wp_lang_attr")),e.ie?9===parseInt(e.ie,10)?t.push("ie9"):8===parseInt(e.ie,10)?t.push("ie8"):e.ie<8&&t.push("ie7"):e.webkit&&t.push("webkit"),t.push("wp-editor"),m(t,function(e){e&&o.addClass(n.body,e)}),p.on("BeforeSetContent",function(e){e.content&&(e.content=e.content.replace(/<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)( [^>]*)?>/gi,"<$1$2>").replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)>\s*<\/p>/gi,"</$1>"))}),i&&i(function(){i(document).triggerHandler("tinymce-editor-init",[p])}),window.tinyMCEPreInit&&window.tinyMCEPreInit.dragDropUpload&&o.bind(n,"dragstart dragend dragover drop",function(e){i&&i(document).trigger(new i.Event(e))}),p.getParam("wp_paste_filters",!0)&&(p.on("PastePreProcess",function(e){e.content=e.content.replace(/<br class="?Apple-interchange-newline"?>/gi,""),k.Env.webkit||(e.content=e.content.replace(/(<[^>]+) style="[^"]*"([^>]*>)/gi,"$1$2"),e.content=e.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi,"$1 style=$2"))}),p.on("PastePostProcess",function(e){p.$("p",e.node).each(function(e,t){o.isEmpty(t)&&o.remove(t)}),k.isIE&&p.$("a",e.node).find("font, u").each(function(e,t){o.remove(t,!0)})}))}),p.on("SaveContent",function(e){!p.inline&&p.isHidden()?e.content=e.element.value:(e.content=e.content.replace(/<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g,"<p> </p>"),e.content=r?o.editor.removep(e.content):e.content.replace(/-->\s*<!-- wp:/g,"--\x3e\n\n\x3c!-- wp:"))}),p.on("preInit",function(){p.schema.addValidElements("@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b,script[src|async|defer|type|charset|crossorigin|integrity]"),k.Env.iOS&&(p.settings.height=300),m({c:"JustifyCenter",r:"JustifyRight",l:"JustifyLeft",j:"JustifyFull",q:"mceBlockQuote",u:"InsertUnorderedList",o:"InsertOrderedList",m:"WP_Medialib",t:"WP_More",d:"Strikethrough",p:"WP_Page",x:"WP_Code"},function(e,t){p.shortcuts.add("access+"+t,"",e)}),p.addShortcut("meta+s","",function(){o&&o.autosave&&o.autosave.server.triggerSave()}),p.settings.classic_block_editor||p.addShortcut("access+z","","WP_Adv"),p.on("keydown",function(e){var t=k.Env.mac?e.ctrlKey&&e.altKey&&"KeyH"===e.code:e.shiftKey&&e.altKey&&"KeyH"===e.code;return!t||(p.execCommand("WP_Help"),e.stopPropagation(),e.stopImmediatePropagation(),!1)}),1<window.getUserSetting("editor_plain_text_paste_warning")&&(p.settings.paste_plaintext_inform=!1),k.Env.mac&&k.$(p.iframeElement).attr("title",u("Rich Text Area. Press Control-Option-H for help."))}),p.on("PastePlainTextToggle",function(e){!0===e.state&&(e=parseInt(window.getUserSetting("editor_plain_text_paste_warning"),10)||0)<2&&window.setUserSetting("editor_plain_text_paste_warning",++e)}),p.on("beforerenderui",function(){p.theme.panel&&(m(["button","colorbutton","splitbutton"],function(e){(e=p.theme.panel.find(e))&&m(e,function(e){var t;e&&e.settings.tooltip&&(t=d(e.settings.tooltip),e.settings.tooltip=t,e._aria)&&e._aria.label&&(e._aria.label=t)})}),m(p.theme.panel.find("listbox"),function(e){e&&"Paragraph"===e.settings.text&&m(e.settings.values,function(e){e.text&&s.hasOwnProperty(e.text)&&(e.shortcut="("+s[e.text]+")")})}))}),p.on("preinit",function(){var n,v,t,_,y,P,o,r=k.ui.Factory,s=p.settings,e=p.getContainer(),x=document.getElementById("wpadminbar"),C=document.getElementById(p.id+"_ifr");function i(e){if(n)if(n.tempHide||"hide"===e.type||"blur"===e.type)n.hide(),n=!1;else if(("resizewindow"===e.type||"scrollwindow"===e.type||"resize"===e.type||"scroll"===e.type)&&!n.blockHide){if("resize"===e.type||"resizewindow"===e.type){if(e=(e=p.getWin()).innerHeight+e.innerWidth,!(o=o&&2e3<(new Date).getTime()-o.timestamp?null:o))return void(o={timestamp:(new Date).getTime(),size:e});if(e&&Math.abs(e-o.size)<2)return}clearTimeout(t),t=setTimeout(function(){n&&"function"==typeof n.show&&(n.scrolling=!1,n.show())},250),n.scrolling=!0,n.hide()}}e&&(_=k.$(".mce-toolbar-grp",e)[0],y=k.$(".mce-statusbar",e)[0]),"content"===p.id&&(P=document.getElementById("post-status-info")),p.shortcuts.add("alt+119","",function(){var e;n&&(e=n.find("toolbar")[0])&&e.focus(!0)}),p.on("nodechange",function(e){var t=p.selection.isCollapsed(),e={element:e.element,parents:e.parents,collapsed:t};p.fire("wptoolbar",e),v=e.selection||e.element,n&&n!==e.toolbar&&n.hide(),e.toolbar?(n=e.toolbar).visible()?n.reposition():n.show():n=!1}),p.on("focus",function(){n&&n.show()}),p.inline?(p.on("resizewindow",i),document.addEventListener("scroll",i,!0)):(p.dom.bind(p.getWin(),"resize scroll",i),p.on("resizewindow scrollwindow",i)),p.on("remove",function(){document.removeEventListener("scroll",i,!0),p.off("resizewindow scrollwindow",i),p.dom.unbind(p.getWin(),"resize scroll",i)}),p.on("blur hide",i),p.wp=p.wp||{},p.wp._createToolbar=function(e,t){var n,o,a=[];return m(e,function(i){var t,e;function n(){var e=p.selection;"bullist"===t&&e.selectorChanged("ul > li",function(e,t){for(var n,o=t.parents.length;o--&&"OL"!==(n=t.parents[o].nodeName)&&"UL"!=n;);i.active(e&&"UL"===n)}),"numlist"===t&&e.selectorChanged("ol > li",function(e,t){for(var n,o=t.parents.length;o--&&"OL"!==(n=t.parents[o].nodeName)&&"UL"!==n;);i.active(e&&"OL"===n)}),i.settings.stateSelector&&e.selectorChanged(i.settings.stateSelector,function(e){i.active(e)},!0),i.settings.disabledStateSelector&&e.selectorChanged(i.settings.disabledStateSelector,function(e){i.disabled(e)})}"|"===i?o=null:r.has(i)?(i={type:i},s.toolbar_items_size&&(i.size=s.toolbar_items_size),a.push(i),o=null):(o||(o={type:"buttongroup",items:[]},a.push(o)),p.buttons[i]&&(t=i,(i="function"==typeof(i=p.buttons[t])?i():i).type=i.type||"button",s.toolbar_items_size&&(i.size=s.toolbar_items_size),(e=i.tooltip||i.title)&&(i.tooltip=d(e)),i=r.create(i),o.items.push(i),p.initialized?n():p.on("init",n)))}),(n=r.create({type:"panel",layout:"stack",classes:"toolbar-grp inline-toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:[{type:"toolbar",layout:"flow",items:a}]})).bottom=t,n.on("show",function(){this.reposition()}),n.on("keydown",function(e){27===e.keyCode&&(this.hide(),p.focus())}),p.on("remove",function(){n.remove()}),n.reposition=function(){var e,t,n,o,i,a,r,s,d,l,c,p,m,u,g,h,f,w,b;return v&&(e=window.pageXOffset||document.documentElement.scrollLeft,t=window.pageYOffset||document.documentElement.scrollTop,n=window.innerWidth,u=window.innerHeight,o=C?C.getBoundingClientRect():{top:0,right:n,bottom:u,left:0,width:n,height:u},a=(i=this.getEl()).offsetWidth,r=i.clientHeight,d=((s=v.getBoundingClientRect()).left+s.right)/2,l=r+5,c=x?x.getBoundingClientRect().bottom:0,b=_?_.getBoundingClientRect().bottom:0,p=y?u-y.getBoundingClientRect().top:0,m=P?u-P.getBoundingClientRect().top:0,c=Math.max(0,c,b,o.top),b=Math.max(0,p,m,u-o.bottom),p=s.top+o.top-c,m=u-o.top-s.bottom-b,g="",f=h=0,(u=u-c-b)<=p||u<=m?(this.scrolling=!0,this.hide(),this.scrolling=!1):(k.Env.iOS&&"IMG"===v.nodeName&&(h=54,f=46),this.bottom?l<=m?(g=" mce-arrow-up",w=s.bottom+o.top+t-f):l<=p&&(g=" mce-arrow-down",w=s.top+o.top+t-r+h):l<=p?(g=" mce-arrow-down",w=s.top+o.top+t-r+h):l<=m&&u/2>s.bottom+o.top-c&&(g=" mce-arrow-up",w=s.bottom+o.top+t-f),void 0===w&&(w=t+c+5+f),b=d-a/2+o.left+e,s.left<0||s.right>o.width?b=o.left+e+(o.width-a)/2:n<=a?(g+=" mce-arrow-full",b=0):b<0&&s.left+a>n||n<b+a&&s.right-a<0?b=(n-a)/2:b<o.left+e?(g+=" mce-arrow-left",b=s.left+o.left+e):b+a>o.width+o.left+e&&(g+=" mce-arrow-right",b=s.right-a+o.left+e),k.Env.iOS&&"IMG"===v.nodeName&&(g=g.replace(/ ?mce-arrow-(up|down)/g,"")),i.className=i.className.replace(/ ?mce-arrow-[\w]+/g,"")+g,E.setStyles(i,{left:b,top:w}))),this},n.hide().renderTo(document.body),n}},!0),{_showButtons:n,_hideButtons:n,_setEmbed:n,_getEmbed:n}})}(window.tinymce);PK D$�Z�A]�b� b� plugins/wordpress/plugin.jsnu �[��� /* global getUserSetting, setUserSetting */ ( function( tinymce ) { // Set the minimum value for the modals z-index higher than #wpadminbar (100000). if ( ! tinymce.ui.FloatPanel.zIndex || tinymce.ui.FloatPanel.zIndex < 100100 ) { tinymce.ui.FloatPanel.zIndex = 100100; } tinymce.PluginManager.add( 'wordpress', function( editor ) { var wpAdvButton, style, DOM = tinymce.DOM, each = tinymce.each, __ = editor.editorManager.i18n.translate, $ = window.jQuery, wp = window.wp, hasWpautop = ( wp && wp.editor && wp.editor.autop && editor.getParam( 'wpautop', true ) ), wpTooltips = false; if ( $ ) { // Runs as soon as TinyMCE has started initializing, while plugins are loading. // Handlers attached after the `tinymce.init()` call may not get triggered for this instance. $( document ).triggerHandler( 'tinymce-editor-setup', [ editor ] ); } function toggleToolbars( state ) { var initial, toolbars, iframeHeight, pixels = 0, classicBlockToolbar = tinymce.$( '.block-library-classic__toolbar' ); if ( state === 'hide' ) { initial = true; } else if ( classicBlockToolbar.length && ! classicBlockToolbar.hasClass( 'has-advanced-toolbar' ) ) { // Show the second, third, etc. toolbar rows in the Classic block instance. classicBlockToolbar.addClass( 'has-advanced-toolbar' ); state = 'show'; } if ( editor.theme.panel ) { toolbars = editor.theme.panel.find('.toolbar:not(.menubar)'); } if ( toolbars && toolbars.length > 1 ) { if ( ! state && toolbars[1].visible() ) { state = 'hide'; } each( toolbars, function( toolbar, i ) { if ( i > 0 ) { if ( state === 'hide' ) { toolbar.hide(); pixels += 34; } else { toolbar.show(); pixels -= 34; } } }); } // Resize editor iframe, not needed for iOS and inline instances. // Don't resize if the editor is in a hidden container. if ( pixels && ! tinymce.Env.iOS && editor.iframeElement && editor.iframeElement.clientHeight ) { iframeHeight = editor.iframeElement.clientHeight + pixels; // Keep min-height. if ( iframeHeight > 50 ) { DOM.setStyle( editor.iframeElement, 'height', iframeHeight ); } } if ( ! initial ) { if ( state === 'hide' ) { setUserSetting( 'hidetb', '0' ); wpAdvButton && wpAdvButton.active( false ); } else { setUserSetting( 'hidetb', '1' ); wpAdvButton && wpAdvButton.active( true ); } } editor.fire( 'wp-toolbar-toggle' ); } // Add the kitchen sink button :) editor.addButton( 'wp_adv', { tooltip: 'Toolbar Toggle', cmd: 'WP_Adv', onPostRender: function() { wpAdvButton = this; wpAdvButton.active( getUserSetting( 'hidetb' ) === '1' ); } }); // Hide the toolbars after loading. editor.on( 'PostRender', function() { if ( editor.getParam( 'wordpress_adv_hidden', true ) && getUserSetting( 'hidetb', '0' ) === '0' ) { toggleToolbars( 'hide' ); } else { tinymce.$( '.block-library-classic__toolbar' ).addClass( 'has-advanced-toolbar' ); } }); editor.addCommand( 'WP_Adv', function() { toggleToolbars(); }); editor.on( 'focus', function() { window.wpActiveEditor = editor.id; }); editor.on( 'BeforeSetContent', function( event ) { var title; if ( event.content ) { if ( event.content.indexOf( '<!--more' ) !== -1 ) { title = __( 'Read more...' ); event.content = event.content.replace( /<!--more(.*?)-->/g, function( match, moretext ) { return '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="more" data-wp-more-text="' + moretext + '" ' + 'class="wp-more-tag mce-wp-more" alt="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />'; }); } if ( event.content.indexOf( '<!--nextpage-->' ) !== -1 ) { title = __( 'Page break' ); event.content = event.content.replace( /<!--nextpage-->/g, '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="nextpage" class="wp-more-tag mce-wp-nextpage" ' + 'alt="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' ); } if ( event.load && event.format !== 'raw' ) { if ( hasWpautop ) { event.content = wp.editor.autop( event.content ); } else { // Prevent creation of paragraphs out of multiple HTML comments. event.content = event.content.replace( /-->\s+<!--/g, '--><!--' ); } } if ( event.content.indexOf( '<script' ) !== -1 || event.content.indexOf( '<style' ) !== -1 ) { event.content = event.content.replace( /<(script|style)[^>]*>[\s\S]*?<\/\1>/g, function( match, tag ) { return '<img ' + 'src="' + tinymce.Env.transparentSrc + '" ' + 'data-wp-preserve="' + encodeURIComponent( match ) + '" ' + 'data-mce-resize="false" ' + 'data-mce-placeholder="1" '+ 'class="mce-object mce-object-' + tag + '" ' + 'width="20" height="20" '+ 'alt="<' + tag + '>" ' + '/>'; } ); } } }); editor.on( 'setcontent', function() { // Remove spaces from empty paragraphs. editor.$( 'p' ).each( function( i, node ) { if ( node.innerHTML && node.innerHTML.length < 10 ) { var html = tinymce.trim( node.innerHTML ); if ( ! html || html === ' ' ) { node.innerHTML = ( tinymce.Env.ie && tinymce.Env.ie < 11 ) ? '' : '<br data-mce-bogus="1">'; } } } ); }); editor.on( 'PostProcess', function( event ) { if ( event.get ) { event.content = event.content.replace(/<img[^>]+>/g, function( image ) { var match, string, moretext = ''; if ( image.indexOf( 'data-wp-more="more"' ) !== -1 ) { if ( match = image.match( /data-wp-more-text="([^"]+)"/ ) ) { moretext = match[1]; } string = '<!--more' + moretext + '-->'; } else if ( image.indexOf( 'data-wp-more="nextpage"' ) !== -1 ) { string = '<!--nextpage-->'; } else if ( image.indexOf( 'data-wp-preserve' ) !== -1 ) { if ( match = image.match( / data-wp-preserve="([^"]+)"/ ) ) { string = decodeURIComponent( match[1] ); } } return string || image; }); } }); // Display the tag name instead of img in element path. editor.on( 'ResolveName', function( event ) { var attr; if ( event.target.nodeName === 'IMG' && ( attr = editor.dom.getAttrib( event.target, 'data-wp-more' ) ) ) { event.name = attr; } }); // Register commands. editor.addCommand( 'WP_More', function( tag ) { var parent, html, title, classname = 'wp-more-tag', dom = editor.dom, node = editor.selection.getNode(), rootNode = editor.getBody(); tag = tag || 'more'; classname += ' mce-wp-' + tag; title = tag === 'more' ? 'Read more...' : 'Next page'; title = __( title ); html = '<img src="' + tinymce.Env.transparentSrc + '" alt="' + title + '" class="' + classname + '" ' + 'data-wp-more="' + tag + '" data-mce-resize="false" data-mce-placeholder="1" />'; // Most common case. if ( node === rootNode || ( node.nodeName === 'P' && node.parentNode === rootNode ) ) { editor.insertContent( html ); return; } // Get the top level parent node. parent = dom.getParent( node, function( found ) { if ( found.parentNode && found.parentNode === rootNode ) { return true; } return false; }, editor.getBody() ); if ( parent ) { if ( parent.nodeName === 'P' ) { parent.appendChild( dom.create( 'p', null, html ).firstChild ); } else { dom.insertAfter( dom.create( 'p', null, html ), parent ); } editor.nodeChanged(); } }); editor.addCommand( 'WP_Code', function() { editor.formatter.toggle('code'); }); editor.addCommand( 'WP_Page', function() { editor.execCommand( 'WP_More', 'nextpage' ); }); editor.addCommand( 'WP_Help', function() { var access = tinymce.Env.mac ? __( 'Ctrl + Alt + letter:' ) : __( 'Shift + Alt + letter:' ), meta = tinymce.Env.mac ? __( '⌘ + letter:' ) : __( 'Ctrl + letter:' ), table1 = [], table2 = [], row1 = {}, row2 = {}, i1 = 0, i2 = 0, labels = editor.settings.wp_shortcut_labels, header, html, dialog, $wrap; if ( ! labels ) { return; } function tr( row, columns ) { var out = '<tr>'; var i = 0; columns = columns || 1; each( row, function( text, key ) { out += '<td><kbd>' + key + '</kbd></td><td>' + __( text ) + '</td>'; i++; }); while ( i < columns ) { out += '<td></td><td></td>'; i++; } return out + '</tr>'; } each ( labels, function( label, name ) { var letter; if ( label.indexOf( 'meta' ) !== -1 ) { i1++; letter = label.replace( 'meta', '' ).toLowerCase(); if ( letter ) { row1[ letter ] = name; if ( i1 % 2 === 0 ) { table1.push( tr( row1, 2 ) ); row1 = {}; } } } else if ( label.indexOf( 'access' ) !== -1 ) { i2++; letter = label.replace( 'access', '' ).toLowerCase(); if ( letter ) { row2[ letter ] = name; if ( i2 % 2 === 0 ) { table2.push( tr( row2, 2 ) ); row2 = {}; } } } } ); // Add remaining single entries. if ( i1 % 2 > 0 ) { table1.push( tr( row1, 2 ) ); } if ( i2 % 2 > 0 ) { table2.push( tr( row2, 2 ) ); } header = [ __( 'Letter' ), __( 'Action' ), __( 'Letter' ), __( 'Action' ) ]; header = '<tr><th>' + header.join( '</th><th>' ) + '</th></tr>'; html = '<div class="wp-editor-help">'; // Main section, default and additional shortcuts. html = html + '<h2>' + __( 'Default shortcuts,' ) + ' ' + meta + '</h2>' + '<table class="wp-help-th-center fixed">' + header + table1.join('') + '</table>' + '<h2>' + __( 'Additional shortcuts,' ) + ' ' + access + '</h2>' + '<table class="wp-help-th-center fixed">' + header + table2.join('') + '</table>'; if ( editor.plugins.wptextpattern && ( ! tinymce.Env.ie || tinymce.Env.ie > 8 ) ) { // Text pattern section. html = html + '<h2>' + __( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ) + '</h2>' + '<table class="wp-help-th-center fixed">' + tr({ '*': 'Bullet list', '1.': 'Numbered list' }) + tr({ '-': 'Bullet list', '1)': 'Numbered list' }) + '</table>'; html = html + '<h2>' + __( 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' ) + '</h2>' + '<table class="wp-help-single">' + tr({ '>': 'Blockquote' }) + tr({ '##': 'Heading 2' }) + tr({ '###': 'Heading 3' }) + tr({ '####': 'Heading 4' }) + tr({ '#####': 'Heading 5' }) + tr({ '######': 'Heading 6' }) + tr({ '---': 'Horizontal line' }) + '</table>'; } // Focus management section. html = html + '<h2>' + __( 'Focus shortcuts:' ) + '</h2>' + '<table class="wp-help-single">' + tr({ 'Alt + F8': 'Inline toolbar (when an image, link or preview is selected)' }) + tr({ 'Alt + F9': 'Editor menu (when enabled)' }) + tr({ 'Alt + F10': 'Editor toolbar' }) + tr({ 'Alt + F11': 'Elements path' }) + '</table>' + '<p>' + __( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ) + '</p>'; html += '</div>'; dialog = editor.windowManager.open( { title: editor.settings.classic_block_editor ? 'Classic Block Keyboard Shortcuts' : 'Keyboard Shortcuts', items: { type: 'container', classes: 'wp-help', html: html }, buttons: { text: 'Close', onclick: 'close' } } ); if ( dialog.$el ) { dialog.$el.find( 'div[role="application"]' ).attr( 'role', 'document' ); $wrap = dialog.$el.find( '.mce-wp-help' ); if ( $wrap[0] ) { $wrap.attr( 'tabindex', '0' ); $wrap[0].focus(); $wrap.on( 'keydown', function( event ) { // Prevent use of: page up, page down, end, home, left arrow, up arrow, right arrow, down arrow // in the dialog keydown handler. if ( event.keyCode >= 33 && event.keyCode <= 40 ) { event.stopPropagation(); } }); } } } ); editor.addCommand( 'WP_Medialib', function() { if ( wp && wp.media && wp.media.editor ) { wp.media.editor.open( editor.id ); } }); // Register buttons. editor.addButton( 'wp_more', { tooltip: 'Insert Read More tag', onclick: function() { editor.execCommand( 'WP_More', 'more' ); } }); editor.addButton( 'wp_page', { tooltip: 'Page break', onclick: function() { editor.execCommand( 'WP_More', 'nextpage' ); } }); editor.addButton( 'wp_help', { tooltip: 'Keyboard Shortcuts', cmd: 'WP_Help' }); editor.addButton( 'wp_code', { tooltip: 'Code', cmd: 'WP_Code', stateSelector: 'code' }); // Insert->Add Media. if ( wp && wp.media && wp.media.editor ) { editor.addButton( 'wp_add_media', { tooltip: 'Add Media', icon: 'dashicon dashicons-admin-media', cmd: 'WP_Medialib' } ); editor.addMenuItem( 'add_media', { text: 'Add Media', icon: 'wp-media-library', context: 'insert', cmd: 'WP_Medialib' }); } // Insert "Read More...". editor.addMenuItem( 'wp_more', { text: 'Insert Read More tag', icon: 'wp_more', context: 'insert', onclick: function() { editor.execCommand( 'WP_More', 'more' ); } }); // Insert "Next Page". editor.addMenuItem( 'wp_page', { text: 'Page break', icon: 'wp_page', context: 'insert', onclick: function() { editor.execCommand( 'WP_More', 'nextpage' ); } }); editor.on( 'BeforeExecCommand', function(e) { if ( tinymce.Env.webkit && ( e.command === 'InsertUnorderedList' || e.command === 'InsertOrderedList' ) ) { if ( ! style ) { style = editor.dom.create( 'style', {'type': 'text/css'}, '#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}'); } editor.getDoc().head.appendChild( style ); } }); editor.on( 'ExecCommand', function( e ) { if ( tinymce.Env.webkit && style && ( 'InsertUnorderedList' === e.command || 'InsertOrderedList' === e.command ) ) { editor.dom.remove( style ); } }); editor.on( 'init', function() { var env = tinymce.Env, bodyClass = ['mceContentBody'], // Back-compat for themes that use this in editor-style.css... doc = editor.getDoc(), dom = editor.dom; if ( env.iOS ) { dom.addClass( doc.documentElement, 'ios' ); } if ( editor.getParam( 'directionality' ) === 'rtl' ) { bodyClass.push('rtl'); dom.setAttrib( doc.documentElement, 'dir', 'rtl' ); } dom.setAttrib( doc.documentElement, 'lang', editor.getParam( 'wp_lang_attr' ) ); if ( env.ie ) { if ( parseInt( env.ie, 10 ) === 9 ) { bodyClass.push('ie9'); } else if ( parseInt( env.ie, 10 ) === 8 ) { bodyClass.push('ie8'); } else if ( env.ie < 8 ) { bodyClass.push('ie7'); } } else if ( env.webkit ) { bodyClass.push('webkit'); } bodyClass.push('wp-editor'); each( bodyClass, function( cls ) { if ( cls ) { dom.addClass( doc.body, cls ); } }); // Remove invalid parent paragraphs when inserting HTML. editor.on( 'BeforeSetContent', function( event ) { if ( event.content ) { event.content = event.content.replace( /<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)( [^>]*)?>/gi, '<$1$2>' ) .replace( /<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre)>\s*<\/p>/gi, '</$1>' ); } }); if ( $ ) { // Run on DOM ready. Otherwise TinyMCE may initialize earlier and handlers attached // on DOM ready of after the `tinymce.init()` call may not get triggered. $( function() { $( document ).triggerHandler( 'tinymce-editor-init', [editor] ); }); } if ( window.tinyMCEPreInit && window.tinyMCEPreInit.dragDropUpload ) { dom.bind( doc, 'dragstart dragend dragover drop', function( event ) { if ( $ ) { // Trigger the jQuery handlers. $( document ).trigger( new $.Event( event ) ); } }); } if ( editor.getParam( 'wp_paste_filters', true ) ) { editor.on( 'PastePreProcess', function( event ) { // Remove trailing <br> added by WebKit browsers to the clipboard. event.content = event.content.replace( /<br class="?Apple-interchange-newline"?>/gi, '' ); // In WebKit this is handled by removeWebKitStyles(). if ( ! tinymce.Env.webkit ) { // Remove all inline styles. event.content = event.content.replace( /(<[^>]+) style="[^"]*"([^>]*>)/gi, '$1$2' ); // Put back the internal styles. event.content = event.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi, '$1 style=$2' ); } }); editor.on( 'PastePostProcess', function( event ) { // Remove empty paragraphs. editor.$( 'p', event.node ).each( function( i, node ) { if ( dom.isEmpty( node ) ) { dom.remove( node ); } }); if ( tinymce.isIE ) { editor.$( 'a', event.node ).find( 'font, u' ).each( function( i, node ) { dom.remove( node, true ); }); } }); } }); editor.on( 'SaveContent', function( event ) { // If editor is hidden, we just want the textarea's value to be saved. if ( ! editor.inline && editor.isHidden() ) { event.content = event.element.value; return; } // Keep empty paragraphs :( event.content = event.content.replace( /<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g, '<p> </p>' ); if ( hasWpautop ) { event.content = wp.editor.removep( event.content ); } else { // Restore formatting of block boundaries. event.content = event.content.replace( /-->\s*<!-- wp:/g, '-->\n\n<!-- wp:' ); } }); editor.on( 'preInit', function() { var validElementsSetting = '@[id|accesskey|class|dir|lang|style|tabindex|' + 'title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],' + // Global attributes. 'i,' + // Don't replace <i> with <em> and <b> with <strong> and don't remove them when empty. 'b,' + 'script[src|async|defer|type|charset|crossorigin|integrity]'; // Add support for <script>. editor.schema.addValidElements( validElementsSetting ); if ( tinymce.Env.iOS ) { editor.settings.height = 300; } each( { c: 'JustifyCenter', r: 'JustifyRight', l: 'JustifyLeft', j: 'JustifyFull', q: 'mceBlockQuote', u: 'InsertUnorderedList', o: 'InsertOrderedList', m: 'WP_Medialib', t: 'WP_More', d: 'Strikethrough', p: 'WP_Page', x: 'WP_Code' }, function( command, key ) { editor.shortcuts.add( 'access+' + key, '', command ); } ); editor.addShortcut( 'meta+s', '', function() { if ( wp && wp.autosave ) { wp.autosave.server.triggerSave(); } } ); // Alt+Shift+Z removes a block in the block editor, don't add it to the Classic block. if ( ! editor.settings.classic_block_editor ) { editor.addShortcut( 'access+z', '', 'WP_Adv' ); } // Workaround for not triggering the global help modal in the block editor by the Classic block shortcut. editor.on( 'keydown', function( event ) { var match; if ( tinymce.Env.mac ) { match = event.ctrlKey && event.altKey && event.code === 'KeyH'; } else { match = event.shiftKey && event.altKey && event.code === 'KeyH'; } if ( match ) { editor.execCommand( 'WP_Help' ); event.stopPropagation(); event.stopImmediatePropagation(); return false; } return true; }); if ( window.getUserSetting( 'editor_plain_text_paste_warning' ) > 1 ) { editor.settings.paste_plaintext_inform = false; } // Change the editor iframe title on MacOS, add the correct help shortcut. if ( tinymce.Env.mac ) { tinymce.$( editor.iframeElement ).attr( 'title', __( 'Rich Text Area. Press Control-Option-H for help.' ) ); } } ); editor.on( 'PastePlainTextToggle', function( event ) { // Warn twice, then stop. if ( event.state === true ) { var times = parseInt( window.getUserSetting( 'editor_plain_text_paste_warning' ), 10 ) || 0; if ( times < 2 ) { window.setUserSetting( 'editor_plain_text_paste_warning', ++times ); } } }); editor.on( 'beforerenderui', function() { if ( editor.theme.panel ) { each( [ 'button', 'colorbutton', 'splitbutton' ], function( buttonType ) { replaceButtonsTooltips( editor.theme.panel.find( buttonType ) ); } ); addShortcutsToListbox(); } } ); function prepareTooltips() { var access = 'Shift+Alt+'; var meta = 'Ctrl+'; wpTooltips = {}; // For MacOS: ctrl = \u2303, cmd = \u2318, alt = \u2325. if ( tinymce.Env.mac ) { access = '\u2303\u2325'; meta = '\u2318'; } // Some tooltips are translated, others are not... if ( editor.settings.wp_shortcut_labels ) { each( editor.settings.wp_shortcut_labels, function( value, tooltip ) { var translated = editor.translate( tooltip ); value = value.replace( 'access', access ).replace( 'meta', meta ); wpTooltips[ tooltip ] = value; // Add the translated so we can match all of them. if ( tooltip !== translated ) { wpTooltips[ translated ] = value; } } ); } } function getTooltip( tooltip ) { var translated = editor.translate( tooltip ); var label; if ( ! wpTooltips ) { prepareTooltips(); } if ( wpTooltips.hasOwnProperty( translated ) ) { label = wpTooltips[ translated ]; } else if ( wpTooltips.hasOwnProperty( tooltip ) ) { label = wpTooltips[ tooltip ]; } return label ? translated + ' (' + label + ')' : translated; } function replaceButtonsTooltips( buttons ) { if ( ! buttons ) { return; } each( buttons, function( button ) { var tooltip; if ( button && button.settings.tooltip ) { tooltip = getTooltip( button.settings.tooltip ); button.settings.tooltip = tooltip; // Override the aria label with the translated tooltip + shortcut. if ( button._aria && button._aria.label ) { button._aria.label = tooltip; } } } ); } function addShortcutsToListbox() { // listbox for the "blocks" drop-down. each( editor.theme.panel.find( 'listbox' ), function( listbox ) { if ( listbox && listbox.settings.text === 'Paragraph' ) { each( listbox.settings.values, function( item ) { if ( item.text && wpTooltips.hasOwnProperty( item.text ) ) { item.shortcut = '(' + wpTooltips[ item.text ] + ')'; } } ); } } ); } /** * Experimental: create a floating toolbar. * This functionality will change in the next releases. Not recommended for use by plugins. */ editor.on( 'preinit', function() { var Factory = tinymce.ui.Factory, settings = editor.settings, activeToolbar, currentSelection, timeout, container = editor.getContainer(), wpAdminbar = document.getElementById( 'wpadminbar' ), mceIframe = document.getElementById( editor.id + '_ifr' ), mceToolbar, mceStatusbar, wpStatusbar, cachedWinSize; if ( container ) { mceToolbar = tinymce.$( '.mce-toolbar-grp', container )[0]; mceStatusbar = tinymce.$( '.mce-statusbar', container )[0]; } if ( editor.id === 'content' ) { wpStatusbar = document.getElementById( 'post-status-info' ); } function create( buttons, bottom ) { var toolbar, toolbarItems = [], buttonGroup; each( buttons, function( item ) { var itemName; var tooltip; function bindSelectorChanged() { var selection = editor.selection; if ( itemName === 'bullist' ) { selection.selectorChanged( 'ul > li', function( state, args ) { var i = args.parents.length, nodeName; while ( i-- ) { nodeName = args.parents[ i ].nodeName; if ( nodeName === 'OL' || nodeName == 'UL' ) { break; } } item.active( state && nodeName === 'UL' ); } ); } if ( itemName === 'numlist' ) { selection.selectorChanged( 'ol > li', function( state, args ) { var i = args.parents.length, nodeName; while ( i-- ) { nodeName = args.parents[ i ].nodeName; if ( nodeName === 'OL' || nodeName === 'UL' ) { break; } } item.active( state && nodeName === 'OL' ); } ); } if ( item.settings.stateSelector ) { selection.selectorChanged( item.settings.stateSelector, function( state ) { item.active( state ); }, true ); } if ( item.settings.disabledStateSelector ) { selection.selectorChanged( item.settings.disabledStateSelector, function( state ) { item.disabled( state ); } ); } } if ( item === '|' ) { buttonGroup = null; } else { if ( Factory.has( item ) ) { item = { type: item }; if ( settings.toolbar_items_size ) { item.size = settings.toolbar_items_size; } toolbarItems.push( item ); buttonGroup = null; } else { if ( ! buttonGroup ) { buttonGroup = { type: 'buttongroup', items: [] }; toolbarItems.push( buttonGroup ); } if ( editor.buttons[ item ] ) { itemName = item; item = editor.buttons[ itemName ]; if ( typeof item === 'function' ) { item = item(); } item.type = item.type || 'button'; if ( settings.toolbar_items_size ) { item.size = settings.toolbar_items_size; } tooltip = item.tooltip || item.title; if ( tooltip ) { item.tooltip = getTooltip( tooltip ); } item = Factory.create( item ); buttonGroup.items.push( item ); if ( editor.initialized ) { bindSelectorChanged(); } else { editor.on( 'init', bindSelectorChanged ); } } } } } ); toolbar = Factory.create( { type: 'panel', layout: 'stack', classes: 'toolbar-grp inline-toolbar-grp', ariaRoot: true, ariaRemember: true, items: [ { type: 'toolbar', layout: 'flow', items: toolbarItems } ] } ); toolbar.bottom = bottom; function reposition() { if ( ! currentSelection ) { return this; } var scrollX = window.pageXOffset || document.documentElement.scrollLeft, scrollY = window.pageYOffset || document.documentElement.scrollTop, windowWidth = window.innerWidth, windowHeight = window.innerHeight, iframeRect = mceIframe ? mceIframe.getBoundingClientRect() : { top: 0, right: windowWidth, bottom: windowHeight, left: 0, width: windowWidth, height: windowHeight }, toolbar = this.getEl(), toolbarWidth = toolbar.offsetWidth, toolbarHeight = toolbar.clientHeight, selection = currentSelection.getBoundingClientRect(), selectionMiddle = ( selection.left + selection.right ) / 2, buffer = 5, spaceNeeded = toolbarHeight + buffer, wpAdminbarBottom = wpAdminbar ? wpAdminbar.getBoundingClientRect().bottom : 0, mceToolbarBottom = mceToolbar ? mceToolbar.getBoundingClientRect().bottom : 0, mceStatusbarTop = mceStatusbar ? windowHeight - mceStatusbar.getBoundingClientRect().top : 0, wpStatusbarTop = wpStatusbar ? windowHeight - wpStatusbar.getBoundingClientRect().top : 0, blockedTop = Math.max( 0, wpAdminbarBottom, mceToolbarBottom, iframeRect.top ), blockedBottom = Math.max( 0, mceStatusbarTop, wpStatusbarTop, windowHeight - iframeRect.bottom ), spaceTop = selection.top + iframeRect.top - blockedTop, spaceBottom = windowHeight - iframeRect.top - selection.bottom - blockedBottom, editorHeight = windowHeight - blockedTop - blockedBottom, className = '', iosOffsetTop = 0, iosOffsetBottom = 0, top, left; if ( spaceTop >= editorHeight || spaceBottom >= editorHeight ) { this.scrolling = true; this.hide(); this.scrolling = false; return this; } // Add offset in iOS to move the menu over the image, out of the way of the default iOS menu. if ( tinymce.Env.iOS && currentSelection.nodeName === 'IMG' ) { iosOffsetTop = 54; iosOffsetBottom = 46; } if ( this.bottom ) { if ( spaceBottom >= spaceNeeded ) { className = ' mce-arrow-up'; top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom; } else if ( spaceTop >= spaceNeeded ) { className = ' mce-arrow-down'; top = selection.top + iframeRect.top + scrollY - toolbarHeight + iosOffsetTop; } } else { if ( spaceTop >= spaceNeeded ) { className = ' mce-arrow-down'; top = selection.top + iframeRect.top + scrollY - toolbarHeight + iosOffsetTop; } else if ( spaceBottom >= spaceNeeded && editorHeight / 2 > selection.bottom + iframeRect.top - blockedTop ) { className = ' mce-arrow-up'; top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom; } } if ( typeof top === 'undefined' ) { top = scrollY + blockedTop + buffer + iosOffsetBottom; } left = selectionMiddle - toolbarWidth / 2 + iframeRect.left + scrollX; if ( selection.left < 0 || selection.right > iframeRect.width ) { left = iframeRect.left + scrollX + ( iframeRect.width - toolbarWidth ) / 2; } else if ( toolbarWidth >= windowWidth ) { className += ' mce-arrow-full'; left = 0; } else if ( ( left < 0 && selection.left + toolbarWidth > windowWidth ) || ( left + toolbarWidth > windowWidth && selection.right - toolbarWidth < 0 ) ) { left = ( windowWidth - toolbarWidth ) / 2; } else if ( left < iframeRect.left + scrollX ) { className += ' mce-arrow-left'; left = selection.left + iframeRect.left + scrollX; } else if ( left + toolbarWidth > iframeRect.width + iframeRect.left + scrollX ) { className += ' mce-arrow-right'; left = selection.right - toolbarWidth + iframeRect.left + scrollX; } // No up/down arrows on the menu over images in iOS. if ( tinymce.Env.iOS && currentSelection.nodeName === 'IMG' ) { className = className.replace( / ?mce-arrow-(up|down)/g, '' ); } toolbar.className = toolbar.className.replace( / ?mce-arrow-[\w]+/g, '' ) + className; DOM.setStyles( toolbar, { 'left': left, 'top': top } ); return this; } toolbar.on( 'show', function() { this.reposition(); } ); toolbar.on( 'keydown', function( event ) { if ( event.keyCode === 27 ) { this.hide(); editor.focus(); } } ); editor.on( 'remove', function() { toolbar.remove(); } ); toolbar.reposition = reposition; toolbar.hide().renderTo( document.body ); return toolbar; } editor.shortcuts.add( 'alt+119', '', function() { var node; if ( activeToolbar ) { node = activeToolbar.find( 'toolbar' )[0]; node && node.focus( true ); } } ); editor.on( 'nodechange', function( event ) { var collapsed = editor.selection.isCollapsed(); var args = { element: event.element, parents: event.parents, collapsed: collapsed }; editor.fire( 'wptoolbar', args ); currentSelection = args.selection || args.element; if ( activeToolbar && activeToolbar !== args.toolbar ) { activeToolbar.hide(); } if ( args.toolbar ) { activeToolbar = args.toolbar; if ( activeToolbar.visible() ) { activeToolbar.reposition(); } else { activeToolbar.show(); } } else { activeToolbar = false; } } ); editor.on( 'focus', function() { if ( activeToolbar ) { activeToolbar.show(); } } ); function hide( event ) { var win; var size; if ( activeToolbar ) { if ( activeToolbar.tempHide || event.type === 'hide' || event.type === 'blur' ) { activeToolbar.hide(); activeToolbar = false; } else if ( ( event.type === 'resizewindow' || event.type === 'scrollwindow' || event.type === 'resize' || event.type === 'scroll' ) && ! activeToolbar.blockHide ) { /* * Showing a tooltip may trigger a `resize` event in Chromium browsers. * That results in a flicketing inline menu; tooltips are shown on hovering over a button, * which then hides the toolbar on `resize`, then it repeats as soon as the toolbar is shown again. */ if ( event.type === 'resize' || event.type === 'resizewindow' ) { win = editor.getWin(); size = win.innerHeight + win.innerWidth; // Reset old cached size. if ( cachedWinSize && ( new Date() ).getTime() - cachedWinSize.timestamp > 2000 ) { cachedWinSize = null; } if ( cachedWinSize ) { if ( size && Math.abs( size - cachedWinSize.size ) < 2 ) { // `resize` fired but the window hasn't been resized. Bail. return; } } else { // First of a new series of `resize` events. Store the cached size and bail. cachedWinSize = { timestamp: ( new Date() ).getTime(), size: size, }; return; } } clearTimeout( timeout ); timeout = setTimeout( function() { if ( activeToolbar && typeof activeToolbar.show === 'function' ) { activeToolbar.scrolling = false; activeToolbar.show(); } }, 250 ); activeToolbar.scrolling = true; activeToolbar.hide(); } } } if ( editor.inline ) { editor.on( 'resizewindow', hide ); // Enable `capture` for the event. // This will hide/reposition the toolbar on any scrolling in the document. document.addEventListener( 'scroll', hide, true ); } else { // Bind to the editor iframe and to the parent window. editor.dom.bind( editor.getWin(), 'resize scroll', hide ); editor.on( 'resizewindow scrollwindow', hide ); } editor.on( 'remove', function() { document.removeEventListener( 'scroll', hide, true ); editor.off( 'resizewindow scrollwindow', hide ); editor.dom.unbind( editor.getWin(), 'resize scroll', hide ); } ); editor.on( 'blur hide', hide ); editor.wp = editor.wp || {}; editor.wp._createToolbar = create; }, true ); function noop() {} // Expose some functions (back-compat). return { _showButtons: noop, _hideButtons: noop, _setEmbed: noop, _getEmbed: noop }; }); }( window.tinymce )); PK D$�Z @|�� � plugins/wpemoji/plugin.min.jsnu �[��� !function(m){m.PluginManager.add("wpemoji",function(n){var t,o=window.wp,e=window._wpemojiSettings,i=m.Env,a=window.navigator.userAgent,w=-1<a.indexOf("Windows"),a=!!((a=a.match(/Windows NT 6\.(\d)/))&&1<a[1]);function d(e){o.emoji.parse(e,{imgAttr:{"data-mce-resize":"false","data-mce-placeholder":"1","data-wp-emoji":"1"}})}function c(e){var t,o;e&&window.twemoji&&window.twemoji.test(e.textContent||e.innerText)&&(i.webkit&&(o=(t=n.selection).getBookmark()),d(e),i.webkit)&&t.moveToBookmark(o)}o&&o.emoji&&!e.supports.everything&&(a?n.on("keyup",function(e){231===e.keyCode&&c(n.selection.getNode())}):w||(n.on("keydown keyup",function(e){t="keydown"===e.type}),n.on("input",function(){t||c(n.selection.getNode())})),n.on("setcontent",function(e){var t=n.selection,o=t.getNode();window.twemoji&&window.twemoji.test(o.textContent||o.innerText)&&(d(o),i.ie)&&i.ie<9&&e.load&&o&&"BODY"===o.nodeName&&t.collapse(!0)}),n.on("PastePostProcess",function(e){window.twemoji&&m.each(n.dom.$("img.emoji",e.node),function(e){e.alt&&window.twemoji.test(e.alt)&&((e=e).className="emoji",e.setAttribute("data-mce-resize","false"),e.setAttribute("data-mce-placeholder","1"),e.setAttribute("data-wp-emoji","1"))})}),n.on("postprocess",function(e){e.content&&(e.content=e.content.replace(/<img[^>]+data-wp-emoji="[^>]+>/g,function(e){var t=e.match(/alt="([^"]+)"/);return t&&t[1]?t[1]:e}))}),n.on("resolvename",function(e){"IMG"===e.target.nodeName&&n.dom.getAttrib(e.target,"data-wp-emoji")&&e.preventDefault()}))})}(window.tinymce);PK D$�Z�S�q� � plugins/wpemoji/plugin.jsnu �[��� ( function( tinymce ) { tinymce.PluginManager.add( 'wpemoji', function( editor ) { var typing, wp = window.wp, settings = window._wpemojiSettings, env = tinymce.Env, ua = window.navigator.userAgent, isWin = ua.indexOf( 'Windows' ) > -1, isWin8 = ( function() { var match = ua.match( /Windows NT 6\.(\d)/ ); if ( match && match[1] > 1 ) { return true; } return false; }()); if ( ! wp || ! wp.emoji || settings.supports.everything ) { return; } function setImgAttr( image ) { image.className = 'emoji'; image.setAttribute( 'data-mce-resize', 'false' ); image.setAttribute( 'data-mce-placeholder', '1' ); image.setAttribute( 'data-wp-emoji', '1' ); } function replaceEmoji( node ) { var imgAttr = { 'data-mce-resize': 'false', 'data-mce-placeholder': '1', 'data-wp-emoji': '1' }; wp.emoji.parse( node, { imgAttr: imgAttr } ); } // Test if the node text contains emoji char(s) and replace. function parseNode( node ) { var selection, bookmark; if ( node && window.twemoji && window.twemoji.test( node.textContent || node.innerText ) ) { if ( env.webkit ) { selection = editor.selection; bookmark = selection.getBookmark(); } replaceEmoji( node ); if ( env.webkit ) { selection.moveToBookmark( bookmark ); } } } if ( isWin8 ) { /* * Windows 8+ emoji can be "typed" with the onscreen keyboard. * That triggers the normal keyboard events, but not the 'input' event. * Thankfully it sets keyCode 231 when the onscreen keyboard inserts any emoji. */ editor.on( 'keyup', function( event ) { if ( event.keyCode === 231 ) { parseNode( editor.selection.getNode() ); } } ); } else if ( ! isWin ) { /* * In MacOS inserting emoji doesn't trigger the stanradr keyboard events. * Thankfully it triggers the 'input' event. * This works in Android and iOS as well. */ editor.on( 'keydown keyup', function( event ) { typing = ( event.type === 'keydown' ); } ); editor.on( 'input', function() { if ( typing ) { return; } parseNode( editor.selection.getNode() ); }); } editor.on( 'setcontent', function( event ) { var selection = editor.selection, node = selection.getNode(); if ( window.twemoji && window.twemoji.test( node.textContent || node.innerText ) ) { replaceEmoji( node ); // In IE all content in the editor is left selected after wp.emoji.parse()... // Collapse the selection to the beginning. if ( env.ie && env.ie < 9 && event.load && node && node.nodeName === 'BODY' ) { selection.collapse( true ); } } } ); // Convert Twemoji compatible pasted emoji replacement images into our format. editor.on( 'PastePostProcess', function( event ) { if ( window.twemoji ) { tinymce.each( editor.dom.$( 'img.emoji', event.node ), function( image ) { if ( image.alt && window.twemoji.test( image.alt ) ) { setImgAttr( image ); } }); } }); editor.on( 'postprocess', function( event ) { if ( event.content ) { event.content = event.content.replace( /<img[^>]+data-wp-emoji="[^>]+>/g, function( img ) { var alt = img.match( /alt="([^"]+)"/ ); if ( alt && alt[1] ) { return alt[1]; } return img; }); } } ); editor.on( 'resolvename', function( event ) { if ( event.target.nodeName === 'IMG' && editor.dom.getAttrib( event.target, 'data-wp-emoji' ) ) { event.preventDefault(); } } ); } ); } )( window.tinymce ); PK D$�Z�C �N N plugins/tabfocus/plugin.min.jsnu �[��� !function(c){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.VK"),m=function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))},v=t.DOM,n=function(e){e.keyCode!==d.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==d.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=f.explode(m(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):v.get(e[0]):":next"===e[1]?u(1):v.get(e[1]))){var t=s.get(o.id||o.name);o.id&&t?t.focus():y.setTimeout(function(){a.webkit||c.window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(t){return/INPUT|TEXTAREA|BUTTON/.test(t.tagName)&&s.get(n.id)&&-1!==t.tabIndex&&function e(t){return"BODY"===t.nodeName||"hidden"!==t.type&&"none"!==t.style.display&&"hidden"!==t.style.visibility&&e(t.parentNode)}(t)}if(o=v.select(":input:enabled,*[tabindex]:not(iframe)"),f.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&v.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",n),a.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};e.add("tabfocus",function(e){i(e)})}(window);PK D$�Z�^�[� � plugins/tabfocus/plugin.jsnu �[��� (function () { var tabfocus = (function (domGlobals) { 'use strict'; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager'); var global$3 = tinymce.util.Tools.resolve('tinymce.Env'); var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay'); var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var global$6 = tinymce.util.Tools.resolve('tinymce.util.VK'); var getTabFocusElements = function (editor) { return editor.getParam('tabfocus_elements', ':prev,:next'); }; var getTabFocus = function (editor) { return editor.getParam('tab_focus', getTabFocusElements(editor)); }; var Settings = { getTabFocus: getTabFocus }; var DOM = global$1.DOM; var tabCancel = function (e) { if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) { e.preventDefault(); } }; var setup = function (editor) { function tabHandler(e) { var x, el, v, i; if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) { return; } function find(direction) { el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); function canSelectRecursive(e) { return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode); } function canSelect(el) { return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el); } global$5.each(el, function (e, i) { if (e.id === editor.id) { x = i; return false; } }); if (direction > 0) { for (i = x + 1; i < el.length; i++) { if (canSelect(el[i])) { return el[i]; } } } else { for (i = x - 1; i >= 0; i--) { if (canSelect(el[i])) { return el[i]; } } } return null; } v = global$5.explode(Settings.getTabFocus(editor)); if (v.length === 1) { v[1] = v[0]; v[0] = ':prev'; } if (e.shiftKey) { if (v[0] === ':prev') { el = find(-1); } else { el = DOM.get(v[0]); } } else { if (v[1] === ':next') { el = find(1); } else { el = DOM.get(v[1]); } } if (el) { var focusEditor = global$2.get(el.id || el.name); if (el.id && focusEditor) { focusEditor.focus(); } else { global$4.setTimeout(function () { if (!global$3.webkit) { domGlobals.window.focus(); } el.focus(); }, 10); } e.preventDefault(); } } editor.on('init', function () { if (editor.inline) { DOM.setAttrib(editor.getBody(), 'tabIndex', null); } editor.on('keyup', tabCancel); if (global$3.gecko) { editor.on('keypress keydown', tabHandler); } else { editor.on('keydown', tabHandler); } }); }; var Keyboard = { setup: setup }; global.add('tabfocus', function (editor) { Keyboard.setup(editor); }); function Plugin () { } return Plugin; }(window)); })(); PK D$�Z����= �= plugins/image/plugin.min.jsnu �[��� !function(l){"use strict";var i,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=function(e){return!1!==e.settings.image_dimensions},u=function(e){return!0===e.settings.image_advtab},m=function(e){return e.getParam("image_prepend_url","")},n=function(e){return e.getParam("image_class_list")},r=function(e){return!1!==e.settings.image_description},a=function(e){return!0===e.settings.image_title},o=function(e){return!0===e.settings.image_caption},c=function(e){return e.getParam("image_list",!1)},s=function(e){return e.getParam("images_upload_url",!1)},g=function(e){return e.getParam("images_upload_handler",!1)},f=function(e){return e.getParam("images_upload_url")},p=function(e){return e.getParam("images_upload_handler")},h=function(e){return e.getParam("images_upload_base_path")},v=function(e){return e.getParam("images_upload_credentials")},b="undefined"!=typeof l.window?l.window:Function("return this;")(),y=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:b,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},x={getOrDie:function(e,t){var n=y(e,t);if(n===undefined||null===n)throw new Error(e+" not available on this browser");return n}},w=tinymce.util.Tools.resolve("tinymce.util.Promise"),C=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=tinymce.util.Tools.resolve("tinymce.util.XHR"),N=function(e,t){return Math.max(parseInt(e,10),parseInt(t,10))},_=function(e,n){var r=l.document.createElement("img");function t(e,t){r.parentNode&&r.parentNode.removeChild(r),n({width:e,height:t})}r.onload=function(){t(N(r.width,r.clientWidth),N(r.height,r.clientHeight))},r.onerror=function(){t(0,0)};var a=r.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left="0px",a.width=a.height="auto",l.document.body.appendChild(r),r.src=e},T=function(e,a,t){return function n(e,r){return r=r||[],C.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=n(e.menu):(t.value=e.value,a(t)),r.push(t)}),r}(e,t||[])},A=function(e){return e&&(e=e.replace(/px$/,"")),e},R=function(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e},I=function(e){if(e.margin){var t=e.margin.split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e},t=function(e,t){var n=c(e);"string"==typeof n?S.send({url:n,success:function(e){t(JSON.parse(e))}}):"function"==typeof n?n(t):t(n)},O=function(e,t,n){function r(){n.onload=n.onerror=null,e.selection&&(e.selection.select(n),e.nodeChanged())}n.onload=function(){t.width||t.height||!d(e)||e.dom.setAttribs(n,{width:n.clientWidth,height:n.clientHeight}),r()},n.onerror=r},L=function(r){return new w(function(e,t){var n=new(x.getOrDie("FileReader"));n.onload=function(){e(n.result)},n.onerror=function(){t(n.error.message)},n.readAsDataURL(r)})},P=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),U=Object.prototype.hasOwnProperty,E=(i=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var a=e[r];for(var o in a)U.call(a,o)&&(n[o]=i(n[o],a[o]))}return n}),k=P.DOM,M=function(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?A(e.style.marginLeft):""},D=function(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?A(e.style.marginTop):""},z=function(e){return e.style.borderWidth?A(e.style.borderWidth):""},B=function(e,t){return e.hasAttribute(t)?e.getAttribute(t):""},H=function(e,t){return e.style[t]?e.style[t]:""},j=function(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName},F=function(e,t,n){e.setAttribute(t,n)},W=function(e){var t,n,r,a;j(e)?(a=(r=e).parentNode,k.insertAfter(r,a),k.remove(a)):(t=e,n=k.create("figure",{"class":"image"}),k.insertAfter(n,t),n.appendChild(t),n.appendChild(k.create("figcaption",{contentEditable:!0},"Caption")),n.contentEditable="false")},J=function(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")},V=function(e,r){return function(e,t,n){e.style[t]?(e.style[t]=R(n),J(e,r)):F(e,t,n)}},G=function(e,t){return e.style[t]?A(e.style[t]):B(e,t)},$=function(e,t){var n=R(t);e.style.marginLeft=n,e.style.marginRight=n},X=function(e,t){var n=R(t);e.style.marginTop=n,e.style.marginBottom=n},q=function(e,t){var n=R(t);e.style.borderWidth=n},K=function(e,t){e.style.borderStyle=t},Q=function(e){return"FIGURE"===e.nodeName},Y=function(e,t){var n=l.document.createElement("img");return F(n,"style",t.style),(M(n)||""!==t.hspace)&&$(n,t.hspace),(D(n)||""!==t.vspace)&&X(n,t.vspace),(z(n)||""!==t.border)&&q(n,t.border),(H(n,"borderStyle")||""!==t.borderStyle)&&K(n,t.borderStyle),e(n.getAttribute("style"))},Z=function(e,t){return{src:B(t,"src"),alt:B(t,"alt"),title:B(t,"title"),width:G(t,"width"),height:G(t,"height"),"class":B(t,"class"),style:e(B(t,"style")),caption:j(t),hspace:M(t),vspace:D(t),border:z(t),borderStyle:H(t,"borderStyle")}},ee=function(e,t,n,r,a){n[r]!==t[r]&&a(e,r,n[r])},te=function(r,a){return function(e,t,n){r(e,n),J(e,a)}},ne=function(e,t,n){var r=Z(e,n);ee(n,r,t,"caption",function(e,t,n){return W(e)}),ee(n,r,t,"src",F),ee(n,r,t,"alt",F),ee(n,r,t,"title",F),ee(n,r,t,"width",V(0,e)),ee(n,r,t,"height",V(0,e)),ee(n,r,t,"class",F),ee(n,r,t,"style",te(function(e,t){return F(e,"style",t)},e)),ee(n,r,t,"hspace",te($,e)),ee(n,r,t,"vspace",te(X,e)),ee(n,r,t,"border",te(q,e)),ee(n,r,t,"borderStyle",te(K,e))},re=function(e,t){var n=e.dom.styles.parse(t),r=I(n),a=e.dom.styles.parse(e.dom.styles.serialize(r));return e.dom.styles.serialize(a)},ae=function(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||t.getAttribute("data-mce-object")||t.getAttribute("data-mce-placeholder"))?null:t},oe=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,function(e){return t.schema.getTextBlockElements()[e.nodeName]},t.getBody());return r?n.split(r,e):e},ie=function(t){var e=ae(t);return e?Z(function(e){return re(t,e)},e):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""}},le=function(t,e){var n=function(e,t){var n=l.document.createElement("img");if(ne(e,E(t,{caption:!1}),n),F(n,"alt",t.alt),t.caption){var r=k.create("figure",{"class":"image"});return r.appendChild(n),r.appendChild(k.create("figcaption",{contentEditable:!0},"Caption")),r.contentEditable="false",r}return n}(function(e){return re(t,e)},e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),Q(r)){var a=oe(t,r);t.selection.select(a)}else t.selection.select(r)},ue=function(e,t){var n=ae(e);n?t.src?function(t,e){var n,r=ae(t);if(ne(function(e){return re(t,e)},e,r),n=r,t.dom.setAttrib(n,"src",n.getAttribute("src")),Q(r.parentNode)){var a=r.parentNode;oe(t,a),t.selection.select(r.parentNode)}else t.selection.select(r),O(t,e,r)}(e,t):function(e,t){if(t){var n=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(n),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}}(e,n):t.src&&le(e,t)},ce=function(n,r){r.find("#style").each(function(e){var t=Y(function(e){return re(n,e)},E({src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""},r.toJSON()));e.value(t)})},se=function(t){return{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:(o=t,function(e){var t=o.dom,n=e.control.rootControl;if(u(o)){var r=n.toJSON(),a=t.parseStyle(r.style);n.find("#vspace").value(""),n.find("#hspace").value(""),((a=I(a))["margin-top"]&&a["margin-bottom"]||a["margin-right"]&&a["margin-left"])&&(a["margin-top"]===a["margin-bottom"]?n.find("#vspace").value(A(a["margin-top"])):n.find("#vspace").value(""),a["margin-right"]===a["margin-left"]?n.find("#hspace").value(A(a["margin-right"])):n.find("#hspace").value("")),a["border-width"]?n.find("#border").value(A(a["border-width"])):n.find("#border").value(""),a["border-style"]?n.find("#borderStyle").value(a["border-style"]):n.find("#borderStyle").value(""),n.find("#style").value(t.serializeStyle(t.parseStyle(t.serializeStyle(a))))}})},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,defaults:{type:"textbox",maxWidth:50,onchange:function(e){ce(t,e.control.rootControl)}},items:[{label:"Vertical space",name:"vspace"},{label:"Border width",name:"border"},{label:"Horizontal space",name:"hspace"},{label:"Border style",type:"listbox",name:"borderStyle",width:90,maxWidth:90,onselect:function(e){ce(t,e.control.rootControl)},values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]};var o},de=function(e,t){e.state.set("oldVal",e.value()),t.state.set("oldVal",t.value())},me=function(e,t){var n=e.find("#width")[0],r=e.find("#height")[0],a=e.find("#constrain")[0];n&&r&&a&&t(n,r,a.checked())},ge=function(e,t,n){var r=e.state.get("oldVal"),a=t.state.get("oldVal"),o=e.value(),i=t.value();n&&r&&a&&o&&i&&(o!==r?(i=Math.round(o/r*i),isNaN(i)||t.value(i)):(o=Math.round(i/a*o),isNaN(o)||e.value(o))),de(e,t)},fe=function(e){me(e,ge)},pe=function(){var e=function(e){fe(e.control.rootControl)};return{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}},he=function(e){me(e,de)},ve=fe,be=function(e){e.meta=e.control.rootControl.toJSON()},ye=function(s,e){var t=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:function(e){var t,n,r,a,o,i,l,u,c;n=s,i=(t=e).meta||{},l=t.control,u=l.rootControl,(c=u.find("#image-list")[0])&&c.value(n.convertURL(l.value(),"src")),C.each(i,function(e,t){u.find("#"+t).value(e)}),i.width||i.height||(r=n.convertURL(l.value(),"src"),a=m(n),o=new RegExp("^(?:[a-z]+:)?//","i"),a&&!o.test(r)&&r.substring(0,a.length)!==a&&(r=a+r),l.value(r),_(n.documentBaseURI.toAbsolute(l.value()),function(e){e.width&&e.height&&d(n)&&(u.find("#width").value(e.width),u.find("#height").value(e.height),he(u))}))},onbeforecall:be},e];return r(s)&&t.push({name:"alt",type:"textbox",label:"Image description"}),a(s)&&t.push({name:"title",type:"textbox",label:"Image Title"}),d(s)&&t.push(pe()),n(s)&&t.push({name:"class",type:"listbox",label:"Class",values:T(n(s),function(e){e.value&&(e.textStyle=function(){return s.formatter.getCssText({inline:"img",classes:[e.value]})})})}),o(s)&&t.push({name:"caption",type:"checkbox",label:"Caption"}),t},xe=function(e,t){return{title:"General",type:"form",items:ye(e,t)}},we=ye,Ce=function(){return x.getOrDie("URL")},Se=function(e){return Ce().createObjectURL(e)},Ne=function(e){Ce().revokeObjectURL(e)},_e=tinymce.util.Tools.resolve("tinymce.ui.Factory"),Te=function(){};function Ae(i){var t=function(e,r,a,t){var o,n;(o=new(x.getOrDie("XMLHttpRequest"))).open("POST",i.url),o.withCredentials=i.credentials,o.upload.onprogress=function(e){t(e.loaded/e.total*100)},o.onerror=function(){a("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){var e,t,n;o.status<200||300<=o.status?a("HTTP Error: "+o.status):(e=JSON.parse(o.responseText))&&"string"==typeof e.location?r((t=i.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):a("Invalid JSON: "+o.responseText)},(n=new l.FormData).append("file",e.blob(),e.filename()),o.send(n)};return i=C.extend({credentials:!1,handler:t},i),{upload:function(e){return i.url||i.handler!==t?(r=e,a=i.handler,new w(function(e,t){try{a(r,e,t,Te)}catch(n){t(n.message)}})):w.reject("Upload url missing from the settings.");var r,a}}}var Re=function(u){return function(e){var t=_e.get("Throbber"),n=e.control.rootControl,r=new t(n.getEl()),a=e.control.value(),o=Se(a),i=Ae({url:f(u),basePath:h(u),credentials:v(u),handler:p(u)}),l=function(){r.hide(),Ne(o)};return r.show(),L(a).then(function(e){var t=u.editorUpload.blobCache.create({blob:a,blobUri:o,name:a.name?a.name.replace(/\.[^\.]+$/,""):null,base64:e.split(",")[1]});return i.upload(t).then(function(e){var t=n.find("#src");return t.value(e),n.find("tabpanel")[0].activateTab(0),t.fire("change"),l(),e})})["catch"](function(e){u.windowManager.alert(e),l()})}},Ie=".jpg,.jpeg,.png,.gif",Oe=function(e){return{title:"Upload",type:"form",layout:"flex",direction:"column",align:"stretch",padding:"20 20 20 20",items:[{type:"container",layout:"flex",direction:"column",align:"center",spacing:10,items:[{text:"Browse for an image",type:"browsebutton",accept:Ie,onchange:Re(e)},{text:"OR",type:"label"}]},{text:"Drop an image here",type:"dropzone",accept:Ie,height:100,onchange:Re(e)}]}};function Le(r){for(var a=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.concat(e);return r.apply(null,n)}}var Pe=function(t,e){var n=e.control.getRoot();ve(n),t.undoManager.transact(function(){var e=E(ie(t),n.toJSON());ue(t,e)}),t.editorUpload.uploadImagesAuto()};function Ue(o){function e(e){var n,t,r=ie(o);if(e&&(t={type:"listbox",label:"Image list",name:"image-list",values:T(e,function(e){e.value=o.convertURL(e.value||e.url,"src")},[{text:"None",value:""}]),value:r.src&&o.convertURL(r.src,"src"),onselect:function(e){var t=n.find("#alt");(!t.value()||e.lastControl&&t.value()===e.lastControl.text())&&t.value(e.control.text()),n.find("#src").value(e.control.value()).fire("change")},onPostRender:function(){t=this}}),u(o)||s(o)||g(o)){var a=[xe(o,t)];u(o)&&a.push(se(o)),(s(o)||g(o))&&a.push(Oe(o)),n=o.windowManager.open({title:"Insert/edit image",data:r,bodyType:"tabpanel",body:a,onSubmit:Le(Pe,o)})}else n=o.windowManager.open({title:"Insert/edit image",data:r,body:we(o,t),onSubmit:Le(Pe,o)});he(n)}return{open:function(){t(o,e)}}}var Ee=function(e){e.addCommand("mceImage",Ue(e).open)},ke=function(o){return function(e){for(var t,n,r=e.length,a=function(e){e.attr("contenteditable",o?"true":null)};r--;)t=e[r],(n=t.attr("class"))&&/\bimage\b/.test(n)&&(t.attr("contenteditable",o?"false":null),C.each(t.getAll("figcaption"),a))}},Me=function(e){e.on("preInit",function(){e.parser.addNodeFilter("figure",ke(!0)),e.serializer.addNodeFilter("figure",ke(!1))})},De=function(e){e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:Ue(e).open,stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),e.addMenuItem("image",{icon:"image",text:"Image",onclick:Ue(e).open,context:"insert",prependToContext:!0})};e.add("image",function(e){Me(e),De(e),Ee(e)})}(window);PK D$�Z[��#V� V� plugins/image/plugin.jsnu �[��� (function () { var image = (function (domGlobals) { 'use strict'; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var hasDimensions = function (editor) { return editor.settings.image_dimensions === false ? false : true; }; var hasAdvTab = function (editor) { return editor.settings.image_advtab === true ? true : false; }; var getPrependUrl = function (editor) { return editor.getParam('image_prepend_url', ''); }; var getClassList = function (editor) { return editor.getParam('image_class_list'); }; var hasDescription = function (editor) { return editor.settings.image_description === false ? false : true; }; var hasImageTitle = function (editor) { return editor.settings.image_title === true ? true : false; }; var hasImageCaption = function (editor) { return editor.settings.image_caption === true ? true : false; }; var getImageList = function (editor) { return editor.getParam('image_list', false); }; var hasUploadUrl = function (editor) { return editor.getParam('images_upload_url', false); }; var hasUploadHandler = function (editor) { return editor.getParam('images_upload_handler', false); }; var getUploadUrl = function (editor) { return editor.getParam('images_upload_url'); }; var getUploadHandler = function (editor) { return editor.getParam('images_upload_handler'); }; var getUploadBasePath = function (editor) { return editor.getParam('images_upload_base_path'); }; var getUploadCredentials = function (editor) { return editor.getParam('images_upload_credentials'); }; var Settings = { hasDimensions: hasDimensions, hasAdvTab: hasAdvTab, getPrependUrl: getPrependUrl, getClassList: getClassList, hasDescription: hasDescription, hasImageTitle: hasImageTitle, hasImageCaption: hasImageCaption, getImageList: getImageList, hasUploadUrl: hasUploadUrl, hasUploadHandler: hasUploadHandler, getUploadUrl: getUploadUrl, getUploadHandler: getUploadHandler, getUploadBasePath: getUploadBasePath, getUploadCredentials: getUploadCredentials }; var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); var path = function (parts, scope) { var o = scope !== undefined && scope !== null ? scope : Global; for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) { o = o[parts[i]]; } return o; }; var resolve = function (p, scope) { var parts = p.split('.'); return path(parts, scope); }; var unsafe = function (name, scope) { return resolve(name, scope); }; var getOrDie = function (name, scope) { var actual = unsafe(name, scope); if (actual === undefined || actual === null) { throw new Error(name + ' not available on this browser'); } return actual; }; var Global$1 = { getOrDie: getOrDie }; function FileReader () { var f = Global$1.getOrDie('FileReader'); return new f(); } var global$1 = tinymce.util.Tools.resolve('tinymce.util.Promise'); var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var global$3 = tinymce.util.Tools.resolve('tinymce.util.XHR'); var parseIntAndGetMax = function (val1, val2) { return Math.max(parseInt(val1, 10), parseInt(val2, 10)); }; var getImageSize = function (url, callback) { var img = domGlobals.document.createElement('img'); function done(width, height) { if (img.parentNode) { img.parentNode.removeChild(img); } callback({ width: width, height: height }); } img.onload = function () { var width = parseIntAndGetMax(img.width, img.clientWidth); var height = parseIntAndGetMax(img.height, img.clientHeight); done(width, height); }; img.onerror = function () { done(0, 0); }; var style = img.style; style.visibility = 'hidden'; style.position = 'fixed'; style.bottom = style.left = '0px'; style.width = style.height = 'auto'; domGlobals.document.body.appendChild(img); img.src = url; }; var buildListItems = function (inputList, itemCallback, startItems) { function appendItems(values, output) { output = output || []; global$2.each(values, function (item) { var menuItem = { text: item.text || item.title }; if (item.menu) { menuItem.menu = appendItems(item.menu); } else { menuItem.value = item.value; itemCallback(menuItem); } output.push(menuItem); }); return output; } return appendItems(inputList, startItems || []); }; var removePixelSuffix = function (value) { if (value) { value = value.replace(/px$/, ''); } return value; }; var addPixelSuffix = function (value) { if (value.length > 0 && /^[0-9]+$/.test(value)) { value += 'px'; } return value; }; var mergeMargins = function (css) { if (css.margin) { var splitMargin = css.margin.split(' '); switch (splitMargin.length) { case 1: css['margin-top'] = css['margin-top'] || splitMargin[0]; css['margin-right'] = css['margin-right'] || splitMargin[0]; css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; css['margin-left'] = css['margin-left'] || splitMargin[0]; break; case 2: css['margin-top'] = css['margin-top'] || splitMargin[0]; css['margin-right'] = css['margin-right'] || splitMargin[1]; css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; css['margin-left'] = css['margin-left'] || splitMargin[1]; break; case 3: css['margin-top'] = css['margin-top'] || splitMargin[0]; css['margin-right'] = css['margin-right'] || splitMargin[1]; css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; css['margin-left'] = css['margin-left'] || splitMargin[1]; break; case 4: css['margin-top'] = css['margin-top'] || splitMargin[0]; css['margin-right'] = css['margin-right'] || splitMargin[1]; css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; css['margin-left'] = css['margin-left'] || splitMargin[3]; } delete css.margin; } return css; }; var createImageList = function (editor, callback) { var imageList = Settings.getImageList(editor); if (typeof imageList === 'string') { global$3.send({ url: imageList, success: function (text) { callback(JSON.parse(text)); } }); } else if (typeof imageList === 'function') { imageList(callback); } else { callback(imageList); } }; var waitLoadImage = function (editor, data, imgElm) { function selectImage() { imgElm.onload = imgElm.onerror = null; if (editor.selection) { editor.selection.select(imgElm); editor.nodeChanged(); } } imgElm.onload = function () { if (!data.width && !data.height && Settings.hasDimensions(editor)) { editor.dom.setAttribs(imgElm, { width: imgElm.clientWidth, height: imgElm.clientHeight }); } selectImage(); }; imgElm.onerror = selectImage; }; var blobToDataUri = function (blob) { return new global$1(function (resolve, reject) { var reader = FileReader(); reader.onload = function () { resolve(reader.result); }; reader.onerror = function () { reject(reader.error.message); }; reader.readAsDataURL(blob); }); }; var Utils = { getImageSize: getImageSize, buildListItems: buildListItems, removePixelSuffix: removePixelSuffix, addPixelSuffix: addPixelSuffix, mergeMargins: mergeMargins, createImageList: createImageList, waitLoadImage: waitLoadImage, blobToDataUri: blobToDataUri }; var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); var hasOwnProperty = Object.prototype.hasOwnProperty; var shallow = function (old, nu) { return nu; }; var baseMerge = function (merger) { return function () { var objects = new Array(arguments.length); for (var i = 0; i < objects.length; i++) { objects[i] = arguments[i]; } if (objects.length === 0) { throw new Error('Can\'t merge zero objects'); } var ret = {}; for (var j = 0; j < objects.length; j++) { var curObject = objects[j]; for (var key in curObject) { if (hasOwnProperty.call(curObject, key)) { ret[key] = merger(ret[key], curObject[key]); } } } return ret; }; }; var merge = baseMerge(shallow); var DOM = global$4.DOM; var getHspace = function (image) { if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) { return Utils.removePixelSuffix(image.style.marginLeft); } else { return ''; } }; var getVspace = function (image) { if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) { return Utils.removePixelSuffix(image.style.marginTop); } else { return ''; } }; var getBorder = function (image) { if (image.style.borderWidth) { return Utils.removePixelSuffix(image.style.borderWidth); } else { return ''; } }; var getAttrib = function (image, name) { if (image.hasAttribute(name)) { return image.getAttribute(name); } else { return ''; } }; var getStyle = function (image, name) { return image.style[name] ? image.style[name] : ''; }; var hasCaption = function (image) { return image.parentNode !== null && image.parentNode.nodeName === 'FIGURE'; }; var setAttrib = function (image, name, value) { image.setAttribute(name, value); }; var wrapInFigure = function (image) { var figureElm = DOM.create('figure', { class: 'image' }); DOM.insertAfter(figureElm, image); figureElm.appendChild(image); figureElm.appendChild(DOM.create('figcaption', { contentEditable: true }, 'Caption')); figureElm.contentEditable = 'false'; }; var removeFigure = function (image) { var figureElm = image.parentNode; DOM.insertAfter(image, figureElm); DOM.remove(figureElm); }; var toggleCaption = function (image) { if (hasCaption(image)) { removeFigure(image); } else { wrapInFigure(image); } }; var normalizeStyle = function (image, normalizeCss) { var attrValue = image.getAttribute('style'); var value = normalizeCss(attrValue !== null ? attrValue : ''); if (value.length > 0) { image.setAttribute('style', value); image.setAttribute('data-mce-style', value); } else { image.removeAttribute('style'); } }; var setSize = function (name, normalizeCss) { return function (image, name, value) { if (image.style[name]) { image.style[name] = Utils.addPixelSuffix(value); normalizeStyle(image, normalizeCss); } else { setAttrib(image, name, value); } }; }; var getSize = function (image, name) { if (image.style[name]) { return Utils.removePixelSuffix(image.style[name]); } else { return getAttrib(image, name); } }; var setHspace = function (image, value) { var pxValue = Utils.addPixelSuffix(value); image.style.marginLeft = pxValue; image.style.marginRight = pxValue; }; var setVspace = function (image, value) { var pxValue = Utils.addPixelSuffix(value); image.style.marginTop = pxValue; image.style.marginBottom = pxValue; }; var setBorder = function (image, value) { var pxValue = Utils.addPixelSuffix(value); image.style.borderWidth = pxValue; }; var setBorderStyle = function (image, value) { image.style.borderStyle = value; }; var getBorderStyle = function (image) { return getStyle(image, 'borderStyle'); }; var isFigure = function (elm) { return elm.nodeName === 'FIGURE'; }; var defaultData = function () { return { src: '', alt: '', title: '', width: '', height: '', class: '', style: '', caption: false, hspace: '', vspace: '', border: '', borderStyle: '' }; }; var getStyleValue = function (normalizeCss, data) { var image = domGlobals.document.createElement('img'); setAttrib(image, 'style', data.style); if (getHspace(image) || data.hspace !== '') { setHspace(image, data.hspace); } if (getVspace(image) || data.vspace !== '') { setVspace(image, data.vspace); } if (getBorder(image) || data.border !== '') { setBorder(image, data.border); } if (getBorderStyle(image) || data.borderStyle !== '') { setBorderStyle(image, data.borderStyle); } return normalizeCss(image.getAttribute('style')); }; var create = function (normalizeCss, data) { var image = domGlobals.document.createElement('img'); write(normalizeCss, merge(data, { caption: false }), image); setAttrib(image, 'alt', data.alt); if (data.caption) { var figure = DOM.create('figure', { class: 'image' }); figure.appendChild(image); figure.appendChild(DOM.create('figcaption', { contentEditable: true }, 'Caption')); figure.contentEditable = 'false'; return figure; } else { return image; } }; var read = function (normalizeCss, image) { return { src: getAttrib(image, 'src'), alt: getAttrib(image, 'alt'), title: getAttrib(image, 'title'), width: getSize(image, 'width'), height: getSize(image, 'height'), class: getAttrib(image, 'class'), style: normalizeCss(getAttrib(image, 'style')), caption: hasCaption(image), hspace: getHspace(image), vspace: getVspace(image), border: getBorder(image), borderStyle: getStyle(image, 'borderStyle') }; }; var updateProp = function (image, oldData, newData, name, set) { if (newData[name] !== oldData[name]) { set(image, name, newData[name]); } }; var normalized = function (set, normalizeCss) { return function (image, name, value) { set(image, value); normalizeStyle(image, normalizeCss); }; }; var write = function (normalizeCss, newData, image) { var oldData = read(normalizeCss, image); updateProp(image, oldData, newData, 'caption', function (image, _name, _value) { return toggleCaption(image); }); updateProp(image, oldData, newData, 'src', setAttrib); updateProp(image, oldData, newData, 'alt', setAttrib); updateProp(image, oldData, newData, 'title', setAttrib); updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss)); updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss)); updateProp(image, oldData, newData, 'class', setAttrib); updateProp(image, oldData, newData, 'style', normalized(function (image, value) { return setAttrib(image, 'style', value); }, normalizeCss)); updateProp(image, oldData, newData, 'hspace', normalized(setHspace, normalizeCss)); updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss)); updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss)); updateProp(image, oldData, newData, 'borderStyle', normalized(setBorderStyle, normalizeCss)); }; var normalizeCss = function (editor, cssText) { var css = editor.dom.styles.parse(cssText); var mergedCss = Utils.mergeMargins(css); var compressed = editor.dom.styles.parse(editor.dom.styles.serialize(mergedCss)); return editor.dom.styles.serialize(compressed); }; var getSelectedImage = function (editor) { var imgElm = editor.selection.getNode(); var figureElm = editor.dom.getParent(imgElm, 'figure.image'); if (figureElm) { return editor.dom.select('img', figureElm)[0]; } if (imgElm && (imgElm.nodeName !== 'IMG' || imgElm.getAttribute('data-mce-object') || imgElm.getAttribute('data-mce-placeholder'))) { return null; } return imgElm; }; var splitTextBlock = function (editor, figure) { var dom = editor.dom; var textBlock = dom.getParent(figure.parentNode, function (node) { return editor.schema.getTextBlockElements()[node.nodeName]; }, editor.getBody()); if (textBlock) { return dom.split(textBlock, figure); } else { return figure; } }; var readImageDataFromSelection = function (editor) { var image = getSelectedImage(editor); return image ? read(function (css) { return normalizeCss(editor, css); }, image) : defaultData(); }; var insertImageAtCaret = function (editor, data) { var elm = create(function (css) { return normalizeCss(editor, css); }, data); editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew'); editor.focus(); editor.selection.setContent(elm.outerHTML); var insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0]; editor.dom.setAttrib(insertedElm, 'data-mce-id', null); if (isFigure(insertedElm)) { var figure = splitTextBlock(editor, insertedElm); editor.selection.select(figure); } else { editor.selection.select(insertedElm); } }; var syncSrcAttr = function (editor, image) { editor.dom.setAttrib(image, 'src', image.getAttribute('src')); }; var deleteImage = function (editor, image) { if (image) { var elm = editor.dom.is(image.parentNode, 'figure.image') ? image.parentNode : image; editor.dom.remove(elm); editor.focus(); editor.nodeChanged(); if (editor.dom.isEmpty(editor.getBody())) { editor.setContent(''); editor.selection.setCursorLocation(); } } }; var writeImageDataToSelection = function (editor, data) { var image = getSelectedImage(editor); write(function (css) { return normalizeCss(editor, css); }, data, image); syncSrcAttr(editor, image); if (isFigure(image.parentNode)) { var figure = image.parentNode; splitTextBlock(editor, figure); editor.selection.select(image.parentNode); } else { editor.selection.select(image); Utils.waitLoadImage(editor, data, image); } }; var insertOrUpdateImage = function (editor, data) { var image = getSelectedImage(editor); if (image) { if (data.src) { writeImageDataToSelection(editor, data); } else { deleteImage(editor, image); } } else if (data.src) { insertImageAtCaret(editor, data); } }; var updateVSpaceHSpaceBorder = function (editor) { return function (evt) { var dom = editor.dom; var rootControl = evt.control.rootControl; if (!Settings.hasAdvTab(editor)) { return; } var data = rootControl.toJSON(); var css = dom.parseStyle(data.style); rootControl.find('#vspace').value(''); rootControl.find('#hspace').value(''); css = Utils.mergeMargins(css); if (css['margin-top'] && css['margin-bottom'] || css['margin-right'] && css['margin-left']) { if (css['margin-top'] === css['margin-bottom']) { rootControl.find('#vspace').value(Utils.removePixelSuffix(css['margin-top'])); } else { rootControl.find('#vspace').value(''); } if (css['margin-right'] === css['margin-left']) { rootControl.find('#hspace').value(Utils.removePixelSuffix(css['margin-right'])); } else { rootControl.find('#hspace').value(''); } } if (css['border-width']) { rootControl.find('#border').value(Utils.removePixelSuffix(css['border-width'])); } else { rootControl.find('#border').value(''); } if (css['border-style']) { rootControl.find('#borderStyle').value(css['border-style']); } else { rootControl.find('#borderStyle').value(''); } rootControl.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css)))); }; }; var updateStyle = function (editor, win) { win.find('#style').each(function (ctrl) { var value = getStyleValue(function (css) { return normalizeCss(editor, css); }, merge(defaultData(), win.toJSON())); ctrl.value(value); }); }; var makeTab = function (editor) { return { title: 'Advanced', type: 'form', pack: 'start', items: [ { label: 'Style', name: 'style', type: 'textbox', onchange: updateVSpaceHSpaceBorder(editor) }, { type: 'form', layout: 'grid', packV: 'start', columns: 2, padding: 0, defaults: { type: 'textbox', maxWidth: 50, onchange: function (evt) { updateStyle(editor, evt.control.rootControl); } }, items: [ { label: 'Vertical space', name: 'vspace' }, { label: 'Border width', name: 'border' }, { label: 'Horizontal space', name: 'hspace' }, { label: 'Border style', type: 'listbox', name: 'borderStyle', width: 90, maxWidth: 90, onselect: function (evt) { updateStyle(editor, evt.control.rootControl); }, values: [ { text: 'Select...', value: '' }, { text: 'Solid', value: 'solid' }, { text: 'Dotted', value: 'dotted' }, { text: 'Dashed', value: 'dashed' }, { text: 'Double', value: 'double' }, { text: 'Groove', value: 'groove' }, { text: 'Ridge', value: 'ridge' }, { text: 'Inset', value: 'inset' }, { text: 'Outset', value: 'outset' }, { text: 'None', value: 'none' }, { text: 'Hidden', value: 'hidden' } ] } ] } ] }; }; var AdvTab = { makeTab: makeTab }; var doSyncSize = function (widthCtrl, heightCtrl) { widthCtrl.state.set('oldVal', widthCtrl.value()); heightCtrl.state.set('oldVal', heightCtrl.value()); }; var doSizeControls = function (win, f) { var widthCtrl = win.find('#width')[0]; var heightCtrl = win.find('#height')[0]; var constrained = win.find('#constrain')[0]; if (widthCtrl && heightCtrl && constrained) { f(widthCtrl, heightCtrl, constrained.checked()); } }; var doUpdateSize = function (widthCtrl, heightCtrl, isContrained) { var oldWidth = widthCtrl.state.get('oldVal'); var oldHeight = heightCtrl.state.get('oldVal'); var newWidth = widthCtrl.value(); var newHeight = heightCtrl.value(); if (isContrained && oldWidth && oldHeight && newWidth && newHeight) { if (newWidth !== oldWidth) { newHeight = Math.round(newWidth / oldWidth * newHeight); if (!isNaN(newHeight)) { heightCtrl.value(newHeight); } } else { newWidth = Math.round(newHeight / oldHeight * newWidth); if (!isNaN(newWidth)) { widthCtrl.value(newWidth); } } } doSyncSize(widthCtrl, heightCtrl); }; var syncSize = function (win) { doSizeControls(win, doSyncSize); }; var updateSize = function (win) { doSizeControls(win, doUpdateSize); }; var createUi = function () { var recalcSize = function (evt) { updateSize(evt.control.rootControl); }; return { type: 'container', label: 'Dimensions', layout: 'flex', align: 'center', spacing: 5, items: [ { name: 'width', type: 'textbox', maxLength: 5, size: 5, onchange: recalcSize, ariaLabel: 'Width' }, { type: 'label', text: 'x' }, { name: 'height', type: 'textbox', maxLength: 5, size: 5, onchange: recalcSize, ariaLabel: 'Height' }, { name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions' } ] }; }; var SizeManager = { createUi: createUi, syncSize: syncSize, updateSize: updateSize }; var onSrcChange = function (evt, editor) { var srcURL, prependURL, absoluteURLPattern; var meta = evt.meta || {}; var control = evt.control; var rootControl = control.rootControl; var imageListCtrl = rootControl.find('#image-list')[0]; if (imageListCtrl) { imageListCtrl.value(editor.convertURL(control.value(), 'src')); } global$2.each(meta, function (value, key) { rootControl.find('#' + key).value(value); }); if (!meta.width && !meta.height) { srcURL = editor.convertURL(control.value(), 'src'); prependURL = Settings.getPrependUrl(editor); absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i'); if (prependURL && !absoluteURLPattern.test(srcURL) && srcURL.substring(0, prependURL.length) !== prependURL) { srcURL = prependURL + srcURL; } control.value(srcURL); Utils.getImageSize(editor.documentBaseURI.toAbsolute(control.value()), function (data) { if (data.width && data.height && Settings.hasDimensions(editor)) { rootControl.find('#width').value(data.width); rootControl.find('#height').value(data.height); SizeManager.syncSize(rootControl); } }); } }; var onBeforeCall = function (evt) { evt.meta = evt.control.rootControl.toJSON(); }; var getGeneralItems = function (editor, imageListCtrl) { var generalFormItems = [ { name: 'src', type: 'filepicker', filetype: 'image', label: 'Source', autofocus: true, onchange: function (evt) { onSrcChange(evt, editor); }, onbeforecall: onBeforeCall }, imageListCtrl ]; if (Settings.hasDescription(editor)) { generalFormItems.push({ name: 'alt', type: 'textbox', label: 'Image description' }); } if (Settings.hasImageTitle(editor)) { generalFormItems.push({ name: 'title', type: 'textbox', label: 'Image Title' }); } if (Settings.hasDimensions(editor)) { generalFormItems.push(SizeManager.createUi()); } if (Settings.getClassList(editor)) { generalFormItems.push({ name: 'class', type: 'listbox', label: 'Class', values: Utils.buildListItems(Settings.getClassList(editor), function (item) { if (item.value) { item.textStyle = function () { return editor.formatter.getCssText({ inline: 'img', classes: [item.value] }); }; } }) }); } if (Settings.hasImageCaption(editor)) { generalFormItems.push({ name: 'caption', type: 'checkbox', label: 'Caption' }); } return generalFormItems; }; var makeTab$1 = function (editor, imageListCtrl) { return { title: 'General', type: 'form', items: getGeneralItems(editor, imageListCtrl) }; }; var MainTab = { makeTab: makeTab$1, getGeneralItems: getGeneralItems }; var url = function () { return Global$1.getOrDie('URL'); }; var createObjectURL = function (blob) { return url().createObjectURL(blob); }; var revokeObjectURL = function (u) { url().revokeObjectURL(u); }; var URL = { createObjectURL: createObjectURL, revokeObjectURL: revokeObjectURL }; var global$5 = tinymce.util.Tools.resolve('tinymce.ui.Factory'); function XMLHttpRequest () { var f = Global$1.getOrDie('XMLHttpRequest'); return new f(); } var noop = function () { }; var pathJoin = function (path1, path2) { if (path1) { return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, ''); } return path2; }; function Uploader (settings) { var defaultHandler = function (blobInfo, success, failure, progress) { var xhr, formData; xhr = XMLHttpRequest(); xhr.open('POST', settings.url); xhr.withCredentials = settings.credentials; xhr.upload.onprogress = function (e) { progress(e.loaded / e.total * 100); }; xhr.onerror = function () { failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status); }; xhr.onload = function () { var json; if (xhr.status < 200 || xhr.status >= 300) { failure('HTTP Error: ' + xhr.status); return; } json = JSON.parse(xhr.responseText); if (!json || typeof json.location !== 'string') { failure('Invalid JSON: ' + xhr.responseText); return; } success(pathJoin(settings.basePath, json.location)); }; formData = new domGlobals.FormData(); formData.append('file', blobInfo.blob(), blobInfo.filename()); xhr.send(formData); }; var uploadBlob = function (blobInfo, handler) { return new global$1(function (resolve, reject) { try { handler(blobInfo, resolve, reject, noop); } catch (ex) { reject(ex.message); } }); }; var isDefaultHandler = function (handler) { return handler === defaultHandler; }; var upload = function (blobInfo) { return !settings.url && isDefaultHandler(settings.handler) ? global$1.reject('Upload url missing from the settings.') : uploadBlob(blobInfo, settings.handler); }; settings = global$2.extend({ credentials: false, handler: defaultHandler }, settings); return { upload: upload }; } var onFileInput = function (editor) { return function (evt) { var Throbber = global$5.get('Throbber'); var rootControl = evt.control.rootControl; var throbber = new Throbber(rootControl.getEl()); var file = evt.control.value(); var blobUri = URL.createObjectURL(file); var uploader = Uploader({ url: Settings.getUploadUrl(editor), basePath: Settings.getUploadBasePath(editor), credentials: Settings.getUploadCredentials(editor), handler: Settings.getUploadHandler(editor) }); var finalize = function () { throbber.hide(); URL.revokeObjectURL(blobUri); }; throbber.show(); return Utils.blobToDataUri(file).then(function (dataUrl) { var blobInfo = editor.editorUpload.blobCache.create({ blob: file, blobUri: blobUri, name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null, base64: dataUrl.split(',')[1] }); return uploader.upload(blobInfo).then(function (url) { var src = rootControl.find('#src'); src.value(url); rootControl.find('tabpanel')[0].activateTab(0); src.fire('change'); finalize(); return url; }); }).catch(function (err) { editor.windowManager.alert(err); finalize(); }); }; }; var acceptExts = '.jpg,.jpeg,.png,.gif'; var makeTab$2 = function (editor) { return { title: 'Upload', type: 'form', layout: 'flex', direction: 'column', align: 'stretch', padding: '20 20 20 20', items: [ { type: 'container', layout: 'flex', direction: 'column', align: 'center', spacing: 10, items: [ { text: 'Browse for an image', type: 'browsebutton', accept: acceptExts, onchange: onFileInput(editor) }, { text: 'OR', type: 'label' } ] }, { text: 'Drop an image here', type: 'dropzone', accept: acceptExts, height: 100, onchange: onFileInput(editor) } ] }; }; var UploadTab = { makeTab: makeTab$2 }; function curry(fn) { var initialArgs = []; for (var _i = 1; _i < arguments.length; _i++) { initialArgs[_i - 1] = arguments[_i]; } return function () { var restArgs = []; for (var _i = 0; _i < arguments.length; _i++) { restArgs[_i] = arguments[_i]; } var all = initialArgs.concat(restArgs); return fn.apply(null, all); }; } var submitForm = function (editor, evt) { var win = evt.control.getRoot(); SizeManager.updateSize(win); editor.undoManager.transact(function () { var data = merge(readImageDataFromSelection(editor), win.toJSON()); insertOrUpdateImage(editor, data); }); editor.editorUpload.uploadImagesAuto(); }; function Dialog (editor) { function showDialog(imageList) { var data = readImageDataFromSelection(editor); var win, imageListCtrl; if (imageList) { imageListCtrl = { type: 'listbox', label: 'Image list', name: 'image-list', values: Utils.buildListItems(imageList, function (item) { item.value = editor.convertURL(item.value || item.url, 'src'); }, [{ text: 'None', value: '' }]), value: data.src && editor.convertURL(data.src, 'src'), onselect: function (e) { var altCtrl = win.find('#alt'); if (!altCtrl.value() || e.lastControl && altCtrl.value() === e.lastControl.text()) { altCtrl.value(e.control.text()); } win.find('#src').value(e.control.value()).fire('change'); }, onPostRender: function () { imageListCtrl = this; } }; } if (Settings.hasAdvTab(editor) || Settings.hasUploadUrl(editor) || Settings.hasUploadHandler(editor)) { var body = [MainTab.makeTab(editor, imageListCtrl)]; if (Settings.hasAdvTab(editor)) { body.push(AdvTab.makeTab(editor)); } if (Settings.hasUploadUrl(editor) || Settings.hasUploadHandler(editor)) { body.push(UploadTab.makeTab(editor)); } win = editor.windowManager.open({ title: 'Insert/edit image', data: data, bodyType: 'tabpanel', body: body, onSubmit: curry(submitForm, editor) }); } else { win = editor.windowManager.open({ title: 'Insert/edit image', data: data, body: MainTab.getGeneralItems(editor, imageListCtrl), onSubmit: curry(submitForm, editor) }); } SizeManager.syncSize(win); } function open() { Utils.createImageList(editor, showDialog); } return { open: open }; } var register = function (editor) { editor.addCommand('mceImage', Dialog(editor).open); }; var Commands = { register: register }; var hasImageClass = function (node) { var className = node.attr('class'); return className && /\bimage\b/.test(className); }; var toggleContentEditableState = function (state) { return function (nodes) { var i = nodes.length, node; var toggleContentEditable = function (node) { node.attr('contenteditable', state ? 'true' : null); }; while (i--) { node = nodes[i]; if (hasImageClass(node)) { node.attr('contenteditable', state ? 'false' : null); global$2.each(node.getAll('figcaption'), toggleContentEditable); } } }; }; var setup = function (editor) { editor.on('preInit', function () { editor.parser.addNodeFilter('figure', toggleContentEditableState(true)); editor.serializer.addNodeFilter('figure', toggleContentEditableState(false)); }); }; var FilterContent = { setup: setup }; var register$1 = function (editor) { editor.addButton('image', { icon: 'image', tooltip: 'Insert/edit image', onclick: Dialog(editor).open, stateSelector: 'img:not([data-mce-object],[data-mce-placeholder]),figure.image' }); editor.addMenuItem('image', { icon: 'image', text: 'Image', onclick: Dialog(editor).open, context: 'insert', prependToContext: true }); }; var Buttons = { register: register$1 }; global.add('image', function (editor) { FilterContent.setup(editor); Buttons.register(editor); Commands.register(editor); }); function Plugin () { } return Plugin; }(window)); })(); PK D$�Z�\u�# # plugins/wplink/plugin.min.jsnu �[��� !function(L){L.ui.Factory.add("WPLinkPreview",L.ui.Control.extend({url:"#",renderHtml:function(){return'<div id="'+this._id+'" class="wp-link-preview"><a href="'+this.url+'" target="_blank" tabindex="-1">'+this.url+"</a></div>"},setURL:function(e){var t,n;this.url!==e&&(this.url=e,40<(e=""===(e="/"===(e=(e=-1!==(t=(e=-1!==(t=(e=(e=window.decodeURIComponent(e)).replace(/^(?:https?:)?\/\/(?:www\.)?/,"")).indexOf("?"))?e.slice(0,t):e).indexOf("#"))?e.slice(0,t):e).replace(/(?:index)?\.html$/,"")).charAt(e.length-1)?e.slice(0,-1):e)?this.url:e).length&&-1!==(t=e.indexOf("/"))&&-1!==(n=e.lastIndexOf("/"))&&n!==t&&(t+e.length-n<40&&(n=-(40-(t+1))),e=e.slice(0,t+1)+"\u2026"+e.slice(n)),L.$(this.getEl().firstChild).attr("href",this.url).text(e))}})),L.ui.Factory.add("WPLinkInput",L.ui.Control.extend({renderHtml:function(){return'<div id="'+this._id+'" class="wp-link-input"><label for="'+this._id+'_label">'+L.translate("Paste URL or type to search")+'</label><input id="'+this._id+'_label" type="text" value="" /><input type="text" style="display:none" value="" /></div>'},setURL:function(e){this.getEl().firstChild.nextSibling.value=e},getURL:function(){return L.trim(this.getEl().firstChild.nextSibling.value)},getLinkText:function(){var e=this.getEl().firstChild.nextSibling.nextSibling.value;return L.trim(e)?e.replace(/[\r\n\t ]+/g," "):""},reset:function(){var e=this.getEl().firstChild.nextSibling;e.value="",e.nextSibling.value=""}})),L.PluginManager.add("wplink",function(l){var a,r,d,c,i,n,t,p=window.jQuery,o=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i,s=/^https?:\/\/([^\s/?.#-][^\s\/?.#]*\.?)+(\/[^\s"]*)?$/i,u=/^https?:\/\/[^\/]+\.[^\/]+($|\/)/i,w=void 0!==window.wp&&window.wp.a11y&&window.wp.a11y.speak?window.wp.a11y.speak:function(){},k=!1,m=window.wp.i18n.__,f=window.wp.i18n._n,h=window.wp.i18n.sprintf;function _(){l.$("a").each(function(e,t){var n=l.$(t);"_wp_link_placeholder"===n.attr("href")?l.dom.remove(t,!0):n.attr("data-wplink-edit")&&n.attr("data-wplink-edit",null)})}function v(e,i){return e.replace(/(<a [^>]+>)([\s\S]*?)<\/a>/g,function(e,t,n){return-1<t.indexOf(' href="_wp_link_placeholder"')?n:(t=(t=i?t.replace(/ data-wplink-edit="true"/g,""):t).replace(/ data-wplink-url-error="true"/g,""))+n+"</a>"})}function g(e){var e=l.$(e),t=e.attr("href");t&&void 0!==p&&(k=!1,!/^http/i.test(t)||s.test(t)&&u.test(t)?e.removeAttr("data-wplink-url-error"):(k=!0,e.attr("data-wplink-url-error","true"),w(l.translate("Warning: the link has been inserted but may have errors. Please test it."),"assertive")))}return l.on("preinit",function(){var e;l.wp&&l.wp._createToolbar&&(a=l.wp._createToolbar(["wp_link_preview","wp_link_edit","wp_link_remove"],!0),e=["wp_link_input","wp_link_apply"],void 0!==window.wpLink&&e.push("wp_link_advanced"),(r=l.wp._createToolbar(e,!0)).on("show",function(){void 0!==window.wpLink&&window.wpLink.modalOpen||window.setTimeout(function(){var e=r.$el.find("input.ui-autocomplete-input")[0],t=i&&(i.textContent||i.innerText);e&&(!e.value&&t&&void 0!==window.wpLink&&(e.value=window.wpLink.getUrlFromSelection(t)),n||(e.focus(),e.select()))})}),r.on("hide",function(){r.scrolling||l.execCommand("wp_link_cancel")}))}),l.addCommand("WP_Link",function(){var e,t,n;L.Env.ie&&L.Env.ie<10&&void 0!==window.wpLink?window.wpLink.open(l.id):(t=l.selection.getStart(),(n=l.dom.getParent(t,"a[href]"))||(e=l.selection.getContent({format:"raw"}))&&-1!==e.indexOf("</a>")&&(n=(e=e.match(/href="([^">]+)"/))&&e[1]?l.$('a[href="'+e[1]+'"]',t)[0]:n)&&l.selection.select(n),i=n,r.tempHide=!1,i||(_(),l.execCommand("mceInsertLink",!1,{href:"_wp_link_placeholder"}),i=l.$('a[href="_wp_link_placeholder"]')[0],l.nodeChanged()),l.dom.setAttribs(i,{"data-wplink-edit":!0}))}),l.addCommand("wp_link_apply",function(){if(!r.scrolling){var e,t;if(i){e=c.getURL(),t=c.getLinkText(),l.focus();var n=document.createElement("a");if(n.href=e,!(e="javascript:"!==n.protocol&&"data:"!==n.protocol?e:""))return void l.dom.remove(i,!0);/^(?:[a-z]+:|#|\?|\.|\/)/.test(e)||o.test(e)||(e="http://"+e),l.dom.setAttribs(i,{href:e,"data-wplink-edit":null}),L.trim(i.innerHTML)||l.$(i).text(t||e),g(i)}c.reset(),l.nodeChanged(),void 0===window.wpLinkL10n||k||w(window.wpLinkL10n.linkInserted)}}),l.addCommand("wp_link_cancel",function(){c.reset(),r.tempHide||_()}),l.addCommand("wp_unlink",function(){l.execCommand("unlink"),r.tempHide=!1,l.execCommand("wp_link_cancel")}),l.addShortcut("access+a","","WP_Link"),l.addShortcut("access+s","","wp_unlink"),l.addShortcut("meta+k","","WP_Link"),l.addButton("link",{icon:"link",tooltip:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]"}),l.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink"}),l.addMenuItem("link",{icon:"link",text:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0}),l.on("pastepreprocess",function(e){var t=e.content,n=/^(?:https?:)?\/\/\S+$/i;l.selection.isCollapsed()||n.test(l.selection.getContent())||(t=t.replace(/<[^>]+>/g,""),t=L.trim(t),n.test(t)&&(l.execCommand("mceInsertLink",!1,{href:l.dom.decode(t)}),e.preventDefault()))}),l.on("savecontent",function(e){e.content=v(e.content,!0)}),l.on("BeforeAddUndo",function(e){e.lastLevel&&e.lastLevel.content&&e.level.content&&e.lastLevel.content===v(e.level.content)&&e.preventDefault()}),l.on("keydown",function(e){27===e.keyCode&&l.execCommand("wp_link_cancel"),e.altKey||L.Env.mac&&(!e.metaKey||e.ctrlKey)||!L.Env.mac&&!e.ctrlKey||89!==e.keyCode&&90!==e.keyCode||(n=!0,window.clearTimeout(t),t=window.setTimeout(function(){n=!1},500))}),l.addButton("wp_link_preview",{type:"WPLinkPreview",onPostRender:function(){d=this}}),l.addButton("wp_link_input",{type:"WPLinkInput",onPostRender:function(){var n,i,o,a=this.getEl(),e=a.firstChild.nextSibling;c=this,p&&p.ui&&p.ui.autocomplete&&((n=p(e)).on("keydown",function(){n.removeAttr("aria-activedescendant")}).autocomplete({source:function(e,t){if(o===e.term)t(i);else{if(/^https?:/.test(e.term)||-1!==e.term.indexOf("."))return t();p.post(window.ajaxurl,{action:"wp-link-ajax",page:1,search:e.term,_ajax_linking_nonce:p("#_ajax_linking_nonce").val()},function(e){t(i=e)},"json"),o=e.term}},focus:function(e,t){n.attr("aria-activedescendant","mce-wp-autocomplete-"+t.item.ID),e.preventDefault()},select:function(e,t){return n.val(t.item.permalink),p(a.firstChild.nextSibling.nextSibling).val(t.item.title),9===e.keyCode&&void 0!==window.wpLinkL10n&&w(window.wpLinkL10n.linkSelected),!1},open:function(){n.attr("aria-expanded","true"),r.blockHide=!0},close:function(){n.attr("aria-expanded","false"),r.blockHide=!1},minLength:2,position:{my:"left top+2"},messages:{noResults:m("No results found."),results:function(e){return h(f("%d result found. Use up and down arrow keys to navigate.","%d results found. Use up and down arrow keys to navigate.",e),e)}}}).autocomplete("instance")._renderItem=function(e,t){var n=void 0!==window.wpLinkL10n?window.wpLinkL10n.noTitle:"",n=t.title||n;return p('<li role="option" id="mce-wp-autocomplete-'+t.ID+'">').append("<span>"+n+'</span> <span class="wp-editor-float-right">'+t.info+"</span>").appendTo(e)},n.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":n.autocomplete("widget").attr("id")}).on("focus",function(){var e=n.val();e&&!/^https?:/.test(e)&&n.autocomplete("search")}).autocomplete("widget").addClass("wplink-autocomplete").attr("role","listbox").removeAttr("tabindex").on("menufocus",function(e,t){t.item.attr("aria-selected","true")}).on("menublur",function(){p(this).find('[aria-selected="true"]').removeAttr("aria-selected")})),L.$(e).on("keydown",function(e){13===e.keyCode&&(l.execCommand("wp_link_apply"),e.preventDefault())})}}),l.on("wptoolbar",function(e){var t,n,i,o=l.dom.getParent(e.element,"a");void 0!==window.wpLink&&window.wpLink.modalOpen?r.tempHide=!0:(r.tempHide=!1,o?(n=(t=l.$(o)).attr("href"),i=t.attr("data-wplink-edit"),"_wp_link_placeholder"===n||i?("_wp_link_placeholder"===n||c.getURL()||c.setURL(n),e.element=o,e.toolbar=r):n&&!t.find("img").length&&(d.setURL(n),e.element=o,e.toolbar=a,"true"===t.attr("data-wplink-url-error")?a.$el.find(".wp-link-preview a").addClass("wplink-url-error"):(a.$el.find(".wp-link-preview a").removeClass("wplink-url-error"),k=!1))):r.visible()&&l.execCommand("wp_link_cancel"))}),l.addButton("wp_link_edit",{tooltip:"Edit|button",icon:"dashicon dashicons-edit",cmd:"WP_Link"}),l.addButton("wp_link_remove",{tooltip:"Remove link",icon:"dashicon dashicons-editor-unlink",cmd:"wp_unlink"}),l.addButton("wp_link_advanced",{tooltip:"Link options",icon:"dashicon dashicons-admin-generic",onclick:function(){var e,t;void 0!==window.wpLink&&(e=c.getURL()||null,t=c.getLinkText()||null,window.wpLink.open(l.id,e,t),r.tempHide=!0,r.hide())}}),l.addButton("wp_link_apply",{tooltip:"Apply",icon:"dashicon dashicons-editor-break",cmd:"wp_link_apply",classes:"widget btn primary"}),{close:function(){r.tempHide=!1,l.execCommand("wp_link_cancel")},checkLink:g}})}(window.tinymce);PK D$�ZXM��E �E plugins/wplink/plugin.jsnu �[��� ( function( tinymce ) { tinymce.ui.Factory.add( 'WPLinkPreview', tinymce.ui.Control.extend( { url: '#', renderHtml: function() { return ( '<div id="' + this._id + '" class="wp-link-preview">' + '<a href="' + this.url + '" target="_blank" tabindex="-1">' + this.url + '</a>' + '</div>' ); }, setURL: function( url ) { var index, lastIndex; if ( this.url !== url ) { this.url = url; url = window.decodeURIComponent( url ); url = url.replace( /^(?:https?:)?\/\/(?:www\.)?/, '' ); if ( ( index = url.indexOf( '?' ) ) !== -1 ) { url = url.slice( 0, index ); } if ( ( index = url.indexOf( '#' ) ) !== -1 ) { url = url.slice( 0, index ); } url = url.replace( /(?:index)?\.html$/, '' ); if ( url.charAt( url.length - 1 ) === '/' ) { url = url.slice( 0, -1 ); } // If nothing's left (maybe the URL was just a fragment), use the whole URL. if ( url === '' ) { url = this.url; } // If the URL is longer that 40 chars, concatenate the beginning (after the domain) and ending with '...'. if ( url.length > 40 && ( index = url.indexOf( '/' ) ) !== -1 && ( lastIndex = url.lastIndexOf( '/' ) ) !== -1 && lastIndex !== index ) { // If the beginning + ending are shorter that 40 chars, show more of the ending. if ( index + url.length - lastIndex < 40 ) { lastIndex = -( 40 - ( index + 1 ) ); } url = url.slice( 0, index + 1 ) + '\u2026' + url.slice( lastIndex ); } tinymce.$( this.getEl().firstChild ).attr( 'href', this.url ).text( url ); } } } ) ); tinymce.ui.Factory.add( 'WPLinkInput', tinymce.ui.Control.extend( { renderHtml: function() { return ( '<div id="' + this._id + '" class="wp-link-input">' + '<label for="' + this._id + '_label">' + tinymce.translate( 'Paste URL or type to search' ) + '</label><input id="' + this._id + '_label" type="text" value="" />' + '<input type="text" style="display:none" value="" />' + '</div>' ); }, setURL: function( url ) { this.getEl().firstChild.nextSibling.value = url; }, getURL: function() { return tinymce.trim( this.getEl().firstChild.nextSibling.value ); }, getLinkText: function() { var text = this.getEl().firstChild.nextSibling.nextSibling.value; if ( ! tinymce.trim( text ) ) { return ''; } return text.replace( /[\r\n\t ]+/g, ' ' ); }, reset: function() { var urlInput = this.getEl().firstChild.nextSibling; urlInput.value = ''; urlInput.nextSibling.value = ''; } } ) ); tinymce.PluginManager.add( 'wplink', function( editor ) { var toolbar; var editToolbar; var previewInstance; var inputInstance; var linkNode; var doingUndoRedo; var doingUndoRedoTimer; var $ = window.jQuery; var emailRegex = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i; var urlRegex1 = /^https?:\/\/([^\s/?.#-][^\s\/?.#]*\.?)+(\/[^\s"]*)?$/i; var urlRegex2 = /^https?:\/\/[^\/]+\.[^\/]+($|\/)/i; var speak = ( typeof window.wp !== 'undefined' && window.wp.a11y && window.wp.a11y.speak ) ? window.wp.a11y.speak : function() {}; var hasLinkError = false; var __ = window.wp.i18n.__; var _n = window.wp.i18n._n; var sprintf = window.wp.i18n.sprintf; function getSelectedLink() { var href, html, node = editor.selection.getStart(), link = editor.dom.getParent( node, 'a[href]' ); if ( ! link ) { html = editor.selection.getContent({ format: 'raw' }); if ( html && html.indexOf( '</a>' ) !== -1 ) { href = html.match( /href="([^">]+)"/ ); if ( href && href[1] ) { link = editor.$( 'a[href="' + href[1] + '"]', node )[0]; } if ( link ) { editor.selection.select( link ); } } } return link; } function removePlaceholders() { editor.$( 'a' ).each( function( i, element ) { var $element = editor.$( element ); if ( $element.attr( 'href' ) === '_wp_link_placeholder' ) { editor.dom.remove( element, true ); } else if ( $element.attr( 'data-wplink-edit' ) ) { $element.attr( 'data-wplink-edit', null ); } }); } function removePlaceholderStrings( content, dataAttr ) { return content.replace( /(<a [^>]+>)([\s\S]*?)<\/a>/g, function( all, tag, text ) { if ( tag.indexOf( ' href="_wp_link_placeholder"' ) > -1 ) { return text; } if ( dataAttr ) { tag = tag.replace( / data-wplink-edit="true"/g, '' ); } tag = tag.replace( / data-wplink-url-error="true"/g, '' ); return tag + text + '</a>'; }); } function checkLink( node ) { var $link = editor.$( node ); var href = $link.attr( 'href' ); if ( ! href || typeof $ === 'undefined' ) { return; } hasLinkError = false; if ( /^http/i.test( href ) && ( ! urlRegex1.test( href ) || ! urlRegex2.test( href ) ) ) { hasLinkError = true; $link.attr( 'data-wplink-url-error', 'true' ); speak( editor.translate( 'Warning: the link has been inserted but may have errors. Please test it.' ), 'assertive' ); } else { $link.removeAttr( 'data-wplink-url-error' ); } } editor.on( 'preinit', function() { if ( editor.wp && editor.wp._createToolbar ) { toolbar = editor.wp._createToolbar( [ 'wp_link_preview', 'wp_link_edit', 'wp_link_remove' ], true ); var editButtons = [ 'wp_link_input', 'wp_link_apply' ]; if ( typeof window.wpLink !== 'undefined' ) { editButtons.push( 'wp_link_advanced' ); } editToolbar = editor.wp._createToolbar( editButtons, true ); editToolbar.on( 'show', function() { if ( typeof window.wpLink === 'undefined' || ! window.wpLink.modalOpen ) { window.setTimeout( function() { var element = editToolbar.$el.find( 'input.ui-autocomplete-input' )[0], selection = linkNode && ( linkNode.textContent || linkNode.innerText ); if ( element ) { if ( ! element.value && selection && typeof window.wpLink !== 'undefined' ) { element.value = window.wpLink.getUrlFromSelection( selection ); } if ( ! doingUndoRedo ) { element.focus(); element.select(); } } } ); } } ); editToolbar.on( 'hide', function() { if ( ! editToolbar.scrolling ) { editor.execCommand( 'wp_link_cancel' ); } } ); } } ); editor.addCommand( 'WP_Link', function() { if ( tinymce.Env.ie && tinymce.Env.ie < 10 && typeof window.wpLink !== 'undefined' ) { window.wpLink.open( editor.id ); return; } linkNode = getSelectedLink(); editToolbar.tempHide = false; if ( ! linkNode ) { removePlaceholders(); editor.execCommand( 'mceInsertLink', false, { href: '_wp_link_placeholder' } ); linkNode = editor.$( 'a[href="_wp_link_placeholder"]' )[0]; editor.nodeChanged(); } editor.dom.setAttribs( linkNode, { 'data-wplink-edit': true } ); } ); editor.addCommand( 'wp_link_apply', function() { if ( editToolbar.scrolling ) { return; } var href, text; if ( linkNode ) { href = inputInstance.getURL(); text = inputInstance.getLinkText(); editor.focus(); var parser = document.createElement( 'a' ); parser.href = href; if ( 'javascript:' === parser.protocol || 'data:' === parser.protocol ) { // jshint ignore:line href = ''; } if ( ! href ) { editor.dom.remove( linkNode, true ); return; } if ( ! /^(?:[a-z]+:|#|\?|\.|\/)/.test( href ) && ! emailRegex.test( href ) ) { href = 'http://' + href; } editor.dom.setAttribs( linkNode, { href: href, 'data-wplink-edit': null } ); if ( ! tinymce.trim( linkNode.innerHTML ) ) { editor.$( linkNode ).text( text || href ); } checkLink( linkNode ); } inputInstance.reset(); editor.nodeChanged(); // Audible confirmation message when a link has been inserted in the Editor. if ( typeof window.wpLinkL10n !== 'undefined' && ! hasLinkError ) { speak( window.wpLinkL10n.linkInserted ); } } ); editor.addCommand( 'wp_link_cancel', function() { inputInstance.reset(); if ( ! editToolbar.tempHide ) { removePlaceholders(); } } ); editor.addCommand( 'wp_unlink', function() { editor.execCommand( 'unlink' ); editToolbar.tempHide = false; editor.execCommand( 'wp_link_cancel' ); } ); // WP default shortcuts. editor.addShortcut( 'access+a', '', 'WP_Link' ); editor.addShortcut( 'access+s', '', 'wp_unlink' ); // The "de-facto standard" shortcut, see #27305. editor.addShortcut( 'meta+k', '', 'WP_Link' ); editor.addButton( 'link', { icon: 'link', tooltip: 'Insert/edit link', cmd: 'WP_Link', stateSelector: 'a[href]' }); editor.addButton( 'unlink', { icon: 'unlink', tooltip: 'Remove link', cmd: 'unlink' }); editor.addMenuItem( 'link', { icon: 'link', text: 'Insert/edit link', cmd: 'WP_Link', stateSelector: 'a[href]', context: 'insert', prependToContext: true }); editor.on( 'pastepreprocess', function( event ) { var pastedStr = event.content, regExp = /^(?:https?:)?\/\/\S+$/i; if ( ! editor.selection.isCollapsed() && ! regExp.test( editor.selection.getContent() ) ) { pastedStr = pastedStr.replace( /<[^>]+>/g, '' ); pastedStr = tinymce.trim( pastedStr ); if ( regExp.test( pastedStr ) ) { editor.execCommand( 'mceInsertLink', false, { href: editor.dom.decode( pastedStr ) } ); event.preventDefault(); } } } ); // Remove any remaining placeholders on saving. editor.on( 'savecontent', function( event ) { event.content = removePlaceholderStrings( event.content, true ); }); // Prevent adding undo levels on inserting link placeholder. editor.on( 'BeforeAddUndo', function( event ) { if ( event.lastLevel && event.lastLevel.content && event.level.content && event.lastLevel.content === removePlaceholderStrings( event.level.content ) ) { event.preventDefault(); } }); // When doing undo and redo with keyboard shortcuts (Ctrl|Cmd+Z, Ctrl|Cmd+Shift+Z, Ctrl|Cmd+Y), // set a flag to not focus the inline dialog. The editor has to remain focused so the users can do consecutive undo/redo. editor.on( 'keydown', function( event ) { if ( event.keyCode === 27 ) { // Esc editor.execCommand( 'wp_link_cancel' ); } if ( event.altKey || ( tinymce.Env.mac && ( ! event.metaKey || event.ctrlKey ) ) || ( ! tinymce.Env.mac && ! event.ctrlKey ) ) { return; } if ( event.keyCode === 89 || event.keyCode === 90 ) { // Y or Z doingUndoRedo = true; window.clearTimeout( doingUndoRedoTimer ); doingUndoRedoTimer = window.setTimeout( function() { doingUndoRedo = false; }, 500 ); } } ); editor.addButton( 'wp_link_preview', { type: 'WPLinkPreview', onPostRender: function() { previewInstance = this; } } ); editor.addButton( 'wp_link_input', { type: 'WPLinkInput', onPostRender: function() { var element = this.getEl(), input = element.firstChild.nextSibling, $input, cache, last; inputInstance = this; if ( $ && $.ui && $.ui.autocomplete ) { $input = $( input ); $input.on( 'keydown', function() { $input.removeAttr( 'aria-activedescendant' ); } ) .autocomplete( { source: function( request, response ) { if ( last === request.term ) { response( cache ); return; } if ( /^https?:/.test( request.term ) || request.term.indexOf( '.' ) !== -1 ) { return response(); } $.post( window.ajaxurl, { action: 'wp-link-ajax', page: 1, search: request.term, _ajax_linking_nonce: $( '#_ajax_linking_nonce' ).val() }, function( data ) { cache = data; response( data ); }, 'json' ); last = request.term; }, focus: function( event, ui ) { $input.attr( 'aria-activedescendant', 'mce-wp-autocomplete-' + ui.item.ID ); /* * Don't empty the URL input field, when using the arrow keys to * highlight items. See api.jqueryui.com/autocomplete/#event-focus */ event.preventDefault(); }, select: function( event, ui ) { $input.val( ui.item.permalink ); $( element.firstChild.nextSibling.nextSibling ).val( ui.item.title ); if ( 9 === event.keyCode && typeof window.wpLinkL10n !== 'undefined' ) { // Audible confirmation message when a link has been selected. speak( window.wpLinkL10n.linkSelected ); } return false; }, open: function() { $input.attr( 'aria-expanded', 'true' ); editToolbar.blockHide = true; }, close: function() { $input.attr( 'aria-expanded', 'false' ); editToolbar.blockHide = false; }, minLength: 2, position: { my: 'left top+2' }, messages: { noResults: __( 'No results found.' ) , results: function( number ) { return sprintf( /* translators: %d: Number of search results found. */ _n( '%d result found. Use up and down arrow keys to navigate.', '%d results found. Use up and down arrow keys to navigate.', number ), number ); } } } ).autocomplete( 'instance' )._renderItem = function( ul, item ) { var fallbackTitle = ( typeof window.wpLinkL10n !== 'undefined' ) ? window.wpLinkL10n.noTitle : '', title = item.title ? item.title : fallbackTitle; return $( '<li role="option" id="mce-wp-autocomplete-' + item.ID + '">' ) .append( '<span>' + title + '</span> <span class="wp-editor-float-right">' + item.info + '</span>' ) .appendTo( ul ); }; $input.attr( { 'role': 'combobox', 'aria-autocomplete': 'list', 'aria-expanded': 'false', 'aria-owns': $input.autocomplete( 'widget' ).attr( 'id' ) } ) .on( 'focus', function() { var inputValue = $input.val(); /* * Don't trigger a search if the URL field already has a link or is empty. * Also, avoids screen readers announce `No search results`. */ if ( inputValue && ! /^https?:/.test( inputValue ) ) { $input.autocomplete( 'search' ); } } ) // Returns a jQuery object containing the menu element. .autocomplete( 'widget' ) .addClass( 'wplink-autocomplete' ) .attr( 'role', 'listbox' ) .removeAttr( 'tabindex' ) // Remove the `tabindex=0` attribute added by jQuery UI. /* * Looks like Safari and VoiceOver need an `aria-selected` attribute. See ticket #33301. * The `menufocus` and `menublur` events are the same events used to add and remove * the `ui-state-focus` CSS class on the menu items. See jQuery UI Menu Widget. */ .on( 'menufocus', function( event, ui ) { ui.item.attr( 'aria-selected', 'true' ); }) .on( 'menublur', function() { /* * The `menublur` event returns an object where the item is `null` * so we need to find the active item with other means. */ $( this ).find( '[aria-selected="true"]' ).removeAttr( 'aria-selected' ); }); } tinymce.$( input ).on( 'keydown', function( event ) { if ( event.keyCode === 13 ) { editor.execCommand( 'wp_link_apply' ); event.preventDefault(); } } ); } } ); editor.on( 'wptoolbar', function( event ) { var linkNode = editor.dom.getParent( event.element, 'a' ), $linkNode, href, edit; if ( typeof window.wpLink !== 'undefined' && window.wpLink.modalOpen ) { editToolbar.tempHide = true; return; } editToolbar.tempHide = false; if ( linkNode ) { $linkNode = editor.$( linkNode ); href = $linkNode.attr( 'href' ); edit = $linkNode.attr( 'data-wplink-edit' ); if ( href === '_wp_link_placeholder' || edit ) { if ( href !== '_wp_link_placeholder' && ! inputInstance.getURL() ) { inputInstance.setURL( href ); } event.element = linkNode; event.toolbar = editToolbar; } else if ( href && ! $linkNode.find( 'img' ).length ) { previewInstance.setURL( href ); event.element = linkNode; event.toolbar = toolbar; if ( $linkNode.attr( 'data-wplink-url-error' ) === 'true' ) { toolbar.$el.find( '.wp-link-preview a' ).addClass( 'wplink-url-error' ); } else { toolbar.$el.find( '.wp-link-preview a' ).removeClass( 'wplink-url-error' ); hasLinkError = false; } } } else if ( editToolbar.visible() ) { editor.execCommand( 'wp_link_cancel' ); } } ); editor.addButton( 'wp_link_edit', { tooltip: 'Edit|button', // '|button' is not displayed, only used for context. icon: 'dashicon dashicons-edit', cmd: 'WP_Link' } ); editor.addButton( 'wp_link_remove', { tooltip: 'Remove link', icon: 'dashicon dashicons-editor-unlink', cmd: 'wp_unlink' } ); editor.addButton( 'wp_link_advanced', { tooltip: 'Link options', icon: 'dashicon dashicons-admin-generic', onclick: function() { if ( typeof window.wpLink !== 'undefined' ) { var url = inputInstance.getURL() || null, text = inputInstance.getLinkText() || null; window.wpLink.open( editor.id, url, text ); editToolbar.tempHide = true; editToolbar.hide(); } } } ); editor.addButton( 'wp_link_apply', { tooltip: 'Apply', icon: 'dashicon dashicons-editor-break', cmd: 'wp_link_apply', classes: 'widget btn primary' } ); return { close: function() { editToolbar.tempHide = false; editor.execCommand( 'wp_link_cancel' ); }, checkLink: checkLink }; } ); } )( window.tinymce ); PK D$�ZU6��? ? plugins/textcolor/plugin.min.jsnu �[��� !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t,o){var r;return t.dom.getParents(t.selection.getStart(),function(t){var e;(e=t.style["forecolor"===o?"color":"background-color"])&&(r=r||e)}),r},g=function(t){var e,o=[];for(e=0;e<t.length;e+=2)o.push({text:t[e+1],color:"#"+t[e]});return o},r=function(t,e,o){t.undoManager.transact(function(){t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()})},e=function(t,e){t.undoManager.transact(function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()})},o=function(o){o.addCommand("mceApplyTextcolor",function(t,e){r(o,t,e)}),o.addCommand("mceRemoveTextcolor",function(t){e(o,t)})},F=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],l=function(t){return t.getParam("textcolor_map",a)},c=function(t){return t.getParam("textcolor_rows",5)},u=function(t){return t.getParam("textcolor_cols",8)},m=function(t){return t.getParam("color_picker_callback",null)},s=function(t){return t.getParam("forecolor_map",l(t))},d=function(t){return t.getParam("backcolor_map",l(t))},f=function(t){return t.getParam("forecolor_rows",c(t))},b=function(t){return t.getParam("backcolor_rows",c(t))},p=function(t){return t.getParam("forecolor_cols",u(t))},C=function(t){return t.getParam("backcolor_cols",u(t))},y=m,v=function(t){return"function"==typeof m(t)},h=tinymce.util.Tools.resolve("tinymce.util.I18n"),P=function(t,e,o,r){var n,a,l,c,i,u,m,s=0,d=F.DOM.uniqueId("mcearia"),f=function(t,e){var o="transparent"===t;return'<td class="mce-grid-cell'+(o?" mce-colorbtn-trans":"")+'"><div id="'+d+"-"+s+++'" data-mce-color="'+(t||"")+'" role="option" tabIndex="-1" style="'+(t?"background-color: "+t:"")+'" title="'+h.translate(e)+'">'+(o?"×":"")+"</div></td>"};for((n=g(o)).push({text:h.translate("No color"),color:"transparent"}),l='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',c=n.length-1,u=0;u<e;u++){for(l+="<tr>",i=0;i<t;i++)l+=c<(m=u*t+i)?"<td></td>":f((a=n[m]).color,a.text);l+="</tr>"}if(r){for(l+='<tr><td colspan="'+t+'" class="mce-custom-color-btn"><div id="'+d+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+d+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+h.translate("Custom...")+"</button></div></td></tr>",l+="<tr>",i=0;i<t;i++)l+=f("","Custom color");l+="</tr>"}return l+="</tbody></table>"},k=function(t,e){t.style.background=e,t.setAttribute("data-mce-color",e)},x=function(o){return function(t){var e=t.control;e._color?o.execCommand("mceApplyTextcolor",e.settings.format,e._color):o.execCommand("mceRemoveTextcolor",e.settings.format)}},T=function(r,c){return function(t){var e,a=this.parent(),o=n(r,a.settings.format),l=function(t){r.execCommand("mceApplyTextcolor",a.settings.format,t),a.hidePanel(),a.color(t)};F.DOM.getParent(t.target,".mce-custom-color-btn")&&(a.hidePanel(),y(r).call(r,function(t){var e,o,r,n=a.panel.getEl().getElementsByTagName("table")[0];for(e=i.map(n.rows[n.rows.length-1].childNodes,function(t){return t.firstChild}),r=0;r<e.length&&(o=e[r]).getAttribute("data-mce-color");r++);if(r===c)for(r=0;r<c-1;r++)k(e[r],e[r+1].getAttribute("data-mce-color"));k(o,t),l(t)},o)),(e=t.target.getAttribute("data-mce-color"))?(this.lastId&&F.DOM.get(this.lastId).setAttribute("aria-selected","false"),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,"transparent"===e?(r.execCommand("mceRemoveTextcolor",a.settings.format),a.hidePanel(),a.resetColor()):l(e)):null!==e&&a.hidePanel()}},_=function(n,a){return function(){var t=a?p(n):C(n),e=a?f(n):b(n),o=a?s(n):d(n),r=v(n);return P(t,e,o,r)}},A=function(t){t.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!0),onclick:T(t,p(t))},onclick:x(t)}),t.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!1),onclick:T(t,C(t))},onclick:x(t)})};t.add("textcolor",function(t){o(t),A(t)})}();PK D$�Z��.., ., plugins/textcolor/plugin.jsnu �[��� (function () { var textcolor = (function () { 'use strict'; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var getCurrentColor = function (editor, format) { var color; editor.dom.getParents(editor.selection.getStart(), function (elm) { var value; if (value = elm.style[format === 'forecolor' ? 'color' : 'background-color']) { color = color ? color : value; } }); return color; }; var mapColors = function (colorMap) { var i; var colors = []; for (i = 0; i < colorMap.length; i += 2) { colors.push({ text: colorMap[i + 1], color: '#' + colorMap[i] }); } return colors; }; var applyFormat = function (editor, format, value) { editor.undoManager.transact(function () { editor.focus(); editor.formatter.apply(format, { value: value }); editor.nodeChanged(); }); }; var removeFormat = function (editor, format) { editor.undoManager.transact(function () { editor.focus(); editor.formatter.remove(format, { value: null }, null, true); editor.nodeChanged(); }); }; var TextColor = { getCurrentColor: getCurrentColor, mapColors: mapColors, applyFormat: applyFormat, removeFormat: removeFormat }; var register = function (editor) { editor.addCommand('mceApplyTextcolor', function (format, value) { TextColor.applyFormat(editor, format, value); }); editor.addCommand('mceRemoveTextcolor', function (format) { TextColor.removeFormat(editor, format); }); }; var Commands = { register: register }; var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var defaultColorMap = [ '000000', 'Black', '993300', 'Burnt orange', '333300', 'Dark olive', '003300', 'Dark green', '003366', 'Dark azure', '000080', 'Navy Blue', '333399', 'Indigo', '333333', 'Very dark gray', '800000', 'Maroon', 'FF6600', 'Orange', '808000', 'Olive', '008000', 'Green', '008080', 'Teal', '0000FF', 'Blue', '666699', 'Grayish blue', '808080', 'Gray', 'FF0000', 'Red', 'FF9900', 'Amber', '99CC00', 'Yellow green', '339966', 'Sea green', '33CCCC', 'Turquoise', '3366FF', 'Royal blue', '800080', 'Purple', '999999', 'Medium gray', 'FF00FF', 'Magenta', 'FFCC00', 'Gold', 'FFFF00', 'Yellow', '00FF00', 'Lime', '00FFFF', 'Aqua', '00CCFF', 'Sky blue', '993366', 'Red violet', 'FFFFFF', 'White', 'FF99CC', 'Pink', 'FFCC99', 'Peach', 'FFFF99', 'Light yellow', 'CCFFCC', 'Pale green', 'CCFFFF', 'Pale cyan', '99CCFF', 'Light sky blue', 'CC99FF', 'Plum' ]; var getTextColorMap = function (editor) { return editor.getParam('textcolor_map', defaultColorMap); }; var getForeColorMap = function (editor) { return editor.getParam('forecolor_map', getTextColorMap(editor)); }; var getBackColorMap = function (editor) { return editor.getParam('backcolor_map', getTextColorMap(editor)); }; var getTextColorRows = function (editor) { return editor.getParam('textcolor_rows', 5); }; var getTextColorCols = function (editor) { return editor.getParam('textcolor_cols', 8); }; var getForeColorRows = function (editor) { return editor.getParam('forecolor_rows', getTextColorRows(editor)); }; var getBackColorRows = function (editor) { return editor.getParam('backcolor_rows', getTextColorRows(editor)); }; var getForeColorCols = function (editor) { return editor.getParam('forecolor_cols', getTextColorCols(editor)); }; var getBackColorCols = function (editor) { return editor.getParam('backcolor_cols', getTextColorCols(editor)); }; var getColorPickerCallback = function (editor) { return editor.getParam('color_picker_callback', null); }; var hasColorPicker = function (editor) { return typeof getColorPickerCallback(editor) === 'function'; }; var Settings = { getForeColorMap: getForeColorMap, getBackColorMap: getBackColorMap, getForeColorRows: getForeColorRows, getBackColorRows: getBackColorRows, getForeColorCols: getForeColorCols, getBackColorCols: getBackColorCols, getColorPickerCallback: getColorPickerCallback, hasColorPicker: hasColorPicker }; var global$3 = tinymce.util.Tools.resolve('tinymce.util.I18n'); var getHtml = function (cols, rows, colorMap, hasColorPicker) { var colors, color, html, last, x, y, i, count = 0; var id = global$1.DOM.uniqueId('mcearia'); var getColorCellHtml = function (color, title) { var isNoColor = color === 'transparent'; return '<td class="mce-grid-cell' + (isNoColor ? ' mce-colorbtn-trans' : '') + '">' + '<div id="' + id + '-' + count++ + '"' + ' data-mce-color="' + (color ? color : '') + '"' + ' role="option"' + ' tabIndex="-1"' + ' style="' + (color ? 'background-color: ' + color : '') + '"' + ' title="' + global$3.translate(title) + '">' + (isNoColor ? '×' : '') + '</div>' + '</td>'; }; colors = TextColor.mapColors(colorMap); colors.push({ text: global$3.translate('No color'), color: 'transparent' }); html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>'; last = colors.length - 1; for (y = 0; y < rows; y++) { html += '<tr>'; for (x = 0; x < cols; x++) { i = y * cols + x; if (i > last) { html += '<td></td>'; } else { color = colors[i]; html += getColorCellHtml(color.color, color.text); } } html += '</tr>'; } if (hasColorPicker) { html += '<tr>' + '<td colspan="' + cols + '" class="mce-custom-color-btn">' + '<div id="' + id + '-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" ' + 'role="button" tabindex="-1" aria-labelledby="' + id + '-c" style="width: 100%">' + '<button type="button" role="presentation" tabindex="-1">' + global$3.translate('Custom...') + '</button>' + '</div>' + '</td>' + '</tr>'; html += '<tr>'; for (x = 0; x < cols; x++) { html += getColorCellHtml('', 'Custom color'); } html += '</tr>'; } html += '</tbody></table>'; return html; }; var ColorPickerHtml = { getHtml: getHtml }; var setDivColor = function setDivColor(div, value) { div.style.background = value; div.setAttribute('data-mce-color', value); }; var onButtonClick = function (editor) { return function (e) { var ctrl = e.control; if (ctrl._color) { editor.execCommand('mceApplyTextcolor', ctrl.settings.format, ctrl._color); } else { editor.execCommand('mceRemoveTextcolor', ctrl.settings.format); } }; }; var onPanelClick = function (editor, cols) { return function (e) { var buttonCtrl = this.parent(); var value; var currentColor = TextColor.getCurrentColor(editor, buttonCtrl.settings.format); var selectColor = function (value) { editor.execCommand('mceApplyTextcolor', buttonCtrl.settings.format, value); buttonCtrl.hidePanel(); buttonCtrl.color(value); }; var resetColor = function () { editor.execCommand('mceRemoveTextcolor', buttonCtrl.settings.format); buttonCtrl.hidePanel(); buttonCtrl.resetColor(); }; if (global$1.DOM.getParent(e.target, '.mce-custom-color-btn')) { buttonCtrl.hidePanel(); var colorPickerCallback = Settings.getColorPickerCallback(editor); colorPickerCallback.call(editor, function (value) { var tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0]; var customColorCells, div, i; customColorCells = global$2.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function (elm) { return elm.firstChild; }); for (i = 0; i < customColorCells.length; i++) { div = customColorCells[i]; if (!div.getAttribute('data-mce-color')) { break; } } if (i === cols) { for (i = 0; i < cols - 1; i++) { setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color')); } } setDivColor(div, value); selectColor(value); }, currentColor); } value = e.target.getAttribute('data-mce-color'); if (value) { if (this.lastId) { global$1.DOM.get(this.lastId).setAttribute('aria-selected', 'false'); } e.target.setAttribute('aria-selected', true); this.lastId = e.target.id; if (value === 'transparent') { resetColor(); } else { selectColor(value); } } else if (value !== null) { buttonCtrl.hidePanel(); } }; }; var renderColorPicker = function (editor, foreColor) { return function () { var cols = foreColor ? Settings.getForeColorCols(editor) : Settings.getBackColorCols(editor); var rows = foreColor ? Settings.getForeColorRows(editor) : Settings.getBackColorRows(editor); var colorMap = foreColor ? Settings.getForeColorMap(editor) : Settings.getBackColorMap(editor); var hasColorPicker = Settings.hasColorPicker(editor); return ColorPickerHtml.getHtml(cols, rows, colorMap, hasColorPicker); }; }; var register$1 = function (editor) { editor.addButton('forecolor', { type: 'colorbutton', tooltip: 'Text color', format: 'forecolor', panel: { role: 'application', ariaRemember: true, html: renderColorPicker(editor, true), onclick: onPanelClick(editor, Settings.getForeColorCols(editor)) }, onclick: onButtonClick(editor) }); editor.addButton('backcolor', { type: 'colorbutton', tooltip: 'Background color', format: 'hilitecolor', panel: { role: 'application', ariaRemember: true, html: renderColorPicker(editor, false), onclick: onPanelClick(editor, Settings.getBackColorCols(editor)) }, onclick: onButtonClick(editor) }); }; var Buttons = { register: register$1 }; global.add('textcolor', function (editor) { Commands.register(editor); Buttons.register(editor); }); function Plugin () { } return Plugin; }()); })(); PK D$�Z]l��V V plugins/wpview/plugin.min.jsnu �[��� !function(c){c.PluginManager.add("wpview",function(o){function e(){}var n=window.wp;return n&&n.mce&&n.mce.views&&(o.on("init",function(){var e=window.MutationObserver||window.WebKitMutationObserver;e&&new e(function(){o.fire("wp-body-class-change")}).observe(o.getBody(),{attributes:!0,attributeFilter:["class"]}),o.on("wp-body-class-change",function(){var n=o.getBody().className;o.$('iframe[class="wpview-sandbox"]').each(function(e,t){if(!t.src||'javascript:""'===t.src)try{t.contentWindow.document.body.className=n}catch(e){}})})}),o.on("beforesetcontent",function(e){var t;if(e.selection||n.mce.views.unbind(),e.content){if(!e.load&&(t=o.selection.getNode())&&t!==o.getBody()&&/^\s*https?:\/\/\S+\s*$/i.test(e.content)){if(!(t=o.dom.getParent(t,"p"))||!/^[\s\uFEFF\u00A0]*$/.test(o.$(t).text()||""))return;t.innerHTML=""}e.content=n.mce.views.setMarkers(e.content,o)}}),o.on("setcontent",function(){n.mce.views.render()}),o.on("preprocess hide",function(e){o.$("div[data-wpview-text], p[data-wpview-marker]",e.node).each(function(e,t){t.innerHTML="."})},!0),o.on("postprocess",function(e){e.content=a(e.content)}),o.on("beforeaddundo",function(e){var t=e.level.content||e.level.fragments&&e.level.fragments.join(""),n=e.lastLevel?e.lastLevel.content||e.lastLevel.fragments&&e.lastLevel.fragments.join(""):o.startContent;t&&n&&-1!==t.indexOf(" data-wpview-")&&-1!==n.indexOf(" data-wpview-")&&a(n)===a(t)&&e.preventDefault()}),o.on("drop objectselected",function(e){i(e.targetClone)&&(e.targetClone=o.getDoc().createTextNode(window.decodeURIComponent(o.dom.getAttrib(e.targetClone,"data-wpview-text"))))}),o.on("pastepreprocess",function(e){var t=e.content;t&&(t=c.trim(t.replace(/<[^>]+>/g,"")),/^https?:\/\/\S+$/i.test(t))&&(e.content=t)}),o.on("resolvename",function(e){i(e.target)&&(e.name=o.dom.getAttrib(e.target,"data-wpview-type")||"object")}),o.on("click keyup",function(){var e=o.selection.getNode();i(e)&&o.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")}),o.addButton("wp_view_edit",{tooltip:"Edit|button",icon:"dashicon dashicons-edit",onclick:function(){var e=o.selection.getNode();i(e)&&n.mce.views.edit(o,e)}}),o.addButton("wp_view_remove",{tooltip:"Remove",icon:"dashicon dashicons-no",onclick:function(){o.fire("cut")}}),o.once("preinit",function(){var t;o.wp&&o.wp._createToolbar&&(t=o.wp._createToolbar(["wp_view_edit","wp_view_remove"]),o.on("wptoolbar",function(e){!e.collapsed&&i(e.element)&&(e.toolbar=t)}))}),o.wp=o.wp||{},o.wp.getView=e,o.wp.setViewCursor=e),{getView:e};function i(e){return o.dom.hasClass(e,"wpview")}function a(e){function t(e,t){return"<p>"+window.decodeURIComponent(t)+"</p>"}return e&&-1!==e.indexOf(" data-wpview-")?e.replace(/<div[^>]+data-wpview-text="([^"]+)"[^>]*>(?:\.|[\s\S]+?wpview-end[^>]+>\s*<\/span>\s*)?<\/div>/g,t).replace(/<p[^>]+data-wpview-marker="([^"]+)"[^>]*>[\s\S]*?<\/p>/g,t):e}})}(window.tinymce);PK D$�ZqMY:� � plugins/wpview/plugin.jsnu �[��� /** * WordPress View plugin. */ ( function( tinymce ) { tinymce.PluginManager.add( 'wpview', function( editor ) { function noop () {} // Set this here as wp-tinymce.js may be loaded too early. var wp = window.wp; if ( ! wp || ! wp.mce || ! wp.mce.views ) { return { getView: noop }; } // Check if a node is a view or not. function isView( node ) { return editor.dom.hasClass( node, 'wpview' ); } // Replace view tags with their text. function resetViews( content ) { function callback( match, $1 ) { return '<p>' + window.decodeURIComponent( $1 ) + '</p>'; } if ( ! content || content.indexOf( ' data-wpview-' ) === -1 ) { return content; } return content .replace( /<div[^>]+data-wpview-text="([^"]+)"[^>]*>(?:\.|[\s\S]+?wpview-end[^>]+>\s*<\/span>\s*)?<\/div>/g, callback ) .replace( /<p[^>]+data-wpview-marker="([^"]+)"[^>]*>[\s\S]*?<\/p>/g, callback ); } editor.on( 'init', function() { var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; if ( MutationObserver ) { new MutationObserver( function() { editor.fire( 'wp-body-class-change' ); } ) .observe( editor.getBody(), { attributes: true, attributeFilter: ['class'] } ); } // Pass on body class name changes from the editor to the wpView iframes. editor.on( 'wp-body-class-change', function() { var className = editor.getBody().className; editor.$( 'iframe[class="wpview-sandbox"]' ).each( function( i, iframe ) { // Make sure it is a local iframe. // jshint scripturl: true if ( ! iframe.src || iframe.src === 'javascript:""' ) { try { iframe.contentWindow.document.body.className = className; } catch( er ) {} } }); } ); }); // Scan new content for matching view patterns and replace them with markers. editor.on( 'beforesetcontent', function( event ) { var node; if ( ! event.selection ) { wp.mce.views.unbind(); } if ( ! event.content ) { return; } if ( ! event.load ) { node = editor.selection.getNode(); if ( node && node !== editor.getBody() && /^\s*https?:\/\/\S+\s*$/i.test( event.content ) ) { // When a url is pasted or inserted, only try to embed it when it is in an empty paragraph. node = editor.dom.getParent( node, 'p' ); if ( node && /^[\s\uFEFF\u00A0]*$/.test( editor.$( node ).text() || '' ) ) { // Make sure there are no empty inline elements in the <p>. node.innerHTML = ''; } else { return; } } } event.content = wp.mce.views.setMarkers( event.content, editor ); } ); // Replace any new markers nodes with views. editor.on( 'setcontent', function() { wp.mce.views.render(); } ); // Empty view nodes for easier processing. editor.on( 'preprocess hide', function( event ) { editor.$( 'div[data-wpview-text], p[data-wpview-marker]', event.node ).each( function( i, node ) { node.innerHTML = '.'; } ); }, true ); // Replace views with their text. editor.on( 'postprocess', function( event ) { event.content = resetViews( event.content ); } ); // Prevent adding of undo levels when replacing wpview markers // or when there are changes only in the (non-editable) previews. editor.on( 'beforeaddundo', function( event ) { var lastContent; var newContent = event.level.content || ( event.level.fragments && event.level.fragments.join( '' ) ); if ( ! event.lastLevel ) { lastContent = editor.startContent; } else { lastContent = event.lastLevel.content || ( event.lastLevel.fragments && event.lastLevel.fragments.join( '' ) ); } if ( ! newContent || ! lastContent || newContent.indexOf( ' data-wpview-' ) === -1 || lastContent.indexOf( ' data-wpview-' ) === -1 ) { return; } if ( resetViews( lastContent ) === resetViews( newContent ) ) { event.preventDefault(); } } ); // Make sure views are copied as their text. editor.on( 'drop objectselected', function( event ) { if ( isView( event.targetClone ) ) { event.targetClone = editor.getDoc().createTextNode( window.decodeURIComponent( editor.dom.getAttrib( event.targetClone, 'data-wpview-text' ) ) ); } } ); // Clean up URLs for easier processing. editor.on( 'pastepreprocess', function( event ) { var content = event.content; if ( content ) { content = tinymce.trim( content.replace( /<[^>]+>/g, '' ) ); if ( /^https?:\/\/\S+$/i.test( content ) ) { event.content = content; } } } ); // Show the view type in the element path. editor.on( 'resolvename', function( event ) { if ( isView( event.target ) ) { event.name = editor.dom.getAttrib( event.target, 'data-wpview-type' ) || 'object'; } } ); // See `media` plugin. editor.on( 'click keyup', function() { var node = editor.selection.getNode(); if ( isView( node ) ) { if ( editor.dom.getAttrib( node, 'data-mce-selected' ) ) { node.setAttribute( 'data-mce-selected', '2' ); } } } ); editor.addButton( 'wp_view_edit', { tooltip: 'Edit|button', // '|button' is not displayed, only used for context. icon: 'dashicon dashicons-edit', onclick: function() { var node = editor.selection.getNode(); if ( isView( node ) ) { wp.mce.views.edit( editor, node ); } } } ); editor.addButton( 'wp_view_remove', { tooltip: 'Remove', icon: 'dashicon dashicons-no', onclick: function() { editor.fire( 'cut' ); } } ); editor.once( 'preinit', function() { var toolbar; if ( editor.wp && editor.wp._createToolbar ) { toolbar = editor.wp._createToolbar( [ 'wp_view_edit', 'wp_view_remove' ] ); editor.on( 'wptoolbar', function( event ) { if ( ! event.collapsed && isView( event.element ) ) { event.toolbar = toolbar; } } ); } } ); editor.wp = editor.wp || {}; editor.wp.getView = noop; editor.wp.setViewCursor = noop; return { getView: noop }; } ); } )( window.tinymce ); PK D$�ZS� � plugins/hr/plugin.min.jsnu �[��� !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},o=function(n){n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};n.add("hr",function(n){t(n),o(n)})}();PK D$�Z?#Z~� � plugins/hr/plugin.jsnu �[��� (function () { var hr = (function () { 'use strict'; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var register = function (editor) { editor.addCommand('InsertHorizontalRule', function () { editor.execCommand('mceInsertContent', false, '<hr />'); }); }; var Commands = { register: register }; var register$1 = function (editor) { editor.addButton('hr', { icon: 'hr', tooltip: 'Horizontal line', cmd: 'InsertHorizontalRule' }); editor.addMenuItem('hr', { icon: 'hr', text: 'Horizontal line', cmd: 'InsertHorizontalRule', context: 'insert' }); }; var Buttons = { register: register$1 }; global.add('hr', function (editor) { Commands.register(editor); Buttons.register(editor); }); function Plugin () { } return Plugin; }()); })(); PK D$�Z����Y Y $ plugins/directionality/plugin.min.jsnu �[��� !function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(t,e){var i,n=t.dom,o=t.selection.getSelectedBlocks();o.length&&(i=n.getAttrib(o[0],"dir"),c.each(o,function(t){n.getParent(t.parentNode,'*[dir="'+e+'"]',n.getRoot())||n.setAttrib(t,"dir",i!==e?e:null)}),t.nodeChanged())},i=function(t){t.addCommand("mceDirectionLTR",function(){e(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){e(t,"rtl")})},n=function(e){var i=[];return c.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(t){i.push(t+"[dir="+e+"]")}),i.join(",")},o=function(t){t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})};t.add("directionality",function(t){i(t),o(t)})}();PK D$�Z8H�d d plugins/directionality/plugin.jsnu �[��� (function () { var directionality = (function () { 'use strict'; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var setDir = function (editor, dir) { var dom = editor.dom; var curDir; var blocks = editor.selection.getSelectedBlocks(); if (blocks.length) { curDir = dom.getAttrib(blocks[0], 'dir'); global$1.each(blocks, function (block) { if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) { dom.setAttrib(block, 'dir', curDir !== dir ? dir : null); } }); editor.nodeChanged(); } }; var Direction = { setDir: setDir }; var register = function (editor) { editor.addCommand('mceDirectionLTR', function () { Direction.setDir(editor, 'ltr'); }); editor.addCommand('mceDirectionRTL', function () { Direction.setDir(editor, 'rtl'); }); }; var Commands = { register: register }; var generateSelector = function (dir) { var selector = []; global$1.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function (name) { selector.push(name + '[dir=' + dir + ']'); }); return selector.join(','); }; var register$1 = function (editor) { editor.addButton('ltr', { title: 'Left to right', cmd: 'mceDirectionLTR', stateSelector: generateSelector('ltr') }); editor.addButton('rtl', { title: 'Right to left', cmd: 'mceDirectionRTL', stateSelector: generateSelector('rtl') }); }; var Buttons = { register: register$1 }; global.add('directionality', function (editor) { Commands.register(editor); Buttons.register(editor); }); function Plugin () { } return Plugin; }()); })(); PK D$�Z�S�( ( "