diff --git a/wp-content/plugins/revisr/LICENSE.txt b/wp-content/plugins/revisr/LICENSE.txt deleted file mode 100644 index 20d40b6b..00000000 --- a/wp-content/plugins/revisr/LICENSE.txt +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If 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 convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU 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 -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. \ No newline at end of file diff --git a/wp-content/plugins/revisr/README.md b/wp-content/plugins/revisr/README.md deleted file mode 100644 index cab477a7..00000000 --- a/wp-content/plugins/revisr/README.md +++ /dev/null @@ -1,295 +0,0 @@ -# Revisr # -**Contributors:** ExpandedFronts -**Tags:** revisr, git, git management, revision tracking, revision, backup, database, database backup, database plugin, deploy, commit, bitbucket, github, version control -**Requires at least:** 3.9.2 -**Tested up to:** 4.3.1 -**Stable tag:** trunk -**License:** GPLv3 -**License URI:** http://www.gnu.org/licenses/gpl.html - -A simple plugin for managing your WordPress website with Git. - -## Description ## - -Revisr allows you to manage your WordPress website with a Git repository. With Revisr, you can: - -* Track changes to your entire WordPress installation, or just the parts that you prefer -* Commit changes from within the WordPress dashboard -* Backup or restore your entire website in seconds -* Set up daily or weekly automatic backups -* Optionally push or pull changes to a remote repository, like Bitbucket or Github -* Test changes out before deploying them to another server -* Revert your website files and/or database to an earlier version -* Quickly discard any unwanted changes - -A must have plugin for deploying and managing WordPress using Git repositories. - - -## Installation ## - -### Requirements ### -* A web server with Git and WordPress installed -* The PHP exec() function enabled - -### Instructions ### -* Unzip the plugin folder and upload it to the plugins directory of your WordPress installation. -* If the WordPress installation is not already in a Git repository, you will be able to create a new one in the Revisr Dashboard. -* Go to the Revisr settings page and adjust any settings as needed. - -### Notes ### -Please verify that database backups are working before attempting to revert the database, especially if attempting to do so on a production website. Backups use the mysqldump command, supported by most hosts/environments. - -If you're using the HTTPS method to connect to the remote repository, the password for the remote repository will be stored in the '.git/config' file. You should take steps to prevent this from being publicly accessible. The following code added to a '.htaccess' file in the '.git/' directory will prevent public access: - -` -content: Deny from all -` - -If you're using NGINX, you'll have to update your configuration file with something similar to the following: -` -location ~ path/to/your-repo/.git { - deny all; -} -` - -This issue can be avoided entirely by using SSH to authenticate, which is recommended in most cases. If using SSH, you will need to generate a SSH key on the server and add it to the remote repository (Bitbucket and Github both support SSH). - -It is also adviseable to add Revisr to the .gitignore file via the settings page to make sure that reverts don't rollback any new functionality. - -## Frequently Asked Questions ## - -### How does Revisr handle the database? ### -You have complete control, and can decide whether you want to track the entire database, just certain tables, or if you don't want to track the database at all. Then, during a backup, the tracked database tables are exported via "mysqldump". When importing or restoring the database to an earlier commit, Revisr first takes a backup of the existing database, creating a restore point from immediately before the import that can be reverted to if needed. - -You can also set a "Development URL" that will be automatically replaced in the database during import- allowing for backups and restores that work on both your dev and live environments. - -### Why aren't my commits being pushed to Bitbucket/GitHub? ### -This is either an authentication issue or the remote branch is ahead of yours. - -### Can I damage my site with this plugin? ### -Care should be taken when dealing with upgrades that depend on the database. Taking verified backups before and after major changes is always recommended. - -## Screenshots ## - -### 1. The main dashboard of Revisr. ### -![1. The main dashboard of Revisr.](http://ps.w.org/revisr/assets/screenshot-1.png) - -### 2. Simple staging area that lets you decide what gets committed. ### -![2. Simple staging area that lets you decide what gets committed.](http://ps.w.org/revisr/assets/screenshot-2.png) - -### 3. Easily view changes in files with Revisr's diffs. ### -![3. Easily view changes in files with Revisr's diffs.](http://ps.w.org/revisr/assets/screenshot-3.png) - -### 4. A comprehensive history of your website, with unlimited restore points. ### -![4. A comprehensive history of your website, with unlimited restore points.](http://ps.w.org/revisr/assets/screenshot-4.png) - - - -## Changelog ## - -### 2.0.2 - December 9, 2015 ### -* Fix: CSS fixes for WordPress 4.4 -* Fix: Broken settings link on "All Plugins" page - -### 2.0.1 - October 30, 2015 ### -* Fix: Bug causing all files to be committed in some cases - -### 2.0 - October 27, 2015 ### -* New: Commits are no longer stored in the database -* New: Setup wizard for when no repo is found -* New: View commits before pushing/pulling them -* New: View remote branches -* New: Sort/paginate branches -* New: Define installation path to Git from the settings page -* New: Action hooks and filters for extending Revisr -* New: Activity log can be filtered by age, event type, or username -* Tweak: Improved commit speed when there are no unstaged files -* Tweak: Include database backups in commit details -* Tweak: Improved general plugin performance -* Tweak: Improved file organization -* Tweak: Improved detection of unpushed commits -* Tweak: Improved information in the Help tab -* Tweak: Always show confirmation dialog before reverts -* Tweak: Removed unused bulk actions for commits -* Tweak: Refactored CSS/JS files -* Fix: PHP notice with saving the .gitignore -* Fix: Minor logging error when committing with "Backup DB" and "Push Changes" checked at the same time -* Fix: Committing a failed database backup -* Fix: Changing salts during a DB import logs a user out with no notification/error in Revisr -* Fix: Bug with the logged "Undo" URL for imports -* Fix: Bug with default sort order in the dashboard -* Fix: Conflict with BuddyPress - -### 1.9.5 ### -* Added sizes to database tables for the "Let me decide..." option -* Added ability to search for commits by the 7-letter commit ID/hash -* Added link/filter for viewing tags on dashboard/commits page -* Improved plugin intiation -* Fixed bug with certain errors saved as an array when making a commit -* Fixed bug with first commit not showing correct branch -* Fixed bug with ".gitignore" not showing latest version of gitignore when updated outside of Revisr - -### 1.9.4 ### -* Added support for sockets in the DB_HOST constant -* Fixed bug causing error on PHP 5.2 -* Fixed bug causing potential error with backups/imports on some systems - -### 1.9.3 ### -* Added option to use WordPress instead of MySQL for backups and imports -* Added ability to backup the database through the "New Commit" screen without any pending files -* Added ability to change the amount of events per page on the Revisr dashboard -* Improved .gitignore functionality, automatically remove cached files from repository index -* Several bugfixes and security improvements - -### 1.9.2 ### -* Improved error handling for commits, pushes, and pulls -* Fixed bug with saving Git username -* Fixed bug with PHP error reporting -* Fixed bug with push count when backing up DB and pushing at the same time -* Fixed CSS issue with viewing untracked tables after importing - -### 1.9.1 ### -* Fixed bug with "Import Pushes" checkbox not showing after saving -* Fixed bug with saving some settings in Windows -* Fixed CSS issue when viewing a branch with no commits -* Small cleanup - -### 1.9 ### -* Added support for multiple commit authors -* Added basic support for custom WordPress file structures -* Added support for PHP autoloading when available -* Added pagination to the "Recent Activity" table on the dashboard page -* Added "Debug" page to the "Revisr Settings" page -* Fixed bug with viewing diffs in Firefox, -* Fixed potential XSS and user escalation vulnerabilities, props @jdgrimes -* General UI improvements -* General performance improvements - -### 1.8.3 ### -* Fixed bug with spaces in filename - -### 1.8.2 ### -* Improved plugin performance -* Fixed bug with timezone on some sites -* Fixed bug with loading translation file -* Changed "Commit Changes" to read "Save Changes" -* Improved Remote URL validation - -### 1.8.1 ### -* Fixed bug resulting from changes in WordPress 4.1 -* Fixed bug with storing webhook URL in some environments - -### 1.8 ### -* Added ability to track individual database tables -* Added ability to import tracked database tables while pulling changes -* Added ability to run a safe search/replace on the database during import to support multiple environments (supports serialization) -* Added unique token to the webhook to improve security (existing webhooks will need to be updated) -* Added fallback to the WordPress database class if mysqldump is not available -* Moved backups to 'wp-content/uploads/revisr-backups/' (path may vary) and automatically generate .htaccess -* Updated pending files count to only show for admins -* Updated error handling for commits -* Small UI improvements - -### 1.7.2 ### -* Tweaked permissions check to only check permissions if repository exists. - -### 1.7.1 ### -* Fixed potential PHP notice with tags widget -* Fixed permissions to just check the ".git/" directory - -### 1.7 ### -* Added ability to create a new repository if one does not already exist -* Added ability to create automatic daily or weekly backups -* Added ability to merge changes -* Added ability to add tags to commits -* Fixed bug with backing up the database when a port is used -* General improvements - -### 1.6.3 ### -* Improvements to the list of committed files -* Small bugfixes - -### 1.6.2 ### -* Added dedicated page for managing branches -* Database backups from the dashboard now automatically create new commits -* Fixed timezone bug on the dashboard -* Improvements to settings page -* Small UI improvements - -### 1.6.1 ### -* Small UI improvements -* Changed Recent Activity to show 15 items -* Fixed bug with multi-site installations -* Fixed bug with reverting files - -### 1.6 ### -* Added internationalization support -* Switched to human-friendly time diffs for Recent Activity -* Fixed bug causing dashboard to freeze in some environments -* Improved error handling -* Removed passthru() functions -* Code cleanup - -### 1.5.2 ### -* Fixed bug with adding certain files -* Restricted access to super admins for multisite installations - -### 1.5.1 ### -* Added support for remote DB hosts -* Fixed bug with deleting files - -### 1.5 ### -* Improved commit interface, added ability to stage individual files -* Added ability to see and revert to changes pulled from a remote -* Added ability to set the name of the remotes (defaults to origin) -* Added ability to set the path to MySQL -* Improved compatibility for Mac and Windows -* Bugfixes and general cleanup - -### 1.4.1 ### -* Added "Backup Database" button to the Quick Actions -* Added number of unpulled/unpushed commits to the Quick Action buttons -* Updated recent activity text - -### 1.4 ### -* Added ability to automatically pull changes from Bitbucket or Github (enabled on the settings page) -* Fixed bug causing call_user_func() error in some enviornments (including Windows) -* Additional validation on Git commands -* Additional error handling -* Fixed bug with saving .gitignore -* Fixed potential bug with viewing pending files -* Minor cleanup - -### 1.3.2 ### -* Bugfixes - -### 1.3.1 ### -* Added error handling -* Commits are no longer automatically pushed by default. This can be changed in the plugin settings page. -* Fixed issue with .gitignore showing as a pending file - -### 1.3 ### -* Added ability to track/revert changes to the database -* The commits listing now shows commits on the current branch by default -* Added basic compatibility check -* Added settings link to the plugin page - -### 1.2.1 ### -* Minor bugfixes - -### 1.2 ### -* Added ability to view the number of pending files in the admin bar -* Small cleanup, updated wording - -### 1.1 ### -* Bugfixes and improvements -* Added ability to view changes in files from a previous commit - -### 1.0.2 ### -* Minor bugfixes - -### 1.0.1 ### -* Updated readme.txt - -### 1.0 ### -* Initial commit diff --git a/wp-content/plugins/revisr/assets/css/revisr-admin.css b/wp-content/plugins/revisr/assets/css/revisr-admin.css deleted file mode 100644 index 4b9c695c..00000000 --- a/wp-content/plugins/revisr/assets/css/revisr-admin.css +++ /dev/null @@ -1,131 +0,0 @@ -/** - * revisr-admin.css - * - * @package Revisr - * @license GPLv3 - * @link https://revisr.io - * @copyright Expanded Fronts, LLC - */ - -/*-------------------------------------------------------------- ->>> TABLE OF CONTENTS: ----------------------------------------------------------------- -# Dashboard Page - ## Recent Activity - ## "Quick Actions" metabox - ## "Branches/Tags" metabox -# Branches Page -# Commits Pages - ## Committed - ## Staging -# Settings Pages -# Setup -# Misc ---------------------------------------------------------------*/ - -/*-------------------------------------------------------------- -# Dashboard Page ---------------------------------------------------------------*/ -.revisr-poststuff { padding-top: 0 !important; } - -/*-------------------------------------------------------------- -## Recent Activity ---------------------------------------------------------------*/ -#revisr-activity-form table th[id=message] { width: 75%; } -#revisr-activity-form .alignleft { display: none; } - -/*-------------------------------------------------------------- -## "Quick Actions" metabox ---------------------------------------------------------------*/ -.revisr-quick-action-btn { width: 100%; text-align: left !important; margin-bottom: 4px !important; } -.revisr-quick-action-btn:before { margin: 5px; display: inline-block; float: left; color: #fff; -webkit-font-smoothing: antialiased; } -.revisr-quick-action-btn-txt { float: left; } -#revisr-commit-btn:before { content: "\f132"; margin: 5px 1px !important; font: normal 20px/1 'dashicons'; color: #444; } -#revisr-discard-btn:before { content: "\f158"; margin: 4px 1px !important; font: normal 20px/1 'dashicons'; color: #444; } -#revisr-backup-btn:before { content: "\f096"; font: normal 17px/1 'octicons'; color: #444; } -#revisr-push-btn:before { content: "\f03d"; font: normal 20px/1 'octicons'; color: #444; } -#revisr-pull-btn:before { content: "\f03f"; font: normal 20px/1 'octicons'; color: #444; } -#revisr-loader { float: right; } - -/*-------------------------------------------------------------- -## "Branches/Tags" metabox ---------------------------------------------------------------*/ -#revisr-branches-tags-widget #branches { padding: 0; } -#revisr-branches-tags-widget #branches-table { border: 0; } -#revisr-branches-tags-widget #branches-table tr:nth-child(odd) { background-color: #f9f9f9; } -#revisr-manage-branches-link { font-size: 12px; } - -/*-------------------------------------------------------------- -# Branches Page ---------------------------------------------------------------*/ -.revisr-col-container { margin-top: 25px !important; } -#revisr-branch-form .tablenav.top { display: none; } -#revisr-add-branch-box { max-width: 280px; } -#revisr-add-branch-box h3 { font-size: 14px; padding: 8px 12px; margin: 0; line-height: 1.4; } -#revisr-add-branch-box #add-branch-submit { text-align: center; margin-bottom: 0; padding-bottom: 0; } - -/*-------------------------------------------------------------- -# Commits ---------------------------------------------------------------*/ -.revisr_page_revisr_commits .alignleft.actions.bulkactions { display: none; } -#revisr-commits-filter #hash, #revisr-commits-filter .column-hash { width:70px !important; } -#revisr-commits-filter .column-title { width: 400px !important; } -#revisr-commits-filter #branch, #revisr-commits-filter #tag, #files_changed, #revisr-commits-filter .column-branch, #revisr-commits-filter .column-tag, .column-files_changed { text-align: center !important; } -.revisr_page_revisr_commits .wrap { margin-top: 27px !important; } - -/*-------------------------------------------------------------- -## Committed ---------------------------------------------------------------*/ -#committed { width: 90%; } -.admin_page_revisr_view_commit .wrap { margin-top: 27px !important; } - -/*-------------------------------------------------------------- -## Staging ---------------------------------------------------------------*/ -#revisr_save_commit .inside, #revisr_view_commit .inside { padding: 0; } -.revisr-timestamp:before { margin-right: 3px; } -#misc-publishing-actions .revisr-octicon-label:before { color: #888; display: inline-block; font: 400 20px/1 octicons; speak: none; left: -1px; position: relative; top: 0; text-decoration: none!important; vertical-align: top; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } -#misc-publishing-actions label[for=revisr-branch]:before { content: '\f020'; padding: 0 7px 0 5px; } -#misc-publishing-actions label[for=revisr-tag]:before { content: '\f015'; padding: 0 5px 0 3px; } -.stage-container { width: 100%; display: inline-block; } -#staged { width: 80%; float: left; overflow-y: scroll; } -#unstaged { width: 80%; float: left; overflow-y: scroll; } -.stage-nav { float: left; margin: 5px; } -.stage-nav-button { margin-top: 7px !important; } -.diff_added { background-color: #cfc; } -.diff_removed { background-color: #fdd; } -.admin_page_revisr_new_commit .wrap { margin-top: 27px !important; } -#revisr-commit-form #title { line-height: normal; } - -/*-------------------------------------------------------------- -# Settings ---------------------------------------------------------------*/ -.revisr-settings-form { margin-left: 15px; } -#verify-remote { margin-left: 10px; padding: 4px; font-size: 11px; border-radius: 4px; color: #fff; margin-left: 10px; } -.verify-remote-success { background-color: #5cb85c; } -.verify-remote-error { background-color: #AFAFAF; } -#gitignore { width: 35em; } -.revisr-description { width: 35em; } -.revisr-text { width: 35em !important; } -#post-hook-input { width: 35em; } -#revisr-debug-table { max-width: 750px; } -body.revisr_page_revisr_settings #site5_wrapper { margin-right: 20px; } - -/*-------------------------------------------------------------- -# Setup ---------------------------------------------------------------*/ -#revisr-setup-container { max-width: 400px; background-color: #fff; color: #444; margin: 140px auto 25px; padding: 30px; -webkit-font-smoothing: subpixel-antialiased; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.13); box-shadow: 0 1px 3px rgba(0,0,0,.13); } -.revisr-setup-input { width: 100% !important; } -.select2-hidden { display:none; } -.revisr-setup-nav { margin-top: 10px; width: 100%; } -.revisr-setup-nav button { width: 48%; } -.revisr-setup-nav:last-child { float: right; } -#revisr-setup-h2 { font-size: 23px; font-weight: 400; padding: 9px 15px 4px 0; line-height: 29px; margin: 0; } - -/*-------------------------------------------------------------- -# Misc ---------------------------------------------------------------*/ -.revisr-arrow-logo { background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOC4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjI0NS44IDM4MS4xIDgxLjkgODkuNSIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAyNDUuOCAzODEuMSA4MS45IDg5LjUiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iIzQ0NCIgZD0iTTI5NS4yLDM4Ny4yYy01LjEsNS4xLTUuMSwxMy4zLDAsMTguM2MzLjgsMy44LDkuMyw0LjcsMTMuOSwyLjlsNy4yLTcuMmMxLjgtNC43LDAuOS0xMC4yLTIuOS0xMy45DQoJQzMwOC41LDM4Mi4xLDMwMC4zLDM4Mi4xLDI5NS4yLDM4Ny4yeiBNMzA5LjcsNDAxLjZjLTIuOSwyLjktNy42LDIuOS0xMC42LDBjLTIuOS0yLjktMi45LTcuNiwwLTEwLjZjMi45LTIuOSw3LjYtMi45LDEwLjYsMA0KCUMzMTIuNiwzOTQsMzEyLjYsMzk4LjcsMzA5LjcsNDAxLjZ6Ii8+DQo8cGF0aCBmaWxsPSIjNDQ0IiBkPSJNMjY4LjEsNDU0Yy0xMy4yLTEwLjEtMTYuMS0yOS02LjQtNDIuNmM0LTUuNiw5LjQtOS40LDE1LjQtMTEuNGwtMi0xMC4yYy04LjUsMi41LTE2LjIsNy43LTIxLjcsMTUuNQ0KCWMtMTIuOSwxOC4yLTguOSw0My41LDguOCw1N2wtNS42LDguM2wyNS45LTEuMmwtOC42LTIzLjZMMjY4LjEsNDU0eiIvPg0KPHBhdGggZmlsbD0iIzQ0NCIgZD0iTTMxOC4zLDQwMy4zYzEuMS0yLjEsMS43LTQuNSwxLjctN2MwLTguNC02LjgtMTUuMi0xNS4yLTE1LjJzLTE1LjIsNi44LTE1LjIsMTUuMnM2LjgsMTUuMiwxNS4yLDE1LjINCgljMi4xLDAsNC4xLTAuNCw1LjktMS4yYzguNCwxMC42LDkuMiwyNS44LDEsMzcuMmMtMy45LDUuNi05LjQsOS40LTE1LjQsMTEuNGwyLDEwLjJjOC41LTIuNSwxNi4yLTcuNywyMS43LTE1LjUNCglDMzMxLjIsNDM4LjEsMzI5LjksNDE3LjQsMzE4LjMsNDAzLjN6IE0zMDQuOCw0MDMuM2MtMy44LDAtNi45LTMuMS02LjktNi45czMuMS02LjksNi45LTYuOXM2LjksMy4xLDYuOSw2LjkNCglTMzA4LjcsNDAzLjMsMzA0LjgsNDAzLjN6Ii8+DQo8L3N2Zz4=); background-repeat: no-repeat; width: 24px; height: 24px; margin-top: 3px; margin-right: 8px; float: left; } -#site5_wrapper { width: 80px; text-align: center; font-size: 11px; float: right; margin: 0 10px 10px 10px; padding: 0 5px; background-color: #fff; border: 1px solid #ddd; } -#site5_logo { width: 80px; margin-top: -5px; } -.revisr-alert { margin: 20px 0 !important;} diff --git a/wp-content/plugins/revisr/assets/css/thickbox.css b/wp-content/plugins/revisr/assets/css/thickbox.css deleted file mode 100644 index 0e3e2cad..00000000 --- a/wp-content/plugins/revisr/assets/css/thickbox.css +++ /dev/null @@ -1,78 +0,0 @@ -/* Thickbox Styles */ -html { - background-color: #fff; - color: #444; - font-family: "Open Sans",sans-serif; - font-size: 14px; - line-height: 1.4em; -} -body { - margin: 0 !important; - overflow: hidden; -} -input[type="text"] { - height: 25px; - font-size: 13px; -} -a { - color: #0074a2 !important; -} -select { - border: 1px solid #ddd; - padding: 2px; - line-height: 28px; - height: 28px; - vertical-align: middle; - font-size: 14px; - background: #fff; - color: #32373c; - outline: 0; -} -.revisr-tb-description { - padding: 10px 15px 10px 15px; - overflow-y: scroll; - height: 155px; -} -.revisr-tb-submit { - width: 100%; - position: fixed; - bottom: 0px; - padding: 15px 0 15px 0; - border-top: 1px solid #ddd; - background-color: #f5f5f5; - text-align: right; -} -.revisr-tb-btn { - height: 30px; - font-size: 14px; - padding: 0 15px; - margin: 0 15px 0 0; - border-radius: 4px; -} -.revisr-tb-btn:hover { - cursor: pointer; -} -.revisr-tb-danger { - background-color:#e14d43; - border:1px #d02c21 solid; - color:#fff; - -webkit-box-shadow: inset 0 1px 0 #ec8b85,0 1px 0 rgba(0,0,0,.15); - box-shadow: inset 0 1px 0 #ec8b85,0 1px 0 rgba(0,0,0,.15); -} -.revisr-tb-danger:hover { - background: #dd382d; - border-color: #ba281e; - color: #fff; - -webkit-box-shadow: inset 0 1px 0 #e8776f; - box-shadow: inset 0 1px 0 #e8776f; -} -.revisr-btn-cancel { - background-color: #f7f7f7; - border: 1px #ccc solid; - color: #555; -} -.revisr-btn-cancel:hover { - background-color: #fafafa; - border: 1px solid #999; - color: #222; -} diff --git a/wp-content/plugins/revisr/assets/img/loader.gif b/wp-content/plugins/revisr/assets/img/loader.gif deleted file mode 100644 index 782e28cb..00000000 Binary files a/wp-content/plugins/revisr/assets/img/loader.gif and /dev/null differ diff --git a/wp-content/plugins/revisr/assets/img/site5.png b/wp-content/plugins/revisr/assets/img/site5.png deleted file mode 100644 index d74ebdfe..00000000 Binary files a/wp-content/plugins/revisr/assets/img/site5.png and /dev/null differ diff --git a/wp-content/plugins/revisr/assets/index.php b/wp-content/plugins/revisr/assets/index.php deleted file mode 100644 index 8142269b..00000000 --- a/wp-content/plugins/revisr/assets/index.php +++ /dev/null @@ -1 +0,0 @@ -' + revisr_dashboard_vars.login_prompt + '

'; - } else { - jQuery('#revisr-loading-alert').hide(); - jQuery('#revisr-processing-request').hide(); - document.getElementById('revisr-alert-container').innerHTML = response; - } - } - }); - } - -/** - * Update the AJAX button counts. - */ -function update_counts() { - jQuery.post(ajaxurl, {action: 'ajax_button_count', data: 'unpulled'}, function(response) { - if ( 0 == response ) { - response = ''; - } - document.getElementById('revisr-unpulled').innerHTML = response; - }); - jQuery.post(ajaxurl, {action: 'ajax_button_count',data: 'unpushed'}, function(response) { - if ( 0 == response ) { - response = ''; - } - document.getElementById('revisr-unpushed').innerHTML = response; - }); -} - -/** - * Display the loading message. - */ -function processing() { - jQuery('.revisr-alert').hide(); - jQuery('#revisr-loader').show(); - jQuery('#revisr-processing-request').show(); -} - -/** - * Run when an AJAX request from the dashboard has been completed. - */ -function process_complete() { - jQuery('#revisr-loader').hide(); - update_alert(); - revisr_list.update(); - update_counts(); - delayed_refresh(); -} - -/** - * Display the branches list. - */ -jQuery('#branches-link').click(function() { - jQuery('#tags-tab').attr('class', 'hide-if-no-js'); - jQuery('#branches-tab').attr('class', 'tabs'); - jQuery('#tags').hide(); - jQuery('#branches').show(); -}); - -/** - * Display the tags list. - */ -jQuery('#tags-link').click(function() { - jQuery('#branches-tab').attr('class', 'hide-if-no-js'); - jQuery('#tags-tab').attr('class', 'tabs'); - jQuery('#branches').hide(); - jQuery('#tags').show(); -}); - -/** - * Redirects to the new commit screen. - */ -jQuery('#revisr-commit-btn').click(function() { - window.location = 'admin.php?page=revisr_new_commit'; -}); - -/** - * Runs when the 'Backup Database' button is clicked. - */ -jQuery('#revisr-backup-btn').click(function() { - processing(); - jQuery.post(ajaxurl, {action: 'backup_db', source: 'ajax_button', revisr_dashboard_nonce: revisr_dashboard_vars.ajax_nonce}, function(response) { - process_complete(); - }); -}); - - -var revisr_list = { - /** - * Register our triggers - * - * We want to capture clicks on specific links, but also value change in - * the pagination input field. The links contain all the information we - * need concerning the wanted page number or ordering, so we'll just - * parse the URL to extract these variables. - * - * The page number input is trickier: it has no URL so we have to find a - * way around. We'll use the hidden inputs added in TT_Example_List_Table::display() - * to recover the ordering variables, and the default paged input added - * automatically by WordPress. - */ - init: function() { - // This will have its utility when dealing with the page number input - var timer; - var delay = 500; - // Pagination links, sortable link - jQuery('.tablenav-pages a, .manage-column.sortable a, .manage-column.sorted a').on('click', function(e) { - // We don't want to actually follow these links - e.preventDefault(); - // Simple way: use the URL to extract our needed variables - var query = this.search.substring( 1 ); - - var data = { - paged: revisr_list.__query( query, 'paged' ) || '1', - order: revisr_list.__query( query, 'order' ) || 'desc', - orderby: revisr_list.__query( query, 'orderby' ) || 'time', - revisr_event: revisr_list.__query( query, 'revisr_event' ) || 'all', - revisr_user: revisr_list.__query( query, 'revisr_user' ) || 'all', - revisr_time: revisr_list.__query( query, 'revisr_time' ) || 'all' - }; - revisr_list.update( data ); - }); - // Page number input - jQuery('input[name=paged]').on('keyup', function(e) { - // If user hit enter, we don't want to submit the form - // We don't preventDefault() for all keys because it would - // also prevent to get the page number! - if ( 13 == e.which ) - e.preventDefault(); - // This time we fetch the variables in inputs - var data = { - paged: parseInt( jQuery('input[name=paged]').val() ) || '1', - order: jQuery('input[name=order]').val() || 'asc', - orderby: jQuery('input[name=orderby]').val() || 'title', - revisr_event : jQuery('input[name=revisr_event]').val() || 'all', - revisr_user : jQuery('input[name=revisr_user]').val() || 'all', - revisr_time : jQuery('input[name=revisr_time]').val() || 'all' - }; - // Now the timer comes to use: we wait half a second after - // the user stopped typing to actually send the call. If - // we don't, the keyup event will trigger instantly and - // thus may cause duplicate calls before sending the intended - // value - window.clearTimeout( timer ); - timer = window.setTimeout(function() { - revisr_list.update( data ); - }, delay); - }); - }, - /** - * AJAX call - * - * Send the call and replace table parts with updated version! - * - * @param object data The data to pass through AJAX - */ - update: function( data ) { - jQuery.ajax({ - // /wp-admin/admin-ajax.php - url: ajaxurl, - // Add action and nonce to our collected data - data: jQuery.extend( - { - revisr_list_nonce: jQuery('#revisr_list_nonce').val(), - action: 'revisr_get_custom_list', - }, - data - ), - // Handle the successful result - success: function( response ) { - // WP_List_Table::ajax_response() returns json - var response = jQuery.parseJSON( response ); - // Add the requested rows - if ( response.rows.length ) - jQuery('#the-list').html( response.rows ); - // Update column headers for sorting - if ( response.column_headers.length ) - jQuery('thead tr, tfoot tr').html( response.column_headers ); - // Update pagination for navigation - if ( response.pagination.bottom.length ) - jQuery('.tablenav.top .tablenav-pages').html( jQuery(response.pagination.top).html() ); - if ( response.pagination.top.length ) - jQuery('.tablenav.bottom .tablenav-pages').html( jQuery(response.pagination.bottom).html() ); - // Init back our event handlers - revisr_list.init(); - } - }); - }, - /** - * Filter the URL Query to extract variables - * - * @see http://css-tricks.com/snippets/javascript/get-url-variables/ - * - * @param string query The URL query part containing the variables - * @param string variable Name of the variable we want to get - * - * @return string|boolean The variable value if available, false else. - */ - __query: function( query, variable ) { - var vars = query.split("&"); - for ( var i = 0; i - - - -(c) 2012-2014 GitHub - -When using the GitHub logos, be sure to follow the GitHub logo guidelines (https://github.com/logos) - -Font License: SIL OFL 1.1 (http://scripts.sil.org/OFL) -Applies to all font files - -Code License: MIT (http://choosealicense.com/licenses/mit/) -Applies to all other files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/wp-content/plugins/revisr/assets/lib/octicons/octicons.ttf b/wp-content/plugins/revisr/assets/lib/octicons/octicons.ttf deleted file mode 100644 index 189ca281..00000000 Binary files a/wp-content/plugins/revisr/assets/lib/octicons/octicons.ttf and /dev/null differ diff --git a/wp-content/plugins/revisr/assets/lib/octicons/octicons.woff b/wp-content/plugins/revisr/assets/lib/octicons/octicons.woff deleted file mode 100644 index 2b770e42..00000000 Binary files a/wp-content/plugins/revisr/assets/lib/octicons/octicons.woff and /dev/null differ diff --git a/wp-content/plugins/revisr/assets/lib/octicons/sprockets-octicons.scss b/wp-content/plugins/revisr/assets/lib/octicons/sprockets-octicons.scss deleted file mode 100644 index 0e518fc1..00000000 --- a/wp-content/plugins/revisr/assets/lib/octicons/sprockets-octicons.scss +++ /dev/null @@ -1,230 +0,0 @@ -@font-face { - font-family: 'octicons'; - src: font-url('octicons.eot?#iefix') format('embedded-opentype'), - font-url('octicons.woff') format('woff'), - font-url('octicons.ttf') format('truetype'), - font-url('octicons.svg#octicons') format('svg'); - font-weight: normal; - font-style: normal; -} - -// .octicon is optimized for 16px. -// .mega-octicon is optimized for 32px but can be used larger. -.octicon, .mega-octicon { - font: normal normal normal 16px/1 octicons; - display: inline-block; - text-decoration: none; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.mega-octicon { font-size: 32px; } - -.octicon-alert:before { content: '\f02d'} /*  */ -.octicon-alignment-align:before { content: '\f08a'} /*  */ -.octicon-alignment-aligned-to:before { content: '\f08e'} /*  */ -.octicon-alignment-unalign:before { content: '\f08b'} /*  */ -.octicon-arrow-down:before { content: '\f03f'} /*  */ -.octicon-arrow-left:before { content: '\f040'} /*  */ -.octicon-arrow-right:before { content: '\f03e'} /*  */ -.octicon-arrow-small-down:before { content: '\f0a0'} /*  */ -.octicon-arrow-small-left:before { content: '\f0a1'} /*  */ -.octicon-arrow-small-right:before { content: '\f071'} /*  */ -.octicon-arrow-small-up:before { content: '\f09f'} /*  */ -.octicon-arrow-up:before { content: '\f03d'} /*  */ -.octicon-beer:before { content: '\f069'} /*  */ -.octicon-book:before { content: '\f007'} /*  */ -.octicon-bookmark:before { content: '\f07b'} /*  */ -.octicon-briefcase:before { content: '\f0d3'} /*  */ -.octicon-broadcast:before { content: '\f048'} /*  */ -.octicon-browser:before { content: '\f0c5'} /*  */ -.octicon-bug:before { content: '\f091'} /*  */ -.octicon-calendar:before { content: '\f068'} /*  */ -.octicon-check:before { content: '\f03a'} /*  */ -.octicon-checklist:before { content: '\f076'} /*  */ -.octicon-chevron-down:before { content: '\f0a3'} /*  */ -.octicon-chevron-left:before { content: '\f0a4'} /*  */ -.octicon-chevron-right:before { content: '\f078'} /*  */ -.octicon-chevron-up:before { content: '\f0a2'} /*  */ -.octicon-circle-slash:before { content: '\f084'} /*  */ -.octicon-circuit-board:before { content: '\f0d6'} /*  */ -.octicon-clippy:before { content: '\f035'} /*  */ -.octicon-clock:before { content: '\f046'} /*  */ -.octicon-cloud-download:before { content: '\f00b'} /*  */ -.octicon-cloud-upload:before { content: '\f00c'} /*  */ -.octicon-code:before { content: '\f05f'} /*  */ -.octicon-color-mode:before { content: '\f065'} /*  */ -.octicon-comment-add:before, -.octicon-comment:before { content: '\f02b'} /*  */ -.octicon-comment-discussion:before { content: '\f04f'} /*  */ -.octicon-credit-card:before { content: '\f045'} /*  */ -.octicon-dash:before { content: '\f0ca'} /*  */ -.octicon-dashboard:before { content: '\f07d'} /*  */ -.octicon-database:before { content: '\f096'} /*  */ -.octicon-device-camera:before { content: '\f056'} /*  */ -.octicon-device-camera-video:before { content: '\f057'} /*  */ -.octicon-device-desktop:before { content: '\f27c'} /*  */ -.octicon-device-mobile:before { content: '\f038'} /*  */ -.octicon-diff:before { content: '\f04d'} /*  */ -.octicon-diff-added:before { content: '\f06b'} /*  */ -.octicon-diff-ignored:before { content: '\f099'} /*  */ -.octicon-diff-modified:before { content: '\f06d'} /*  */ -.octicon-diff-removed:before { content: '\f06c'} /*  */ -.octicon-diff-renamed:before { content: '\f06e'} /*  */ -.octicon-ellipsis:before { content: '\f09a'} /*  */ -.octicon-eye-unwatch:before, -.octicon-eye-watch:before, -.octicon-eye:before { content: '\f04e'} /*  */ -.octicon-file-binary:before { content: '\f094'} /*  */ -.octicon-file-code:before { content: '\f010'} /*  */ -.octicon-file-directory:before { content: '\f016'} /*  */ -.octicon-file-media:before { content: '\f012'} /*  */ -.octicon-file-pdf:before { content: '\f014'} /*  */ -.octicon-file-submodule:before { content: '\f017'} /*  */ -.octicon-file-symlink-directory:before { content: '\f0b1'} /*  */ -.octicon-file-symlink-file:before { content: '\f0b0'} /*  */ -.octicon-file-text:before { content: '\f011'} /*  */ -.octicon-file-zip:before { content: '\f013'} /*  */ -.octicon-flame:before { content: '\f0d2'} /*  */ -.octicon-fold:before { content: '\f0cc'} /*  */ -.octicon-gear:before { content: '\f02f'} /*  */ -.octicon-gift:before { content: '\f042'} /*  */ -.octicon-gist:before { content: '\f00e'} /*  */ -.octicon-gist-secret:before { content: '\f08c'} /*  */ -.octicon-git-branch-create:before, -.octicon-git-branch-delete:before, -.octicon-git-branch:before { content: '\f020'} /*  */ -.octicon-git-commit:before { content: '\f01f'} /*  */ -.octicon-git-compare:before { content: '\f0ac'} /*  */ -.octicon-git-merge:before { content: '\f023'} /*  */ -.octicon-git-pull-request-abandoned:before, -.octicon-git-pull-request:before { content: '\f009'} /*  */ -.octicon-globe:before { content: '\f0b6'} /*  */ -.octicon-graph:before { content: '\f043'} /*  */ -.octicon-heart:before { content: '\2665'} /* ♥ */ -.octicon-history:before { content: '\f07e'} /*  */ -.octicon-home:before { content: '\f08d'} /*  */ -.octicon-horizontal-rule:before { content: '\f070'} /*  */ -.octicon-hourglass:before { content: '\f09e'} /*  */ -.octicon-hubot:before { content: '\f09d'} /*  */ -.octicon-inbox:before { content: '\f0cf'} /*  */ -.octicon-info:before { content: '\f059'} /*  */ -.octicon-issue-closed:before { content: '\f028'} /*  */ -.octicon-issue-opened:before { content: '\f026'} /*  */ -.octicon-issue-reopened:before { content: '\f027'} /*  */ -.octicon-jersey:before { content: '\f019'} /*  */ -.octicon-jump-down:before { content: '\f072'} /*  */ -.octicon-jump-left:before { content: '\f0a5'} /*  */ -.octicon-jump-right:before { content: '\f0a6'} /*  */ -.octicon-jump-up:before { content: '\f073'} /*  */ -.octicon-key:before { content: '\f049'} /*  */ -.octicon-keyboard:before { content: '\f00d'} /*  */ -.octicon-law:before { content: '\f0d8'} /* */ -.octicon-light-bulb:before { content: '\f000'} /*  */ -.octicon-link:before { content: '\f05c'} /*  */ -.octicon-link-external:before { content: '\f07f'} /*  */ -.octicon-list-ordered:before { content: '\f062'} /*  */ -.octicon-list-unordered:before { content: '\f061'} /*  */ -.octicon-location:before { content: '\f060'} /*  */ -.octicon-gist-private:before, -.octicon-mirror-private:before, -.octicon-git-fork-private:before, -.octicon-lock:before { content: '\f06a'} /*  */ -.octicon-logo-github:before { content: '\f092'} /*  */ -.octicon-mail:before { content: '\f03b'} /*  */ -.octicon-mail-read:before { content: '\f03c'} /*  */ -.octicon-mail-reply:before { content: '\f051'} /*  */ -.octicon-mark-github:before { content: '\f00a'} /*  */ -.octicon-markdown:before { content: '\f0c9'} /*  */ -.octicon-megaphone:before { content: '\f077'} /*  */ -.octicon-mention:before { content: '\f0be'} /*  */ -.octicon-microscope:before { content: '\f089'} /*  */ -.octicon-milestone:before { content: '\f075'} /*  */ -.octicon-mirror-public:before, -.octicon-mirror:before { content: '\f024'} /*  */ -.octicon-mortar-board:before { content: '\f0d7'} /* */ -.octicon-move-down:before { content: '\f0a8'} /*  */ -.octicon-move-left:before { content: '\f074'} /*  */ -.octicon-move-right:before { content: '\f0a9'} /*  */ -.octicon-move-up:before { content: '\f0a7'} /*  */ -.octicon-mute:before { content: '\f080'} /*  */ -.octicon-no-newline:before { content: '\f09c'} /*  */ -.octicon-octoface:before { content: '\f008'} /*  */ -.octicon-organization:before { content: '\f037'} /*  */ -.octicon-package:before { content: '\f0c4'} /*  */ -.octicon-paintcan:before { content: '\f0d1'} /*  */ -.octicon-pencil:before { content: '\f058'} /*  */ -.octicon-person-add:before, -.octicon-person-follow:before, -.octicon-person:before { content: '\f018'} /*  */ -.octicon-pin:before { content: '\f041'} /*  */ -.octicon-playback-fast-forward:before { content: '\f0bd'} /*  */ -.octicon-playback-pause:before { content: '\f0bb'} /*  */ -.octicon-playback-play:before { content: '\f0bf'} /*  */ -.octicon-playback-rewind:before { content: '\f0bc'} /*  */ -.octicon-plug:before { content: '\f0d4'} /*  */ -.octicon-repo-create:before, -.octicon-gist-new:before, -.octicon-file-directory-create:before, -.octicon-file-add:before, -.octicon-plus:before { content: '\f05d'} /*  */ -.octicon-podium:before { content: '\f0af'} /*  */ -.octicon-primitive-dot:before { content: '\f052'} /*  */ -.octicon-primitive-square:before { content: '\f053'} /*  */ -.octicon-pulse:before { content: '\f085'} /*  */ -.octicon-puzzle:before { content: '\f0c0'} /*  */ -.octicon-question:before { content: '\f02c'} /*  */ -.octicon-quote:before { content: '\f063'} /*  */ -.octicon-radio-tower:before { content: '\f030'} /*  */ -.octicon-repo-delete:before, -.octicon-repo:before { content: '\f001'} /*  */ -.octicon-repo-clone:before { content: '\f04c'} /*  */ -.octicon-repo-force-push:before { content: '\f04a'} /*  */ -.octicon-gist-fork:before, -.octicon-repo-forked:before { content: '\f002'} /*  */ -.octicon-repo-pull:before { content: '\f006'} /*  */ -.octicon-repo-push:before { content: '\f005'} /*  */ -.octicon-rocket:before { content: '\f033'} /*  */ -.octicon-rss:before { content: '\f034'} /*  */ -.octicon-ruby:before { content: '\f047'} /*  */ -.octicon-screen-full:before { content: '\f066'} /*  */ -.octicon-screen-normal:before { content: '\f067'} /*  */ -.octicon-search-save:before, -.octicon-search:before { content: '\f02e'} /*  */ -.octicon-server:before { content: '\f097'} /*  */ -.octicon-settings:before { content: '\f07c'} /*  */ -.octicon-log-in:before, -.octicon-sign-in:before { content: '\f036'} /*  */ -.octicon-log-out:before, -.octicon-sign-out:before { content: '\f032'} /*  */ -.octicon-split:before { content: '\f0c6'} /*  */ -.octicon-squirrel:before { content: '\f0b2'} /*  */ -.octicon-star-add:before, -.octicon-star-delete:before, -.octicon-star:before { content: '\f02a'} /*  */ -.octicon-steps:before { content: '\f0c7'} /*  */ -.octicon-stop:before { content: '\f08f'} /*  */ -.octicon-repo-sync:before, -.octicon-sync:before { content: '\f087'} /*  */ -.octicon-tag-remove:before, -.octicon-tag-add:before, -.octicon-tag:before { content: '\f015'} /*  */ -.octicon-telescope:before { content: '\f088'} /*  */ -.octicon-terminal:before { content: '\f0c8'} /*  */ -.octicon-three-bars:before { content: '\f05e'} /*  */ -.octicon-tools:before { content: '\f031'} /*  */ -.octicon-trashcan:before { content: '\f0d0'} /*  */ -.octicon-triangle-down:before { content: '\f05b'} /*  */ -.octicon-triangle-left:before { content: '\f044'} /*  */ -.octicon-triangle-right:before { content: '\f05a'} /*  */ -.octicon-triangle-up:before { content: '\f0aa'} /*  */ -.octicon-unfold:before { content: '\f039'} /*  */ -.octicon-unmute:before { content: '\f0ba'} /*  */ -.octicon-versions:before { content: '\f064'} /*  */ -.octicon-remove-close:before, -.octicon-x:before { content: '\f081'} /*  */ -.octicon-zap:before { content: '\26A1'} /* ⚡ */ diff --git a/wp-content/plugins/revisr/assets/lib/select2/css/select2.css b/wp-content/plugins/revisr/assets/lib/select2/css/select2.css deleted file mode 100644 index d365213c..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/css/select2.css +++ /dev/null @@ -1,431 +0,0 @@ -.select2-container { - box-sizing: border-box; - display: inline-block; - margin: 0; - position: relative; - vertical-align: middle; } - .select2-container .select2-selection--single { - box-sizing: border-box; - cursor: pointer; - display: block; - height: 28px; - user-select: none; - -webkit-user-select: none; } - .select2-container .select2-selection--single .select2-selection__rendered { - display: block; - padding-left: 8px; - padding-right: 20px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; } - .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { - padding-right: 8px; - padding-left: 20px; } - .select2-container .select2-selection--multiple { - box-sizing: border-box; - cursor: pointer; - display: block; - min-height: 32px; - user-select: none; - -webkit-user-select: none; } - .select2-container .select2-selection--multiple .select2-selection__rendered { - display: inline-block; - overflow: hidden; - padding-left: 8px; - text-overflow: ellipsis; - white-space: nowrap; } - .select2-container .select2-search--inline { - float: left; } - .select2-container .select2-search--inline .select2-search__field { - box-sizing: border-box; - border: none; - font-size: 100%; - margin-top: 5px; } - .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button { - -webkit-appearance: none; } - -.select2-dropdown { - background-color: white; - border: 1px solid #aaa; - border-radius: 4px; - box-sizing: border-box; - display: block; - position: absolute; - left: -100000px; - width: 100%; - z-index: 1051; } - -.select2-results { - display: block; } - -.select2-results__options { - list-style: none; - margin: 0; - padding: 0; } - -.select2-results__option { - padding: 6px; - user-select: none; - -webkit-user-select: none; } - .select2-results__option[aria-selected] { - cursor: pointer; } - -.select2-container--open .select2-dropdown { - left: 0; } - -.select2-container--open .select2-dropdown--above { - border-bottom: none; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; } - -.select2-container--open .select2-dropdown--below { - border-top: none; - border-top-left-radius: 0; - border-top-right-radius: 0; } - -.select2-search--dropdown { - display: block; - padding: 4px; } - .select2-search--dropdown .select2-search__field { - padding: 4px; - width: 100%; - box-sizing: border-box; } - .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button { - -webkit-appearance: none; } - .select2-search--dropdown.select2-search--hide { - display: none; } - -.select2-close-mask { - border: 0; - margin: 0; - padding: 0; - display: block; - position: fixed; - left: 0; - top: 0; - min-height: 100%; - min-width: 100%; - height: auto; - width: auto; - opacity: 0; - z-index: 99; - background-color: #fff; - filter: alpha(opacity=0); } - -.select2-hidden-accessible { - border: 0; - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; } - -.select2-container--default .select2-selection--single { - background-color: #fff; - border: 1px solid #aaa; - border-radius: 4px; } - .select2-container--default .select2-selection--single .select2-selection__rendered { - color: #444; - line-height: 28px; } - .select2-container--default .select2-selection--single .select2-selection__clear { - cursor: pointer; - float: right; - font-weight: bold; } - .select2-container--default .select2-selection--single .select2-selection__placeholder { - color: #999; } - .select2-container--default .select2-selection--single .select2-selection__arrow { - height: 26px; - position: absolute; - top: 1px; - right: 1px; - width: 20px; } - .select2-container--default .select2-selection--single .select2-selection__arrow b { - border-color: #888 transparent transparent transparent; - border-style: solid; - border-width: 5px 4px 0 4px; - height: 0; - left: 50%; - margin-left: -4px; - margin-top: -2px; - position: absolute; - top: 50%; - width: 0; } -.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear { - float: left; } -.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow { - left: 1px; - right: auto; } -.select2-container--default.select2-container--disabled .select2-selection--single { - background-color: #eee; - cursor: default; } - .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear { - display: none; } -.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { - border-color: transparent transparent #888 transparent; - border-width: 0 4px 5px 4px; } -.select2-container--default .select2-selection--multiple { - background-color: white; - border: 1px solid #aaa; - border-radius: 4px; - cursor: text; } - .select2-container--default .select2-selection--multiple .select2-selection__rendered { - box-sizing: border-box; - list-style: none; - margin: 0; - padding: 0 5px; - width: 100%; } - .select2-container--default .select2-selection--multiple .select2-selection__placeholder { - color: #999; - margin-top: 5px; - float: left; } - .select2-container--default .select2-selection--multiple .select2-selection__clear { - cursor: pointer; - float: right; - font-weight: bold; - margin-top: 5px; - margin-right: 10px; } - .select2-container--default .select2-selection--multiple .select2-selection__choice { - background-color: #e4e4e4; - border: 1px solid #aaa; - border-radius: 4px; - cursor: default; - float: left; - margin-right: 5px; - margin-top: 5px; - padding: 0 5px; } - .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { - color: #999; - cursor: pointer; - display: inline-block; - font-weight: bold; - margin-right: 2px; } - .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { - color: #333; } -.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder { - float: right; } -.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { - margin-left: 5px; - margin-right: auto; } -.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { - margin-left: 2px; - margin-right: auto; } -.select2-container--default.select2-container--focus .select2-selection--multiple { - border: solid black 1px; - outline: 0; } -.select2-container--default.select2-container--disabled .select2-selection--multiple { - background-color: #eee; - cursor: default; } -.select2-container--default.select2-container--disabled .select2-selection__choice__remove { - display: none; } -.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple { - border-top-left-radius: 0; - border-top-right-radius: 0; } -.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple { - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; } -.select2-container--default .select2-search--dropdown .select2-search__field { - border: 1px solid #aaa; } -.select2-container--default .select2-search--inline .select2-search__field { - background: transparent; - border: none; - outline: 0; } -.select2-container--default .select2-results > .select2-results__options { - max-height: 200px; - overflow-y: auto; } -.select2-container--default .select2-results__option[role=group] { - padding: 0; } -.select2-container--default .select2-results__option[aria-disabled=true] { - color: #999; } -.select2-container--default .select2-results__option[aria-selected=true] { - background-color: #ddd; } -.select2-container--default .select2-results__option .select2-results__option { - padding-left: 1em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__group { - padding-left: 0; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option { - margin-left: -1em; - padding-left: 2em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option { - margin-left: -2em; - padding-left: 3em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { - margin-left: -3em; - padding-left: 4em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { - margin-left: -4em; - padding-left: 5em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { - margin-left: -5em; - padding-left: 6em; } -.select2-container--default .select2-results__option--highlighted[aria-selected] { - background-color: #5897fb; - color: white; } -.select2-container--default .select2-results__group { - cursor: default; - display: block; - padding: 6px; } - -.select2-container--classic .select2-selection--single { - background-color: #f6f6f6; - border: 1px solid #aaa; - border-radius: 4px; - outline: 0; - background-image: -webkit-linear-gradient(top, #ffffff 50%, #eeeeee 100%); - background-image: -o-linear-gradient(top, #ffffff 50%, #eeeeee 100%); - background-image: linear-gradient(to bottom, #ffffff 50%, #eeeeee 100%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); } - .select2-container--classic .select2-selection--single:focus { - border: 1px solid #5897fb; } - .select2-container--classic .select2-selection--single .select2-selection__rendered { - color: #444; - line-height: 28px; } - .select2-container--classic .select2-selection--single .select2-selection__clear { - cursor: pointer; - float: right; - font-weight: bold; - margin-right: 10px; } - .select2-container--classic .select2-selection--single .select2-selection__placeholder { - color: #999; } - .select2-container--classic .select2-selection--single .select2-selection__arrow { - background-color: #ddd; - border: none; - border-left: 1px solid #aaa; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - height: 26px; - position: absolute; - top: 1px; - right: 1px; - width: 20px; - background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%); - background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%); - background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0); } - .select2-container--classic .select2-selection--single .select2-selection__arrow b { - border-color: #888 transparent transparent transparent; - border-style: solid; - border-width: 5px 4px 0 4px; - height: 0; - left: 50%; - margin-left: -4px; - margin-top: -2px; - position: absolute; - top: 50%; - width: 0; } -.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { - float: left; } -.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { - border: none; - border-right: 1px solid #aaa; - border-radius: 0; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; - left: 1px; - right: auto; } -.select2-container--classic.select2-container--open .select2-selection--single { - border: 1px solid #5897fb; } - .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow { - background: transparent; - border: none; } - .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b { - border-color: transparent transparent #888 transparent; - border-width: 0 4px 5px 4px; } -.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single { - border-top: none; - border-top-left-radius: 0; - border-top-right-radius: 0; - background-image: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 50%); - background-image: -o-linear-gradient(top, #ffffff 0%, #eeeeee 50%); - background-image: linear-gradient(to bottom, #ffffff 0%, #eeeeee 50%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); } -.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single { - border-bottom: none; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - background-image: -webkit-linear-gradient(top, #eeeeee 50%, #ffffff 100%); - background-image: -o-linear-gradient(top, #eeeeee 50%, #ffffff 100%); - background-image: linear-gradient(to bottom, #eeeeee 50%, #ffffff 100%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); } -.select2-container--classic .select2-selection--multiple { - background-color: white; - border: 1px solid #aaa; - border-radius: 4px; - cursor: text; - outline: 0; } - .select2-container--classic .select2-selection--multiple:focus { - border: 1px solid #5897fb; } - .select2-container--classic .select2-selection--multiple .select2-selection__rendered { - list-style: none; - margin: 0; - padding: 0 5px; } - .select2-container--classic .select2-selection--multiple .select2-selection__clear { - display: none; } - .select2-container--classic .select2-selection--multiple .select2-selection__choice { - background-color: #e4e4e4; - border: 1px solid #aaa; - border-radius: 4px; - cursor: default; - float: left; - margin-right: 5px; - margin-top: 5px; - padding: 0 5px; } - .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove { - color: #888; - cursor: pointer; - display: inline-block; - font-weight: bold; - margin-right: 2px; } - .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover { - color: #555; } -.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { - float: right; } -.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { - margin-left: 5px; - margin-right: auto; } -.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { - margin-left: 2px; - margin-right: auto; } -.select2-container--classic.select2-container--open .select2-selection--multiple { - border: 1px solid #5897fb; } -.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple { - border-top: none; - border-top-left-radius: 0; - border-top-right-radius: 0; } -.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple { - border-bottom: none; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; } -.select2-container--classic .select2-search--dropdown .select2-search__field { - border: 1px solid #aaa; - outline: 0; } -.select2-container--classic .select2-search--inline .select2-search__field { - outline: 0; } -.select2-container--classic .select2-dropdown { - background-color: white; - border: 1px solid transparent; } -.select2-container--classic .select2-dropdown--above { - border-bottom: none; } -.select2-container--classic .select2-dropdown--below { - border-top: none; } -.select2-container--classic .select2-results > .select2-results__options { - max-height: 200px; - overflow-y: auto; } -.select2-container--classic .select2-results__option[role=group] { - padding: 0; } -.select2-container--classic .select2-results__option[aria-disabled=true] { - color: grey; } -.select2-container--classic .select2-results__option--highlighted[aria-selected] { - background-color: #3875d7; - color: white; } -.select2-container--classic .select2-results__group { - cursor: default; - display: block; - padding: 6px; } -.select2-container--classic.select2-container--open .select2-dropdown { - border-color: #5897fb; } diff --git a/wp-content/plugins/revisr/assets/lib/select2/css/select2.min.css b/wp-content/plugins/revisr/assets/lib/select2/css/select2.min.css deleted file mode 100644 index 1c723442..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/css/select2.min.css +++ /dev/null @@ -1 +0,0 @@ -.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none;}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px;}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none;}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap;}.select2-container .select2-search--inline{float:left;}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none;}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051;}.select2-results{display:block;}.select2-results__options{list-style:none;margin:0;padding:0;}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none;}.select2-results__option[aria-selected]{cursor:pointer;}.select2-container--open .select2-dropdown{left:0;}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0;}.select2-search--dropdown{display:block;padding:4px;}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box;}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none;}.select2-search--dropdown.select2-search--hide{display:none;}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0);}.select2-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px;}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px;}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999;}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px;}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0;}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left;}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto;}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default;}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none;}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px;}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%;}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left;}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px;}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px;}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder{float:right;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto;}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0;}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default;}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none;}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0;}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa;}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto;}.select2-container--default .select2-results__option[role=group]{padding:0;}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999;}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd;}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em;}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white;}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px;}.select2-container--classic .select2-selection--single{background-color:#f6f6f6;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #ffffff 50%, #eeeeee 100%);background-image:-o-linear-gradient(top, #ffffff 50%, #eeeeee 100%);background-image:linear-gradient(to bottom, #ffffff 50%, #eeeeee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb;}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px;}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px;}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999;}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0);}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0;}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left;}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto;}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb;}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none;}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px;}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #ffffff 0%, #eeeeee 50%);background-image:-o-linear-gradient(top, #ffffff 0%, #eeeeee 50%);background-image:linear-gradient(to bottom, #ffffff 0%, #eeeeee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eeeeee 50%, #ffffff 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #ffffff 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #ffffff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0;}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb;}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px;}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none;}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px;}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px;}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto;}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb;}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0;}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0;}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;}.select2-container--classic .select2-dropdown{background-color:white;border:1px solid transparent;}.select2-container--classic .select2-dropdown--above{border-bottom:none;}.select2-container--classic .select2-dropdown--below{border-top:none;}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto;}.select2-container--classic .select2-results__option[role=group]{padding:0;}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey;}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:white;}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px;}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb;} \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/az.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/az.js deleted file mode 100644 index 3ad855a7..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/az.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/bg.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/bg.js deleted file mode 100644 index edad761b..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/bg.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ca.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ca.js deleted file mode 100644 index 3f5db5ea..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ca.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/cs.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/cs.js deleted file mode 100644 index d5823e96..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/cs.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak méně":n<=4?"Prosím zadejte o "+e(n,!0)+" znaky méně":"Prosím zadejte o "+n+" znaků méně"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím zadejte ještě jeden znak":n<=4?"Prosím zadejte ještě další "+e(n,!0)+" znaky":"Prosím zadejte ještě dalších "+n+" znaků"},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky":"Můžete zvolit maximálně "+n+" položek"},noResults:function(){return"Nenalezeny žádné položky"},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/da.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/da.js deleted file mode 100644 index e9d25315..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/da.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Angiv venligst "+t+" tegn mindre";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Angiv venligst "+t+" tegn mere";return n},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/de.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/de.js deleted file mode 100644 index 2224138e..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/de.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/en.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/en.js deleted file mode 100644 index 869dfd7b..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/en.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/es.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/es.js deleted file mode 100644 index f12d3f52..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/es.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/et.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/et.js deleted file mode 100644 index b0603bdc..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/et.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/eu.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/eu.js deleted file mode 100644 index 3abb677a..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/eu.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/fa.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/fa.js deleted file mode 100644 index 49abc419..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/fa.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها می‌توانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/fi.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/fi.js deleted file mode 100644 index fef0d8b5..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/fi.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/fr.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/fr.js deleted file mode 100644 index 44395226..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/fr.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Supprimez "+t+" caractère";return t!==1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Saisissez "+t+" caractère";return t!==1&&(n+="s"),n},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){var t="Vous pouvez seulement sélectionner "+e.maximum+" élément";return e.maximum!==1&&(t+="s"),t},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/gl.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/gl.js deleted file mode 100644 index 9e593af4..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/gl.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Engada ";return t===1?n+="un carácter":n+=t+" caracteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Elimine ";return t===1?n+="un carácter":n+=t+" caracteres",n},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){var t="Só pode ";return e.maximum===1?t+="un elemento":t+=e.maximum+" elementos",t},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/he.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/he.js deleted file mode 100644 index c5102c31..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/he.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"התוצאות לא נטענו בהלכה"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק "+t+" תווים";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס "+t+" תווים או יותר";return n},loadingMore:function(){return"טען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור רק "+e.maximum+" פריטים";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/hi.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/hi.js deleted file mode 100644 index f8dd58a4..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/hi.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/hr.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/hr.js deleted file mode 100644 index a783b3fb..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/hr.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/hu.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/hu.js deleted file mode 100644 index d13fea25..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/hu.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/id.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/id.js deleted file mode 100644 index 7ffb8dbd..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/id.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/is.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/is.js deleted file mode 100644 index 588ec1de..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/is.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/it.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/it.js deleted file mode 100644 index 0488d3b1..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/it.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ko.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ko.js deleted file mode 100644 index 80b5a8b2..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ko.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/lt.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/lt.js deleted file mode 100644 index 27cfe364..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/lt.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%100>9&&e%100<21||e%10===0?e%10>1?n:r:t}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"ių","ius","į"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"ių","ius","į"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ų","us","ą"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/lv.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/lv.js deleted file mode 100644 index b47bc8e2..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/lv.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/mk.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/mk.js deleted file mode 100644 index 065a47a0..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/mk.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/nb.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/nb.js deleted file mode 100644 index d7328a25..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/nb.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn ";return t>1?n+=" flere tegn":n+=" tegn til",n},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/nl.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/nl.js deleted file mode 100644 index b30c81c7..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/nl.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t="Er kunnen maar "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t+=" worden geselecteerd",t},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/pl.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/pl.js deleted file mode 100644 index 0c0923c2..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/pl.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maxiumum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/pt-BR.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/pt-BR.js deleted file mode 100644 index 25351146..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/pt-BR.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/pt.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/pt.js deleted file mode 100644 index 6dcc51f0..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/pt.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"carácter",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ro.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ro.js deleted file mode 100644 index 61e7f123..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ro.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să introduceți mai puțin de "+t;return n+=" caracter",n!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți incă "+t;return n+=" caracter",n!==1&&(n+="e"),n},loadingMore:function(){return"Se încarcă…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",t!==1&&(t+="e"),t},noResults:function(){return"Nu a fost găsit nimic"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ru.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ru.js deleted file mode 100644 index e082600f..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/ru.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/sk.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/sk.js deleted file mode 100644 index 8f928556..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/sk.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/sr.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/sr.js deleted file mode 100644 index 5ed6a817..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/sr.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/sv.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/sv.js deleted file mode 100644 index 1934e365..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/sv.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/th.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/th.js deleted file mode 100644 index 91c911c4..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/th.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/tr.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/tr.js deleted file mode 100644 index 2d616c80..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/tr.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/uk.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/uk.js deleted file mode 100644 index ea34a4a1..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/uk.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/vi.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/vi.js deleted file mode 100644 index 5c22a14b..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/vi.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+' ký tự"';return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/zh-CN.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/zh-CN.js deleted file mode 100644 index df0ea410..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/zh-CN.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/zh-TW.js b/wp-content/plugins/revisr/assets/lib/select2/js/i18n/zh-TW.js deleted file mode 100644 index 017483be..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/i18n/zh-TW.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ - -(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})(); \ No newline at end of file diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/select2.full.js b/wp-content/plugins/revisr/assets/lib/select2/js/select2.full.js deleted file mode 100644 index dd0e8bc7..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/select2.full.js +++ /dev/null @@ -1,6114 +0,0 @@ -/*! - * Select2 4.0.0 - * https://select2.github.io - * - * Released under the MIT license - * https://github.com/select2/select2/blob/master/LICENSE.md - */ -(function (factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['jquery'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS - factory(require('jquery')); - } else { - // Browser globals - factory(jQuery); - } -}(function (jQuery) { - // This is needed so we can catch the AMD loader configuration and use it - // The inner file should be wrapped (by `banner.start.js`) in a function that - // returns the AMD loader references. - var S2 = -(function () { - // Restore the Select2 AMD loader so it can be used - // Needed mostly in the language files, where the loader is not inserted - if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) { - var S2 = jQuery.fn.select2.amd; - } -var S2;(function () { if (!S2 || !S2.requirejs) { -if (!S2) { S2 = {}; } else { require = S2; } -/** - * @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/almond for details - */ -//Going sloppy to avoid 'use strict' string cost, but strict practices should -//be followed. -/*jslint sloppy: true */ -/*global setTimeout: false */ - -var requirejs, require, define; -(function (undef) { - var main, req, makeMap, handlers, - defined = {}, - waiting = {}, - config = {}, - defining = {}, - hasOwn = Object.prototype.hasOwnProperty, - aps = [].slice, - jsSuffixRegExp = /\.js$/; - - function hasProp(obj, prop) { - return hasOwn.call(obj, prop); - } - - /** - * Given a relative module name, like ./something, normalize it to - * a real name that can be mapped to a path. - * @param {String} name the relative name - * @param {String} baseName a real name that the name arg is relative - * to. - * @returns {String} normalized name - */ - function normalize(name, baseName) { - var nameParts, nameSegment, mapValue, foundMap, lastIndex, - foundI, foundStarMap, starI, i, j, part, - baseParts = baseName && baseName.split("/"), - map = config.map, - starMap = (map && map['*']) || {}; - - //Adjust any relative paths. - if (name && name.charAt(0) === ".") { - //If have a base name, try to normalize against it, - //otherwise, assume it is a top-level require that will - //be relative to baseUrl in the end. - if (baseName) { - //Convert baseName to array, and lop off the last part, - //so that . matches that "directory" and not name of the baseName's - //module. For instance, baseName of "one/two/three", maps to - //"one/two/three.js", but we want the directory, "one/two" for - //this normalization. - baseParts = baseParts.slice(0, baseParts.length - 1); - name = name.split('/'); - lastIndex = name.length - 1; - - // Node .js allowance: - if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { - name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); - } - - name = baseParts.concat(name); - - //start trimDots - for (i = 0; i < name.length; i += 1) { - part = name[i]; - if (part === ".") { - name.splice(i, 1); - i -= 1; - } else if (part === "..") { - if (i === 1 && (name[2] === '..' || name[0] === '..')) { - //End of the line. Keep at least one non-dot - //path segment at the front so it can be mapped - //correctly to disk. Otherwise, there is likely - //no path mapping for a path starting with '..'. - //This can still fail, but catches the most reasonable - //uses of .. - break; - } else if (i > 0) { - name.splice(i - 1, 2); - i -= 2; - } - } - } - //end trimDots - - name = name.join("/"); - } else if (name.indexOf('./') === 0) { - // No baseName, so this is ID is resolved relative - // to baseUrl, pull off the leading dot. - name = name.substring(2); - } - } - - //Apply map config if available. - if ((baseParts || starMap) && map) { - nameParts = name.split('/'); - - for (i = nameParts.length; i > 0; i -= 1) { - nameSegment = nameParts.slice(0, i).join("/"); - - if (baseParts) { - //Find the longest baseName segment match in the config. - //So, do joins on the biggest to smallest lengths of baseParts. - for (j = baseParts.length; j > 0; j -= 1) { - mapValue = map[baseParts.slice(0, j).join('/')]; - - //baseName segment has config, find if it has one for - //this name. - if (mapValue) { - mapValue = mapValue[nameSegment]; - if (mapValue) { - //Match, update name to the new value. - foundMap = mapValue; - foundI = i; - break; - } - } - } - } - - if (foundMap) { - break; - } - - //Check for a star map match, but just hold on to it, - //if there is a shorter segment match later in a matching - //config, then favor over this star map. - if (!foundStarMap && starMap && starMap[nameSegment]) { - foundStarMap = starMap[nameSegment]; - starI = i; - } - } - - if (!foundMap && foundStarMap) { - foundMap = foundStarMap; - foundI = starI; - } - - if (foundMap) { - nameParts.splice(0, foundI, foundMap); - name = nameParts.join('/'); - } - } - - return name; - } - - function makeRequire(relName, forceSync) { - return function () { - //A version of a require function that passes a moduleName - //value for items that may need to - //look up paths relative to the moduleName - return req.apply(undef, aps.call(arguments, 0).concat([relName, forceSync])); - }; - } - - function makeNormalize(relName) { - return function (name) { - return normalize(name, relName); - }; - } - - function makeLoad(depName) { - return function (value) { - defined[depName] = value; - }; - } - - function callDep(name) { - if (hasProp(waiting, name)) { - var args = waiting[name]; - delete waiting[name]; - defining[name] = true; - main.apply(undef, args); - } - - if (!hasProp(defined, name) && !hasProp(defining, name)) { - throw new Error('No ' + name); - } - return defined[name]; - } - - //Turns a plugin!resource to [plugin, resource] - //with the plugin being undefined if the name - //did not have a plugin prefix. - function splitPrefix(name) { - var prefix, - index = name ? name.indexOf('!') : -1; - if (index > -1) { - prefix = name.substring(0, index); - name = name.substring(index + 1, name.length); - } - return [prefix, name]; - } - - /** - * Makes a name map, normalizing the name, and using a plugin - * for normalization if necessary. Grabs a ref to plugin - * too, as an optimization. - */ - makeMap = function (name, relName) { - var plugin, - parts = splitPrefix(name), - prefix = parts[0]; - - name = parts[1]; - - if (prefix) { - prefix = normalize(prefix, relName); - plugin = callDep(prefix); - } - - //Normalize according - if (prefix) { - if (plugin && plugin.normalize) { - name = plugin.normalize(name, makeNormalize(relName)); - } else { - name = normalize(name, relName); - } - } else { - name = normalize(name, relName); - parts = splitPrefix(name); - prefix = parts[0]; - name = parts[1]; - if (prefix) { - plugin = callDep(prefix); - } - } - - //Using ridiculous property names for space reasons - return { - f: prefix ? prefix + '!' + name : name, //fullName - n: name, - pr: prefix, - p: plugin - }; - }; - - function makeConfig(name) { - return function () { - return (config && config.config && config.config[name]) || {}; - }; - } - - handlers = { - require: function (name) { - return makeRequire(name); - }, - exports: function (name) { - var e = defined[name]; - if (typeof e !== 'undefined') { - return e; - } else { - return (defined[name] = {}); - } - }, - module: function (name) { - return { - id: name, - uri: '', - exports: defined[name], - config: makeConfig(name) - }; - } - }; - - main = function (name, deps, callback, relName) { - var cjsModule, depName, ret, map, i, - args = [], - callbackType = typeof callback, - usingExports; - - //Use name if no relName - relName = relName || name; - - //Call the callback to define the module, if necessary. - if (callbackType === 'undefined' || callbackType === 'function') { - //Pull out the defined dependencies and pass the ordered - //values to the callback. - //Default to [require, exports, module] if no deps - deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; - for (i = 0; i < deps.length; i += 1) { - map = makeMap(deps[i], relName); - depName = map.f; - - //Fast path CommonJS standard dependencies. - if (depName === "require") { - args[i] = handlers.require(name); - } else if (depName === "exports") { - //CommonJS module spec 1.1 - args[i] = handlers.exports(name); - usingExports = true; - } else if (depName === "module") { - //CommonJS module spec 1.1 - cjsModule = args[i] = handlers.module(name); - } else if (hasProp(defined, depName) || - hasProp(waiting, depName) || - hasProp(defining, depName)) { - args[i] = callDep(depName); - } else if (map.p) { - map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); - args[i] = defined[depName]; - } else { - throw new Error(name + ' missing ' + depName); - } - } - - ret = callback ? callback.apply(defined[name], args) : undefined; - - if (name) { - //If setting exports via "module" is in play, - //favor that over return value and exports. After that, - //favor a non-undefined return value over exports use. - if (cjsModule && cjsModule.exports !== undef && - cjsModule.exports !== defined[name]) { - defined[name] = cjsModule.exports; - } else if (ret !== undef || !usingExports) { - //Use the return value from the function. - defined[name] = ret; - } - } - } else if (name) { - //May just be an object definition for the module. Only - //worry about defining if have a module name. - defined[name] = callback; - } - }; - - requirejs = require = req = function (deps, callback, relName, forceSync, alt) { - if (typeof deps === "string") { - if (handlers[deps]) { - //callback in this case is really relName - return handlers[deps](callback); - } - //Just return the module wanted. In this scenario, the - //deps arg is the module name, and second arg (if passed) - //is just the relName. - //Normalize module name, if it contains . or .. - return callDep(makeMap(deps, callback).f); - } else if (!deps.splice) { - //deps is a config object, not an array. - config = deps; - if (config.deps) { - req(config.deps, config.callback); - } - if (!callback) { - return; - } - - if (callback.splice) { - //callback is an array, which means it is a dependency list. - //Adjust args if there are dependencies - deps = callback; - callback = relName; - relName = null; - } else { - deps = undef; - } - } - - //Support require(['a']) - callback = callback || function () {}; - - //If relName is a function, it is an errback handler, - //so remove it. - if (typeof relName === 'function') { - relName = forceSync; - forceSync = alt; - } - - //Simulate async callback; - if (forceSync) { - main(undef, deps, callback, relName); - } else { - //Using a non-zero value because of concern for what old browsers - //do, and latest browsers "upgrade" to 4 if lower value is used: - //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: - //If want a value immediately, use require('id') instead -- something - //that works in almond on the global level, but not guaranteed and - //unlikely to work in other AMD implementations. - setTimeout(function () { - main(undef, deps, callback, relName); - }, 4); - } - - return req; - }; - - /** - * Just drops the config on the floor, but returns req in case - * the config return value is used. - */ - req.config = function (cfg) { - return req(cfg); - }; - - /** - * Expose module registry for debugging and tooling - */ - requirejs._defined = defined; - - define = function (name, deps, callback) { - - //This module may not have dependencies - if (!deps.splice) { - //deps is not an array, so probably means - //an object literal or factory function for - //the value. Adjust args. - callback = deps; - deps = []; - } - - if (!hasProp(defined, name) && !hasProp(waiting, name)) { - waiting[name] = [name, deps, callback]; - } - }; - - define.amd = { - jQuery: true - }; -}()); - -S2.requirejs = requirejs;S2.require = require;S2.define = define; -} -}()); -S2.define("almond", function(){}); - -/* global jQuery:false, $:false */ -S2.define('jquery',[],function () { - var _$ = jQuery || $; - - if (_$ == null && console && console.error) { - console.error( - 'Select2: An instance of jQuery or a jQuery-compatible library was not ' + - 'found. Make sure that you are including jQuery before Select2 on your ' + - 'web page.' - ); - } - - return _$; -}); - -S2.define('select2/utils',[ - 'jquery' -], function ($) { - var Utils = {}; - - Utils.Extend = function (ChildClass, SuperClass) { - var __hasProp = {}.hasOwnProperty; - - function BaseConstructor () { - this.constructor = ChildClass; - } - - for (var key in SuperClass) { - if (__hasProp.call(SuperClass, key)) { - ChildClass[key] = SuperClass[key]; - } - } - - BaseConstructor.prototype = SuperClass.prototype; - ChildClass.prototype = new BaseConstructor(); - ChildClass.__super__ = SuperClass.prototype; - - return ChildClass; - }; - - function getMethods (theClass) { - var proto = theClass.prototype; - - var methods = []; - - for (var methodName in proto) { - var m = proto[methodName]; - - if (typeof m !== 'function') { - continue; - } - - if (methodName === 'constructor') { - continue; - } - - methods.push(methodName); - } - - return methods; - } - - Utils.Decorate = function (SuperClass, DecoratorClass) { - var decoratedMethods = getMethods(DecoratorClass); - var superMethods = getMethods(SuperClass); - - function DecoratedClass () { - var unshift = Array.prototype.unshift; - - var argCount = DecoratorClass.prototype.constructor.length; - - var calledConstructor = SuperClass.prototype.constructor; - - if (argCount > 0) { - unshift.call(arguments, SuperClass.prototype.constructor); - - calledConstructor = DecoratorClass.prototype.constructor; - } - - calledConstructor.apply(this, arguments); - } - - DecoratorClass.displayName = SuperClass.displayName; - - function ctr () { - this.constructor = DecoratedClass; - } - - DecoratedClass.prototype = new ctr(); - - for (var m = 0; m < superMethods.length; m++) { - var superMethod = superMethods[m]; - - DecoratedClass.prototype[superMethod] = - SuperClass.prototype[superMethod]; - } - - var calledMethod = function (methodName) { - // Stub out the original method if it's not decorating an actual method - var originalMethod = function () {}; - - if (methodName in DecoratedClass.prototype) { - originalMethod = DecoratedClass.prototype[methodName]; - } - - var decoratedMethod = DecoratorClass.prototype[methodName]; - - return function () { - var unshift = Array.prototype.unshift; - - unshift.call(arguments, originalMethod); - - return decoratedMethod.apply(this, arguments); - }; - }; - - for (var d = 0; d < decoratedMethods.length; d++) { - var decoratedMethod = decoratedMethods[d]; - - DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod); - } - - return DecoratedClass; - }; - - var Observable = function () { - this.listeners = {}; - }; - - Observable.prototype.on = function (event, callback) { - this.listeners = this.listeners || {}; - - if (event in this.listeners) { - this.listeners[event].push(callback); - } else { - this.listeners[event] = [callback]; - } - }; - - Observable.prototype.trigger = function (event) { - var slice = Array.prototype.slice; - - this.listeners = this.listeners || {}; - - if (event in this.listeners) { - this.invoke(this.listeners[event], slice.call(arguments, 1)); - } - - if ('*' in this.listeners) { - this.invoke(this.listeners['*'], arguments); - } - }; - - Observable.prototype.invoke = function (listeners, params) { - for (var i = 0, len = listeners.length; i < len; i++) { - listeners[i].apply(this, params); - } - }; - - Utils.Observable = Observable; - - Utils.generateChars = function (length) { - var chars = ''; - - for (var i = 0; i < length; i++) { - var randomChar = Math.floor(Math.random() * 36); - chars += randomChar.toString(36); - } - - return chars; - }; - - Utils.bind = function (func, context) { - return function () { - func.apply(context, arguments); - }; - }; - - Utils._convertData = function (data) { - for (var originalKey in data) { - var keys = originalKey.split('-'); - - var dataLevel = data; - - if (keys.length === 1) { - continue; - } - - for (var k = 0; k < keys.length; k++) { - var key = keys[k]; - - // Lowercase the first letter - // By default, dash-separated becomes camelCase - key = key.substring(0, 1).toLowerCase() + key.substring(1); - - if (!(key in dataLevel)) { - dataLevel[key] = {}; - } - - if (k == keys.length - 1) { - dataLevel[key] = data[originalKey]; - } - - dataLevel = dataLevel[key]; - } - - delete data[originalKey]; - } - - return data; - }; - - Utils.hasScroll = function (index, el) { - // Adapted from the function created by @ShadowScripter - // and adapted by @BillBarry on the Stack Exchange Code Review website. - // The original code can be found at - // http://codereview.stackexchange.com/q/13338 - // and was designed to be used with the Sizzle selector engine. - - var $el = $(el); - var overflowX = el.style.overflowX; - var overflowY = el.style.overflowY; - - //Check both x and y declarations - if (overflowX === overflowY && - (overflowY === 'hidden' || overflowY === 'visible')) { - return false; - } - - if (overflowX === 'scroll' || overflowY === 'scroll') { - return true; - } - - return ($el.innerHeight() < el.scrollHeight || - $el.innerWidth() < el.scrollWidth); - }; - - Utils.escapeMarkup = function (markup) { - var replaceMap = { - '\\': '\', - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '/': '/' - }; - - // Do not try to escape the markup if it's not a string - if (typeof markup !== 'string') { - return markup; - } - - return String(markup).replace(/[&<>"'\/\\]/g, function (match) { - return replaceMap[match]; - }); - }; - - // Append an array of jQuery nodes to a given element. - Utils.appendMany = function ($element, $nodes) { - // jQuery 1.7.x does not support $.fn.append() with an array - // Fall back to a jQuery object collection using $.fn.add() - if ($.fn.jquery.substr(0, 3) === '1.7') { - var $jqNodes = $(); - - $.map($nodes, function (node) { - $jqNodes = $jqNodes.add(node); - }); - - $nodes = $jqNodes; - } - - $element.append($nodes); - }; - - return Utils; -}); - -S2.define('select2/results',[ - 'jquery', - './utils' -], function ($, Utils) { - function Results ($element, options, dataAdapter) { - this.$element = $element; - this.data = dataAdapter; - this.options = options; - - Results.__super__.constructor.call(this); - } - - Utils.Extend(Results, Utils.Observable); - - Results.prototype.render = function () { - var $results = $( - '
    ' - ); - - if (this.options.get('multiple')) { - $results.attr('aria-multiselectable', 'true'); - } - - this.$results = $results; - - return $results; - }; - - Results.prototype.clear = function () { - this.$results.empty(); - }; - - Results.prototype.displayMessage = function (params) { - var escapeMarkup = this.options.get('escapeMarkup'); - - this.clear(); - this.hideLoading(); - - var $message = $( - '
  • ' - ); - - var message = this.options.get('translations').get(params.message); - - $message.append( - escapeMarkup( - message(params.args) - ) - ); - - this.$results.append($message); - }; - - Results.prototype.append = function (data) { - this.hideLoading(); - - var $options = []; - - if (data.results == null || data.results.length === 0) { - if (this.$results.children().length === 0) { - this.trigger('results:message', { - message: 'noResults' - }); - } - - return; - } - - data.results = this.sort(data.results); - - for (var d = 0; d < data.results.length; d++) { - var item = data.results[d]; - - var $option = this.option(item); - - $options.push($option); - } - - this.$results.append($options); - }; - - Results.prototype.position = function ($results, $dropdown) { - var $resultsContainer = $dropdown.find('.select2-results'); - $resultsContainer.append($results); - }; - - Results.prototype.sort = function (data) { - var sorter = this.options.get('sorter'); - - return sorter(data); - }; - - Results.prototype.setClasses = function () { - var self = this; - - this.data.current(function (selected) { - var selectedIds = $.map(selected, function (s) { - return s.id.toString(); - }); - - var $options = self.$results - .find('.select2-results__option[aria-selected]'); - - $options.each(function () { - var $option = $(this); - - var item = $.data(this, 'data'); - - // id needs to be converted to a string when comparing - var id = '' + item.id; - - if ((item.element != null && item.element.selected) || - (item.element == null && $.inArray(id, selectedIds) > -1)) { - $option.attr('aria-selected', 'true'); - } else { - $option.attr('aria-selected', 'false'); - } - }); - - var $selected = $options.filter('[aria-selected=true]'); - - // Check if there are any selected options - if ($selected.length > 0) { - // If there are selected options, highlight the first - $selected.first().trigger('mouseenter'); - } else { - // If there are no selected options, highlight the first option - // in the dropdown - $options.first().trigger('mouseenter'); - } - }); - }; - - Results.prototype.showLoading = function (params) { - this.hideLoading(); - - var loadingMore = this.options.get('translations').get('searching'); - - var loading = { - disabled: true, - loading: true, - text: loadingMore(params) - }; - var $loading = this.option(loading); - $loading.className += ' loading-results'; - - this.$results.prepend($loading); - }; - - Results.prototype.hideLoading = function () { - this.$results.find('.loading-results').remove(); - }; - - Results.prototype.option = function (data) { - var option = document.createElement('li'); - option.className = 'select2-results__option'; - - var attrs = { - 'role': 'treeitem', - 'aria-selected': 'false' - }; - - if (data.disabled) { - delete attrs['aria-selected']; - attrs['aria-disabled'] = 'true'; - } - - if (data.id == null) { - delete attrs['aria-selected']; - } - - if (data._resultId != null) { - option.id = data._resultId; - } - - if (data.title) { - option.title = data.title; - } - - if (data.children) { - attrs.role = 'group'; - attrs['aria-label'] = data.text; - delete attrs['aria-selected']; - } - - for (var attr in attrs) { - var val = attrs[attr]; - - option.setAttribute(attr, val); - } - - if (data.children) { - var $option = $(option); - - var label = document.createElement('strong'); - label.className = 'select2-results__group'; - - var $label = $(label); - this.template(data, label); - - var $children = []; - - for (var c = 0; c < data.children.length; c++) { - var child = data.children[c]; - - var $child = this.option(child); - - $children.push($child); - } - - var $childrenContainer = $('
      ', { - 'class': 'select2-results__options select2-results__options--nested' - }); - - $childrenContainer.append($children); - - $option.append(label); - $option.append($childrenContainer); - } else { - this.template(data, option); - } - - $.data(option, 'data', data); - - return option; - }; - - Results.prototype.bind = function (container, $container) { - var self = this; - - var id = container.id + '-results'; - - this.$results.attr('id', id); - - container.on('results:all', function (params) { - self.clear(); - self.append(params.data); - - if (container.isOpen()) { - self.setClasses(); - } - }); - - container.on('results:append', function (params) { - self.append(params.data); - - if (container.isOpen()) { - self.setClasses(); - } - }); - - container.on('query', function (params) { - self.showLoading(params); - }); - - container.on('select', function () { - if (!container.isOpen()) { - return; - } - - self.setClasses(); - }); - - container.on('unselect', function () { - if (!container.isOpen()) { - return; - } - - self.setClasses(); - }); - - container.on('open', function () { - // When the dropdown is open, aria-expended="true" - self.$results.attr('aria-expanded', 'true'); - self.$results.attr('aria-hidden', 'false'); - - self.setClasses(); - self.ensureHighlightVisible(); - }); - - container.on('close', function () { - // When the dropdown is closed, aria-expended="false" - self.$results.attr('aria-expanded', 'false'); - self.$results.attr('aria-hidden', 'true'); - self.$results.removeAttr('aria-activedescendant'); - }); - - container.on('results:toggle', function () { - var $highlighted = self.getHighlightedResults(); - - if ($highlighted.length === 0) { - return; - } - - $highlighted.trigger('mouseup'); - }); - - container.on('results:select', function () { - var $highlighted = self.getHighlightedResults(); - - if ($highlighted.length === 0) { - return; - } - - var data = $highlighted.data('data'); - - if ($highlighted.attr('aria-selected') == 'true') { - self.trigger('close'); - } else { - self.trigger('select', { - data: data - }); - } - }); - - container.on('results:previous', function () { - var $highlighted = self.getHighlightedResults(); - - var $options = self.$results.find('[aria-selected]'); - - var currentIndex = $options.index($highlighted); - - // If we are already at te top, don't move further - if (currentIndex === 0) { - return; - } - - var nextIndex = currentIndex - 1; - - // If none are highlighted, highlight the first - if ($highlighted.length === 0) { - nextIndex = 0; - } - - var $next = $options.eq(nextIndex); - - $next.trigger('mouseenter'); - - var currentOffset = self.$results.offset().top; - var nextTop = $next.offset().top; - var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset); - - if (nextIndex === 0) { - self.$results.scrollTop(0); - } else if (nextTop - currentOffset < 0) { - self.$results.scrollTop(nextOffset); - } - }); - - container.on('results:next', function () { - var $highlighted = self.getHighlightedResults(); - - var $options = self.$results.find('[aria-selected]'); - - var currentIndex = $options.index($highlighted); - - var nextIndex = currentIndex + 1; - - // If we are at the last option, stay there - if (nextIndex >= $options.length) { - return; - } - - var $next = $options.eq(nextIndex); - - $next.trigger('mouseenter'); - - var currentOffset = self.$results.offset().top + - self.$results.outerHeight(false); - var nextBottom = $next.offset().top + $next.outerHeight(false); - var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset; - - if (nextIndex === 0) { - self.$results.scrollTop(0); - } else if (nextBottom > currentOffset) { - self.$results.scrollTop(nextOffset); - } - }); - - container.on('results:focus', function (params) { - params.element.addClass('select2-results__option--highlighted'); - }); - - container.on('results:message', function (params) { - self.displayMessage(params); - }); - - if ($.fn.mousewheel) { - this.$results.on('mousewheel', function (e) { - var top = self.$results.scrollTop(); - - var bottom = ( - self.$results.get(0).scrollHeight - - self.$results.scrollTop() + - e.deltaY - ); - - var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0; - var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height(); - - if (isAtTop) { - self.$results.scrollTop(0); - - e.preventDefault(); - e.stopPropagation(); - } else if (isAtBottom) { - self.$results.scrollTop( - self.$results.get(0).scrollHeight - self.$results.height() - ); - - e.preventDefault(); - e.stopPropagation(); - } - }); - } - - this.$results.on('mouseup', '.select2-results__option[aria-selected]', - function (evt) { - var $this = $(this); - - var data = $this.data('data'); - - if ($this.attr('aria-selected') === 'true') { - if (self.options.get('multiple')) { - self.trigger('unselect', { - originalEvent: evt, - data: data - }); - } else { - self.trigger('close'); - } - - return; - } - - self.trigger('select', { - originalEvent: evt, - data: data - }); - }); - - this.$results.on('mouseenter', '.select2-results__option[aria-selected]', - function (evt) { - var data = $(this).data('data'); - - self.getHighlightedResults() - .removeClass('select2-results__option--highlighted'); - - self.trigger('results:focus', { - data: data, - element: $(this) - }); - }); - }; - - Results.prototype.getHighlightedResults = function () { - var $highlighted = this.$results - .find('.select2-results__option--highlighted'); - - return $highlighted; - }; - - Results.prototype.destroy = function () { - this.$results.remove(); - }; - - Results.prototype.ensureHighlightVisible = function () { - var $highlighted = this.getHighlightedResults(); - - if ($highlighted.length === 0) { - return; - } - - var $options = this.$results.find('[aria-selected]'); - - var currentIndex = $options.index($highlighted); - - var currentOffset = this.$results.offset().top; - var nextTop = $highlighted.offset().top; - var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset); - - var offsetDelta = nextTop - currentOffset; - nextOffset -= $highlighted.outerHeight(false) * 2; - - if (currentIndex <= 2) { - this.$results.scrollTop(0); - } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) { - this.$results.scrollTop(nextOffset); - } - }; - - Results.prototype.template = function (result, container) { - var template = this.options.get('templateResult'); - var escapeMarkup = this.options.get('escapeMarkup'); - - var content = template(result); - - if (content == null) { - container.style.display = 'none'; - } else if (typeof content === 'string') { - container.innerHTML = escapeMarkup(content); - } else { - $(container).append(content); - } - }; - - return Results; -}); - -S2.define('select2/keys',[ - -], function () { - var KEYS = { - BACKSPACE: 8, - TAB: 9, - ENTER: 13, - SHIFT: 16, - CTRL: 17, - ALT: 18, - ESC: 27, - SPACE: 32, - PAGE_UP: 33, - PAGE_DOWN: 34, - END: 35, - HOME: 36, - LEFT: 37, - UP: 38, - RIGHT: 39, - DOWN: 40, - DELETE: 46 - }; - - return KEYS; -}); - -S2.define('select2/selection/base',[ - 'jquery', - '../utils', - '../keys' -], function ($, Utils, KEYS) { - function BaseSelection ($element, options) { - this.$element = $element; - this.options = options; - - BaseSelection.__super__.constructor.call(this); - } - - Utils.Extend(BaseSelection, Utils.Observable); - - BaseSelection.prototype.render = function () { - var $selection = $( - '' - ); - - this._tabindex = 0; - - if (this.$element.data('old-tabindex') != null) { - this._tabindex = this.$element.data('old-tabindex'); - } else if (this.$element.attr('tabindex') != null) { - this._tabindex = this.$element.attr('tabindex'); - } - - $selection.attr('title', this.$element.attr('title')); - $selection.attr('tabindex', this._tabindex); - - this.$selection = $selection; - - return $selection; - }; - - BaseSelection.prototype.bind = function (container, $container) { - var self = this; - - var id = container.id + '-container'; - var resultsId = container.id + '-results'; - - this.container = container; - - this.$selection.on('focus', function (evt) { - self.trigger('focus', evt); - }); - - this.$selection.on('blur', function (evt) { - self.trigger('blur', evt); - }); - - this.$selection.on('keydown', function (evt) { - self.trigger('keypress', evt); - - if (evt.which === KEYS.SPACE) { - evt.preventDefault(); - } - }); - - container.on('results:focus', function (params) { - self.$selection.attr('aria-activedescendant', params.data._resultId); - }); - - container.on('selection:update', function (params) { - self.update(params.data); - }); - - container.on('open', function () { - // When the dropdown is open, aria-expanded="true" - self.$selection.attr('aria-expanded', 'true'); - self.$selection.attr('aria-owns', resultsId); - - self._attachCloseHandler(container); - }); - - container.on('close', function () { - // When the dropdown is closed, aria-expanded="false" - self.$selection.attr('aria-expanded', 'false'); - self.$selection.removeAttr('aria-activedescendant'); - self.$selection.removeAttr('aria-owns'); - - self.$selection.focus(); - - self._detachCloseHandler(container); - }); - - container.on('enable', function () { - self.$selection.attr('tabindex', self._tabindex); - }); - - container.on('disable', function () { - self.$selection.attr('tabindex', '-1'); - }); - }; - - BaseSelection.prototype._attachCloseHandler = function (container) { - var self = this; - - $(document.body).on('mousedown.select2.' + container.id, function (e) { - var $target = $(e.target); - - var $select = $target.closest('.select2'); - - var $all = $('.select2.select2-container--open'); - - $all.each(function () { - var $this = $(this); - - if (this == $select[0]) { - return; - } - - var $element = $this.data('element'); - - $element.select2('close'); - }); - }); - }; - - BaseSelection.prototype._detachCloseHandler = function (container) { - $(document.body).off('mousedown.select2.' + container.id); - }; - - BaseSelection.prototype.position = function ($selection, $container) { - var $selectionContainer = $container.find('.selection'); - $selectionContainer.append($selection); - }; - - BaseSelection.prototype.destroy = function () { - this._detachCloseHandler(this.container); - }; - - BaseSelection.prototype.update = function (data) { - throw new Error('The `update` method must be defined in child classes.'); - }; - - return BaseSelection; -}); - -S2.define('select2/selection/single',[ - 'jquery', - './base', - '../utils', - '../keys' -], function ($, BaseSelection, Utils, KEYS) { - function SingleSelection () { - SingleSelection.__super__.constructor.apply(this, arguments); - } - - Utils.Extend(SingleSelection, BaseSelection); - - SingleSelection.prototype.render = function () { - var $selection = SingleSelection.__super__.render.call(this); - - $selection.addClass('select2-selection--single'); - - $selection.html( - '' + - '' + - '' + - '' - ); - - return $selection; - }; - - SingleSelection.prototype.bind = function (container, $container) { - var self = this; - - SingleSelection.__super__.bind.apply(this, arguments); - - var id = container.id + '-container'; - - this.$selection.find('.select2-selection__rendered').attr('id', id); - this.$selection.attr('aria-labelledby', id); - - this.$selection.on('mousedown', function (evt) { - // Only respond to left clicks - if (evt.which !== 1) { - return; - } - - self.trigger('toggle', { - originalEvent: evt - }); - }); - - this.$selection.on('focus', function (evt) { - // User focuses on the container - }); - - this.$selection.on('blur', function (evt) { - // User exits the container - }); - - container.on('selection:update', function (params) { - self.update(params.data); - }); - }; - - SingleSelection.prototype.clear = function () { - this.$selection.find('.select2-selection__rendered').empty(); - }; - - SingleSelection.prototype.display = function (data) { - var template = this.options.get('templateSelection'); - var escapeMarkup = this.options.get('escapeMarkup'); - - return escapeMarkup(template(data)); - }; - - SingleSelection.prototype.selectionContainer = function () { - return $(''); - }; - - SingleSelection.prototype.update = function (data) { - if (data.length === 0) { - this.clear(); - return; - } - - var selection = data[0]; - - var formatted = this.display(selection); - - var $rendered = this.$selection.find('.select2-selection__rendered'); - $rendered.empty().append(formatted); - $rendered.prop('title', selection.title || selection.text); - }; - - return SingleSelection; -}); - -S2.define('select2/selection/multiple',[ - 'jquery', - './base', - '../utils' -], function ($, BaseSelection, Utils) { - function MultipleSelection ($element, options) { - MultipleSelection.__super__.constructor.apply(this, arguments); - } - - Utils.Extend(MultipleSelection, BaseSelection); - - MultipleSelection.prototype.render = function () { - var $selection = MultipleSelection.__super__.render.call(this); - - $selection.addClass('select2-selection--multiple'); - - $selection.html( - '
        ' - ); - - return $selection; - }; - - MultipleSelection.prototype.bind = function (container, $container) { - var self = this; - - MultipleSelection.__super__.bind.apply(this, arguments); - - this.$selection.on('click', function (evt) { - self.trigger('toggle', { - originalEvent: evt - }); - }); - - this.$selection.on('click', '.select2-selection__choice__remove', - function (evt) { - var $remove = $(this); - var $selection = $remove.parent(); - - var data = $selection.data('data'); - - self.trigger('unselect', { - originalEvent: evt, - data: data - }); - }); - }; - - MultipleSelection.prototype.clear = function () { - this.$selection.find('.select2-selection__rendered').empty(); - }; - - MultipleSelection.prototype.display = function (data) { - var template = this.options.get('templateSelection'); - var escapeMarkup = this.options.get('escapeMarkup'); - - return escapeMarkup(template(data)); - }; - - MultipleSelection.prototype.selectionContainer = function () { - var $container = $( - '
      • ' + - '' + - '×' + - '' + - '
      • ' - ); - - return $container; - }; - - MultipleSelection.prototype.update = function (data) { - this.clear(); - - if (data.length === 0) { - return; - } - - var $selections = []; - - for (var d = 0; d < data.length; d++) { - var selection = data[d]; - - var formatted = this.display(selection); - var $selection = this.selectionContainer(); - - $selection.append(formatted); - $selection.prop('title', selection.title || selection.text); - - $selection.data('data', selection); - - $selections.push($selection); - } - - var $rendered = this.$selection.find('.select2-selection__rendered'); - - Utils.appendMany($rendered, $selections); - }; - - return MultipleSelection; -}); - -S2.define('select2/selection/placeholder',[ - '../utils' -], function (Utils) { - function Placeholder (decorated, $element, options) { - this.placeholder = this.normalizePlaceholder(options.get('placeholder')); - - decorated.call(this, $element, options); - } - - Placeholder.prototype.normalizePlaceholder = function (_, placeholder) { - if (typeof placeholder === 'string') { - placeholder = { - id: '', - text: placeholder - }; - } - - return placeholder; - }; - - Placeholder.prototype.createPlaceholder = function (decorated, placeholder) { - var $placeholder = this.selectionContainer(); - - $placeholder.html(this.display(placeholder)); - $placeholder.addClass('select2-selection__placeholder') - .removeClass('select2-selection__choice'); - - return $placeholder; - }; - - Placeholder.prototype.update = function (decorated, data) { - var singlePlaceholder = ( - data.length == 1 && data[0].id != this.placeholder.id - ); - var multipleSelections = data.length > 1; - - if (multipleSelections || singlePlaceholder) { - return decorated.call(this, data); - } - - this.clear(); - - var $placeholder = this.createPlaceholder(this.placeholder); - - this.$selection.find('.select2-selection__rendered').append($placeholder); - }; - - return Placeholder; -}); - -S2.define('select2/selection/allowClear',[ - 'jquery', - '../keys' -], function ($, KEYS) { - function AllowClear () { } - - AllowClear.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - if (this.placeholder == null) { - if (this.options.get('debug') && window.console && console.error) { - console.error( - 'Select2: The `allowClear` option should be used in combination ' + - 'with the `placeholder` option.' - ); - } - } - - this.$selection.on('mousedown', '.select2-selection__clear', - function (evt) { - self._handleClear(evt); - }); - - container.on('keypress', function (evt) { - self._handleKeyboardClear(evt, container); - }); - }; - - AllowClear.prototype._handleClear = function (_, evt) { - // Ignore the event if it is disabled - if (this.options.get('disabled')) { - return; - } - - var $clear = this.$selection.find('.select2-selection__clear'); - - // Ignore the event if nothing has been selected - if ($clear.length === 0) { - return; - } - - evt.stopPropagation(); - - var data = $clear.data('data'); - - for (var d = 0; d < data.length; d++) { - var unselectData = { - data: data[d] - }; - - // Trigger the `unselect` event, so people can prevent it from being - // cleared. - this.trigger('unselect', unselectData); - - // If the event was prevented, don't clear it out. - if (unselectData.prevented) { - return; - } - } - - this.$element.val(this.placeholder.id).trigger('change'); - - this.trigger('toggle'); - }; - - AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { - if (container.isOpen()) { - return; - } - - if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) { - this._handleClear(evt); - } - }; - - AllowClear.prototype.update = function (decorated, data) { - decorated.call(this, data); - - if (this.$selection.find('.select2-selection__placeholder').length > 0 || - data.length === 0) { - return; - } - - var $remove = $( - '' + - '×' + - '' - ); - $remove.data('data', data); - - this.$selection.find('.select2-selection__rendered').prepend($remove); - }; - - return AllowClear; -}); - -S2.define('select2/selection/search',[ - 'jquery', - '../utils', - '../keys' -], function ($, Utils, KEYS) { - function Search (decorated, $element, options) { - decorated.call(this, $element, options); - } - - Search.prototype.render = function (decorated) { - var $search = $( - '' - ); - - this.$searchContainer = $search; - this.$search = $search.find('input'); - - var $rendered = decorated.call(this); - - return $rendered; - }; - - Search.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - container.on('open', function () { - self.$search.attr('tabindex', 0); - - self.$search.focus(); - }); - - container.on('close', function () { - self.$search.attr('tabindex', -1); - - self.$search.val(''); - self.$search.focus(); - }); - - container.on('enable', function () { - self.$search.prop('disabled', false); - }); - - container.on('disable', function () { - self.$search.prop('disabled', true); - }); - - this.$selection.on('focusin', '.select2-search--inline', function (evt) { - self.trigger('focus', evt); - }); - - this.$selection.on('focusout', '.select2-search--inline', function (evt) { - self.trigger('blur', evt); - }); - - this.$selection.on('keydown', '.select2-search--inline', function (evt) { - evt.stopPropagation(); - - self.trigger('keypress', evt); - - self._keyUpPrevented = evt.isDefaultPrevented(); - - var key = evt.which; - - if (key === KEYS.BACKSPACE && self.$search.val() === '') { - var $previousChoice = self.$searchContainer - .prev('.select2-selection__choice'); - - if ($previousChoice.length > 0) { - var item = $previousChoice.data('data'); - - self.searchRemoveChoice(item); - - evt.preventDefault(); - } - } - }); - - // Workaround for browsers which do not support the `input` event - // This will prevent double-triggering of events for browsers which support - // both the `keyup` and `input` events. - this.$selection.on('input', '.select2-search--inline', function (evt) { - // Unbind the duplicated `keyup` event - self.$selection.off('keyup.search'); - }); - - this.$selection.on('keyup.search input', '.select2-search--inline', - function (evt) { - self.handleSearch(evt); - }); - }; - - Search.prototype.createPlaceholder = function (decorated, placeholder) { - this.$search.attr('placeholder', placeholder.text); - }; - - Search.prototype.update = function (decorated, data) { - this.$search.attr('placeholder', ''); - - decorated.call(this, data); - - this.$selection.find('.select2-selection__rendered') - .append(this.$searchContainer); - - this.resizeSearch(); - }; - - Search.prototype.handleSearch = function () { - this.resizeSearch(); - - if (!this._keyUpPrevented) { - var input = this.$search.val(); - - this.trigger('query', { - term: input - }); - } - - this._keyUpPrevented = false; - }; - - Search.prototype.searchRemoveChoice = function (decorated, item) { - this.trigger('unselect', { - data: item - }); - - this.trigger('open'); - - this.$search.val(item.text + ' '); - }; - - Search.prototype.resizeSearch = function () { - this.$search.css('width', '25px'); - - var width = ''; - - if (this.$search.attr('placeholder') !== '') { - width = this.$selection.find('.select2-selection__rendered').innerWidth(); - } else { - var minimumWidth = this.$search.val().length + 1; - - width = (minimumWidth * 0.75) + 'em'; - } - - this.$search.css('width', width); - }; - - return Search; -}); - -S2.define('select2/selection/eventRelay',[ - 'jquery' -], function ($) { - function EventRelay () { } - - EventRelay.prototype.bind = function (decorated, container, $container) { - var self = this; - var relayEvents = [ - 'open', 'opening', - 'close', 'closing', - 'select', 'selecting', - 'unselect', 'unselecting' - ]; - - var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting']; - - decorated.call(this, container, $container); - - container.on('*', function (name, params) { - // Ignore events that should not be relayed - if ($.inArray(name, relayEvents) === -1) { - return; - } - - // The parameters should always be an object - params = params || {}; - - // Generate the jQuery event for the Select2 event - var evt = $.Event('select2:' + name, { - params: params - }); - - self.$element.trigger(evt); - - // Only handle preventable events if it was one - if ($.inArray(name, preventableEvents) === -1) { - return; - } - - params.prevented = evt.isDefaultPrevented(); - }); - }; - - return EventRelay; -}); - -S2.define('select2/translation',[ - 'jquery', - 'require' -], function ($, require) { - function Translation (dict) { - this.dict = dict || {}; - } - - Translation.prototype.all = function () { - return this.dict; - }; - - Translation.prototype.get = function (key) { - return this.dict[key]; - }; - - Translation.prototype.extend = function (translation) { - this.dict = $.extend({}, translation.all(), this.dict); - }; - - // Static functions - - Translation._cache = {}; - - Translation.loadPath = function (path) { - if (!(path in Translation._cache)) { - var translations = require(path); - - Translation._cache[path] = translations; - } - - return new Translation(Translation._cache[path]); - }; - - return Translation; -}); - -S2.define('select2/diacritics',[ - -], function () { - var diacritics = { - '\u24B6': 'A', - '\uFF21': 'A', - '\u00C0': 'A', - '\u00C1': 'A', - '\u00C2': 'A', - '\u1EA6': 'A', - '\u1EA4': 'A', - '\u1EAA': 'A', - '\u1EA8': 'A', - '\u00C3': 'A', - '\u0100': 'A', - '\u0102': 'A', - '\u1EB0': 'A', - '\u1EAE': 'A', - '\u1EB4': 'A', - '\u1EB2': 'A', - '\u0226': 'A', - '\u01E0': 'A', - '\u00C4': 'A', - '\u01DE': 'A', - '\u1EA2': 'A', - '\u00C5': 'A', - '\u01FA': 'A', - '\u01CD': 'A', - '\u0200': 'A', - '\u0202': 'A', - '\u1EA0': 'A', - '\u1EAC': 'A', - '\u1EB6': 'A', - '\u1E00': 'A', - '\u0104': 'A', - '\u023A': 'A', - '\u2C6F': 'A', - '\uA732': 'AA', - '\u00C6': 'AE', - '\u01FC': 'AE', - '\u01E2': 'AE', - '\uA734': 'AO', - '\uA736': 'AU', - '\uA738': 'AV', - '\uA73A': 'AV', - '\uA73C': 'AY', - '\u24B7': 'B', - '\uFF22': 'B', - '\u1E02': 'B', - '\u1E04': 'B', - '\u1E06': 'B', - '\u0243': 'B', - '\u0182': 'B', - '\u0181': 'B', - '\u24B8': 'C', - '\uFF23': 'C', - '\u0106': 'C', - '\u0108': 'C', - '\u010A': 'C', - '\u010C': 'C', - '\u00C7': 'C', - '\u1E08': 'C', - '\u0187': 'C', - '\u023B': 'C', - '\uA73E': 'C', - '\u24B9': 'D', - '\uFF24': 'D', - '\u1E0A': 'D', - '\u010E': 'D', - '\u1E0C': 'D', - '\u1E10': 'D', - '\u1E12': 'D', - '\u1E0E': 'D', - '\u0110': 'D', - '\u018B': 'D', - '\u018A': 'D', - '\u0189': 'D', - '\uA779': 'D', - '\u01F1': 'DZ', - '\u01C4': 'DZ', - '\u01F2': 'Dz', - '\u01C5': 'Dz', - '\u24BA': 'E', - '\uFF25': 'E', - '\u00C8': 'E', - '\u00C9': 'E', - '\u00CA': 'E', - '\u1EC0': 'E', - '\u1EBE': 'E', - '\u1EC4': 'E', - '\u1EC2': 'E', - '\u1EBC': 'E', - '\u0112': 'E', - '\u1E14': 'E', - '\u1E16': 'E', - '\u0114': 'E', - '\u0116': 'E', - '\u00CB': 'E', - '\u1EBA': 'E', - '\u011A': 'E', - '\u0204': 'E', - '\u0206': 'E', - '\u1EB8': 'E', - '\u1EC6': 'E', - '\u0228': 'E', - '\u1E1C': 'E', - '\u0118': 'E', - '\u1E18': 'E', - '\u1E1A': 'E', - '\u0190': 'E', - '\u018E': 'E', - '\u24BB': 'F', - '\uFF26': 'F', - '\u1E1E': 'F', - '\u0191': 'F', - '\uA77B': 'F', - '\u24BC': 'G', - '\uFF27': 'G', - '\u01F4': 'G', - '\u011C': 'G', - '\u1E20': 'G', - '\u011E': 'G', - '\u0120': 'G', - '\u01E6': 'G', - '\u0122': 'G', - '\u01E4': 'G', - '\u0193': 'G', - '\uA7A0': 'G', - '\uA77D': 'G', - '\uA77E': 'G', - '\u24BD': 'H', - '\uFF28': 'H', - '\u0124': 'H', - '\u1E22': 'H', - '\u1E26': 'H', - '\u021E': 'H', - '\u1E24': 'H', - '\u1E28': 'H', - '\u1E2A': 'H', - '\u0126': 'H', - '\u2C67': 'H', - '\u2C75': 'H', - '\uA78D': 'H', - '\u24BE': 'I', - '\uFF29': 'I', - '\u00CC': 'I', - '\u00CD': 'I', - '\u00CE': 'I', - '\u0128': 'I', - '\u012A': 'I', - '\u012C': 'I', - '\u0130': 'I', - '\u00CF': 'I', - '\u1E2E': 'I', - '\u1EC8': 'I', - '\u01CF': 'I', - '\u0208': 'I', - '\u020A': 'I', - '\u1ECA': 'I', - '\u012E': 'I', - '\u1E2C': 'I', - '\u0197': 'I', - '\u24BF': 'J', - '\uFF2A': 'J', - '\u0134': 'J', - '\u0248': 'J', - '\u24C0': 'K', - '\uFF2B': 'K', - '\u1E30': 'K', - '\u01E8': 'K', - '\u1E32': 'K', - '\u0136': 'K', - '\u1E34': 'K', - '\u0198': 'K', - '\u2C69': 'K', - '\uA740': 'K', - '\uA742': 'K', - '\uA744': 'K', - '\uA7A2': 'K', - '\u24C1': 'L', - '\uFF2C': 'L', - '\u013F': 'L', - '\u0139': 'L', - '\u013D': 'L', - '\u1E36': 'L', - '\u1E38': 'L', - '\u013B': 'L', - '\u1E3C': 'L', - '\u1E3A': 'L', - '\u0141': 'L', - '\u023D': 'L', - '\u2C62': 'L', - '\u2C60': 'L', - '\uA748': 'L', - '\uA746': 'L', - '\uA780': 'L', - '\u01C7': 'LJ', - '\u01C8': 'Lj', - '\u24C2': 'M', - '\uFF2D': 'M', - '\u1E3E': 'M', - '\u1E40': 'M', - '\u1E42': 'M', - '\u2C6E': 'M', - '\u019C': 'M', - '\u24C3': 'N', - '\uFF2E': 'N', - '\u01F8': 'N', - '\u0143': 'N', - '\u00D1': 'N', - '\u1E44': 'N', - '\u0147': 'N', - '\u1E46': 'N', - '\u0145': 'N', - '\u1E4A': 'N', - '\u1E48': 'N', - '\u0220': 'N', - '\u019D': 'N', - '\uA790': 'N', - '\uA7A4': 'N', - '\u01CA': 'NJ', - '\u01CB': 'Nj', - '\u24C4': 'O', - '\uFF2F': 'O', - '\u00D2': 'O', - '\u00D3': 'O', - '\u00D4': 'O', - '\u1ED2': 'O', - '\u1ED0': 'O', - '\u1ED6': 'O', - '\u1ED4': 'O', - '\u00D5': 'O', - '\u1E4C': 'O', - '\u022C': 'O', - '\u1E4E': 'O', - '\u014C': 'O', - '\u1E50': 'O', - '\u1E52': 'O', - '\u014E': 'O', - '\u022E': 'O', - '\u0230': 'O', - '\u00D6': 'O', - '\u022A': 'O', - '\u1ECE': 'O', - '\u0150': 'O', - '\u01D1': 'O', - '\u020C': 'O', - '\u020E': 'O', - '\u01A0': 'O', - '\u1EDC': 'O', - '\u1EDA': 'O', - '\u1EE0': 'O', - '\u1EDE': 'O', - '\u1EE2': 'O', - '\u1ECC': 'O', - '\u1ED8': 'O', - '\u01EA': 'O', - '\u01EC': 'O', - '\u00D8': 'O', - '\u01FE': 'O', - '\u0186': 'O', - '\u019F': 'O', - '\uA74A': 'O', - '\uA74C': 'O', - '\u01A2': 'OI', - '\uA74E': 'OO', - '\u0222': 'OU', - '\u24C5': 'P', - '\uFF30': 'P', - '\u1E54': 'P', - '\u1E56': 'P', - '\u01A4': 'P', - '\u2C63': 'P', - '\uA750': 'P', - '\uA752': 'P', - '\uA754': 'P', - '\u24C6': 'Q', - '\uFF31': 'Q', - '\uA756': 'Q', - '\uA758': 'Q', - '\u024A': 'Q', - '\u24C7': 'R', - '\uFF32': 'R', - '\u0154': 'R', - '\u1E58': 'R', - '\u0158': 'R', - '\u0210': 'R', - '\u0212': 'R', - '\u1E5A': 'R', - '\u1E5C': 'R', - '\u0156': 'R', - '\u1E5E': 'R', - '\u024C': 'R', - '\u2C64': 'R', - '\uA75A': 'R', - '\uA7A6': 'R', - '\uA782': 'R', - '\u24C8': 'S', - '\uFF33': 'S', - '\u1E9E': 'S', - '\u015A': 'S', - '\u1E64': 'S', - '\u015C': 'S', - '\u1E60': 'S', - '\u0160': 'S', - '\u1E66': 'S', - '\u1E62': 'S', - '\u1E68': 'S', - '\u0218': 'S', - '\u015E': 'S', - '\u2C7E': 'S', - '\uA7A8': 'S', - '\uA784': 'S', - '\u24C9': 'T', - '\uFF34': 'T', - '\u1E6A': 'T', - '\u0164': 'T', - '\u1E6C': 'T', - '\u021A': 'T', - '\u0162': 'T', - '\u1E70': 'T', - '\u1E6E': 'T', - '\u0166': 'T', - '\u01AC': 'T', - '\u01AE': 'T', - '\u023E': 'T', - '\uA786': 'T', - '\uA728': 'TZ', - '\u24CA': 'U', - '\uFF35': 'U', - '\u00D9': 'U', - '\u00DA': 'U', - '\u00DB': 'U', - '\u0168': 'U', - '\u1E78': 'U', - '\u016A': 'U', - '\u1E7A': 'U', - '\u016C': 'U', - '\u00DC': 'U', - '\u01DB': 'U', - '\u01D7': 'U', - '\u01D5': 'U', - '\u01D9': 'U', - '\u1EE6': 'U', - '\u016E': 'U', - '\u0170': 'U', - '\u01D3': 'U', - '\u0214': 'U', - '\u0216': 'U', - '\u01AF': 'U', - '\u1EEA': 'U', - '\u1EE8': 'U', - '\u1EEE': 'U', - '\u1EEC': 'U', - '\u1EF0': 'U', - '\u1EE4': 'U', - '\u1E72': 'U', - '\u0172': 'U', - '\u1E76': 'U', - '\u1E74': 'U', - '\u0244': 'U', - '\u24CB': 'V', - '\uFF36': 'V', - '\u1E7C': 'V', - '\u1E7E': 'V', - '\u01B2': 'V', - '\uA75E': 'V', - '\u0245': 'V', - '\uA760': 'VY', - '\u24CC': 'W', - '\uFF37': 'W', - '\u1E80': 'W', - '\u1E82': 'W', - '\u0174': 'W', - '\u1E86': 'W', - '\u1E84': 'W', - '\u1E88': 'W', - '\u2C72': 'W', - '\u24CD': 'X', - '\uFF38': 'X', - '\u1E8A': 'X', - '\u1E8C': 'X', - '\u24CE': 'Y', - '\uFF39': 'Y', - '\u1EF2': 'Y', - '\u00DD': 'Y', - '\u0176': 'Y', - '\u1EF8': 'Y', - '\u0232': 'Y', - '\u1E8E': 'Y', - '\u0178': 'Y', - '\u1EF6': 'Y', - '\u1EF4': 'Y', - '\u01B3': 'Y', - '\u024E': 'Y', - '\u1EFE': 'Y', - '\u24CF': 'Z', - '\uFF3A': 'Z', - '\u0179': 'Z', - '\u1E90': 'Z', - '\u017B': 'Z', - '\u017D': 'Z', - '\u1E92': 'Z', - '\u1E94': 'Z', - '\u01B5': 'Z', - '\u0224': 'Z', - '\u2C7F': 'Z', - '\u2C6B': 'Z', - '\uA762': 'Z', - '\u24D0': 'a', - '\uFF41': 'a', - '\u1E9A': 'a', - '\u00E0': 'a', - '\u00E1': 'a', - '\u00E2': 'a', - '\u1EA7': 'a', - '\u1EA5': 'a', - '\u1EAB': 'a', - '\u1EA9': 'a', - '\u00E3': 'a', - '\u0101': 'a', - '\u0103': 'a', - '\u1EB1': 'a', - '\u1EAF': 'a', - '\u1EB5': 'a', - '\u1EB3': 'a', - '\u0227': 'a', - '\u01E1': 'a', - '\u00E4': 'a', - '\u01DF': 'a', - '\u1EA3': 'a', - '\u00E5': 'a', - '\u01FB': 'a', - '\u01CE': 'a', - '\u0201': 'a', - '\u0203': 'a', - '\u1EA1': 'a', - '\u1EAD': 'a', - '\u1EB7': 'a', - '\u1E01': 'a', - '\u0105': 'a', - '\u2C65': 'a', - '\u0250': 'a', - '\uA733': 'aa', - '\u00E6': 'ae', - '\u01FD': 'ae', - '\u01E3': 'ae', - '\uA735': 'ao', - '\uA737': 'au', - '\uA739': 'av', - '\uA73B': 'av', - '\uA73D': 'ay', - '\u24D1': 'b', - '\uFF42': 'b', - '\u1E03': 'b', - '\u1E05': 'b', - '\u1E07': 'b', - '\u0180': 'b', - '\u0183': 'b', - '\u0253': 'b', - '\u24D2': 'c', - '\uFF43': 'c', - '\u0107': 'c', - '\u0109': 'c', - '\u010B': 'c', - '\u010D': 'c', - '\u00E7': 'c', - '\u1E09': 'c', - '\u0188': 'c', - '\u023C': 'c', - '\uA73F': 'c', - '\u2184': 'c', - '\u24D3': 'd', - '\uFF44': 'd', - '\u1E0B': 'd', - '\u010F': 'd', - '\u1E0D': 'd', - '\u1E11': 'd', - '\u1E13': 'd', - '\u1E0F': 'd', - '\u0111': 'd', - '\u018C': 'd', - '\u0256': 'd', - '\u0257': 'd', - '\uA77A': 'd', - '\u01F3': 'dz', - '\u01C6': 'dz', - '\u24D4': 'e', - '\uFF45': 'e', - '\u00E8': 'e', - '\u00E9': 'e', - '\u00EA': 'e', - '\u1EC1': 'e', - '\u1EBF': 'e', - '\u1EC5': 'e', - '\u1EC3': 'e', - '\u1EBD': 'e', - '\u0113': 'e', - '\u1E15': 'e', - '\u1E17': 'e', - '\u0115': 'e', - '\u0117': 'e', - '\u00EB': 'e', - '\u1EBB': 'e', - '\u011B': 'e', - '\u0205': 'e', - '\u0207': 'e', - '\u1EB9': 'e', - '\u1EC7': 'e', - '\u0229': 'e', - '\u1E1D': 'e', - '\u0119': 'e', - '\u1E19': 'e', - '\u1E1B': 'e', - '\u0247': 'e', - '\u025B': 'e', - '\u01DD': 'e', - '\u24D5': 'f', - '\uFF46': 'f', - '\u1E1F': 'f', - '\u0192': 'f', - '\uA77C': 'f', - '\u24D6': 'g', - '\uFF47': 'g', - '\u01F5': 'g', - '\u011D': 'g', - '\u1E21': 'g', - '\u011F': 'g', - '\u0121': 'g', - '\u01E7': 'g', - '\u0123': 'g', - '\u01E5': 'g', - '\u0260': 'g', - '\uA7A1': 'g', - '\u1D79': 'g', - '\uA77F': 'g', - '\u24D7': 'h', - '\uFF48': 'h', - '\u0125': 'h', - '\u1E23': 'h', - '\u1E27': 'h', - '\u021F': 'h', - '\u1E25': 'h', - '\u1E29': 'h', - '\u1E2B': 'h', - '\u1E96': 'h', - '\u0127': 'h', - '\u2C68': 'h', - '\u2C76': 'h', - '\u0265': 'h', - '\u0195': 'hv', - '\u24D8': 'i', - '\uFF49': 'i', - '\u00EC': 'i', - '\u00ED': 'i', - '\u00EE': 'i', - '\u0129': 'i', - '\u012B': 'i', - '\u012D': 'i', - '\u00EF': 'i', - '\u1E2F': 'i', - '\u1EC9': 'i', - '\u01D0': 'i', - '\u0209': 'i', - '\u020B': 'i', - '\u1ECB': 'i', - '\u012F': 'i', - '\u1E2D': 'i', - '\u0268': 'i', - '\u0131': 'i', - '\u24D9': 'j', - '\uFF4A': 'j', - '\u0135': 'j', - '\u01F0': 'j', - '\u0249': 'j', - '\u24DA': 'k', - '\uFF4B': 'k', - '\u1E31': 'k', - '\u01E9': 'k', - '\u1E33': 'k', - '\u0137': 'k', - '\u1E35': 'k', - '\u0199': 'k', - '\u2C6A': 'k', - '\uA741': 'k', - '\uA743': 'k', - '\uA745': 'k', - '\uA7A3': 'k', - '\u24DB': 'l', - '\uFF4C': 'l', - '\u0140': 'l', - '\u013A': 'l', - '\u013E': 'l', - '\u1E37': 'l', - '\u1E39': 'l', - '\u013C': 'l', - '\u1E3D': 'l', - '\u1E3B': 'l', - '\u017F': 'l', - '\u0142': 'l', - '\u019A': 'l', - '\u026B': 'l', - '\u2C61': 'l', - '\uA749': 'l', - '\uA781': 'l', - '\uA747': 'l', - '\u01C9': 'lj', - '\u24DC': 'm', - '\uFF4D': 'm', - '\u1E3F': 'm', - '\u1E41': 'm', - '\u1E43': 'm', - '\u0271': 'm', - '\u026F': 'm', - '\u24DD': 'n', - '\uFF4E': 'n', - '\u01F9': 'n', - '\u0144': 'n', - '\u00F1': 'n', - '\u1E45': 'n', - '\u0148': 'n', - '\u1E47': 'n', - '\u0146': 'n', - '\u1E4B': 'n', - '\u1E49': 'n', - '\u019E': 'n', - '\u0272': 'n', - '\u0149': 'n', - '\uA791': 'n', - '\uA7A5': 'n', - '\u01CC': 'nj', - '\u24DE': 'o', - '\uFF4F': 'o', - '\u00F2': 'o', - '\u00F3': 'o', - '\u00F4': 'o', - '\u1ED3': 'o', - '\u1ED1': 'o', - '\u1ED7': 'o', - '\u1ED5': 'o', - '\u00F5': 'o', - '\u1E4D': 'o', - '\u022D': 'o', - '\u1E4F': 'o', - '\u014D': 'o', - '\u1E51': 'o', - '\u1E53': 'o', - '\u014F': 'o', - '\u022F': 'o', - '\u0231': 'o', - '\u00F6': 'o', - '\u022B': 'o', - '\u1ECF': 'o', - '\u0151': 'o', - '\u01D2': 'o', - '\u020D': 'o', - '\u020F': 'o', - '\u01A1': 'o', - '\u1EDD': 'o', - '\u1EDB': 'o', - '\u1EE1': 'o', - '\u1EDF': 'o', - '\u1EE3': 'o', - '\u1ECD': 'o', - '\u1ED9': 'o', - '\u01EB': 'o', - '\u01ED': 'o', - '\u00F8': 'o', - '\u01FF': 'o', - '\u0254': 'o', - '\uA74B': 'o', - '\uA74D': 'o', - '\u0275': 'o', - '\u01A3': 'oi', - '\u0223': 'ou', - '\uA74F': 'oo', - '\u24DF': 'p', - '\uFF50': 'p', - '\u1E55': 'p', - '\u1E57': 'p', - '\u01A5': 'p', - '\u1D7D': 'p', - '\uA751': 'p', - '\uA753': 'p', - '\uA755': 'p', - '\u24E0': 'q', - '\uFF51': 'q', - '\u024B': 'q', - '\uA757': 'q', - '\uA759': 'q', - '\u24E1': 'r', - '\uFF52': 'r', - '\u0155': 'r', - '\u1E59': 'r', - '\u0159': 'r', - '\u0211': 'r', - '\u0213': 'r', - '\u1E5B': 'r', - '\u1E5D': 'r', - '\u0157': 'r', - '\u1E5F': 'r', - '\u024D': 'r', - '\u027D': 'r', - '\uA75B': 'r', - '\uA7A7': 'r', - '\uA783': 'r', - '\u24E2': 's', - '\uFF53': 's', - '\u00DF': 's', - '\u015B': 's', - '\u1E65': 's', - '\u015D': 's', - '\u1E61': 's', - '\u0161': 's', - '\u1E67': 's', - '\u1E63': 's', - '\u1E69': 's', - '\u0219': 's', - '\u015F': 's', - '\u023F': 's', - '\uA7A9': 's', - '\uA785': 's', - '\u1E9B': 's', - '\u24E3': 't', - '\uFF54': 't', - '\u1E6B': 't', - '\u1E97': 't', - '\u0165': 't', - '\u1E6D': 't', - '\u021B': 't', - '\u0163': 't', - '\u1E71': 't', - '\u1E6F': 't', - '\u0167': 't', - '\u01AD': 't', - '\u0288': 't', - '\u2C66': 't', - '\uA787': 't', - '\uA729': 'tz', - '\u24E4': 'u', - '\uFF55': 'u', - '\u00F9': 'u', - '\u00FA': 'u', - '\u00FB': 'u', - '\u0169': 'u', - '\u1E79': 'u', - '\u016B': 'u', - '\u1E7B': 'u', - '\u016D': 'u', - '\u00FC': 'u', - '\u01DC': 'u', - '\u01D8': 'u', - '\u01D6': 'u', - '\u01DA': 'u', - '\u1EE7': 'u', - '\u016F': 'u', - '\u0171': 'u', - '\u01D4': 'u', - '\u0215': 'u', - '\u0217': 'u', - '\u01B0': 'u', - '\u1EEB': 'u', - '\u1EE9': 'u', - '\u1EEF': 'u', - '\u1EED': 'u', - '\u1EF1': 'u', - '\u1EE5': 'u', - '\u1E73': 'u', - '\u0173': 'u', - '\u1E77': 'u', - '\u1E75': 'u', - '\u0289': 'u', - '\u24E5': 'v', - '\uFF56': 'v', - '\u1E7D': 'v', - '\u1E7F': 'v', - '\u028B': 'v', - '\uA75F': 'v', - '\u028C': 'v', - '\uA761': 'vy', - '\u24E6': 'w', - '\uFF57': 'w', - '\u1E81': 'w', - '\u1E83': 'w', - '\u0175': 'w', - '\u1E87': 'w', - '\u1E85': 'w', - '\u1E98': 'w', - '\u1E89': 'w', - '\u2C73': 'w', - '\u24E7': 'x', - '\uFF58': 'x', - '\u1E8B': 'x', - '\u1E8D': 'x', - '\u24E8': 'y', - '\uFF59': 'y', - '\u1EF3': 'y', - '\u00FD': 'y', - '\u0177': 'y', - '\u1EF9': 'y', - '\u0233': 'y', - '\u1E8F': 'y', - '\u00FF': 'y', - '\u1EF7': 'y', - '\u1E99': 'y', - '\u1EF5': 'y', - '\u01B4': 'y', - '\u024F': 'y', - '\u1EFF': 'y', - '\u24E9': 'z', - '\uFF5A': 'z', - '\u017A': 'z', - '\u1E91': 'z', - '\u017C': 'z', - '\u017E': 'z', - '\u1E93': 'z', - '\u1E95': 'z', - '\u01B6': 'z', - '\u0225': 'z', - '\u0240': 'z', - '\u2C6C': 'z', - '\uA763': 'z', - '\u0386': '\u0391', - '\u0388': '\u0395', - '\u0389': '\u0397', - '\u038A': '\u0399', - '\u03AA': '\u0399', - '\u038C': '\u039F', - '\u038E': '\u03A5', - '\u03AB': '\u03A5', - '\u038F': '\u03A9', - '\u03AC': '\u03B1', - '\u03AD': '\u03B5', - '\u03AE': '\u03B7', - '\u03AF': '\u03B9', - '\u03CA': '\u03B9', - '\u0390': '\u03B9', - '\u03CC': '\u03BF', - '\u03CD': '\u03C5', - '\u03CB': '\u03C5', - '\u03B0': '\u03C5', - '\u03C9': '\u03C9', - '\u03C2': '\u03C3' - }; - - return diacritics; -}); - -S2.define('select2/data/base',[ - '../utils' -], function (Utils) { - function BaseAdapter ($element, options) { - BaseAdapter.__super__.constructor.call(this); - } - - Utils.Extend(BaseAdapter, Utils.Observable); - - BaseAdapter.prototype.current = function (callback) { - throw new Error('The `current` method must be defined in child classes.'); - }; - - BaseAdapter.prototype.query = function (params, callback) { - throw new Error('The `query` method must be defined in child classes.'); - }; - - BaseAdapter.prototype.bind = function (container, $container) { - // Can be implemented in subclasses - }; - - BaseAdapter.prototype.destroy = function () { - // Can be implemented in subclasses - }; - - BaseAdapter.prototype.generateResultId = function (container, data) { - var id = container.id + '-result-'; - - id += Utils.generateChars(4); - - if (data.id != null) { - id += '-' + data.id.toString(); - } else { - id += '-' + Utils.generateChars(4); - } - return id; - }; - - return BaseAdapter; -}); - -S2.define('select2/data/select',[ - './base', - '../utils', - 'jquery' -], function (BaseAdapter, Utils, $) { - function SelectAdapter ($element, options) { - this.$element = $element; - this.options = options; - - SelectAdapter.__super__.constructor.call(this); - } - - Utils.Extend(SelectAdapter, BaseAdapter); - - SelectAdapter.prototype.current = function (callback) { - var data = []; - var self = this; - - this.$element.find(':selected').each(function () { - var $option = $(this); - - var option = self.item($option); - - data.push(option); - }); - - callback(data); - }; - - SelectAdapter.prototype.select = function (data) { - var self = this; - - data.selected = true; - - // If data.element is a DOM node, use it instead - if ($(data.element).is('option')) { - data.element.selected = true; - - this.$element.trigger('change'); - - return; - } - - if (this.$element.prop('multiple')) { - this.current(function (currentData) { - var val = []; - - data = [data]; - data.push.apply(data, currentData); - - for (var d = 0; d < data.length; d++) { - var id = data[d].id; - - if ($.inArray(id, val) === -1) { - val.push(id); - } - } - - self.$element.val(val); - self.$element.trigger('change'); - }); - } else { - var val = data.id; - - this.$element.val(val); - this.$element.trigger('change'); - } - }; - - SelectAdapter.prototype.unselect = function (data) { - var self = this; - - if (!this.$element.prop('multiple')) { - return; - } - - data.selected = false; - - if ($(data.element).is('option')) { - data.element.selected = false; - - this.$element.trigger('change'); - - return; - } - - this.current(function (currentData) { - var val = []; - - for (var d = 0; d < currentData.length; d++) { - var id = currentData[d].id; - - if (id !== data.id && $.inArray(id, val) === -1) { - val.push(id); - } - } - - self.$element.val(val); - - self.$element.trigger('change'); - }); - }; - - SelectAdapter.prototype.bind = function (container, $container) { - var self = this; - - this.container = container; - - container.on('select', function (params) { - self.select(params.data); - }); - - container.on('unselect', function (params) { - self.unselect(params.data); - }); - }; - - SelectAdapter.prototype.destroy = function () { - // Remove anything added to child elements - this.$element.find('*').each(function () { - // Remove any custom data set by Select2 - $.removeData(this, 'data'); - }); - }; - - SelectAdapter.prototype.query = function (params, callback) { - var data = []; - var self = this; - - var $options = this.$element.children(); - - $options.each(function () { - var $option = $(this); - - if (!$option.is('option') && !$option.is('optgroup')) { - return; - } - - var option = self.item($option); - - var matches = self.matches(params, option); - - if (matches !== null) { - data.push(matches); - } - }); - - callback({ - results: data - }); - }; - - SelectAdapter.prototype.addOptions = function ($options) { - Utils.appendMany(this.$element, $options); - }; - - SelectAdapter.prototype.option = function (data) { - var option; - - if (data.children) { - option = document.createElement('optgroup'); - option.label = data.text; - } else { - option = document.createElement('option'); - - if (option.textContent !== undefined) { - option.textContent = data.text; - } else { - option.innerText = data.text; - } - } - - if (data.id) { - option.value = data.id; - } - - if (data.disabled) { - option.disabled = true; - } - - if (data.selected) { - option.selected = true; - } - - if (data.title) { - option.title = data.title; - } - - var $option = $(option); - - var normalizedData = this._normalizeItem(data); - normalizedData.element = option; - - // Override the option's data with the combined data - $.data(option, 'data', normalizedData); - - return $option; - }; - - SelectAdapter.prototype.item = function ($option) { - var data = {}; - - data = $.data($option[0], 'data'); - - if (data != null) { - return data; - } - - if ($option.is('option')) { - data = { - id: $option.val(), - text: $option.text(), - disabled: $option.prop('disabled'), - selected: $option.prop('selected'), - title: $option.prop('title') - }; - } else if ($option.is('optgroup')) { - data = { - text: $option.prop('label'), - children: [], - title: $option.prop('title') - }; - - var $children = $option.children('option'); - var children = []; - - for (var c = 0; c < $children.length; c++) { - var $child = $($children[c]); - - var child = this.item($child); - - children.push(child); - } - - data.children = children; - } - - data = this._normalizeItem(data); - data.element = $option[0]; - - $.data($option[0], 'data', data); - - return data; - }; - - SelectAdapter.prototype._normalizeItem = function (item) { - if (!$.isPlainObject(item)) { - item = { - id: item, - text: item - }; - } - - item = $.extend({}, { - text: '' - }, item); - - var defaults = { - selected: false, - disabled: false - }; - - if (item.id != null) { - item.id = item.id.toString(); - } - - if (item.text != null) { - item.text = item.text.toString(); - } - - if (item._resultId == null && item.id && this.container != null) { - item._resultId = this.generateResultId(this.container, item); - } - - return $.extend({}, defaults, item); - }; - - SelectAdapter.prototype.matches = function (params, data) { - var matcher = this.options.get('matcher'); - - return matcher(params, data); - }; - - return SelectAdapter; -}); - -S2.define('select2/data/array',[ - './select', - '../utils', - 'jquery' -], function (SelectAdapter, Utils, $) { - function ArrayAdapter ($element, options) { - var data = options.get('data') || []; - - ArrayAdapter.__super__.constructor.call(this, $element, options); - - this.addOptions(this.convertToOptions(data)); - } - - Utils.Extend(ArrayAdapter, SelectAdapter); - - ArrayAdapter.prototype.select = function (data) { - var $option = this.$element.find('option').filter(function (i, elm) { - return elm.value == data.id.toString(); - }); - - if ($option.length === 0) { - $option = this.option(data); - - this.addOptions($option); - } - - ArrayAdapter.__super__.select.call(this, data); - }; - - ArrayAdapter.prototype.convertToOptions = function (data) { - var self = this; - - var $existing = this.$element.find('option'); - var existingIds = $existing.map(function () { - return self.item($(this)).id; - }).get(); - - var $options = []; - - // Filter out all items except for the one passed in the argument - function onlyItem (item) { - return function () { - return $(this).val() == item.id; - }; - } - - for (var d = 0; d < data.length; d++) { - var item = this._normalizeItem(data[d]); - - // Skip items which were pre-loaded, only merge the data - if ($.inArray(item.id, existingIds) >= 0) { - var $existingOption = $existing.filter(onlyItem(item)); - - var existingData = this.item($existingOption); - var newData = $.extend(true, {}, existingData, item); - - var $newOption = this.option(existingData); - - $existingOption.replaceWith($newOption); - - continue; - } - - var $option = this.option(item); - - if (item.children) { - var $children = this.convertToOptions(item.children); - - Utils.appendMany($option, $children); - } - - $options.push($option); - } - - return $options; - }; - - return ArrayAdapter; -}); - -S2.define('select2/data/ajax',[ - './array', - '../utils', - 'jquery' -], function (ArrayAdapter, Utils, $) { - function AjaxAdapter ($element, options) { - this.ajaxOptions = this._applyDefaults(options.get('ajax')); - - if (this.ajaxOptions.processResults != null) { - this.processResults = this.ajaxOptions.processResults; - } - - ArrayAdapter.__super__.constructor.call(this, $element, options); - } - - Utils.Extend(AjaxAdapter, ArrayAdapter); - - AjaxAdapter.prototype._applyDefaults = function (options) { - var defaults = { - data: function (params) { - return { - q: params.term - }; - }, - transport: function (params, success, failure) { - var $request = $.ajax(params); - - $request.then(success); - $request.fail(failure); - - return $request; - } - }; - - return $.extend({}, defaults, options, true); - }; - - AjaxAdapter.prototype.processResults = function (results) { - return results; - }; - - AjaxAdapter.prototype.query = function (params, callback) { - var matches = []; - var self = this; - - if (this._request != null) { - // JSONP requests cannot always be aborted - if ($.isFunction(this._request.abort)) { - this._request.abort(); - } - - this._request = null; - } - - var options = $.extend({ - type: 'GET' - }, this.ajaxOptions); - - if (typeof options.url === 'function') { - options.url = options.url(params); - } - - if (typeof options.data === 'function') { - options.data = options.data(params); - } - - function request () { - var $request = options.transport(options, function (data) { - var results = self.processResults(data, params); - - if (self.options.get('debug') && window.console && console.error) { - // Check to make sure that the response included a `results` key. - if (!results || !results.results || !$.isArray(results.results)) { - console.error( - 'Select2: The AJAX results did not return an array in the ' + - '`results` key of the response.' - ); - } - } - - callback(results); - }, function () { - // TODO: Handle AJAX errors - }); - - self._request = $request; - } - - if (this.ajaxOptions.delay && params.term !== '') { - if (this._queryTimeout) { - window.clearTimeout(this._queryTimeout); - } - - this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); - } else { - request(); - } - }; - - return AjaxAdapter; -}); - -S2.define('select2/data/tags',[ - 'jquery' -], function ($) { - function Tags (decorated, $element, options) { - var tags = options.get('tags'); - - var createTag = options.get('createTag'); - - if (createTag !== undefined) { - this.createTag = createTag; - } - - decorated.call(this, $element, options); - - if ($.isArray(tags)) { - for (var t = 0; t < tags.length; t++) { - var tag = tags[t]; - var item = this._normalizeItem(tag); - - var $option = this.option(item); - - this.$element.append($option); - } - } - } - - Tags.prototype.query = function (decorated, params, callback) { - var self = this; - - this._removeOldTags(); - - if (params.term == null || params.page != null) { - decorated.call(this, params, callback); - return; - } - - function wrapper (obj, child) { - var data = obj.results; - - for (var i = 0; i < data.length; i++) { - var option = data[i]; - - var checkChildren = ( - option.children != null && - !wrapper({ - results: option.children - }, true) - ); - - var checkText = option.text === params.term; - - if (checkText || checkChildren) { - if (child) { - return false; - } - - obj.data = data; - callback(obj); - - return; - } - } - - if (child) { - return true; - } - - var tag = self.createTag(params); - - if (tag != null) { - var $option = self.option(tag); - $option.attr('data-select2-tag', true); - - self.addOptions([$option]); - - self.insertTag(data, tag); - } - - obj.results = data; - - callback(obj); - } - - decorated.call(this, params, wrapper); - }; - - Tags.prototype.createTag = function (decorated, params) { - var term = $.trim(params.term); - - if (term === '') { - return null; - } - - return { - id: term, - text: term - }; - }; - - Tags.prototype.insertTag = function (_, data, tag) { - data.unshift(tag); - }; - - Tags.prototype._removeOldTags = function (_) { - var tag = this._lastTag; - - var $options = this.$element.find('option[data-select2-tag]'); - - $options.each(function () { - if (this.selected) { - return; - } - - $(this).remove(); - }); - }; - - return Tags; -}); - -S2.define('select2/data/tokenizer',[ - 'jquery' -], function ($) { - function Tokenizer (decorated, $element, options) { - var tokenizer = options.get('tokenizer'); - - if (tokenizer !== undefined) { - this.tokenizer = tokenizer; - } - - decorated.call(this, $element, options); - } - - Tokenizer.prototype.bind = function (decorated, container, $container) { - decorated.call(this, container, $container); - - this.$search = container.dropdown.$search || container.selection.$search || - $container.find('.select2-search__field'); - }; - - Tokenizer.prototype.query = function (decorated, params, callback) { - var self = this; - - function select (data) { - self.select(data); - } - - params.term = params.term || ''; - - var tokenData = this.tokenizer(params, this.options, select); - - if (tokenData.term !== params.term) { - // Replace the search term if we have the search box - if (this.$search.length) { - this.$search.val(tokenData.term); - this.$search.focus(); - } - - params.term = tokenData.term; - } - - decorated.call(this, params, callback); - }; - - Tokenizer.prototype.tokenizer = function (_, params, options, callback) { - var separators = options.get('tokenSeparators') || []; - var term = params.term; - var i = 0; - - var createTag = this.createTag || function (params) { - return { - id: params.term, - text: params.term - }; - }; - - while (i < term.length) { - var termChar = term[i]; - - if ($.inArray(termChar, separators) === -1) { - i++; - - continue; - } - - var part = term.substr(0, i); - var partParams = $.extend({}, params, { - term: part - }); - - var data = createTag(partParams); - - callback(data); - - // Reset the term to not include the tokenized portion - term = term.substr(i + 1) || ''; - i = 0; - } - - return { - term: term - }; - }; - - return Tokenizer; -}); - -S2.define('select2/data/minimumInputLength',[ - -], function () { - function MinimumInputLength (decorated, $e, options) { - this.minimumInputLength = options.get('minimumInputLength'); - - decorated.call(this, $e, options); - } - - MinimumInputLength.prototype.query = function (decorated, params, callback) { - params.term = params.term || ''; - - if (params.term.length < this.minimumInputLength) { - this.trigger('results:message', { - message: 'inputTooShort', - args: { - minimum: this.minimumInputLength, - input: params.term, - params: params - } - }); - - return; - } - - decorated.call(this, params, callback); - }; - - return MinimumInputLength; -}); - -S2.define('select2/data/maximumInputLength',[ - -], function () { - function MaximumInputLength (decorated, $e, options) { - this.maximumInputLength = options.get('maximumInputLength'); - - decorated.call(this, $e, options); - } - - MaximumInputLength.prototype.query = function (decorated, params, callback) { - params.term = params.term || ''; - - if (this.maximumInputLength > 0 && - params.term.length > this.maximumInputLength) { - this.trigger('results:message', { - message: 'inputTooLong', - args: { - maximum: this.maximumInputLength, - input: params.term, - params: params - } - }); - - return; - } - - decorated.call(this, params, callback); - }; - - return MaximumInputLength; -}); - -S2.define('select2/data/maximumSelectionLength',[ - -], function (){ - function MaximumSelectionLength (decorated, $e, options) { - this.maximumSelectionLength = options.get('maximumSelectionLength'); - - decorated.call(this, $e, options); - } - - MaximumSelectionLength.prototype.query = - function (decorated, params, callback) { - var self = this; - - this.current(function (currentData) { - var count = currentData != null ? currentData.length : 0; - if (self.maximumSelectionLength > 0 && - count >= self.maximumSelectionLength) { - self.trigger('results:message', { - message: 'maximumSelected', - args: { - maximum: self.maximumSelectionLength - } - }); - return; - } - decorated.call(self, params, callback); - }); - }; - - return MaximumSelectionLength; -}); - -S2.define('select2/dropdown',[ - 'jquery', - './utils' -], function ($, Utils) { - function Dropdown ($element, options) { - this.$element = $element; - this.options = options; - - Dropdown.__super__.constructor.call(this); - } - - Utils.Extend(Dropdown, Utils.Observable); - - Dropdown.prototype.render = function () { - var $dropdown = $( - '' + - '' + - '' - ); - - $dropdown.attr('dir', this.options.get('dir')); - - this.$dropdown = $dropdown; - - return $dropdown; - }; - - Dropdown.prototype.position = function ($dropdown, $container) { - // Should be implmented in subclasses - }; - - Dropdown.prototype.destroy = function () { - // Remove the dropdown from the DOM - this.$dropdown.remove(); - }; - - return Dropdown; -}); - -S2.define('select2/dropdown/search',[ - 'jquery', - '../utils' -], function ($, Utils) { - function Search () { } - - Search.prototype.render = function (decorated) { - var $rendered = decorated.call(this); - - var $search = $( - '' + - '' + - '' - ); - - this.$searchContainer = $search; - this.$search = $search.find('input'); - - $rendered.prepend($search); - - return $rendered; - }; - - Search.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - this.$search.on('keydown', function (evt) { - self.trigger('keypress', evt); - - self._keyUpPrevented = evt.isDefaultPrevented(); - }); - - // Workaround for browsers which do not support the `input` event - // This will prevent double-triggering of events for browsers which support - // both the `keyup` and `input` events. - this.$search.on('input', function (evt) { - // Unbind the duplicated `keyup` event - $(this).off('keyup'); - }); - - this.$search.on('keyup input', function (evt) { - self.handleSearch(evt); - }); - - container.on('open', function () { - self.$search.attr('tabindex', 0); - - self.$search.focus(); - - window.setTimeout(function () { - self.$search.focus(); - }, 0); - }); - - container.on('close', function () { - self.$search.attr('tabindex', -1); - - self.$search.val(''); - }); - - container.on('results:all', function (params) { - if (params.query.term == null || params.query.term === '') { - var showSearch = self.showSearch(params); - - if (showSearch) { - self.$searchContainer.removeClass('select2-search--hide'); - } else { - self.$searchContainer.addClass('select2-search--hide'); - } - } - }); - }; - - Search.prototype.handleSearch = function (evt) { - if (!this._keyUpPrevented) { - var input = this.$search.val(); - - this.trigger('query', { - term: input - }); - } - - this._keyUpPrevented = false; - }; - - Search.prototype.showSearch = function (_, params) { - return true; - }; - - return Search; -}); - -S2.define('select2/dropdown/hidePlaceholder',[ - -], function () { - function HidePlaceholder (decorated, $element, options, dataAdapter) { - this.placeholder = this.normalizePlaceholder(options.get('placeholder')); - - decorated.call(this, $element, options, dataAdapter); - } - - HidePlaceholder.prototype.append = function (decorated, data) { - data.results = this.removePlaceholder(data.results); - - decorated.call(this, data); - }; - - HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { - if (typeof placeholder === 'string') { - placeholder = { - id: '', - text: placeholder - }; - } - - return placeholder; - }; - - HidePlaceholder.prototype.removePlaceholder = function (_, data) { - var modifiedData = data.slice(0); - - for (var d = data.length - 1; d >= 0; d--) { - var item = data[d]; - - if (this.placeholder.id === item.id) { - modifiedData.splice(d, 1); - } - } - - return modifiedData; - }; - - return HidePlaceholder; -}); - -S2.define('select2/dropdown/infiniteScroll',[ - 'jquery' -], function ($) { - function InfiniteScroll (decorated, $element, options, dataAdapter) { - this.lastParams = {}; - - decorated.call(this, $element, options, dataAdapter); - - this.$loadingMore = this.createLoadingMore(); - this.loading = false; - } - - InfiniteScroll.prototype.append = function (decorated, data) { - this.$loadingMore.remove(); - this.loading = false; - - decorated.call(this, data); - - if (this.showLoadingMore(data)) { - this.$results.append(this.$loadingMore); - } - }; - - InfiniteScroll.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - container.on('query', function (params) { - self.lastParams = params; - self.loading = true; - }); - - container.on('query:append', function (params) { - self.lastParams = params; - self.loading = true; - }); - - this.$results.on('scroll', function () { - var isLoadMoreVisible = $.contains( - document.documentElement, - self.$loadingMore[0] - ); - - if (self.loading || !isLoadMoreVisible) { - return; - } - - var currentOffset = self.$results.offset().top + - self.$results.outerHeight(false); - var loadingMoreOffset = self.$loadingMore.offset().top + - self.$loadingMore.outerHeight(false); - - if (currentOffset + 50 >= loadingMoreOffset) { - self.loadMore(); - } - }); - }; - - InfiniteScroll.prototype.loadMore = function () { - this.loading = true; - - var params = $.extend({}, {page: 1}, this.lastParams); - - params.page++; - - this.trigger('query:append', params); - }; - - InfiniteScroll.prototype.showLoadingMore = function (_, data) { - return data.pagination && data.pagination.more; - }; - - InfiniteScroll.prototype.createLoadingMore = function () { - var $option = $( - '
      • ' - ); - - var message = this.options.get('translations').get('loadingMore'); - - $option.html(message(this.lastParams)); - - return $option; - }; - - return InfiniteScroll; -}); - -S2.define('select2/dropdown/attachBody',[ - 'jquery', - '../utils' -], function ($, Utils) { - function AttachBody (decorated, $element, options) { - this.$dropdownParent = options.get('dropdownParent') || document.body; - - decorated.call(this, $element, options); - } - - AttachBody.prototype.bind = function (decorated, container, $container) { - var self = this; - - var setupResultsEvents = false; - - decorated.call(this, container, $container); - - container.on('open', function () { - self._showDropdown(); - self._attachPositioningHandler(container); - - if (!setupResultsEvents) { - setupResultsEvents = true; - - container.on('results:all', function () { - self._positionDropdown(); - self._resizeDropdown(); - }); - - container.on('results:append', function () { - self._positionDropdown(); - self._resizeDropdown(); - }); - } - }); - - container.on('close', function () { - self._hideDropdown(); - self._detachPositioningHandler(container); - }); - - this.$dropdownContainer.on('mousedown', function (evt) { - evt.stopPropagation(); - }); - }; - - AttachBody.prototype.position = function (decorated, $dropdown, $container) { - // Clone all of the container classes - $dropdown.attr('class', $container.attr('class')); - - $dropdown.removeClass('select2'); - $dropdown.addClass('select2-container--open'); - - $dropdown.css({ - position: 'absolute', - top: -999999 - }); - - this.$container = $container; - }; - - AttachBody.prototype.render = function (decorated) { - var $container = $(''); - - var $dropdown = decorated.call(this); - $container.append($dropdown); - - this.$dropdownContainer = $container; - - return $container; - }; - - AttachBody.prototype._hideDropdown = function (decorated) { - this.$dropdownContainer.detach(); - }; - - AttachBody.prototype._attachPositioningHandler = function (container) { - var self = this; - - var scrollEvent = 'scroll.select2.' + container.id; - var resizeEvent = 'resize.select2.' + container.id; - var orientationEvent = 'orientationchange.select2.' + container.id; - - var $watchers = this.$container.parents().filter(Utils.hasScroll); - $watchers.each(function () { - $(this).data('select2-scroll-position', { - x: $(this).scrollLeft(), - y: $(this).scrollTop() - }); - }); - - $watchers.on(scrollEvent, function (ev) { - var position = $(this).data('select2-scroll-position'); - $(this).scrollTop(position.y); - }); - - $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, - function (e) { - self._positionDropdown(); - self._resizeDropdown(); - }); - }; - - AttachBody.prototype._detachPositioningHandler = function (container) { - var scrollEvent = 'scroll.select2.' + container.id; - var resizeEvent = 'resize.select2.' + container.id; - var orientationEvent = 'orientationchange.select2.' + container.id; - - var $watchers = this.$container.parents().filter(Utils.hasScroll); - $watchers.off(scrollEvent); - - $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); - }; - - AttachBody.prototype._positionDropdown = function () { - var $window = $(window); - - var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); - var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); - - var newDirection = null; - - var position = this.$container.position(); - var offset = this.$container.offset(); - - offset.bottom = offset.top + this.$container.outerHeight(false); - - var container = { - height: this.$container.outerHeight(false) - }; - - container.top = offset.top; - container.bottom = offset.top + container.height; - - var dropdown = { - height: this.$dropdown.outerHeight(false) - }; - - var viewport = { - top: $window.scrollTop(), - bottom: $window.scrollTop() + $window.height() - }; - - var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); - var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); - - var css = { - left: offset.left, - top: container.bottom - }; - - if (!isCurrentlyAbove && !isCurrentlyBelow) { - newDirection = 'below'; - } - - if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { - newDirection = 'above'; - } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { - newDirection = 'below'; - } - - if (newDirection == 'above' || - (isCurrentlyAbove && newDirection !== 'below')) { - css.top = container.top - dropdown.height; - } - - if (newDirection != null) { - this.$dropdown - .removeClass('select2-dropdown--below select2-dropdown--above') - .addClass('select2-dropdown--' + newDirection); - this.$container - .removeClass('select2-container--below select2-container--above') - .addClass('select2-container--' + newDirection); - } - - this.$dropdownContainer.css(css); - }; - - AttachBody.prototype._resizeDropdown = function () { - this.$dropdownContainer.width(); - - var css = { - width: this.$container.outerWidth(false) + 'px' - }; - - if (this.options.get('dropdownAutoWidth')) { - css.minWidth = css.width; - css.width = 'auto'; - } - - this.$dropdown.css(css); - }; - - AttachBody.prototype._showDropdown = function (decorated) { - this.$dropdownContainer.appendTo(this.$dropdownParent); - - this._positionDropdown(); - this._resizeDropdown(); - }; - - return AttachBody; -}); - -S2.define('select2/dropdown/minimumResultsForSearch',[ - -], function () { - function countResults (data) { - var count = 0; - - for (var d = 0; d < data.length; d++) { - var item = data[d]; - - if (item.children) { - count += countResults(item.children); - } else { - count++; - } - } - - return count; - } - - function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { - this.minimumResultsForSearch = options.get('minimumResultsForSearch'); - - if (this.minimumResultsForSearch < 0) { - this.minimumResultsForSearch = Infinity; - } - - decorated.call(this, $element, options, dataAdapter); - } - - MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { - if (countResults(params.data.results) < this.minimumResultsForSearch) { - return false; - } - - return decorated.call(this, params); - }; - - return MinimumResultsForSearch; -}); - -S2.define('select2/dropdown/selectOnClose',[ - -], function () { - function SelectOnClose () { } - - SelectOnClose.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - container.on('close', function () { - self._handleSelectOnClose(); - }); - }; - - SelectOnClose.prototype._handleSelectOnClose = function () { - var $highlightedResults = this.getHighlightedResults(); - - if ($highlightedResults.length < 1) { - return; - } - - this.trigger('select', { - data: $highlightedResults.data('data') - }); - }; - - return SelectOnClose; -}); - -S2.define('select2/dropdown/closeOnSelect',[ - -], function () { - function CloseOnSelect () { } - - CloseOnSelect.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - container.on('select', function (evt) { - self._selectTriggered(evt); - }); - - container.on('unselect', function (evt) { - self._selectTriggered(evt); - }); - }; - - CloseOnSelect.prototype._selectTriggered = function (_, evt) { - var originalEvent = evt.originalEvent; - - // Don't close if the control key is being held - if (originalEvent && originalEvent.ctrlKey) { - return; - } - - this.trigger('close'); - }; - - return CloseOnSelect; -}); - -S2.define('select2/i18n/en',[],function () { - // English - return { - errorLoading: function () { - return 'The results could not be loaded.'; - }, - inputTooLong: function (args) { - var overChars = args.input.length - args.maximum; - - var message = 'Please delete ' + overChars + ' character'; - - if (overChars != 1) { - message += 's'; - } - - return message; - }, - inputTooShort: function (args) { - var remainingChars = args.minimum - args.input.length; - - var message = 'Please enter ' + remainingChars + ' or more characters'; - - return message; - }, - loadingMore: function () { - return 'Loading more results…'; - }, - maximumSelected: function (args) { - var message = 'You can only select ' + args.maximum + ' item'; - - if (args.maximum != 1) { - message += 's'; - } - - return message; - }, - noResults: function () { - return 'No results found'; - }, - searching: function () { - return 'Searching…'; - } - }; -}); - -S2.define('select2/defaults',[ - 'jquery', - 'require', - - './results', - - './selection/single', - './selection/multiple', - './selection/placeholder', - './selection/allowClear', - './selection/search', - './selection/eventRelay', - - './utils', - './translation', - './diacritics', - - './data/select', - './data/array', - './data/ajax', - './data/tags', - './data/tokenizer', - './data/minimumInputLength', - './data/maximumInputLength', - './data/maximumSelectionLength', - - './dropdown', - './dropdown/search', - './dropdown/hidePlaceholder', - './dropdown/infiniteScroll', - './dropdown/attachBody', - './dropdown/minimumResultsForSearch', - './dropdown/selectOnClose', - './dropdown/closeOnSelect', - - './i18n/en' -], function ($, require, - - ResultsList, - - SingleSelection, MultipleSelection, Placeholder, AllowClear, - SelectionSearch, EventRelay, - - Utils, Translation, DIACRITICS, - - SelectData, ArrayData, AjaxData, Tags, Tokenizer, - MinimumInputLength, MaximumInputLength, MaximumSelectionLength, - - Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, - AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, - - EnglishTranslation) { - function Defaults () { - this.reset(); - } - - Defaults.prototype.apply = function (options) { - options = $.extend({}, this.defaults, options); - - if (options.dataAdapter == null) { - if (options.ajax != null) { - options.dataAdapter = AjaxData; - } else if (options.data != null) { - options.dataAdapter = ArrayData; - } else { - options.dataAdapter = SelectData; - } - - if (options.minimumInputLength > 0) { - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - MinimumInputLength - ); - } - - if (options.maximumInputLength > 0) { - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - MaximumInputLength - ); - } - - if (options.maximumSelectionLength > 0) { - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - MaximumSelectionLength - ); - } - - if (options.tags) { - options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); - } - - if (options.tokenSeparators != null || options.tokenizer != null) { - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - Tokenizer - ); - } - - if (options.query != null) { - var Query = require(options.amdBase + 'compat/query'); - - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - Query - ); - } - - if (options.initSelection != null) { - var InitSelection = require(options.amdBase + 'compat/initSelection'); - - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - InitSelection - ); - } - } - - if (options.resultsAdapter == null) { - options.resultsAdapter = ResultsList; - - if (options.ajax != null) { - options.resultsAdapter = Utils.Decorate( - options.resultsAdapter, - InfiniteScroll - ); - } - - if (options.placeholder != null) { - options.resultsAdapter = Utils.Decorate( - options.resultsAdapter, - HidePlaceholder - ); - } - - if (options.selectOnClose) { - options.resultsAdapter = Utils.Decorate( - options.resultsAdapter, - SelectOnClose - ); - } - } - - if (options.dropdownAdapter == null) { - if (options.multiple) { - options.dropdownAdapter = Dropdown; - } else { - var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); - - options.dropdownAdapter = SearchableDropdown; - } - - if (options.minimumResultsForSearch !== 0) { - options.dropdownAdapter = Utils.Decorate( - options.dropdownAdapter, - MinimumResultsForSearch - ); - } - - if (options.closeOnSelect) { - options.dropdownAdapter = Utils.Decorate( - options.dropdownAdapter, - CloseOnSelect - ); - } - - if ( - options.dropdownCssClass != null || - options.dropdownCss != null || - options.adaptDropdownCssClass != null - ) { - var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); - - options.dropdownAdapter = Utils.Decorate( - options.dropdownAdapter, - DropdownCSS - ); - } - - options.dropdownAdapter = Utils.Decorate( - options.dropdownAdapter, - AttachBody - ); - } - - if (options.selectionAdapter == null) { - if (options.multiple) { - options.selectionAdapter = MultipleSelection; - } else { - options.selectionAdapter = SingleSelection; - } - - // Add the placeholder mixin if a placeholder was specified - if (options.placeholder != null) { - options.selectionAdapter = Utils.Decorate( - options.selectionAdapter, - Placeholder - ); - } - - if (options.allowClear) { - options.selectionAdapter = Utils.Decorate( - options.selectionAdapter, - AllowClear - ); - } - - if (options.multiple) { - options.selectionAdapter = Utils.Decorate( - options.selectionAdapter, - SelectionSearch - ); - } - - if ( - options.containerCssClass != null || - options.containerCss != null || - options.adaptContainerCssClass != null - ) { - var ContainerCSS = require(options.amdBase + 'compat/containerCss'); - - options.selectionAdapter = Utils.Decorate( - options.selectionAdapter, - ContainerCSS - ); - } - - options.selectionAdapter = Utils.Decorate( - options.selectionAdapter, - EventRelay - ); - } - - if (typeof options.language === 'string') { - // Check if the language is specified with a region - if (options.language.indexOf('-') > 0) { - // Extract the region information if it is included - var languageParts = options.language.split('-'); - var baseLanguage = languageParts[0]; - - options.language = [options.language, baseLanguage]; - } else { - options.language = [options.language]; - } - } - - if ($.isArray(options.language)) { - var languages = new Translation(); - options.language.push('en'); - - var languageNames = options.language; - - for (var l = 0; l < languageNames.length; l++) { - var name = languageNames[l]; - var language = {}; - - try { - // Try to load it with the original name - language = Translation.loadPath(name); - } catch (e) { - try { - // If we couldn't load it, check if it wasn't the full path - name = this.defaults.amdLanguageBase + name; - language = Translation.loadPath(name); - } catch (ex) { - // The translation could not be loaded at all. Sometimes this is - // because of a configuration problem, other times this can be - // because of how Select2 helps load all possible translation files. - if (options.debug && window.console && console.warn) { - console.warn( - 'Select2: The language file for "' + name + '" could not be ' + - 'automatically loaded. A fallback will be used instead.' - ); - } - - continue; - } - } - - languages.extend(language); - } - - options.translations = languages; - } else { - var baseTranslation = Translation.loadPath( - this.defaults.amdLanguageBase + 'en' - ); - var customTranslation = new Translation(options.language); - - customTranslation.extend(baseTranslation); - - options.translations = customTranslation; - } - - return options; - }; - - Defaults.prototype.reset = function () { - function stripDiacritics (text) { - // Used 'uni range + named function' from http://jsperf.com/diacritics/18 - function match(a) { - return DIACRITICS[a] || a; - } - - return text.replace(/[^\u0000-\u007E]/g, match); - } - - function matcher (params, data) { - // Always return the object if there is nothing to compare - if ($.trim(params.term) === '') { - return data; - } - - // Do a recursive check for options with children - if (data.children && data.children.length > 0) { - // Clone the data object if there are children - // This is required as we modify the object to remove any non-matches - var match = $.extend(true, {}, data); - - // Check each child of the option - for (var c = data.children.length - 1; c >= 0; c--) { - var child = data.children[c]; - - var matches = matcher(params, child); - - // If there wasn't a match, remove the object in the array - if (matches == null) { - match.children.splice(c, 1); - } - } - - // If any children matched, return the new object - if (match.children.length > 0) { - return match; - } - - // If there were no matching children, check just the plain object - return matcher(params, match); - } - - var original = stripDiacritics(data.text).toUpperCase(); - var term = stripDiacritics(params.term).toUpperCase(); - - // Check if the text contains the term - if (original.indexOf(term) > -1) { - return data; - } - - // If it doesn't contain the term, don't return anything - return null; - } - - this.defaults = { - amdBase: './', - amdLanguageBase: './i18n/', - closeOnSelect: true, - debug: false, - dropdownAutoWidth: false, - escapeMarkup: Utils.escapeMarkup, - language: EnglishTranslation, - matcher: matcher, - minimumInputLength: 0, - maximumInputLength: 0, - maximumSelectionLength: 0, - minimumResultsForSearch: 0, - selectOnClose: false, - sorter: function (data) { - return data; - }, - templateResult: function (result) { - return result.text; - }, - templateSelection: function (selection) { - return selection.text; - }, - theme: 'default', - width: 'resolve' - }; - }; - - Defaults.prototype.set = function (key, value) { - var camelKey = $.camelCase(key); - - var data = {}; - data[camelKey] = value; - - var convertedData = Utils._convertData(data); - - $.extend(this.defaults, convertedData); - }; - - var defaults = new Defaults(); - - return defaults; -}); - -S2.define('select2/options',[ - 'require', - 'jquery', - './defaults', - './utils' -], function (require, $, Defaults, Utils) { - function Options (options, $element) { - this.options = options; - - if ($element != null) { - this.fromElement($element); - } - - this.options = Defaults.apply(this.options); - - if ($element && $element.is('input')) { - var InputCompat = require(this.get('amdBase') + 'compat/inputData'); - - this.options.dataAdapter = Utils.Decorate( - this.options.dataAdapter, - InputCompat - ); - } - } - - Options.prototype.fromElement = function ($e) { - var excludedData = ['select2']; - - if (this.options.multiple == null) { - this.options.multiple = $e.prop('multiple'); - } - - if (this.options.disabled == null) { - this.options.disabled = $e.prop('disabled'); - } - - if (this.options.language == null) { - if ($e.prop('lang')) { - this.options.language = $e.prop('lang').toLowerCase(); - } else if ($e.closest('[lang]').prop('lang')) { - this.options.language = $e.closest('[lang]').prop('lang'); - } - } - - if (this.options.dir == null) { - if ($e.prop('dir')) { - this.options.dir = $e.prop('dir'); - } else if ($e.closest('[dir]').prop('dir')) { - this.options.dir = $e.closest('[dir]').prop('dir'); - } else { - this.options.dir = 'ltr'; - } - } - - $e.prop('disabled', this.options.disabled); - $e.prop('multiple', this.options.multiple); - - if ($e.data('select2Tags')) { - if (this.options.debug && window.console && console.warn) { - console.warn( - 'Select2: The `data-select2-tags` attribute has been changed to ' + - 'use the `data-data` and `data-tags="true"` attributes and will be ' + - 'removed in future versions of Select2.' - ); - } - - $e.data('data', $e.data('select2Tags')); - $e.data('tags', true); - } - - if ($e.data('ajaxUrl')) { - if (this.options.debug && window.console && console.warn) { - console.warn( - 'Select2: The `data-ajax-url` attribute has been changed to ' + - '`data-ajax--url` and support for the old attribute will be removed' + - ' in future versions of Select2.' - ); - } - - $e.attr('ajax--url', $e.data('ajaxUrl')); - $e.data('ajax--url', $e.data('ajaxUrl')); - } - - var dataset = {}; - - // Prefer the element's `dataset` attribute if it exists - // jQuery 1.x does not correctly handle data attributes with multiple dashes - if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { - dataset = $.extend(true, {}, $e[0].dataset, $e.data()); - } else { - dataset = $e.data(); - } - - var data = $.extend(true, {}, dataset); - - data = Utils._convertData(data); - - for (var key in data) { - if ($.inArray(key, excludedData) > -1) { - continue; - } - - if ($.isPlainObject(this.options[key])) { - $.extend(this.options[key], data[key]); - } else { - this.options[key] = data[key]; - } - } - - return this; - }; - - Options.prototype.get = function (key) { - return this.options[key]; - }; - - Options.prototype.set = function (key, val) { - this.options[key] = val; - }; - - return Options; -}); - -S2.define('select2/core',[ - 'jquery', - './options', - './utils', - './keys' -], function ($, Options, Utils, KEYS) { - var Select2 = function ($element, options) { - if ($element.data('select2') != null) { - $element.data('select2').destroy(); - } - - this.$element = $element; - - this.id = this._generateId($element); - - options = options || {}; - - this.options = new Options(options, $element); - - Select2.__super__.constructor.call(this); - - // Set up the tabindex - - var tabindex = $element.attr('tabindex') || 0; - $element.data('old-tabindex', tabindex); - $element.attr('tabindex', '-1'); - - // Set up containers and adapters - - var DataAdapter = this.options.get('dataAdapter'); - this.dataAdapter = new DataAdapter($element, this.options); - - var $container = this.render(); - - this._placeContainer($container); - - var SelectionAdapter = this.options.get('selectionAdapter'); - this.selection = new SelectionAdapter($element, this.options); - this.$selection = this.selection.render(); - - this.selection.position(this.$selection, $container); - - var DropdownAdapter = this.options.get('dropdownAdapter'); - this.dropdown = new DropdownAdapter($element, this.options); - this.$dropdown = this.dropdown.render(); - - this.dropdown.position(this.$dropdown, $container); - - var ResultsAdapter = this.options.get('resultsAdapter'); - this.results = new ResultsAdapter($element, this.options, this.dataAdapter); - this.$results = this.results.render(); - - this.results.position(this.$results, this.$dropdown); - - // Bind events - - var self = this; - - // Bind the container to all of the adapters - this._bindAdapters(); - - // Register any DOM event handlers - this._registerDomEvents(); - - // Register any internal event handlers - this._registerDataEvents(); - this._registerSelectionEvents(); - this._registerDropdownEvents(); - this._registerResultsEvents(); - this._registerEvents(); - - // Set the initial state - this.dataAdapter.current(function (initialData) { - self.trigger('selection:update', { - data: initialData - }); - }); - - // Hide the original select - $element.addClass('select2-hidden-accessible'); - $element.attr('aria-hidden', 'true'); - - // Synchronize any monitored attributes - this._syncAttributes(); - - $element.data('select2', this); - }; - - Utils.Extend(Select2, Utils.Observable); - - Select2.prototype._generateId = function ($element) { - var id = ''; - - if ($element.attr('id') != null) { - id = $element.attr('id'); - } else if ($element.attr('name') != null) { - id = $element.attr('name') + '-' + Utils.generateChars(2); - } else { - id = Utils.generateChars(4); - } - - id = 'select2-' + id; - - return id; - }; - - Select2.prototype._placeContainer = function ($container) { - $container.insertAfter(this.$element); - - var width = this._resolveWidth(this.$element, this.options.get('width')); - - if (width != null) { - $container.css('width', width); - } - }; - - Select2.prototype._resolveWidth = function ($element, method) { - var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; - - if (method == 'resolve') { - var styleWidth = this._resolveWidth($element, 'style'); - - if (styleWidth != null) { - return styleWidth; - } - - return this._resolveWidth($element, 'element'); - } - - if (method == 'element') { - var elementWidth = $element.outerWidth(false); - - if (elementWidth <= 0) { - return 'auto'; - } - - return elementWidth + 'px'; - } - - if (method == 'style') { - var style = $element.attr('style'); - - if (typeof(style) !== 'string') { - return null; - } - - var attrs = style.split(';'); - - for (var i = 0, l = attrs.length; i < l; i = i + 1) { - var attr = attrs[i].replace(/\s/g, ''); - var matches = attr.match(WIDTH); - - if (matches !== null && matches.length >= 1) { - return matches[1]; - } - } - - return null; - } - - return method; - }; - - Select2.prototype._bindAdapters = function () { - this.dataAdapter.bind(this, this.$container); - this.selection.bind(this, this.$container); - - this.dropdown.bind(this, this.$container); - this.results.bind(this, this.$container); - }; - - Select2.prototype._registerDomEvents = function () { - var self = this; - - this.$element.on('change.select2', function () { - self.dataAdapter.current(function (data) { - self.trigger('selection:update', { - data: data - }); - }); - }); - - this._sync = Utils.bind(this._syncAttributes, this); - - if (this.$element[0].attachEvent) { - this.$element[0].attachEvent('onpropertychange', this._sync); - } - - var observer = window.MutationObserver || - window.WebKitMutationObserver || - window.MozMutationObserver - ; - - if (observer != null) { - this._observer = new observer(function (mutations) { - $.each(mutations, self._sync); - }); - this._observer.observe(this.$element[0], { - attributes: true, - subtree: false - }); - } else if (this.$element[0].addEventListener) { - this.$element[0].addEventListener('DOMAttrModified', self._sync, false); - } - }; - - Select2.prototype._registerDataEvents = function () { - var self = this; - - this.dataAdapter.on('*', function (name, params) { - self.trigger(name, params); - }); - }; - - Select2.prototype._registerSelectionEvents = function () { - var self = this; - var nonRelayEvents = ['toggle']; - - this.selection.on('toggle', function () { - self.toggleDropdown(); - }); - - this.selection.on('*', function (name, params) { - if ($.inArray(name, nonRelayEvents) !== -1) { - return; - } - - self.trigger(name, params); - }); - }; - - Select2.prototype._registerDropdownEvents = function () { - var self = this; - - this.dropdown.on('*', function (name, params) { - self.trigger(name, params); - }); - }; - - Select2.prototype._registerResultsEvents = function () { - var self = this; - - this.results.on('*', function (name, params) { - self.trigger(name, params); - }); - }; - - Select2.prototype._registerEvents = function () { - var self = this; - - this.on('open', function () { - self.$container.addClass('select2-container--open'); - }); - - this.on('close', function () { - self.$container.removeClass('select2-container--open'); - }); - - this.on('enable', function () { - self.$container.removeClass('select2-container--disabled'); - }); - - this.on('disable', function () { - self.$container.addClass('select2-container--disabled'); - }); - - this.on('focus', function () { - self.$container.addClass('select2-container--focus'); - }); - - this.on('blur', function () { - self.$container.removeClass('select2-container--focus'); - }); - - this.on('query', function (params) { - if (!self.isOpen()) { - self.trigger('open'); - } - - this.dataAdapter.query(params, function (data) { - self.trigger('results:all', { - data: data, - query: params - }); - }); - }); - - this.on('query:append', function (params) { - this.dataAdapter.query(params, function (data) { - self.trigger('results:append', { - data: data, - query: params - }); - }); - }); - - this.on('keypress', function (evt) { - var key = evt.which; - - if (self.isOpen()) { - if (key === KEYS.ENTER) { - self.trigger('results:select'); - - evt.preventDefault(); - } else if ((key === KEYS.SPACE && evt.ctrlKey)) { - self.trigger('results:toggle'); - - evt.preventDefault(); - } else if (key === KEYS.UP) { - self.trigger('results:previous'); - - evt.preventDefault(); - } else if (key === KEYS.DOWN) { - self.trigger('results:next'); - - evt.preventDefault(); - } else if (key === KEYS.ESC || key === KEYS.TAB) { - self.close(); - - evt.preventDefault(); - } - } else { - if (key === KEYS.ENTER || key === KEYS.SPACE || - ((key === KEYS.DOWN || key === KEYS.UP) && evt.altKey)) { - self.open(); - - evt.preventDefault(); - } - } - }); - }; - - Select2.prototype._syncAttributes = function () { - this.options.set('disabled', this.$element.prop('disabled')); - - if (this.options.get('disabled')) { - if (this.isOpen()) { - this.close(); - } - - this.trigger('disable'); - } else { - this.trigger('enable'); - } - }; - - /** - * Override the trigger method to automatically trigger pre-events when - * there are events that can be prevented. - */ - Select2.prototype.trigger = function (name, args) { - var actualTrigger = Select2.__super__.trigger; - var preTriggerMap = { - 'open': 'opening', - 'close': 'closing', - 'select': 'selecting', - 'unselect': 'unselecting' - }; - - if (name in preTriggerMap) { - var preTriggerName = preTriggerMap[name]; - var preTriggerArgs = { - prevented: false, - name: name, - args: args - }; - - actualTrigger.call(this, preTriggerName, preTriggerArgs); - - if (preTriggerArgs.prevented) { - args.prevented = true; - - return; - } - } - - actualTrigger.call(this, name, args); - }; - - Select2.prototype.toggleDropdown = function () { - if (this.options.get('disabled')) { - return; - } - - if (this.isOpen()) { - this.close(); - } else { - this.open(); - } - }; - - Select2.prototype.open = function () { - if (this.isOpen()) { - return; - } - - this.trigger('query', {}); - - this.trigger('open'); - }; - - Select2.prototype.close = function () { - if (!this.isOpen()) { - return; - } - - this.trigger('close'); - }; - - Select2.prototype.isOpen = function () { - return this.$container.hasClass('select2-container--open'); - }; - - Select2.prototype.enable = function (args) { - if (this.options.get('debug') && window.console && console.warn) { - console.warn( - 'Select2: The `select2("enable")` method has been deprecated and will' + - ' be removed in later Select2 versions. Use $element.prop("disabled")' + - ' instead.' - ); - } - - if (args == null || args.length === 0) { - args = [true]; - } - - var disabled = !args[0]; - - this.$element.prop('disabled', disabled); - }; - - Select2.prototype.data = function () { - if (this.options.get('debug') && - arguments.length > 0 && window.console && console.warn) { - console.warn( - 'Select2: Data can no longer be set using `select2("data")`. You ' + - 'should consider setting the value instead using `$element.val()`.' - ); - } - - var data = []; - - this.dataAdapter.current(function (currentData) { - data = currentData; - }); - - return data; - }; - - Select2.prototype.val = function (args) { - if (this.options.get('debug') && window.console && console.warn) { - console.warn( - 'Select2: The `select2("val")` method has been deprecated and will be' + - ' removed in later Select2 versions. Use $element.val() instead.' - ); - } - - if (args == null || args.length === 0) { - return this.$element.val(); - } - - var newVal = args[0]; - - if ($.isArray(newVal)) { - newVal = $.map(newVal, function (obj) { - return obj.toString(); - }); - } - - this.$element.val(newVal).trigger('change'); - }; - - Select2.prototype.destroy = function () { - this.$container.remove(); - - if (this.$element[0].detachEvent) { - this.$element[0].detachEvent('onpropertychange', this._sync); - } - - if (this._observer != null) { - this._observer.disconnect(); - this._observer = null; - } else if (this.$element[0].removeEventListener) { - this.$element[0] - .removeEventListener('DOMAttrModified', this._sync, false); - } - - this._sync = null; - - this.$element.off('.select2'); - this.$element.attr('tabindex', this.$element.data('old-tabindex')); - - this.$element.removeClass('select2-hidden-accessible'); - this.$element.attr('aria-hidden', 'false'); - this.$element.removeData('select2'); - - this.dataAdapter.destroy(); - this.selection.destroy(); - this.dropdown.destroy(); - this.results.destroy(); - - this.dataAdapter = null; - this.selection = null; - this.dropdown = null; - this.results = null; - }; - - Select2.prototype.render = function () { - var $container = $( - '' + - '' + - '' + - '' - ); - - $container.attr('dir', this.options.get('dir')); - - this.$container = $container; - - this.$container.addClass('select2-container--' + this.options.get('theme')); - - $container.data('element', this.$element); - - return $container; - }; - - return Select2; -}); - -S2.define('select2/compat/utils',[ - 'jquery' -], function ($) { - function syncCssClasses ($dest, $src, adapter) { - var classes, replacements = [], adapted; - - classes = $.trim($dest.attr('class')); - - if (classes) { - classes = '' + classes; // for IE which returns object - - $(classes.split(/\s+/)).each(function () { - // Save all Select2 classes - if (this.indexOf('select2-') === 0) { - replacements.push(this); - } - }); - } - - classes = $.trim($src.attr('class')); - - if (classes) { - classes = '' + classes; // for IE which returns object - - $(classes.split(/\s+/)).each(function () { - // Only adapt non-Select2 classes - if (this.indexOf('select2-') !== 0) { - adapted = adapter(this); - - if (adapted != null) { - replacements.push(adapted); - } - } - }); - } - - $dest.attr('class', replacements.join(' ')); - } - - return { - syncCssClasses: syncCssClasses - }; -}); - -S2.define('select2/compat/containerCss',[ - 'jquery', - './utils' -], function ($, CompatUtils) { - // No-op CSS adapter that discards all classes by default - function _containerAdapter (clazz) { - return null; - } - - function ContainerCSS () { } - - ContainerCSS.prototype.render = function (decorated) { - var $container = decorated.call(this); - - var containerCssClass = this.options.get('containerCssClass') || ''; - - if ($.isFunction(containerCssClass)) { - containerCssClass = containerCssClass(this.$element); - } - - var containerCssAdapter = this.options.get('adaptContainerCssClass'); - containerCssAdapter = containerCssAdapter || _containerAdapter; - - if (containerCssClass.indexOf(':all:') !== -1) { - containerCssClass = containerCssClass.replace(':all', ''); - - var _cssAdapter = containerCssAdapter; - - containerCssAdapter = function (clazz) { - var adapted = _cssAdapter(clazz); - - if (adapted != null) { - // Append the old one along with the adapted one - return adapted + ' ' + clazz; - } - - return clazz; - }; - } - - var containerCss = this.options.get('containerCss') || {}; - - if ($.isFunction(containerCss)) { - containerCss = containerCss(this.$element); - } - - CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter); - - $container.css(containerCss); - $container.addClass(containerCssClass); - - return $container; - }; - - return ContainerCSS; -}); - -S2.define('select2/compat/dropdownCss',[ - 'jquery', - './utils' -], function ($, CompatUtils) { - // No-op CSS adapter that discards all classes by default - function _dropdownAdapter (clazz) { - return null; - } - - function DropdownCSS () { } - - DropdownCSS.prototype.render = function (decorated) { - var $dropdown = decorated.call(this); - - var dropdownCssClass = this.options.get('dropdownCssClass') || ''; - - if ($.isFunction(dropdownCssClass)) { - dropdownCssClass = dropdownCssClass(this.$element); - } - - var dropdownCssAdapter = this.options.get('adaptDropdownCssClass'); - dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter; - - if (dropdownCssClass.indexOf(':all:') !== -1) { - dropdownCssClass = dropdownCssClass.replace(':all', ''); - - var _cssAdapter = dropdownCssAdapter; - - dropdownCssAdapter = function (clazz) { - var adapted = _cssAdapter(clazz); - - if (adapted != null) { - // Append the old one along with the adapted one - return adapted + ' ' + clazz; - } - - return clazz; - }; - } - - var dropdownCss = this.options.get('dropdownCss') || {}; - - if ($.isFunction(dropdownCss)) { - dropdownCss = dropdownCss(this.$element); - } - - CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter); - - $dropdown.css(dropdownCss); - $dropdown.addClass(dropdownCssClass); - - return $dropdown; - }; - - return DropdownCSS; -}); - -S2.define('select2/compat/initSelection',[ - 'jquery' -], function ($) { - function InitSelection (decorated, $element, options) { - if (options.get('debug') && window.console && console.warn) { - console.warn( - 'Select2: The `initSelection` option has been deprecated in favor' + - ' of a custom data adapter that overrides the `current` method. ' + - 'This method is now called multiple times instead of a single ' + - 'time when the instance is initialized. Support will be removed ' + - 'for the `initSelection` option in future versions of Select2' - ); - } - - this.initSelection = options.get('initSelection'); - this._isInitialized = false; - - decorated.call(this, $element, options); - } - - InitSelection.prototype.current = function (decorated, callback) { - var self = this; - - if (this._isInitialized) { - decorated.call(this, callback); - - return; - } - - this.initSelection.call(null, this.$element, function (data) { - self._isInitialized = true; - - if (!$.isArray(data)) { - data = [data]; - } - - callback(data); - }); - }; - - return InitSelection; -}); - -S2.define('select2/compat/inputData',[ - 'jquery' -], function ($) { - function InputData (decorated, $element, options) { - this._currentData = []; - this._valueSeparator = options.get('valueSeparator') || ','; - - if ($element.prop('type') === 'hidden') { - if (options.get('debug') && console && console.warn) { - console.warn( - 'Select2: Using a hidden input with Select2 is no longer ' + - 'supported and may stop working in the future. It is recommended ' + - 'to use a `');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus()}),b.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.focus()}),b.on("enable",function(){e.$search.prop("disabled",!1)}),b.on("disable",function(){e.$search.prop("disabled",!0)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e.trigger("blur",a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}}),this.$selection.on("input",".select2-search--inline",function(){e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input",".select2-search--inline",function(a){e.handleSearch(a)})},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.trigger("open"),this.$search.val(b.text+" ")},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=(c.extend(!0,{},l,j),this.option(l));k.replaceWith(m)}else{var n=this.option(j);if(j.children){var o=this.convertToOptions(j.children);b.appendMany(n,o)}h.push(n)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(b,c){this.ajaxOptions=this._applyDefaults(c.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),a.__super__.constructor.call(this,b,c)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return{q:a.term}},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url(a)),"function"==typeof f.data&&(f.data=f.data(a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");if(void 0!==f&&(this.createTag=f),b.call(this,c,d),a.isArray(e))for(var g=0;g0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.position=function(){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},b.prototype.handleSearch=function(){if(!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},b.prototype.showSearch=function(){return!0},b}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
      • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(a,b,c){this.$dropdownParent=c.get("dropdownParent")||document.body,a.call(this,b,c)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c){var d=this,e="scroll.select2."+c.id,f="resize.select2."+c.id,g="orientationchange.select2."+c.id,h=this.$container.parents().filter(b.hasScroll);h.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),h.on(e,function(){var b=a(this).data("select2-scroll-position");a(this).scrollTop(b.y)}),a(window).on(e+" "+f+" "+g,function(){d._positionDropdown(),d._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c){var d="scroll.select2."+c.id,e="resize.select2."+c.id,f="orientationchange.select2."+c.id,g=this.$container.parents().filter(b.hasScroll);g.off(d),a(window).off(d+" "+e+" "+f)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=(this.$container.position(),this.$container.offset());f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom};c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){this.$dropdownContainer.width();var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.selectionAdapter=l.multiple?e:d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(this.options.dir=a.prop("dir")?a.prop("dir"):a.closest("[dir]").prop("dir")?a.closest("[dir]").prop("dir"):"ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("focus",function(){a.$container.addClass("select2-container--focus")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open"),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ENTER?(a.trigger("results:select"),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle"),b.preventDefault()):c===d.UP?(a.trigger("results:previous"),b.preventDefault()):c===d.DOWN?(a.trigger("results:next"),b.preventDefault()):(c===d.ESC||c===d.TAB)&&(a.close(),b.preventDefault()):(c===d.ENTER||c===d.SPACE||(c===d.DOWN||c===d.UP)&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable")):this.trigger("enable")},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||(this.trigger("query",{}),this.trigger("open"))},e.prototype.close=function(){this.isOpen()&&this.trigger("close")},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&(f=d(this),null!=f&&g.push(f))})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;return this._isInitialized?void b.call(this,c):void this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `' + - '' - ); - - this.$searchContainer = $search; - this.$search = $search.find('input'); - - var $rendered = decorated.call(this); - - return $rendered; - }; - - Search.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - container.on('open', function () { - self.$search.attr('tabindex', 0); - - self.$search.focus(); - }); - - container.on('close', function () { - self.$search.attr('tabindex', -1); - - self.$search.val(''); - self.$search.focus(); - }); - - container.on('enable', function () { - self.$search.prop('disabled', false); - }); - - container.on('disable', function () { - self.$search.prop('disabled', true); - }); - - this.$selection.on('focusin', '.select2-search--inline', function (evt) { - self.trigger('focus', evt); - }); - - this.$selection.on('focusout', '.select2-search--inline', function (evt) { - self.trigger('blur', evt); - }); - - this.$selection.on('keydown', '.select2-search--inline', function (evt) { - evt.stopPropagation(); - - self.trigger('keypress', evt); - - self._keyUpPrevented = evt.isDefaultPrevented(); - - var key = evt.which; - - if (key === KEYS.BACKSPACE && self.$search.val() === '') { - var $previousChoice = self.$searchContainer - .prev('.select2-selection__choice'); - - if ($previousChoice.length > 0) { - var item = $previousChoice.data('data'); - - self.searchRemoveChoice(item); - - evt.preventDefault(); - } - } - }); - - // Workaround for browsers which do not support the `input` event - // This will prevent double-triggering of events for browsers which support - // both the `keyup` and `input` events. - this.$selection.on('input', '.select2-search--inline', function (evt) { - // Unbind the duplicated `keyup` event - self.$selection.off('keyup.search'); - }); - - this.$selection.on('keyup.search input', '.select2-search--inline', - function (evt) { - self.handleSearch(evt); - }); - }; - - Search.prototype.createPlaceholder = function (decorated, placeholder) { - this.$search.attr('placeholder', placeholder.text); - }; - - Search.prototype.update = function (decorated, data) { - this.$search.attr('placeholder', ''); - - decorated.call(this, data); - - this.$selection.find('.select2-selection__rendered') - .append(this.$searchContainer); - - this.resizeSearch(); - }; - - Search.prototype.handleSearch = function () { - this.resizeSearch(); - - if (!this._keyUpPrevented) { - var input = this.$search.val(); - - this.trigger('query', { - term: input - }); - } - - this._keyUpPrevented = false; - }; - - Search.prototype.searchRemoveChoice = function (decorated, item) { - this.trigger('unselect', { - data: item - }); - - this.trigger('open'); - - this.$search.val(item.text + ' '); - }; - - Search.prototype.resizeSearch = function () { - this.$search.css('width', '25px'); - - var width = ''; - - if (this.$search.attr('placeholder') !== '') { - width = this.$selection.find('.select2-selection__rendered').innerWidth(); - } else { - var minimumWidth = this.$search.val().length + 1; - - width = (minimumWidth * 0.75) + 'em'; - } - - this.$search.css('width', width); - }; - - return Search; -}); - -S2.define('select2/selection/eventRelay',[ - 'jquery' -], function ($) { - function EventRelay () { } - - EventRelay.prototype.bind = function (decorated, container, $container) { - var self = this; - var relayEvents = [ - 'open', 'opening', - 'close', 'closing', - 'select', 'selecting', - 'unselect', 'unselecting' - ]; - - var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting']; - - decorated.call(this, container, $container); - - container.on('*', function (name, params) { - // Ignore events that should not be relayed - if ($.inArray(name, relayEvents) === -1) { - return; - } - - // The parameters should always be an object - params = params || {}; - - // Generate the jQuery event for the Select2 event - var evt = $.Event('select2:' + name, { - params: params - }); - - self.$element.trigger(evt); - - // Only handle preventable events if it was one - if ($.inArray(name, preventableEvents) === -1) { - return; - } - - params.prevented = evt.isDefaultPrevented(); - }); - }; - - return EventRelay; -}); - -S2.define('select2/translation',[ - 'jquery', - 'require' -], function ($, require) { - function Translation (dict) { - this.dict = dict || {}; - } - - Translation.prototype.all = function () { - return this.dict; - }; - - Translation.prototype.get = function (key) { - return this.dict[key]; - }; - - Translation.prototype.extend = function (translation) { - this.dict = $.extend({}, translation.all(), this.dict); - }; - - // Static functions - - Translation._cache = {}; - - Translation.loadPath = function (path) { - if (!(path in Translation._cache)) { - var translations = require(path); - - Translation._cache[path] = translations; - } - - return new Translation(Translation._cache[path]); - }; - - return Translation; -}); - -S2.define('select2/diacritics',[ - -], function () { - var diacritics = { - '\u24B6': 'A', - '\uFF21': 'A', - '\u00C0': 'A', - '\u00C1': 'A', - '\u00C2': 'A', - '\u1EA6': 'A', - '\u1EA4': 'A', - '\u1EAA': 'A', - '\u1EA8': 'A', - '\u00C3': 'A', - '\u0100': 'A', - '\u0102': 'A', - '\u1EB0': 'A', - '\u1EAE': 'A', - '\u1EB4': 'A', - '\u1EB2': 'A', - '\u0226': 'A', - '\u01E0': 'A', - '\u00C4': 'A', - '\u01DE': 'A', - '\u1EA2': 'A', - '\u00C5': 'A', - '\u01FA': 'A', - '\u01CD': 'A', - '\u0200': 'A', - '\u0202': 'A', - '\u1EA0': 'A', - '\u1EAC': 'A', - '\u1EB6': 'A', - '\u1E00': 'A', - '\u0104': 'A', - '\u023A': 'A', - '\u2C6F': 'A', - '\uA732': 'AA', - '\u00C6': 'AE', - '\u01FC': 'AE', - '\u01E2': 'AE', - '\uA734': 'AO', - '\uA736': 'AU', - '\uA738': 'AV', - '\uA73A': 'AV', - '\uA73C': 'AY', - '\u24B7': 'B', - '\uFF22': 'B', - '\u1E02': 'B', - '\u1E04': 'B', - '\u1E06': 'B', - '\u0243': 'B', - '\u0182': 'B', - '\u0181': 'B', - '\u24B8': 'C', - '\uFF23': 'C', - '\u0106': 'C', - '\u0108': 'C', - '\u010A': 'C', - '\u010C': 'C', - '\u00C7': 'C', - '\u1E08': 'C', - '\u0187': 'C', - '\u023B': 'C', - '\uA73E': 'C', - '\u24B9': 'D', - '\uFF24': 'D', - '\u1E0A': 'D', - '\u010E': 'D', - '\u1E0C': 'D', - '\u1E10': 'D', - '\u1E12': 'D', - '\u1E0E': 'D', - '\u0110': 'D', - '\u018B': 'D', - '\u018A': 'D', - '\u0189': 'D', - '\uA779': 'D', - '\u01F1': 'DZ', - '\u01C4': 'DZ', - '\u01F2': 'Dz', - '\u01C5': 'Dz', - '\u24BA': 'E', - '\uFF25': 'E', - '\u00C8': 'E', - '\u00C9': 'E', - '\u00CA': 'E', - '\u1EC0': 'E', - '\u1EBE': 'E', - '\u1EC4': 'E', - '\u1EC2': 'E', - '\u1EBC': 'E', - '\u0112': 'E', - '\u1E14': 'E', - '\u1E16': 'E', - '\u0114': 'E', - '\u0116': 'E', - '\u00CB': 'E', - '\u1EBA': 'E', - '\u011A': 'E', - '\u0204': 'E', - '\u0206': 'E', - '\u1EB8': 'E', - '\u1EC6': 'E', - '\u0228': 'E', - '\u1E1C': 'E', - '\u0118': 'E', - '\u1E18': 'E', - '\u1E1A': 'E', - '\u0190': 'E', - '\u018E': 'E', - '\u24BB': 'F', - '\uFF26': 'F', - '\u1E1E': 'F', - '\u0191': 'F', - '\uA77B': 'F', - '\u24BC': 'G', - '\uFF27': 'G', - '\u01F4': 'G', - '\u011C': 'G', - '\u1E20': 'G', - '\u011E': 'G', - '\u0120': 'G', - '\u01E6': 'G', - '\u0122': 'G', - '\u01E4': 'G', - '\u0193': 'G', - '\uA7A0': 'G', - '\uA77D': 'G', - '\uA77E': 'G', - '\u24BD': 'H', - '\uFF28': 'H', - '\u0124': 'H', - '\u1E22': 'H', - '\u1E26': 'H', - '\u021E': 'H', - '\u1E24': 'H', - '\u1E28': 'H', - '\u1E2A': 'H', - '\u0126': 'H', - '\u2C67': 'H', - '\u2C75': 'H', - '\uA78D': 'H', - '\u24BE': 'I', - '\uFF29': 'I', - '\u00CC': 'I', - '\u00CD': 'I', - '\u00CE': 'I', - '\u0128': 'I', - '\u012A': 'I', - '\u012C': 'I', - '\u0130': 'I', - '\u00CF': 'I', - '\u1E2E': 'I', - '\u1EC8': 'I', - '\u01CF': 'I', - '\u0208': 'I', - '\u020A': 'I', - '\u1ECA': 'I', - '\u012E': 'I', - '\u1E2C': 'I', - '\u0197': 'I', - '\u24BF': 'J', - '\uFF2A': 'J', - '\u0134': 'J', - '\u0248': 'J', - '\u24C0': 'K', - '\uFF2B': 'K', - '\u1E30': 'K', - '\u01E8': 'K', - '\u1E32': 'K', - '\u0136': 'K', - '\u1E34': 'K', - '\u0198': 'K', - '\u2C69': 'K', - '\uA740': 'K', - '\uA742': 'K', - '\uA744': 'K', - '\uA7A2': 'K', - '\u24C1': 'L', - '\uFF2C': 'L', - '\u013F': 'L', - '\u0139': 'L', - '\u013D': 'L', - '\u1E36': 'L', - '\u1E38': 'L', - '\u013B': 'L', - '\u1E3C': 'L', - '\u1E3A': 'L', - '\u0141': 'L', - '\u023D': 'L', - '\u2C62': 'L', - '\u2C60': 'L', - '\uA748': 'L', - '\uA746': 'L', - '\uA780': 'L', - '\u01C7': 'LJ', - '\u01C8': 'Lj', - '\u24C2': 'M', - '\uFF2D': 'M', - '\u1E3E': 'M', - '\u1E40': 'M', - '\u1E42': 'M', - '\u2C6E': 'M', - '\u019C': 'M', - '\u24C3': 'N', - '\uFF2E': 'N', - '\u01F8': 'N', - '\u0143': 'N', - '\u00D1': 'N', - '\u1E44': 'N', - '\u0147': 'N', - '\u1E46': 'N', - '\u0145': 'N', - '\u1E4A': 'N', - '\u1E48': 'N', - '\u0220': 'N', - '\u019D': 'N', - '\uA790': 'N', - '\uA7A4': 'N', - '\u01CA': 'NJ', - '\u01CB': 'Nj', - '\u24C4': 'O', - '\uFF2F': 'O', - '\u00D2': 'O', - '\u00D3': 'O', - '\u00D4': 'O', - '\u1ED2': 'O', - '\u1ED0': 'O', - '\u1ED6': 'O', - '\u1ED4': 'O', - '\u00D5': 'O', - '\u1E4C': 'O', - '\u022C': 'O', - '\u1E4E': 'O', - '\u014C': 'O', - '\u1E50': 'O', - '\u1E52': 'O', - '\u014E': 'O', - '\u022E': 'O', - '\u0230': 'O', - '\u00D6': 'O', - '\u022A': 'O', - '\u1ECE': 'O', - '\u0150': 'O', - '\u01D1': 'O', - '\u020C': 'O', - '\u020E': 'O', - '\u01A0': 'O', - '\u1EDC': 'O', - '\u1EDA': 'O', - '\u1EE0': 'O', - '\u1EDE': 'O', - '\u1EE2': 'O', - '\u1ECC': 'O', - '\u1ED8': 'O', - '\u01EA': 'O', - '\u01EC': 'O', - '\u00D8': 'O', - '\u01FE': 'O', - '\u0186': 'O', - '\u019F': 'O', - '\uA74A': 'O', - '\uA74C': 'O', - '\u01A2': 'OI', - '\uA74E': 'OO', - '\u0222': 'OU', - '\u24C5': 'P', - '\uFF30': 'P', - '\u1E54': 'P', - '\u1E56': 'P', - '\u01A4': 'P', - '\u2C63': 'P', - '\uA750': 'P', - '\uA752': 'P', - '\uA754': 'P', - '\u24C6': 'Q', - '\uFF31': 'Q', - '\uA756': 'Q', - '\uA758': 'Q', - '\u024A': 'Q', - '\u24C7': 'R', - '\uFF32': 'R', - '\u0154': 'R', - '\u1E58': 'R', - '\u0158': 'R', - '\u0210': 'R', - '\u0212': 'R', - '\u1E5A': 'R', - '\u1E5C': 'R', - '\u0156': 'R', - '\u1E5E': 'R', - '\u024C': 'R', - '\u2C64': 'R', - '\uA75A': 'R', - '\uA7A6': 'R', - '\uA782': 'R', - '\u24C8': 'S', - '\uFF33': 'S', - '\u1E9E': 'S', - '\u015A': 'S', - '\u1E64': 'S', - '\u015C': 'S', - '\u1E60': 'S', - '\u0160': 'S', - '\u1E66': 'S', - '\u1E62': 'S', - '\u1E68': 'S', - '\u0218': 'S', - '\u015E': 'S', - '\u2C7E': 'S', - '\uA7A8': 'S', - '\uA784': 'S', - '\u24C9': 'T', - '\uFF34': 'T', - '\u1E6A': 'T', - '\u0164': 'T', - '\u1E6C': 'T', - '\u021A': 'T', - '\u0162': 'T', - '\u1E70': 'T', - '\u1E6E': 'T', - '\u0166': 'T', - '\u01AC': 'T', - '\u01AE': 'T', - '\u023E': 'T', - '\uA786': 'T', - '\uA728': 'TZ', - '\u24CA': 'U', - '\uFF35': 'U', - '\u00D9': 'U', - '\u00DA': 'U', - '\u00DB': 'U', - '\u0168': 'U', - '\u1E78': 'U', - '\u016A': 'U', - '\u1E7A': 'U', - '\u016C': 'U', - '\u00DC': 'U', - '\u01DB': 'U', - '\u01D7': 'U', - '\u01D5': 'U', - '\u01D9': 'U', - '\u1EE6': 'U', - '\u016E': 'U', - '\u0170': 'U', - '\u01D3': 'U', - '\u0214': 'U', - '\u0216': 'U', - '\u01AF': 'U', - '\u1EEA': 'U', - '\u1EE8': 'U', - '\u1EEE': 'U', - '\u1EEC': 'U', - '\u1EF0': 'U', - '\u1EE4': 'U', - '\u1E72': 'U', - '\u0172': 'U', - '\u1E76': 'U', - '\u1E74': 'U', - '\u0244': 'U', - '\u24CB': 'V', - '\uFF36': 'V', - '\u1E7C': 'V', - '\u1E7E': 'V', - '\u01B2': 'V', - '\uA75E': 'V', - '\u0245': 'V', - '\uA760': 'VY', - '\u24CC': 'W', - '\uFF37': 'W', - '\u1E80': 'W', - '\u1E82': 'W', - '\u0174': 'W', - '\u1E86': 'W', - '\u1E84': 'W', - '\u1E88': 'W', - '\u2C72': 'W', - '\u24CD': 'X', - '\uFF38': 'X', - '\u1E8A': 'X', - '\u1E8C': 'X', - '\u24CE': 'Y', - '\uFF39': 'Y', - '\u1EF2': 'Y', - '\u00DD': 'Y', - '\u0176': 'Y', - '\u1EF8': 'Y', - '\u0232': 'Y', - '\u1E8E': 'Y', - '\u0178': 'Y', - '\u1EF6': 'Y', - '\u1EF4': 'Y', - '\u01B3': 'Y', - '\u024E': 'Y', - '\u1EFE': 'Y', - '\u24CF': 'Z', - '\uFF3A': 'Z', - '\u0179': 'Z', - '\u1E90': 'Z', - '\u017B': 'Z', - '\u017D': 'Z', - '\u1E92': 'Z', - '\u1E94': 'Z', - '\u01B5': 'Z', - '\u0224': 'Z', - '\u2C7F': 'Z', - '\u2C6B': 'Z', - '\uA762': 'Z', - '\u24D0': 'a', - '\uFF41': 'a', - '\u1E9A': 'a', - '\u00E0': 'a', - '\u00E1': 'a', - '\u00E2': 'a', - '\u1EA7': 'a', - '\u1EA5': 'a', - '\u1EAB': 'a', - '\u1EA9': 'a', - '\u00E3': 'a', - '\u0101': 'a', - '\u0103': 'a', - '\u1EB1': 'a', - '\u1EAF': 'a', - '\u1EB5': 'a', - '\u1EB3': 'a', - '\u0227': 'a', - '\u01E1': 'a', - '\u00E4': 'a', - '\u01DF': 'a', - '\u1EA3': 'a', - '\u00E5': 'a', - '\u01FB': 'a', - '\u01CE': 'a', - '\u0201': 'a', - '\u0203': 'a', - '\u1EA1': 'a', - '\u1EAD': 'a', - '\u1EB7': 'a', - '\u1E01': 'a', - '\u0105': 'a', - '\u2C65': 'a', - '\u0250': 'a', - '\uA733': 'aa', - '\u00E6': 'ae', - '\u01FD': 'ae', - '\u01E3': 'ae', - '\uA735': 'ao', - '\uA737': 'au', - '\uA739': 'av', - '\uA73B': 'av', - '\uA73D': 'ay', - '\u24D1': 'b', - '\uFF42': 'b', - '\u1E03': 'b', - '\u1E05': 'b', - '\u1E07': 'b', - '\u0180': 'b', - '\u0183': 'b', - '\u0253': 'b', - '\u24D2': 'c', - '\uFF43': 'c', - '\u0107': 'c', - '\u0109': 'c', - '\u010B': 'c', - '\u010D': 'c', - '\u00E7': 'c', - '\u1E09': 'c', - '\u0188': 'c', - '\u023C': 'c', - '\uA73F': 'c', - '\u2184': 'c', - '\u24D3': 'd', - '\uFF44': 'd', - '\u1E0B': 'd', - '\u010F': 'd', - '\u1E0D': 'd', - '\u1E11': 'd', - '\u1E13': 'd', - '\u1E0F': 'd', - '\u0111': 'd', - '\u018C': 'd', - '\u0256': 'd', - '\u0257': 'd', - '\uA77A': 'd', - '\u01F3': 'dz', - '\u01C6': 'dz', - '\u24D4': 'e', - '\uFF45': 'e', - '\u00E8': 'e', - '\u00E9': 'e', - '\u00EA': 'e', - '\u1EC1': 'e', - '\u1EBF': 'e', - '\u1EC5': 'e', - '\u1EC3': 'e', - '\u1EBD': 'e', - '\u0113': 'e', - '\u1E15': 'e', - '\u1E17': 'e', - '\u0115': 'e', - '\u0117': 'e', - '\u00EB': 'e', - '\u1EBB': 'e', - '\u011B': 'e', - '\u0205': 'e', - '\u0207': 'e', - '\u1EB9': 'e', - '\u1EC7': 'e', - '\u0229': 'e', - '\u1E1D': 'e', - '\u0119': 'e', - '\u1E19': 'e', - '\u1E1B': 'e', - '\u0247': 'e', - '\u025B': 'e', - '\u01DD': 'e', - '\u24D5': 'f', - '\uFF46': 'f', - '\u1E1F': 'f', - '\u0192': 'f', - '\uA77C': 'f', - '\u24D6': 'g', - '\uFF47': 'g', - '\u01F5': 'g', - '\u011D': 'g', - '\u1E21': 'g', - '\u011F': 'g', - '\u0121': 'g', - '\u01E7': 'g', - '\u0123': 'g', - '\u01E5': 'g', - '\u0260': 'g', - '\uA7A1': 'g', - '\u1D79': 'g', - '\uA77F': 'g', - '\u24D7': 'h', - '\uFF48': 'h', - '\u0125': 'h', - '\u1E23': 'h', - '\u1E27': 'h', - '\u021F': 'h', - '\u1E25': 'h', - '\u1E29': 'h', - '\u1E2B': 'h', - '\u1E96': 'h', - '\u0127': 'h', - '\u2C68': 'h', - '\u2C76': 'h', - '\u0265': 'h', - '\u0195': 'hv', - '\u24D8': 'i', - '\uFF49': 'i', - '\u00EC': 'i', - '\u00ED': 'i', - '\u00EE': 'i', - '\u0129': 'i', - '\u012B': 'i', - '\u012D': 'i', - '\u00EF': 'i', - '\u1E2F': 'i', - '\u1EC9': 'i', - '\u01D0': 'i', - '\u0209': 'i', - '\u020B': 'i', - '\u1ECB': 'i', - '\u012F': 'i', - '\u1E2D': 'i', - '\u0268': 'i', - '\u0131': 'i', - '\u24D9': 'j', - '\uFF4A': 'j', - '\u0135': 'j', - '\u01F0': 'j', - '\u0249': 'j', - '\u24DA': 'k', - '\uFF4B': 'k', - '\u1E31': 'k', - '\u01E9': 'k', - '\u1E33': 'k', - '\u0137': 'k', - '\u1E35': 'k', - '\u0199': 'k', - '\u2C6A': 'k', - '\uA741': 'k', - '\uA743': 'k', - '\uA745': 'k', - '\uA7A3': 'k', - '\u24DB': 'l', - '\uFF4C': 'l', - '\u0140': 'l', - '\u013A': 'l', - '\u013E': 'l', - '\u1E37': 'l', - '\u1E39': 'l', - '\u013C': 'l', - '\u1E3D': 'l', - '\u1E3B': 'l', - '\u017F': 'l', - '\u0142': 'l', - '\u019A': 'l', - '\u026B': 'l', - '\u2C61': 'l', - '\uA749': 'l', - '\uA781': 'l', - '\uA747': 'l', - '\u01C9': 'lj', - '\u24DC': 'm', - '\uFF4D': 'm', - '\u1E3F': 'm', - '\u1E41': 'm', - '\u1E43': 'm', - '\u0271': 'm', - '\u026F': 'm', - '\u24DD': 'n', - '\uFF4E': 'n', - '\u01F9': 'n', - '\u0144': 'n', - '\u00F1': 'n', - '\u1E45': 'n', - '\u0148': 'n', - '\u1E47': 'n', - '\u0146': 'n', - '\u1E4B': 'n', - '\u1E49': 'n', - '\u019E': 'n', - '\u0272': 'n', - '\u0149': 'n', - '\uA791': 'n', - '\uA7A5': 'n', - '\u01CC': 'nj', - '\u24DE': 'o', - '\uFF4F': 'o', - '\u00F2': 'o', - '\u00F3': 'o', - '\u00F4': 'o', - '\u1ED3': 'o', - '\u1ED1': 'o', - '\u1ED7': 'o', - '\u1ED5': 'o', - '\u00F5': 'o', - '\u1E4D': 'o', - '\u022D': 'o', - '\u1E4F': 'o', - '\u014D': 'o', - '\u1E51': 'o', - '\u1E53': 'o', - '\u014F': 'o', - '\u022F': 'o', - '\u0231': 'o', - '\u00F6': 'o', - '\u022B': 'o', - '\u1ECF': 'o', - '\u0151': 'o', - '\u01D2': 'o', - '\u020D': 'o', - '\u020F': 'o', - '\u01A1': 'o', - '\u1EDD': 'o', - '\u1EDB': 'o', - '\u1EE1': 'o', - '\u1EDF': 'o', - '\u1EE3': 'o', - '\u1ECD': 'o', - '\u1ED9': 'o', - '\u01EB': 'o', - '\u01ED': 'o', - '\u00F8': 'o', - '\u01FF': 'o', - '\u0254': 'o', - '\uA74B': 'o', - '\uA74D': 'o', - '\u0275': 'o', - '\u01A3': 'oi', - '\u0223': 'ou', - '\uA74F': 'oo', - '\u24DF': 'p', - '\uFF50': 'p', - '\u1E55': 'p', - '\u1E57': 'p', - '\u01A5': 'p', - '\u1D7D': 'p', - '\uA751': 'p', - '\uA753': 'p', - '\uA755': 'p', - '\u24E0': 'q', - '\uFF51': 'q', - '\u024B': 'q', - '\uA757': 'q', - '\uA759': 'q', - '\u24E1': 'r', - '\uFF52': 'r', - '\u0155': 'r', - '\u1E59': 'r', - '\u0159': 'r', - '\u0211': 'r', - '\u0213': 'r', - '\u1E5B': 'r', - '\u1E5D': 'r', - '\u0157': 'r', - '\u1E5F': 'r', - '\u024D': 'r', - '\u027D': 'r', - '\uA75B': 'r', - '\uA7A7': 'r', - '\uA783': 'r', - '\u24E2': 's', - '\uFF53': 's', - '\u00DF': 's', - '\u015B': 's', - '\u1E65': 's', - '\u015D': 's', - '\u1E61': 's', - '\u0161': 's', - '\u1E67': 's', - '\u1E63': 's', - '\u1E69': 's', - '\u0219': 's', - '\u015F': 's', - '\u023F': 's', - '\uA7A9': 's', - '\uA785': 's', - '\u1E9B': 's', - '\u24E3': 't', - '\uFF54': 't', - '\u1E6B': 't', - '\u1E97': 't', - '\u0165': 't', - '\u1E6D': 't', - '\u021B': 't', - '\u0163': 't', - '\u1E71': 't', - '\u1E6F': 't', - '\u0167': 't', - '\u01AD': 't', - '\u0288': 't', - '\u2C66': 't', - '\uA787': 't', - '\uA729': 'tz', - '\u24E4': 'u', - '\uFF55': 'u', - '\u00F9': 'u', - '\u00FA': 'u', - '\u00FB': 'u', - '\u0169': 'u', - '\u1E79': 'u', - '\u016B': 'u', - '\u1E7B': 'u', - '\u016D': 'u', - '\u00FC': 'u', - '\u01DC': 'u', - '\u01D8': 'u', - '\u01D6': 'u', - '\u01DA': 'u', - '\u1EE7': 'u', - '\u016F': 'u', - '\u0171': 'u', - '\u01D4': 'u', - '\u0215': 'u', - '\u0217': 'u', - '\u01B0': 'u', - '\u1EEB': 'u', - '\u1EE9': 'u', - '\u1EEF': 'u', - '\u1EED': 'u', - '\u1EF1': 'u', - '\u1EE5': 'u', - '\u1E73': 'u', - '\u0173': 'u', - '\u1E77': 'u', - '\u1E75': 'u', - '\u0289': 'u', - '\u24E5': 'v', - '\uFF56': 'v', - '\u1E7D': 'v', - '\u1E7F': 'v', - '\u028B': 'v', - '\uA75F': 'v', - '\u028C': 'v', - '\uA761': 'vy', - '\u24E6': 'w', - '\uFF57': 'w', - '\u1E81': 'w', - '\u1E83': 'w', - '\u0175': 'w', - '\u1E87': 'w', - '\u1E85': 'w', - '\u1E98': 'w', - '\u1E89': 'w', - '\u2C73': 'w', - '\u24E7': 'x', - '\uFF58': 'x', - '\u1E8B': 'x', - '\u1E8D': 'x', - '\u24E8': 'y', - '\uFF59': 'y', - '\u1EF3': 'y', - '\u00FD': 'y', - '\u0177': 'y', - '\u1EF9': 'y', - '\u0233': 'y', - '\u1E8F': 'y', - '\u00FF': 'y', - '\u1EF7': 'y', - '\u1E99': 'y', - '\u1EF5': 'y', - '\u01B4': 'y', - '\u024F': 'y', - '\u1EFF': 'y', - '\u24E9': 'z', - '\uFF5A': 'z', - '\u017A': 'z', - '\u1E91': 'z', - '\u017C': 'z', - '\u017E': 'z', - '\u1E93': 'z', - '\u1E95': 'z', - '\u01B6': 'z', - '\u0225': 'z', - '\u0240': 'z', - '\u2C6C': 'z', - '\uA763': 'z', - '\u0386': '\u0391', - '\u0388': '\u0395', - '\u0389': '\u0397', - '\u038A': '\u0399', - '\u03AA': '\u0399', - '\u038C': '\u039F', - '\u038E': '\u03A5', - '\u03AB': '\u03A5', - '\u038F': '\u03A9', - '\u03AC': '\u03B1', - '\u03AD': '\u03B5', - '\u03AE': '\u03B7', - '\u03AF': '\u03B9', - '\u03CA': '\u03B9', - '\u0390': '\u03B9', - '\u03CC': '\u03BF', - '\u03CD': '\u03C5', - '\u03CB': '\u03C5', - '\u03B0': '\u03C5', - '\u03C9': '\u03C9', - '\u03C2': '\u03C3' - }; - - return diacritics; -}); - -S2.define('select2/data/base',[ - '../utils' -], function (Utils) { - function BaseAdapter ($element, options) { - BaseAdapter.__super__.constructor.call(this); - } - - Utils.Extend(BaseAdapter, Utils.Observable); - - BaseAdapter.prototype.current = function (callback) { - throw new Error('The `current` method must be defined in child classes.'); - }; - - BaseAdapter.prototype.query = function (params, callback) { - throw new Error('The `query` method must be defined in child classes.'); - }; - - BaseAdapter.prototype.bind = function (container, $container) { - // Can be implemented in subclasses - }; - - BaseAdapter.prototype.destroy = function () { - // Can be implemented in subclasses - }; - - BaseAdapter.prototype.generateResultId = function (container, data) { - var id = container.id + '-result-'; - - id += Utils.generateChars(4); - - if (data.id != null) { - id += '-' + data.id.toString(); - } else { - id += '-' + Utils.generateChars(4); - } - return id; - }; - - return BaseAdapter; -}); - -S2.define('select2/data/select',[ - './base', - '../utils', - 'jquery' -], function (BaseAdapter, Utils, $) { - function SelectAdapter ($element, options) { - this.$element = $element; - this.options = options; - - SelectAdapter.__super__.constructor.call(this); - } - - Utils.Extend(SelectAdapter, BaseAdapter); - - SelectAdapter.prototype.current = function (callback) { - var data = []; - var self = this; - - this.$element.find(':selected').each(function () { - var $option = $(this); - - var option = self.item($option); - - data.push(option); - }); - - callback(data); - }; - - SelectAdapter.prototype.select = function (data) { - var self = this; - - data.selected = true; - - // If data.element is a DOM node, use it instead - if ($(data.element).is('option')) { - data.element.selected = true; - - this.$element.trigger('change'); - - return; - } - - if (this.$element.prop('multiple')) { - this.current(function (currentData) { - var val = []; - - data = [data]; - data.push.apply(data, currentData); - - for (var d = 0; d < data.length; d++) { - var id = data[d].id; - - if ($.inArray(id, val) === -1) { - val.push(id); - } - } - - self.$element.val(val); - self.$element.trigger('change'); - }); - } else { - var val = data.id; - - this.$element.val(val); - this.$element.trigger('change'); - } - }; - - SelectAdapter.prototype.unselect = function (data) { - var self = this; - - if (!this.$element.prop('multiple')) { - return; - } - - data.selected = false; - - if ($(data.element).is('option')) { - data.element.selected = false; - - this.$element.trigger('change'); - - return; - } - - this.current(function (currentData) { - var val = []; - - for (var d = 0; d < currentData.length; d++) { - var id = currentData[d].id; - - if (id !== data.id && $.inArray(id, val) === -1) { - val.push(id); - } - } - - self.$element.val(val); - - self.$element.trigger('change'); - }); - }; - - SelectAdapter.prototype.bind = function (container, $container) { - var self = this; - - this.container = container; - - container.on('select', function (params) { - self.select(params.data); - }); - - container.on('unselect', function (params) { - self.unselect(params.data); - }); - }; - - SelectAdapter.prototype.destroy = function () { - // Remove anything added to child elements - this.$element.find('*').each(function () { - // Remove any custom data set by Select2 - $.removeData(this, 'data'); - }); - }; - - SelectAdapter.prototype.query = function (params, callback) { - var data = []; - var self = this; - - var $options = this.$element.children(); - - $options.each(function () { - var $option = $(this); - - if (!$option.is('option') && !$option.is('optgroup')) { - return; - } - - var option = self.item($option); - - var matches = self.matches(params, option); - - if (matches !== null) { - data.push(matches); - } - }); - - callback({ - results: data - }); - }; - - SelectAdapter.prototype.addOptions = function ($options) { - Utils.appendMany(this.$element, $options); - }; - - SelectAdapter.prototype.option = function (data) { - var option; - - if (data.children) { - option = document.createElement('optgroup'); - option.label = data.text; - } else { - option = document.createElement('option'); - - if (option.textContent !== undefined) { - option.textContent = data.text; - } else { - option.innerText = data.text; - } - } - - if (data.id) { - option.value = data.id; - } - - if (data.disabled) { - option.disabled = true; - } - - if (data.selected) { - option.selected = true; - } - - if (data.title) { - option.title = data.title; - } - - var $option = $(option); - - var normalizedData = this._normalizeItem(data); - normalizedData.element = option; - - // Override the option's data with the combined data - $.data(option, 'data', normalizedData); - - return $option; - }; - - SelectAdapter.prototype.item = function ($option) { - var data = {}; - - data = $.data($option[0], 'data'); - - if (data != null) { - return data; - } - - if ($option.is('option')) { - data = { - id: $option.val(), - text: $option.text(), - disabled: $option.prop('disabled'), - selected: $option.prop('selected'), - title: $option.prop('title') - }; - } else if ($option.is('optgroup')) { - data = { - text: $option.prop('label'), - children: [], - title: $option.prop('title') - }; - - var $children = $option.children('option'); - var children = []; - - for (var c = 0; c < $children.length; c++) { - var $child = $($children[c]); - - var child = this.item($child); - - children.push(child); - } - - data.children = children; - } - - data = this._normalizeItem(data); - data.element = $option[0]; - - $.data($option[0], 'data', data); - - return data; - }; - - SelectAdapter.prototype._normalizeItem = function (item) { - if (!$.isPlainObject(item)) { - item = { - id: item, - text: item - }; - } - - item = $.extend({}, { - text: '' - }, item); - - var defaults = { - selected: false, - disabled: false - }; - - if (item.id != null) { - item.id = item.id.toString(); - } - - if (item.text != null) { - item.text = item.text.toString(); - } - - if (item._resultId == null && item.id && this.container != null) { - item._resultId = this.generateResultId(this.container, item); - } - - return $.extend({}, defaults, item); - }; - - SelectAdapter.prototype.matches = function (params, data) { - var matcher = this.options.get('matcher'); - - return matcher(params, data); - }; - - return SelectAdapter; -}); - -S2.define('select2/data/array',[ - './select', - '../utils', - 'jquery' -], function (SelectAdapter, Utils, $) { - function ArrayAdapter ($element, options) { - var data = options.get('data') || []; - - ArrayAdapter.__super__.constructor.call(this, $element, options); - - this.addOptions(this.convertToOptions(data)); - } - - Utils.Extend(ArrayAdapter, SelectAdapter); - - ArrayAdapter.prototype.select = function (data) { - var $option = this.$element.find('option').filter(function (i, elm) { - return elm.value == data.id.toString(); - }); - - if ($option.length === 0) { - $option = this.option(data); - - this.addOptions($option); - } - - ArrayAdapter.__super__.select.call(this, data); - }; - - ArrayAdapter.prototype.convertToOptions = function (data) { - var self = this; - - var $existing = this.$element.find('option'); - var existingIds = $existing.map(function () { - return self.item($(this)).id; - }).get(); - - var $options = []; - - // Filter out all items except for the one passed in the argument - function onlyItem (item) { - return function () { - return $(this).val() == item.id; - }; - } - - for (var d = 0; d < data.length; d++) { - var item = this._normalizeItem(data[d]); - - // Skip items which were pre-loaded, only merge the data - if ($.inArray(item.id, existingIds) >= 0) { - var $existingOption = $existing.filter(onlyItem(item)); - - var existingData = this.item($existingOption); - var newData = $.extend(true, {}, existingData, item); - - var $newOption = this.option(existingData); - - $existingOption.replaceWith($newOption); - - continue; - } - - var $option = this.option(item); - - if (item.children) { - var $children = this.convertToOptions(item.children); - - Utils.appendMany($option, $children); - } - - $options.push($option); - } - - return $options; - }; - - return ArrayAdapter; -}); - -S2.define('select2/data/ajax',[ - './array', - '../utils', - 'jquery' -], function (ArrayAdapter, Utils, $) { - function AjaxAdapter ($element, options) { - this.ajaxOptions = this._applyDefaults(options.get('ajax')); - - if (this.ajaxOptions.processResults != null) { - this.processResults = this.ajaxOptions.processResults; - } - - ArrayAdapter.__super__.constructor.call(this, $element, options); - } - - Utils.Extend(AjaxAdapter, ArrayAdapter); - - AjaxAdapter.prototype._applyDefaults = function (options) { - var defaults = { - data: function (params) { - return { - q: params.term - }; - }, - transport: function (params, success, failure) { - var $request = $.ajax(params); - - $request.then(success); - $request.fail(failure); - - return $request; - } - }; - - return $.extend({}, defaults, options, true); - }; - - AjaxAdapter.prototype.processResults = function (results) { - return results; - }; - - AjaxAdapter.prototype.query = function (params, callback) { - var matches = []; - var self = this; - - if (this._request != null) { - // JSONP requests cannot always be aborted - if ($.isFunction(this._request.abort)) { - this._request.abort(); - } - - this._request = null; - } - - var options = $.extend({ - type: 'GET' - }, this.ajaxOptions); - - if (typeof options.url === 'function') { - options.url = options.url(params); - } - - if (typeof options.data === 'function') { - options.data = options.data(params); - } - - function request () { - var $request = options.transport(options, function (data) { - var results = self.processResults(data, params); - - if (self.options.get('debug') && window.console && console.error) { - // Check to make sure that the response included a `results` key. - if (!results || !results.results || !$.isArray(results.results)) { - console.error( - 'Select2: The AJAX results did not return an array in the ' + - '`results` key of the response.' - ); - } - } - - callback(results); - }, function () { - // TODO: Handle AJAX errors - }); - - self._request = $request; - } - - if (this.ajaxOptions.delay && params.term !== '') { - if (this._queryTimeout) { - window.clearTimeout(this._queryTimeout); - } - - this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); - } else { - request(); - } - }; - - return AjaxAdapter; -}); - -S2.define('select2/data/tags',[ - 'jquery' -], function ($) { - function Tags (decorated, $element, options) { - var tags = options.get('tags'); - - var createTag = options.get('createTag'); - - if (createTag !== undefined) { - this.createTag = createTag; - } - - decorated.call(this, $element, options); - - if ($.isArray(tags)) { - for (var t = 0; t < tags.length; t++) { - var tag = tags[t]; - var item = this._normalizeItem(tag); - - var $option = this.option(item); - - this.$element.append($option); - } - } - } - - Tags.prototype.query = function (decorated, params, callback) { - var self = this; - - this._removeOldTags(); - - if (params.term == null || params.page != null) { - decorated.call(this, params, callback); - return; - } - - function wrapper (obj, child) { - var data = obj.results; - - for (var i = 0; i < data.length; i++) { - var option = data[i]; - - var checkChildren = ( - option.children != null && - !wrapper({ - results: option.children - }, true) - ); - - var checkText = option.text === params.term; - - if (checkText || checkChildren) { - if (child) { - return false; - } - - obj.data = data; - callback(obj); - - return; - } - } - - if (child) { - return true; - } - - var tag = self.createTag(params); - - if (tag != null) { - var $option = self.option(tag); - $option.attr('data-select2-tag', true); - - self.addOptions([$option]); - - self.insertTag(data, tag); - } - - obj.results = data; - - callback(obj); - } - - decorated.call(this, params, wrapper); - }; - - Tags.prototype.createTag = function (decorated, params) { - var term = $.trim(params.term); - - if (term === '') { - return null; - } - - return { - id: term, - text: term - }; - }; - - Tags.prototype.insertTag = function (_, data, tag) { - data.unshift(tag); - }; - - Tags.prototype._removeOldTags = function (_) { - var tag = this._lastTag; - - var $options = this.$element.find('option[data-select2-tag]'); - - $options.each(function () { - if (this.selected) { - return; - } - - $(this).remove(); - }); - }; - - return Tags; -}); - -S2.define('select2/data/tokenizer',[ - 'jquery' -], function ($) { - function Tokenizer (decorated, $element, options) { - var tokenizer = options.get('tokenizer'); - - if (tokenizer !== undefined) { - this.tokenizer = tokenizer; - } - - decorated.call(this, $element, options); - } - - Tokenizer.prototype.bind = function (decorated, container, $container) { - decorated.call(this, container, $container); - - this.$search = container.dropdown.$search || container.selection.$search || - $container.find('.select2-search__field'); - }; - - Tokenizer.prototype.query = function (decorated, params, callback) { - var self = this; - - function select (data) { - self.select(data); - } - - params.term = params.term || ''; - - var tokenData = this.tokenizer(params, this.options, select); - - if (tokenData.term !== params.term) { - // Replace the search term if we have the search box - if (this.$search.length) { - this.$search.val(tokenData.term); - this.$search.focus(); - } - - params.term = tokenData.term; - } - - decorated.call(this, params, callback); - }; - - Tokenizer.prototype.tokenizer = function (_, params, options, callback) { - var separators = options.get('tokenSeparators') || []; - var term = params.term; - var i = 0; - - var createTag = this.createTag || function (params) { - return { - id: params.term, - text: params.term - }; - }; - - while (i < term.length) { - var termChar = term[i]; - - if ($.inArray(termChar, separators) === -1) { - i++; - - continue; - } - - var part = term.substr(0, i); - var partParams = $.extend({}, params, { - term: part - }); - - var data = createTag(partParams); - - callback(data); - - // Reset the term to not include the tokenized portion - term = term.substr(i + 1) || ''; - i = 0; - } - - return { - term: term - }; - }; - - return Tokenizer; -}); - -S2.define('select2/data/minimumInputLength',[ - -], function () { - function MinimumInputLength (decorated, $e, options) { - this.minimumInputLength = options.get('minimumInputLength'); - - decorated.call(this, $e, options); - } - - MinimumInputLength.prototype.query = function (decorated, params, callback) { - params.term = params.term || ''; - - if (params.term.length < this.minimumInputLength) { - this.trigger('results:message', { - message: 'inputTooShort', - args: { - minimum: this.minimumInputLength, - input: params.term, - params: params - } - }); - - return; - } - - decorated.call(this, params, callback); - }; - - return MinimumInputLength; -}); - -S2.define('select2/data/maximumInputLength',[ - -], function () { - function MaximumInputLength (decorated, $e, options) { - this.maximumInputLength = options.get('maximumInputLength'); - - decorated.call(this, $e, options); - } - - MaximumInputLength.prototype.query = function (decorated, params, callback) { - params.term = params.term || ''; - - if (this.maximumInputLength > 0 && - params.term.length > this.maximumInputLength) { - this.trigger('results:message', { - message: 'inputTooLong', - args: { - maximum: this.maximumInputLength, - input: params.term, - params: params - } - }); - - return; - } - - decorated.call(this, params, callback); - }; - - return MaximumInputLength; -}); - -S2.define('select2/data/maximumSelectionLength',[ - -], function (){ - function MaximumSelectionLength (decorated, $e, options) { - this.maximumSelectionLength = options.get('maximumSelectionLength'); - - decorated.call(this, $e, options); - } - - MaximumSelectionLength.prototype.query = - function (decorated, params, callback) { - var self = this; - - this.current(function (currentData) { - var count = currentData != null ? currentData.length : 0; - if (self.maximumSelectionLength > 0 && - count >= self.maximumSelectionLength) { - self.trigger('results:message', { - message: 'maximumSelected', - args: { - maximum: self.maximumSelectionLength - } - }); - return; - } - decorated.call(self, params, callback); - }); - }; - - return MaximumSelectionLength; -}); - -S2.define('select2/dropdown',[ - 'jquery', - './utils' -], function ($, Utils) { - function Dropdown ($element, options) { - this.$element = $element; - this.options = options; - - Dropdown.__super__.constructor.call(this); - } - - Utils.Extend(Dropdown, Utils.Observable); - - Dropdown.prototype.render = function () { - var $dropdown = $( - '' + - '' + - '' - ); - - $dropdown.attr('dir', this.options.get('dir')); - - this.$dropdown = $dropdown; - - return $dropdown; - }; - - Dropdown.prototype.position = function ($dropdown, $container) { - // Should be implmented in subclasses - }; - - Dropdown.prototype.destroy = function () { - // Remove the dropdown from the DOM - this.$dropdown.remove(); - }; - - return Dropdown; -}); - -S2.define('select2/dropdown/search',[ - 'jquery', - '../utils' -], function ($, Utils) { - function Search () { } - - Search.prototype.render = function (decorated) { - var $rendered = decorated.call(this); - - var $search = $( - '' + - '' + - '' - ); - - this.$searchContainer = $search; - this.$search = $search.find('input'); - - $rendered.prepend($search); - - return $rendered; - }; - - Search.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - this.$search.on('keydown', function (evt) { - self.trigger('keypress', evt); - - self._keyUpPrevented = evt.isDefaultPrevented(); - }); - - // Workaround for browsers which do not support the `input` event - // This will prevent double-triggering of events for browsers which support - // both the `keyup` and `input` events. - this.$search.on('input', function (evt) { - // Unbind the duplicated `keyup` event - $(this).off('keyup'); - }); - - this.$search.on('keyup input', function (evt) { - self.handleSearch(evt); - }); - - container.on('open', function () { - self.$search.attr('tabindex', 0); - - self.$search.focus(); - - window.setTimeout(function () { - self.$search.focus(); - }, 0); - }); - - container.on('close', function () { - self.$search.attr('tabindex', -1); - - self.$search.val(''); - }); - - container.on('results:all', function (params) { - if (params.query.term == null || params.query.term === '') { - var showSearch = self.showSearch(params); - - if (showSearch) { - self.$searchContainer.removeClass('select2-search--hide'); - } else { - self.$searchContainer.addClass('select2-search--hide'); - } - } - }); - }; - - Search.prototype.handleSearch = function (evt) { - if (!this._keyUpPrevented) { - var input = this.$search.val(); - - this.trigger('query', { - term: input - }); - } - - this._keyUpPrevented = false; - }; - - Search.prototype.showSearch = function (_, params) { - return true; - }; - - return Search; -}); - -S2.define('select2/dropdown/hidePlaceholder',[ - -], function () { - function HidePlaceholder (decorated, $element, options, dataAdapter) { - this.placeholder = this.normalizePlaceholder(options.get('placeholder')); - - decorated.call(this, $element, options, dataAdapter); - } - - HidePlaceholder.prototype.append = function (decorated, data) { - data.results = this.removePlaceholder(data.results); - - decorated.call(this, data); - }; - - HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { - if (typeof placeholder === 'string') { - placeholder = { - id: '', - text: placeholder - }; - } - - return placeholder; - }; - - HidePlaceholder.prototype.removePlaceholder = function (_, data) { - var modifiedData = data.slice(0); - - for (var d = data.length - 1; d >= 0; d--) { - var item = data[d]; - - if (this.placeholder.id === item.id) { - modifiedData.splice(d, 1); - } - } - - return modifiedData; - }; - - return HidePlaceholder; -}); - -S2.define('select2/dropdown/infiniteScroll',[ - 'jquery' -], function ($) { - function InfiniteScroll (decorated, $element, options, dataAdapter) { - this.lastParams = {}; - - decorated.call(this, $element, options, dataAdapter); - - this.$loadingMore = this.createLoadingMore(); - this.loading = false; - } - - InfiniteScroll.prototype.append = function (decorated, data) { - this.$loadingMore.remove(); - this.loading = false; - - decorated.call(this, data); - - if (this.showLoadingMore(data)) { - this.$results.append(this.$loadingMore); - } - }; - - InfiniteScroll.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - container.on('query', function (params) { - self.lastParams = params; - self.loading = true; - }); - - container.on('query:append', function (params) { - self.lastParams = params; - self.loading = true; - }); - - this.$results.on('scroll', function () { - var isLoadMoreVisible = $.contains( - document.documentElement, - self.$loadingMore[0] - ); - - if (self.loading || !isLoadMoreVisible) { - return; - } - - var currentOffset = self.$results.offset().top + - self.$results.outerHeight(false); - var loadingMoreOffset = self.$loadingMore.offset().top + - self.$loadingMore.outerHeight(false); - - if (currentOffset + 50 >= loadingMoreOffset) { - self.loadMore(); - } - }); - }; - - InfiniteScroll.prototype.loadMore = function () { - this.loading = true; - - var params = $.extend({}, {page: 1}, this.lastParams); - - params.page++; - - this.trigger('query:append', params); - }; - - InfiniteScroll.prototype.showLoadingMore = function (_, data) { - return data.pagination && data.pagination.more; - }; - - InfiniteScroll.prototype.createLoadingMore = function () { - var $option = $( - '
      • ' - ); - - var message = this.options.get('translations').get('loadingMore'); - - $option.html(message(this.lastParams)); - - return $option; - }; - - return InfiniteScroll; -}); - -S2.define('select2/dropdown/attachBody',[ - 'jquery', - '../utils' -], function ($, Utils) { - function AttachBody (decorated, $element, options) { - this.$dropdownParent = options.get('dropdownParent') || document.body; - - decorated.call(this, $element, options); - } - - AttachBody.prototype.bind = function (decorated, container, $container) { - var self = this; - - var setupResultsEvents = false; - - decorated.call(this, container, $container); - - container.on('open', function () { - self._showDropdown(); - self._attachPositioningHandler(container); - - if (!setupResultsEvents) { - setupResultsEvents = true; - - container.on('results:all', function () { - self._positionDropdown(); - self._resizeDropdown(); - }); - - container.on('results:append', function () { - self._positionDropdown(); - self._resizeDropdown(); - }); - } - }); - - container.on('close', function () { - self._hideDropdown(); - self._detachPositioningHandler(container); - }); - - this.$dropdownContainer.on('mousedown', function (evt) { - evt.stopPropagation(); - }); - }; - - AttachBody.prototype.position = function (decorated, $dropdown, $container) { - // Clone all of the container classes - $dropdown.attr('class', $container.attr('class')); - - $dropdown.removeClass('select2'); - $dropdown.addClass('select2-container--open'); - - $dropdown.css({ - position: 'absolute', - top: -999999 - }); - - this.$container = $container; - }; - - AttachBody.prototype.render = function (decorated) { - var $container = $(''); - - var $dropdown = decorated.call(this); - $container.append($dropdown); - - this.$dropdownContainer = $container; - - return $container; - }; - - AttachBody.prototype._hideDropdown = function (decorated) { - this.$dropdownContainer.detach(); - }; - - AttachBody.prototype._attachPositioningHandler = function (container) { - var self = this; - - var scrollEvent = 'scroll.select2.' + container.id; - var resizeEvent = 'resize.select2.' + container.id; - var orientationEvent = 'orientationchange.select2.' + container.id; - - var $watchers = this.$container.parents().filter(Utils.hasScroll); - $watchers.each(function () { - $(this).data('select2-scroll-position', { - x: $(this).scrollLeft(), - y: $(this).scrollTop() - }); - }); - - $watchers.on(scrollEvent, function (ev) { - var position = $(this).data('select2-scroll-position'); - $(this).scrollTop(position.y); - }); - - $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, - function (e) { - self._positionDropdown(); - self._resizeDropdown(); - }); - }; - - AttachBody.prototype._detachPositioningHandler = function (container) { - var scrollEvent = 'scroll.select2.' + container.id; - var resizeEvent = 'resize.select2.' + container.id; - var orientationEvent = 'orientationchange.select2.' + container.id; - - var $watchers = this.$container.parents().filter(Utils.hasScroll); - $watchers.off(scrollEvent); - - $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); - }; - - AttachBody.prototype._positionDropdown = function () { - var $window = $(window); - - var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); - var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); - - var newDirection = null; - - var position = this.$container.position(); - var offset = this.$container.offset(); - - offset.bottom = offset.top + this.$container.outerHeight(false); - - var container = { - height: this.$container.outerHeight(false) - }; - - container.top = offset.top; - container.bottom = offset.top + container.height; - - var dropdown = { - height: this.$dropdown.outerHeight(false) - }; - - var viewport = { - top: $window.scrollTop(), - bottom: $window.scrollTop() + $window.height() - }; - - var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); - var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); - - var css = { - left: offset.left, - top: container.bottom - }; - - if (!isCurrentlyAbove && !isCurrentlyBelow) { - newDirection = 'below'; - } - - if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { - newDirection = 'above'; - } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { - newDirection = 'below'; - } - - if (newDirection == 'above' || - (isCurrentlyAbove && newDirection !== 'below')) { - css.top = container.top - dropdown.height; - } - - if (newDirection != null) { - this.$dropdown - .removeClass('select2-dropdown--below select2-dropdown--above') - .addClass('select2-dropdown--' + newDirection); - this.$container - .removeClass('select2-container--below select2-container--above') - .addClass('select2-container--' + newDirection); - } - - this.$dropdownContainer.css(css); - }; - - AttachBody.prototype._resizeDropdown = function () { - this.$dropdownContainer.width(); - - var css = { - width: this.$container.outerWidth(false) + 'px' - }; - - if (this.options.get('dropdownAutoWidth')) { - css.minWidth = css.width; - css.width = 'auto'; - } - - this.$dropdown.css(css); - }; - - AttachBody.prototype._showDropdown = function (decorated) { - this.$dropdownContainer.appendTo(this.$dropdownParent); - - this._positionDropdown(); - this._resizeDropdown(); - }; - - return AttachBody; -}); - -S2.define('select2/dropdown/minimumResultsForSearch',[ - -], function () { - function countResults (data) { - var count = 0; - - for (var d = 0; d < data.length; d++) { - var item = data[d]; - - if (item.children) { - count += countResults(item.children); - } else { - count++; - } - } - - return count; - } - - function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { - this.minimumResultsForSearch = options.get('minimumResultsForSearch'); - - if (this.minimumResultsForSearch < 0) { - this.minimumResultsForSearch = Infinity; - } - - decorated.call(this, $element, options, dataAdapter); - } - - MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { - if (countResults(params.data.results) < this.minimumResultsForSearch) { - return false; - } - - return decorated.call(this, params); - }; - - return MinimumResultsForSearch; -}); - -S2.define('select2/dropdown/selectOnClose',[ - -], function () { - function SelectOnClose () { } - - SelectOnClose.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - container.on('close', function () { - self._handleSelectOnClose(); - }); - }; - - SelectOnClose.prototype._handleSelectOnClose = function () { - var $highlightedResults = this.getHighlightedResults(); - - if ($highlightedResults.length < 1) { - return; - } - - this.trigger('select', { - data: $highlightedResults.data('data') - }); - }; - - return SelectOnClose; -}); - -S2.define('select2/dropdown/closeOnSelect',[ - -], function () { - function CloseOnSelect () { } - - CloseOnSelect.prototype.bind = function (decorated, container, $container) { - var self = this; - - decorated.call(this, container, $container); - - container.on('select', function (evt) { - self._selectTriggered(evt); - }); - - container.on('unselect', function (evt) { - self._selectTriggered(evt); - }); - }; - - CloseOnSelect.prototype._selectTriggered = function (_, evt) { - var originalEvent = evt.originalEvent; - - // Don't close if the control key is being held - if (originalEvent && originalEvent.ctrlKey) { - return; - } - - this.trigger('close'); - }; - - return CloseOnSelect; -}); - -S2.define('select2/i18n/en',[],function () { - // English - return { - errorLoading: function () { - return 'The results could not be loaded.'; - }, - inputTooLong: function (args) { - var overChars = args.input.length - args.maximum; - - var message = 'Please delete ' + overChars + ' character'; - - if (overChars != 1) { - message += 's'; - } - - return message; - }, - inputTooShort: function (args) { - var remainingChars = args.minimum - args.input.length; - - var message = 'Please enter ' + remainingChars + ' or more characters'; - - return message; - }, - loadingMore: function () { - return 'Loading more results…'; - }, - maximumSelected: function (args) { - var message = 'You can only select ' + args.maximum + ' item'; - - if (args.maximum != 1) { - message += 's'; - } - - return message; - }, - noResults: function () { - return 'No results found'; - }, - searching: function () { - return 'Searching…'; - } - }; -}); - -S2.define('select2/defaults',[ - 'jquery', - 'require', - - './results', - - './selection/single', - './selection/multiple', - './selection/placeholder', - './selection/allowClear', - './selection/search', - './selection/eventRelay', - - './utils', - './translation', - './diacritics', - - './data/select', - './data/array', - './data/ajax', - './data/tags', - './data/tokenizer', - './data/minimumInputLength', - './data/maximumInputLength', - './data/maximumSelectionLength', - - './dropdown', - './dropdown/search', - './dropdown/hidePlaceholder', - './dropdown/infiniteScroll', - './dropdown/attachBody', - './dropdown/minimumResultsForSearch', - './dropdown/selectOnClose', - './dropdown/closeOnSelect', - - './i18n/en' -], function ($, require, - - ResultsList, - - SingleSelection, MultipleSelection, Placeholder, AllowClear, - SelectionSearch, EventRelay, - - Utils, Translation, DIACRITICS, - - SelectData, ArrayData, AjaxData, Tags, Tokenizer, - MinimumInputLength, MaximumInputLength, MaximumSelectionLength, - - Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, - AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, - - EnglishTranslation) { - function Defaults () { - this.reset(); - } - - Defaults.prototype.apply = function (options) { - options = $.extend({}, this.defaults, options); - - if (options.dataAdapter == null) { - if (options.ajax != null) { - options.dataAdapter = AjaxData; - } else if (options.data != null) { - options.dataAdapter = ArrayData; - } else { - options.dataAdapter = SelectData; - } - - if (options.minimumInputLength > 0) { - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - MinimumInputLength - ); - } - - if (options.maximumInputLength > 0) { - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - MaximumInputLength - ); - } - - if (options.maximumSelectionLength > 0) { - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - MaximumSelectionLength - ); - } - - if (options.tags) { - options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); - } - - if (options.tokenSeparators != null || options.tokenizer != null) { - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - Tokenizer - ); - } - - if (options.query != null) { - var Query = require(options.amdBase + 'compat/query'); - - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - Query - ); - } - - if (options.initSelection != null) { - var InitSelection = require(options.amdBase + 'compat/initSelection'); - - options.dataAdapter = Utils.Decorate( - options.dataAdapter, - InitSelection - ); - } - } - - if (options.resultsAdapter == null) { - options.resultsAdapter = ResultsList; - - if (options.ajax != null) { - options.resultsAdapter = Utils.Decorate( - options.resultsAdapter, - InfiniteScroll - ); - } - - if (options.placeholder != null) { - options.resultsAdapter = Utils.Decorate( - options.resultsAdapter, - HidePlaceholder - ); - } - - if (options.selectOnClose) { - options.resultsAdapter = Utils.Decorate( - options.resultsAdapter, - SelectOnClose - ); - } - } - - if (options.dropdownAdapter == null) { - if (options.multiple) { - options.dropdownAdapter = Dropdown; - } else { - var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); - - options.dropdownAdapter = SearchableDropdown; - } - - if (options.minimumResultsForSearch !== 0) { - options.dropdownAdapter = Utils.Decorate( - options.dropdownAdapter, - MinimumResultsForSearch - ); - } - - if (options.closeOnSelect) { - options.dropdownAdapter = Utils.Decorate( - options.dropdownAdapter, - CloseOnSelect - ); - } - - if ( - options.dropdownCssClass != null || - options.dropdownCss != null || - options.adaptDropdownCssClass != null - ) { - var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); - - options.dropdownAdapter = Utils.Decorate( - options.dropdownAdapter, - DropdownCSS - ); - } - - options.dropdownAdapter = Utils.Decorate( - options.dropdownAdapter, - AttachBody - ); - } - - if (options.selectionAdapter == null) { - if (options.multiple) { - options.selectionAdapter = MultipleSelection; - } else { - options.selectionAdapter = SingleSelection; - } - - // Add the placeholder mixin if a placeholder was specified - if (options.placeholder != null) { - options.selectionAdapter = Utils.Decorate( - options.selectionAdapter, - Placeholder - ); - } - - if (options.allowClear) { - options.selectionAdapter = Utils.Decorate( - options.selectionAdapter, - AllowClear - ); - } - - if (options.multiple) { - options.selectionAdapter = Utils.Decorate( - options.selectionAdapter, - SelectionSearch - ); - } - - if ( - options.containerCssClass != null || - options.containerCss != null || - options.adaptContainerCssClass != null - ) { - var ContainerCSS = require(options.amdBase + 'compat/containerCss'); - - options.selectionAdapter = Utils.Decorate( - options.selectionAdapter, - ContainerCSS - ); - } - - options.selectionAdapter = Utils.Decorate( - options.selectionAdapter, - EventRelay - ); - } - - if (typeof options.language === 'string') { - // Check if the language is specified with a region - if (options.language.indexOf('-') > 0) { - // Extract the region information if it is included - var languageParts = options.language.split('-'); - var baseLanguage = languageParts[0]; - - options.language = [options.language, baseLanguage]; - } else { - options.language = [options.language]; - } - } - - if ($.isArray(options.language)) { - var languages = new Translation(); - options.language.push('en'); - - var languageNames = options.language; - - for (var l = 0; l < languageNames.length; l++) { - var name = languageNames[l]; - var language = {}; - - try { - // Try to load it with the original name - language = Translation.loadPath(name); - } catch (e) { - try { - // If we couldn't load it, check if it wasn't the full path - name = this.defaults.amdLanguageBase + name; - language = Translation.loadPath(name); - } catch (ex) { - // The translation could not be loaded at all. Sometimes this is - // because of a configuration problem, other times this can be - // because of how Select2 helps load all possible translation files. - if (options.debug && window.console && console.warn) { - console.warn( - 'Select2: The language file for "' + name + '" could not be ' + - 'automatically loaded. A fallback will be used instead.' - ); - } - - continue; - } - } - - languages.extend(language); - } - - options.translations = languages; - } else { - var baseTranslation = Translation.loadPath( - this.defaults.amdLanguageBase + 'en' - ); - var customTranslation = new Translation(options.language); - - customTranslation.extend(baseTranslation); - - options.translations = customTranslation; - } - - return options; - }; - - Defaults.prototype.reset = function () { - function stripDiacritics (text) { - // Used 'uni range + named function' from http://jsperf.com/diacritics/18 - function match(a) { - return DIACRITICS[a] || a; - } - - return text.replace(/[^\u0000-\u007E]/g, match); - } - - function matcher (params, data) { - // Always return the object if there is nothing to compare - if ($.trim(params.term) === '') { - return data; - } - - // Do a recursive check for options with children - if (data.children && data.children.length > 0) { - // Clone the data object if there are children - // This is required as we modify the object to remove any non-matches - var match = $.extend(true, {}, data); - - // Check each child of the option - for (var c = data.children.length - 1; c >= 0; c--) { - var child = data.children[c]; - - var matches = matcher(params, child); - - // If there wasn't a match, remove the object in the array - if (matches == null) { - match.children.splice(c, 1); - } - } - - // If any children matched, return the new object - if (match.children.length > 0) { - return match; - } - - // If there were no matching children, check just the plain object - return matcher(params, match); - } - - var original = stripDiacritics(data.text).toUpperCase(); - var term = stripDiacritics(params.term).toUpperCase(); - - // Check if the text contains the term - if (original.indexOf(term) > -1) { - return data; - } - - // If it doesn't contain the term, don't return anything - return null; - } - - this.defaults = { - amdBase: './', - amdLanguageBase: './i18n/', - closeOnSelect: true, - debug: false, - dropdownAutoWidth: false, - escapeMarkup: Utils.escapeMarkup, - language: EnglishTranslation, - matcher: matcher, - minimumInputLength: 0, - maximumInputLength: 0, - maximumSelectionLength: 0, - minimumResultsForSearch: 0, - selectOnClose: false, - sorter: function (data) { - return data; - }, - templateResult: function (result) { - return result.text; - }, - templateSelection: function (selection) { - return selection.text; - }, - theme: 'default', - width: 'resolve' - }; - }; - - Defaults.prototype.set = function (key, value) { - var camelKey = $.camelCase(key); - - var data = {}; - data[camelKey] = value; - - var convertedData = Utils._convertData(data); - - $.extend(this.defaults, convertedData); - }; - - var defaults = new Defaults(); - - return defaults; -}); - -S2.define('select2/options',[ - 'require', - 'jquery', - './defaults', - './utils' -], function (require, $, Defaults, Utils) { - function Options (options, $element) { - this.options = options; - - if ($element != null) { - this.fromElement($element); - } - - this.options = Defaults.apply(this.options); - - if ($element && $element.is('input')) { - var InputCompat = require(this.get('amdBase') + 'compat/inputData'); - - this.options.dataAdapter = Utils.Decorate( - this.options.dataAdapter, - InputCompat - ); - } - } - - Options.prototype.fromElement = function ($e) { - var excludedData = ['select2']; - - if (this.options.multiple == null) { - this.options.multiple = $e.prop('multiple'); - } - - if (this.options.disabled == null) { - this.options.disabled = $e.prop('disabled'); - } - - if (this.options.language == null) { - if ($e.prop('lang')) { - this.options.language = $e.prop('lang').toLowerCase(); - } else if ($e.closest('[lang]').prop('lang')) { - this.options.language = $e.closest('[lang]').prop('lang'); - } - } - - if (this.options.dir == null) { - if ($e.prop('dir')) { - this.options.dir = $e.prop('dir'); - } else if ($e.closest('[dir]').prop('dir')) { - this.options.dir = $e.closest('[dir]').prop('dir'); - } else { - this.options.dir = 'ltr'; - } - } - - $e.prop('disabled', this.options.disabled); - $e.prop('multiple', this.options.multiple); - - if ($e.data('select2Tags')) { - if (this.options.debug && window.console && console.warn) { - console.warn( - 'Select2: The `data-select2-tags` attribute has been changed to ' + - 'use the `data-data` and `data-tags="true"` attributes and will be ' + - 'removed in future versions of Select2.' - ); - } - - $e.data('data', $e.data('select2Tags')); - $e.data('tags', true); - } - - if ($e.data('ajaxUrl')) { - if (this.options.debug && window.console && console.warn) { - console.warn( - 'Select2: The `data-ajax-url` attribute has been changed to ' + - '`data-ajax--url` and support for the old attribute will be removed' + - ' in future versions of Select2.' - ); - } - - $e.attr('ajax--url', $e.data('ajaxUrl')); - $e.data('ajax--url', $e.data('ajaxUrl')); - } - - var dataset = {}; - - // Prefer the element's `dataset` attribute if it exists - // jQuery 1.x does not correctly handle data attributes with multiple dashes - if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { - dataset = $.extend(true, {}, $e[0].dataset, $e.data()); - } else { - dataset = $e.data(); - } - - var data = $.extend(true, {}, dataset); - - data = Utils._convertData(data); - - for (var key in data) { - if ($.inArray(key, excludedData) > -1) { - continue; - } - - if ($.isPlainObject(this.options[key])) { - $.extend(this.options[key], data[key]); - } else { - this.options[key] = data[key]; - } - } - - return this; - }; - - Options.prototype.get = function (key) { - return this.options[key]; - }; - - Options.prototype.set = function (key, val) { - this.options[key] = val; - }; - - return Options; -}); - -S2.define('select2/core',[ - 'jquery', - './options', - './utils', - './keys' -], function ($, Options, Utils, KEYS) { - var Select2 = function ($element, options) { - if ($element.data('select2') != null) { - $element.data('select2').destroy(); - } - - this.$element = $element; - - this.id = this._generateId($element); - - options = options || {}; - - this.options = new Options(options, $element); - - Select2.__super__.constructor.call(this); - - // Set up the tabindex - - var tabindex = $element.attr('tabindex') || 0; - $element.data('old-tabindex', tabindex); - $element.attr('tabindex', '-1'); - - // Set up containers and adapters - - var DataAdapter = this.options.get('dataAdapter'); - this.dataAdapter = new DataAdapter($element, this.options); - - var $container = this.render(); - - this._placeContainer($container); - - var SelectionAdapter = this.options.get('selectionAdapter'); - this.selection = new SelectionAdapter($element, this.options); - this.$selection = this.selection.render(); - - this.selection.position(this.$selection, $container); - - var DropdownAdapter = this.options.get('dropdownAdapter'); - this.dropdown = new DropdownAdapter($element, this.options); - this.$dropdown = this.dropdown.render(); - - this.dropdown.position(this.$dropdown, $container); - - var ResultsAdapter = this.options.get('resultsAdapter'); - this.results = new ResultsAdapter($element, this.options, this.dataAdapter); - this.$results = this.results.render(); - - this.results.position(this.$results, this.$dropdown); - - // Bind events - - var self = this; - - // Bind the container to all of the adapters - this._bindAdapters(); - - // Register any DOM event handlers - this._registerDomEvents(); - - // Register any internal event handlers - this._registerDataEvents(); - this._registerSelectionEvents(); - this._registerDropdownEvents(); - this._registerResultsEvents(); - this._registerEvents(); - - // Set the initial state - this.dataAdapter.current(function (initialData) { - self.trigger('selection:update', { - data: initialData - }); - }); - - // Hide the original select - $element.addClass('select2-hidden-accessible'); - $element.attr('aria-hidden', 'true'); - - // Synchronize any monitored attributes - this._syncAttributes(); - - $element.data('select2', this); - }; - - Utils.Extend(Select2, Utils.Observable); - - Select2.prototype._generateId = function ($element) { - var id = ''; - - if ($element.attr('id') != null) { - id = $element.attr('id'); - } else if ($element.attr('name') != null) { - id = $element.attr('name') + '-' + Utils.generateChars(2); - } else { - id = Utils.generateChars(4); - } - - id = 'select2-' + id; - - return id; - }; - - Select2.prototype._placeContainer = function ($container) { - $container.insertAfter(this.$element); - - var width = this._resolveWidth(this.$element, this.options.get('width')); - - if (width != null) { - $container.css('width', width); - } - }; - - Select2.prototype._resolveWidth = function ($element, method) { - var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; - - if (method == 'resolve') { - var styleWidth = this._resolveWidth($element, 'style'); - - if (styleWidth != null) { - return styleWidth; - } - - return this._resolveWidth($element, 'element'); - } - - if (method == 'element') { - var elementWidth = $element.outerWidth(false); - - if (elementWidth <= 0) { - return 'auto'; - } - - return elementWidth + 'px'; - } - - if (method == 'style') { - var style = $element.attr('style'); - - if (typeof(style) !== 'string') { - return null; - } - - var attrs = style.split(';'); - - for (var i = 0, l = attrs.length; i < l; i = i + 1) { - var attr = attrs[i].replace(/\s/g, ''); - var matches = attr.match(WIDTH); - - if (matches !== null && matches.length >= 1) { - return matches[1]; - } - } - - return null; - } - - return method; - }; - - Select2.prototype._bindAdapters = function () { - this.dataAdapter.bind(this, this.$container); - this.selection.bind(this, this.$container); - - this.dropdown.bind(this, this.$container); - this.results.bind(this, this.$container); - }; - - Select2.prototype._registerDomEvents = function () { - var self = this; - - this.$element.on('change.select2', function () { - self.dataAdapter.current(function (data) { - self.trigger('selection:update', { - data: data - }); - }); - }); - - this._sync = Utils.bind(this._syncAttributes, this); - - if (this.$element[0].attachEvent) { - this.$element[0].attachEvent('onpropertychange', this._sync); - } - - var observer = window.MutationObserver || - window.WebKitMutationObserver || - window.MozMutationObserver - ; - - if (observer != null) { - this._observer = new observer(function (mutations) { - $.each(mutations, self._sync); - }); - this._observer.observe(this.$element[0], { - attributes: true, - subtree: false - }); - } else if (this.$element[0].addEventListener) { - this.$element[0].addEventListener('DOMAttrModified', self._sync, false); - } - }; - - Select2.prototype._registerDataEvents = function () { - var self = this; - - this.dataAdapter.on('*', function (name, params) { - self.trigger(name, params); - }); - }; - - Select2.prototype._registerSelectionEvents = function () { - var self = this; - var nonRelayEvents = ['toggle']; - - this.selection.on('toggle', function () { - self.toggleDropdown(); - }); - - this.selection.on('*', function (name, params) { - if ($.inArray(name, nonRelayEvents) !== -1) { - return; - } - - self.trigger(name, params); - }); - }; - - Select2.prototype._registerDropdownEvents = function () { - var self = this; - - this.dropdown.on('*', function (name, params) { - self.trigger(name, params); - }); - }; - - Select2.prototype._registerResultsEvents = function () { - var self = this; - - this.results.on('*', function (name, params) { - self.trigger(name, params); - }); - }; - - Select2.prototype._registerEvents = function () { - var self = this; - - this.on('open', function () { - self.$container.addClass('select2-container--open'); - }); - - this.on('close', function () { - self.$container.removeClass('select2-container--open'); - }); - - this.on('enable', function () { - self.$container.removeClass('select2-container--disabled'); - }); - - this.on('disable', function () { - self.$container.addClass('select2-container--disabled'); - }); - - this.on('focus', function () { - self.$container.addClass('select2-container--focus'); - }); - - this.on('blur', function () { - self.$container.removeClass('select2-container--focus'); - }); - - this.on('query', function (params) { - if (!self.isOpen()) { - self.trigger('open'); - } - - this.dataAdapter.query(params, function (data) { - self.trigger('results:all', { - data: data, - query: params - }); - }); - }); - - this.on('query:append', function (params) { - this.dataAdapter.query(params, function (data) { - self.trigger('results:append', { - data: data, - query: params - }); - }); - }); - - this.on('keypress', function (evt) { - var key = evt.which; - - if (self.isOpen()) { - if (key === KEYS.ENTER) { - self.trigger('results:select'); - - evt.preventDefault(); - } else if ((key === KEYS.SPACE && evt.ctrlKey)) { - self.trigger('results:toggle'); - - evt.preventDefault(); - } else if (key === KEYS.UP) { - self.trigger('results:previous'); - - evt.preventDefault(); - } else if (key === KEYS.DOWN) { - self.trigger('results:next'); - - evt.preventDefault(); - } else if (key === KEYS.ESC || key === KEYS.TAB) { - self.close(); - - evt.preventDefault(); - } - } else { - if (key === KEYS.ENTER || key === KEYS.SPACE || - ((key === KEYS.DOWN || key === KEYS.UP) && evt.altKey)) { - self.open(); - - evt.preventDefault(); - } - } - }); - }; - - Select2.prototype._syncAttributes = function () { - this.options.set('disabled', this.$element.prop('disabled')); - - if (this.options.get('disabled')) { - if (this.isOpen()) { - this.close(); - } - - this.trigger('disable'); - } else { - this.trigger('enable'); - } - }; - - /** - * Override the trigger method to automatically trigger pre-events when - * there are events that can be prevented. - */ - Select2.prototype.trigger = function (name, args) { - var actualTrigger = Select2.__super__.trigger; - var preTriggerMap = { - 'open': 'opening', - 'close': 'closing', - 'select': 'selecting', - 'unselect': 'unselecting' - }; - - if (name in preTriggerMap) { - var preTriggerName = preTriggerMap[name]; - var preTriggerArgs = { - prevented: false, - name: name, - args: args - }; - - actualTrigger.call(this, preTriggerName, preTriggerArgs); - - if (preTriggerArgs.prevented) { - args.prevented = true; - - return; - } - } - - actualTrigger.call(this, name, args); - }; - - Select2.prototype.toggleDropdown = function () { - if (this.options.get('disabled')) { - return; - } - - if (this.isOpen()) { - this.close(); - } else { - this.open(); - } - }; - - Select2.prototype.open = function () { - if (this.isOpen()) { - return; - } - - this.trigger('query', {}); - - this.trigger('open'); - }; - - Select2.prototype.close = function () { - if (!this.isOpen()) { - return; - } - - this.trigger('close'); - }; - - Select2.prototype.isOpen = function () { - return this.$container.hasClass('select2-container--open'); - }; - - Select2.prototype.enable = function (args) { - if (this.options.get('debug') && window.console && console.warn) { - console.warn( - 'Select2: The `select2("enable")` method has been deprecated and will' + - ' be removed in later Select2 versions. Use $element.prop("disabled")' + - ' instead.' - ); - } - - if (args == null || args.length === 0) { - args = [true]; - } - - var disabled = !args[0]; - - this.$element.prop('disabled', disabled); - }; - - Select2.prototype.data = function () { - if (this.options.get('debug') && - arguments.length > 0 && window.console && console.warn) { - console.warn( - 'Select2: Data can no longer be set using `select2("data")`. You ' + - 'should consider setting the value instead using `$element.val()`.' - ); - } - - var data = []; - - this.dataAdapter.current(function (currentData) { - data = currentData; - }); - - return data; - }; - - Select2.prototype.val = function (args) { - if (this.options.get('debug') && window.console && console.warn) { - console.warn( - 'Select2: The `select2("val")` method has been deprecated and will be' + - ' removed in later Select2 versions. Use $element.val() instead.' - ); - } - - if (args == null || args.length === 0) { - return this.$element.val(); - } - - var newVal = args[0]; - - if ($.isArray(newVal)) { - newVal = $.map(newVal, function (obj) { - return obj.toString(); - }); - } - - this.$element.val(newVal).trigger('change'); - }; - - Select2.prototype.destroy = function () { - this.$container.remove(); - - if (this.$element[0].detachEvent) { - this.$element[0].detachEvent('onpropertychange', this._sync); - } - - if (this._observer != null) { - this._observer.disconnect(); - this._observer = null; - } else if (this.$element[0].removeEventListener) { - this.$element[0] - .removeEventListener('DOMAttrModified', this._sync, false); - } - - this._sync = null; - - this.$element.off('.select2'); - this.$element.attr('tabindex', this.$element.data('old-tabindex')); - - this.$element.removeClass('select2-hidden-accessible'); - this.$element.attr('aria-hidden', 'false'); - this.$element.removeData('select2'); - - this.dataAdapter.destroy(); - this.selection.destroy(); - this.dropdown.destroy(); - this.results.destroy(); - - this.dataAdapter = null; - this.selection = null; - this.dropdown = null; - this.results = null; - }; - - Select2.prototype.render = function () { - var $container = $( - '' + - '' + - '' + - '' - ); - - $container.attr('dir', this.options.get('dir')); - - this.$container = $container; - - this.$container.addClass('select2-container--' + this.options.get('theme')); - - $container.data('element', this.$element); - - return $container; - }; - - return Select2; -}); - -S2.define('jquery.select2',[ - 'jquery', - 'require', - - './select2/core', - './select2/defaults' -], function ($, require, Select2, Defaults) { - // Force jQuery.mousewheel to be loaded if it hasn't already - require('jquery.mousewheel'); - - if ($.fn.select2 == null) { - // All methods that should return the element - var thisMethods = ['open', 'close', 'destroy']; - - $.fn.select2 = function (options) { - options = options || {}; - - if (typeof options === 'object') { - this.each(function () { - var instanceOptions = $.extend({}, options, true); - - var instance = new Select2($(this), instanceOptions); - }); - - return this; - } else if (typeof options === 'string') { - var instance = this.data('select2'); - - if (instance == null && window.console && console.error) { - console.error( - 'The select2(\'' + options + '\') method was called on an ' + - 'element that is not using Select2.' - ); - } - - var args = Array.prototype.slice.call(arguments, 1); - - var ret = instance[options](args); - - // Check if we should be returning `this` - if ($.inArray(options, thisMethods) > -1) { - return this; - } - - return ret; - } else { - throw new Error('Invalid arguments for Select2: ' + options); - } - }; - } - - if ($.fn.select2.defaults == null) { - $.fn.select2.defaults = Defaults; - } - - return Select2; -}); - -S2.define('jquery.mousewheel',[ - 'jquery' -], function ($) { - // Used to shim jQuery.mousewheel for non-full builds. - return $; -}); - - // Return the AMD loader configuration so it can be used outside of this file - return { - define: S2.define, - require: S2.require - }; -}()); - - // Autoload the jQuery bindings - // We know that all of the modules exist above this, so we're safe - var select2 = S2.require('jquery.select2'); - - // Hold the AMD module references on the jQuery function that was just loaded - // This allows Select2 to use the internal loader outside of this file, such - // as in the language files. - jQuery.fn.select2.amd = S2; - - // Return the Select2 instance for anyone who is importing it. - return select2; -})); diff --git a/wp-content/plugins/revisr/assets/lib/select2/js/select2.min.js b/wp-content/plugins/revisr/assets/lib/select2/js/select2.min.js deleted file mode 100644 index 49a988c7..00000000 --- a/wp-content/plugins/revisr/assets/lib/select2/js/select2.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){return n.apply(b,v.call(arguments,0).concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;hc;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
          ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
        • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),this.$results.append(d)},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";{a(h)}this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b){var c=this,d=b.id+"-results";this.$results.attr("id",d),b.on("results:all",function(a){c.clear(),c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("results:append",function(a){c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("query",function(a){c.showLoading(a)}),b.on("select",function(){b.isOpen()&&c.setClasses()}),b.on("unselect",function(){b.isOpen()&&c.setClasses()}),b.on("open",function(){c.$results.attr("aria-expanded","true"),c.$results.attr("aria-hidden","false"),c.setClasses(),c.ensureHighlightVisible()}),b.on("close",function(){c.$results.attr("aria-expanded","false"),c.$results.attr("aria-hidden","true"),c.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=c.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=c.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?c.trigger("close"):c.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a);if(0!==d){var e=d-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top,h=f.offset().top,i=c.$results.scrollTop()+(h-g);0===e?c.$results.scrollTop(0):0>h-g&&c.$results.scrollTop(i)}}),b.on("results:next",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a),e=d+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top+c.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=c.$results.scrollTop()+h-g;0===e?c.$results.scrollTop(0):h>g&&c.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){c.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=c.$results.scrollTop(),d=c.$results.get(0).scrollHeight-c.$results.scrollTop()+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&d<=c.$results.height();e?(c.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(c.$results.scrollTop(c.$results.get(0).scrollHeight-c.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var d=a(this),e=d.data("data");return"true"===d.attr("aria-selected")?void(c.options.get("multiple")?c.trigger("unselect",{originalEvent:b,data:e}):c.trigger("close")):void c.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var b=a(this).data("data");c.getHighlightedResults().removeClass("select2-results__option--highlighted"),c.trigger("results:focus",{data:b,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a){var b=this,d=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){b.trigger("focus",a)}),this.$selection.on("blur",function(a){b.trigger("blur",a)}),this.$selection.on("keydown",function(a){b.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){b.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){b.update(a.data)}),a.on("open",function(){b.$selection.attr("aria-expanded","true"),b.$selection.attr("aria-owns",d),b._attachCloseHandler(a)}),a.on("close",function(){b.$selection.attr("aria-expanded","false"),b.$selection.removeAttr("aria-activedescendant"),b.$selection.removeAttr("aria-owns"),b.$selection.focus(),b._detachCloseHandler(a)}),a.on("enable",function(){b.$selection.attr("tabindex",b._tabindex)}),a.on("disable",function(){b.$selection.attr("tabindex","-1")})},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},d.prototype.bind=function(a){var b=this;d.__super__.bind.apply(this,arguments);var c=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",c),this.$selection.attr("aria-labelledby",c),this.$selection.on("mousedown",function(a){1===a.which&&b.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(){}),this.$selection.on("blur",function(){}),a.on("selection:update",function(a){b.update(a.data)})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){return a("")},d.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.display(b),d=this.$selection.find(".select2-selection__rendered");d.empty().append(c),d.prop("title",b.title||b.text)},d}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
            '),a},d.prototype.bind=function(){var b=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){b.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(c){var d=a(this),e=d.parent(),f=e.data("data");b.trigger("unselect",{originalEvent:c,data:f})})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){var b=a('
          • ×
          • ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},a}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus()}),b.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.focus()}),b.on("enable",function(){e.$search.prop("disabled",!1)}),b.on("disable",function(){e.$search.prop("disabled",!0)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e.trigger("blur",a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}}),this.$selection.on("input",".select2-search--inline",function(){e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input",".select2-search--inline",function(a){e.handleSearch(a)})},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.trigger("open"),this.$search.val(b.text+" ")},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=(c.extend(!0,{},l,j),this.option(l));k.replaceWith(m)}else{var n=this.option(j);if(j.children){var o=this.convertToOptions(j.children);b.appendMany(n,o)}h.push(n)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(b,c){this.ajaxOptions=this._applyDefaults(c.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),a.__super__.constructor.call(this,b,c)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return{q:a.term}},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url(a)),"function"==typeof f.data&&(f.data=f.data(a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");if(void 0!==f&&(this.createTag=f),b.call(this,c,d),a.isArray(e))for(var g=0;g0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.position=function(){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},b.prototype.handleSearch=function(){if(!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},b.prototype.showSearch=function(){return!0},b}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
          • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(a,b,c){this.$dropdownParent=c.get("dropdownParent")||document.body,a.call(this,b,c)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c){var d=this,e="scroll.select2."+c.id,f="resize.select2."+c.id,g="orientationchange.select2."+c.id,h=this.$container.parents().filter(b.hasScroll);h.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),h.on(e,function(){var b=a(this).data("select2-scroll-position");a(this).scrollTop(b.y)}),a(window).on(e+" "+f+" "+g,function(){d._positionDropdown(),d._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c){var d="scroll.select2."+c.id,e="resize.select2."+c.id,f="orientationchange.select2."+c.id,g=this.$container.parents().filter(b.hasScroll);g.off(d),a(window).off(d+" "+e+" "+f)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=(this.$container.position(),this.$container.offset());f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom};c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){this.$dropdownContainer.width();var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.selectionAdapter=l.multiple?e:d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(this.options.dir=a.prop("dir")?a.prop("dir"):a.closest("[dir]").prop("dir")?a.closest("[dir]").prop("dir"):"ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("focus",function(){a.$container.addClass("select2-container--focus")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open"),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ENTER?(a.trigger("results:select"),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle"),b.preventDefault()):c===d.UP?(a.trigger("results:previous"),b.preventDefault()):c===d.DOWN?(a.trigger("results:next"),b.preventDefault()):(c===d.ESC||c===d.TAB)&&(a.close(),b.preventDefault()):(c===d.ENTER||c===d.SPACE||(c===d.DOWN||c===d.UP)&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable")):this.trigger("enable")},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||(this.trigger("query",{}),this.trigger("open"))},e.prototype.close=function(){this.isOpen()&&this.trigger("close")},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery.select2",["jquery","require","./select2/core","./select2/defaults"],function(a,b,c,d){if(b("jquery.mousewheel"),null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){{var d=a.extend({},b,!0);new c(a(this),d)}}),this;if("string"==typeof b){var d=this.data("select2");null==d&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2.");var f=Array.prototype.slice.call(arguments,1),g=d[b](f);return a.inArray(b,e)>-1?this:g}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),b.define("jquery.mousewheel",["jquery"],function(a){return a}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}); \ No newline at end of file diff --git a/wp-content/plugins/revisr/classes/class-revisr-activity-table.php b/wp-content/plugins/revisr/classes/class-revisr-activity-table.php deleted file mode 100644 index 2a0a6be8..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-activity-table.php +++ /dev/null @@ -1,418 +0,0 @@ - 'activity', - 'plural' => 'activity', - 'ajax' => true - ) ); - - add_screen_option( - 'per_page', - array( - 'default' => 15, - 'label' => __( 'Events per page', 'revisr' ), - 'option' => 'edit_revisr_events_per_page', - ) - ); - - set_screen_options(); - } - - /** - * Loads additional filters into the table. - * @access public - * @return string - */ - public function extra_tablenav( $which ) { - if ( 'top' === $which ) { - - $filter_event = isset( $_REQUEST['revisr_event'] ) ? $_REQUEST['revisr_event'] : 'all'; - $filter_user = isset( $_REQUEST['revisr_user'] ) ? $_REQUEST['revisr_user'] : 'all'; - $filter_time = isset( $_REQUEST['revisr_time'] ) ? $_REQUEST['revisr_time'] : 'all'; - - ?> - - - - - - - - - %s', get_admin_url() . 'admin.php?page=revisr', __( 'Reset', 'revisr' ) ); - } - - } - } - - /** - * Sets the screen options for the Revisr dashboard. - * @access public - * @param boolean $status This seems to be false - * @param string $option The name of the option - * @param int $value The number of events to display - * @return int|boolean - */ - public function set_screen_option( $status, $option, $value ) { - if ( 'edit_revisr_events_per_page' === $option ) { - return $value; - } - return $status; - } - - /** - * Renders the default data for a column. - * @access public - * @param array $item A singular item (one full row's worth of data) - * @param array $column_name The name/slug of the column to be processed - * @return string - */ - public function column_default( $item, $column_name ) { - switch( $column_name ) { - case 'message': - return wp_kses_post( ucfirst( $item[$column_name] ) ); - case 'time': - $current = strtotime( current_time( 'mysql' ) ); - $timestamp = strtotime( $item[$column_name] ); - return sprintf( __( '%s ago', 'revisr' ), human_time_diff( $timestamp, $current ) ); - case 'user': - $url = esc_url( add_query_arg( array( 'revisr_user' => urlencode( $item[$column_name] ) ), $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ); - return sprintf( '%s', $url, esc_html( $item[$column_name] ) ); - default: - return print_r( $item, true ); - } - } - - /** - * Returns an array of the column names. - * @access public - * @return array - */ - public function get_columns() { - $columns = array( - 'message' => __( 'Event', 'revisr' ), - 'user' => __( 'User', 'revisr' ), - 'time' => __( 'Time', 'revisr' ) - ); - return $columns; - } - - /** - * Returns an array of filters for the list table. - * @access public - * @return array - */ - public function get_filters() { - $filters = array(); - $filters['revisr_event'] = 'event'; - $filters['revisr_user'] = 'user'; - $filters['revisr_time'] = 'time'; - - return apply_filters( 'revisr_list_table_filters', $filters ); - } - - /** - * Returns an array of columns that are sortable. - * @access public - * @return array - */ - public function get_sortable_columns() { - $sortable_columns = array( - 'message' => array( 'message', false ), - 'user' => array( 'user', false ), - 'time' => array( 'time', false ) - ); - return $sortable_columns; - } - - /** - * Creates a where query based on our custom filters. - * @access public - */ - public function create_where() { - - $where = array(); - - foreach ( $this->get_filters() as $filter => $col ) { - - if ( isset( $_REQUEST[$filter] ) && $_REQUEST[$filter] != 'all' ) { - - if ( 'revisr_time' === $filter ) { - - $value = $_REQUEST[$filter]; - $time = ''; - - switch( $value ) { - case 'halfday': - $time = DAY_IN_SECONDS / 2; - break; - case 'day': - $time = DAY_IN_SECONDS; - break; - case 'week': - $time = DAY_IN_SECONDS * 7; - break; - case 'month': - $time = DAY_IN_SECONDS * 28; - break; - - } - - if ( $time !== '' ) { - $time = esc_sql( date( 'Y-m-d H:i:s', time() - $time ) ); - $where[] = "$col > '$time'"; - } - - } else { - $value = esc_sql( $_REQUEST[$filter] ); - $where[] = "$col = '$value'"; - } - - } - } - - // Build out the WHERE queries. - $where = empty( $where ) ? '' : 'WHERE ' . implode( ' AND ', $where ); - - // Return the WHERE queries. - return $where; - } - - /** - * Prepares the data for display. - * @access public - */ - public function prepare_items() { - global $wpdb; - $table = Revisr::get_table_name(); - - // Number of items per page. - $per_page = $this->get_items_per_page( 'edit_revisr_events_per_page', 15 ); - - // Set up the custom columns. - $columns = $this->get_columns(); - $hidden = array(); - $sortable = $this->get_sortable_columns(); - - // Builds the list of column headers. - $this->_column_headers = array( $columns, $hidden, $sortable ); - - // Run any custom filters. - $where = $this->create_where(); - - // Get the data to populate into the table. - $data = $wpdb->get_results( "SELECT message, time, user FROM $table $where", ARRAY_A ); - - // Handle sorting of the data. - function usort_reorder($a,$b){ - // Default to time for default sort. - $orderby = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : 'time'; - - // Default to descending for default sort order. - $order = isset( $_REQUEST['order'] ) ? $_REQUEST['order'] : 'desc'; - - // Determine the sort order and send to usort. - $result = strcmp( $a[$orderby], $b[$orderby] ); - return ( $order === 'asc' ) ? $result : -$result; - } - usort( $data, 'usort_reorder' ); - - // Pagination. - $current_page = $this->get_pagenum(); - $total_items = count($data); - $data = array_slice($data,(($current_page-1)*$per_page),$per_page); - - $this->items = $data; - $this->set_pagination_args( array( - 'total_items' => $total_items, - 'per_page' => $per_page, - 'total_pages' => ceil($total_items/$per_page), - 'orderby' => isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : 'time', - 'order' => isset( $_REQUEST['order'] ) ? $_REQUEST['order'] : 'desc' - ) ); - } - - /** - * Displays the table. - * @access public - */ - public function display() { - wp_nonce_field( 'revisr-list-nonce', 'revisr_list_nonce', false ); - - $filter_event = esc_attr( isset( $_REQUEST['revisr_event'] ) ? $_REQUEST['revisr_event'] : 'all' ); - $filter_user = esc_attr( isset( $_REQUEST['revisr_user'] ) ? $_REQUEST['revisr_user'] : 'all' ); - $filter_time = esc_attr( isset( $_REQUEST['revisr_time'] ) ? $_REQUEST['revisr_time'] : 'all' ); - - echo ''; - echo ''; - echo ''; - - echo ''; - echo ''; - - parent::display(); - } - - /** - * Renders the top or bottom tablenav. - * @access public - * @param string $which Which tablenav to display (top or bottom) - */ - public function display_tablenav( $which ) { - ?> -
            - -
            - bulk_actions(); ?> -
            - - extra_tablenav( $which ); - $this->pagination( $which ); - ?> - -
            - -
            - prepare_items(); - - extract( $this->_args ); - extract( $this->_pagination_args, EXTR_SKIP ); - - ob_start(); - if ( ! empty( $_REQUEST['no_placeholder'] ) ) { - $this->display_rows(); - } else { - $this->display_rows_or_placeholder(); - } - $rows = ob_get_clean(); - - ob_start(); - $this->print_column_headers(); - $headers = ob_get_clean(); - - ob_start(); - $this->pagination('top'); - $pagination_top = ob_get_clean(); - - ob_start(); - $this->pagination('bottom'); - $pagination_bottom = ob_get_clean(); - - $response = array( 'rows' => $rows ); - $response['pagination']['top'] = $pagination_top; - $response['pagination']['bottom'] = $pagination_bottom; - $response['column_headers'] = $headers; - - if ( isset( $total_items ) ) { - $response['total_items_i18n'] = sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ); - } - - if ( isset( $total_pages ) ) { - $response['total_pages'] = $total_pages; - $response['total_pages_i18n'] = number_format_i18n( $total_pages ); - } - - die( json_encode( $response ) ); - } - - /** - * The callback for the AJAX response. - * @access public - */ - public function ajax_callback() { - $this->load(); - $this->ajax_response(); - } - - /** - * Called when no activity is found. - * @access public - */ - public function no_items() { - _e( 'Your recent activity will show up here.', 'revisr' ); - } -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-admin-pages.php b/wp-content/plugins/revisr/classes/class-revisr-admin-pages.php deleted file mode 100644 index e6e77e84..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-admin-pages.php +++ /dev/null @@ -1,296 +0,0 @@ -page_hooks['menu'] = add_menu_page( __( 'Dashboard', 'revisr' ), __( 'Revisr', 'revisr' ), $cap, 'revisr', array( $this, 'include_page' ), $icon_svg ); - $this->page_hooks['dashboard'] = add_submenu_page( 'revisr', __( 'Revisr - Dashboard', 'revisr' ), __( 'Dashboard', 'revisr' ), $cap, 'revisr', array( $this, 'include_page' ) ); - $this->page_hooks['commits'] = add_submenu_page( 'revisr', __( 'Revisr - Commits', 'revisr' ), __( 'Commits', 'revisr' ), $cap, 'revisr_commits', array( $this, 'include_page' ) ); - $this->page_hooks['new_commit'] = add_submenu_page( NULL, __( 'Revisr - New Commit', 'revisr' ), __( 'New Commit', 'revisr' ), $cap, 'revisr_new_commit', array( $this, 'include_page' ) ); - $this->page_hooks['view_commit'] = add_submenu_page( NULL, __( 'Revisr - View Commit', 'revisr' ), __( 'View Commit', 'revisr' ), $cap, 'revisr_view_commit', array( $this, 'include_page' ) ); - $this->page_hooks['branches'] = add_submenu_page( 'revisr', __( 'Revisr - Branches', 'revisr' ), __( 'Branches', 'revisr' ), $cap, 'revisr_branches', array( $this, 'include_page' ) ); - $this->page_hooks['settings'] = add_submenu_page( 'revisr', __( 'Revisr - Settings', 'revisr' ), __( 'Settings', 'revisr' ), $cap, 'revisr_settings', array( $this, 'include_page' ) ); - $this->page_hooks['setup'] = add_submenu_page( NULL, __( 'Revisr - Setup', 'revisr' ), 'Revisr', $cap, 'revisr_setup', array( $this, 'include_page' ) ); - } else { - $this->page_hooks['setup'] = add_menu_page( __( 'Revisr Setup', 'revisr' ), __( 'Revisr', 'revisr' ), $cap, 'revisr_setup', array( $this, 'include_page' ), $icon_svg ); - $this->page_hooks['dashboard'] = add_submenu_page( null, __( 'Revisr - Dashboard', 'revisr' ), __( 'Dashboard', 'revisr' ), $cap, 'revisr', array( $this, 'include_page' ) ); - $this->page_hooks['branches'] = add_submenu_page( NULL, __( 'Revisr - Branches', 'revisr' ), __( 'Branches', 'revisr' ), $cap, 'revisr_branches', array( $this, 'include_page' ) ); - $this->page_hooks['settings'] = add_submenu_page( NULL, __( 'Revisr - Settings', 'revisr' ), __( 'Settings', 'revisr' ), $cap, 'revisr_settings', array( $this, 'include_page' ) ); - } - - } - - /** - * Registers and enqueues css and javascript files. - * @access public - * @param string $hook The page to enqueue the styles/scripts. - */ - public function scripts( $hook ) { - - // Start registering/enqueuing scripts if the hook is in our allowed pages. - if ( in_array( $hook, $this->page_hooks ) ) { - - // Registers all CSS and JS files used by Revisr. - wp_register_style( 'revisr_admin_css', REVISR_URL . 'assets/css/revisr-admin.css', array(), REVISR_VERSION ); - wp_register_style( 'revisr_octicons_css', REVISR_URL . 'assets/lib/octicons/octicons.css', array(), REVISR_VERSION ); - wp_register_style( 'revisr_select2_css', REVISR_URL . 'assets/lib/select2/css/select2.min.css', array(), REVISR_VERSION ); - wp_register_script( 'revisr_dashboard', REVISR_URL . 'assets/js/revisr-dashboard.js', 'jquery', REVISR_VERSION, true ); - wp_register_script( 'revisr_staging', REVISR_URL . 'assets/js/revisr-staging.js', 'jquery', REVISR_VERSION, false ); - wp_register_script( 'revisr_settings', REVISR_URL . 'assets/js/revisr-settings.js', 'jquery', REVISR_VERSION, true ); - wp_register_script( 'revisr_setup', REVISR_URL . 'assets/js/revisr-setup.js', 'jquery', REVISR_VERSION, true ); - wp_register_script( 'revisr_select2_js', REVISR_URL . 'assets/lib/select2/js/select2.min.js', 'jquery', REVISR_VERSION, true ); - - // Enqueues styles/scripts that should be loaded on all allowed pages. - wp_enqueue_style( 'revisr_admin_css' ); - wp_enqueue_style( 'thickbox' ); - wp_enqueue_style( 'revisr_select2_css' ); - wp_enqueue_style( 'revisr_octicons_css' ); - wp_enqueue_script( 'thickbox' ); - wp_enqueue_script( 'revisr_select2_js' ); - - // Switch through page-dependant styles/scripts. - switch( $hook ) { - - // The main dashboard page. - case 'toplevel_page_revisr': - case 'revisr': - wp_enqueue_script( 'revisr_dashboard' ); - wp_localize_script( 'revisr_dashboard', 'revisr_dashboard_vars', array( - 'ajax_nonce' => wp_create_nonce( 'revisr_dashboard_nonce' ), - 'login_prompt' => sprintf( __( 'Session Expired: Please click here to log in again.', 'revisr' ), wp_login_url( get_admin_url() . 'admin.php?page=revisr' ) ) - ) - ); - break; - - // The branches page. - case 'revisr_page_revisr_branches': - break; - - // The settings pages. - case 'revisr_page_revisr_settings': - wp_enqueue_script( 'revisr_settings' ); - break; - - // The setup page. - case 'toplevel_page_revisr_setup': - wp_enqueue_script( 'revisr_setup' ); - wp_localize_script( 'revisr_setup', 'revisr_setup_vars', array( - 'plugin_or_theme_placeholder' => __( 'Please select...', 'revisr' ) - ) - ); - break; - - // The "New Commit" screen and "View Commit" screen. - case 'admin_page_revisr_new_commit': - case 'admin_page_revisr_view_commit': - wp_enqueue_script( 'revisr_staging' ); - wp_localize_script( 'revisr_staging', 'staging_vars', array( - 'ajax_nonce' => wp_create_nonce( 'staging_nonce' ), - 'view_diff' => __( 'View Diff', 'revisr' ), - ) - ); - break; - - } - - } - - } - - /** - * Filters the display order of the menu pages. - * @access public - */ - public function submenu_order( $menu_ord ) { - global $submenu; - $arr = array(); - - if ( isset( $submenu['revisr'] ) && ! Revisr_Admin::is_doing_setup() ) { - $arr[] = $submenu['revisr'][0]; - $arr[] = $submenu['revisr'][1]; - $arr[] = $submenu['revisr'][2]; - $arr[] = $submenu['revisr'][3]; - $submenu['revisr'] = $arr; - } - return $menu_ord; - } - - /** - * Filters the parent_file for the new/view commit pages. - * @access public - * @param string $file - * @return string - */ - public function parent_file( $file ) { - global $plugin_page; - - if ( 'revisr_new_commit' === $plugin_page || 'revisr_view_commit' === $plugin_page ) { - $plugin_page = 'revisr_commits'; - } - - return $file; - } - - /** - * Includes custom page templates used in the backend. - * @access public - */ - public function include_page() { - - $page = filter_input( INPUT_GET, 'page' ); - - switch ( $page ) { - - case 'revisr_branches': - $file = 'branches.php'; - break; - - case 'revisr_commits': - $file = 'commits.php'; - break; - - case 'revisr_new_commit': - $file = 'new-commit.php'; - break; - - case 'revisr_view_commit': - $file = 'view-commit.php'; - break; - - case 'revisr_settings': - $file = 'settings.php'; - break; - - case 'revisr_setup': - $file = 'setup.php'; - break; - - case 'revisr': - default: - $file = 'dashboard.php'; - break; - - } - - require_once ( REVISR_PATH . "templates/pages/$file" ); - - } - - /** - * Includes a form template. - * @access public - */ - public function include_form() { - if ( isset( $_REQUEST['action'] ) && 'revisr_' === substr( $_REQUEST['action'], 0, 7 ) ) { - $file = REVISR_PATH . 'templates/partials/' . str_replace( '_', '-', substr( $_REQUEST['action'], 7 ) ) . '.php'; - if ( file_exists( $file ) ) { - include_once( $file ); - } - } - } - - /** - * Displays the number of files changed in the admin bar. - * @access public - */ - public function admin_bar( $wp_admin_bar ) { - - if ( revisr()->git->is_repo ) { - - $untracked = revisr()->git->count_untracked(); - - if ( $untracked != 0 ) { - $text = sprintf( _n( '%d Untracked File', '%d Untracked Files', $untracked, 'revisr' ), $untracked ); - $args = array( - 'id' => 'revisr', - 'title' => $text, - 'href' => get_admin_url() . 'admin.php?page=revisr_new_commit', - 'meta' => array( 'class' => 'revisr_commits' ), - ); - $wp_admin_bar->add_node( $args ); - } - - $wp_admin_bar->add_menu( array( - 'id' => 'revisr-new-commit', - 'title' => __( 'Commit', 'revisr' ), - 'parent' => 'new-content', - 'href' => get_admin_url() . 'admin.php?page=revisr_new_commit', - ) - ); - - } - - } - - /** - * Displays the "Sponsored by Site5" logo. - * @access public - */ - public function site5_notice() { - - $allowed_pages = array( - 'revisr', - 'revisr_branches', - 'revisr_commits', - 'revisr_settings', - 'revisr_new_commit', - 'revisr_view_commit' - ); - - if ( isset( $_GET['page'] ) && in_array( $_GET['page'], $allowed_pages ) ) { - $output = true; - } else { - $output = false; - } - - if ( $output === true ) { - ?> -
            - - -
            - ' . __( 'Settings', 'revisr' ) . ''; - array_unshift( $links, $settings_link ); - return $links; - } - -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-admin.php b/wp-content/plugins/revisr/classes/class-revisr-admin.php deleted file mode 100644 index 6933a75b..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-admin.php +++ /dev/null @@ -1,370 +0,0 @@ -Click here for more details, or try again.', 'revisr' ), $error_url ); - } - - set_transient( 'revisr_error', $message, 10 ); - - } else { - set_transient( 'revisr_alert', $message, 3 ); - } - } - - /** - * Returns the data for the AJAX buttons. - * @access public - */ - public function ajax_button_count() { - if ( $_REQUEST['data'] == 'unpulled' ) { - echo revisr()->git->count_unpulled(); - } else { - echo revisr()->git->count_unpushed(); - } - exit(); - } - - /** - * Deletes existing transients. - * @access public - */ - public static function clear_transients( $errors = true ) { - if ( true === $errors ) { - delete_transient( 'revisr_error' ); - delete_transient( 'revisr_error_details' ); - } else { - delete_transient( 'revisr_alert' ); - } - } - - /** - * Helper function for determining if we're in setup mode. - * @access public - * @return boolean - */ - public static function is_doing_setup() { - - if ( revisr()->git->is_repo ) { - return false; - } else { - if ( defined( 'REVISR_SKIP_SETUP' ) || get_transient( 'revisr_skip_setup' ) ) { - return false; - } - return true; - } - - } - - /** - * Escapes a shell arguement. - * @access public - * @param string $string The string to escape. - * @return string $string The escaped string. - */ - public static function escapeshellarg( $string ) { - $os = Revisr_Compatibility::get_os(); - if ( 'WIN' !== $os['code'] ) { - return escapeshellarg( $string ); - } else { - // Windows-friendly workaround. - return '"' . str_replace( "'", "'\\''", $string ) . '"'; - } - } - - /** - * Logs an event to the database. - * @access public - * @param string $message The message to show in the Recent Activity. - * @param string $event Will be used for filtering later. - * @param string $user An optional user to associate the record with. - */ - public static function log( $message, $event, $user = '' ) { - - global $wpdb; - - $time = current_time( 'mysql' ); - $table = Revisr::get_table_name(); - - if ( '' === $user ) { - $user = wp_get_current_user(); - $username = $user->user_login; - } else { - $username = $user; - } - - if ( ! $username || '' === $username ) { - $username = __( 'Revisr Bot', 'revisr' ); - } - - $wpdb->insert( - "$table", - array( - 'time' => $time, - 'message' => $message, - 'event' => $event, - 'user' => $username, - ), - array( - '%s', - '%s', - '%s', - '%s', - ) - ); - } - - /** - * Notifies the admin if notifications are enabled. - * @access private - * @param string $subject The subject line of the email. - * @param string $message The message for the email. - */ - public static function notify( $subject, $message ) { - $options = Revisr::get_options(); - $url = get_admin_url() . 'admin.php?page=revisr'; - - if ( isset( $options['notifications'] ) ) { - $email = $options['email']; - $message .= '

            '; - $message .= sprintf( __( 'Click here for more details.', 'revisr' ), $url ); - $headers = "Content-Type: text/html; charset=ISO-8859-1\r\n"; - wp_mail( $email, $subject, $message, $headers ); - } - } - - /** - * Renders an alert and removes the old data. - * @access public - * @param boolean $errors_only Whether or not to only display errors. - */ - public static function render_alert( $errors_only = false ) { - $alert = get_transient( 'revisr_alert' ); - $error = get_transient( 'revisr_error' ); - - if ( $error ) { - $alert = '
            ' . wpautop( $error ) . '
            '; - } else if ( $alert ) { - $alert = '
            ' . wpautop( $alert ) . '
            '; - } else { - if ( revisr()->git->count_untracked() == '0' ) { - $msg = sprintf( __( 'There are currently no untracked files on branch %s.', 'revisr' ), revisr()->git->branch ); - $alert = '

            ' . $msg . '

            '; - } else { - $link = get_admin_url() . 'admin.php?page=revisr_new_commit'; - $msg = sprintf( __( 'There are currently %d untracked files on branch %s. Commit your changes to save them.', 'revisr' ), revisr()->git->count_untracked(), revisr()->git->branch, $link ); - $alert = '

            ' . $msg . '

            '; - } - } - - if ( $errors_only && false !== $error ) { - echo $alert; - } else if ( ! $errors_only ) { - echo $alert; - } - - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { - exit(); - } - - } - - /** - * Updates user settings to be compatible with 1.8. - * @access public - */ - public function do_upgrade() { - global $wpdb; - - // For users upgrading from 1.7 and older. - if ( get_option( 'revisr_db_version' ) === '1.0' ) { - - // Check for the "auto_push" option and save it to the config. - if ( isset( revisr()->options['auto_push'] ) ) { - revisr()->git->set_config( 'revisr', 'auto-push', 'true' ); - } - - // Check for the "auto_pull" option and save it to the config. - if ( isset( revisr()->options['auto_pull'] ) ) { - revisr()->git->set_config( 'revisr', 'auto-pull', 'true' ); - } - - // Check for the "reset_db" option and save it to the config. - if ( isset( revisr()->options['reset_db'] ) ) { - revisr()->git->set_config( 'revisr', 'import-checkouts', 'true' ); - } - - // Check for the "mysql_path" option and save it to the config. - if ( isset( revisr()->options['mysql_path'] ) ) { - revisr()->git->set_config( 'revisr', 'mysql-path', revisr()->options['mysql_path'] ); - } - - // Configure the database tracking to use all tables, as this was how it behaved in 1.7. - revisr()->git->set_config( 'revisr', 'db_tracking', 'all_tables' ); - } - - // Upgrades from the "revisr_commits" custom post type to pure Git. - $table = Revisr::get_table_name(); - $commits = $wpdb->get_results( "SELECT * FROM $table WHERE event = 'commit'", ARRAY_A ); - - if ( is_array( $commits ) && ! empty( $commits ) ) { - - foreach ( $commits as $commit ) { - // Get the commit short hash from the message. - $msg_array = explode( '#', $commit['message'] ); - $commit_id = substr( $msg_array[1], 0, 7 ); - - // Prepare the new message. - $new_msg = sprintf( - __( 'Committed #%s to the local repository.', 'revisr' ), - get_admin_url() . 'admin.php?page=revisr_view_commit&commit=' . $commit_id, - $commit_id - ); - - // Update the existing message. - $query = $wpdb->prepare( - "UPDATE $table SET message = %s WHERE id = '%d'", - $new_msg, - $commit['id'] - ); - - $wpdb->query( $query ); - } - - } - - // Update the database schema using dbDelta. - Revisr::install(); - - } - - /** - * Helper function for writing to the wp-config.php file, - * taken from WP Super Cache. - * - * @access public - * @return boolean - */ - public static function replace_config_line( $old, $new, $file = '' ) { - - if ( $file === '' ) { - if ( file_exists( ABSPATH . 'wp-config.php') ) { - $file = ABSPATH . 'wp-config.php'; - } else { - $file = dirname(ABSPATH) . '/wp-config.php'; - } - } - - if ( @is_file( $file ) == false ) { - return false; - } - if (!is_writeable( $file ) ) { - return false; - } - - $found = false; - $lines = file($file); - foreach( (array)$lines as $line ) { - if ( preg_match("/$old/", $line)) { - $found = true; - break; - } - } - if ($found) { - $fd = fopen($file, 'w'); - foreach( (array)$lines as $line ) { - if ( !preg_match("/$old/", $line)) - fputs($fd, $line); - else { - fputs($fd, "$new // Added by Revisr\n"); - } - } - fclose($fd); - return true; - } - $fd = fopen($file, 'w'); - $done = false; - foreach( (array)$lines as $line ) { - if ( $done || !preg_match('/^(if\ \(\ \!\ )?define|\$|\?>/', $line) ) { - fputs($fd, $line); - } else { - fputs($fd, "$new // Added by Revisr\n"); - fputs($fd, $line); - $done = true; - } - } - fclose($fd); - return true; - - } - - /** - * Wrapper for wp_verify_nonce. - * - * @access public - */ - public static function verify_nonce( $nonce, $action ) { - - if ( ! wp_verify_nonce( $nonce, $action ) ) { - wp_die( __( 'Cheatin’ uh?', 'revisr' ) ); - } - - } - - /** - * Helper function for processing redirects. - * - * @access public - * @param string $url The URL to redirect to. - * @param bool $echo Set to true if the redirect should be done in Javascript. - */ - public static function redirect( $url = '', $echo = false ) { - - if ( '' === $url ) { - $url = get_admin_url() . 'admin.php?page=revisr'; - } - - if ( $echo || isset( $_REQUEST['echo_redirect'] ) ) { - _e( 'Processing...', 'revisr' ); - ?> - - 'branch', - 'plural' => 'branches' - ) ); - - add_screen_option( - 'per_page', - array( - 'default' => 10, - 'label' => __( 'Branches per page', 'revisr' ), - 'option' => 'edit_revisr_branches_per_page', - ) - ); - - set_screen_options(); - } - - /** - * Sets the screen options for the Revisr branches page. - * @access public - * @param boolean $status This seems to be false - * @param string $option The name of the option - * @param int $value The number of events to display - * @return int|boolean - */ - public function set_screen_option( $status, $option, $value ) { - if ( 'edit_revisr_branches_per_page' === $option ) { - return $value; - } - return $status; - } - - /** - * Returns an array of the column names. - * @access public - * @return array - */ - public function get_columns() { - $columns = array( - 'branch' => __( 'Branch', 'revisr' ), - 'updated' => __( 'Last Updated', 'revisr' ), - 'actions' => __( 'Actions', 'revisr' ), - ); - return $columns; - } - - /** - * Returns an array of columns that are sortable. - * @access public - * @return array - */ - public function get_sortable_columns() { - $sortable_columns = array( - 'branch' => array( 'branch', false ), - 'updated' => array( 'updated', false ) - ); - return $sortable_columns; - } - - /** - * Returns an array containing the branch information. - * @access public - * @return array - */ - public function get_data() { - - // Basic filter for viewing remote branches. - if ( isset( $_GET['branches'] ) && $_GET['branches'] === 'remote' ) { - // We may need to clear out the cache for the remote branches. - revisr()->git->run( 'remote', array( 'update', '--prune' ) ); - $remote = true; - } else { - $remote = false; - } - - // Get the branches. - $branches = revisr()->git->get_branches( $remote ); - $branches_array = array(); - - if ( is_array( $branches ) && ! empty( $branches ) ) { - - $count = 0; - - foreach ( $branches as $key => $value ) { - - $branch = substr( $value, 2 ); - $updated = revisr()->git->get_branch_last_updated( $branch ); - - if ( substr( $value, 0, 1 ) === '*' ) { - $current = true; - $branch_title = sprintf( '%s %s', $branch, __( '(current branch)', 'revisr' ) ); - } else { - $current = false; - $branch_title = $branch; - } - - $branches_array[$count]['branch'] = $branch_title; - $branches_array[$count]['updated'] = $updated; - $branches_array[$count]['actions'] = $this->get_actions( $branch, $remote, $current ); - - $count++; - - } - - } - - return $branches_array; - } - - /** - * Returns possible actions for a given branch. - * @access public - * @return string - */ - public function get_actions( $branch, $remote, $current ) { - - $admin_url = get_admin_url(); - $checkout_text = __( 'Checkout', 'revisr' ); - $merge_text = __( 'Merge', 'revisr' ); - $delete_text = __( 'Delete', 'revisr' ); - $checkout_title = __( 'Checkout Branch', 'revisr' ); - $merge_title = __( 'Merge Branch', 'revisr' ); - $delete_title = __( 'Delete Branch', 'revisr' ); - $checkout_url = wp_nonce_url( $admin_url . "admin-post.php?action=process_checkout&branch=" . $branch, 'process_checkout', 'revisr_checkout_nonce' ); - $merge_url = $admin_url . "admin-post.php?action=revisr_merge_branch_form&branch=" . $branch . "&TB_iframe=true&width=400&height=225"; - $delete_url = $admin_url . "admin-post.php?action=revisr_delete_branch_form&branch=" . $branch . "&TB_iframe=true&width=400&height=225"; - - if ( $current ) { - return sprintf( - '%s - %s - %s', - $checkout_text, - $merge_text, - $delete_text - ); - } - - if ( ! $remote ) { - - return sprintf( - '%s - %s - %s', - $checkout_url, - $checkout_text, - $merge_url, - $merge_title, - $merge_text, - $delete_url, - $delete_title, - $delete_text - ); - - } else { - $checkout_url = esc_url( $admin_url . 'admin-post.php?action=revisr_checkout_remote_form&branch=' . $branch . '&TB_iframe=true&width=400&height=225' ); - $merge_url = esc_url( $admin_url . 'admin-post.php?action=revisr_merge_branch_form&branch=' . $branch . '&TB_iframe=true&width=400&height=225' ); - $delete_url = esc_url( $admin_url . 'admin-post.php?action=revisr_delete_branch_form&branch=' . $branch . '&remote=true&TB_iframe=true&width=400&height=225' ); - - return sprintf( - '%s - %s - %s', - $checkout_url, - $checkout_title, - $checkout_text, - $merge_url, - $merge_title, - $merge_text, - $delete_url, - $delete_title, - $delete_text - ); - } - - } - - /** - * Renders the default data for a column. - * @access public - * @param array $item A singular item (one full row's worth of data) - * @param array $column_name The name/slug of the column to be processed - * @return string - */ - public function column_default( $item, $column_name ) { - return $item[$column_name]; - } - - /** - * Called when no branches are found. - * @access public - */ - public function no_items() { - _e( 'No branches found.', 'revisr' ); - } - - /** - * Prepares the data for display. - * @access public - */ - public function prepare_items() { - global $wpdb; - - // Number of items per page. - $per_page = $this->get_items_per_page( 'edit_revisr_branches_per_page', 10 ); - - // Set up the custom columns. - $columns = $this->get_columns(); - $hidden = array(); - $sortable = $this->get_sortable_columns(); - - // Builds the list of column headers. - $this->_column_headers = array( $columns, $hidden, $sortable ); - - // Get the data to populate into the table. - $data = $this->get_data(); - - // Handle sorting of the data. - function usort_reorder($a,$b){ - $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'branch'; //If no sort, default to time. - $order = ( ! empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'desc'; //If no order, default to desc - $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order - return ( $order==='asc' ) ? $result : -$result; //Send final sort direction to usort - } - usort( $data, 'usort_reorder' ); - - // Pagination. - $current_page = $this->get_pagenum(); - $total_items = count($data); - $data = array_slice($data,(($current_page-1)*$per_page),$per_page); - - $this->items = $data; - $this->set_pagination_args( array( - 'total_items' => $total_items, - 'per_page' => $per_page, - 'total_pages' => ceil($total_items/$per_page), - 'orderby' => ! empty( $_REQUEST['orderby'] ) && '' != $_REQUEST['orderby'] ? $_REQUEST['orderby'] : 'time', - 'order' => ! empty( $_REQUEST['order'] ) && '' != $_REQUEST['order'] ? $_REQUEST['order'] : 'desc' - ) ); - } - - /** - * Displays the table. - * @access public - */ - public function display() { - wp_nonce_field( 'revisr-branches-nonce', 'revisr_branches_nonce' ); - - echo ''; - echo ''; - - parent::display(); - } - - /** - * Extra table navigation. - * @access public - * @param string $which - * @return string - */ - public function extra_tablenav( $which ) { - if ( 'top' != $which && revisr()->git->has_remote() ) { - - if ( isset( $_GET['branches'] ) && $_GET['branches'] == 'remote' ) { - $url = esc_url( add_query_arg( array( 'branches' => 'local' ) ) ); - printf( '%s', $url, __( 'Local Branches', 'revisr' ) ); - - } else { - $url = esc_url( add_query_arg( array( 'branches' => 'remote' ) ) ); - printf( '%s', $url, __( 'Remote Branches', 'revisr' ) ); - } - - } - } - -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-commits-table.php b/wp-content/plugins/revisr/classes/class-revisr-commits-table.php deleted file mode 100644 index 783032fe..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-commits-table.php +++ /dev/null @@ -1,411 +0,0 @@ - 'commit', - 'plural' => 'commits' - ) ); - - add_screen_option( - 'per_page', - array( - 'default' => 20, - 'label' => __( 'Commits per page', 'revisr' ), - 'option' => 'edit_revisr_commits_per_page', - ) - ); - - set_screen_options(); - } - - /** - * Sets the screen options for the Revisr branches page. - * @access public - * @param boolean $status This seems to be false - * @param string $option The name of the option - * @param int $value The number of events to display - * @return int|boolean - */ - public function set_screen_option( $status, $option, $value ) { - if ( 'edit_revisr_commits_per_page' === $option ) { - return $value; - } - return $status; - } - - /** - * Returns an array of the column names. - * @access public - * @return array - */ - public function get_columns() { - - $columns = array( - 'hash' => __( 'ID', 'revisr' ), - 'title' => __( 'Commit', 'revisr' ), - 'author' => __( 'Author', 'revisr' ), - 'date' => __( 'Date', 'revisr' ) - ); - - return $columns; - - } - - /** - * Returns an array of columns that are sortable. - * @access public - * @return array - */ - public function get_sortable_columns() { - $sortable_columns = array( - 'title' => array( 'title', false ), - 'date' => array( 'date', false ) - ); - return $sortable_columns; - } - - /** - * Returns an array containing the branch information. - * @access public - * @return array - */ - public function get_data() { - - // Determine which branch to check, if any. - $branch = isset( $_GET['branch'] ) ? $_GET['branch'] : revisr()->git->branch; - if ( 'all' === $branch ) { - $branch = '--all'; - } - - // Build the search string if necessary.. - if ( isset( $_GET['s'] ) ) { - $search = '--grep=' . $_GET['s']; - } else { - $search = false; - } - - // Get the date to start from. - if ( isset( $_GET['revisr_time'] ) && $_GET['revisr_time'] != 'all' ) { - $now = time(); - switch ( $_GET['revisr_time'] ) { - case 'halfday': - $offset = DAY_IN_SECONDS / 2; - break; - case 'day': - $offset = DAY_IN_SECONDS; - break; - case 'week': - $offset = DAY_IN_SECONDS * 7; - break; - case 'month': - default: - $offset = DAY_IN_SECONDS * 28; - break; - } - $date = $now - $offset; - $date = '--since=' . $date; - } else { - $date = false; - } - - // Build the arguements to pass to Git. - $args = array( - 'log', - $branch, - '--pretty=format:%h|#|%s|#|%an|#|%at', - ); - - // Add in search field if needed. - if ( false !== $search ) { - $args[] = '-i'; // case-insensitve - $args[] = $search; - } - - // Add in date field if needed. - if ( false !== $date ) { - $args[] = $date; - } - - // Get the commits. - $commits = revisr()->git->run( '--no-pager', $args ); - - $commits_array = array(); - - // Iterate through and pull out the data. - if ( is_array( $commits ) && ! empty( $commits ) ) { - - foreach ( $commits as $key => $value ) { - // Get data from Git log. - $commit = explode( '|#|', $value ); - $commits_array[$key]['hash'] = $commit[0]; - $commits_array[$key]['title'] = $commit[1]; - $commits_array[$key]['author'] = $commit[2]; - $commits_array[$key]['date'] = $commit[3]; - } - - } - - // Return the array of commits. - return $commits_array; - } - - /** - * Renders the default data for a column. - * @access public - * @param array $item A singular item (one full row's worth of data) - * @param array $column_name The name/slug of the column to be processed - * @return string - */ - public function column_default( $item, $column_name ) { - - switch ( $column_name ) { - - case 'date': - $current = strtotime( current_time( 'mysql' ) ); - $timestamp = $item[$column_name]; - return sprintf( __( '%s ago', 'revisr' ), human_time_diff( $timestamp, $current ) ); - - default: - return $item[$column_name]; - - } - - } - - /** - * Renders the title/commit subject column. - * @access public - * @return string - */ - public function column_title( $item ) { - $view_url = get_admin_url() . 'admin.php?page=revisr_view_commit&commit=' . $item['hash']; - $revert_url = get_admin_url() . 'admin-post.php?action=revisr_revert_form&commit=' . $item['hash'] . '&TB_iframe=true&width=400&height=225'; - $title = '' . $item['title'] . ''; - $actions['view'] = '' . __( 'View', 'revisr' ) . ''; - $actions['revert'] = '' . __( 'Revert', 'revisr' ) . ''; - - return $title . $this->row_actions( $actions ); - } - - /** - * Called when no commits are found. - * @access public - */ - public function no_items() { - _e( 'No commits found.', 'revisr' ); - } - - /** - * Prepares the data for display. - * @access public - */ - public function prepare_items() { - global $wpdb; - - // Number of items per page. - $per_page = $this->get_items_per_page( 'edit_revisr_commits_per_page', 10 ); - - // Set up the custom columns. - $columns = $this->get_columns(); - $hidden = array(); - $sortable = $this->get_sortable_columns(); - - // Builds the list of column headers. - $this->_column_headers = array( $columns, $hidden, $sortable ); - - // Get the data to populate into the table. - $data = $this->get_data(); - - // Handle sorting of the data. - function usort_reorder( $a,$b ) { - // Sort by date, descending by default. - $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'date'; - $order = ( ! empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'desc'; - $result = strcmp($a[$orderby], $b[$orderby]); - return ( $order==='asc' ) ? $result : -$result; - } - usort( $data, 'usort_reorder' ); - - // Pagination. - $current_page = $this->get_pagenum(); - $total_items = count($data); - $data = array_slice($data,(($current_page-1)*$per_page),$per_page); - - $this->items = $data; - $this->set_pagination_args( array( - 'total_items' => $total_items, - 'per_page' => $per_page, - 'total_pages' => ceil($total_items/$per_page), - 'orderby' => ! empty( $_REQUEST['orderby'] ) && '' != $_REQUEST['orderby'] ? $_REQUEST['orderby'] : 'date', - 'order' => ! empty( $_REQUEST['order'] ) && '' != $_REQUEST['order'] ? $_REQUEST['order'] : 'desc' - ) ); - } - - /** - * Displays the table. - * @access public - */ - public function display() { - wp_nonce_field( 'revisr-commits-nonce', 'revisr_commits_nonce', false ); - - echo ''; - echo ''; - - parent::display(); - } - - /** - * Displays the "subsubsub" list. - * @access public - */ - public function render_views() { - $branches = revisr()->git->get_branches(); - $views = array(); - $base_url = get_admin_url() . 'admin.php?page=revisr_commits'; - - if ( is_array( $branches ) && ! empty( $branches ) ) { - foreach ( $branches as $branch ) { - - if ( substr( $branch, 0, 2) === '* ' ) { - - $branch = substr( $branch, 2 ); - $count = revisr()->git->run( 'rev-list', array( '--count', $branch ) ); - $count = is_array( $count ) ? absint( $count[0] ) : 0; - - if ( ! isset( $_GET['branch'] ) || $_GET['branch'] === $branch ) { - $views[$branch] = '' . $branch . ' (' . $count . ')'; - } else { - $views[$branch] = '' . $branch . ' (' . $count . ')'; - } - - } else { - - $branch = trim( $branch ); - $count = revisr()->git->run( 'rev-list', array( '--count', $branch ) ); - $count = is_array( $count ) ? absint( $count[0] ) : 0; - - if ( isset( $_GET['branch'] ) && $_GET['branch'] === $branch ) { - $views[$branch] = '' . $branch . ' (' . $count . ')'; - } elseif ( isset( $_GET['branch'] ) && 'all' === $branch ) { - $views[$branch] = '' . $branch . ''; - } else { - $views[$branch] = '' . $branch . ' (' . $count . ')'; - } - - } - - } - } - - // Start outputting the list. - echo '
              '; - foreach ( $views as $class => $view ) { - $views[$class] = "\t
            • $view"; - } - - // Render the "All" link. - $all_class = isset( $_GET['branch'] ) && 'all' === $_GET['branch'] ? 'current' : ''; - $all_count = revisr()->git->run( 'rev-list', array( '--count', '--all' ) ); - $all_count = is_array( $all_count ) ? absint( $all_count[0] ) : 0; - echo '
            • ' . __( 'All', 'revisr' ) . ' (' . $all_count . ') |
            • '; - - // Render the branches. - echo implode( " |\n", $views ) . "\n"; - echo '
            '; - } - - /** - * Displays the search box. - * @access public - */ - public function render_search() { - $value = isset( $_GET['s'] ) ? esc_attr( $_GET['s'] ) : ''; - - ?> - - -
            - - extra_tablenav( $which ); - $this->pagination( $which ); - ?> - -
            - -
            - - - - prefix ) . "\n"; - $return .= 'WP_DEBUG: ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n"; - $return .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n"; - - // Revisr Configuration - $return .= "\n" . '-- Revisr Configuration' . "\n\n"; - $return .= 'Plugin Version: ' . REVISR_VERSION . "\n"; - - if ( isset( revisr()->options['automatic_backups'] ) && 'none' !== revisr()->options['automatic_backups'] ) { - $backups = 'Enabled'; - } else { - $backups = 'Disabled'; - } - $return .= 'Automatic Backups: ' . $backups . "\n"; - - if ( revisr()->git->get_config( 'revisr', 'auto-push' ) === 'true' ) { - $auto_push = 'Enabled'; - } else { - $auto_push = 'Disabled'; - } - $return .= 'Auto-Push: ' . $auto_push . "\n"; - - if ( revisr()->git->get_config( 'revisr', 'auto-pull' ) === 'true' ) { - $auto_pull = 'Enabled'; - } else { - $auto_pull = 'Disabled'; - } - $return .= 'Auto-Pull: ' . $auto_pull . "\n"; - - if ( revisr()->git->get_config( 'revisr', 'import-checkouts' ) === 'true' ) { - $import_checkouts = 'Enabled'; - } else { - $import_checkouts = 'Disabled'; - } - $return .= 'Import checkouts: ' . $import_checkouts . "\n"; - - if ( revisr()->git->get_config( 'revisr', 'import-pulls' ) === 'true' ) { - $import_pulls = 'Enabled'; - } else { - $import_pulls = 'Disabled'; - } - $return .= 'Import pulls: ' . $import_pulls . "\n"; - $return .= 'Work Tree: ' . revisr()->git->get_work_tree() . "\n"; - $return .= 'Git Dir: ' . revisr()->git->get_git_dir() . "\n"; - - if ( revisr()->git->is_repo ) { - $detected = 'true'; - } else { - $detected = 'false'; - } - $return .= 'Repository Detected: ' . $detected . "\n"; - if ( 'true' === $detected ) { - $return .= 'Repository Writable: ' . Revisr_Compatibility::server_has_permissions( revisr()->git->get_git_dir() ) . "\n"; - } - - - // Server Configuration - $return .= "\n" . '-- Server Configuration' . "\n\n"; - $os = Revisr_Compatibility::get_os(); - $return .= 'Operating System: ' . $os['name'] . "\n"; - $return .= 'PHP Version: ' . PHP_VERSION . "\n"; - $return .= 'MySQL Version: ' . $wpdb->db_version() . "\n"; - $return .= 'Git Version: ' . revisr()->git->version() . "\n"; - - $return .= 'Git Install Path: ' . Revisr_Compatibility::guess_path( 'git' ) . "\n"; - $return .= 'MySQL Install Path: ' . Revisr_Compatibility::guess_path( 'mysql' ) . "\n"; - - $return .= 'Server Software: ' . $_SERVER['SERVER_SOFTWARE'] . "\n"; - $return .= 'Server User: ' . Revisr_Compatibility::get_user() . "\n"; - - // PHP configs... now we're getting to the important stuff - $return .= "\n" . '-- PHP Configuration' . "\n\n"; - $return .= 'Safe Mode: ' . ( ini_get( 'safe_mode' ) ? 'Enabled' : 'Disabled' . "\n" ); - - if ( function_exists( 'exec' ) ) { - $exec = 'Enabled'; - } else { - $exec = 'Disabled'; - } - - $return .= 'Exec Enabled: ' . $exec . "\n"; - $return .= 'Memory Limit: ' . ini_get( 'memory_limit' ) . "\n"; - $return .= 'Upload Max Size: ' . ini_get( 'upload_max_filesize' ) . "\n"; - $return .= 'Post Max Size: ' . ini_get( 'post_max_size' ) . "\n"; - $return .= 'Upload Max Filesize: ' . ini_get( 'upload_max_filesize' ) . "\n"; - $return .= 'Time Limit: ' . ini_get( 'max_execution_time' ) . "\n"; - $return .= 'Max Input Vars: ' . ini_get( 'max_input_vars' ) . "\n"; - $return .= 'Display Errors: ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n"; - - // WordPress active plugins - $return .= "\n" . '-- WordPress Active Plugins' . "\n\n"; - $plugins = get_plugins(); - $active_plugins = get_option( 'active_plugins', array() ); - foreach( $plugins as $plugin_path => $plugin ) { - if( !in_array( $plugin_path, $active_plugins ) ) - continue; - $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n"; - } - - // WordPress inactive plugins - $return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n"; - foreach( $plugins as $plugin_path => $plugin ) { - if( in_array( $plugin_path, $active_plugins ) ) - continue; - $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n"; - } - - if( is_multisite() ) { - // WordPress Multisite active plugins - $return .= "\n" . '-- Network Active Plugins' . "\n\n"; - $plugins = wp_get_active_network_plugins(); - $active_plugins = get_site_option( 'active_sitewide_plugins', array() ); - foreach( $plugins as $plugin_path ) { - $plugin_base = plugin_basename( $plugin_path ); - if( !array_key_exists( $plugin_base, $active_plugins ) ) - continue; - $plugin = get_plugin_data( $plugin_path ); - $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n"; - } - } - - $return .= "\n" . '### End System Info ###'; - return $return; - } - - /** - * Determines the current operating system. - * @access public - * @return array - */ - public static function get_os() { - $os = array(); - $uname = php_uname( 's' ); - $os['code'] = strtoupper( substr( $uname, 0, 3 ) ); - $os['name'] = $uname; - return $os; - } - - /** - * Gets the user running this PHP process. - * @access public - * @return string - */ - public static function get_user() { - if ( function_exists( 'exec' ) ) { - return exec( 'whoami' ); - } - return __( 'Unknown', 'revisr' ); - } - - /** - * Tries to guess the install path to the provided program. - * @access public - * @param string $program The program to check for. - * @return string - */ - public static function guess_path( $program ) { - $os = Revisr_Compatibility::get_os(); - $program = Revisr_Admin::escapeshellarg( $program ); - - if ( $os['code'] !== 'WIN' ) { - $path = exec( "which $program" ); - } else { - $path = exec( "where $program" ); - } - - if ( $path ) { - return $path; - } else { - return __( 'Not Found', 'revisr' ); - } - } - - /** - * Checks if the exec() function is enabled. - * @access public - * @return string - */ - public static function server_has_exec() { - if ( function_exists( 'exec' ) ) { - return 'true'; - } - return 'false'; - } - - /** - * Checks if Revisr has write permissions to the repository. - * @access public - * @param string $path The path to the repository. - * @return string - */ - public static function server_has_permissions( $path ) { - if ( ! is_writable( $path ) || ! is_writeable( $path . DIRECTORY_SEPARATOR . 'config' ) ) { - return 'false'; - } - return 'true'; - } -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-cron.php b/wp-content/plugins/revisr/classes/class-revisr-cron.php deleted file mode 100644 index 95aff936..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-cron.php +++ /dev/null @@ -1,101 +0,0 @@ - 604800, - 'display' => __( 'Weekly', 'revisr' ) - ); - return $schedules; - } - - /** - * The main "automatic backup" event. - * @access public - */ - public function run_automatic_backup() { - - revisr()->git = new Revisr_Git(); - revisr()->db = new Revisr_DB(); - $backup_type = revisr()->git->get_config( 'revisr', 'automatic-backups' ) ? revisr()->git->get_config( 'revisr', 'automatic-backups' ) : 'none'; - - // Make sure backups have been enabled for this environment. - if ( 'none' !== $backup_type ) { - - // Defaults. - $date = date("F j, Y"); - $files = revisr()->git->status() ? revisr()->git->status() : array(); - $commit_msg = sprintf( __( '%s backup - %s', 'revisr' ), ucfirst( $backup_type ), $date ); - - // Stage the files and commit. - revisr()->git->stage_files( $files ); - revisr()->git->commit( $commit_msg ); - - // Backup the DB. - revisr()->db->backup(); - - // Log result - TODO: improve error handling as necessary. - $log_msg = sprintf( __( 'The %s backup was successful.', 'revisr' ), $backup_type ); - Revisr_Admin::log( $log_msg, 'backup' ); - - } - - } - - /** - * Processes the "auto-pull" functionality. - * @access public - */ - public function run_autopull() { - - revisr()->git = new Revisr_Git(); - - // If auto-pull isn't enabled, we definitely don't want to do this. - if ( revisr()->git->get_config( 'revisr', 'auto-pull' ) !== 'true' ) { - wp_die( __( 'Cheatin’ uh?', 'revisr' ) ); - } - - // Verify the provided token matches the token stored locally. - $remote = new Revisr_Remote(); - $remote->check_token(); - - // If we're still running at this point, we've successfully authenticated. - revisr()->git->reset(); - revisr()->git->fetch(); - - // Grab the commits that need to be pulled. - $commits_since = revisr()->git->run( 'log', array( revisr()->git->branch . '..' . revisr()->git->remote . '/' . revisr()->git->branch, '--pretty=oneline' ) ); - - // Maybe backup the database. - if ( revisr()->git->get_config( 'revisr', 'import-pulls' ) === 'true' ) { - revisr()->db = new Revisr_DB(); - revisr()->db->backup(); - $undo_hash = revisr()->git->current_commit(); - revisr()->git->set_config( 'revisr', 'last-db-backup', $undo_hash ); - } - - // Pull the changes or return an error on failure. - revisr()->git->pull( $commits_since ); - - } -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-db-backup.php b/wp-content/plugins/revisr/classes/class-revisr-db-backup.php deleted file mode 100644 index 9dbc5244..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-db-backup.php +++ /dev/null @@ -1,133 +0,0 @@ -build_conn( $table ); - - // Grab the path to use for mysqldump. - $path = $this->get_path(); - - // Backup the table. - $current_dir = getcwd(); - chdir( $this->backup_dir ); - exec( "{$path}mysqldump $conn > revisr_$table.sql --skip-comments", $output, $return_code ); - chdir( $current_dir ); - - // Handle any errors - if ( 0 !== $return_code ) { - return false; - } - - // Add the table into version control. - $this->add_table( $table ); - - // Makes sure that the backup file exists and is not empty. - return $this->verify_backup( $table ); - - } - - /** - * Backs up a single database table using the WordPress database class. - * @access public - * @param string $table The database table to backup. - * @return boolean - */ - public function backup_table_wpdb( $table ) { - - $table = esc_sql( $table ); - - // Initialize the results, ultimately stored in the backup file. - $results = ''; - - // An empty array to store the queries for the table in later. - $queries = array(); - - // Grab the SQL needed to create the table. - $show_create = $this->wpdb->get_row( "SHOW CREATE TABLE `$table`" ); - $want = 'Create Table'; - - if ( $show_create ) { - - // Store the table schema in the backup file. - $results .= "DROP TABLE IF EXISTS `$table`;" . PHP_EOL; - $results .= $show_create->$want . ';' . PHP_EOL; - - // Grab the content of the database table. - foreach ( $this->wpdb->get_results( "SELECT * FROM `$table`" ) as $row ) { - - $vals = array(); - - foreach ( get_object_vars( $row ) as $i => $v ) { - $vals[] = sprintf( "'%s'", esc_sql( $v ) ); - } - - $queries[] = sprintf( "(%s)", implode( ',', $vals ) ); - } - - if ( ! empty( $queries ) ) { - // Implode the queries and generate the rest of the SQL file. - $results .= "LOCK TABLES `$table` WRITE;" . PHP_EOL; - $results .= "INSERT INTO `$table` VALUES " . implode( ', ', $queries ) . ';' . PHP_EOL; - $results .= 'UNLOCK TABLES;' . PHP_EOL; - } - - } - - // Store the contents of the SQL file. - file_put_contents( $this->backup_dir . "revisr_$table.sql", $results ); - $this->add_table( $table ); - - // Verify the backup was successful and return a boolean. - return $this->verify_backup( $table ); - } - - /** - * Processes the results and alerts the user as necessary. - * @access public - * @param array $args An array containing the results of the backup. - * @return boolean - */ - public function callback( $args ) { - - if ( in_array( false, $args ) ) { - $msg = __( 'Error backing up the database.', 'revisr' ); - Revisr_Admin::alert( $msg, true ); - Revisr_Admin::log( $msg, 'error' ); - } else { - $msg = __( 'Successfully backed up the database.', 'revisr' ); - Revisr_Admin::alert( $msg ); - Revisr_Admin::log( $msg, 'backup' ); - - // Fires after a successful database backup. - do_action( 'revisr_post_db_backup' ); - - return true; - } - - return false; - } - -} - diff --git a/wp-content/plugins/revisr/classes/class-revisr-db-import.php b/wp-content/plugins/revisr/classes/class-revisr-db-import.php deleted file mode 100644 index 1d915b60..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-db-import.php +++ /dev/null @@ -1,315 +0,0 @@ -build_conn(); - - // Grab the path to use for MySQL. - $path = $this->get_path(); - - // Grab the site url. - $live_url = site_url(); - - // Import the table. - $current_dir = getcwd(); - chdir( $this->backup_dir ); - exec( "{$path}mysql {$conn} < revisr_$table.sql", $output, $return_code ); - chdir( $current_dir ); - - // Handle any errors. - if ( 0 !== $return_code ) { - Revisr_Admin::log( implode( '
            ', $output ), 'error' ); - return false; - } - - // Run a search replace if necessary. - if ( $replace_url !== '' && $replace_url !== false ) { - $this->revisr_srdb( $table, $replace_url, $live_url ); - } - - // If we're still running at this point, everything worked. - return true; - } - - /** - * Imports a single database table using the WordPress database class. - * @access public - * @param string $table The table to import - * @return array An array of the results. - */ - public function import_table_wpdb( $table, $replace_url = '' ) { - - $live_url = site_url(); - $fh = fopen( "{$this->backup_dir}revisr_$table.sql", 'r' ); - $size = filesize( "{$this->backup_dir}revisr_$table.sql" ); - $status = array( - 'errors' => 0, - 'updates' => 0 - ); - - while( !feof( $fh ) ) { - $query = trim( stream_get_line( $fh, $size, ';' . PHP_EOL ) ); - if ( empty( $query ) ) { - $status['dropped_queries'][] = $query; - continue; - } - if ( $this->wpdb->query( $query ) === false ) { - $status['errors']++; - $status['bad_queries'][] = $query; - } else { - $status['updates']++; - $status['good_queries'][] = $query; - } - } - - fclose( $fh ); - - if ( '' !== $replace_url ) { - $this->revisr_srdb( $table, $replace_url, $live_url ); - } - - if ( 0 !== $status['errors'] ) { - return false; - } - return true; - } - - /** - * Processes the results and alerts the user as necessary. - * @access public - * @param array $args An array containing the results of the backup. - * @return boolean - */ - public function callback( $args ) { - - if ( in_array( false, $args ) ) { - - // There were one or more errors with the import. - $msg = __( 'Error importing the database.', 'revisr' ); - Revisr_Admin::log( $msg, 'error' ); - Revisr_Admin::alert( $msg, true ); - - } else { - - // Everything imported properly. - $get_hash = revisr()->git->run( 'config', array( 'revisr.last-db-backup' ) ); - $revert_link = ''; - - if ( is_array( $get_hash ) ) { - $undo_hash = $get_hash[0]; - $undo_url = get_admin_url() . 'admin-post.php?action=process_revert&revert_type=db&db_hash=' . $undo_hash; - $undo_nonced = wp_nonce_url( $undo_url, 'revisr_revert_nonce', 'revisr_revert_nonce' ); - $revert_link = '' . __( 'Undo', 'revisr') . ''; - revisr()->git->run( 'config', array( '--unset', 'revisr.last-db-backup' ) ); - } - - // Alert the user. - $msg = sprintf( __( 'Successfully imported the database. %s', 'revisr'), $revert_link ); - Revisr_Admin::log( $msg, 'import' ); - Revisr_Admin::alert( $msg ); - - // Fires after a successful database import. - do_action( 'revisr_post_db_import' ); - - return true; - } - - return false; - } - - /** - * Gets the columns in a table. - * @access public - * @param string $table The table to check. - * @return array - */ - public function get_columns( $table ) { - $primary_key = null; - $columns = array(); - $fields = $this->wpdb->get_results( 'DESCRIBE ' . $table ); - - if ( is_array( $fields ) ) { - foreach ( $fields as $column ) { - $columns[] = $column->Field; - if ( $column->Key == 'PRI' ) { - $primary_key = $column->Field; - } - } - } - - return array( $primary_key, $columns ); - } - - /** - * Adapated from interconnect/it's search/replace script. - * Modified to use WordPress wpdb functions instead of PHP's native mysql/pdo functions. - * - * @link https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ - * - * @access private - * @param string $table The table to run the replacement on. - * @param string $search The string to replace. - * @param string $replace The string to replace with. - * @return boolean - */ - private function revisr_srdb( $table, $search = '', $replace = '' ) { - - $table = esc_sql( $table ); - - // Get a list of columns in this table. - list( $primary_key, $columns ) = $this->get_columns( $table ); - - // Bail out early if there isn't a primary key. - if ( null === $primary_key ) { - return false; - } - - // Count the number of rows we have in the table if large we'll split into blocks, This is a mod from Simon Wheatley - $row_count = $this->wpdb->get_var( "SELECT COUNT(*) FROM $table" ); - if ( $row_count == 0 ) { - return true; - } - - $page_size = 50000; - $pages = ceil( $row_count / $page_size ); - - for( $page = 0; $page < $pages; $page++ ) { - - $current_row = 0; - $start = $page * $page_size; - $end = $page_size; - - // Grab the content of the table. - $data = $this->wpdb->get_results( "SELECT * FROM $table LIMIT $start, $end", ARRAY_A ); - - // Loop through the data. - foreach ( $data as $row ) { - $current_row++; - $update_sql = array(); - $where_sql = array(); - $upd = false; - - foreach( $columns as $column ) { - - $data_to_fix = $row[ $column ]; - - if ( $column == $primary_key ) { - $where_sql[] = $column . ' = "' . $this->mysql_escape_mimic( $data_to_fix ) . '"'; - continue; - } - - // Run a search replace on the data that'll respect the serialisation. - $edited_data = $this->recursive_unserialize_replace( $search, $replace, $data_to_fix ); - - // Something was changed - if ( $edited_data != $data_to_fix ) { - $update_sql[] = $column . ' = "' . $this->mysql_escape_mimic( $edited_data ) . '"'; - $upd = true; - } - - } - - if ( $upd && ! empty( $where_sql ) ) { - $sql = 'UPDATE ' . $table . ' SET ' . implode( ', ', $update_sql ) . ' WHERE ' . implode( ' AND ', array_filter( $where_sql ) ); - $result = $this->wpdb->query( $sql ); - if ( ! $result ) { - $error_msg = sprintf( __( 'Error updating the table: %s.', 'revisr' ), $table ); - } - } - - } - - } - - $this->wpdb->flush(); - if ( isset( $error_msg ) ) { - Revisr_Admin::log( $error_msg, 'error' ); - return false; - } - - } - - /** - * Adapated from interconnect/it's search/replace script. - * - * @link https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ - * - * Take a serialised array and unserialise it replacing elements as needed and - * unserialising any subordinate arrays and performing the replace on those too. - * - * @access private - * @param string $from String we're looking to replace. - * @param string $to What we want it to be replaced with. - * @param array $data Used to pass any subordinate arrays back to in. - * @param bool $serialised Does the array passed via $data need serialising. - * - * @return string|array The original array with all elements replaced as needed. - */ - private function recursive_unserialize_replace( $from = '', $to = '', $data = '', $serialised = false ) { - try { - - if ( is_string( $data ) && ( $unserialized = @unserialize( $data ) ) !== false ) { - $data = $this->recursive_unserialize_replace( $from, $to, $unserialized, true ); - } - - elseif ( is_array( $data ) ) { - $_tmp = array( ); - foreach ( $data as $key => $value ) { - $_tmp[ $key ] = $this->recursive_unserialize_replace( $from, $to, $value, false ); - } - - $data = $_tmp; - unset( $_tmp ); - } - - // Submitted by Tina Matter - elseif ( is_object( $data ) ) { - // $data_class = get_class( $data ); - $_tmp = $data; // new $data_class( ); - $props = get_object_vars( $data ); - foreach ( $props as $key => $value ) { - $_tmp->$key = $this->recursive_unserialize_replace( $from, $to, $value, false ); - } - - $data = $_tmp; - unset( $_tmp ); - } - - else { - if ( is_string( $data ) ) - $data = str_replace( $from, $to, $data ); - } - - if ( $serialised ) - return serialize( $data ); - - } catch( Exception $error ) { - Revisr_Admin::log( $error, 'error' ); - } - - return $data; - } - -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-db.php b/wp-content/plugins/revisr/classes/class-revisr-db.php deleted file mode 100644 index f5a6c8fc..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-db.php +++ /dev/null @@ -1,523 +0,0 @@ -wpdb = $wpdb; - - $upload_dir = wp_upload_dir(); - - $this->backup_dir = $upload_dir['basedir'] . '/revisr-backups/'; - - // Set up the "revisr_backups" directory if necessary. - $this->setup_env(); - - } - - /** - * Runs an action on all tracked database tables. - * - * @access private - * @param string $action The action to perform. - * @param array $tables The tables to run on (optional). - * @param string|array $args Any arguements to pass through (optional). - * @return boolean - */ - private function run( $action, $tables = array(), $args = '' ) { - - // An empty status array to update later. - $status = array(); - - // Whether we're using MySQL, WPDB, or maybe even something else. - $driver = $this->get_driver(); - - // Builds the name of the class to construct. - $class = 'Revisr_DB_' . $action; - - // Builds the name of the method to call. - $method = $action . '_table_' . $driver; - - // The tables we want to run the action on. - $tables = $tables ? $tables : $this->get_tracked_tables(); - - if ( is_callable( array( $class, $method ) ) ) { - - // Construct the class. - $class = new $class; - - /** - * Loop through the tracked tables, - * storing the results in the status array. - */ - foreach ( $tables as $table ) { - $status[$table] = $class->$method( $table, $args ); - } - - // Fire off the callback. - return $class->callback( $status ); - - } - - } - - /** - * Returns the database method being used. - * @access private - * @return string - */ - private function get_driver() { - return revisr()->git->get_config( 'revisr', 'db-driver' ) ? revisr()->git->get_config( 'revisr', 'db-driver' ) : 'mysql'; - } - - /** - * Returns the path to MySQL. - * @access protected - * @return string - */ - protected function get_path() { - return revisr()->git->get_config( 'revisr', 'mysql-path' ) ? revisr()->git->get_config( 'revisr', 'mysql-path' ) : ''; - } - - /** - * Returns an array of tables in the database. - * @access public - * @return array - */ - public function get_tables() { - $tables = $this->wpdb->get_col( 'SHOW TABLES' ); - return $tables; - } - - /** - * Returns an array containing the size of each database table. - * @access public - * @return array - */ - public function get_sizes() { - $sizes = array(); - $tables = $this->wpdb->get_results( 'SHOW TABLE STATUS', ARRAY_A ); - - if ( is_array( $tables ) ) { - - foreach ( $tables as $table ) { - $size = round( $table['Data_length'] / 1024 / 1024, 2 ); - $sizes[$table['Name']] = sprintf( __( '(%s MB)', 'revisr' ), $size ); - } - - } - - return $sizes; - } - - /** - * Returns a list of tables that are in the "revisr-backups" directory, - * but not in the database. Necessary for importing tables that could - * not be added to the tracked tables due to them not existing. - * @access public - * @return array - */ - public function get_tables_not_in_db() { - $backup_tables = array(); - $db_tables = $this->get_tables(); - - foreach ( scandir( $this->backup_dir ) as $file ) { - - if ( 'revisr_' !== substr( $file, 0, 7 ) ) { - continue; - } - - // Remove the prefix and extension. - $backup_tables[] = substr( substr( $file, 7 ), 0, -4 ); - } - - $new_tables = array_diff( $backup_tables, $db_tables ); - return $new_tables; - } - - /** - * Returns the array of tables that are to be tracked. - * @access public - * @return array - */ - public function get_tracked_tables() { - - // Get our saved tracking preferences from the .git/config. - $db_tracking = revisr()->git->get_config( 'revisr', 'db-tracking' ); - $stored_tables = revisr()->git->run( 'config', array( '--get-all', 'revisr.tracked-tables' ) ); - - // Determine which tables we want to track. - if ( 'all_tables' == $db_tracking ) { - $tracked_tables = $this->get_tables(); - } elseif ( 'custom' == $db_tracking && is_array( $stored_tables ) ) { - $tracked_tables = array_intersect( $stored_tables, $this->get_tables() ); - } elseif ( 'none' == $db_tracking) { - $tracked_tables = array(); - } else { - $tracked_tables = $this->get_tables(); - } - - // Return an array of tables we should track. - return $tracked_tables; - } - - /** - * Adds a table to version control. - * @access private - * @param string $table The table to add. - */ - protected function add_table( $table ) { - revisr()->git->run( 'add', array( $this->backup_dir . 'revisr_' . $table. '.sql' ) ); - } - - /** - * Builds the connection string to use with MySQL. - * @access protected - * @param string $table Optionally pass the table to use. - * @return string - */ - protected function build_conn( $table = '' ) { - - // Allow using the port or socket from the DB_HOST constant. - $port_or_socket = $this->check_port_or_socket( DB_HOST ); - $add_port = ''; - $add_socket = ''; - $db_host = DB_HOST; - - if ( false !== $port_or_socket ) { - - if ( null !== $port_or_socket['socket'] ) { - $socket = $port_or_socket['socket']; - $add_socket = " --socket=$socket"; - $temp = strlen( $socket ) * -1 - 1; - } else { - $port = $port_or_socket['port']; - $add_port = " --port=$port"; - $temp = strlen( $port ) * -1 - 1; - } - - $db_host = substr( DB_HOST, 0, $temp ); - - } - - // Maybe connect to a specific table. - if ( '' !== $table ) { - $table = ' ' . Revisr_Admin::escapeshellarg( $table ); - } - - // Workaround for compatibility between UNIX and Windows. - if ( '' !== DB_PASSWORD ) { - $conn = "-u " . Revisr_Admin::escapeshellarg( DB_USER ) . " -p" . Revisr_Admin::escapeshellarg( DB_PASSWORD ) . " " . DB_NAME . $table . " --host " . $db_host . $add_port . $add_socket; - } else { - $conn = "-u " . Revisr_Admin::escapeshellarg( DB_USER ) . " " . DB_NAME . $table . " --host " . $db_host . $add_port . $add_socket; - } - - // Return the connection string. - return $conn; - } - - /** - * Creates the backup folder and adds the .htaccess if necessary. - * @access private - */ - private function setup_env() { - // Check if the backups directory has already been created. - if ( is_dir( $this->backup_dir ) ) { - return true; - } else { - // Make the backups directory. - mkdir( $this->backup_dir ); - - // Add .htaccess to prevent direct access. - $htaccess_content = '' . - PHP_EOL . 'Order allow,deny' . - PHP_EOL . 'Deny from all' . - PHP_EOL . 'Satisfy All' . - PHP_EOL . ''; - file_put_contents( $this->backup_dir . '/.htaccess', $htaccess_content ); - - // Add index.php to prevent directory listing. - $index_content = 'backup_dir . '/index.php', $index_content ); - } - } - - /** - * Checks if a given DB_HOST parameter is using a port or socket. - * - * Adapated from WordPress core. - * - * @access public - * @param string $url The URL to check. - * @return array|boolean - */ - public function check_port_or_socket( $url ) { - - // Initialize the defaults. - $port = null; - $socket = null; - $host = $url; - $port_or_socket = strrchr( $host, ':' ); - - if ( ! empty( $port_or_socket ) ) { - - $port_or_socket = substr( $port_or_socket, 1); - - if ( 0 !== strpos( $port_or_socket, '/' ) ) { - - $port = intval( $port_or_socket ); - $maybe_socket = strstr( $port_or_socket, ':' ); - - if ( ! empty( $maybe_socket ) ) { - $socket = substr( $maybe_socket, 1 ); - } - } else { - $socket = $port_or_socket; - } - } - - if ( null === $port && null === $socket ) { - return false; - } - - return array( 'port' => $port, 'socket' => $socket ); - } - - /** - * Mimics the mysql_real_escape_string function. Adapted from a post by 'feedr' on php.net. - * @link http://php.net/manual/en/function.mysql-real-escape-string.php#101248 - * @access public - * @param string $input The string to escape. - */ - public function mysql_escape_mimic( $input ) { - - if ( is_array( $input ) ) { - return array_map( __METHOD__, $input ); - } - - if( ! empty( $input ) && is_string( $input ) ) { - return str_replace( array( '\\', "\0", "\n", "\r", "'", '"', "\x1a" ), array( '\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z' ), $input ); - } - - return $input; - } - - /** - * Callback for database backups (AJAX button and via New Commit) - * @access public - * @param string $commit_msg A commit message to pass to $this->commit_db() (optional) - * @param boolean $commit_db Whether or not to commit the DB immediately. - * @return boolean - */ - public function backup( $commit_msg = '', $commit_db = true ) { - - // Get the tables to backup. - $tables = $this->get_tracked_tables(); - if ( empty( $tables ) ) { - $tables = $this->get_tables(); - } - - // Run the backup. - if ( $this->run( 'backup', $tables ) ) { - - // Commit the backed up database tables if necessary. - if ( true === $commit_db ) { - $this->commit_db( $commit_msg ); - } - - return true; - } - - return false; - } - - /** - * Reverts all tracked tables to an earlier commit. - * @access public - * @param boolean $redirect Whether or not to redirect via PHP. - */ - public function restore( $redirect = true ) { - - // Make sure we really want to do this. - if ( ! wp_verify_nonce( $_REQUEST['revisr_revert_nonce'], 'revisr_revert_nonce' ) ) { - wp_die( __( 'Cheatin’ uh?', 'revisr' ) ); - } - - $commit = $_REQUEST['db_hash']; - - /** - * Backup the database and store the resulting commit hash - * in memory so we can use it to create the revert link later. - */ - $msg = sprintf( __( 'Database backup before revert to #%s.', 'revisr' ), $commit ); - $this->backup( $msg ); - $current_temp = revisr()->git->current_commit(); - - if ( $current_temp ) { - - /** - * If the backup was successful and we have the resulting commit hash, - * run a revert on the sql files for the tracked tables and import them. - */ - $tables = $this->get_tracked_tables(); - $checkout = array(); - - foreach ( $tables as $table ) { - $checkout[$table] = revisr()->git->run( 'checkout', array( $commit, "{$this->backup_dir}revisr_$table.sql" ) ); - } - - if ( ! in_array( 1, $checkout ) ) { - - $import = $this->import(); - - if ( $import ) { - - // Create a link to undo the revert if necessary. - $undo_nonce = wp_nonce_url( admin_url( "admin-post.php?action=process_revert&revert_type=db&db_hash=" . $current_temp ), 'revisr_revert_nonce', 'revisr_revert_nonce' ); - $undo_msg = sprintf( __( 'Successfully reverted the database to a previous commit. Undo', 'revisr' ), $undo_nonce ); - - // Store the undo link and alert the user. - Revisr_Admin::log( $undo_msg, 'revert' ); - Revisr_Admin::alert( $undo_msg ); - - } - - } else { - - // There was an error importing the database. - $msg = __( 'Error reverting one or more database tables.', 'revisr' ); - Revisr_Admin::log( $msg, 'error' ); - Revisr_Admin::alert( $msg, true ); - - } - - // Redirect if necessary. - if ( $redirect !== false ) { - wp_redirect( get_admin_url() . 'admin.php?page=revisr' ); - exit(); - } - - } else { - wp_die( __( 'Something went wrong. Check your settings and try again.', 'revisr' ) ); - } - - } - - /** - * Runs an import of all tracked tables, importing any new tables - * if tracking all_tables, or providing a link to import new tables - * if necessary. - * @access public - * @param array $tables The tables to import. - * @return boolean - */ - public function import( $tables = array() ) { - // The tables currently being tracked. - $tracked_tables = $this->get_tracked_tables(); - - // Tables that have import files but aren't in the database. - $new_tables = $this->get_tables_not_in_db(); - - // All tables. - $all_tables = array_unique( array_merge( $new_tables, $tracked_tables ) ); - - // The URL to replace during import. - $replace_url = revisr()->git->get_config( 'revisr', 'dev-url' ) ? revisr()->git->get_config( 'revisr', 'dev-url' ) : ''; - - if ( empty( $tables ) ) { - - if ( ! empty( $new_tables ) ) { - // If there are new tables that were imported. - if ( isset( revisr()->options['db_tracking'] ) && revisr()->options['db_tracking'] == 'all_tables' ) { - // If the user is tracking all tables, import all tables. - $import = $this->run( 'import', $all_tables, $replace_url ); - } else { - // Import only tracked tables, but provide a warning and import link. - $import = $this->run( 'import', $tracked_tables, $replace_url ); - $url = wp_nonce_url( get_admin_url() . 'admin-post.php?action=revisr_import_tables_form&TB_iframe=true&width=400&height=225', 'import_table_form', 'import_nonce' ); - $msg = sprintf( __( 'New database tables detected. Click here to view and import.', 'revisr' ), $url ); - Revisr_Admin::log( $msg, 'db' ); - } - } else { - // If there are no new tables, go ahead and import the tracked tables. - $import = $this->run( 'import', $tracked_tables, $replace_url ); - } - - } else { - // Import the provided tables. - $import = $this->run( 'import', $tables, $replace_url ); - } - - return $import; - } - - /** - * Commits the database to the repository and pushes if needed. - * @access public - * @param string $commit_msg A custom commit message. - */ - public function commit_db( $commit_msg = '' ) { - - if ( '' === $commit_msg ) { - $commit_msg = __( 'Backed up the database with Revisr.', 'revisr' ); - } - - // Allow for overriding default commit message through the "New Commit" screen. - if ( isset( $_REQUEST['post_title'] ) && $_REQUEST['post_title'] !== '' ) { - $commit_msg = $_REQUEST['post_title']; - } - - // Make the commit. - revisr()->git->commit( $commit_msg ); - - // Push changes if necessary. - revisr()->git->auto_push(); - } - - /** - * Verifies a backup for a table. - * @access public - * @param string $table The table to check. - * @return boolean - */ - public function verify_backup( $table ) { - if ( ! file_exists( "{$this->backup_dir}revisr_$table.sql" ) || filesize( "{$this->backup_dir}revisr_$table.sql" ) < 100 ) { - return false; - } - return true; - } - -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-git-callback.php b/wp-content/plugins/revisr/classes/class-revisr-git-callback.php deleted file mode 100644 index a92be8c2..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-git-callback.php +++ /dev/null @@ -1,369 +0,0 @@ -git->current_branch(); - $msg = sprintf( __( 'Checked out branch: %s.', 'revisr' ), $branch ); - $email_msg = sprintf( __( '%s was switched to branch %s.', 'revisr' ), get_bloginfo(), $branch ); - Revisr_Admin::alert( $msg ); - Revisr_Admin::log( $msg, 'branch' ); - Revisr_Admin::notify(get_bloginfo() . __( ' - Branch Changed', 'revisr'), $email_msg ); - } - - /** - * Callback for a failed checkout. - * @access public - */ - public function null_checkout( $output = array(), $args = '' ) { - $msg = __( 'There was an error checking out the branch. Check your configuration and try again.', 'revisr' ); - Revisr_Admin::alert( $msg, true, $output ); - Revisr_Admin::log( $msg, 'error' ); - } - - /** - * Callback for a successful commit. - * @access public - */ - public function success_commit( $output = array(), $args = '' ) { - - $commit_hash = revisr()->git->current_commit(); - $commit_msg = $_REQUEST['post_title']; - $view_link = get_admin_url() . 'admin.php?page=revisr_view_commit&commit=' . $commit_hash . '&success=true'; - - // Log the event. - $msg = sprintf( __( 'Committed #%s to the local repository.', 'revisr' ), $view_link, $commit_hash ); - Revisr_Admin::log( $msg, 'commit' ); - - // Notify the admin. - $email_msg = sprintf( __( 'A new commit was made to the repository:
            #%s - %s', 'revisr' ), $commit_hash, $commit_msg ); - Revisr_Admin::notify( get_bloginfo() . __( ' - New Commit', 'revisr' ), $email_msg ); - - // Add a tag if necessary. - if ( isset( $_REQUEST['tag_name'] ) ) { - revisr()->git->tag( $_POST['tag_name'] ); - } - - // Fires after the commit has been made. - do_action( 'revisr_post_commit', $output ); - - // Push if necessary. - revisr()->git->auto_push(); - - // View the commit. - Revisr_Admin::redirect( $view_link ); - } - - /** - * Callback for a failed commit. - * @access public - */ - public function null_commit( $output = array(), $args = '' ) { - - $msg = __( 'There was an error committing the changes to the local repository.', 'revisr' ); - $url = get_admin_url() . 'admin.php?page=revisr_new_commit&error=true'; - - Revisr_Admin::alert( $msg, true, $output ); - Revisr_Admin::log( $msg, 'error' ); - Revisr_Admin::redirect( $url ); - } - - /** - * Callback for successful branch deletion. - * @access public - */ - public function success_delete_branch( $output = array(), $args = '' ) { - $branch = $args; - $msg = sprintf( __( 'Deleted branch %s.', 'revisr' ), $branch ); - $url = get_admin_url() . 'admin.php?page=revisr_branches&status=delete_success&branch=' . $branch; - $email_msg = sprintf( __( 'The branch "%s" on the repository for %s was deleted.', 'revisr' ), $branch, get_bloginfo() ); - Revisr_Admin::log( $msg, 'branch' ); - Revisr_Admin::notify( get_bloginfo() . __( ' - Branch Deleted', 'revisr' ), $email_msg ); - Revisr_Admin::redirect( $url, true ); - } - - /** - * Callback for a failed branch deletion. - * @access public - */ - public function null_delete_branch( $output = array(), $args = '' ) { - $branch = $args; - $url = get_admin_url() . 'admin.php?page=revisr_branches&status=delete_fail&branch=' . $branch; - Revisr_Admin::redirect( $url, true ); - } - - /** - * Renders the number of unpushed/unpulled commits for the AJAX buttons. - * @access public - */ - public function success_count_ajax_btn( $output = array(), $args = '' ) { - - $count = count( $output ); - - if ( 0 != $count && revisr()->git->has_remote() ) { - echo "($count)"; - } - - exit(); - } - - /** - * Returns nothing if there are no commits to push/pull. - * @access public - */ - public function null_count_ajax_btn( $output = array(), $args = '' ) { - exit(); - } - - /** - * Called if the repo initialization was successful. - * Sets up the '.git/config' file for the first time. - * @access public - */ - public function success_init_repo( $output, $args ) { - - // Updates the repository properties. - revisr()->git->is_repo = true; - revisr()->git->git_dir = revisr()->git->get_git_dir(); - revisr()->git->work_tree = revisr()->git->get_work_tree(); - - // Clear out any errors. - Revisr_Admin::clear_transients(); - - // Grab the current user. - $user = wp_get_current_user(); - - // Set the default username to use in Git. - if ( isset( revisr()->git->options['username'] ) && revisr()->git->options['username'] != '' ) { - revisr()->git->set_config( 'user', 'name', revisr()->git->options['username'] ); - } else { - revisr()->git->set_config( 'user', 'name', $user->user_login ); - } - - // Set the default email to use in Git. - if ( isset( revisr()->git->options['email'] ) && revisr()->git->options['email'] != '' ) { - revisr()->git->set_config( 'user', 'email', revisr()->git->options['email'] ); - } else { - revisr()->git->set_config( 'user', 'email', $user->user_email ); - } - - // Set the default name of the remote. - if ( isset( revisr()->git->options['remote_name'] ) && revisr()->git->options['remote_name'] != '' ) { - $remote_name = revisr()->git->options['remote_name']; - } else { - $remote_name = 'origin'; - } - - // Add the remote URL in Git if already set in the database. - if ( isset( revisr()->git->options['remote_url'] ) && revisr()->git->options['remote_url'] != '' ) { - revisr()->git->run( 'remote', array( 'add', $remote_name, revisr()->git->options['remote_url'] ) ); - } - - // Adds an .htaccess file to the "/.git" directory to prevent public access. - if ( is_writable( revisr()->git->git_dir ) ) { - file_put_contents( revisr()->git->git_dir . DIRECTORY_SEPARATOR . '.htaccess', 'Deny from all' . PHP_EOL ); - } - - // Fires after the repo has been created. - do_action( 'revisr_post_init', $output ); - - // Alerts the user. - Revisr_Admin::log( __( 'Successfully created a new repository.', 'revisr' ), 'init' ); - - // Redirect if necessary (through skipped/legacy setup). - if ( ! defined( 'REVISR_SETUP_INIT' ) ) { - Revisr_Admin::redirect( get_admin_url() . 'admin.php?page=revisr_settings&init=success' ); - } - - // Return true if we haven't exited already. - return true; - } - - /** - * Returns if an initialization failed. - * @access public - */ - public function null_init_repo() { - - // Redirect if necessary (through skipped/legacy setup). - if ( ! defined( 'REVISR_SETUP_INIT' ) ) { - Revisr_Admin::log( __( 'Failed to initialize a new repository. Please make sure that Git is installed on the server and that Revisr has write permissons to the WordPress install.', 'revisr' ), 'error' ); - Revisr_Admin::redirect(); - } - - // Return false if we haven't exited already. - return false; - } - - /** - * Returns if a merge was successful. - * @access public - */ - public function success_merge( $output = array(), $args = '' ) { - $alert_msg = sprintf( __( 'Successfully merged changes from branch %s into branch %s.', 'revisr' ), $_REQUEST['branch'], revisr()->git->branch ); - $log_msg = sprintf( __( 'Merged branch %s into branch %s.', 'revisr' ), $_REQUEST['branch'], revisr()->git->branch ); - Revisr_Admin::alert( $alert_msg ); - Revisr_Admin::log( $log_msg, 'merge' ); - - // Fires after a successful merge. - do_action( 'revisr_post_merge', $output ); - - Revisr_Admin::redirect(); - } - - /** - * Returns if a merge failed. - * @access public - */ - public function null_merge( $output = array(), $args = '' ) { - $log_msg = sprintf( __( 'Error merging branch %s into %s.', 'revisr'), $_REQUEST['branch'], revisr()->git->branch ); - $alert_msg = sprintf( __( 'There was an error merging branch %s into your current branch. The merge was aborted to avoid conflicts.', 'revisr' ), $_REQUEST['branch'] ); - Revisr_Admin::alert( $alert_msg, true, $output ); - Revisr_Admin::log( $log_msg, 'error' ); - Revisr_Admin::redirect(); - } - - /** - * Returns if a pull was successful. - * @access public - */ - public function success_pull( $output = array(), $args = array() ) { - $commits_since = $args; - $num_commits = count( $commits_since ); - - if ( 0 === $num_commits ) { - $msg = __( 'The local repository is already up-to-date with the remote repository.', 'revisr' ); - Revisr_Admin::alert( $msg ); - } else { - - foreach ( $commits_since as $commit ) { - - $commit_hash = substr( $commit, 0, 7 ); - $view_link = get_admin_url() . 'admin.php?page=revisr_view_commit&commit=' . $commit_hash; - $msg = sprintf( __( 'Pulled #%s from %s/%s.', 'revisr' ), $view_link, $commit_hash, revisr()->git->remote, revisr()->git->branch ); - Revisr_Admin::log( $msg, 'pull' ); - - } - - $msg = sprintf( _n( 'Successfully pulled %s commit from %s/%s.', 'Successfully pulled %s commits from %s/%s.', $num_commits, 'revisr' ), $num_commits, revisr()->git->remote, revisr()->git->branch ); - Revisr_Admin::alert( $msg ); - - // Fires just after a successful pull. - do_action( 'revisr_post_pull', $output ); - - if ( revisr()->git->get_config( 'revisr', 'import-pulls' ) === 'true' ) { - revisr()->db->import(); - } - } - } - - /** - * Returns if a pull failed. - * @access public - * @return boolean - */ - public function null_pull( $output = array(), $args = '' ) { - $msg = __( 'There was an error pulling from the remote repository. The local repository could be ahead, or there may be an authentication issue.', 'revisr' ); - Revisr_Admin::alert( $msg, true, $output ); - Revisr_Admin::log( __( 'Error pulling changes from the remote repository.', 'revisr' ), 'error' ); - return false; - } - - /** - * Returns if a push was successful. - * @access public - */ - public function success_push( $output = array(), $args = '' ) { - $msg = sprintf( _n( 'Successfully pushed %s commit to %s/%s.', 'Successfully pushed %s commits to %s/%s.', $args, 'revisr' ), $args, revisr()->git->remote, revisr()->git->branch ); - Revisr_Admin::alert( $msg ); - Revisr_Admin::log( $msg, 'push' ); - - // Fires after a successful push. - do_action( 'revisr_post_push', $output ); - - if ( revisr()->git->get_config( 'revisr', 'webhook-url' ) !== false ) { - $remote = new Revisr_Remote(); - $remote->send_request(); - } - } - - /** - * Returns if a push failed. - * @access public - */ - public function null_push( $output = array(), $args = '' ) { - $msg = __( 'Error pushing to the remote repository. The remote repository could be ahead, or there may be an authentication issue.', 'revisr' ); - Revisr_Admin::alert( $msg, true, $output ); - Revisr_Admin::log( __( 'Error pushing changes to the remote repository.', 'revisr' ), 'error' ); - return; - } - - /** - * Returns "Success!" if the connection to remote was successful. - * @access public - */ - public function success_verify_remote( $output = array(), $args = '' ) { - _e( 'Success!', 'revisr' ); - exit(); - } - - /** - * Returns if the connection to the remote was unsuccessful. - * @access public - */ - public function null_verify_remote( $output = array(), $args = '' ) { - _e( 'Remote not found...', 'revisr' ); - exit(); - } - - /** - * Returns the Git version. - * @access public - */ - public function success_version( $output = array(), $args = '' ) { - return $output['0']; - } - - /** - * Returns if Revisr could not detect the Git version. - * @access public - */ - public function null_version( $output = array(), $args = '' ) { - return __( 'Unknown', 'revisr' ); - } -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-git.php b/wp-content/plugins/revisr/classes/class-revisr-git.php deleted file mode 100644 index a8e68759..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-git.php +++ /dev/null @@ -1,802 +0,0 @@ -is_repo = true; - $this->current_dir = getcwd(); - $this->git_path = $this->get_git_path(); - $this->git_dir = $this->get_git_dir(); - $this->work_tree = $this->get_work_tree(); - - // Make sure the provided Git directory is valid. - $this->check_work_tree(); - - // Load up information about the current repository. - if ( $this->is_repo ) { - $this->branch = $this->current_branch(); - $this->remote = $this->current_remote(); - $this->current_commit = $this->current_commit(); - } - - } - - /** - * Runs a Git command and fires the given callback. - * @access public - * @param string $command The command to use. - * @param array $args Arguements provided by user. - * @param string $callback The callback to use. - * @param string|array $info Additional info to pass to the callback - */ - public function run( $command, $args, $callback = '', $info = '' ) { - - // Setup the command for safe usage. - $safe_path = Revisr_Admin::escapeshellarg( $this->git_path ); - $safe_cmd = Revisr_Admin::escapeshellarg( $command ); - $safe_args = join( ' ', array_map( array( 'Revisr_Admin', 'escapeshellarg' ), $args ) ); - - // Allow for customizing the git work-tree and git-dir paths. - $git_dir = Revisr_Admin::escapeshellarg( "--git-dir=$this->git_dir" ); - $work_tree = Revisr_Admin::escapeshellarg( "--work-tree=$this->work_tree" ); - - // Run the command. - chdir( $this->work_tree ); - exec( "$safe_path $git_dir $work_tree $safe_cmd $safe_args 2>&1", $output, $return_code ); - chdir( $this->current_dir ); - - // Process the response. - $response = new Revisr_Git_Callback(); - $success_callback = 'success_' . $callback; - $failure_callback = 'null_' . $callback; - - // Return the callback. - if ( 0 !== $return_code ) { - return $response->$failure_callback( $output, $info ); - } else { - return $response->$success_callback( $output, $info ); - } - } - - /** - * Checks if the provided path is a Git repository. - * @access public - * @param string $dir The directory to check (optional). - * @return boolean - */ - public function check_work_tree( $dir = '' ) { - - // If no dir provided, use constant. - if ( '' === $dir ) { - $dir = $this->get_work_tree(); - } - - // Definitely bail if not a directory. - if ( ! is_dir( $dir ) ) { - return false; - } - - $this->work_tree = $dir; - - // Check with Git binary if repo is detected. - $git_toplevel = $this->run( 'rev-parse', array( '--show-toplevel' ) ); - - // If not, set the is_repo flag to false. - if ( ! $git_toplevel ) { - $this->is_repo = false; - return false; - } - - return true; - } - - /** - * Returns the path to the top-level Git directory. - * @access public - * @return string The path to the top-level Git directory. - */ - public function get_git_dir() { - - if ( defined( 'REVISR_GIT_DIR' ) && is_dir( REVISR_GIT_DIR ) ) { - - // Force removal of trailing slash upfront. - $git_dir = rtrim( REVISR_GIT_DIR, DIRECTORY_SEPARATOR ); - - if ( is_dir( REVISR_GIT_DIR . DIRECTORY_SEPARATOR . '.git' ) ) { - - // Workaround for backwards compatibility. - if ( ! defined( 'REVISR_WORK_TREE' ) ) { - - // Define the REVISR_WORK_TREE constant to match the old REVISR_GIT_DIR constant. - define( 'REVISR_WORK_TREE', REVISR_GIT_DIR ); - $line = "define('REVISR_WORK_TREE', '" . REVISR_GIT_DIR . "');"; - Revisr_Admin::replace_config_line( 'define *\( *\'REVISR_WORK_TREE\'', $line ); - - // Update the old REVISR_GIT_DIR constant. - $git_dir = REVISR_GIT_DIR . DIRECTORY_SEPARATOR . '.git'; - $line = "define('REVISR_GIT_DIR', '" . REVISR_GIT_DIR . DIRECTORY_SEPARATOR . ".git');"; - Revisr_Admin::replace_config_line( 'define *\( *\'REVISR_GIT_DIR\'', $line ); - - } - - } else { - $git_dir = REVISR_GIT_DIR; - } - - } else { - - // Best guess. - $git_dir = $this->get_work_tree() . DIRECTORY_SEPARATOR . '.git'; - - } - - return $git_dir; - } - - /** - * Returns the current path to Git. - * @access public - * @return string The path to the installation of Git. - */ - public function get_git_path() { - if ( defined( 'REVISR_GIT_PATH' ) && file_exists( REVISR_GIT_PATH ) ) { - return REVISR_GIT_PATH; - } else { - // This is surprisingly still the best option - // given the huge amount of possible install paths, - // and ~90% of the time this will work anyway. - return 'git'; - } - } - - /** - * Returns the path to the Git work-tree in exec() friendly format. - * @access public - * @return string - */ - public function get_work_tree() { - - if ( defined( 'REVISR_WORK_TREE' ) && is_dir( REVISR_WORK_TREE ) ) { - $work_tree = REVISR_WORK_TREE; - } else { - $work_tree = ABSPATH; - } - - // Remove trailing slash. - $work_tree = rtrim( $work_tree, DIRECTORY_SEPARATOR ); - return $work_tree; - } - - /** - * Pushes changes if "Automatically push new commits" is enabled. - * @access public - */ - public function auto_push() { - - // Allow for preventing auto-push on a per-commit basis. - if ( isset( $_REQUEST['autopush_enabled'] ) && ! isset( $_REQUEST['auto_push'] ) ) { - return; - } - - // Push the changes if needed. - if ( $this->get_config( 'revisr', 'auto-push' ) === 'true' || isset( $_REQUEST['auto_push'] ) ) { - $this->push(); - } - } - - /** - * Checks out an existing branch. - * @access public - * @param string $branch The branch to checkout. - */ - public function checkout( $branch, $new_branch = false ) { - if ( $new_branch ) { - $args = array( '-b', $branch, '-q' ); - } else { - $args = array( $branch, '-q' ); - } - - $this->run( 'checkout', $args, __FUNCTION__ ); - } - - /** - * Commits any staged files to the local repository. - * @access public - * @param string $message The message to use with the commit. - * @param string $callback The callback to run. - */ - public function commit( $message, $callback = '' ) { - if ( is_user_logged_in() ) { - $current_user = wp_get_current_user(); - $author = "$current_user->user_login <$current_user->user_email>"; - $commit = $this->run( 'commit', array( '-m', $message, '--author', $author ), $callback ); - } else { - $commit = $this->run( 'commit', array( '-m', $message ), $callback ); - } - - return $commit; - } - - /** - * Sets a value in the .git/config. - * @access public - * @param string $section The section to store/update the value for. - * @param string $key The key for the value which is being updated. - * @param string $value The value to set. - * @return boolean - */ - public function set_config( $section, $key, $value ) { - if ( ! $this->run( 'config', array( "$section.$key", $value ) ) ) { - return false; - } - return true; - } - - /** - * Gets a single value from the config. - * @access public - * @param string $section The section to check from. - * @param string $key The key who's value to grab. - * @return string|boolean - */ - public function get_config( $section, $key ) { - $result = $this->run( 'config', array( '--get', "$section.$key" ) ); - if ( is_array( $result ) ) { - return $result[0]; - } elseif ( is_string( $result ) ) { - return $result; - } else { - return false; - } - } - - /** - * Returns the number of unpulled commits. - * @access public - */ - public function count_unpulled( $ajax_btn = true ) { - $this->fetch(); - - if ( true === $ajax_btn ) { - $this->run( 'log', array( $this->branch . '..' . $this->remote . '/' . $this->branch, '--pretty=oneline' ), 'count_ajax_btn' ); - } else { - $unpulled = $this->run( 'log', array( $this->branch . '..' . $this->remote . '/' . $this->branch, '--pretty=oneline' ) ); - return count( $unpulled ); - } - - } - - /** - * Returns the number of unpushed commits. - * @access public - */ - public function count_unpushed( $ajax_btn = true ) { - - if ( true === $ajax_btn ) { - $this->run( 'log', array( $this->branch, '--not', '--remotes', '--oneline' ), 'count_ajax_btn' ); - } else { - $unpushed = $this->run( 'log', array( $this->branch, '--not', '--remotes', '--oneline' ) ); - return count( $unpushed ); - } - - } - - /** - * Returns the number of untracked/modified files. - * @access public - */ - public function count_untracked() { - $untracked = $this->run( 'status', array( '--short', '--untracked-files=all' ) ); - return count( $untracked ); - } - - /** - * Creates a new branch. - * @access public - * @param string $branch The name of the branch to create. - */ - public function create_branch( $branch ) { - $new_branch = $this->run( 'branch', array( $branch ) ); - return $new_branch; - } - - /** - * Returns the current branch. - * @access public - */ - public function current_branch() { - $current_branch = $this->run( 'rev-parse', array( '--abbrev-ref', 'HEAD' ) ); - if ( $current_branch != false && is_array( $current_branch ) ) { - return $current_branch[0]; - } - } - - /** - * Returns the hash of the current commit. - * @access public - */ - public function current_commit() { - $commit_hash = $this->run( 'rev-parse', array( '--short', 'HEAD' ) ); - if ( is_array( $commit_hash ) ) { - return $commit_hash[0]; - } - } - - /** - * Returns the name of the current remote. - * @access public - * @return string - */ - public function current_remote() { - $remote = $this->get_config( 'revisr', 'current-remote' ); - if ( ! $remote ) { - $remote = 'origin'; - } - return $remote; - } - - /** - * Deletes a local or remote branch. - * @access public - * @param string $branch The branch to delete. - * @param boolean $redirect Whether or not to redirect on completion. - * @param boolean $remote Whether $branch is a local or remote branch. - * @return mixed - */ - public function delete_branch( $branch, $redirect = true, $remote = false ) { - - $callback = ''; - - if ( $redirect ) { - $callback = __FUNCTION__; - } - - if ( $remote ) { - $deletion = $this->run( 'push', array( $this->remote, ":$branch" ), $callback, $branch ); - } else { - $deletion = $this->run( 'branch', array( '-D', $branch ), $callback, $branch ); - } - - return $deletion; - } - - /** - * Fetches changes without merging them. - * @access public - */ - public function fetch() { - $fetch = $this->run( 'fetch', array() ); - return $fetch; - } - - /** - * Returns available branches on the local or remote repository. - * @access public - * @param boolean $remote If set to true, will retrieve the remote branches. - */ - public function get_branches( $remote = false ) { - - $params = array(); - - if ( true === $remote ) { - $params[] = '-r'; - } - - return $this->run( 'branch', $params ); - } - - /** - * Returns the date of last update for a branch/ref. - * @access public - * @return string - */ - public function get_branch_last_updated( $branch, $format = '' ) { - $last_updated = $this->run( 'log', array( $branch, '-1', '--format=%cd', '--date=relative' ) ); - - if ( $last_updated ) { - return $last_updated[0]; - } else { - return __( 'Unknown', 'revisr' ); - } - - } - - /** - * Returns the author of a provided commit. - * @access public - * @param string $commit_hash The hash of the commit to get the author of. - * @return string|boolean - */ - public function get_commit_author_by_hash( $commit_hash ) { - - $author = $this->run( 'log', array( '-1', '--format=%an', $commit_hash ) ); - - if ( is_array( $author ) ) { - return $author[0]; - } - - return false; - - } - - /** - * Returns an array of details on the provided commit. - * @access public - * @param string $hash The SHA1 of the commit to check. - * @return array - */ - public static function get_commit_details( $hash ) { - - // Build an associative array of details. - $commit_details = array( - 'hash' => $hash, - 'branch' => '', - 'author' => '', - 'subject' => __( 'Commit not found', 'revisr' ), - 'time' => time(), - 'files_changed' => 0, - 'committed_files' => array(), - 'has_db_backup' => false, - 'tag' => '', - 'status' => false, - ); - - // Try to get some basic data about the commit. - $commit = revisr()->git->run( 'show', array( '--pretty=format:%s|#|%an|#|%at', '--name-status', '--root', '-r', $hash ) ); - - if ( is_array( $commit ) ) { - - $commit_meta = $commit[0]; - $commit_meta = explode( '|#|', $commit_meta ); - unset( $commit[0] ); - - $commit_details['subject'] = $commit_meta[0]; - $commit_details['author'] = $commit_meta[1]; - $commit_details['time'] = $commit_meta[2]; - - $commit = array_filter( $commit ); - $backed_up_tables = preg_grep( '/revisr.*sql/', $commit ); - - if ( 0 !== count( $backed_up_tables ) ) { - $commit_details['has_db_backup'] = true; - } - - $commit_details['files_changed'] = count( $commit ); - $commit_details['committed_files'] = $commit; - - $branches = revisr()->git->run( 'branch', array( '--contains', $hash ) ); - $commit_details['branch'] = is_array( $branches ) ? implode( ', ', $branches ) : __( 'Unknown', 'revisr' ); - $commit_details['status'] = __( 'Committed', 'revisr' ); - - } - - // Return the array. - return $commit_details; - - } - - /** - * Returns the status of a file. - * @access public - * @param string $status The status code returned via 'git status --short' - */ - public static function get_status( $status ) { - if ( strpos( $status, 'M' ) !== false ){ - $status = __( 'Modified', 'revisr' ); - } elseif ( strpos( $status, 'D' ) !== false ){ - $status = __( 'Deleted', 'revisr' ); - } elseif ( strpos( $status, 'A' ) !== false ){ - $status = __( 'Added', 'revisr' ); - } elseif ( strpos( $status, 'R' ) !== false ){ - $status = __( 'Renamed', 'revisr' ); - } elseif ( strpos( $status, 'U' ) !== false ){ - $status = __( 'Updated', 'revisr' ); - } elseif ( strpos( $status, 'C' ) !== false ){ - $status = __( 'Copied', 'revisr' ); - } elseif ( strpos( $status, '??' ) !== false ){ - $status = __( 'Untracked', 'revisr' ); - } else { - $status = false; - } - return $status; - } - - /** - * Checks if the repo has a remote. - * @access public - * @return boolean - */ - public function has_remote() { - if ( $this->get_config( 'remote', 'origin.url' ) ) { - return true; - } - return false; - } - - /** - * Initializes a new repository. - * @access public - */ - public function init_repo() { - $init = $this->run( 'init', array( '.' ), __FUNCTION__ ); - return $init; - } - - /** - * Checks if the provided branch is an existing branch. - * @access public - * @param string $branch The name of the branch to check. - * @return boolean - */ - public function is_branch( $branch ) { - $branches = $this->get_branches(); - if ( in_array( $branch, $branches ) || in_array( "* $branch", $branches ) || in_array( " $branch", $branches ) ) { - return true; - } else { - return false; - } - } - - /** - * Merges a branch into the current branch. - * @access public - * @param string $branch The branch to merge into the current branch. - */ - public function merge( $branch ) { - $this->reset(); - $merge = $this->run( 'merge', array( $branch, '--strategy-option', 'theirs' ), __FUNCTION__ ); - return $merge; - } - - /** - * Pulls changes from the remote repository. - * @access public - * @param array $commits The commits we're pulling (used in callback). - */ - public function pull( $commits = array() ) { - $this->reset(); - $pull = $this->run( 'pull', array( '-Xtheirs', '--quiet', $this->remote, $this->branch ), __FUNCTION__, $commits ); - return $pull; - } - - /** - * Pushes changes to the remote repository. - * @access public - */ - public function push() { - $push = $this->run( 'push', array( $this->remote, 'HEAD', '--quiet' ), __FUNCTION__, $this->count_unpushed( false ) ); - return $push; - } - - /** - * Resets the working directory. - * @access public - * @param string $mode The mode to use for the reset (hard, soft, etc.). - * @param string $path The path to apply the reset to. - * @param boolean $clean Whether to remove any untracked files. - * @return boolean - */ - public function reset( $mode = '--hard', $path = 'HEAD', $clean = false ) { - - if ( $this->run( 'reset', array( $mode, $path ) ) ) { - - if ( true === $clean ) { - - if ( ! $this->run( 'clean', array( '-f', '-d' ) ) ) { - return false; - } - - } - - return true; - } - - return false; - } - - /** - * Reverts the working directory to a specified commit. - * @access public - * @param string $commit The hash of the commit to revert to. - */ - public function revert( $commit ) { - $this->reset( '--hard', 'HEAD', true ); - $this->reset( '--hard', $commit ); - $this->reset( '--soft', 'HEAD@{1}' ); - } - - /** - * Stages the array of files passed through the New Commit screen. - * @access public - * @param array $staged_files An array of files to add/remove. - * @param boolean $stage_all If set to true, skip the loop and add -A. - * @return boolean - */ - public function stage_files( $staged_files, $stage_all = false ) { - - // An empty array for errors. - $errors = array(); - - if ( true === $stage_all ) { - - if ( $this->run( 'add', array( '-A' ) ) === false ) { - $errors[] = $staged_files; - } - - } else { - - foreach ( $staged_files as $result ) { - - $file = substr( $result, 3 ); - $status = self::get_status( substr( $result, 0, 2 ) ); - - if ( $status == __( 'Deleted', 'revisr' ) ) { - if ( $this->run( 'rm', array( $file ) ) === false ) { - $errors[] = $file; - } - } else { - if ( $this->run( 'add', array( $file ) ) === false ) { - $errors[] = $file; - } - } - } - - } - - if ( ! empty( $errors ) ) { - $msg = __( 'There was an error staging the files. Please check the settings and try again.', 'revisr' ); - Revisr_Admin::alert( $msg, true ); - Revisr_Admin::log( __( 'Error staging files.', 'revisr' ), 'error' ); - return false; - } - - return true; - } - - /** - * Returns the current status. - * @access public - * @param array $args Defaults to "--short". - */ - public function status( $args = array( '--short', '--untracked-files=all' ) ) { - $status = $this->run( 'status', $args ); - return $status; - } - - /** - * Adds a tag to the repository, or returns a list of tags if no parameters are passed. - * @access public - * @param string $tag The tag to add. - */ - public function tag( $tag = '' ) { - $tag = $this->run( 'tag', array( $tag ) ); - return $tag; - } - - /** - * Updates the .gitignore file, and removes files from version control, - * making sure to keep the physical copies of the files on the server. - * @access public - */ - public function update_gitignore() { - - // Store the content in the .gitignore. - file_put_contents( $this->work_tree . DIRECTORY_SEPARATOR . '.gitignore', revisr()->options['gitignore'] ); - - // Add the .gitignore. - $this->run( 'add', array( '.gitignore' ) ); - - // Convert the .gitignore into an array we can work with. - $files = explode( PHP_EOL, revisr()->options['gitignore'] ); - - foreach ( $files as $file ) { - if ( '' == $file || '!' === $file[0] ) { - // Don't do anything. - continue; - } else { - /** - * Remove the cached version of the file, - * leaving it intact in the working directory. - */ - $this->run( 'rm', array( '--cached', $file ) ); - } - } - - // Commit the updates. - $commit_msg = __( 'Updated .gitignore.', 'revisr' ); - $this->run( 'commit', array( '-m', $commit_msg ) ); - $this->auto_push(); - } - - /** - * Pings a remote repository to verify that it exists and is reachable. - * @access public - * @param string $remote The remote to ping. - */ - public function verify_remote( $remote = '' ) { - if ( $remote != '' ) { - $ping = $this->run( 'ls-remote', array( $remote, 'HEAD' ), __FUNCTION__ ); - } else { - $ping = $this->run( 'ls-remote', array( $_REQUEST['remote'], 'HEAD' ), __FUNCTION__ ); - } - return $ping; - } - - /** - * Returns the current version of Git. - * @access public - */ - public function version() { - $version = $this->run( 'version', array(), __FUNCTION__ ); - return $version; - } - -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-i18n.php b/wp-content/plugins/revisr/classes/class-revisr-i18n.php deleted file mode 100644 index 209f6b05..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-i18n.php +++ /dev/null @@ -1,49 +0,0 @@ -domain, - false, - dirname( dirname( plugin_basename( __FILE__ ) ) ) . 'languages/' - ); - } - - /** - * Set the domain equal to that of the specified domain. - * @access public - * @param string $domain The domain that represents the locale of this plugin. - */ - public function set_domain( $domain ) { - $this->domain = $domain; - } - -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-meta-boxes.php b/wp-content/plugins/revisr/classes/class-revisr-meta-boxes.php deleted file mode 100644 index 15fe0669..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-meta-boxes.php +++ /dev/null @@ -1,284 +0,0 @@ - 2, 'default' => 2 ) ); - } - - /** - * Initializes JS for the Revisr custom meta boxes. - * @access public - */ - public function init_meta_boxes() { - ?> - - git->status(); - $total_pending = count( $output ); - $text = sprintf( __( 'There are %s untracked files that can be added to this commit.', 'revisr' ), $total_pending, revisr()->git->branch ); - echo "
            " . $text . "

            "; - _e( 'Use the boxes below to select the files to include in this commit. Only files in the "Staged Files" section will be included.
            Double-click files marked as "Modified" to view the changes to the file.

            ', 'revisr' ); - if ( is_array( $output ) ) { - ?> - -
            -

            - -
            - -
            - -
            -
            -
            - - -
            -

            - -
            - -
            - -
            -
            - -
            '; - - // Files were included in this commit. - if ( 0 !== count( $commit['committed_files'] ) ) { - - printf( __('
            %s files were included in this commit. Double-click files marked as "Modified" to view the changes in a diff.', 'revisr' ), $commit['files_changed'] ); - - echo ''; - echo '

            '; - - } else { - printf( '

            %s

            ', __( 'No files were included in this commit.', 'revisr' ) ); - } - - echo '
            '; - - } - - /** - * Displays the "Add Tag" meta box on the sidebar. - * @access public - */ - public function add_tag_meta() { - printf( - ' - ', - __( 'Tag Name:', 'revisr' ) - ); - } - - /** - * Displays the "Save Commit" meta box in the sidebar. - * @access public - */ - public function save_commit_meta() { - ?> - -
            -
            - -
            - - -
            - -
            - - git->branch; ?> -
            - -
            - - -
            - -
            - git->get_config( 'revisr', 'auto-push' ) == 'true' ): ?> - - - - - - -
            - -
            -
            - -
            -
            -
            - - - -
            -
            -
            - - %s', 'revisr' ), date_i18n( $time_format, $commit['time'] ) ); - - if ( false === $commit['status'] ) { - $commit['status'] = __( 'Error', 'revisr' ); - $revert_btn = '' . __( 'Revert to this Commit', 'revisr' ) . ''; - } else { - $revert_btn = '' . __( 'Revert to this Commit', 'revisr' ) . ''; - } - - ?> -
            -
            - -
            - - -
            - -
            - - -
            - -
            - -
            - - -
            - - -
            - - -
            -
            - -
            -
            -
            - - -
            -
            -
            - -
            "; - } - -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-process.php b/wp-content/plugins/revisr/classes/class-revisr-process.php deleted file mode 100644 index 3b493081..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-process.php +++ /dev/null @@ -1,444 +0,0 @@ -git->is_repo ) { - return true; - } else { - $init_url = wp_nonce_url( get_admin_url() . 'admin-post.php?action=init_repo', 'init_repo', 'revisr_init_nonce' ); - $alert = sprintf( __( 'Thanks for installing Revisr! No Git repository was detected, click here to create one.', 'revisr' ), $init_url ); - Revisr_Admin::alert( $alert ); - } - return false; - } - - } - - /** - * Processes the request to checkout an existing branch. - * @access public - */ - public function checkout( $args = '', $new_branch = false ) { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_checkout_nonce'], 'process_checkout' ); - - if ( revisr()->git->get_config( 'revisr', 'import-checkouts' ) === 'true' ) { - revisr()->db->backup(); - } - - $branch = isset( $_REQUEST['branch'] ) ? $_REQUEST['branch'] : $args; - $new_branch = isset( $_REQUEST['new_branch'] ) ? $_REQUEST['new_branch'] : false; - - // Fires before the checkout. - do_action( 'revisr_pre_checkout', $branch ); - - revisr()->git->reset(); - revisr()->git->checkout( $branch, $new_branch ); - - if ( revisr()->git->get_config( 'revisr', 'import-checkouts' ) === 'true' && $new_branch === false ) { - revisr()->db->import(); - } - - Revisr_Admin::redirect(); - - } - - /** - * Processes a new commit from the "New Commit" admin page. - * @access public - */ - public function commit() { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_commit_nonce'], 'process_commit' ); - - $commit_msg = $_REQUEST['post_title']; - - // Backup the database if necessary. - if ( isset( $_POST['backup_db'] ) ) { - revisr()->db->backup( '', false ); - } - - // Add any staged files. - if ( isset( $_POST['staged_files'] ) ) { - $staged_files = $_POST['staged_files']; - $quick_stage = isset( $_POST['unstaged_files'] ) ? false : true; - revisr()->git->stage_files( $staged_files, $quick_stage ); - } - - // Make the commit. - revisr()->git->commit( $commit_msg, 'commit' ); - - } - - /** - * Processes the request to create a new branch. - * @access public - */ - public function create_branch() { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_create_branch_nonce'], 'process_create_branch' ); - - // Branches can't have spaces, so we replace them with hyphens. - $branch = str_replace( ' ', '-', $_REQUEST['branch_name'] ); - - // Create the branch. - $result = revisr()->git->create_branch( $branch ); - $url = get_admin_url() . 'admin.php?page=revisr_branches&branch=' . $branch; - - if ( $result !== false ) { - $msg = sprintf( __( 'Created new branch: %s', 'revisr' ), $branch ); - Revisr_Admin::log( $msg, 'branch' ); - - // Maybe checkout the new branch. - if ( isset( $_REQUEST['checkout_new_branch'] ) ) { - revisr()->git->checkout( $branch ); - } - - $url .= '&status=create_success'; - } else { - $url .= '&status=create_error'; - } - - Revisr_Admin::redirect( $url ); - - } - - /** - * Processes the request to delete an existing branch. - * @access public - */ - public function delete_branch() { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_delete_branch_nonce'], 'process_delete_branch' ); - - $branch = $_REQUEST['branch']; - - // Allows deleting just the remote branch. - if ( isset( $_REQUEST['delete_remote_only'] ) ){ - revisr()->git->delete_branch( $branch, true, true ); - exit(); - } - - // Delete local, and maybe remote branches. - if ( isset( $_REQUEST['branch'] ) && $_REQUEST['branch'] != revisr()->git->branch ) { - - revisr()->git->delete_branch( $branch, true ); - - if ( isset( $_REQUEST['delete_remote_branch'] ) ) { - revisr()->git->delete_branch( $branch, false, true ); - } - } - - exit(); - - } - - /** - * Processes the request to discard all untracked changes. - * @access public - */ - public function discard() { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_dashboard_nonce'], 'revisr_dashboard_nonce' ); - - // Fires prior to a discard. - do_action( 'revisr_pre_discard' ); - - if ( revisr()->git->reset( '--hard', 'HEAD', true ) ) { - - Revisr_Admin::log( __('Discarded all uncommitted changes.', 'revisr'), 'discard' ); - Revisr_Admin::alert( __('Successfully discarded any uncommitted changes.', 'revisr' ) ); - - // Fires after a successful discard. - do_action( 'revisr_post_discard' ); - - } - - exit(); - - } - - /** - * Processes a Git init. - * @access public - */ - public function init() { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_init_nonce'], 'init_repo' ); - - // Fires before a repo is created. - do_action( 'revisr_pre_init' ); - - revisr()->git->init_repo(); - - } - - /** - * Processes the import of additional (new) tables. - * @access public - */ - public function import() { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_import_nonce'], 'process_import' ); - - if ( isset( $_REQUEST['revisr_import_untracked'] ) && is_array( $_REQUEST['revisr_import_untracked'] ) ) { - revisr()->db->import( $_REQUEST['revisr_import_untracked'] ); - Revisr_Admin::redirect(); - } - - } - - /** - * Processes the request to merge a branch into the current branch. - * @access public - */ - public function merge() { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_merge_nonce'], 'process_merge' ); - - // Fires immediately before a merge. - do_action( 'revisr_pre_merge' ); - - revisr()->git->merge( $_REQUEST['branch'] ); - - if ( isset( $_REQUEST['import_db'] ) && $_REQUEST['import_db'] == 'on' ) { - revisr()->db->import(); - } - - } - - /** - * Processes the request to pull changes into the current branch. - * @access public - */ - public function pull() { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_dashboard_nonce'], 'revisr_dashboard_nonce' ); - - // Fetch the changes so we can compare them. - revisr()->git->reset(); - revisr()->git->fetch(); - - // Build an array of the commits we don't have locally. - $commits_since = revisr()->git->run( 'log', array( revisr()->git->branch . '..' . revisr()->git->remote . '/' . revisr()->git->branch, '--pretty=oneline' ) ); - - // Maybe backup database. - if ( revisr()->git->get_config( 'revisr', 'import-pulls' ) === 'true' ) { - revisr()->db->backup(); - $undo_hash = revisr()->git->current_commit(); - revisr()->git->set_config( 'revisr', 'last-db-backup', $undo_hash ); - } - - // Fires before the changes are pulled. - do_action( 'revisr_pre_pull', $commits_since ); - - // Pull the changes or return an error on failure. - revisr()->git->pull( $commits_since ); - } - - /** - * Processes the request to push changes to a remote repository. - * @access public - */ - public function push() { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_dashboard_nonce'], 'revisr_dashboard_nonce' ); - - // Fires before a push. - do_action( 'revisr_pre_push' ); - - revisr()->git->push(); - - } - - /** - * Processes a request to revert, routing to the necessary functions. - * @access public - * @param string $type What to revert - * @return null - */ - public function revert( $type = '' ) { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_revert_nonce'], 'revisr_revert_nonce' ); - - // Determine how to handle the request. - if ( isset( $_REQUEST['revert_type'] ) && $_REQUEST['revert_type'] !== '' ) { - $revert_type = $_REQUEST['revert_type']; - } else { - $revert_type = $type; - } - - // Fires before the revert. - do_action( 'revisr_pre_revert', $type ); - - // Run the action. - switch ( $revert_type ) { - case 'files': - $this->revert_files( false ); - break; - case 'db': - revisr()->db->restore( false ); - break; - case 'files_and_db': - $this->revert_files( false ); - revisr()->db->restore( false ); - break; - default: - } - - Revisr_Admin::redirect(); - - } - - /** - * Processes the request to revert to an earlier commit. - * @access public - */ - public function revert_files( $redirect = true ) { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_revert_nonce'], 'revisr_revert_nonce' ); - - $commit = $_REQUEST['commit_hash']; - $commit_msg = sprintf( __( 'Reverted to commit: #%s.', 'revisr' ), $commit ); - - revisr()->git->reset( '--hard', 'HEAD', true ); - revisr()->git->reset( '--hard', $commit ); - revisr()->git->reset( '--soft', 'HEAD@{1}' ); - revisr()->git->run( 'add', array( '-A' ) ); - revisr()->git->commit( $commit_msg ); - revisr()->git->auto_push(); - - $commit_url = get_admin_url() . 'admin.php?page=revisr_view_commit&commit=' . $commit; - - $msg = sprintf( __( 'Reverted to commit #%s.', 'revisr' ), $commit_url, $commit ); - $email_msg = sprintf( __( '%s was reverted to commit #%s', 'revisr' ), get_bloginfo(), $commit ); - Revisr_Admin::log( $msg, 'revert' ); - Revisr_Admin::notify( get_bloginfo() . __( ' - Commit Reverted', 'revisr' ), $email_msg ); - - if ( true === $redirect ) { - Revisr_Admin::redirect(); - } - - } - - /** - * Processes a diff request. - * @access public - */ - public function view_diff() { - - Revisr_Admin::verify_nonce( $_GET['security'], 'staging_nonce' ); - - if ( isset( $_REQUEST['commit'] ) ) { - $diff = revisr()->git->run( 'show', array( $_REQUEST['commit'], $_REQUEST['file'] ) ); - } else { - $diff = revisr()->git->run( 'diff', array( $_REQUEST['file'] ) ); - } - - if ( is_array( $diff ) ) { - - // Loop through the diff and echo the output. - foreach ( $diff as $line ) { - - if ( substr( $line, 0, 1 ) === '+' ) { - echo '' . htmlspecialchars( $line ) . '
            '; - } else if ( substr( $line, 0, 1 ) === '-' ) { - echo '' . htmlspecialchars( $line ) . '
            '; - } else { - echo htmlspecialchars( $line ) . '
            '; - } - - } - - } else { - _e( 'Oops! Revisr ran into an error rendering the diff.', 'revisr' ); - } - - // We may need to exit early if doing_ajax. - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { - exit(); - } - - } - - /** - * Processes a view error request. - * @access public - */ - public function view_error() { - - if ( $revisr_error = get_transient( 'revisr_error_details' ) ) { - echo implode( '
            ', $revisr_error ); - } else { - _e( 'Detailed error information not available.', 'revisr' ); - } - - } - - /** - * Processes a view status request. - * @access public - */ - public function view_status() { - - Revisr_Admin::verify_nonce( $_GET['revisr_status_nonce'], 'revisr_view_status' ); - - $status = revisr()->git->run( 'status', array() ); - - if ( is_array( $status ) ) { - echo '
            ';
            -			foreach ( $status as $line ) {
            -				echo $line . PHP_EOL;
            -			}
            -			echo '
            '; - } else { - _e( 'Error retrieving the status of the repository.', 'revisr' ); - } - - } - - /** - * Downloads the system info. - * @access public - */ - public function download_sysinfo() { - - Revisr_Admin::verify_nonce( $_REQUEST['revisr_info_nonce'], 'process_download_sysinfo' ); - - if ( ! current_user_can( Revisr::get_capability() ) ) { - return; - } - - nocache_headers(); - - header( 'Content-Type: text/plain' ); - header( 'Content-Disposition: attachment; filename="revisr-system-info.txt"' ); - - echo wp_strip_all_tags( $_POST['revisr-sysinfo'] ); - die(); - - } - -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-remote.php b/wp-content/plugins/revisr/classes/class-revisr-remote.php deleted file mode 100644 index 02056269..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-remote.php +++ /dev/null @@ -1,109 +0,0 @@ -git->get_config( 'revisr', 'token' ); - - if ( $check === false ) { - - // If there is no token, generate a new one and save it. - $token = wp_generate_password( 16, false, false ); - revisr()->git->set_config( 'revisr', 'token', $token ); - - // Make sure that the token saved correctly. - $new_token = revisr()->git->get_config( 'revisr', 'token' ); - if ( is_string( $new_token ) && hash_equals( $new_token, $token ) ) { - if ( $new_token !== false ) { - return $new_token; - } - } else { - return false; - } - - } else { - // Return the already saved token. - return $check; - } - } - - /** - * Verifies a token is valid. - * @access public - * @return boolean - */ - public function check_token( $token = '' ) { - - // Allow testing of this function. - if ( $token !== '' ) { - $token_to_check = $token; - } - - // This is set in the Webhook URL. - if ( isset( $_REQUEST['token'] ) && $_REQUEST['token'] !== '' ) { - $token_to_check = $_REQUEST['token']; - } - - // Compare the tokens and return true if a complete match. - if ( isset( $token_to_check ) ) { - $safe_token = revisr()->git->get_config( 'revisr', 'token' ); - if ( hash_equals( $safe_token, $token_to_check ) ) { - return true; - } - } - - // Die if not. - wp_die( __( 'Cheatin’ uh?', 'revisr' ) ); - } - - /** - * Sends a new HTTP request to the live site. - * @access public - */ - public function send_request() { - $body = array( - 'action' => 'revisr_update' - ); - $args = array( - 'method' => 'POST', - 'timeout' => '30', - 'redirection' => '5', - 'httpversion' => '1.0', - 'blocking' => true, - 'headers' => array(), - 'body' => $body - ); - - // Get the URL and send the request. - $get_url = revisr()->git->get_config( 'revisr', 'webhook-url' ); - - if ( $get_url !== false ) { - $webhook = urldecode( $get_url ); - $request = wp_remote_post( $webhook, $args ); - if ( is_wp_error( $request ) ) { - Revisr_Admin::log( __( 'Error contacting webhook URL.', 'revisr' ), 'error' ); - } else { - Revisr_Admin::log( __( 'Sent update request to the webhook.', 'revisr' ), 'push' ); - } - } - } - -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-repositories-table.php b/wp-content/plugins/revisr/classes/class-revisr-repositories-table.php deleted file mode 100644 index 1ce2e5f3..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-repositories-table.php +++ /dev/null @@ -1,211 +0,0 @@ - 'repository', - 'plural' => 'repositories' - ) ); - - add_screen_option( - 'per_page', - array( - 'default' => 10, - 'label' => __( 'Repositories per page', 'revisr' ), - 'option' => 'edit_revisr_repositories_per_page', - ) - ); - - set_screen_options(); - } - - /** - * Sets the screen options for the Revisr branches page. - * @access public - * @param boolean $status This seems to be false - * @param string $option The name of the option - * @param int $value The number of events to display - * @return int|boolean - */ - public function set_screen_option( $status, $option, $value ) { - if ( 'edit_revisr_repositories_per_page' === $option ) { - return $value; - } - return $status; - } - - /** - * Returns an array of the column names. - * @access public - * @return array - */ - public function get_columns() { - $columns = array( - 'name' => __( 'Name', 'revisr' ), - 'path' => __( 'Path', 'revisr' ), - 'actions' => __( 'Actions', 'revisr' ), - ); - return $columns; - } - - /** - * Returns an array of columns that are sortable. - * @access public - * @return array - */ - public function get_sortable_columns() { - $sortable_columns = array( - 'name' => array( 'name', false ) - ); - return $sortable_columns; - } - - /** - * Returns an array containing the branch information. - * @access public - * @return array - */ - public function get_data() { - - if ( file_exists( ABSPATH . 'revisr-config.php' ) ) { - $repos = require ABSPATH . 'revisr-config.php'; - } else { - $repos = array(); - } - - $repositories_array = array(); - - $c = 0; - foreach ( $repos as $name => $path ) { - $repositories_array[$c]['name'] = $name; - $repositories_array[$c]['path'] = $path; - $repositories_array[$c]['actions'] = $this->get_actions(); - $c++; - } - - return $repositories_array; - } - - /** - * Returns possible actions for a given branch. - * @access public - * @return string - */ - public function get_actions() { - $actions = sprintf( __( '', 'revisr' ) ); - return $actions; - } - - /** - * Renders the default data for a column. - * @access public - * @param array $item A singular item (one full row's worth of data) - * @param array $column_name The name/slug of the column to be processed - * @return string - */ - public function column_default( $item, $column_name ) { - return $item[$column_name]; - } - - /** - * Called when no branches are found. - * @access public - */ - public function no_items() { - _e( 'No repositories found.', 'revisr' ); - } - - /** - * Prepares the data for display. - * @access public - */ - public function prepare_items() { - global $wpdb; - - // Number of items per page. - $per_page = $this->get_items_per_page( 'edit_revisr_repositories_per_page', 10 ); - - // Set up the custom columns. - $columns = $this->get_columns(); - $hidden = array(); - $sortable = $this->get_sortable_columns(); - - // Builds the list of column headers. - $this->_column_headers = array( $columns, $hidden, $sortable ); - - // Get the data to populate into the table. - $data = $this->get_data(); - - // Handle sorting of the data. - function usort_reorder($a,$b){ - $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'name'; //If no sort, default to name. - $order = ( ! empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'desc'; //If no order, default to desc - $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order - return ( $order==='asc' ) ? $result : -$result; //Send final sort direction to usort - } - usort( $data, 'usort_reorder' ); - - // Pagination. - $current_page = $this->get_pagenum(); - $total_items = count($data); - $data = array_slice($data,(($current_page-1)*$per_page),$per_page); - - $this->items = $data; - $this->set_pagination_args( array( - 'total_items' => $total_items, - 'per_page' => $per_page, - 'total_pages' => ceil($total_items/$per_page), - 'orderby' => ! empty( $_REQUEST['orderby'] ) && '' != $_REQUEST['orderby'] ? $_REQUEST['orderby'] : 'time', - 'order' => ! empty( $_REQUEST['order'] ) && '' != $_REQUEST['order'] ? $_REQUEST['order'] : 'desc' - ) ); - } - - /** - * Displays the table. - * @access public - */ - public function display() { - wp_nonce_field( 'revisr-repositories-nonce', 'revisr_repositories_nonce' ); - - echo ''; - echo ''; - - parent::display(); - } - -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-settings-fields.php b/wp-content/plugins/revisr/classes/class-revisr-settings-fields.php deleted file mode 100644 index bda178cb..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-settings-fields.php +++ /dev/null @@ -1,570 +0,0 @@ -options[$option] ) && revisr()->options[$option] != '' ) { - return true; - } - } - return false; - } - - /** - * Displays the description for the "General Settings" tab. - * @access public - */ - public function revisr_general_settings_callback() { - _e( 'These settings configure the local repository, and may be required for Revisr to work correctly.', 'revisr' ); - } - - /** - * Displays the description for the "Remote Settings" tab. - * @access public - */ - public function revisr_remote_settings_callback() { - _e( 'These settings are optional, and only need to be configured if you plan to push your website to a remote repository like Bitbucket or Github.', 'revisr' ); - } - - /** - * Displays the description for the "Database Settings" tab. - * @access public - */ - public function revisr_database_settings_callback() { - _e( 'These settings configure how Revisr interacts with your database, if at all.', 'revisr' ); - } - /** - * Displays/updates the "Username" settings field. - * @access public - */ - public function username_callback() { - - // Update the .git/config if necessary. - if ( $this->is_updated( 'username' ) ) { - revisr()->git->set_config( 'user', 'name', revisr()->options['username'] ); - } - - $check_username = revisr()->git->get_config( 'user', 'name' ); - if ( $check_username ) { - $username = $check_username; - } else { - $username = ''; - } - - printf( - ' -

            %s

            ', - esc_attr( $username ), - __( 'The username to commit with in Git.', 'revisr' ) - ); - } - - /** - * Displays/updates the "Email" settings field. - * @access public - */ - public function email_callback() { - - // Update the .git/config if necessary. - if ( $this->is_updated( 'email' ) ) { - revisr()->git->set_config( 'user', 'email', revisr()->options['email'] ); - } - - $check_email = revisr()->git->get_config( 'user', 'email' ); - if ( $check_email ) { - $email = $check_email; - }else { - $email = ''; - } - - printf( - ' -

            %s

            ', - esc_attr( $email ), - __( 'The email address associated to your Git username. Also used for notifications (if enabled).', 'revisr' ) - ); - } - - /** - * Displays/updates the "Git Path" settings field. - * @access public - */ - public function git_path_callback() { - - $git_path = defined( 'REVISR_GIT_PATH' ) ? REVISR_GIT_PATH : ''; - - if ( isset( $_GET['settings-updated'] ) ) { - - $dir = revisr()->options['git_path']; - $line = "define('REVISR_GIT_PATH', '$dir');"; - Revisr_Admin::replace_config_line( 'define *\( *\'REVISR_GIT_PATH\'', $line ); - $git_path = revisr()->options['git_path']; - } - - printf( - ' -

            %s

            ', - esc_attr( $git_path ), - __( 'If necessary, you can define the installation path to Git here.', 'revisr' ) - ); - } - - /** - * Displays/updates the ".gitignore" settings field. - * @access public - */ - public function gitignore_callback() { - - // Update the .gitignore if necessary. - if ( isset( $_GET['settings-updated'] ) ) { - revisr()->git->update_gitignore(); - } - - // Grab the contents from the .gitignore. - if ( file_exists( revisr()->git->work_tree . '/.gitignore' ) ) { - $gitignore = file_get_contents( revisr()->git->work_tree . '/.gitignore' ); - } else { - $gitignore = ''; - } - - // Display the settings field. - printf( - ' -

            %s

            ', - esc_textarea( $gitignore ), - __( 'Add files or directories that you don\'t want to show up in Git here, one per line.
            This will update the ".gitignore" file for this repository.', 'revisr' ) - ); - } - - /** - * Displays/updates the "Automatic Backups" settings field. - * @access public - */ - public function automatic_backups_callback() { - if ( $this->is_updated( 'automatic_backups' ) ) { - - $schedule = revisr()->options['automatic_backups']; - - // Only do anything if the value has been changed. - if ( revisr()->git->get_config( 'revisr', 'automatic-backups' ) != $schedule ) { - - // Set the new value. - revisr()->git->set_config( 'revisr', 'automatic-backups', $schedule ); - - // Clear the existing cron. - wp_clear_scheduled_hook( 'revisr_cron' ); - - // Schedule the next one! - if ( 'none' != $schedule ) { - $next_time = time(); - wp_schedule_event( $next_time, revisr()->options['automatic_backups'], 'revisr_cron' ); - } - - } - - } else { - $schedule = revisr()->git->get_config( 'revisr', 'automatic-backups' ) ? revisr()->git->get_config( 'revisr', 'automatic-backups' ) : 'none'; - } - - ?> - - - - - options['notifications'] ) ? revisr()->options['notifications'] : 'off'; - revisr()->git->set_config( 'revisr', 'notifications', $notifications ); - } - - $notifications = revisr()->git->get_config( 'revisr', 'notifications' ); - - printf( - ' - ', - checked( $notifications, 'on', false ), - __( 'Enabling notifications will send updates about new commits, pulls, and pushes to the email address above.', 'revisr' ) - ); - } - - /** - * Displays/updates the "Uninstall on Delete" settings field. - * @access public - */ - public function uninstall_on_delete_callback() { - - if ( isset( $_GET['settings-updated'] ) ) { - $uninstall_on_delete = isset( revisr()->options['uninstall_on_delete'] ) ? 'on' : 'off'; - revisr()->git->set_config( 'revisr', 'uninstall-on-delete', $uninstall_on_delete ); - } - - $uninstall_on_delete = revisr()->git->get_config( 'revisr', 'uninstall-on-delete' ); - - printf( - ' - ', - checked( $uninstall_on_delete, 'on', false ), - __( 'Check to delete all settings and history stored in the database when this plugin is deleted. Settings in the .git/config will not be affected.', 'revisr' ) - ); - } - - /** - * Displays/updates the "Remote Name" settings field. - * @access public - */ - public function remote_name_callback() { - - // Default to orign as the remote name. - $remote = $this->is_updated( 'remote_name' ) ? revisr()->options['remote_name'] : 'origin'; - - // Set the current remote. - if ( isset( $_GET['settings-updated'] ) ) { - revisr()->git->set_config( 'revisr', 'current-remote', $remote ); - } - - $remote = revisr()->git->get_config( 'revisr', 'current-remote' ); - - printf( - ' -

            %s

            ', - isset( $remote ) ? esc_attr( $remote ) : '', - __( 'Git sets this to "origin" by default when you clone a repository, and this should be sufficient in most cases. If you\'ve changed the remote name or have more than one remote, you can specify that here.', 'revisr' ) - ); - - } - - /** - * Displays/updates the "Remote URL" settings field. - * @access public - */ - public function remote_url_callback() { - - if ( isset( $_GET['settings-updated'] ) ) { - - // Stores the Remote URL. - $remote = $this->is_updated( 'remote_name' ) ? revisr()->options['remote_name'] : 'origin'; - $add = revisr()->git->run( 'remote', array( 'add', $remote, revisr()->options['remote_url'] ) ); - - if ( false == $add ) { - revisr()->git->run( 'remote', array( 'set-url', $remote, revisr()->options['remote_url'] ) ); - } - - } - - $check_remote = revisr()->git->run( 'ls-remote', array( '--get-url' ) ); - - if ( false !== $check_remote && is_array( $check_remote ) ) { - $remote = $check_remote[0]; - } else { - $remote = ''; - } - - printf( - ' -

            %s

            ', - $remote, - __( 'Useful if you need to authenticate over "https://" instead of SSH, or if the remote has not already been set through Git.', 'revisr' ) - ); - } - - /** - * Displays/updates the "Revisr Webhook URL" settings field. - * @access public - */ - public function webhook_url_callback() { - // Allow the user to unset the Webhook URL. - if ( isset( $_GET['settings-updated'] ) ) { - if ( $this->is_updated( 'webhook_url' ) ) { - revisr()->git->set_config( 'revisr', 'webhook-url', revisr()->options['webhook_url'] ); - } else { - revisr()->git->run( 'config', array( '--unset', 'revisr.webhook-url' ) ); - } - } - - // Grab the URL from the .git/config as it MAY be replaced in the database. - $get_url = revisr()->git->get_config( 'revisr', 'webhook-url' ); - if ( $get_url ) { - $webhook_url = urldecode($get_url); - } else { - $webhook_url = ''; - } - printf( - '

            %s

            ', - $webhook_url, - __( 'If you have Revisr installed on another server using the same repository,
            you can add the Revisr Webhook from that server here to trigger an update when pushing.', 'revisr' ) - ); - } - - /** - * Displays/updates the "Auto Push" settings field. - * @access public - */ - public function auto_push_callback() { - if ( isset( $_GET['settings-updated'] ) ) { - if ( isset( revisr()->options['auto_push'] ) ) { - revisr()->git->set_config( 'revisr', 'auto-push', 'true' ); - } else { - revisr()->git->run( 'config', array( '--unset', 'revisr.auto-push' ) ); - } - } - - printf( - ' - ', - checked( revisr()->git->get_config( 'revisr', 'auto-push' ), 'true', false ), - __( 'Check to automatically push new commits to the remote repository.', 'revisr' ) - ); - } - - /** - * Displays/updates the "Auto Pull" settings field. - * @access public - */ - public function auto_pull_callback() { - if ( isset( $_GET['settings-updated'] ) ) { - if ( isset( revisr()->options['auto_pull'] ) ) { - revisr()->git->set_config( 'revisr', 'auto-pull', 'true' ); - } else { - revisr()->git->run( 'config', array( '--unset', 'revisr.auto-pull' ) ); - } - } - - printf( - ' - ', - checked( revisr()->git->get_config( 'revisr', 'auto-pull' ), 'true', false ), - __( 'Check to generate the Revisr Webhook and allow Revisr to automatically pull commits from a remote repository.', 'revisr' ) - ); - $remote = new Revisr_Remote(); - $token = $remote->get_token(); - - if ( $token ) { - $post_hook = get_admin_url() . 'admin-post.php?action=revisr_update&token=' . $remote->get_token(); - - ?> -
            -

            - -

            -
            - ' . __( 'There was an error generating the webhook. Please make sure that Revisr has write access to the ".git/config" and try again.', 'revisr' ) . '

            '; - } - - } - - /** - * Displays/updates the "DB Tracking" settings field. - * @access public - */ - public function tracked_tables_callback() { - if ( $this->is_updated( 'db_tracking' ) ) { - revisr()->git->set_config( 'revisr', 'db-tracking', revisr()->options['db_tracking'] ); - } - - if ( $db_tracking = revisr()->git->get_config( 'revisr', 'db-tracking' ) ) { - if ( $db_tracking == 'custom' && $this->is_updated( 'tracked_tables' ) ) { - revisr()->git->run( 'config', array( '--unset-all', 'revisr.tracked-tables' ) ); - $tables = revisr()->options['tracked_tables']; - foreach ( $tables as $table ) { - revisr()->git->run( 'config', array( '--add', 'revisr.tracked-tables', $table ) ); - } - } elseif ( $db_tracking != 'custom' ) { - revisr()->git->run( 'config', array( '--unset-all', 'revisr.tracked-tables' ) ); - } - } else { - $db_tracking = ''; - } - - ?> - - - get_tables(); - $sizes = $db->get_sizes(); - echo ''; - } - - /** - * Displays/updates the "Development URL" settings field. - * NOTE: DO NOT USE THE OPTION AS STORED IN THE DATABASE! - * @access public - */ - public function development_url_callback() { - // Allow the user to unset the dev URL. - if ( isset( $_GET['settings-updated'] ) ) { - if ( $this->is_updated( 'development_url' ) ) { - revisr()->git->set_config( 'revisr', 'dev-url', esc_url_raw( revisr()->options['development_url'] ) ); - } else { - revisr()->git->run( 'config', array( '--unset', 'revisr.dev-url' ) ); - } - } - - // Grab the URL from the .git/config as it will be replaced in the database. - $get_url = revisr()->git->get_config( 'revisr', 'dev-url' ); - if ( $get_url !== false ) { - $dev_url = $get_url; - } else { - $dev_url = ''; - } - - printf( - ' -

            %s

            ', - $dev_url, - __( 'If you\'re importing the database from a seperate environment, enter the WordPress Site URL for that environment here to replace all occurrences of that URL with the current Site URL during import. This MUST match the WordPress Site URL of the database being imported.', 'revisr' ) - ); - } - - /** - * Displays/updates the "DB Driver" settings field. - * @access public - */ - public function db_driver_callback() { - if ( $this->is_updated( 'db_driver' ) ) { - revisr()->git->set_config( 'revisr', 'db-driver', revisr()->options['db_driver'] ); - } - - $current = revisr()->git->get_config( 'revisr', 'db-driver' ); - - ?> - -

            - - is_updated( 'mysql_path' ) ) { - - // Properly escape trailing backslashes on Windows. - if ( substr( revisr()->options['mysql_path'], -1 ) === '\\' ) { - revisr()->options['mysql_path'] .= '\\'; - } - - revisr()->git->set_config( 'revisr', 'mysql-path', revisr()->options['mysql_path'] ); - - } else { - revisr()->git->run( 'config', array( '--unset', 'revisr.mysql-path' ) ); - } - } - - if ( $get_path = revisr()->git->get_config( 'revisr', 'mysql-path' ) ) { - $mysql_path = $get_path; - } else { - $mysql_path = ''; - } - - printf( - ' -

            %s

            ', - esc_attr( $mysql_path ), - __( 'Leave blank if the full path to MySQL has already been set on the server. Some possible settings include: -

            For MAMP: /Applications/MAMP/Library/bin/
            - For WAMP: C:\wamp\bin\mysql\mysql5.6.12\bin\ ', 'revisr' ) - ); - } - - /** - * Displays/updates the "Reset DB" settings field. - * @access public - */ - public function reset_db_callback() { - - if ( isset( $_GET['settings-updated'] ) ) { - - if ( isset( revisr()->options['reset_db'] ) ) { - revisr()->git->set_config( 'revisr', 'import-checkouts', 'true' ); - } else { - revisr()->git->run( 'config', array( '--unset-all', 'revisr.import-checkouts' ) ); - } - - if ( isset( revisr()->options['import_db'] ) ) { - revisr()->git->set_config( 'revisr', 'import-pulls', 'true' ); - } else { - revisr()->git->run( 'config', array( '--unset-all', 'revisr.import-pulls' ) ); - } - } - - printf( - '

            -

            -

            %s

            ', - checked( revisr()->git->get_config( 'revisr', 'import-checkouts' ), 'true', false ), - __( 'Import database when changing branches?', 'revisr' ), - checked( revisr()->git->get_config( 'revisr', 'import-pulls' ), 'true', false ), - __( 'Import database when pulling commits?', 'revisr' ), - __( 'If checked, Revisr will automatically import the above tracked tables while pulling from or checking out a branch. The tracked tables will be backed up beforehand to provide a restore point immediately prior to the import. Use this feature with caution and only after verifying that you have a full backup of your website.', 'revisr' ) - ); - } -} diff --git a/wp-content/plugins/revisr/classes/class-revisr-settings.php b/wp-content/plugins/revisr/classes/class-revisr-settings.php deleted file mode 100644 index 27277fbe..00000000 --- a/wp-content/plugins/revisr/classes/class-revisr-settings.php +++ /dev/null @@ -1,226 +0,0 @@ -settings_fields = new Revisr_Settings_Fields(); - } - - /** - * Initialize the settings. - * @access public - */ - public function init_settings() { - $this->revisr_add_settings_sections(); - $this->revisr_add_settings_fields(); - $this->revisr_register_settings(); - } - - /** - * Registers the settings sections. - * @access public - */ - public function revisr_add_settings_sections() { - add_settings_section( - 'revisr_general_settings', - 'General Settings', - array( $this->settings_fields, 'revisr_general_settings_callback' ), - 'revisr_general_settings' - ); - add_settings_section( - 'revisr_remote_settings', - 'Repository Settings', - array( $this->settings_fields, 'revisr_remote_settings_callback' ), - 'revisr_remote_settings' - ); - add_settings_section( - 'revisr_database_settings', - 'Database Settings', - array( $this->settings_fields, 'revisr_database_settings_callback' ), - 'revisr_database_settings' - ); - } - - /** - * Registers the settings fields. - * @access public - */ - public function revisr_add_settings_fields() { - add_settings_field( - 'username', - __( 'Git Username', 'revisr' ), - array( $this->settings_fields, 'username_callback' ), - 'revisr_general_settings', - 'revisr_general_settings' - ); - add_settings_field( - 'email', - __( 'Git Email', 'revisr'), - array( $this->settings_fields, 'email_callback' ), - 'revisr_general_settings', - 'revisr_general_settings' - ); - add_settings_field( - 'git_path', - __( 'Git Path', 'revisr' ), - array( $this->settings_fields, 'git_path_callback' ), - 'revisr_general_settings', - 'revisr_general_settings' - ); - add_settings_field( - 'gitignore', - __( 'Files/Directories to ignore', 'revisr'), - array( $this->settings_fields, 'gitignore_callback' ), - 'revisr_general_settings', - 'revisr_general_settings' - ); - add_settings_field( - 'automatic_backups', - __( 'Automatic backup schedule', 'revisr' ), - array( $this->settings_fields, 'automatic_backups_callback' ), - 'revisr_general_settings', - 'revisr_general_settings' - ); - add_settings_field( - 'notifications', - __( 'Enable email notifications?', 'revisr' ), - array( $this->settings_fields, 'notifications_callback' ), - 'revisr_general_settings', - 'revisr_general_settings' - ); - add_settings_field( - 'uninstall_on_delete', - __( 'Remove data on uninstall?', 'revisr' ), - array( $this->settings_fields, 'uninstall_on_delete_callback' ), - 'revisr_general_settings', - 'revisr_general_settings' - ); - add_settings_field( - 'remote_name', - __( 'Remote Name', 'revisr'), - array( $this->settings_fields, 'remote_name_callback' ), - 'revisr_remote_settings', - 'revisr_remote_settings' - ); - add_settings_field( - 'remote_url', - __( 'Remote URL', 'revisr'), - array( $this->settings_fields, 'remote_url_callback' ), - 'revisr_remote_settings', - 'revisr_remote_settings' - ); - add_settings_field( - 'webhook_url', - __( 'Revisr Webhook URL', 'revisr' ), - array( $this->settings_fields, 'webhook_url_callback' ), - 'revisr_remote_settings', - 'revisr_remote_settings' - ); - add_settings_field( - 'auto_push', - __( 'Automatically push new commits?', 'revisr' ), - array( $this->settings_fields, 'auto_push_callback' ), - 'revisr_remote_settings', - 'revisr_remote_settings' - ); - add_settings_field( - 'auto_pull', - __( 'Automatically pull new commits?', 'revisr' ), - array( $this->settings_fields, 'auto_pull_callback' ), - 'revisr_remote_settings', - 'revisr_remote_settings' - ); - add_settings_field( - 'tracked_tables', - __( 'Database tables to track', 'revisr' ), - array( $this->settings_fields, 'tracked_tables_callback' ), - 'revisr_database_settings', - 'revisr_database_settings' - ); - add_settings_field( - 'reset_db', - __( 'Import Options', 'revisr' ), - array( $this->settings_fields, 'reset_db_callback' ), - 'revisr_database_settings', - 'revisr_database_settings' - ); - add_settings_field( - 'development_url', - __( 'Development URL', 'revisr'), - array( $this->settings_fields, 'development_url_callback' ), - 'revisr_database_settings', - 'revisr_database_settings' - ); - add_settings_field( - 'db_driver', - __( 'Database Driver', 'revisr' ), - array( $this->settings_fields, 'db_driver_callback' ), - 'revisr_database_settings', - 'revisr_database_settings' - ); - add_settings_field( - 'mysql_path', - __( 'Path to MySQL', 'revisr' ), - array( $this->settings_fields, 'mysql_path_callback' ), - 'revisr_database_settings', - 'revisr_database_settings' - ); - } - - /** - * Register the settings fields with WordPress. - * @access public - */ - public function revisr_register_settings() { - register_setting( - 'revisr_general_settings', - 'revisr_general_settings' - ); - register_setting( - 'revisr_remote_settings', - 'revisr_remote_settings', - array( $this, 'sanitize_remote' ) - ); - register_setting( - 'revisr_database_settings', - 'revisr_database_settings' - ); - } - - /** - * Sanitizes the "Remote Settings" fields so that URL's can be stored. - * @access public - * @param array $input The data from the form. - * @return array - */ - public function sanitize_remote( $input ) { - if ( isset( $input['webhook_url'] ) ) { - $input['webhook_url'] = urlencode( $input['webhook_url'] ); - } - return $input; - } - -} diff --git a/wp-content/plugins/revisr/classes/index.php b/wp-content/plugins/revisr/classes/index.php deleted file mode 100644 index 8142269b..00000000 --- a/wp-content/plugins/revisr/classes/index.php +++ /dev/null @@ -1 +0,0 @@ -\n" -"Language-Team: LANGUAGE \n" - -#: classes/class-revisr-activity-table.php:57 -msgid "Events per page" -msgstr "" - -#: classes/class-revisr-activity-table.php:80 -msgid "All Events" -msgstr "" - -#: classes/class-revisr-activity-table.php:81 -#: classes/class-revisr-admin-pages.php:39 -#: classes/class-revisr-admin-pages.php:45 templates/pages/dashboard.php:80 -msgid "Branches" -msgstr "" - -#: classes/class-revisr-activity-table.php:82 -#: classes/class-revisr-admin-pages.php:36 templates/pages/commits.php:26 -msgid "Commits" -msgstr "" - -#: classes/class-revisr-activity-table.php:83 -msgid "Database Backups" -msgstr "" - -#: classes/class-revisr-activity-table.php:84 -msgid "Database Imports" -msgstr "" - -#: classes/class-revisr-activity-table.php:85 -msgid "File Discards" -msgstr "" - -#: classes/class-revisr-activity-table.php:86 -msgid "Pushes" -msgstr "" - -#: classes/class-revisr-activity-table.php:87 -msgid "Pulls" -msgstr "" - -#: classes/class-revisr-activity-table.php:91 -msgid "All Users" -msgstr "" - -#: classes/class-revisr-activity-table.php:105 -#: classes/class-revisr-commits-table.php:400 -msgid "All Time" -msgstr "" - -#: classes/class-revisr-activity-table.php:106 -#: classes/class-revisr-commits-table.php:401 -msgid "Last 12 Hours" -msgstr "" - -#: classes/class-revisr-activity-table.php:107 -#: classes/class-revisr-commits-table.php:402 -msgid "Last 24 Hours" -msgstr "" - -#: classes/class-revisr-activity-table.php:108 -#: classes/class-revisr-commits-table.php:403 -msgid "Last Week" -msgstr "" - -#: classes/class-revisr-activity-table.php:109 -#: classes/class-revisr-commits-table.php:404 -msgid "Last Month" -msgstr "" - -#: classes/class-revisr-activity-table.php:112 -msgid "Filter" -msgstr "" - -#: classes/class-revisr-activity-table.php:116 -msgid "Reset" -msgstr "" - -#: classes/class-revisr-activity-table.php:151 -#: classes/class-revisr-commits-table.php:202 -msgid "%s ago" -msgstr "" - -#: classes/class-revisr-activity-table.php:167 -msgid "Event" -msgstr "" - -#: classes/class-revisr-activity-table.php:168 -msgid "User" -msgstr "" - -#: classes/class-revisr-activity-table.php:169 -msgid "Time" -msgstr "" - -#: classes/class-revisr-activity-table.php:391 -msgid "1 item" -msgid_plural "%s items" -msgstr[0] "" -msgstr[1] "" - -#: classes/class-revisr-activity-table.php:416 -msgid "Your recent activity will show up here." -msgstr "" - -#: classes/class-revisr-admin-pages.php:34 -#: classes/class-revisr-admin-pages.php:35 -#: classes/class-revisr-admin-pages.php:44 -msgid "Dashboard" -msgstr "" - -#. #-#-#-#-# plugin.pot (Revisr 2.0) #-#-#-#-# -#. Plugin Name of the plugin/theme -#: classes/class-revisr-admin-pages.php:34 -#: classes/class-revisr-admin-pages.php:43 -msgid "Revisr" -msgstr "" - -#: classes/class-revisr-admin-pages.php:35 -#: classes/class-revisr-admin-pages.php:44 templates/pages/dashboard.php:36 -msgid "Revisr - Dashboard" -msgstr "" - -#: classes/class-revisr-admin-pages.php:36 -msgid "Revisr - Commits" -msgstr "" - -#: classes/class-revisr-admin-pages.php:37 -msgid "Revisr - New Commit" -msgstr "" - -#: classes/class-revisr-admin-pages.php:37 templates/pages/new-commit.php:20 -msgid "New Commit" -msgstr "" - -#: classes/class-revisr-admin-pages.php:38 -msgid "Revisr - View Commit" -msgstr "" - -#: classes/class-revisr-admin-pages.php:38 templates/pages/view-commit.php:24 -msgid "View Commit" -msgstr "" - -#: classes/class-revisr-admin-pages.php:39 -#: classes/class-revisr-admin-pages.php:45 templates/pages/branches.php:23 -msgid "Revisr - Branches" -msgstr "" - -#: classes/class-revisr-admin-pages.php:40 -#: classes/class-revisr-admin-pages.php:46 templates/pages/settings.php:20 -msgid "Revisr - Settings" -msgstr "" - -#: classes/class-revisr-admin-pages.php:40 -#: classes/class-revisr-admin-pages.php:46 -#: classes/class-revisr-admin-pages.php:291 -msgid "Settings" -msgstr "" - -#: classes/class-revisr-admin-pages.php:41 -msgid "Revisr - Setup" -msgstr "" - -#: classes/class-revisr-admin-pages.php:43 -msgid "Revisr Setup" -msgstr "" - -#: classes/class-revisr-admin-pages.php:88 -msgid "Session Expired: Please click here to log in again." -msgstr "" - -#: classes/class-revisr-admin-pages.php:106 -msgid "Please select..." -msgstr "" - -#: classes/class-revisr-admin-pages.php:117 -msgid "View Diff" -msgstr "" - -#: classes/class-revisr-admin-pages.php:231 -msgid "%d Untracked File" -msgid_plural "%d Untracked Files" -msgstr[0] "" -msgstr[1] "" - -#: classes/class-revisr-admin-pages.php:243 -#: classes/class-revisr-commits-table.php:81 -msgid "Commit" -msgstr "" - -#: classes/class-revisr-admin-pages.php:277 -msgid "Sponsored by" -msgstr "" - -#: classes/class-revisr-admin.php:34 -msgid "" -"
            Click here " -"for more details, or try again." -msgstr "" - -#: classes/class-revisr-admin.php:126 -msgid "Revisr Bot" -msgstr "" - -#: classes/class-revisr-admin.php:159 -msgid "Click here for more details." -msgstr "" - -#: classes/class-revisr-admin.php:180 -msgid "There are currently no untracked files on branch %s." -msgstr "" - -#: classes/class-revisr-admin.php:184 -msgid "" -"There are currently %d untracked files on branch %s. Commit your changes to save them." -msgstr "" - -#: classes/class-revisr-admin.php:248 classes/class-revisr-git-callback.php:70 -msgid "Committed #%s to the local repository." -msgstr "" - -#: classes/class-revisr-admin.php:338 classes/class-revisr-cron.php:75 -#: classes/class-revisr-db.php:376 classes/class-revisr-remote.php:74 -msgid "Cheatin’ uh?" -msgstr "" - -#: classes/class-revisr-admin.php:357 -msgid "Processing..." -msgstr "" - -#: classes/class-revisr-branch-table.php:49 -msgid "Branches per page" -msgstr "" - -#: classes/class-revisr-branch-table.php:79 -msgid "Branch" -msgstr "" - -#: classes/class-revisr-branch-table.php:80 -msgid "Last Updated" -msgstr "" - -#: classes/class-revisr-branch-table.php:81 -#: classes/class-revisr-repositories-table.php:81 -msgid "Actions" -msgstr "" - -#: classes/class-revisr-branch-table.php:130 -msgid "(current branch)" -msgstr "" - -#: classes/class-revisr-branch-table.php:157 templates/pages/dashboard.php:107 -msgid "Checkout" -msgstr "" - -#: classes/class-revisr-branch-table.php:158 -msgid "Merge" -msgstr "" - -#: classes/class-revisr-branch-table.php:159 -msgid "Delete" -msgstr "" - -#: classes/class-revisr-branch-table.php:160 -#: templates/partials/checkout-remote-form.php:49 -msgid "Checkout Branch" -msgstr "" - -#: classes/class-revisr-branch-table.php:161 -#: templates/partials/merge-branch-form.php:36 -msgid "Merge Branch" -msgstr "" - -#: classes/class-revisr-branch-table.php:162 -#: templates/partials/delete-branch-form.php:43 -msgid "Delete Branch" -msgstr "" - -#: classes/class-revisr-branch-table.php:233 templates/pages/dashboard.php:114 -msgid "No branches found." -msgstr "" - -#: classes/class-revisr-branch-table.php:305 -msgid "Local Branches" -msgstr "" - -#: classes/class-revisr-branch-table.php:309 -msgid "Remote Branches" -msgstr "" - -#: classes/class-revisr-commits-table.php:49 -msgid "Commits per page" -msgstr "" - -#: classes/class-revisr-commits-table.php:80 -msgid "ID" -msgstr "" - -#: classes/class-revisr-commits-table.php:82 -msgid "Author" -msgstr "" - -#: classes/class-revisr-commits-table.php:83 -msgid "Date" -msgstr "" - -#: classes/class-revisr-commits-table.php:220 -msgid "View" -msgstr "" - -#: classes/class-revisr-commits-table.php:221 -#: classes/class-revisr-meta-boxes.php:233 -#: templates/partials/revert-form.php:53 -msgid "Revert" -msgstr "" - -#: classes/class-revisr-commits-table.php:231 -msgid "No commits found." -msgstr "" - -#: classes/class-revisr-commits-table.php:346 -msgid "All" -msgstr "" - -#: classes/class-revisr-commits-table.php:362 -msgid "Search Commits:" -msgstr "" - -#: classes/class-revisr-compatibility.php:183 -#: classes/class-revisr-git-callback.php:367 classes/class-revisr-git.php:467 -#: classes/class-revisr-git.php:536 -msgid "Unknown" -msgstr "" - -#: classes/class-revisr-compatibility.php:205 -msgid "Not Found" -msgstr "" - -#: classes/class-revisr-cron.php:27 -#: classes/class-revisr-settings-fields.php:195 -msgid "Weekly" -msgstr "" - -#: classes/class-revisr-cron.php:48 -msgid "%s backup - %s" -msgstr "" - -#: classes/class-revisr-cron.php:58 -msgid "The %s backup was successful." -msgstr "" - -#: classes/class-revisr-db-backup.php:115 -msgid "Error backing up the database." -msgstr "" - -#: classes/class-revisr-db-backup.php:119 -msgid "Successfully backed up the database." -msgstr "" - -#: classes/class-revisr-db-import.php:110 -msgid "Error importing the database." -msgstr "" - -#: classes/class-revisr-db-import.php:123 -msgid "Undo" -msgstr "" - -#: classes/class-revisr-db-import.php:128 -msgid "Successfully imported the database. %s" -msgstr "" - -#: classes/class-revisr-db-import.php:237 -msgid "Error updating the table: %s." -msgstr "" - -#: classes/class-revisr-db.php:138 -msgid "(%s MB)" -msgstr "" - -#: classes/class-revisr-db.php:385 -msgid "Database backup before revert to #%s." -msgstr "" - -#: classes/class-revisr-db.php:410 -msgid "" -"Successfully reverted the database to a previous commit. Undo" -msgstr "" - -#: classes/class-revisr-db.php:421 -msgid "Error reverting one or more database tables." -msgstr "" - -#: classes/class-revisr-db.php:434 -msgid "Something went wrong. Check your settings and try again." -msgstr "" - -#: classes/class-revisr-db.php:471 -msgid "" -"New database tables detected. Click here to view and import." -msgstr "" - -#: classes/class-revisr-db.php:495 -msgid "Backed up the database with Revisr." -msgstr "" - -#: classes/class-revisr-git-callback.php:42 -msgid "Checked out branch: %s." -msgstr "" - -#: classes/class-revisr-git-callback.php:43 -msgid "%s was switched to branch %s." -msgstr "" - -#: classes/class-revisr-git-callback.php:46 -msgid " - Branch Changed" -msgstr "" - -#: classes/class-revisr-git-callback.php:54 -msgid "" -"There was an error checking out the branch. Check your configuration and try " -"again." -msgstr "" - -#: classes/class-revisr-git-callback.php:74 -msgid "A new commit was made to the repository:
            #%s - %s" -msgstr "" - -#: classes/class-revisr-git-callback.php:75 -msgid " - New Commit" -msgstr "" - -#: classes/class-revisr-git-callback.php:98 -msgid "There was an error committing the changes to the local repository." -msgstr "" - -#: classes/class-revisr-git-callback.php:112 -msgid "Deleted branch %s." -msgstr "" - -#: classes/class-revisr-git-callback.php:114 -msgid "The branch \"%s\" on the repository for %s was deleted." -msgstr "" - -#: classes/class-revisr-git-callback.php:116 -msgid " - Branch Deleted" -msgstr "" - -#: classes/class-revisr-git-callback.php:206 -msgid "Successfully created a new repository." -msgstr "" - -#: classes/class-revisr-git-callback.php:225 -msgid "" -"Failed to initialize a new repository. Please make sure that Git is " -"installed on the server and that Revisr has write permissons to the " -"WordPress install." -msgstr "" - -#: classes/class-revisr-git-callback.php:238 -msgid "Successfully merged changes from branch %s into branch %s." -msgstr "" - -#: classes/class-revisr-git-callback.php:239 -msgid "Merged branch %s into branch %s." -msgstr "" - -#: classes/class-revisr-git-callback.php:254 -msgid "Error merging branch %s into %s." -msgstr "" - -#: classes/class-revisr-git-callback.php:255 -msgid "" -"There was an error merging branch %s into your current branch. The merge was " -"aborted to avoid conflicts." -msgstr "" - -#: classes/class-revisr-git-callback.php:270 -#: templates/partials/pull-form.php:51 -msgid "The local repository is already up-to-date with the remote repository." -msgstr "" - -#: classes/class-revisr-git-callback.php:278 -msgid "Pulled #%s from %s/%s." -msgstr "" - -#: classes/class-revisr-git-callback.php:283 -msgid "Successfully pulled %s commit from %s/%s." -msgid_plural "Successfully pulled %s commits from %s/%s." -msgstr[0] "" -msgstr[1] "" - -#: classes/class-revisr-git-callback.php:301 -msgid "" -"There was an error pulling from the remote repository. The local repository " -"could be ahead, or there may be an authentication issue." -msgstr "" - -#: classes/class-revisr-git-callback.php:303 -msgid "Error pulling changes from the remote repository." -msgstr "" - -#: classes/class-revisr-git-callback.php:312 -msgid "Successfully pushed %s commit to %s/%s." -msgid_plural "Successfully pushed %s commits to %s/%s." -msgstr[0] "" -msgstr[1] "" - -#: classes/class-revisr-git-callback.php:330 -msgid "" -"Error pushing to the remote repository. The remote repository could be " -"ahead, or there may be an authentication issue." -msgstr "" - -#: classes/class-revisr-git-callback.php:332 -msgid "Error pushing changes to the remote repository." -msgstr "" - -#: classes/class-revisr-git-callback.php:341 -msgid "Success!" -msgstr "" - -#: classes/class-revisr-git-callback.php:350 -msgid "Remote not found..." -msgstr "" - -#: classes/class-revisr-git.php:503 -msgid "Commit not found" -msgstr "" - -#: classes/class-revisr-git.php:537 -msgid "Committed" -msgstr "" - -#: classes/class-revisr-git.php:553 -msgid "Modified" -msgstr "" - -#: classes/class-revisr-git.php:555 classes/class-revisr-git.php:701 -msgid "Deleted" -msgstr "" - -#: classes/class-revisr-git.php:557 -msgid "Added" -msgstr "" - -#: classes/class-revisr-git.php:559 -msgid "Renamed" -msgstr "" - -#: classes/class-revisr-git.php:561 -msgid "Updated" -msgstr "" - -#: classes/class-revisr-git.php:563 -msgid "Copied" -msgstr "" - -#: classes/class-revisr-git.php:565 -msgid "Untracked" -msgstr "" - -#: classes/class-revisr-git.php:715 -msgid "" -"There was an error staging the files. Please check the settings and try " -"again." -msgstr "" - -#: classes/class-revisr-git.php:717 -msgid "Error staging files." -msgstr "" - -#: classes/class-revisr-git.php:774 -msgid "Updated .gitignore." -msgstr "" - -#: classes/class-revisr-meta-boxes.php:49 -msgid "Committed Files" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:50 -msgid "Commit Details" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:51 -msgid "Stage Changes" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:52 -msgid "Add Tag" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:53 -msgid "Save Commit" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:64 -msgid "" -"There are %s untracked files that can be added to this " -"commit." -msgstr "" - -#: classes/class-revisr-meta-boxes.php:66 -msgid "" -"Use the boxes below to select the files to include in this commit. Only " -"files in the \"Staged Files\" section will be included.
            Double-click " -"files marked as \"Modified\" to view the changes to the file.

            " -msgstr "" - -#: classes/class-revisr-meta-boxes.php:71 -msgid "Staged Files" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:85 -msgid "Unstage Selected" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:87 -msgid "Unstage All" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:94 -msgid "Unstaged Files" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:98 -msgid "Stage Selected" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:100 -msgid "Stage All" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:125 -msgid "" -"
            %s files were included in this commit. Double-click " -"files marked as \"Modified\" to view the changes in a diff." -msgstr "" - -#: classes/class-revisr-meta-boxes.php:144 -msgid "No files were included in this commit." -msgstr "" - -#: classes/class-revisr-meta-boxes.php:159 -msgid "Tag Name:" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:174 -#: classes/class-revisr-meta-boxes.php:241 -msgid "Status:" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:175 -msgid "Pending" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:179 -#: classes/class-revisr-meta-boxes.php:246 -msgid "Branch:" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:185 -msgid "Backup database?" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:195 -msgid "Push changes?" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:206 -msgid "Commit Changes" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:226 -msgid "M j, Y @ G:i" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:227 -msgid "Committed on: %s" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:230 -msgid "Error" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:231 -#: classes/class-revisr-meta-boxes.php:233 -msgid "Revert to this Commit" -msgstr "" - -#: classes/class-revisr-meta-boxes.php:256 -msgid "Tagged:" -msgstr "" - -#: classes/class-revisr-process.php:31 -msgid "" -"Thanks for installing Revisr! No Git repository was detected, click here to create one." -msgstr "" - -#: classes/class-revisr-process.php:111 -msgid "Created new branch: %s" -msgstr "" - -#: classes/class-revisr-process.php:171 -msgid "Discarded all uncommitted changes." -msgstr "" - -#: classes/class-revisr-process.php:172 -msgid "Successfully discarded any uncommitted changes." -msgstr "" - -#: classes/class-revisr-process.php:324 -msgid "Reverted to commit: #%s." -msgstr "" - -#: classes/class-revisr-process.php:335 -msgid "Reverted to commit #%s." -msgstr "" - -#: classes/class-revisr-process.php:336 -msgid "%s was reverted to commit #%s" -msgstr "" - -#: classes/class-revisr-process.php:338 -msgid " - Commit Reverted" -msgstr "" - -#: classes/class-revisr-process.php:376 -msgid "Oops! Revisr ran into an error rendering the diff." -msgstr "" - -#: classes/class-revisr-process.php:395 -msgid "Detailed error information not available." -msgstr "" - -#: classes/class-revisr-process.php:417 -msgid "Error retrieving the status of the repository." -msgstr "" - -#: classes/class-revisr-remote.php:102 -msgid "Error contacting webhook URL." -msgstr "" - -#: classes/class-revisr-remote.php:104 -msgid "Sent update request to the webhook." -msgstr "" - -#: classes/class-revisr-repositories-table.php:49 -msgid "Repositories per page" -msgstr "" - -#: classes/class-revisr-repositories-table.php:79 -#: templates/pages/branches.php:67 templates/pages/repositories.php:68 -msgid "Name" -msgstr "" - -#: classes/class-revisr-repositories-table.php:80 -#: templates/pages/repositories.php:74 -msgid "Path" -msgstr "" - -#: classes/class-revisr-repositories-table.php:150 -msgid "No repositories found." -msgstr "" - -#: classes/class-revisr-settings-fields.php:39 -msgid "" -"These settings configure the local repository, and may be required for " -"Revisr to work correctly." -msgstr "" - -#: classes/class-revisr-settings-fields.php:47 -msgid "" -"These settings are optional, and only need to be configured if you plan to " -"push your website to a remote repository like Bitbucket or Github." -msgstr "" - -#: classes/class-revisr-settings-fields.php:55 -msgid "" -"These settings configure how Revisr interacts with your database, if at all." -msgstr "" - -#: classes/class-revisr-settings-fields.php:79 -msgid "The username to commit with in Git." -msgstr "" - -#: classes/class-revisr-settings-fields.php:105 -msgid "" -"The email address associated to your Git username. Also used for " -"notifications (if enabled)." -msgstr "" - -#: classes/class-revisr-settings-fields.php:129 -msgid "If necessary, you can define the installation path to Git here." -msgstr "" - -#: classes/class-revisr-settings-fields.php:156 -msgid "" -"Add files or directories that you don't want to show up in Git here, one per " -"line.
            This will update the \".gitignore\" file for this repository." -msgstr "" - -#: classes/class-revisr-settings-fields.php:193 -#: classes/class-revisr-settings-fields.php:419 -msgid "None" -msgstr "" - -#: classes/class-revisr-settings-fields.php:194 -msgid "Daily" -msgstr "" - -#: classes/class-revisr-settings-fields.php:197 -msgid "" -"Automatic backups will backup both the files and database at the interval of " -"your choosing." -msgstr "" - -#: classes/class-revisr-settings-fields.php:220 -msgid "" -"Enabling notifications will send updates about new commits, pulls, and " -"pushes to the email address above." -msgstr "" - -#: classes/class-revisr-settings-fields.php:241 -msgid "" -"Check to delete all settings and history stored in the database when this " -"plugin is deleted. Settings in the .git/config will not be affected." -msgstr "" - -#: classes/class-revisr-settings-fields.php:265 -msgid "" -"Git sets this to \"origin\" by default when you clone a repository, and this " -"should be sufficient in most cases. If you've changed the remote name or " -"have more than one remote, you can specify that here." -msgstr "" - -#: classes/class-revisr-settings-fields.php:300 -msgid "" -"Useful if you need to authenticate over \"https://\" instead of SSH, or if " -"the remote has not already been set through Git." -msgstr "" - -#: classes/class-revisr-settings-fields.php:328 -msgid "" -"If you have Revisr installed on another server using the same repository," -"
            you can add the Revisr Webhook from that server here to trigger an " -"update when pushing." -msgstr "" - -#: classes/class-revisr-settings-fields.php:349 -msgid "Check to automatically push new commits to the remote repository." -msgstr "" - -#: classes/class-revisr-settings-fields.php:370 -msgid "" -"Check to generate the Revisr Webhook and allow Revisr to automatically pull " -"commits from a remote repository." -msgstr "" - -#: classes/class-revisr-settings-fields.php:380 -msgid "Revisr Webhook:" -msgstr "" - -#: classes/class-revisr-settings-fields.php:382 -msgid "" -"You can add the above webhook to Bitbucket, GitHub, or another instance of " -"Revisr to automatically update this repository." -msgstr "" - -#: classes/class-revisr-settings-fields.php:387 -msgid "" -"There was an error generating the webhook. Please make sure that Revisr has " -"write access to the \".git/config\" and try again." -msgstr "" - -#: classes/class-revisr-settings-fields.php:417 -msgid "All Tables" -msgstr "" - -#: classes/class-revisr-settings-fields.php:418 -msgid "Let me decide..." -msgstr "" - -#: classes/class-revisr-settings-fields.php:476 -msgid "" -"If you're importing the database from a seperate environment, enter the " -"WordPress Site URL for that environment here to replace all occurrences of " -"that URL with the current Site URL during import. This MUST match the " -"WordPress Site URL of the database being imported." -msgstr "" - -#: classes/class-revisr-settings-fields.php:493 -msgid "MySQL" -msgstr "" - -#: classes/class-revisr-settings-fields.php:494 -msgid "WordPress" -msgstr "" - -#: classes/class-revisr-settings-fields.php:496 -msgid "MySQL can be faster, but may not be available on some servers." -msgstr "" - -#: classes/class-revisr-settings-fields.php:532 -msgid "" -"Leave blank if the full path to MySQL has already been set on the server. " -"Some possible settings include:\n" -"\t\t\t

            For MAMP: /Applications/MAMP/Library/bin/
            \n" -"\t\t\tFor WAMP: C:\\wamp\\bin\\mysql\\mysql5.6.12\\bin\\ " -msgstr "" - -#: classes/class-revisr-settings-fields.php:564 -msgid "Import database when changing branches?" -msgstr "" - -#: classes/class-revisr-settings-fields.php:566 -msgid "Import database when pulling commits?" -msgstr "" - -#: classes/class-revisr-settings-fields.php:567 -msgid "" -"If checked, Revisr will automatically import the above tracked tables while " -"pulling from or checking out a branch. The tracked tables will be backed up " -"beforehand to provide a restore point immediately prior to the import. Use " -"this feature with caution and only after verifying that you have a full " -"backup of your website." -msgstr "" - -#: classes/class-revisr-settings.php:74 -msgid "Git Username" -msgstr "" - -#: classes/class-revisr-settings.php:81 -msgid "Git Email" -msgstr "" - -#: classes/class-revisr-settings.php:88 -msgid "Git Path" -msgstr "" - -#: classes/class-revisr-settings.php:95 -msgid "Files/Directories to ignore" -msgstr "" - -#: classes/class-revisr-settings.php:102 -msgid "Automatic backup schedule" -msgstr "" - -#: classes/class-revisr-settings.php:109 -msgid "Enable email notifications?" -msgstr "" - -#: classes/class-revisr-settings.php:116 -msgid "Remove data on uninstall?" -msgstr "" - -#: classes/class-revisr-settings.php:123 -msgid "Remote Name" -msgstr "" - -#: classes/class-revisr-settings.php:130 -msgid "Remote URL" -msgstr "" - -#: classes/class-revisr-settings.php:137 -msgid "Revisr Webhook URL" -msgstr "" - -#: classes/class-revisr-settings.php:144 -msgid "Automatically push new commits?" -msgstr "" - -#: classes/class-revisr-settings.php:151 -msgid "Automatically pull new commits?" -msgstr "" - -#: classes/class-revisr-settings.php:158 -msgid "Database tables to track" -msgstr "" - -#: classes/class-revisr-settings.php:165 -msgid "Import Options" -msgstr "" - -#: classes/class-revisr-settings.php:172 -msgid "Development URL" -msgstr "" - -#: classes/class-revisr-settings.php:179 -msgid "Database Driver" -msgstr "" - -#: classes/class-revisr-settings.php:186 -msgid "Path to MySQL" -msgstr "" - -#: revisr.php:106 revisr.php:114 -msgid "Cheatin’ huh?" -msgstr "" - -#: templates/pages/branches.php:29 -msgid "Successfully created branch: %s." -msgstr "" - -#: templates/pages/branches.php:33 -msgid "Failed to create the new branch." -msgstr "" - -#: templates/pages/branches.php:35 -msgid "Failed to create branch: %s (branch already exists)." -msgstr "" - -#: templates/pages/branches.php:40 -msgid "Successfully deleted branch: %s." -msgstr "" - -#: templates/pages/branches.php:44 -msgid "Failed to delete branch: %s." -msgstr "" - -#: templates/pages/branches.php:63 -msgid "Add New Branch" -msgstr "" - -#: templates/pages/branches.php:69 -msgid "The name of the new branch." -msgstr "" - -#: templates/pages/branches.php:73 -msgid "Checkout new branch?" -msgstr "" - -#: templates/pages/branches.php:76 -msgid "Create Branch" -msgstr "" - -#: templates/pages/commits.php:26 templates/pages/view-commit.php:24 -msgid "Add New" -msgstr "" - -#: templates/pages/dashboard.php:38 -msgid "Loading..." -msgstr "" - -#: templates/pages/dashboard.php:39 -msgid "Processing request..." -msgstr "" - -#: templates/pages/dashboard.php:63 -msgid "Quick Actions" -msgstr "" - -#: templates/pages/dashboard.php:65 -msgid "Save Changes" -msgstr "" - -#: templates/pages/dashboard.php:66 templates/partials/discard-form.php:30 -msgid "Discard Changes" -msgstr "" - -#: templates/pages/dashboard.php:67 -msgid "Backup Database" -msgstr "" - -#: templates/pages/dashboard.php:68 templates/partials/push-form.php:65 -msgid "Push Changes" -msgstr "" - -#: templates/pages/dashboard.php:68 -msgid "Push Changes " -msgstr "" - -#: templates/pages/dashboard.php:69 templates/partials/pull-form.php:58 -msgid "Pull Changes" -msgstr "" - -#: templates/pages/dashboard.php:76 -msgid "Branches/Tags" -msgstr "" - -#: templates/pages/dashboard.php:81 -msgid "Tags" -msgstr "" - -#: templates/pages/dashboard.php:100 -msgid "Checked Out" -msgstr "" - -#: templates/pages/dashboard.php:137 -msgid "No tags found." -msgstr "" - -#: templates/pages/dashboard.php:143 -msgid "Manage Branches" -msgstr "" - -#: templates/pages/dashboard.php:151 -msgid "Documentation" -msgstr "" - -#: templates/pages/dashboard.php:153 -msgid "Need help? Check out the improved documentation at %s." -msgstr "" - -#: templates/pages/dashboard.php:155 -msgid "© %d Expanded Fronts, LLC" -msgstr "" - -#: templates/pages/help.php:16 -msgid "Help and Troubleshooting" -msgstr "" - -#: templates/pages/help.php:18 -msgid "" -"Support is available on the plugin support forums." -msgstr "" - -#: templates/pages/help.php:20 -msgid "" -"Found a bug or have a feature request? Please open an issue on GitHub!" -msgstr "" - -#: templates/pages/help.php:30 -msgid "View Status" -msgstr "" - -#: templates/pages/new-commit.php:40 -msgid "Enter a message for your commit" -msgstr "" - -#: templates/pages/repositories.php:23 -msgid "Revisr - Repositories" -msgstr "" - -#: templates/pages/repositories.php:29 -msgid "Successfully created repository: %s." -msgstr "" - -#: templates/pages/repositories.php:33 -msgid "Failed to create the new repository." -msgstr "" - -#: templates/pages/repositories.php:35 -msgid "Failed to create repository: %s (repository already exists)." -msgstr "" - -#: templates/pages/repositories.php:40 -msgid "Successfully deleted repository: %s." -msgstr "" - -#: templates/pages/repositories.php:44 -msgid "Failed to delete repository: %s." -msgstr "" - -#: templates/pages/repositories.php:63 -msgid "Add New Repository" -msgstr "" - -#: templates/pages/repositories.php:70 -msgid "The name of the new repository." -msgstr "" - -#: templates/pages/repositories.php:76 -msgid "The full path to the repository." -msgstr "" - -#: templates/pages/repositories.php:81 -msgid "Create as submodule?" -msgstr "" - -#: templates/pages/repositories.php:84 -msgid "Create Repository" -msgstr "" - -#: templates/pages/settings.php:25 -msgid "" -"

            Settings updated successfully.

            " -msgstr "" - -#: templates/pages/settings.php:29 -msgid "" -"Successfully initialized a new repository. Please confirm the settings below " -"before creating your first commit." -msgstr "" - -#: templates/pages/settings.php:35 -msgid "General" -msgstr "" - -#: templates/pages/settings.php:36 -msgid "Remote" -msgstr "" - -#: templates/pages/settings.php:37 -msgid "Database" -msgstr "" - -#: templates/pages/settings.php:38 -msgid "Help" -msgstr "" - -#: templates/pages/setup.php:30 -msgid "Revisr - Installation" -msgstr "" - -#: templates/pages/setup.php:36 -msgid "Revisr has succesfully detected a Git repository." -msgstr "" - -#: templates/pages/setup.php:38 templates/pages/setup.php:212 -#: templates/pages/setup.php:291 -msgid "Continue to dashboard." -msgstr "" - -#: templates/pages/setup.php:44 -msgid "Thanks for installing Revisr!" -msgstr "" - -#: templates/pages/setup.php:64 -msgid "No Repository was detected." -msgstr "" - -#: templates/pages/setup.php:66 -msgid "Would you like to create a new one?" -msgstr "" - -#: templates/pages/setup.php:69 -msgid "Yes, create a new repository." -msgstr "" - -#: templates/pages/setup.php:70 -msgid "No, find an existing repository." -msgstr "" - -#: templates/pages/setup.php:71 -msgid "Skip setup..." -msgstr "" - -#: templates/pages/setup.php:77 -msgid "Next step..." -msgstr "" - -#: templates/pages/setup.php:82 -msgid "The install path to Git was not recognized." -msgstr "" - -#: templates/pages/setup.php:84 -msgid "Git was not detected on the server." -msgstr "" - -#: templates/pages/setup.php:87 -msgid "Please enter the install path to Git below and click \"Continue\"." -msgstr "" - -#: templates/pages/setup.php:92 -msgid "Continue" -msgstr "" - -#: templates/pages/setup.php:104 -msgid "What would you like to track?" -msgstr "" - -#: templates/pages/setup.php:107 -msgid "Everything" -msgstr "" - -#: templates/pages/setup.php:108 -msgid "Plugins, Themes, and Uploads" -msgstr "" - -#: templates/pages/setup.php:109 -msgid "A plugin or theme..." -msgstr "" - -#: templates/pages/setup.php:112 -msgid "Custom (REVISR_WORK_TREE)" -msgstr "" - -#: templates/pages/setup.php:121 -msgid "Please select a plugin or theme..." -msgstr "" - -#: templates/pages/setup.php:125 -msgid "Plugins" -msgstr "" - -#: templates/pages/setup.php:141 -msgid "Themes" -msgstr "" - -#: templates/pages/setup.php:154 -msgid "Revisr will try to create a repository in the following directory:" -msgstr "" - -#: templates/pages/setup.php:157 -msgid "Note: " -msgstr "" - -#: templates/pages/setup.php:157 -msgid "" -"You can always ignore specific files/directories within the repository later " -"by going to the Revisr Settings page." -msgstr "" - -#: templates/pages/setup.php:162 -msgid "Initialize Revisr" -msgstr "" - -#: templates/pages/setup.php:166 -msgid "Revisr wasn't able to automatically detect your repository." -msgstr "" - -#: templates/pages/setup.php:167 -msgid "Enter the path to the repository below to try to detect it manually." -msgstr "" - -#: templates/pages/setup.php:173 templates/pages/setup.php:223 -msgid "Go Back" -msgstr "" - -#: templates/pages/setup.php:174 templates/pages/setup.php:224 -msgid "Check path..." -msgstr "" - -#: templates/pages/setup.php:182 -msgid "Setup has been skipped for this session." -msgstr "" - -#: templates/pages/setup.php:183 -msgid "" -"If you want to permanently skip the setup, you can do so by adding the " -"following to your \"wp-config.php\" file:" -msgstr "" - -#: templates/pages/setup.php:187 -msgid "Continue to dashboard" -msgstr "" - -#: templates/pages/setup.php:210 -msgid "Repository detected succesfully." -msgstr "" - -#: templates/pages/setup.php:217 -msgid "Repository not found. Double-check the path and try again." -msgstr "" - -#: templates/pages/setup.php:281 -msgid "Attempting to create repository..." -msgstr "" - -#: templates/pages/setup.php:289 -msgid "Repository created successfully." -msgstr "" - -#: templates/pages/setup.php:293 -msgid "Error creating repository." -msgstr "" - -#: templates/pages/view-commit.php:28 -msgid "Committed files on branch %s." -msgstr "" - -#: templates/partials/checkout-remote-form.php:22 -msgid "" -"Revisr detected that local branch %s may already be " -"tracking remote branch %s.

            Do you want to checkout " -"local branch %s?" -msgstr "" - -#: templates/partials/checkout-remote-form.php:24 -msgid "" -"This will checkout remote branch %s into a new local branch " -"%s." -msgstr "" - -#: templates/partials/checkout-remote-form.php:36 -#: templates/partials/merge-branch-form.php:28 -msgid "Import tracked database tables" -msgstr "" - -#: templates/partials/checkout-remote-form.php:49 -#: templates/partials/delete-branch-form.php:43 -#: templates/partials/discard-form.php:30 -#: templates/partials/import-tables-form.php:37 -#: templates/partials/merge-branch-form.php:36 -#: templates/partials/pull-form.php:58 templates/partials/push-form.php:65 -#: templates/partials/revert-form.php:53 -msgid "Cancel" -msgstr "" - -#: templates/partials/delete-branch-form.php:28 -msgid "" -"Are you sure you want to delete this branch?
            This will delete all local " -"work on branch %s." -msgstr "" - -#: templates/partials/delete-branch-form.php:30 -msgid "Also delete this branch from the remote repository." -msgstr "" - -#: templates/partials/delete-branch-form.php:32 -msgid "Are you sure you want to delete the remote branch %s?" -msgstr "" - -#: templates/partials/discard-form.php:24 -msgid "Are you sure you want to discard your uncommitted changes?" -msgstr "" - -#: templates/partials/discard-form.php:25 -msgid "" -"This will delete any untracked files and reset the repository to the state " -"of your last commit." -msgstr "" - -#: templates/partials/import-tables-form.php:26 -msgid "" -"The following new tables were added to the repository, but not automatically " -"imported due to your tracking settings. Check any tables that you'd like to " -"import and click \"Import\" to continue." -msgstr "" - -#: templates/partials/import-tables-form.php:37 -msgid "Import" -msgstr "" - -#: templates/partials/merge-branch-form.php:17 -msgid "" -"This will merge changes from branch %s into the current " -"branch. In the event of conflicts, Revisr will keep the version from the " -"branch being merged in." -msgstr "" - -#: templates/partials/pull-form.php:37 -msgid "Are you sure you want to pull the following commits?" -msgstr "" - -#: templates/partials/push-form.php:31 -msgid "" -"Are you sure you sure you want to push all committed changes to the remote?" -msgstr "" - -#: templates/partials/push-form.php:35 -msgid "Are you sure you want to push the following commits?" -msgstr "" - -#: templates/partials/push-form.php:58 -msgid "" -"There are no commits to push to the remote. Would you like to make a new one?" -msgstr "" - -#: templates/partials/revert-form.php:28 -msgid "Are you sure you want to revert to this commit?" -msgstr "" - -#: templates/partials/revert-form.php:34 -msgid "Revert files" -msgstr "" - -#: templates/partials/revert-form.php:35 -msgid "Revert database" -msgstr "" - -#: templates/partials/revert-form.php:36 -msgid "Revert files and database" -msgstr "" - -#: tests/test-admin.php:25 -msgid "test_alert" -msgstr "" - -#. Plugin URI of the plugin/theme -msgid "https://revisr.io/" -msgstr "" - -#. Description of the plugin/theme -msgid "" -"A plugin that allows users to manage WordPress websites with Git " -"repositories." -msgstr "" - -#. Author of the plugin/theme -msgid "Expanded Fronts, LLC" -msgstr "" - -#. Author URI of the plugin/theme -msgid "http://expandedfronts.com/" -msgstr "" diff --git a/wp-content/plugins/revisr/readme.txt b/wp-content/plugins/revisr/readme.txt deleted file mode 100644 index e191faa3..00000000 --- a/wp-content/plugins/revisr/readme.txt +++ /dev/null @@ -1,287 +0,0 @@ -=== Revisr === -Contributors: ExpandedFronts, mattshaw -Tags: revisr, git, git management, revision tracking, revision, backup, database, database backup, database plugin, deploy, commit, bitbucket, github, version control -Requires at least: 3.9.2 -Tested up to: 4.4 -Stable tag: trunk -License: GPLv3 -License URI: http://www.gnu.org/licenses/gpl.html - -A simple plugin for managing your WordPress website with Git. - -== Description == - -Revisr allows you to manage your WordPress website with a Git repository. With Revisr, you can: - -* Track changes to your entire WordPress installation, or just the parts that you prefer -* Commit changes from within the WordPress dashboard -* Backup or restore your entire website in seconds -* Set up daily or weekly automatic backups -* Optionally push or pull changes to a remote repository, like Bitbucket or Github -* Test changes out before deploying them to another server -* Revert your website files and/or database to an earlier version -* Quickly discard any unwanted changes - -A must have plugin for deploying and managing WordPress using Git repositories. - - -== Installation == - -= Requirements = -* A web server with Git and WordPress installed -* The PHP exec() function enabled - -= Instructions = -* Unzip the plugin folder and upload it to the plugins directory of your WordPress installation. -* If the WordPress installation is not already in a Git repository, you will be able to create a new one in the Revisr Dashboard. -* Go to the Revisr settings page and adjust any settings as needed. - -= Notes = -Please verify that database backups are working before attempting to revert the database, especially if attempting to do so on a production website. Backups use the mysqldump command, supported by most hosts/environments. - -If you're using the HTTPS method to connect to the remote repository, the password for the remote repository will be stored in the '.git/config' file. You should take steps to prevent this from being publicly accessible. The following code added to a '.htaccess' file in the '.git/' directory will prevent public access: - -` -content: Deny from all -` - -If you're using NGINX, you'll have to update your configuration file with something similar to the following: -` -location ~ path/to/your-repo/.git { - deny all; -} -` - -This issue can be avoided entirely by using SSH to authenticate, which is recommended in most cases. If using SSH, you will need to generate a SSH key on the server and add it to the remote repository (Bitbucket and Github both support SSH). - -It is also adviseable to add Revisr to the .gitignore file via the settings page to make sure that reverts don't rollback any new functionality. - -== Frequently Asked Questions == - -= How does Revisr handle the database? = -You have complete control, and can decide whether you want to track the entire database, just certain tables, or if you don't want to track the database at all. Then, during a backup, the tracked database tables are exported via "mysqldump". When importing or restoring the database to an earlier commit, Revisr first takes a backup of the existing database, creating a restore point from immediately before the import that can be reverted to if needed. - -You can also set a "Development URL" that will be automatically replaced in the database during import- allowing for backups and restores that work on both your dev and live environments. - -= Why aren't my commits being pushed to Bitbucket/GitHub? = -This is either an authentication issue or the remote branch is ahead of yours. - -= Can I damage my site with this plugin? = -Care should be taken when dealing with upgrades that depend on the database. Taking verified backups before and after major changes is always recommended. - -== Screenshots == - -1. The main dashboard of Revisr. -2. Simple staging area that lets you decide what gets committed. -3. Easily view changes in files with Revisr's diffs. -4. A comprehensive history of your website, with unlimited restore points. - - -== Changelog == - -= 2.0.2 - December 9, 2015 = -* Fix: CSS fixes for WordPress 4.4 -* Fix: Broken settings link on "All Plugins" page - -= 2.0.1 - October 30, 2015 = -* Fix: Bug causing all files to be committed in some cases - -= 2.0 - October 27, 2015 = -* New: Commits are no longer stored in the database -* New: Setup wizard for when no repo is found -* New: View commits before pushing/pulling them -* New: View remote branches -* New: Sort/paginate branches -* New: Define installation path to Git from the settings page -* New: Action hooks and filters for extending Revisr -* New: Activity log can be filtered by age, event type, or username -* Tweak: Improved commit speed when there are no unstaged files -* Tweak: Include database backups in commit details -* Tweak: Improved general plugin performance -* Tweak: Improved file organization -* Tweak: Improved detection of unpushed commits -* Tweak: Improved information in the Help tab -* Tweak: Always show confirmation dialog before reverts -* Tweak: Removed unused bulk actions for commits -* Tweak: Refactored CSS/JS files -* Fix: PHP notice with saving the .gitignore -* Fix: Minor logging error when committing with "Backup DB" and "Push Changes" checked at the same time -* Fix: Committing a failed database backup -* Fix: Changing salts during a DB import logs a user out with no notification/error in Revisr -* Fix: Bug with the logged "Undo" URL for imports -* Fix: Bug with default sort order in the dashboard -* Fix: Conflict with BuddyPress - -= 1.9.5 = -* Added sizes to database tables for the "Let me decide..." option -* Added ability to search for commits by the 7-letter commit ID/hash -* Added link/filter for viewing tags on dashboard/commits page -* Improved plugin intiation -* Fixed bug with certain errors saved as an array when making a commit -* Fixed bug with first commit not showing correct branch -* Fixed bug with ".gitignore" not showing latest version of gitignore when updated outside of Revisr - -= 1.9.4 = -* Added support for sockets in the DB_HOST constant -* Fixed bug causing error on PHP 5.2 -* Fixed bug causing potential error with backups/imports on some systems - -= 1.9.3 = -* Added option to use WordPress instead of MySQL for backups and imports -* Added ability to backup the database through the "New Commit" screen without any pending files -* Added ability to change the amount of events per page on the Revisr dashboard -* Improved .gitignore functionality, automatically remove cached files from repository index -* Several bugfixes and security improvements - -= 1.9.2 = -* Improved error handling for commits, pushes, and pulls -* Fixed bug with saving Git username -* Fixed bug with PHP error reporting -* Fixed bug with push count when backing up DB and pushing at the same time -* Fixed CSS issue with viewing untracked tables after importing - -= 1.9.1 = -* Fixed bug with "Import Pushes" checkbox not showing after saving -* Fixed bug with saving some settings in Windows -* Fixed CSS issue when viewing a branch with no commits -* Small cleanup - -= 1.9 = -* Added support for multiple commit authors -* Added basic support for custom WordPress file structures -* Added support for PHP autoloading when available -* Added pagination to the "Recent Activity" table on the dashboard page -* Added "Debug" page to the "Revisr Settings" page -* Fixed bug with viewing diffs in Firefox, -* Fixed potential XSS and user escalation vulnerabilities, props @jdgrimes -* General UI improvements -* General performance improvements - -= 1.8.3 = -* Fixed bug with spaces in filename - -= 1.8.2 = -* Improved plugin performance -* Fixed bug with timezone on some sites -* Fixed bug with loading translation file -* Changed "Commit Changes" to read "Save Changes" -* Improved Remote URL validation - -= 1.8.1 = -* Fixed bug resulting from changes in WordPress 4.1 -* Fixed bug with storing webhook URL in some environments - -= 1.8 = -* Added ability to track individual database tables -* Added ability to import tracked database tables while pulling changes -* Added ability to run a safe search/replace on the database during import to support multiple environments (supports serialization) -* Added unique token to the webhook to improve security (existing webhooks will need to be updated) -* Added fallback to the WordPress database class if mysqldump is not available -* Moved backups to 'wp-content/uploads/revisr-backups/' (path may vary) and automatically generate .htaccess -* Updated pending files count to only show for admins -* Updated error handling for commits -* Small UI improvements - -= 1.7.2 = -* Tweaked permissions check to only check permissions if repository exists. - -= 1.7.1 = -* Fixed potential PHP notice with tags widget -* Fixed permissions to just check the ".git/" directory - -= 1.7 = -* Added ability to create a new repository if one does not already exist -* Added ability to create automatic daily or weekly backups -* Added ability to merge changes -* Added ability to add tags to commits -* Fixed bug with backing up the database when a port is used -* General improvements - -= 1.6.3 = -* Improvements to the list of committed files -* Small bugfixes - -= 1.6.2 = -* Added dedicated page for managing branches -* Database backups from the dashboard now automatically create new commits -* Fixed timezone bug on the dashboard -* Improvements to settings page -* Small UI improvements - -= 1.6.1 = -* Small UI improvements -* Changed Recent Activity to show 15 items -* Fixed bug with multi-site installations -* Fixed bug with reverting files - -= 1.6 = -* Added internationalization support -* Switched to human-friendly time diffs for Recent Activity -* Fixed bug causing dashboard to freeze in some environments -* Improved error handling -* Removed passthru() functions -* Code cleanup - -= 1.5.2 = -* Fixed bug with adding certain files -* Restricted access to super admins for multisite installations - -= 1.5.1 = -* Added support for remote DB hosts -* Fixed bug with deleting files - -= 1.5 = -* Improved commit interface, added ability to stage individual files -* Added ability to see and revert to changes pulled from a remote -* Added ability to set the name of the remotes (defaults to origin) -* Added ability to set the path to MySQL -* Improved compatibility for Mac and Windows -* Bugfixes and general cleanup - -= 1.4.1 = -* Added "Backup Database" button to the Quick Actions -* Added number of unpulled/unpushed commits to the Quick Action buttons -* Updated recent activity text - -= 1.4 = -* Added ability to automatically pull changes from Bitbucket or Github (enabled on the settings page) -* Fixed bug causing call_user_func() error in some enviornments (including Windows) -* Additional validation on Git commands -* Additional error handling -* Fixed bug with saving .gitignore -* Fixed potential bug with viewing pending files -* Minor cleanup - -= 1.3.2 = -* Bugfixes - -= 1.3.1 = -* Added error handling -* Commits are no longer automatically pushed by default. This can be changed in the plugin settings page. -* Fixed issue with .gitignore showing as a pending file - -= 1.3 = -* Added ability to track/revert changes to the database -* The commits listing now shows commits on the current branch by default -* Added basic compatibility check -* Added settings link to the plugin page - -= 1.2.1 = -* Minor bugfixes - -= 1.2 = -* Added ability to view the number of pending files in the admin bar -* Small cleanup, updated wording - -= 1.1 = -* Bugfixes and improvements -* Added ability to view changes in files from a previous commit - -= 1.0.2 = -* Minor bugfixes - -= 1.0.1 = -* Updated readme.txt - -= 1.0 = -* Initial commit diff --git a/wp-content/plugins/revisr/revisr.php b/wp-content/plugins/revisr/revisr.php deleted file mode 100644 index 7c7409ba..00000000 --- a/wp-content/plugins/revisr/revisr.php +++ /dev/null @@ -1,403 +0,0 @@ -. - */ - -// Prevent direct access. -if ( ! defined( 'ABSPATH' ) ) exit; - -/** - * The main Revisr class. Initializes the plugin and loads any - * required hooks and dependencies. - * - * @since 1.8.2 - */ -final class Revisr { - - /** - * Stores the current instance of Revisr. - * @var object - */ - private static $instance; - - /** - * Stores the Revisr_DB object. - * @var Revisr_DB - */ - public $db; - - /** - * Stores the Revisr_Git object. - * @var Revisr_Git - */ - public $git; - - /** - * Stores the Revisr_Activity_Table object. - * @var Revisr_Activity_Table - */ - public $activity_table; - - /** - * Stores the Revisr_Branch_Table object. - * @var Revisr_Branch_Table - */ - public $branch_table; - - /** - * Stores the Revisr_Commits_Table object. - * @var Revisr_Commits_Table - */ - public $commits_table; - - /** - * The name of the plugin. - * @var string - */ - public $plugin_name = 'revisr'; - - /** - * An array of user options and preferences. - * @var array - */ - public $options; - - /** - * Empty construct, use revisr() instead. - * @access private - */ - private function __construct() { - // Do nothing here. - } - - /** - * Prevent direct __clones by making the method private. - * @access private - */ - private function __clone() { - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'revisr' ), '1.8' ); - } - - /** - * Prevent direct unserialization by making the method private. - * @access private - */ - private function __wakeup() { - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'revisr' ), '1.8' ); - } - - /** - * Retrieves the current instance of the Revisr plugin, - * or create a new one if it doesn't already exist. - * @access public - * @since 1.8.2 - * @return object - */ - public static function get_instance() { - - if ( null == self::$instance ) { - - // Create the instance. - self::$instance = new self; - self::$instance->options = self::$instance->get_options(); - - // Define constants used by the plugin. - self::$instance->define_constants(); - - // Load the rest of the plugin. - add_action( 'after_setup_theme', array( __CLASS__, 'load_instance' ) ); - - } - - return self::$instance; - } - - /** - * Loads dependencies and initiates action hooks. - * @access public - */ - public static function load_instance() { - - // Load the classes via autoloader if available. - if ( function_exists( 'spl_autoload_register' ) ) { - spl_autoload_register( array( __CLASS__, 'autoload' ) ); - } else { - self::$instance->load_dependencies(); - } - - // Set the locale. - self::$instance->set_locale(); - - // Load any public-facing hooks. - self::$instance->load_public_hooks(); - - // Load any admin-side hooks. - if ( current_user_can( self::get_capability() ) && is_admin() ) { - self::$instance->load_admin_hooks(); - } - - // Fires after the plugin has loaded. - do_action( 'revisr_loaded' ); - - } - - /** - * Callback for spl_autoload_register. - * @access private - * @param string $class The class to load. - * @since 1.9 - */ - private static function autoload( $class ) { - $file = REVISR_PATH . 'classes/class-' . strtolower( str_replace( '_', '-', $class ) ) . '.php'; - if ( is_readable( $file ) ) { - require( $file ); - } - } - - /** - * Loads dependencies if autoloading is not enabled. - * @access private - */ - private function load_dependencies() { - - require_once REVISR_PATH . 'classes/class-revisr-i18n.php'; - require_once REVISR_PATH . 'classes/class-revisr-git.php'; - require_once REVISR_PATH . 'classes/class-revisr-admin.php'; - require_once REVISR_PATH . 'classes/class-revisr-remote.php'; - require_once REVISR_PATH . 'classes/class-revisr-db.php'; - require_once REVISR_PATH . 'classes/class-revisr-db-backup.php'; - require_once REVISR_PATH . 'classes/class-revisr-db-import.php'; - require_once REVISR_PATH . 'classes/class-revisr-git-callback.php'; - require_once REVISR_PATH . 'classes/class-revisr-cron.php'; - - // Classes that should only be loaded for admins. - if ( current_user_can( self::get_capability() ) && is_admin() ) { - require_once REVISR_PATH . 'classes/class-revisr-admin-pages.php'; - require_once REVISR_PATH . 'classes/class-revisr-compatibility.php'; - require_once REVISR_PATH . 'classes/class-revisr-process.php'; - require_once REVISR_PATH . 'classes/class-revisr-activity-table.php'; - require_once REVISR_PATH . 'classes/class-revisr-branch-table.php'; - require_once REVISR_PATH . 'classes/class-revisr-commits-table.php'; - require_once REVISR_PATH . 'classes/class-revisr-meta-boxes.php'; - require_once REVISR_PATH . 'classes/class-revisr-settings.php'; - require_once REVISR_PATH . 'classes/class-revisr-settings-fields.php'; - } - - } - - /** - * Defines the constants used by Revisr. - * @access private - */ - private function define_constants() { - // The base plugin file. - define( 'REVISR_FILE', __FILE__ ); - - // The full path used for includes. - define( 'REVISR_PATH', plugin_dir_path( REVISR_FILE ) ); - - // The URL of the plugin base directory. - define( 'REVISR_URL', plugin_dir_url( REVISR_FILE ) ); - - // The current version of the plugin. - define( 'REVISR_VERSION', '2.0.2' ); - } - - /** - * Sets the locale and loads any translation files. - * @access private - */ - private function set_locale() { - $revisr_i18n = new Revisr_i18n(); - $revisr_i18n->set_domain( $this->plugin_name ); - add_action( 'plugins_loaded', array( $revisr_i18n, 'load_plugin_textdomain' ) ); - } - - /** - * Loads any public-facing hooks. - * @access private - */ - private function load_public_hooks() { - $cron = new Revisr_Cron(); - add_filter( 'cron_schedules', array( $cron, 'revisr_schedules' ) ); - add_action( 'revisr_cron', array( $cron, 'run_automatic_backup' ) ); - add_action( 'admin_post_nopriv_revisr_update', array( $cron, 'run_autopull' ) ); - } - - /** - * Loads hooks used in the admin. - * @access private - */ - private function load_admin_hooks() { - - // Load necessary classes into the instance. - self::$instance->git = new Revisr_Git(); - self::$instance->db = new Revisr_DB(); - self::$instance->activity_table = new Revisr_Activity_Table(); - self::$instance->branch_table = new Revisr_Branch_Table(); - self::$instance->commits_table = new Revisr_Commits_Table(); - - // Create/configure custom admin pages and menus. - $admin_pages = new Revisr_Admin_Pages(); - add_action( 'admin_menu', array( $admin_pages, 'menus' ), 2 ); - add_action( 'admin_enqueue_scripts', array( $admin_pages, 'scripts' ) ); - add_filter( 'custom_menu_order', array( $admin_pages, 'submenu_order' ) ); - add_filter( 'parent_file', array( $admin_pages, 'parent_file' ) ); - add_action( 'admin_bar_menu', array( $admin_pages, 'admin_bar' ), 999 ); - add_action( 'admin_notices', array( $admin_pages, 'site5_notice' ) ); - add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $admin_pages, 'settings_link' ) ); - - // Load the thickbox forms used by Revisr. - add_action( 'admin_post_revisr_delete_branch_form', array( $admin_pages, 'include_form' ) ); - add_action( 'admin_post_revisr_merge_branch_form', array ( $admin_pages, 'include_form' ) ); - add_action( 'admin_post_revisr_import_tables_form', array( $admin_pages, 'include_form' ) ); - add_action( 'admin_post_revisr_revert_form', array( $admin_pages, 'include_form' ) ); - add_action( 'admin_post_revisr_discard_form', array( $admin_pages, 'include_form' ) ); - add_action( 'admin_post_revisr_push_form', array( $admin_pages, 'include_form' ) ); - add_action( 'admin_post_revisr_pull_form', array( $admin_pages, 'include_form' ) ); - add_action( 'admin_post_revisr_checkout_remote_form', array( $admin_pages, 'include_form' ) ); - - // Add custom meta boxes. - $meta_boxes = new Revisr_Meta_Boxes(); - add_action( 'load-admin_page_revisr_new_commit', array( $meta_boxes, 'add_meta_box_actions' ) ); - add_action( 'load-admin_page_revisr_view_commit', array( $meta_boxes, 'add_meta_box_actions' ) ); - add_action( 'admin_footer-admin_page_revisr_new_commit', array( $meta_boxes, 'init_meta_boxes' ) ); - add_action( 'add_meta_boxes_admin_page_revisr_new_commit', array( $meta_boxes, 'post_meta' ) ); - add_action( 'wp_ajax_pending_files', array( $meta_boxes, 'pending_files' ) ); - - // Callbacks for AJAX UI - $admin = new Revisr_Admin(); - add_action( 'wp_ajax_render_alert', array( 'Revisr_Admin', 'render_alert' ) ); - add_action( 'wp_ajax_ajax_button_count', array( $admin, 'ajax_button_count' ) ); - add_action( 'wp_ajax_verify_remote', array( self::$instance->git, 'verify_remote' ) ); - - // Update the database schema if necessary. - if ( get_option( 'revisr_db_version' ) !== '2.0' ) { - add_action( 'admin_init', array( $admin, 'do_upgrade' ) ); - } - - // Processes actions taken from within the WordPress dashboard. - $process = new Revisr_Process(); - add_action( 'init', array( $process, 'is_repo' ) ); - add_action( 'admin_post_process_commit', array( $process, 'commit' ) ); - add_action( 'admin_post_process_checkout', array( $process, 'checkout' ) ); - add_action( 'admin_post_process_create_branch', array( $process, 'create_branch' ) ); - add_action( 'admin_post_process_delete_branch', array( $process, 'delete_branch' ) ); - add_action( 'admin_post_process_merge', array( $process, 'merge' ) ); - add_action( 'admin_post_process_import', array( $process, 'import' ) ); - add_action( 'admin_post_init_repo', array( $process, 'init' ) ); - add_action( 'admin_post_process_revert', array( $process, 'revert' ) ); - add_action( 'admin_post_revisr_view_error', array( $process, 'view_error' ) ); - add_action( 'admin_post_process_view_status', array( $process, 'view_status' ) ); - add_action( 'admin_post_process_view_diff', array( $process, 'view_diff' ) ); - add_action( 'wp_ajax_process_view_diff', array( $process, 'view_diff' ) ); - add_action( 'wp_ajax_process_discard', array( $process, 'discard' ) ); - add_action( 'wp_ajax_process_push', array( $process, 'push' ) ); - add_action( 'wp_ajax_process_pull', array( $process, 'pull' ) ); - add_action( 'wp_ajax_backup_db', array( self::$instance->db, 'backup' ) ); - add_action( 'admin_post_revisr_download_sysinfo', array( $process, 'download_sysinfo' ) ); - - // Load the settings page. - $settings = new Revisr_Settings(); - add_action( 'admin_init', array( $settings, 'init_settings' ) ); - } - - /** - * Returns the name of the capability required to use Revisr. - * @access public - * @return string - */ - public static function get_capability() { - return apply_filters( 'manage_revisr', 'install_plugins' ); - } - - /** - * Returns an array of user options and preferences. - * @access public - * @return array - */ - public static function get_options() { - $deprecated = get_option( 'revisr_settings' ) ? get_option( 'revisr_settings' ) : array(); - $general = get_option( 'revisr_general_settings' ) ? get_option( 'revisr_general_settings' ) : array(); - $remote = get_option( 'revisr_remote_settings' ) ? get_option( 'revisr_remote_settings' ) : array(); - $database = get_option( 'revisr_database_settings' ) ? get_option( 'revisr_database_settings' ) : array(); - $options = array_merge( $deprecated, $general, $remote, $database ); - return $options; - } - - /** - * Returns the name of the custom table used by Revisr. - * @access public - * @return string - */ - public static function get_table_name() { - global $wpdb; - return esc_sql( $wpdb->prefix . 'revisr' ); - } - - /** - * Installs the database table. - * @access public - */ - public static function install() { - $table_name = Revisr::get_table_name(); - $sql = "CREATE TABLE {$table_name} ( - id mediumint(9) NOT NULL AUTO_INCREMENT, - time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, - message TEXT, - event VARCHAR(42) NOT NULL, - user VARCHAR(60), - UNIQUE KEY id (id) - );"; - - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); - dbDelta( $sql ); - - update_option( 'revisr_db_version', '2.0' ); - } - -} - -/** - * Returns a single instance of the Revisr plugin. - * - * @since 1.8.2 - * @return object - */ -function revisr() { - return Revisr::get_instance(); -} - -// Let's go! -revisr(); - -// Register the activation hook. -register_activation_hook( __FILE__, array( 'Revisr', 'install' ) ); diff --git a/wp-content/plugins/revisr/templates/index.php b/wp-content/plugins/revisr/templates/index.php deleted file mode 100644 index 8142269b..00000000 --- a/wp-content/plugins/revisr/templates/index.php +++ /dev/null @@ -1 +0,0 @@ -branch_table->prepare_items(); - -?> - -
            - -

            - -

            ' . $msg . '

            '; - break; - case "create_error": - $msg = __( 'Failed to create the new branch.', 'revisr' ); - if ( revisr()->git->is_branch( $_GET['branch'] ) ) { - $msg = sprintf( esc_html__( 'Failed to create branch: %s (branch already exists).', 'revisr' ), $_GET['branch'] ); - } - echo '

            ' . $msg . '

            '; - break; - case "delete_success": - $msg = sprintf( esc_html__( 'Successfully deleted branch: %s.', 'revisr' ), $_GET['branch'] ); - echo '

            ' . $msg . '

            '; - break; - case "delete_fail": - $msg = sprintf( esc_html__( 'Failed to delete branch: %s.', 'revisr' ), $_GET['branch'] ); - echo '

            ' . $msg . '

            '; - default: - // Do nothing. - } - } - ?> - -
            - -
            -
            - branch_table->display(); ?> -
            -
            - -
            - -
            -

            -
            -
            -
            - - -


            -
            -
            - - - - -

            -
            -
            -
            -
            -
            - -
            - - diff --git a/wp-content/plugins/revisr/templates/pages/commits.php b/wp-content/plugins/revisr/templates/pages/commits.php deleted file mode 100644 index 6800d608..00000000 --- a/wp-content/plugins/revisr/templates/pages/commits.php +++ /dev/null @@ -1,36 +0,0 @@ -commits_table->prepare_items(); - -// Gets current branches for filtering. -$branches = revisr()->git->get_branches(); - -?> - -
            - -

            - - commits_table->render_views(); ?> - -
            - - commits_table->render_search(); ?> - commits_table->display(); ?> -
            - -
            diff --git a/wp-content/plugins/revisr/templates/pages/dashboard.php b/wp-content/plugins/revisr/templates/pages/dashboard.php deleted file mode 100644 index 218689b0..00000000 --- a/wp-content/plugins/revisr/templates/pages/dashboard.php +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - -activity_table->prepare_items(); -?> - -
            -
            -

            -
            -

            - -
            - -
            -
            - - -
            -
            - -
            - - activity_table->display(); ?> -
            - -
            -
            - - -
            -
            - - -
            -

            -
            - - | - - | - | -
            -
            - - - -
            -

            -
            -
            -
              -
            • -
            • -
            -
            - - - git->get_branches(); - - if ( is_array( $branches ) && ! empty( $branches ) ) { - - foreach ( $branches as $key => $value ){ - - $branch = substr( $value, 2 ); - - if ( '*' === substr( $value, 0, 1 ) ) { - printf( '', - $branch, - __( 'Checked Out', 'revisr' ) - ); - } else { - $branch_url = wp_nonce_url( $admin_url . "admin-post.php?action=process_checkout&branch={$branch}", 'process_checkout', 'revisr_checkout_nonce' ); - printf( '', - $branch, - $branch_url, - __( 'Checkout', 'revisr' ) - ); - } - - } - - } else { - printf( '', __( 'No branches found.', 'revisr' ) ); - } - ?> -
            %s%s
            %s%s
            %s
            -
            - - - -
            -

            -
            - -
            - -
            - -
            - - -
            -

            -
            - http://docs.revisr.io' ); ?> -

            - -
            -
            - -
            -
            -
            -
            -
            -
            - - diff --git a/wp-content/plugins/revisr/templates/pages/help.php b/wp-content/plugins/revisr/templates/pages/help.php deleted file mode 100644 index 70e31434..00000000 --- a/wp-content/plugins/revisr/templates/pages/help.php +++ /dev/null @@ -1,40 +0,0 @@ - - -

            - -

            plugin support forums.', 'revisr' ); ?>

            - -

            GitHub!', 'revisr' ); ?>

            - -
            - -

            - - - - git->is_repo ) { - $status_text = __( 'View Status', 'revisr' ); - $status_nonce = wp_create_nonce( 'revisr_view_status' ); - printf( '%s', - get_admin_url() . 'admin-post.php?action=process_view_status&revisr_status_nonce=' . $status_nonce . '&TB_iframe=true', - $status_text, - $status_text - ); - } - ?> -

            -
            diff --git a/wp-content/plugins/revisr/templates/pages/index.php b/wp-content/plugins/revisr/templates/pages/index.php deleted file mode 100644 index 8142269b..00000000 --- a/wp-content/plugins/revisr/templates/pages/index.php +++ /dev/null @@ -1 +0,0 @@ - - -
            - -

            - - - -
            - - - - -
            - -
            - -
            -
            -
            - -
            -
            -
            - -
            - -
            - -
            - -
            - -
            - -
            - -
            - -
            diff --git a/wp-content/plugins/revisr/templates/pages/repositories.php b/wp-content/plugins/revisr/templates/pages/repositories.php deleted file mode 100644 index 3dc6db88..00000000 --- a/wp-content/plugins/revisr/templates/pages/repositories.php +++ /dev/null @@ -1,93 +0,0 @@ -repositories_table->prepare_items(); - -?> - -
            - -

            - -

            ' . $msg . '

            '; - break; - case "create_error": - $msg = __( 'Failed to create the new repository.', 'revisr' ); - if ( revisr()->git->is_repository( $_GET['repository'] ) ) { - $msg = sprintf( esc_html__( 'Failed to create repository: %s (repository already exists).', 'revisr' ), $_GET['repository'] ); - } - echo '

            ' . $msg . '

            '; - break; - case "delete_success": - $msg = sprintf( esc_html__( 'Successfully deleted repository: %s.', 'revisr' ), $_GET['repository'] ); - echo '

            ' . $msg . '

            '; - break; - case "delete_fail": - $msg = sprintf( esc_html__( 'Failed to delete repository: %s.', 'revisr' ), $_GET['repository'] ); - echo '

            ' . $msg . '

            '; - default: - // Do nothing. - } - } - ?> - -
            - -
            -
            - repositories_table->display(); ?> -
            -
            - -
            - -
            -

            -
            -
            - -
            - - -


            -
            - -
            - - -


            -
            - -
            - - - - -

            -
            -
            -
            -
            -
            - -
            - - diff --git a/wp-content/plugins/revisr/templates/pages/settings.php b/wp-content/plugins/revisr/templates/pages/settings.php deleted file mode 100644 index 378a9c09..00000000 --- a/wp-content/plugins/revisr/templates/pages/settings.php +++ /dev/null @@ -1,73 +0,0 @@ - -
            -
            -

            - -

            Settings updated successfully.

            ', 'revisr' ); - } - if ( isset( $_GET['init'] ) && $_GET['init'] == 'success' ) { - printf( '

            %s

            ', - __( 'Successfully initialized a new repository. Please confirm the settings below before creating your first commit.', 'revisr' ) - ); - } - ?> - - - -
            - -
            -
            - diff --git a/wp-content/plugins/revisr/templates/pages/setup.php b/wp-content/plugins/revisr/templates/pages/setup.php deleted file mode 100644 index 4247699d..00000000 --- a/wp-content/plugins/revisr/templates/pages/setup.php +++ /dev/null @@ -1,306 +0,0 @@ - - -
            - -
            - -
            - - - -

            - - git->is_repo ): ?> - - %s
            %s

            ', - __( 'Revisr has succesfully detected a Git repository.', 'revisr' ), - get_admin_url( null, 'admin.php?page=revisr' ), - __( 'Continue to dashboard.', 'revisr' ) - ); - ?> - - - - - - git->git_path = $path; - } - - ?> - - git->run( 'version', array() ) ): ?> - -

            - -

            - - - -

            - - - - - - - -

            - -

            - - -

            - - - -

            - - - - -

            - - - - - - - -

            - - - -

            - - - -

            - - - %s%s

            ', __( 'Note: ', 'revisr' ), __( 'You can always ignore specific files/directories within the repository later by going to the Revisr Settings page.', 'revisr' ) ); ?> - -

            - - - - - - -

            -

            - - - - -
            - - -
            -
            - - - - - -

            -

            - -
            define( 'REVISR_SKIP_SETUP', true );
            - - %s

            ', get_admin_url( null, 'admin.php?page=revisr' ), __( 'Continue to dashboard', 'revisr' ) ); ?> - - - - git->work_tree = $dir; - - if ( ! defined( 'REVISR_GIT_DIR' ) ) { - revisr()->git->git_dir = $dir . '/.git'; - } - - if ( revisr()->git->check_work_tree( $dir ) ) { - - // Write it to the wp-config file if necessary. - $line = "define('REVISR_WORK_TREE', '$dir');"; - Revisr_Admin::replace_config_line( 'define *\( *\'REVISR_WORK_TREE\'', $line ); - - Revisr_Admin::clear_transients(); - - printf( '

            %s


            %s', - __( 'Repository detected succesfully.', 'revisr' ), - get_admin_url() . 'admin.php?page=revisr', - __( 'Continue to dashboard.', 'revisr' ) - ); - - } else { - ?> -

            - - - - -
            - - -
            -
            - - - - - - - - - - - git = new Revisr_Git; - - // Create the .gitignore file BEFORE repo creation. - $gitignore_file = revisr()->git->get_work_tree() . DIRECTORY_SEPARATOR . '.gitignore'; - if ( ! file_exists( $gitignore_file ) && ! empty( $gitignore ) ) { - file_put_contents( $gitignore_file, implode( PHP_EOL, $gitignore ) ); - } - - ?> - -

            - - git->init_repo() ) { - printf( '

            %s


            %s', - __( 'Repository created successfully.', 'revisr' ), - get_admin_url( null, 'admin.php?page=revisr' ), - __( 'Continue to dashboard.') ); - } else { - printf( '

            %s

            ', __( 'Error creating repository.', 'revisr' ) ); - } - - ?> - - - - - -
            - -
            - -
            diff --git a/wp-content/plugins/revisr/templates/pages/view-commit.php b/wp-content/plugins/revisr/templates/pages/view-commit.php deleted file mode 100644 index ea804853..00000000 --- a/wp-content/plugins/revisr/templates/pages/view-commit.php +++ /dev/null @@ -1,68 +0,0 @@ - - -
            - -

            - - %s.', 'revisr' ), revisr()->git->branch ); - echo '

            ' . $msg . '

            '; - } - ?> - -
            - - - - -
            - -
            - -
            -
            -
            - -
            -
            -
            - -
            - -
            - -
            - -
            - -
            - -
            - -
            - -
            diff --git a/wp-content/plugins/revisr/templates/partials/checkout-remote-form.php b/wp-content/plugins/revisr/templates/partials/checkout-remote-form.php deleted file mode 100644 index c3fdf9b8..00000000 --- a/wp-content/plugins/revisr/templates/partials/checkout-remote-form.php +++ /dev/null @@ -1,52 +0,0 @@ -git->current_remote() ) + 1 ); - -if ( revisr()->git->is_branch( $local ) ) { - $text = sprintf( __( 'Revisr detected that local branch %s may already be tracking remote branch %s.

            Do you want to checkout local branch %s?', 'revisr' ), $local, $remote, $local ); -} else { - $text = sprintf( __( 'This will checkout remote branch %s into a new local branch %s.', 'revisr' ), $remote, $local ); -} - -?> - - - -
            - -
            -

            - git->get_config( 'revisr', 'import-checkouts' ), 'true' ); ?> /> - -
            - -
            - - - git->is_branch( $local ) ): ?> - - - - - - - -
            - -
            diff --git a/wp-content/plugins/revisr/templates/partials/delete-branch-form.php b/wp-content/plugins/revisr/templates/partials/delete-branch-form.php deleted file mode 100644 index beaa7e79..00000000 --- a/wp-content/plugins/revisr/templates/partials/delete-branch-form.php +++ /dev/null @@ -1,46 +0,0 @@ - - - - -
            - -
            - - -

            This will delete all local work on branch %s.', 'revisr' ), $branch ); ?>

            - - - -

            %s?', 'revisr' ), $branch ); ?>

            - - git->current_remote() ) + 1 ); ?> - - -
            - -
            - - - - -
            - -
            diff --git a/wp-content/plugins/revisr/templates/partials/discard-form.php b/wp-content/plugins/revisr/templates/partials/discard-form.php deleted file mode 100644 index df99214b..00000000 --- a/wp-content/plugins/revisr/templates/partials/discard-form.php +++ /dev/null @@ -1,32 +0,0 @@ - - - - -
            - -

            -

            - -
            - -
            - -
            - diff --git a/wp-content/plugins/revisr/templates/partials/import-tables-form.php b/wp-content/plugins/revisr/templates/partials/import-tables-form.php deleted file mode 100644 index 6f7eea48..00000000 --- a/wp-content/plugins/revisr/templates/partials/import-tables-form.php +++ /dev/null @@ -1,40 +0,0 @@ -db->get_tables_not_in_db(); - -?> - - - -
            - -
            -

            -
            "; - } - ?> -
            - -
            - - - -
            - -
            diff --git a/wp-content/plugins/revisr/templates/partials/index.php b/wp-content/plugins/revisr/templates/partials/index.php deleted file mode 100644 index 8142269b..00000000 --- a/wp-content/plugins/revisr/templates/partials/index.php +++ /dev/null @@ -1 +0,0 @@ -%s into the current branch. In the event of conflicts, Revisr will keep the version from the branch being merged in.', 'revisr' ), esc_html( $_GET['branch'] ) ); - -?> - - - -
            - -
            -

            - - -
            - -
            - - - - - -
            - -
            diff --git a/wp-content/plugins/revisr/templates/partials/pull-form.php b/wp-content/plugins/revisr/templates/partials/pull-form.php deleted file mode 100644 index cba8d3d1..00000000 --- a/wp-content/plugins/revisr/templates/partials/pull-form.php +++ /dev/null @@ -1,61 +0,0 @@ -git->run( 'log', array( revisr()->git->branch . '..' . revisr()->git->remote . '/' . revisr()->git->branch, '--format=%h - %s' ) ); - -// If none are detected, do an extra fetch, just to be sure. -if ( is_array( $unpulled ) && 0 === count( $unpulled ) ) { - revisr()->git->fetch(); - $unpulled = revisr()->git->run( 'log', array( revisr()->git->branch . '..' . revisr()->git->remote . '/' . revisr()->git->branch, '--format=%h - %s' ) ); -} - -?> - - - -
            - -
            - - - -

            - -
              - - - -
            • - - - -
            - - - -

            - - - -
            - -
            - -
            - -
            diff --git a/wp-content/plugins/revisr/templates/partials/push-form.php b/wp-content/plugins/revisr/templates/partials/push-form.php deleted file mode 100644 index 2d66eedd..00000000 --- a/wp-content/plugins/revisr/templates/partials/push-form.php +++ /dev/null @@ -1,68 +0,0 @@ -git->run( 'log', array( revisr()->git->branch, '--not', '--remotes', '--oneline' ) ); - -?> - - - -
            - -
            - - git->has_remote() ): ?> - -

            - - - -

            - -
              - - - - ' . $hash . ''; - $title = substr( $commit, 7 ); - - $commit_li = $link . $title; - ?> - -
            • - - - -
            - - - -

            - - - -
            - -
            - -
            - -
            diff --git a/wp-content/plugins/revisr/templates/partials/revert-form.php b/wp-content/plugins/revisr/templates/partials/revert-form.php deleted file mode 100644 index e145dd4a..00000000 --- a/wp-content/plugins/revisr/templates/partials/revert-form.php +++ /dev/null @@ -1,57 +0,0 @@ - - - - -
            - -
            - -

            - -

            - - -

            - -

            - - - - - - -
            - -
            - - - - - - -
            - -
            - diff --git a/wp-content/plugins/revisr/uninstall.php b/wp-content/plugins/revisr/uninstall.php deleted file mode 100644 index c4e471c5..00000000 --- a/wp-content/plugins/revisr/uninstall.php +++ /dev/null @@ -1,48 +0,0 @@ -options['uninstall_on_delete'] ) { - - // Remove any set crons. - wp_clear_scheduled_hook( 'revisr_cron' ); - - // Remove any set options. - delete_option( 'revisr_settings' ); - delete_option( 'revisr_general_settings' ); - delete_option( 'revisr_remote_settings' ); - delete_option( 'revisr_database_settings' ); - - // Remove any set transients. - delete_transient( 'revisr_error_details' ); - delete_transient( 'revisr_error' ); - delete_transient( 'revisr_alert' ); - delete_transient( 'revisr_skip_setup' ); - - // Delete any commits. - $commits = get_posts( array( 'post_type' => 'revisr_commits', 'post_status' => 'any', 'number_posts' => -1, 'fields' => 'ids' ) ); - foreach ( $commits as $commit ) { - wp_delete_post( $commit, true ); - } - - // Drop the Revisr database table. - global $wpdb; - $table_name = $wpdb->prefix . 'revisr'; - $sql = "DROP TABLE $table_name"; - $wpdb->query( $sql ); - -}